@nivaro/react 0.3.56 → 0.3.57

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.
@@ -1,40 +1,40 @@
1
- import { jsxs as d, Fragment as Ce, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as d, Fragment as qe, jsx as a } from "react/jsx-runtime";
2
2
  import { useSensors as no, useSensor as ro, PointerSensor as ao, DndContext as lo, closestCenter as oo } from "@dnd-kit/core";
3
3
  import { SortableContext as so, verticalListSortingStrategy as io, arrayMove as co, useSortable as uo } from "@dnd-kit/sortable";
4
4
  import { CSS as mo } from "@dnd-kit/utilities";
5
- import { useQueryClient as po, useQuery as W, useMutation as Se, useQueries as Be } from "@tanstack/react-query";
6
- import { AlertTriangle as bo, FileDiff as ho, RefreshCw as fo, Rows3 as wa, Flame as go, Sparkles as xo, BarChart3 as yo, SlidersHorizontal as ko, ListChecks as vo, Rows4 as wo, Rows2 as _o, Play as No, Plus as Zt, ChevronDown as _a, Star as So, Pin as Co, Loader2 as $o, Check as qo, Save as Fo, Bell as To, Inbox as Ro, GripVertical as Eo } from "lucide-react";
7
- import { useState as v, useRef as U, useEffect as M, useMemo as V } from "react";
8
- import { createPortal as Na } from "react-dom";
9
- import { toast as D } from "sonner";
10
- import { useNivaroClient as Ea, useItemEditAuth as Sa, useItemNavigation as Lo, useNavigation as Ao, useOverlayState as Oo } from "../../context.js";
5
+ import { useQueryClient as po, useQuery as W, useMutation as $e, useQueries as Be } from "@tanstack/react-query";
6
+ import { AlertTriangle as bo, FileDiff as ho, RefreshCw as fo, Rows3 as _a, Flame as go, Sparkles as xo, BarChart3 as yo, SlidersHorizontal as ko, ListChecks as vo, Rows4 as wo, Rows2 as _o, Play as No, Plus as en, ChevronDown as Na, Star as So, Pin as Co, Loader2 as $o, Check as qo, Save as Fo, Bell as To, Inbox as Ro, GripVertical as Eo } from "lucide-react";
7
+ import { useState as v, useRef as U, useEffect as P, useMemo as V } from "react";
8
+ import { createPortal as Sa } from "react-dom";
9
+ import { toast as O } from "sonner";
10
+ import { useNivaroClient as La, useItemEditAuth as Ca, useItemNavigation as Lo, useNavigation as Ao, useOverlayState as Oo } from "../../context.js";
11
11
  import { useDebounced as Do } from "../../hooks/useDebounced.js";
12
12
  import { useElapsedLoading as Ko } from "../../hooks/useElapsedLoading.js";
13
13
  import { useSlowReason as Po } from "../../hooks/useSlowReason.js";
14
14
  import { useBulkProgressFeed as Mo } from "../../lib/bulk-progress.js";
15
- import { get as L, post as se, patch as Ca, del as jn, put as Qo } from "../../lib/commands.js";
15
+ import { get as L, post as se, patch as $a, del as In, put as Qo } from "../../lib/commands.js";
16
16
  import { evaluateExpression as Bo } from "../../lib/expression.js";
17
17
  import { clauseFromControlValue as jo, filterSentence as Uo } from "../../lib/filter-sentence.js";
18
18
  import { deliverLive as Io, releaseLiveOwner as Vo } from "../../lib/focus-mode.js";
19
- import { formatMultiValue as tt, formatValue as Go } from "../../lib/format-value.js";
19
+ import { formatMultiValue as nt, formatValue as Go } from "../../lib/format-value.js";
20
20
  import { createCursorBook as Wo, pageRequest as Ho, noteNextCursor as Yo } from "../../lib/keyset-pager.js";
21
21
  import { normalizeInlineEdit as Jo, inlineM2oTarget as zo, inlineChoices as Xo, inlineEditFor as Zo, nextInlineKey as es } from "../../lib/list-inline-edit.js";
22
22
  import { sanitizeQueueLinkState as ts, readListLinkFromLocation as ns, dropListLinkParam as rs } from "../../lib/list-link.js";
23
- import { expandCoalesced as as, LIVE_ASPECTS as Ct } from "../../lib/live.js";
23
+ import { expandCoalesced as as, LIVE_ASPECTS as $t } from "../../lib/live.js";
24
24
  import { useRowChanges as ls, useRowLocksByCollection as os, lockLabel as ss } from "../../lib/live-list.js";
25
- import { OPEN_IN_TABS_CAP as is, openInTabs as cs, openInTabsMessage as $a } from "../../lib/open-in-tabs.js";
25
+ import { OPEN_IN_TABS_CAP as is, openInTabs as cs, openInTabsMessage as qa } from "../../lib/open-in-tabs.js";
26
26
  import { isOwnWrite as ds } from "../../lib/own-writes.js";
27
27
  import { usePrefetchIntent as us } from "../../lib/prefetch.js";
28
28
  import { useRowPresence as ms, rowPresenceKey as ps } from "../../lib/presence-hooks.js";
29
29
  import { buildGroups as bs } from "../../lib/queue-grouping.js";
30
30
  import { cascadeFilter as hs, fetchCascadeRelations as fs } from "../../lib/quick-filter-cascade.js";
31
31
  import { useOptionalRealtime as gs } from "../../lib/realtime.js";
32
- import { copyIdText as qa } from "../../lib/record-ref.js";
32
+ import { copyIdText as Fa } from "../../lib/record-ref.js";
33
33
  import { rowHighlightTextClass as xs, rowHighlightClass as ys } from "../../lib/row-highlight.js";
34
- import { userErrorMessage as $t } from "../../lib/safe-error.js";
34
+ import { userErrorMessage as qt } from "../../lib/safe-error.js";
35
35
  import { useMyScopes as ks, matchScopeDimension as vs } from "../../lib/use-my-scopes.js";
36
36
  import { useNewItemLayouts as ws } from "../../lib/use-new-item-layouts.js";
37
- import { formatNumber as ie, cn as R, titleCase as Un, humanHours as _s, formatRelative as Ns, formatDateTime as Ss, formatDate as Cs } from "../../lib/utils.js";
37
+ import { formatNumber as ie, cn as E, titleCase as Vn, humanHours as _s, formatRelative as Ns, formatDateTime as Ss, formatDate as Cs } from "../../lib/utils.js";
38
38
  import { usePublishAskContext as $s, useAskRecordDrag as qs } from "../ai/ask-context.js";
39
39
  import { useBuiltinGate as Fs, BulkActionButtons as Ts } from "../bulk/BulkActionButtons.js";
40
40
  import { BulkRowMark as Rs } from "../bulk/BulkRowMark.js";
@@ -46,7 +46,7 @@ import { FulfilmentPill as Ks, FULFILMENT_FILTER_OPTIONS as Ps } from "../Fulfil
46
46
  import { ImportFromFileButton as Ms } from "../import/ImportFromFileButton.js";
47
47
  import { IntegrationDots as Qs, INTEGRATIONS_FILTER_OPTIONS as Bs } from "../integrations/IntegrationDots.js";
48
48
  import { IntegrationsFilterPill as js } from "../integrations/IntegrationsFilterPill.js";
49
- import { readQueueReturn as Us, writeQueueReturn as Fa } from "../item-edit/QueueReturnChip.js";
49
+ import { readQueueReturn as Us, writeQueueReturn as Ta } from "../item-edit/QueueReturnChip.js";
50
50
  import { ListLoadError as Is } from "../ListLoadError.js";
51
51
  import { LiveRowMark as Vs } from "../LiveRowMark.js";
52
52
  import { CopyListLinkButton as Gs } from "../list/CopyListLinkButton.js";
@@ -56,28 +56,29 @@ import { RealtimeStaleMark as Xs } from "../RealtimeStatusBanner.js";
56
56
  import { RecordDrilldownSheet as Zs } from "../RecordDrilldownSheet.js";
57
57
  import { RowHighlightLegend as ei } from "../RowHighlightLegend.js";
58
58
  import { RowPresence as ti } from "../RowPresence.js";
59
- import { TickerNumber as In } from "../TickerNumber.js";
59
+ import { TickerNumber as Gn } from "../TickerNumber.js";
60
60
  import { UnseenDot as ni } from "../UnseenDot.js";
61
61
  import { Badge as ri } from "../ui/badge.js";
62
- import { Checkbox as Vn } from "../ui/checkbox.js";
63
- import { Command as Ta, CommandInput as ai, CommandList as Ra, CommandEmpty as li, CommandItem as qt } from "../ui/command.js";
62
+ import { Checkbox as Wn } from "../ui/checkbox.js";
63
+ import { Command as Ra, CommandInput as ai, CommandList as Ea, CommandEmpty as li, CommandItem as Ft } from "../ui/command.js";
64
64
  import { Label as oi } from "../ui/label.js";
65
- import { Popover as nt, PopoverTrigger as rt, PopoverContent as at } from "../ui/popover.js";
65
+ import { Popover as rt, PopoverTrigger as at, PopoverContent as lt } from "../ui/popover.js";
66
66
  import { Skeleton as si } from "../ui/skeleton.js";
67
67
  import { dedupeChooserKeys as ii } from "./column-chooser.js";
68
- import { stateAspectEffect as ci } from "./live-state-aspect.js";
69
- import { OwnerAvatars as di } from "./OwnerAvatars.js";
70
- import { QueueBulkBar as ui } from "./QueueBulkBar.js";
71
- import { QueueItemSheet as mi } from "./QueueItemSheet.js";
72
- import { QueueKanbanBoard as pi } from "./QueueKanbanBoard.js";
73
- import { QueueQuickFilters as bi } from "./QueueQuickFilters.js";
74
- import { QueueWorkloadView as hi } from "./QueueWorkloadView.js";
75
- import { useTransitionNote as fi, needsTransitionNote as gi } from "./transition-note.js";
76
- function xi({ summary: l }) {
68
+ import { statsOutrunRows as ci, stateAspectEffect as di } from "./live-state-aspect.js";
69
+ import { pathHeader as ui } from "./path-label.js";
70
+ import { OwnerAvatars as mi } from "./OwnerAvatars.js";
71
+ import { QueueBulkBar as pi } from "./QueueBulkBar.js";
72
+ import { QueueItemSheet as bi } from "./QueueItemSheet.js";
73
+ import { QueueKanbanBoard as hi } from "./QueueKanbanBoard.js";
74
+ import { QueueQuickFilters as fi } from "./QueueQuickFilters.js";
75
+ import { QueueWorkloadView as gi } from "./QueueWorkloadView.js";
76
+ import { useTransitionNote as xi, needsTransitionNote as yi } from "./transition-note.js";
77
+ function ki({ summary: l }) {
77
78
  if (!l || l.count === 0)
78
79
  return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
79
- const y = [l.last_from, l.last_to].filter(Boolean).join(" → "), A = [
80
- y ? `Last: ${y}` : null,
80
+ const k = [l.last_from, l.last_to].filter(Boolean).join(" → "), K = [
81
+ k ? `Last: ${k}` : null,
81
82
  l.last_at ? Ns(l.last_at) : null,
82
83
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
83
84
  ].filter(Boolean).join(" · ");
@@ -85,7 +86,7 @@ function xi({ summary: l }) {
85
86
  "span",
86
87
  {
87
88
  className: "inline-flex max-w-[260px] items-center gap-1.5 truncate rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-[11px] font-medium text-rose-700 dark:border-rose-900/40 dark:bg-rose-900/10 dark:text-rose-300",
88
- "data-tip": A,
89
+ "data-tip": K,
89
90
  "data-send-backs": l.count,
90
91
  children: [
91
92
  /* @__PURE__ */ d("span", { className: "tabular-nums", children: [
@@ -100,35 +101,35 @@ function xi({ summary: l }) {
100
101
  }
101
102
  );
102
103
  }
103
- const yi = 50, en = "nivaro_addendums", ki = [
104
+ const vi = 50, tn = "nivaro_addendums", wi = [
104
105
  { value: "mine", label: "My Items" },
105
106
  { value: "unowned", label: "No Owners" },
106
107
  { value: "claimed", label: "Claimed by me" },
107
108
  { value: "all", label: "All Items" }
108
109
  ];
109
- function vi({ summary: l }) {
110
+ function _i({ summary: l }) {
110
111
  if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
111
- const y = l.active > 0, A = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", P = l.cost_impact, G = P != null && P !== 0 ? `${P > 0 ? "+" : "−"}$${Math.abs(P).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
112
+ const k = l.active > 0, K = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, G = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
112
113
  return /* @__PURE__ */ d(
113
114
  "span",
114
115
  {
115
116
  title: l.latest_title ?? void 0,
116
- className: R(
117
+ className: E(
117
118
  "inline-flex max-w-[220px] items-center gap-1.5 truncate rounded-full border px-2 py-0.5 text-[11px] font-medium",
118
- y ? "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
119
+ k ? "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
119
120
  ),
120
121
  children: [
121
122
  /* @__PURE__ */ a(
122
123
  "span",
123
124
  {
124
125
  "aria-hidden": !0,
125
- className: R(
126
+ className: E(
126
127
  "h-1.5 w-1.5 shrink-0 rounded-full",
127
- y ? "bg-amber-500" : "bg-slate-400"
128
+ k ? "bg-amber-500" : "bg-slate-400"
128
129
  )
129
130
  }
130
131
  ),
131
- y ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${A}` : `${l.total} ${A}`,
132
+ k ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${K}` : `${l.total} ${K}`,
132
133
  G && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
133
134
  "· ",
134
135
  G
@@ -137,62 +138,62 @@ function vi({ summary: l }) {
137
138
  }
138
139
  );
139
140
  }
140
- function wi(l) {
141
+ function Ni(l) {
141
142
  return _s(l);
142
143
  }
143
- function _i({ status: l }) {
144
- 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: "—" });
144
+ function Si({ status: l }) {
145
+ return l ? /* @__PURE__ */ a("span", { className: E("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: "—" });
145
146
  }
146
- function Ni({ points: l, inline: y = !1 }) {
147
+ function Ci({ points: l, inline: k = !1 }) {
147
148
  if (l.length < 2) return null;
148
- const A = y ? 40 : 64, P = y ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, N = A / (l.length - 1), H = l.map(
149
- (xe, g) => `${g === 0 ? "M" : "L"}${(g * N).toFixed(1)},${(P - 2 - (xe - f) / h * (P - 4)).toFixed(1)}`
149
+ const K = k ? 40 : 64, M = k ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, N = K / (l.length - 1), H = l.map(
150
+ (ye, g) => `${g === 0 ? "M" : "L"}${(g * N).toFixed(1)},${(M - 2 - (ye - f) / h * (M - 4)).toFixed(1)}`
150
151
  ).join(" ");
151
152
  return /* @__PURE__ */ a(
152
153
  "svg",
153
154
  {
154
- width: A,
155
- height: P,
156
- className: y ? "opacity-40" : "mt-1.5 opacity-40",
155
+ width: K,
156
+ height: M,
157
+ className: k ? "opacity-40" : "mt-1.5 opacity-40",
157
158
  "aria-hidden": "true",
158
159
  children: /* @__PURE__ */ a("path", { d: H, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
159
160
  }
160
161
  );
161
162
  }
162
- function Ft({
163
+ function Tt({
163
164
  label: l,
164
- count: y,
165
- filteredCount: A,
166
- active: P,
165
+ count: k,
166
+ filteredCount: K,
167
+ active: M,
167
168
  isLoading: G,
168
169
  tone: f,
169
170
  trend: h,
170
171
  delta: N,
171
172
  deltaBadIsUp: H,
172
- onClick: xe
173
+ onClick: ye
173
174
  }) {
174
175
  return /* @__PURE__ */ a(
175
176
  "button",
176
177
  {
177
178
  type: "button",
178
- onClick: xe,
179
- className: R(
179
+ onClick: ye,
180
+ className: E(
180
181
  "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",
181
- P && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
182
- !P && !G && y === 0 && "opacity-50"
182
+ M && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
183
+ !M && !G && k === 0 && "opacity-50"
183
184
  ),
184
- children: G ? /* @__PURE__ */ a(si, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Ce, { children: [
185
- /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: A != null ? /* @__PURE__ */ d(Ce, { children: [
186
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(In, { value: A, format: ie }) }),
185
+ children: G ? /* @__PURE__ */ a(si, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(qe, { children: [
186
+ /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(qe, { children: [
187
+ /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Gn, { value: K, format: ie }) }),
187
188
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
188
189
  "/ ",
189
- /* @__PURE__ */ a(In, { value: y, format: ie })
190
+ /* @__PURE__ */ a(Gn, { value: k, format: ie })
190
191
  ] })
191
- ] }) : /* @__PURE__ */ a(In, { value: y, format: ie }) }),
192
+ ] }) : /* @__PURE__ */ a(Gn, { value: k, format: ie }) }),
192
193
  /* @__PURE__ */ a(
193
194
  "span",
194
195
  {
195
- className: R(
196
+ className: E(
196
197
  "text-[11px] font-medium leading-none",
197
198
  f === "red" ? "text-red-500 dark:text-red-400" : f === "amber" ? "text-amber-600 dark:text-amber-400" : "text-slate-400 dark:text-muted-foreground"
198
199
  ),
@@ -202,7 +203,7 @@ function Ft({
202
203
  N != null && N !== 0 && /* @__PURE__ */ d(
203
204
  "span",
204
205
  {
205
- className: R(
206
+ className: E(
206
207
  "text-[10px] font-medium leading-none",
207
208
  H ? N > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
208
209
  ),
@@ -212,16 +213,16 @@ function Ft({
212
213
  ]
213
214
  }
214
215
  ),
215
- h && y > 0 && /* @__PURE__ */ a(Ni, { points: h, inline: !0 })
216
+ h && k > 0 && /* @__PURE__ */ a(Ci, { points: h, inline: !0 })
216
217
  ] })
217
218
  }
218
219
  );
219
220
  }
220
- function Si({
221
+ function $i({
221
222
  label: l,
222
- count: y,
223
- filteredCount: A,
224
- color: P,
223
+ count: k,
224
+ filteredCount: K,
225
+ color: M,
225
226
  active: G,
226
227
  onClick: f
227
228
  }) {
@@ -230,7 +231,7 @@ function Si({
230
231
  {
231
232
  type: "button",
232
233
  onClick: f,
233
- className: R(
234
+ className: E(
234
235
  "flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
235
236
  G ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
236
237
  ),
@@ -239,36 +240,34 @@ function Si({
239
240
  "span",
240
241
  {
241
242
  className: "h-2 w-2 shrink-0 rounded-full",
242
- style: { backgroundColor: P ?? "#94a3b8" }
243
+ style: { backgroundColor: M ?? "#94a3b8" }
243
244
  }
244
245
  ),
245
246
  l,
246
- /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: A != null ? /* @__PURE__ */ d(Ce, { children: [
247
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(A) }),
247
+ /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(qe, { children: [
248
+ /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(K) }),
248
249
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
249
250
  " / ",
250
- ie(y)
251
+ ie(k)
251
252
  ] })
252
- ] }) : ie(y) })
253
+ ] }) : ie(k) })
253
254
  ]
254
255
  }
255
256
  );
256
257
  }
257
- function lt(l) {
258
- return l.split(".").map((y) => y.replace(/_/g, " ").replace(/\b\w/g, (A) => A.toUpperCase())).join(" → ");
259
- }
260
- function Ci({
258
+ const je = ui;
259
+ function qi({
261
260
  id: l,
262
- label: y,
263
- checked: A,
264
- onCheckedChange: P
261
+ label: k,
262
+ checked: K,
263
+ onCheckedChange: M
265
264
  }) {
266
- const { attributes: G, listeners: f, setNodeRef: h, transform: N, transition: H, isDragging: xe } = uo({
265
+ const { attributes: G, listeners: f, setNodeRef: h, transform: N, transition: H, isDragging: ye } = uo({
267
266
  id: l
268
267
  }), g = {
269
268
  transform: mo.Transform.toString(N),
270
269
  transition: H,
271
- opacity: xe ? 0.4 : 1
270
+ opacity: ye ? 0.4 : 1
272
271
  }, Y = `col-toggle-${l}`;
273
272
  return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
274
273
  /* @__PURE__ */ a(
@@ -280,38 +279,38 @@ function Ci({
280
279
  children: /* @__PURE__ */ a(Eo, { className: "h-3.5 w-3.5" })
281
280
  }
282
281
  ),
283
- /* @__PURE__ */ a(Vn, { id: Y, checked: A, onCheckedChange: P }),
284
- /* @__PURE__ */ a(oi, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: y })
282
+ /* @__PURE__ */ a(Wn, { id: Y, checked: K, onCheckedChange: M }),
283
+ /* @__PURE__ */ a(oi, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: k })
285
284
  ] });
286
285
  }
287
- function Xc({
286
+ function td({
288
287
  queueId: l,
289
- realtime: y,
290
- renderError: A,
291
- hideCreateActions: P = !1,
288
+ realtime: k,
289
+ renderError: K,
290
+ hideCreateActions: M = !1,
292
291
  onAsk: G
293
292
  }) {
294
- var aa, la, oa, sa, ia, ca, da, ua, ma, pa, ba, ha, fa, ga, xa, ya, ka;
295
- const f = po(), h = Ea(), { userId: N } = Sa(), H = Lo(), { navigate: xe } = Ao(), [g, Y] = v("all"), [de, O] = v(1), Gn = U(Wo()), [Tt, La] = v(() => {
293
+ var la, oa, sa, ia, ca, da, ua, ma, pa, ba, ha, fa, ga, xa, ya, ka, va;
294
+ const f = po(), h = La(), { userId: N } = Ca(), H = Lo(), { navigate: ye } = Ao(), [g, Y] = v("all"), [de, A] = v(1), Hn = U(Wo()), [Rt, Aa] = v(() => {
296
295
  try {
297
296
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
298
297
  } catch {
299
298
  return "compact";
300
299
  }
301
- }), [$, je] = v("table"), [I, Ue] = v(""), [_, Q] = v({}), [Rt, Wn] = v(() => /* @__PURE__ */ new Set()), [C, ot] = v(null), [ye, tn] = v(/* @__PURE__ */ new Set()), [st, nn] = v(null), [it, rn] = v(null), [an, Et] = v(0), $e = ls(), ln = gs(), on = U({}).current, Hn = U(/* @__PURE__ */ new Set()), [Aa, Oa] = v(0), [Yn, Da] = v(0), qe = U(!1), Lt = U([]), Jn = U(null), zn = U(!1), Xn = U(0), sn = U("table");
302
- sn.current = $;
303
- const cn = 25, { data: i, error: At } = W({
300
+ }), [C, Ue] = v("table"), [I, Ie] = v(""), [_, Q] = v({}), [Et, Yn] = v(() => /* @__PURE__ */ new Set()), [$, ot] = v(null), [ke, nn] = v(/* @__PURE__ */ new Set()), [st, rn] = v(null), [it, an] = v(null), [ln, Lt] = v(0), Fe = ls(), on = gs(), sn = U({}).current, Jn = U(/* @__PURE__ */ new Set()), [Oa, Da] = v(0), [zn, Ka] = v(0), ue = U(!1), At = U([]), Xn = U(null), cn = U(!1), dn = U(0), un = U("table");
301
+ un.current = C;
302
+ const mn = 25, { data: c, error: Ot } = W({
304
303
  queryKey: ["queue-meta", l],
305
304
  queryFn: () => h.request(L(`/queues/${l}`)).then((e) => e.data),
306
305
  enabled: !!l
307
- }), { scopes: Ot, ready: Zn } = ks(), er = U(!1), [tr, nr] = v(!1), [Fe, Ka] = v({}), ue = U({});
308
- M(() => {
309
- if (er.current || !Zn || !i) return;
306
+ }), { scopes: Dt, ready: Zn } = ks(), er = U(!1), [tr, nr] = v(!1), [Te, Pa] = v({}), me = U({});
307
+ P(() => {
308
+ if (er.current || !Zn || !c) return;
310
309
  er.current = !0;
311
- const e = (i.extra_field_meta ?? []).filter(
310
+ const e = (c.extra_field_meta ?? []).filter(
312
311
  (t) => t.kind === "relation" && t.target_collection && t.display_field
313
312
  );
314
- if (e.length === 0 || !Ot) {
313
+ if (e.length === 0 || !Dt) {
315
314
  nr(!0);
316
315
  return;
317
316
  }
@@ -331,11 +330,11 @@ function Xc({
331
330
  ];
332
331
  };
333
332
  for (const o of e) {
334
- const s = vs(Ot, { collection: o.target_collection });
333
+ const s = vs(Dt, { collection: o.target_collection });
335
334
  if (!s) continue;
336
335
  const m = `extra.${o.path}`;
337
336
  try {
338
- const p = Ot.restricted[s.name] ?? [];
337
+ const p = Dt.restricted[s.name] ?? [];
339
338
  if (p.length > 0) {
340
339
  const S = await r(o, p);
341
340
  S.length > 0 && (n[m.slice(6)] = S);
@@ -343,48 +342,48 @@ function Xc({
343
342
  } catch {
344
343
  }
345
344
  }
346
- Object.keys(n).length > 0 && Ka(n), Object.keys(t).length > 0 && (ue.current = t, Q((o) => ({ ...o, ...t }))), nr(!0);
345
+ Object.keys(n).length > 0 && Pa(n), Object.keys(t).length > 0 && (me.current = t, Q((o) => ({ ...o, ...t }))), nr(!0);
347
346
  })();
348
- }, [Zn, Ot, i]);
349
- const Ie = ((la = (aa = i == null ? void 0 : i.sources) == null ? void 0 : aa.find((e) => e.type === "collection")) == null ? void 0 : la.collection) ?? null, { data: rr = [] } = W({
350
- queryKey: ["queue-browser-quick-filters", Ie],
351
- queryFn: () => h.request(L(`/collections/${Ie}`)).then((e) => {
347
+ }, [Zn, Dt, c]);
348
+ const Ve = ((oa = (la = c == null ? void 0 : c.sources) == null ? void 0 : la.find((e) => e.type === "collection")) == null ? void 0 : oa.collection) ?? null, { data: rr = [] } = W({
349
+ queryKey: ["queue-browser-quick-filters", Ve],
350
+ queryFn: () => h.request(L(`/collections/${Ve}`)).then((e) => {
352
351
  var t, n;
353
352
  return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
354
353
  }).catch(() => []),
355
- enabled: !!Ie,
354
+ enabled: !!Ve,
356
355
  staleTime: 3e5
357
356
  }), re = V(() => {
358
357
  const e = /* @__PURE__ */ new Set(), t = [];
359
- for (const n of (i == null ? void 0 : i.sources) ?? [])
358
+ for (const n of (c == null ? void 0 : c.sources) ?? [])
360
359
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
361
360
  return t;
362
- }, [i == null ? void 0 : i.sources]), Dt = ws(
361
+ }, [c == null ? void 0 : c.sources]), Kt = ws(
363
362
  re.length === 1 ? re[0] : null
364
- ), dn = P === !0 || Array.isArray(P) && re.length > 0 && re.every((e) => P.includes(e)), me = (i == null ? void 0 : i.claims_enabled) !== !1, u = i == null ? void 0 : i.display_config, Te = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Pa = (u == null ? void 0 : u.work_next) !== !1, Kt = (u == null ? void 0 : u.bulk_actions) !== !1, un = Fs(
363
+ ), pn = M === !0 || Array.isArray(M) && re.length > 0 && re.every((e) => M.includes(e)), pe = (c == null ? void 0 : c.claims_enabled) !== !1, u = c == null ? void 0 : c.display_config, Re = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Ma = (u == null ? void 0 : u.work_next) !== !1, Pt = (u == null ? void 0 : u.bulk_actions) !== !1, bn = Fs(
365
364
  [
366
365
  ...new Set(
367
- ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
366
+ ((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
368
367
  )
369
368
  ],
370
369
  (u == null ? void 0 : u.bulk_action_keys) ?? null
371
- ), E = (e, t) => {
370
+ ), T = (e, t) => {
372
371
  var n, r;
373
- return ((r = (n = i == null ? void 0 : i.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
372
+ return ((r = (n = c == null ? void 0 : c.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
374
373
  }, ar = U(!1);
375
- M(() => {
376
- !i || ar.current || (ar.current = !0, Ue("-priority"));
377
- }, [i]);
378
- const [J, Ma] = v(!1);
379
- M(() => {
380
- i != null && i.display_config && !Te.includes($) && je(Te[0]);
381
- }, [i, $, Te]), M(() => {
382
- if (!(i != null && i.sources)) return;
383
- const e = ln ? (b, T) => ln.subscribeCollections(b, T) : y == null ? void 0 : y.subscribe;
374
+ P(() => {
375
+ !c || ar.current || (ar.current = !0, Ie("-priority"));
376
+ }, [c]);
377
+ const [J, Qa] = v(!1);
378
+ P(() => {
379
+ c != null && c.display_config && !Re.includes(C) && Ue(Re[0]);
380
+ }, [c, C, Re]), P(() => {
381
+ if (!(c != null && c.sources)) return;
382
+ const e = on ? (b, R) => on.subscribeCollections(b, R) : k == null ? void 0 : k.subscribe;
384
383
  if (!e) return;
385
384
  const t = [
386
385
  ...new Set(
387
- i.sources.filter((b) => b.type === "collection" && b.collection).map((b) => b.collection)
386
+ c.sources.filter((b) => b.type === "collection" && b.collection).map((b) => b.collection)
388
387
  )
389
388
  ];
390
389
  if (t.length === 0) return;
@@ -392,58 +391,58 @@ function Xc({
392
391
  let r = null, o = null, s = null;
393
392
  const m = () => {
394
393
  s || (s = setTimeout(() => {
395
- s = null, Da((b) => b + 1);
394
+ s = null, Ka((b) => b + 1);
396
395
  }, 1500));
397
396
  }, p = () => {
398
397
  o || (o = setTimeout(() => {
399
- if (o = null, Xn.current > 0 || zn.current) {
400
- Lt.current = [], Et((b) => b + 1);
398
+ if (o = null, dn.current > 0 || cn.current) {
399
+ At.current = [], Lt((b) => b + 1);
401
400
  return;
402
401
  }
403
- qe.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
402
+ ue.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
404
403
  }, 900));
405
404
  }, S = (b) => {
406
- let T = !1, k = 0, X = !1;
405
+ let R = !1, y = 0, X = !1;
407
406
  const Z = b.flatMap(
408
407
  (F) => F ? as(F) : [F]
409
408
  );
410
409
  for (const F of Z) {
411
- const ne = F == null ? void 0 : F.changed_fields, Xt = (F == null ? void 0 : F.collection) != null ? `${F.collection}:${String(F.item)}` : null, va = Xt != null && Hn.current.has(Xt);
412
- if (F && !F.action && (ne != null && ne.length) && ne.every((Ne) => Ne.startsWith("$"))) {
413
- if (ne.includes(Ct.tasks) && n.add("queue-task-counts"), ne.includes(Ct.integrations) && n.add("queue-integrations-summary"), ne.includes(Ct.addendums) && n.add("queue-collection-addendums"), ne.includes(Ct.lock) && Oa((Ne) => Ne + 1), ne.includes(Ct.state)) {
414
- const Ne = ci(va, sn.current === "kanban");
415
- X = !0, Ne.refresh && (T = !0), k += Ne.pill;
410
+ const ne = F == null ? void 0 : F.changed_fields, Zt = (F == null ? void 0 : F.collection) != null ? `${F.collection}:${String(F.item)}` : null, wa = Zt != null && Jn.current.has(Zt);
411
+ if (F && !F.action && (ne != null && ne.length) && ne.every((Ce) => Ce.startsWith("$"))) {
412
+ if (ne.includes($t.tasks) && n.add("queue-task-counts"), ne.includes($t.integrations) && n.add("queue-integrations-summary"), ne.includes($t.addendums) && n.add("queue-collection-addendums"), ne.includes($t.lock) && Da((Ce) => Ce + 1), ne.includes($t.state)) {
413
+ const Ce = di(wa, un.current === "kanban");
414
+ X = !0, Ce.refresh && (R = !0), y += Ce.pill;
416
415
  }
417
416
  r || (r = setTimeout(() => {
418
417
  r = null;
419
- for (const Ne of n) f.invalidateQueries({ queryKey: [Ne] });
418
+ for (const Ce of n) f.invalidateQueries({ queryKey: [Ce] });
420
419
  n.clear();
421
420
  }, 300));
422
421
  continue;
423
422
  }
424
423
  X = !0;
425
424
  const to = (F == null ? void 0 : F.collection) != null && ds(F.collection, F.item);
426
- Xt && (va || (F == null ? void 0 : F.action) === "create" || sn.current === "kanban") ? (T = !0, to || Lt.current.push({ key: Xt, by: null })) : k += 1;
425
+ Zt && (wa || (F == null ? void 0 : F.action) === "create" || un.current === "kanban") ? (R = !0, to || At.current.push({ key: Zt, by: null })) : y += 1;
427
426
  }
428
- k > 0 && Et((F) => F + k), T && p(), X && m();
429
- }, w = e(t, (b) => Io(on, [b ?? {}], S));
427
+ y > 0 && Lt((F) => F + y), R && p(), X && m();
428
+ }, w = e(t, (b) => Io(sn, [b ?? {}], S));
430
429
  return () => {
431
- w(), Vo(on), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
430
+ w(), Vo(sn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
432
431
  };
433
- }, [ln, y, i == null ? void 0 : i.sources, f, l, N, on]);
434
- const Re = Do(_, 350), Qa = JSON.stringify(Re) === JSON.stringify(_), mn = U(!1), Ee = $ === "table" && !!C, lr = (() => {
432
+ }, [on, k, c == null ? void 0 : c.sources, f, l, N, sn]);
433
+ const Ee = Do(_, 350), Ba = JSON.stringify(Ee) === JSON.stringify(_), hn = U(!1), ve = C === "table" && !!$, lr = (() => {
435
434
  const e = /* @__PURE__ */ new Set();
436
- for (const t of (i == null ? void 0 : i.extra_field_meta) ?? [])
435
+ for (const t of (c == null ? void 0 : c.extra_field_meta) ?? [])
437
436
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
438
- for (const t of (i == null ? void 0 : i.sources) ?? []) {
437
+ for (const t of (c == null ? void 0 : c.sources) ?? []) {
439
438
  for (const [n, r] of Object.entries(t.column_formats ?? {}))
440
439
  (r == null ? void 0 : r.type) === "number" && e.add(n);
441
440
  t.type === "addendums" && e.add("cost_impact");
442
441
  }
443
442
  return [...e].slice(0, 12);
444
- })(), ke = (() => {
443
+ })(), we = (() => {
445
444
  const e = {};
446
- for (const [t, n] of Object.entries(Re))
445
+ for (const [t, n] of Object.entries(Ee))
447
446
  if (n) {
448
447
  if (Array.isArray(n)) {
449
448
  n.length > 0 && (e[t] = n);
@@ -458,58 +457,58 @@ function Xc({
458
457
  }
459
458
  return e;
460
459
  })();
461
- function Ve(e, t) {
462
- Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })), O(1);
460
+ function Ge(e, t) {
461
+ Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })), A(1);
463
462
  }
464
- function Ba(e) {
463
+ function ja(e) {
465
464
  Q((t) => {
466
465
  const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((s) => s !== e) : [...r, e];
467
466
  return { ...t, state: o };
468
- }), O(1);
467
+ }), A(1);
469
468
  }
470
- const ja = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Ua = (e) => !e || Array.isArray(e) && e.length === 0;
471
- function Ia() {
472
- Q({ ...ue.current }), Y("all"), O(1);
469
+ const Ua = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Ia = (e) => !e || Array.isArray(e) && e.length === 0;
470
+ function Va() {
471
+ Q({ ...me.current }), Y("all"), A(1);
473
472
  }
474
- const [ct, Va] = v(() => {
473
+ const [ct, Ga] = v(() => {
475
474
  try {
476
475
  return localStorage.getItem("nvr_queue_insights_open") === "1";
477
476
  } catch {
478
477
  return !1;
479
478
  }
480
479
  });
481
- M(() => {
480
+ P(() => {
482
481
  try {
483
482
  localStorage.setItem("nvr_queue_insights_open", ct ? "1" : "0");
484
483
  } catch {
485
484
  }
486
485
  }, [ct]);
487
- const { data: Ga = [] } = W({
486
+ const { data: Wa = [] } = W({
488
487
  queryKey: ["queue-view-subs", l],
489
488
  queryFn: () => h.request(L("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
490
489
  staleTime: 3e4
491
- }), Pt = (e) => Ga.find((t) => t.queue_view_id === e), Wa = (e) => {
492
- const t = Pt(e);
493
- (t ? h.request(jn(`/notification-subscriptions/${t.id}`)) : h.request(
490
+ }), Mt = (e) => Wa.find((t) => t.queue_view_id === e), Ha = (e) => {
491
+ const t = Mt(e);
492
+ (t ? h.request(In(`/notification-subscriptions/${t.id}`)) : h.request(
494
493
  se("/notification-subscriptions", {
495
494
  queue_id: l,
496
495
  queue_view_id: e,
497
496
  digest_frequency: "instant"
498
497
  })
499
498
  )).then(() => {
500
- D.success(
499
+ O.success(
501
500
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
502
501
  ), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
503
- }).catch((r) => D.error($t(r, "Failed")));
504
- }, [or, pn] = v(null), bn = [
502
+ }).catch((r) => O.error(qt(r, "Failed")));
503
+ }, [or, fn] = v(null), gn = [
505
504
  ...new Set(
506
- ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
505
+ ((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
507
506
  )
508
- ], { data: Ha = {} } = W({
509
- queryKey: ["queue-custom-actions", l, bn.join(",")],
507
+ ], { data: Ya = {} } = W({
508
+ queryKey: ["queue-custom-actions", l, gn.join(",")],
510
509
  queryFn: async () => {
511
510
  const e = {};
512
- for (const t of bn.slice(0, 6))
511
+ for (const t of gn.slice(0, 6))
513
512
  try {
514
513
  const n = await h.request(
515
514
  L("/custom-actions", { collection: t })
@@ -520,16 +519,16 @@ function Xc({
520
519
  }
521
520
  return e;
522
521
  },
523
- enabled: bn.length > 0,
522
+ enabled: gn.length > 0,
524
523
  staleTime: 6e4
525
- }), Ya = (e) => Ha[e] ?? [], Ja = (e, t) => {
524
+ }), Ja = (e) => Ya[e] ?? [], za = (e, t) => {
526
525
  h.request(se(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
527
- D.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
526
+ O.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
528
527
  }).catch((n) => {
529
528
  const r = n.response;
530
- D.error((r == null ? void 0 : r.error) ?? $t(n, `${e.label} failed`));
529
+ O.error((r == null ? void 0 : r.error) ?? qt(n, `${e.label} failed`));
531
530
  });
532
- }, { data: hn = [] } = W({
531
+ }, { data: xn = [] } = W({
533
532
  queryKey: ["queue-triage-labels", l],
534
533
  queryFn: () => h.request(L(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
535
534
  staleTime: 3e4
@@ -542,43 +541,43 @@ function Xc({
542
541
  })
543
542
  ).then(() => {
544
543
  f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
545
- }).catch((n) => D.error($t(n, "Label failed")));
544
+ }).catch((n) => O.error(qt(n, "Label failed")));
546
545
  }, {
547
- data: c,
546
+ data: i,
548
547
  isLoading: ir,
549
548
  isFetching: dt,
550
- isPlaceholderData: za,
549
+ isPlaceholderData: Xa,
551
550
  dataUpdatedAt: ce,
552
551
  isError: cr,
553
- error: Xa,
554
- refetch: Za
552
+ error: Za,
553
+ refetch: el
555
554
  } = W({
556
555
  queryKey: [
557
556
  "queue-items",
558
557
  l,
559
558
  g,
560
559
  I,
561
- Re,
562
- $ === "table" && !C ? de : "all",
563
- C
560
+ Ee,
561
+ C === "table" && !$ ? de : "all",
562
+ $
564
563
  ],
565
564
  queryFn: async () => {
566
- const e = !Ee && $ === "table", t = JSON.stringify([l, g, I, ke, cn]), n = e ? Ho(Gn.current, t, de, "").after : void 0, r = await h.request(
565
+ const e = !ve && C === "table", t = JSON.stringify([l, g, I, we, mn]), n = e ? Ho(Hn.current, t, de, "").after : void 0, r = await h.request(
567
566
  L(`/queues/${l}/items`, {
568
567
  scope: g,
569
568
  // Last State Change is Aging read the other way round: the newest
570
569
  // move is the least aged.
571
570
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
572
- filters: JSON.stringify(ke),
571
+ filters: JSON.stringify(we),
573
572
  // Table + group: headers only (rows load per group on expand, #741).
574
573
  // Kanban renders the full matching set, grouped client-side.
575
- ...Ee ? {
576
- group_by: C,
574
+ ...ve ? {
575
+ group_by: $,
577
576
  ...lr.length ? { group_sums: lr.join(",") } : {}
578
- } : $ === "table" ? { page: de, limit: cn, ...n ? { after: n } : {} } : {}
577
+ } : C === "table" ? { page: de, limit: mn, ...n ? { after: n } : {} } : {}
579
578
  })
580
579
  );
581
- return n && Yo(Gn.current, t, de, r.next_cursor), r;
580
+ return n && Yo(Hn.current, t, de, r.next_cursor), r;
582
581
  },
583
582
  // Wait for display_config AND scope seeding so the first fetch uses the
584
583
  // configured defaults and already carries the viewer's restricted filters.
@@ -587,22 +586,22 @@ function Xc({
587
586
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
588
587
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
589
588
  // waits for the debounced copy to settle; later typing still debounces.
590
- enabled: !!l && J && tr && (mn.current || Qa),
589
+ enabled: !!l && J && tr && (hn.current || Ba),
591
590
  // Keep the previous page rendered while a sort/filter/page change refetches —
592
591
  // swapping to skeletons collapsed the table height and jittered the page.
593
592
  placeholderData: (e) => e
594
593
  });
595
- c && !mn.current && (mn.current = !0);
596
- const Ge = Object.entries(ue.current).filter(
594
+ i && !hn.current && (hn.current = !0);
595
+ const We = Object.entries(me.current).filter(
597
596
  ([e, t]) => {
598
597
  var n;
599
- return !((n = Fe[e.slice(6)]) != null && n.length) && JSON.stringify(ke[e] ?? null) === JSON.stringify(t);
598
+ return !((n = Te[e.slice(6)]) != null && n.length) && JSON.stringify(we[e] ?? null) === JSON.stringify(t);
600
599
  }
601
- ).map(([e]) => e), dr = Ge.length > 0 && Object.keys(ke).every((e) => Ge.includes(e)), ur = Object.fromEntries(
602
- Object.entries(ke).filter(([e]) => !Ge.includes(e))
603
- ), { data: el } = W({
600
+ ).map(([e]) => e), dr = We.length > 0 && Object.keys(we).every((e) => We.includes(e)), ur = Object.fromEntries(
601
+ Object.entries(we).filter(([e]) => !We.includes(e))
602
+ ), { data: tl } = W({
604
603
  queryKey: ["queue-default-hidden", l, g, ur],
605
- enabled: !!l && !!c && !dt && c.total === 0 && ((oa = c.empty) == null ? void 0 : oa.reason) === "filters" && Ge.length > 0 && !dr,
604
+ enabled: !!l && !!i && !dt && i.total === 0 && ((sa = i.empty) == null ? void 0 : sa.reason) === "filters" && We.length > 0 && !dr,
606
605
  staleTime: 3e4,
607
606
  retry: !1,
608
607
  queryFn: () => h.request(
@@ -613,14 +612,14 @@ function Xc({
613
612
  limit: 1
614
613
  })
615
614
  ).then((e) => Number(e.total ?? 0))
616
- }), pe = dr ? Math.max(0, (((sa = c == null ? void 0 : c.stats) == null ? void 0 : sa.total) ?? 0) - ((c == null ? void 0 : c.total) ?? 0)) : el ?? 0, mr = (e) => Ge.map(e).join(" and "), pr = () => {
615
+ }), be = dr ? Math.max(0, (((ia = i == null ? void 0 : i.stats) == null ? void 0 : ia.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : tl ?? 0, mr = (e) => We.map(e).join(" and "), pr = () => {
617
616
  Q((e) => {
618
617
  const t = { ...e };
619
- for (const n of Ge) delete t[n];
618
+ for (const n of We) delete t[n];
620
619
  return t;
621
- }), O(1);
620
+ }), A(1);
622
621
  };
623
- M(() => {
622
+ P(() => {
624
623
  if (typeof window > "u" || !ce) return;
625
624
  const e = window;
626
625
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
@@ -629,19 +628,19 @@ function Xc({
629
628
  at: ce,
630
629
  scope: g,
631
630
  sort: I,
632
- filters: JSON.stringify(Re),
631
+ filters: JSON.stringify(Ee),
633
632
  page: de
634
633
  }, r = t.find((o) => o.queue === l);
635
634
  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
635
  }, [ce]);
637
- const We = ir && !c || !J || !tr && !c, br = (dt && !ir || za && dt) && !qe.current, tl = V(
638
- () => (Ee ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
639
- [Ee, c == null ? void 0 : c.data]
640
- ), nl = ms(tl), Mt = fi(), hr = Ko(dt && !qe.current), rl = Po({
641
- pending: dt && !qe.current,
636
+ const He = ir && !i || !J || !tr && !i, br = (dt && !ir || Xa && dt) && !ue.current, nl = V(
637
+ () => (ve ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
638
+ [ve, i == null ? void 0 : i.data]
639
+ ), rl = ms(nl), Qt = xi(), hr = Ko(dt && !ue.current), al = Po({
640
+ pending: dt && !ue.current,
642
641
  request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
643
642
  noun: "items"
644
- }), al = us();
643
+ }), ll = us();
645
644
  async function fr(e, t) {
646
645
  var p;
647
646
  const r = (await h.request(L(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
@@ -654,7 +653,7 @@ function Xc({
654
653
  );
655
654
  if (!s) throw new Error("No transition available to move this item here");
656
655
  let m = null;
657
- if (gi(s) && (m = await Mt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
656
+ if (yi(s) && (m = await Qt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
658
657
  throw new Error("Not moved — this move needs a note");
659
658
  await h.request(
660
659
  se(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
@@ -663,7 +662,7 @@ function Xc({
663
662
  })
664
663
  );
665
664
  }
666
- const ll = Se({
665
+ const ol = $e({
667
666
  mutationFn: async ({ item: e, targetState: t }) => {
668
667
  await fr(e, t);
669
668
  },
@@ -671,9 +670,9 @@ function Xc({
671
670
  f.invalidateQueries({ queryKey: ["queue-items", l, g] });
672
671
  },
673
672
  onError: (e) => {
674
- D.error($t(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
673
+ O.error(qt(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
675
674
  }
676
- }), Le = Se({
675
+ }), Le = $e({
677
676
  mutationFn: (e) => h.request(
678
677
  se(`/queues/${l}/claim`, {
679
678
  source_collection: e.collection,
@@ -681,8 +680,8 @@ function Xc({
681
680
  })
682
681
  ),
683
682
  onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
684
- onError: () => D.error("Failed to claim item")
685
- }), He = Se({
683
+ onError: () => O.error("Failed to claim item")
684
+ }), Ye = $e({
686
685
  mutationFn: (e) => h.request(
687
686
  se(`/queues/${l}/release`, {
688
687
  source_collection: e.collection,
@@ -690,27 +689,27 @@ function Xc({
690
689
  })
691
690
  ),
692
691
  onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
693
- onError: () => D.error("Failed to release item")
694
- }), { data: Ye } = W({
692
+ onError: () => O.error("Failed to release item")
693
+ }), { data: Je } = W({
695
694
  queryKey: ["queue-column-prefs", l],
696
695
  queryFn: () => h.request(L(`/queues/${l}/column-prefs`)),
697
696
  enabled: !!l
698
- }), [Qt, Bt] = v(null), [Je, fn] = v(null);
699
- M(() => {
700
- Ye && fn(Ye.data.default_view_id);
701
- }, [Ye]);
702
- const [ol, gr] = v({}), be = Ee ? (c == null ? void 0 : c.groups) ?? null : null, jt = (be ?? []).filter((e) => !ye.has(e.key)).map((e) => e.key).flatMap(
703
- (e) => Array.from({ length: ol[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
704
- ), gn = Be({
705
- queries: jt.map(({ key: e, page: t }) => ({
697
+ }), [Bt, jt] = v(null), [ze, yn] = v(null);
698
+ P(() => {
699
+ Je && yn(Je.data.default_view_id);
700
+ }, [Je]);
701
+ const [sl, gr] = v({}), he = ve ? (i == null ? void 0 : i.groups) ?? null : null, Ut = (he ?? []).filter((e) => !ke.has(e.key)).map((e) => e.key).flatMap(
702
+ (e) => Array.from({ length: sl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
703
+ ), kn = Be({
704
+ queries: Ut.map(({ key: e, page: t }) => ({
706
705
  queryKey: [
707
706
  "queue-items",
708
707
  l,
709
708
  "group-rows",
710
709
  g,
711
710
  I,
712
- Re,
713
- C,
711
+ Ee,
712
+ $,
714
713
  e,
715
714
  t
716
715
  ],
@@ -718,117 +717,128 @@ function Xc({
718
717
  L(`/queues/${l}/items`, {
719
718
  scope: g,
720
719
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
721
- filters: JSON.stringify(ke),
722
- group_by: C,
720
+ filters: JSON.stringify(we),
721
+ group_by: $,
723
722
  group_key: e,
724
723
  page: t,
725
- limit: yi
724
+ limit: vi
726
725
  })
727
726
  ).then((n) => ({ key: e, rows: n.data })),
728
- enabled: !!c && Ee,
727
+ enabled: !!i && ve,
729
728
  placeholderData: (n) => n
730
729
  }))
731
- }), sl = gn.map((e) => e.dataUpdatedAt).join(","), xn = V(() => {
730
+ }), il = kn.map((e) => e.dataUpdatedAt).join(","), vn = V(() => {
732
731
  const e = /* @__PURE__ */ new Map();
733
- return gn.forEach((t, n) => {
732
+ return kn.forEach((t, n) => {
734
733
  if (!t.data) return;
735
- const r = jt[n].key;
734
+ const r = Ut[n].key;
736
735
  e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
737
736
  }), e;
738
- }, [sl, jt.map((e) => `${e.key}\0${e.page}`).join("")]), il = new Set(
739
- gn.flatMap((e, t) => e.isFetching ? [jt[t].key] : [])
740
- ), q = be ? [...xn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
737
+ }, [il, Ut.map((e) => `${e.key}\0${e.page}`).join("")]), cl = new Set(
738
+ kn.flatMap((e, t) => e.isFetching ? [Ut[t].key] : [])
739
+ ), q = he ? [...vn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
741
740
  $s(
742
741
  l ? {
743
742
  queue: {
744
743
  id: l,
745
- label: i == null ? void 0 : i.name,
744
+ label: c == null ? void 0 : c.name,
746
745
  scope: g,
747
- filters: JSON.stringify(ke),
746
+ filters: JSON.stringify(we),
748
747
  items: q.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
749
748
  }
750
749
  } : null
751
750
  );
752
- const cl = qs(), ut = q.some((e) => e.fulfilment !== void 0), mt = q.some((e) => e.send_backs !== void 0), { data: Ut, dataUpdatedAt: dl } = W({
753
- queryKey: ["queue-live-stats", l, g, Re, Yn],
751
+ const dl = qs(), ut = q.some((e) => e.fulfilment !== void 0), mt = q.some((e) => e.send_backs !== void 0), { data: pt, dataUpdatedAt: xr } = W({
752
+ queryKey: ["queue-live-stats", l, g, Ee, zn],
754
753
  queryFn: () => h.request(
755
754
  L(`/queues/${l}/items`, {
756
755
  scope: g,
757
- filters: JSON.stringify(ke),
756
+ filters: JSON.stringify(we),
758
757
  page: 1,
759
758
  limit: 1
760
759
  })
761
760
  ),
762
- enabled: Yn > 0 && !!c,
761
+ enabled: zn > 0 && !!i,
763
762
  staleTime: Number.POSITIVE_INFINITY,
764
763
  placeholderData: (e) => e,
765
764
  retry: !1
766
- }), yn = !!Ut && dl > ce, x = yn ? Ut.stats : c == null ? void 0 : c.stats, z = yn ? Ut.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, xr = yn ? Ut.state_counts : c == null ? void 0 : c.state_counts, kn = (ia = z ?? x) == null ? void 0 : ia.aging, yr = U(void 0);
767
- !_.aging_hours && kn && (yr.current = kn);
768
- const pt = _.aging_hours ? yr.current ?? (x == null ? void 0 : x.aging) : kn ?? (x == null ? void 0 : x.aging);
769
- Hn.current = new Set(q.map((e) => `${e.collection}:${e.item_id}`));
770
- const bt = os(
765
+ }), It = !!pt && xr > ce, x = It ? pt.stats : i == null ? void 0 : i.stats, z = It ? pt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, yr = It ? pt.state_counts : i == null ? void 0 : i.state_counts;
766
+ P(() => {
767
+ !It || !ci({
768
+ liveTotal: pt.total,
769
+ rowsTotal: i == null ? void 0 : i.total,
770
+ table: C === "table" && !ve,
771
+ busy: dn.current > 0 || cn.current
772
+ }) || (ue.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l, g] }).finally(() => {
773
+ ue.current = !1;
774
+ }));
775
+ }, [xr]);
776
+ const wn = (ca = z ?? x) == null ? void 0 : ca.aging, kr = U(void 0);
777
+ !_.aging_hours && wn && (kr.current = wn);
778
+ const bt = _.aging_hours ? kr.current ?? (x == null ? void 0 : x.aging) : wn ?? (x == null ? void 0 : x.aging);
779
+ Jn.current = new Set(q.map((e) => `${e.collection}:${e.item_id}`));
780
+ const ht = os(
771
781
  q.map((e) => ({ collection: e.collection, id: e.item_id })),
772
- Aa
773
- ), kr = U(ce), vr = U(0);
774
- !qe.current && ce !== vr.current && (kr.current = ce), M(() => {
782
+ Oa
783
+ ), vr = U(ce), wr = U(0);
784
+ !ue.current && ce !== wr.current && (vr.current = ce), P(() => {
775
785
  const e = new Set(q.map((t) => `${t.collection}:${t.item_id}`));
776
- if (qe.current) {
777
- qe.current = !1, vr.current = ce;
778
- const t = Lt.current;
779
- Lt.current = [];
780
- const n = Jn.current, r = /* @__PURE__ */ new Set();
786
+ if (ue.current) {
787
+ ue.current = !1, wr.current = ce;
788
+ const t = At.current;
789
+ At.current = [];
790
+ const n = Xn.current, r = /* @__PURE__ */ new Set();
781
791
  for (const o of t)
782
- !e.has(o.key) || r.has(o.key) || (r.add(o.key), $e.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
792
+ !e.has(o.key) || r.has(o.key) || (r.add(o.key), Fe.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
783
793
  if (n) {
784
794
  const o = [...e].filter((s) => !n.has(s) && !r.has(s));
785
- o.length > 0 && o.length <= 20 && $e.note(o, null, "create");
795
+ o.length > 0 && o.length <= 20 && Fe.note(o, null, "create");
786
796
  }
787
797
  }
788
- Jn.current = e;
789
- }, [ce]), M(() => {
790
- Et(0);
791
- }, [c]);
798
+ Xn.current = e;
799
+ }, [ce]), P(() => {
800
+ Lt(0);
801
+ }, [i]);
792
802
  function ul() {
793
- f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Et(0);
803
+ f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Lt(0);
794
804
  }
795
- const { data: he } = W({
805
+ const { data: fe } = W({
796
806
  queryKey: ["queue-trends", l],
797
807
  queryFn: () => h.request(L(`/queues/${l}/trends`, { days: 14 })),
798
808
  enabled: !!l,
799
809
  staleTime: 300 * 1e3
800
- }), { data: fe } = W({
810
+ }), { data: ge } = W({
801
811
  queryKey: ["queue-trends", l, "mine"],
802
812
  queryFn: () => h.request(L(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
803
813
  enabled: !!l && g === "mine",
804
814
  staleTime: 300 * 1e3
805
815
  });
806
- function ht(e) {
807
- const n = (g === "all" ? he == null ? void 0 : he.data : g === "mine" ? fe == null ? void 0 : fe.data : void 0) ?? [];
816
+ function ft(e) {
817
+ const n = (g === "all" ? fe == null ? void 0 : fe.data : g === "mine" ? ge == null ? void 0 : ge.data : void 0) ?? [];
808
818
  if (n.length === 0) return {};
809
819
  const r = n.map((s) => s[e]), o = n[n.length - 1];
810
820
  return { trend: r, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
811
821
  }
812
- const ge = V(() => {
813
- const t = (g === "all" ? he == null ? void 0 : he.data : g === "mine" ? fe == null ? void 0 : fe.data : void 0) ?? [];
822
+ const xe = V(() => {
823
+ const t = (g === "all" ? fe == null ? void 0 : fe.data : g === "mine" ? ge == null ? void 0 : ge.data : void 0) ?? [];
814
824
  if (t.length < 3 || !x) return null;
815
825
  const n = t.map(
816
826
  (m) => g === "mine" ? m.owned ?? m.total : m.total
817
827
  ), r = n.slice(1).map((m, p) => m - n[p]), o = r.reduce((m, p) => m + p, 0) / r.length, s = x.total;
818
828
  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 };
819
- }, [he == null ? void 0 : he.data, fe == null ? void 0 : fe.data, g, x]), ft = V(
829
+ }, [fe == null ? void 0 : fe.data, ge == null ? void 0 : ge.data, g, x]), gt = V(
820
830
  () => [
821
831
  ...new Set(
822
- ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
832
+ ((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
823
833
  )
824
834
  ],
825
- [i == null ? void 0 : i.sources]
835
+ [c == null ? void 0 : c.sources]
826
836
  ), { data: ml } = W({
827
837
  queryKey: ["collections"],
828
838
  queryFn: () => h.request(L("/collections")).then((e) => e.data),
829
839
  staleTime: 300 * 1e3
830
- }), ze = Be({
831
- queries: ft.map((e) => ({
840
+ }), Xe = Be({
841
+ queries: gt.map((e) => ({
832
842
  queryKey: ["queue-collection-addendums", e],
833
843
  queryFn: () => h.request(
834
844
  L(`/collections/${e}`)
@@ -838,39 +848,39 @@ function Xc({
838
848
  }).catch(() => !1),
839
849
  staleTime: 300 * 1e3
840
850
  }))
841
- }).some((e) => e.data === !0), { data: vn = [] } = W({
851
+ }).some((e) => e.data === !0), { data: _n = [] } = W({
842
852
  queryKey: ["queue-integrations-collections"],
843
853
  queryFn: () => h.request(L("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
844
854
  staleTime: 300 * 1e3
845
- }), ve = ft.some((e) => vn.includes(e)), wn = V(() => {
855
+ }), _e = gt.some((e) => _n.includes(e)), Nn = V(() => {
846
856
  var t;
847
857
  const e = {};
848
- if (!ve) return e;
858
+ if (!_e) return e;
849
859
  for (const n of q) {
850
- if (!vn.includes(n.collection)) continue;
860
+ if (!_n.includes(n.collection)) continue;
851
861
  const r = e[t = n.collection] ?? (e[t] = []);
852
862
  r.length < 500 && r.push(n.item_id);
853
863
  }
854
864
  return e;
855
- }, [q, vn, ve]), wr = Object.keys(wn), _r = Be({
856
- queries: wr.map((e) => ({
857
- queryKey: ["queue-integrations-summary", e, wn[e].join(",")],
865
+ }, [q, _n, _e]), _r = Object.keys(Nn), Nr = Be({
866
+ queries: _r.map((e) => ({
867
+ queryKey: ["queue-integrations-summary", e, Nn[e].join(",")],
858
868
  queryFn: () => h.request(
859
869
  se("/integration-obligations/summary", {
860
870
  collection: e,
861
- ids: wn[e]
871
+ ids: Nn[e]
862
872
  })
863
873
  ).then((t) => t.data ?? {}).catch(() => ({})),
864
874
  staleTime: 3e4
865
875
  }))
866
- }), pl = _r.map((e) => e.dataUpdatedAt).join(","), bl = V(() => {
876
+ }), pl = Nr.map((e) => e.dataUpdatedAt).join(","), bl = V(() => {
867
877
  const e = {};
868
- return wr.forEach((t, n) => {
878
+ return _r.forEach((t, n) => {
869
879
  var o;
870
- const r = ((o = _r[n]) == null ? void 0 : o.data) ?? {};
880
+ const r = ((o = Nr[n]) == null ? void 0 : o.data) ?? {};
871
881
  for (const [s, m] of Object.entries(r)) e[`${t}:${s}`] = m;
872
882
  }), e;
873
- }, [pl]), _n = V(() => {
883
+ }, [pl]), Sn = V(() => {
874
884
  var t;
875
885
  const e = {};
876
886
  for (const n of q) {
@@ -880,31 +890,31 @@ function Xc({
880
890
  r.length < 500 && r.push(n.item_id);
881
891
  }
882
892
  return e;
883
- }, [q]), Nn = Object.keys(_n), Nr = Be({
884
- queries: Nn.map((e) => ({
885
- queryKey: ["queue-task-counts", e, _n[e].join(",")],
893
+ }, [q]), Cn = Object.keys(Sn), Sr = Be({
894
+ queries: Cn.map((e) => ({
895
+ queryKey: ["queue-task-counts", e, Sn[e].join(",")],
886
896
  queryFn: () => h.request(
887
- se("/tasks/counts", { collection: e, ids: _n[e] })
897
+ se("/tasks/counts", { collection: e, ids: Sn[e] })
888
898
  ).then((t) => t.data ?? {}).catch(() => ({})),
889
899
  staleTime: 3e4
890
900
  }))
891
- }), hl = Nr.map((e) => e.dataUpdatedAt).join(","), fl = V(() => {
901
+ }), hl = Sr.map((e) => e.dataUpdatedAt).join(","), fl = V(() => {
892
902
  const e = {};
893
- return Nn.forEach((t, n) => {
903
+ return Cn.forEach((t, n) => {
894
904
  var r;
895
- for (const [o, s] of Object.entries(((r = Nr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
905
+ for (const [o, s] of Object.entries(((r = Sr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
896
906
  }), e;
897
- }, [hl]), Sr = Nn.length > 0, Cr = Be({
898
- queries: ft.map((e) => ({
907
+ }, [hl]), Cr = Cn.length > 0, $r = Be({
908
+ queries: gt.map((e) => ({
899
909
  queryKey: ["queue-collection-risk-rules", e],
900
910
  queryFn: () => h.request(
901
911
  L("/at-risk/rules/active", { collection: e })
902
912
  ).then((t) => t.data ?? []).catch(() => []),
903
913
  staleTime: 300 * 1e3
904
914
  }))
905
- }), gl = Cr.map((e) => e.dataUpdatedAt).join(","), $r = V(() => {
915
+ }), gl = $r.map((e) => e.dataUpdatedAt).join(","), qr = V(() => {
906
916
  const e = /* @__PURE__ */ new Map();
907
- for (const t of Cr)
917
+ for (const t of $r)
908
918
  for (const n of t.data ?? []) {
909
919
  const r = e.get(n.name);
910
920
  e.set(n.name, {
@@ -913,65 +923,65 @@ function Xc({
913
923
  });
914
924
  }
915
925
  return [...e.values()];
916
- }, [gl]), qr = Be({
917
- queries: ft.map((e) => ({
926
+ }, [gl]), Fr = Be({
927
+ queries: gt.map((e) => ({
918
928
  queryKey: ["queue-collection-states", e],
919
929
  queryFn: () => h.request(
920
930
  L(`/queues/collection-states/${e}`)
921
931
  ).then((t) => t.data),
922
932
  staleTime: 300 * 1e3
923
933
  }))
924
- }), Fr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), we = V(() => {
934
+ }), Tr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Ne = V(() => {
925
935
  const e = {};
926
- for (const t of qr)
936
+ for (const t of Fr)
927
937
  (t.data ?? []).forEach((n, r) => {
928
938
  e[n.key] = { label: n.label, color: n.color, sort: r };
929
939
  });
930
940
  return e;
931
- }, [qr.map((e) => e.data)]), Tr = x ? Object.entries(x.by_state).sort(
941
+ }, [Fr.map((e) => e.data)]), Rr = x ? Object.entries(x.by_state).sort(
932
942
  (e, t) => {
933
943
  var n, r;
934
- 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);
944
+ return (((n = Ne[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = Ne[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
935
945
  }
936
- ) : [], Rr = (e) => [...e].sort(
946
+ ) : [], Er = (e) => [...e].sort(
937
947
  (t, n) => {
938
948
  var r, o;
939
- 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);
949
+ return (((r = Ne[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = Ne[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
940
950
  }
941
- ), Sn = V(() => {
951
+ ), $n = V(() => {
942
952
  const e = {};
943
- for (const [t, n] of Object.entries(we)) e[t] = n.label;
953
+ for (const [t, n] of Object.entries(Ne)) e[t] = n.label;
944
954
  return e;
945
- }, [we]), Ae = (e) => e ? e === "none" ? "No State" : Sn[e] ?? Fr(e) : "—", gt = (e) => {
946
- if (e === en) return "Addendums";
955
+ }, [Ne]), Ae = (e) => e ? e === "none" ? "No State" : $n[e] ?? Tr(e) : "—", xt = (e) => {
956
+ if (e === tn) return "Addendums";
947
957
  const t = (ml ?? []).find((n) => n.collection === e);
948
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Fr(e);
949
- }, le = V(() => C ? be ? be.map((e) => ({
958
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Tr(e);
959
+ }, le = V(() => $ ? he ? he.map((e) => ({
950
960
  key: e.key,
951
- rows: xn.get(e.key) ?? [],
961
+ rows: vn.get(e.key) ?? [],
952
962
  breached: e.breached,
953
963
  atRisk: e.at_risk,
954
964
  count: e.count,
955
965
  sums: e.sums ?? {}
956
- })) : bs(q, C).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [q, C, be, xn]), Cn = U(null);
957
- M(() => {
958
- if (!C || !le) {
959
- Cn.current = null;
966
+ })) : bs(q, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [q, $, he, vn]), qn = U(null);
967
+ P(() => {
968
+ if (!$ || !le) {
969
+ qn.current = null;
960
970
  return;
961
971
  }
962
- if (Ee && !be || Cn.current === C) return;
963
- Cn.current = C;
972
+ if (ve && !he || qn.current === $) return;
973
+ qn.current = $;
964
974
  const e = le.reduce((t, n) => t + n.count, 0);
965
- tn(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), gr({});
966
- }, [C, be]);
975
+ nn(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), gr({});
976
+ }, [$, he]);
967
977
  function xl(e) {
968
- tn((t) => {
978
+ nn((t) => {
969
979
  const n = new Set(t);
970
980
  return n.has(e) ? n.delete(e) : n.add(e), n;
971
981
  });
972
982
  }
973
- const oe = V(() => le ? le.filter((e) => !ye.has(e.key)).flatMap((e) => e.rows) : q, [le, q, ye]), K = (e) => `${e.collection}:${e.item_id}`, [_e, Oe] = v(null), [yl, $n] = v(!1), [It, Vt] = v(null), qn = (e) => {
974
- if (e.collection === en && e.url) {
983
+ const oe = V(() => le ? le.filter((e) => !ke.has(e.key)).flatMap((e) => e.rows) : q, [le, q, ke]), D = (e) => `${e.collection}:${e.item_id}`, [Se, Oe] = v(null), [yl, Fn] = v(!1), [Vt, Gt] = v(null), Tn = (e) => {
984
+ if (e.collection === tn && e.url) {
975
985
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
976
986
  if (t) {
977
987
  const n = {};
@@ -989,35 +999,35 @@ function Xc({
989
999
  itemId: e.item_id,
990
1000
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
991
1001
  };
992
- }, xt = (e) => {
1002
+ }, yt = (e) => {
993
1003
  var t;
994
- i && Fa({
1004
+ c && Ta({
995
1005
  queue_id: l,
996
- name: i.name,
1006
+ name: c.name,
997
1007
  path: `${window.location.pathname}${window.location.search}`,
998
1008
  at: Date.now(),
999
- scroll: ((t = Wt.current) == null ? void 0 : t.scrollTop) ?? 0,
1000
- state: { scope: g, page: de, sort: I, filters: _, group_by: C, view: $ }
1001
- }), H.open(qn(e));
1002
- }, [B, yt] = v(
1009
+ scroll: ((t = Ht.current) == null ? void 0 : t.scrollTop) ?? 0,
1010
+ state: { scope: g, page: de, sort: I, filters: _, group_by: $, view: C }
1011
+ }), H.open(Tn(e));
1012
+ }, [B, kt] = v(
1003
1013
  null
1004
1014
  );
1005
- M(() => {
1015
+ P(() => {
1006
1016
  if (!B) return;
1007
- const e = () => yt(null);
1017
+ const e = () => kt(null);
1008
1018
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
1009
1019
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
1010
1020
  };
1011
1021
  }, [B]);
1012
- const Gt = (e) => {
1013
- Vt(K(e));
1022
+ const Wt = (e) => {
1023
+ Gt(D(e));
1014
1024
  const t = (u == null ? void 0 : u.row_click) ?? "preview";
1015
- if (t === "full" || e.collection === en) {
1016
- xt(e);
1025
+ if (t === "full" || e.collection === tn) {
1026
+ yt(e);
1017
1027
  return;
1018
1028
  }
1019
1029
  if (t === "layout") {
1020
- Wr({
1030
+ Hr({
1021
1031
  collection: e.collection,
1022
1032
  itemId: e.item_id,
1023
1033
  rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
@@ -1028,82 +1038,82 @@ function Xc({
1028
1038
  }
1029
1039
  Oe(e);
1030
1040
  };
1031
- M(() => {
1032
- if (!_e) return;
1033
- const e = q.find((t) => K(t) === K(_e));
1034
- e && e !== _e && Oe(e);
1041
+ P(() => {
1042
+ if (!Se) return;
1043
+ const e = q.find((t) => D(t) === D(Se));
1044
+ e && e !== Se && Oe(e);
1035
1045
  }, [q]);
1036
1046
  const kl = (e) => !e.claimed_by || e.claimed_by.id === N;
1037
- function Er(e) {
1038
- const t = e ? oe.findIndex((r) => K(r) === K(e)) + 1 : 0, n = oe.slice(t).find(kl);
1047
+ function Lr(e) {
1048
+ const t = e ? oe.findIndex((r) => D(r) === D(e)) + 1 : 0, n = oe.slice(t).find(kl);
1039
1049
  if (!n) {
1040
- $n(!1), Oe(null), D.info("Nothing left to work on — queue clear!");
1050
+ Fn(!1), Oe(null), O.info("Nothing left to work on — queue clear!");
1041
1051
  return;
1042
1052
  }
1043
- if (Vt(K(n)), me && !n.claimed_by && Le.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1044
- xt(n);
1053
+ if (Gt(D(n)), pe && !n.claimed_by && Le.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1054
+ yt(n);
1045
1055
  return;
1046
1056
  }
1047
- $n(!0), Oe(n);
1057
+ Fn(!0), Oe(n);
1048
1058
  }
1049
- M(() => {
1050
- if ($ !== "table") return;
1059
+ P(() => {
1060
+ if (C !== "table") return;
1051
1061
  function e(t) {
1052
1062
  var o;
1053
1063
  const n = t.target;
1054
1064
  if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
1055
1065
  return;
1056
- const r = It ? oe.findIndex((s) => K(s) === It) : -1;
1066
+ const r = Vt ? oe.findIndex((s) => D(s) === Vt) : -1;
1057
1067
  if (t.key === "j" || t.key === "ArrowDown") {
1058
1068
  t.preventDefault();
1059
1069
  const s = oe[Math.min(r + 1, oe.length - 1)];
1060
- s && Vt(K(s));
1070
+ s && Gt(D(s));
1061
1071
  } else if (t.key === "k" || t.key === "ArrowUp") {
1062
1072
  t.preventDefault();
1063
1073
  const s = oe[Math.max(r - 1, 0)];
1064
- s && Vt(K(s));
1065
- } else if (t.key === "Enter" && r >= 0 && !_e)
1066
- t.preventDefault(), Gt(oe[r]);
1067
- else if (t.key === "c" && r >= 0 && me) {
1074
+ s && Gt(D(s));
1075
+ } else if (t.key === "Enter" && r >= 0 && !Se)
1076
+ t.preventDefault(), Wt(oe[r]);
1077
+ else if (t.key === "c" && r >= 0 && pe) {
1068
1078
  t.preventDefault();
1069
1079
  const s = oe[r];
1070
- ((o = s.claimed_by) == null ? void 0 : o.id) === N ? He.mutate(s) : Le.mutate(s);
1071
- } else t.key === "o" && r >= 0 && (t.preventDefault(), xt(oe[r]));
1080
+ ((o = s.claimed_by) == null ? void 0 : o.id) === N ? Ye.mutate(s) : Le.mutate(s);
1081
+ } else t.key === "o" && r >= 0 && (t.preventDefault(), yt(oe[r]));
1072
1082
  }
1073
1083
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1074
- }, [$, oe, It, _e, N, Le, He, me]);
1084
+ }, [C, oe, Vt, Se, N, Le, Ye, pe]);
1075
1085
  const { data: j } = W({
1076
1086
  queryKey: ["queue-views", l],
1077
1087
  queryFn: () => h.request(L(`/queues/${l}/views`)),
1078
1088
  enabled: !!l
1079
- }), [Xe, Ze] = v(null), [vl, Fn] = v(!1), [Tn, Lr] = v(""), [Ar, Or] = v(!1), [kt, Dr] = v(!1);
1080
- function vt(e) {
1089
+ }), [Ze, et] = v(null), [vl, Rn] = v(!1), [En, Ar] = v(""), [Or, Dr] = v(!1), [vt, Kr] = v(!1);
1090
+ function wt(e) {
1081
1091
  const t = e.state ?? {};
1082
- Y(t.scope ?? "all"), Q({ ...ue.current, ...t.filters ?? {} }), Ue(t.sort ?? ""), ot(t.group_by ?? null), Bt(t.columns ?? null), rn(t.pins ?? null), t.view && je(Te.includes(t.view) ? t.view : Te[0]), O(1), Ze(e.id);
1092
+ Y(t.scope ?? "all"), Q({ ...me.current, ...t.filters ?? {} }), Ie(t.sort ?? ""), ot(t.group_by ?? null), jt(t.columns ?? null), an(t.pins ?? null), t.view && Ue(Re.includes(t.view) ? t.view : Re[0]), A(1), et(e.id);
1083
1093
  }
1084
1094
  function wl() {
1085
1095
  var t, n;
1086
1096
  const e = j == null ? void 0 : j.data.find((r) => r.is_default);
1087
1097
  if (e) {
1088
- vt(e);
1098
+ wt(e);
1089
1099
  return;
1090
1100
  }
1091
- Y(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...ue.current }), Ue(""), ot(null), Bt(null), rn(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && je(i.display_config.default_view), O(1), Ze(null);
1101
+ Y(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...me.current }), Ie(""), ot(null), jt(null), an(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ue(c.display_config.default_view), A(1), et(null);
1092
1102
  }
1093
- M(() => {
1094
- if (J || !(i != null && i.display_config) || Ye === void 0 || j === void 0) return;
1095
- const e = Ye.data.default_view_id, t = e != null ? j.data.find((r) => r.id === e) : void 0, n = j.data.find((r) => r.is_default);
1096
- t ? vt(t) : n ? vt(n) : (je(i.display_config.default_view), Y(i.display_config.default_scope)), Ma(!0);
1097
- }, [i, Ye, j, J]);
1098
- const Wt = U(null), Ht = U(null);
1099
- M(() => {
1103
+ P(() => {
1104
+ if (J || !(c != null && c.display_config) || Je === void 0 || j === void 0) return;
1105
+ const e = Je.data.default_view_id, t = e != null ? j.data.find((r) => r.id === e) : void 0, n = j.data.find((r) => r.is_default);
1106
+ t ? wt(t) : n ? wt(n) : (Ue(c.display_config.default_view), Y(c.display_config.default_scope)), Qa(!0);
1107
+ }, [c, Je, j, J]);
1108
+ const Ht = U(null), Yt = U(null);
1109
+ P(() => {
1100
1110
  if (!J) return;
1101
1111
  const e = Us();
1102
1112
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1103
- Fa({ ...e, restore: !1 });
1113
+ Ta({ ...e, restore: !1 });
1104
1114
  const t = e.state ?? {};
1105
- t.scope && Y(t.scope), t.filters && Q({ ...ue.current, ...t.filters }), t.sort != null && Ue(t.sort), ot(t.group_by ?? null), t.view && je(t.view), t.page && O(t.page), Ht.current = e.scroll ?? 0;
1106
- }, [J, l]), M(() => {
1115
+ t.scope && Y(t.scope), t.filters && Q({ ...me.current, ...t.filters }), t.sort != null && Ie(t.sort), ot(t.group_by ?? null), t.view && Ue(t.view), t.page && A(t.page), Yt.current = e.scroll ?? 0;
1116
+ }, [J, l]), P(() => {
1107
1117
  var s;
1108
1118
  if (!J || typeof window > "u") return;
1109
1119
  const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((s = e.get("state")) == null ? void 0 : s.trim()) || null, r = t === "all" || t === "mine";
@@ -1114,8 +1124,8 @@ function Xc({
1114
1124
  window.history.state,
1115
1125
  "",
1116
1126
  `${window.location.pathname}${o ? `?${o}` : ""}${window.location.hash}`
1117
- ), r && Y(t), n && Q((m) => ({ ...m, state: [n] })), O(1);
1118
- }, [J]), M(() => {
1127
+ ), r && Y(t), n && Q((m) => ({ ...m, state: [n] })), A(1);
1128
+ }, [J]), P(() => {
1119
1129
  if (!J || typeof window > "u") return;
1120
1130
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1121
1131
  if (!t) return;
@@ -1125,140 +1135,140 @@ function Xc({
1125
1135
  window.history.state,
1126
1136
  "",
1127
1137
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1128
- ), Y("all"), Q((r) => ({ ...r, owners: [t] })), Ze(null), O(1);
1129
- }, [J]), M(() => {
1138
+ ), Y("all"), Q((r) => ({ ...r, owners: [t] })), et(null), A(1);
1139
+ }, [J]), P(() => {
1130
1140
  if (!J) return;
1131
1141
  const e = ts(ns(`queue:${l}`));
1132
- e && (rs(), vt({
1142
+ e && (rs(), wt({
1133
1143
  id: -1,
1134
1144
  // Saved views type filters loosely as strings; multi-selects ride as arrays there too.
1135
1145
  state: e
1136
- }), Ze(null), e.page && O(e.page));
1146
+ }), et(null), e.page && A(e.page));
1137
1147
  }, [J]);
1138
1148
  const _l = () => ({
1139
1149
  scope: g,
1140
1150
  filters: _,
1141
1151
  sort: I,
1142
- group_by: C,
1143
- view: $,
1144
- columns: Qt,
1152
+ group_by: $,
1153
+ view: C,
1154
+ columns: Bt,
1145
1155
  pins: it,
1146
1156
  ...de > 1 ? { page: de } : {}
1147
1157
  });
1148
- M(() => {
1149
- Ht.current == null || q.length === 0 || !Wt.current || (Wt.current.scrollTop = Ht.current, Ht.current = null);
1158
+ P(() => {
1159
+ Yt.current == null || q.length === 0 || !Ht.current || (Ht.current.scrollTop = Yt.current, Yt.current = null);
1150
1160
  }, [q]);
1151
- const { isAdmin: De } = Sa(), Nl = q.map((e) => `${e.collection}|${e.item_id}`).join(","), Sl = V(
1161
+ const { isAdmin: De } = Ca(), Nl = q.map((e) => `${e.collection}|${e.item_id}`).join(","), Sl = V(
1152
1162
  () => q.map((e) => ({ collection: e.collection, id: e.item_id })),
1153
1163
  [Nl]
1154
- ), Kr = Ys(Sl, De), Cl = (e) => It === K(e) ? (
1164
+ ), Pr = Ys(Sl, De), Cl = (e) => Vt === D(e) ? (
1155
1165
  // Pinned sticky cells use bg-inherit — the highlight must be
1156
1166
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
1157
1167
  // scrolled content bleeds through the pinned columns. Same
1158
1168
  // pair DataTable uses for selected rows when pins are active.
1159
1169
  "bg-[#f2fdff] dark:bg-[#20303a]"
1160
- ) : e.at_risk ? ys(e.at_risk_color ?? "red") : void 0, Yt = De || (i == null ? void 0 : i.owner) != null && i.owner === N, $l = Se({
1161
- mutationFn: ({ viewId: e, on: t }) => h.request(Ca(`/queues/views/${e}`, { is_default: t })),
1170
+ ) : e.at_risk ? ys(e.at_risk_color ?? "red") : void 0, Jt = De || (c == null ? void 0 : c.owner) != null && c.owner === N, $l = $e({
1171
+ mutationFn: ({ viewId: e, on: t }) => h.request($a(`/queues/views/${e}`, { is_default: t })),
1162
1172
  onSuccess: () => {
1163
- f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("Queue default view updated");
1173
+ f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("Queue default view updated");
1164
1174
  },
1165
- onError: () => D.error("Could not update the queue default view")
1166
- }), Pr = Se({
1175
+ onError: () => O.error("Could not update the queue default view")
1176
+ }), Mr = $e({
1167
1177
  mutationFn: () => h.request(
1168
1178
  se(`/queues/${l}/views`, {
1169
- name: Tn.trim(),
1170
- is_shared: Yt && (Ar || kt),
1171
- is_default: kt,
1179
+ name: En.trim(),
1180
+ is_shared: Jt && (Or || vt),
1181
+ is_default: vt,
1172
1182
  state: {
1173
1183
  scope: g,
1174
1184
  filters: _,
1175
1185
  sort: I,
1176
- group_by: C,
1177
- view: $,
1178
- columns: Qt,
1186
+ group_by: $,
1187
+ view: C,
1188
+ columns: Bt,
1179
1189
  pins: it
1180
1190
  }
1181
1191
  })
1182
1192
  ),
1183
1193
  onSuccess: (e) => {
1184
- Fn(!1), Lr(""), Or(!1), Dr(!1), Ze(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("View saved");
1194
+ Rn(!1), Ar(""), Dr(!1), Kr(!1), et(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("View saved");
1185
1195
  },
1186
- onError: () => D.error("Failed to save view")
1187
- }), [Mr, Qr] = v(null), Ke = Se({
1196
+ onError: () => O.error("Failed to save view")
1197
+ }), [Qr, Br] = v(null), Ke = $e({
1188
1198
  mutationFn: (e) => h.request(
1189
- Ca(`/queues/views/${e.id}`, {
1199
+ $a(`/queues/views/${e.id}`, {
1190
1200
  state: {
1191
1201
  scope: g,
1192
1202
  filters: _,
1193
1203
  sort: I,
1194
- group_by: C,
1195
- view: $,
1196
- columns: Qt,
1204
+ group_by: $,
1205
+ view: C,
1206
+ columns: Bt,
1197
1207
  pins: it
1198
1208
  }
1199
1209
  })
1200
1210
  ),
1201
1211
  onSuccess: (e, t) => {
1202
- f.invalidateQueries({ queryKey: ["queue-views", l] }), Qr(t.id), setTimeout(() => Qr((n) => n === t.id ? null : n), 2e3), D.success(`Saved "${t.name}" with the current filters, scope and sort`);
1212
+ f.invalidateQueries({ queryKey: ["queue-views", l] }), Br(t.id), setTimeout(() => Br((n) => n === t.id ? null : n), 2e3), O.success(`Saved "${t.name}" with the current filters, scope and sort`);
1203
1213
  },
1204
- onError: () => D.error("Failed to update view")
1205
- }), [Rn, Jt] = v(null);
1206
- M(() => {
1207
- if (Rn == null) return;
1208
- const e = setTimeout(() => Jt(null), 5e3);
1214
+ onError: () => O.error("Failed to update view")
1215
+ }), [Ln, zt] = v(null);
1216
+ P(() => {
1217
+ if (Ln == null) return;
1218
+ const e = setTimeout(() => zt(null), 5e3);
1209
1219
  return () => clearTimeout(e);
1210
- }, [Rn]);
1211
- const Br = Se({
1212
- mutationFn: (e) => h.request(jn(`/queues/views/${e}`)),
1220
+ }, [Ln]);
1221
+ const jr = $e({
1222
+ mutationFn: (e) => h.request(In(`/queues/views/${e}`)),
1213
1223
  onSuccess: (e, t) => {
1214
- Jt(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), Ze(null), Je === t && fn(null);
1224
+ zt(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), et(null), ze === t && yn(null);
1215
1225
  },
1216
- onError: () => D.error("Failed to delete view")
1217
- }), ql = Se({
1226
+ onError: () => O.error("Failed to delete view")
1227
+ }), ql = $e({
1218
1228
  mutationFn: (e) => h.request(Qo(`/queues/${l}/default-view`, { view_id: e })),
1219
- onMutate: (e) => fn(e),
1229
+ onMutate: (e) => yn(e),
1220
1230
  onSuccess: (e, t) => {
1221
- f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.success(
1231
+ f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.success(
1222
1232
  t === null ? "Reverted to the general default" : "Set as your default view"
1223
1233
  );
1224
1234
  },
1225
1235
  onError: () => {
1226
- f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.error("Failed to update default view");
1236
+ f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.error("Failed to update default view");
1227
1237
  }
1228
- }), [Pe, et] = v([]), [ee, jr] = v(!1), Fl = () => {
1229
- ee && et([]), jr(!ee);
1238
+ }), [Pe, tt] = v([]), [ee, Ur] = v(!1), Fl = () => {
1239
+ ee && tt([]), Ur(!ee);
1230
1240
  };
1231
- M(() => {
1232
- $ !== "table" && ee && (jr(!1), et([]));
1233
- }, [$, ee]), Mo(), Xn.current = Pe.length;
1234
- const [Ur, Ir] = v(!1);
1235
- async function En(e, t) {
1236
- const n = q.filter((m) => Pe.includes(K(m)));
1237
- Ir(!0), Mt.beginBatch();
1241
+ P(() => {
1242
+ C !== "table" && ee && (Ur(!1), tt([]));
1243
+ }, [C, ee]), Mo(), dn.current = Pe.length;
1244
+ const [Ir, Vr] = v(!1);
1245
+ async function An(e, t) {
1246
+ const n = q.filter((m) => Pe.includes(D(m)));
1247
+ Vr(!0), Qt.beginBatch();
1238
1248
  const r = await Promise.allSettled(n.map(t));
1239
- Mt.endBatch();
1249
+ Qt.endBatch();
1240
1250
  const o = r.filter((m) => m.status === "fulfilled").length, s = r.length - o;
1241
- Ir(!1), et([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? D.warning(`${e}: ${o} succeeded, ${s} failed`) : D.success(`${e}: ${o} succeeded`);
1251
+ Vr(!1), tt([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? O.warning(`${e}: ${o} succeeded, ${s} failed`) : O.success(`${e}: ${o} succeeded`);
1242
1252
  }
1243
1253
  const Me = (e) => {
1244
1254
  var t;
1245
- for (const n of (i == null ? void 0 : i.sources) ?? []) {
1255
+ for (const n of (c == null ? void 0 : c.sources) ?? []) {
1246
1256
  const r = (t = n.column_formats) == null ? void 0 : t[e];
1247
1257
  if (r) return r;
1248
1258
  }
1249
1259
  return null;
1250
1260
  }, Tl = (e) => {
1251
- if (C === "state") return e === "No state" ? e : Ae(e);
1252
- if (C === "collection") return gt(e);
1253
- if (C != null && C.startsWith("extra.") && e !== "—") {
1254
- const t = Me(C.slice(6));
1255
- if (t) return tt(e, t);
1261
+ if ($ === "state") return e === "No state" ? e : Ae(e);
1262
+ if ($ === "collection") return xt(e);
1263
+ if ($ != null && $.startsWith("extra.") && e !== "—") {
1264
+ const t = Me($.slice(6));
1265
+ if (t) return nt(e, t);
1256
1266
  }
1257
1267
  return e;
1258
1268
  }, Rl = le == null ? void 0 : le.map((e) => ({
1259
1269
  key: e.key,
1260
1270
  rows: e.rows,
1261
- header: /* @__PURE__ */ d(Ce, { children: [
1271
+ header: /* @__PURE__ */ d(qe, { children: [
1262
1272
  /* @__PURE__ */ a("span", { children: Tl(e.key) }),
1263
1273
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1264
1274
  "(",
@@ -1273,17 +1283,17 @@ function Xc({
1273
1283
  className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
1274
1284
  "data-queue-group-sum": t,
1275
1285
  children: [
1276
- E(`extra.${t}`, lt(t)),
1286
+ T(`extra.${t}`, je(t)),
1277
1287
  ":",
1278
1288
  " ",
1279
- r ? tt(String(n), r) : ie(n)
1289
+ r ? nt(String(n), r) : ie(n)
1280
1290
  ]
1281
1291
  },
1282
1292
  t
1283
1293
  );
1284
1294
  }),
1285
- be && !ye.has(e.key) && il.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1286
- be && !ye.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1295
+ he && !ke.has(e.key) && cl.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1296
+ he && !ke.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1287
1297
  "button",
1288
1298
  {
1289
1299
  type: "button",
@@ -1310,32 +1320,32 @@ function Xc({
1310
1320
  " at risk"
1311
1321
  ] })
1312
1322
  ] })
1313
- })), Ln = (((ca = c == null ? void 0 : c.available_values.collection) == null ? void 0 : ca.length) ?? 0) > 1, Vr = q.some((e) => !!e.unseen) || bt.size > 0 || q.some((e) => $e.isNew(K(e))), Gr = [
1314
- ...Ln ? [
1323
+ })), On = (((da = i == null ? void 0 : i.available_values.collection) == null ? void 0 : da.length) ?? 0) > 1, Gr = q.some((e) => !!e.unseen) || ht.size > 0 || q.some((e) => Fe.isNew(D(e))), Wr = [
1324
+ ...On ? [
1315
1325
  {
1316
1326
  key: "collection",
1317
- header: E("collection", "Collection"),
1327
+ header: T("collection", "Collection"),
1318
1328
  sortable: !0,
1319
- render: (e) => /* @__PURE__ */ a(ri, { variant: "outline", children: gt(e.collection) })
1329
+ render: (e) => /* @__PURE__ */ a(ri, { variant: "outline", children: xt(e.collection) })
1320
1330
  }
1321
1331
  ] : [],
1322
1332
  {
1323
1333
  key: "label",
1324
- header: E("label", "Item"),
1334
+ header: T("label", "Item"),
1325
1335
  sortable: !0,
1326
1336
  // Room in the left padding for the hanging unseen mark (#643).
1327
- className: Vr ? "pl-[30px]" : void 0,
1328
- headerClassName: Vr ? "pl-[30px]" : void 0,
1337
+ className: Gr ? "pl-[30px]" : void 0,
1338
+ headerClassName: Gr ? "pl-[30px]" : void 0,
1329
1339
  render: (e) => (
1330
1340
  // Underlined because clicking opens the item. The row is clickable as
1331
1341
  // a whole, but nothing on it said so — an underline is the one
1332
1342
  // convention people already read as "this goes somewhere".
1333
1343
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1334
- bt.get(K(e)) || $e.isNew(K(e)) ? /* @__PURE__ */ a(
1344
+ ht.get(D(e)) || Fe.isNew(D(e)) ? /* @__PURE__ */ a(
1335
1345
  Vs,
1336
1346
  {
1337
- lock: bt.get(K(e)),
1338
- isNew: $e.isNew(K(e)),
1347
+ lock: ht.get(D(e)),
1348
+ isNew: Fe.isNew(D(e)),
1339
1349
  dataAttr: "data-queue-live-mark",
1340
1350
  hang: !0
1341
1351
  }
@@ -1360,7 +1370,7 @@ function Xc({
1360
1370
  /* @__PURE__ */ a(
1361
1371
  ti,
1362
1372
  {
1363
- viewers: nl[ps(e.collection, e.item_id)],
1373
+ viewers: rl[ps(e.collection, e.item_id)],
1364
1374
  dataAttr: "data-queue-presence"
1365
1375
  }
1366
1376
  )
@@ -1369,7 +1379,7 @@ function Xc({
1369
1379
  },
1370
1380
  {
1371
1381
  key: "state",
1372
- header: E("state", "State"),
1382
+ header: T("state", "State"),
1373
1383
  sortable: !0,
1374
1384
  render: (e) => e.state ? /* @__PURE__ */ d(
1375
1385
  "span",
@@ -1389,33 +1399,33 @@ function Xc({
1389
1399
  },
1390
1400
  {
1391
1401
  key: "owners",
1392
- header: E("owners", "Owners"),
1402
+ header: T("owners", "Owners"),
1393
1403
  sortable: !0,
1394
- render: (e) => /* @__PURE__ */ a(di, { owners: e.owners })
1404
+ render: (e) => /* @__PURE__ */ a(mi, { owners: e.owners })
1395
1405
  },
1396
1406
  {
1397
1407
  key: "aging_hours",
1398
- header: E("aging_hours", "Aging"),
1408
+ header: T("aging_hours", "Aging"),
1399
1409
  sortable: !0,
1400
- render: (e) => wi(e.aging_hours)
1410
+ render: (e) => Ni(e.aging_hours)
1401
1411
  },
1402
1412
  {
1403
1413
  // When the record entered its current state — the same moment Aging
1404
1414
  // counts from (the pipeline history, not the legacy column).
1405
1415
  key: "state_entered",
1406
- header: E("state_entered", "Last State Change"),
1416
+ header: T("state_entered", "Last State Change"),
1407
1417
  sortable: !0,
1408
1418
  render: (e) => e.state_entered_at ? Go(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1409
1419
  },
1410
1420
  {
1411
1421
  key: "sla_status",
1412
- header: E("sla_status", "SLA"),
1422
+ header: T("sla_status", "SLA"),
1413
1423
  sortable: !0,
1414
- render: (e) => /* @__PURE__ */ a(_i, { status: e.sla_status })
1424
+ render: (e) => /* @__PURE__ */ a(Si, { status: e.sla_status })
1415
1425
  },
1416
1426
  {
1417
1427
  key: "at_risk",
1418
- header: E("at_risk", "Risk"),
1428
+ header: T("at_risk", "Risk"),
1419
1429
  sortable: !0,
1420
1430
  render: (e) => {
1421
1431
  var t;
@@ -1425,18 +1435,18 @@ function Xc({
1425
1435
  ] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
1426
1436
  }
1427
1437
  },
1428
- ...ze ? [
1438
+ ...Xe ? [
1429
1439
  {
1430
1440
  key: "addendums",
1431
- header: E("addendums", "Addendums"),
1441
+ header: T("addendums", "Addendums"),
1432
1442
  sortable: !1,
1433
- render: (e) => /* @__PURE__ */ a(vi, { summary: e.addendums })
1443
+ render: (e) => /* @__PURE__ */ a(_i, { summary: e.addendums })
1434
1444
  }
1435
1445
  ] : [],
1436
1446
  ...ut ? [
1437
1447
  {
1438
1448
  key: "fulfilment",
1439
- header: E("fulfilment", "Shipped"),
1449
+ header: T("fulfilment", "Shipped"),
1440
1450
  sortable: !0,
1441
1451
  render: (e) => /* @__PURE__ */ a(
1442
1452
  Ks,
@@ -1448,18 +1458,18 @@ function Xc({
1448
1458
  )
1449
1459
  }
1450
1460
  ] : [],
1451
- ...ve ? [
1461
+ ..._e ? [
1452
1462
  {
1453
1463
  key: "integrations",
1454
- header: E("integrations", "Integrations"),
1464
+ header: T("integrations", "Integrations"),
1455
1465
  sortable: !1,
1456
1466
  render: (e) => /* @__PURE__ */ a(Qs, { rows: bl[`${e.collection}:${e.item_id}`] })
1457
1467
  }
1458
1468
  ] : [],
1459
- ...Sr ? [
1469
+ ...Cr ? [
1460
1470
  {
1461
1471
  key: "tasks",
1462
- header: E("tasks", "Tasks"),
1472
+ header: T("tasks", "Tasks"),
1463
1473
  sortable: !1,
1464
1474
  render: (e) => {
1465
1475
  const t = fl[`${e.collection}:${e.item_id}`];
@@ -1480,9 +1490,9 @@ function Xc({
1480
1490
  ...mt ? [
1481
1491
  {
1482
1492
  key: "send_backs",
1483
- header: E("send_backs", "Sent back"),
1493
+ header: T("send_backs", "Sent back"),
1484
1494
  sortable: !0,
1485
- render: (e) => /* @__PURE__ */ a(xi, { summary: e.send_backs })
1495
+ render: (e) => /* @__PURE__ */ a(ki, { summary: e.send_backs })
1486
1496
  }
1487
1497
  ] : []
1488
1498
  ], El = {
@@ -1493,7 +1503,7 @@ function Xc({
1493
1503
  {
1494
1504
  type: "button",
1495
1505
  onClick: (t) => {
1496
- t.stopPropagation(), He.mutate(e);
1506
+ t.stopPropagation(), Ye.mutate(e);
1497
1507
  },
1498
1508
  className: "text-[11px] text-slate-400 underline hover:text-slate-600",
1499
1509
  children: "Release"
@@ -1509,9 +1519,9 @@ function Xc({
1509
1519
  children: "Claim"
1510
1520
  }
1511
1521
  )
1512
- }, wt = (i == null ? void 0 : i.available_extra_fields) ?? [], _t = Oo("drill.queue"), ae = _t.value, Wr = (e) => _t.push([e]), Ll = (e) => {
1522
+ }, _t = (c == null ? void 0 : c.available_extra_fields) ?? [], Nt = Oo("drill.queue"), ae = Nt.value, Hr = (e) => Nt.push([e]), Ll = (e) => {
1513
1523
  var t;
1514
- for (const n of (i == null ? void 0 : i.sources) ?? []) {
1524
+ for (const n of (c == null ? void 0 : c.sources) ?? []) {
1515
1525
  const r = (t = n.drilldown) == null ? void 0 : t[e];
1516
1526
  if (r)
1517
1527
  return {
@@ -1523,11 +1533,11 @@ function Xc({
1523
1533
  return { enabled: !0, layout_id: null, width: null };
1524
1534
  }, Al = V(() => {
1525
1535
  const e = {};
1526
- for (const t of (i == null ? void 0 : i.sources) ?? [])
1536
+ for (const t of (c == null ? void 0 : c.sources) ?? [])
1527
1537
  for (const [n, r] of Object.entries(t.column_formats ?? {}))
1528
1538
  n in e || (e[n] = r);
1529
1539
  return e;
1530
- }, [i == null ? void 0 : i.sources]), Ol = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Dl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1540
+ }, [c == null ? void 0 : c.sources]), Ol = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Dl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1531
1541
  function Kl(e) {
1532
1542
  if (Ol.test(e)) return { text: e.split("@")[0], title: e };
1533
1543
  if (Dl.test(e)) {
@@ -1540,22 +1550,22 @@ function Xc({
1540
1550
  }
1541
1551
  return { text: e, title: e };
1542
1552
  }
1543
- const An = Jo(u == null ? void 0 : u.inline_edit), Hr = An.enabled ? [
1553
+ const Dn = Jo(u == null ? void 0 : u.inline_edit), Yr = Dn.enabled ? [
1544
1554
  ...new Set(
1545
- ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
1555
+ ((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
1546
1556
  )
1547
1557
  ] : [], Pl = Be({
1548
- queries: Hr.map((e) => ({
1558
+ queries: Yr.map((e) => ({
1549
1559
  queryKey: ["cbv-collection-meta", e],
1550
1560
  queryFn: () => h.request(L(`/collections/${e}`)).then((t) => t.data),
1551
1561
  staleTime: 10 * 6e4,
1552
1562
  retry: !1
1553
1563
  }))
1554
- }), On = /* @__PURE__ */ new Map();
1555
- Hr.forEach((e, t) => {
1564
+ }), Kn = /* @__PURE__ */ new Map();
1565
+ Yr.forEach((e, t) => {
1556
1566
  var r;
1557
1567
  const n = (r = Pl[t]) == null ? void 0 : r.data;
1558
- n && On.set(e, {
1568
+ n && Kn.set(e, {
1559
1569
  fields: new Map((n.fields ?? []).map((o) => [o.field, o])),
1560
1570
  relations: n.relations ?? []
1561
1571
  });
@@ -1563,71 +1573,71 @@ function Xc({
1563
1573
  const { data: Ml } = W({
1564
1574
  queryKey: ["my-permissions"],
1565
1575
  queryFn: () => h.request(L("/security/my/permissions")).then((e) => e.data),
1566
- enabled: An.enabled && !De,
1576
+ enabled: Dn.enabled && !De,
1567
1577
  staleTime: 5 * 6e4
1568
- }), Yr = Ws(), Jr = (e, t) => {
1578
+ }), Jr = Ws(), zr = (e, t) => {
1569
1579
  if (t.includes(".")) return null;
1570
- const n = On.get(e.collection);
1580
+ const n = Kn.get(e.collection);
1571
1581
  if (!n) return null;
1572
- const r = bt.get(K(e));
1582
+ const r = ht.get(D(e));
1573
1583
  return r && !r.is_mine ? null : Zo({
1574
- config: An,
1584
+ config: Dn,
1575
1585
  key: t,
1576
1586
  field: n.fields.get(t),
1577
1587
  collection: e.collection,
1578
1588
  relations: n.relations,
1579
1589
  mayUpdate: De || Ls(Ml, e.collection)
1580
1590
  });
1581
- }, zr = (e, t, n) => {
1591
+ }, Xr = (e, t, n) => {
1582
1592
  var r, o, s;
1583
1593
  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;
1584
1594
  }, Ql = (e, t, n, r, o) => {
1585
- const s = (b) => `${K(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Jr(e, b)), p = o === 0 ? null : es(m, t, o), S = (b) => b.collection === e.collection && b.item_id === e.item_id, w = (b) => S(b) ? n === "m2o" ? {
1595
+ const s = (b) => `${D(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!zr(e, b)), p = o === 0 ? null : es(m, t, o), S = (b) => b.collection === e.collection && b.item_id === e.item_id, w = (b) => S(b) ? n === "m2o" ? {
1586
1596
  ...b,
1587
1597
  extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
1588
1598
  } : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
1589
- Yr.commit({
1599
+ Jr.commit({
1590
1600
  cellKey: s(t),
1591
1601
  collection: e.collection,
1592
1602
  id: e.item_id,
1593
1603
  field: t,
1594
1604
  kind: n,
1595
- before: zr(e, t, n),
1605
+ before: Xr(e, t, n),
1596
1606
  value: r,
1597
1607
  next: p ? s(p) : null,
1598
1608
  optimistic: () => {
1599
1609
  const b = f.getQueriesData({ queryKey: ["queue-items", l] });
1600
- return f.setQueriesData({ queryKey: ["queue-items", l] }, (T) => {
1601
- const k = T;
1602
- return Array.isArray(k == null ? void 0 : k.data) ? { ...k, data: k.data.map(w) } : Array.isArray(k == null ? void 0 : k.rows) ? { ...k, rows: k.rows.map(w) } : T;
1610
+ return f.setQueriesData({ queryKey: ["queue-items", l] }, (R) => {
1611
+ const y = R;
1612
+ return Array.isArray(y == null ? void 0 : y.data) ? { ...y, data: y.data.map(w) } : Array.isArray(y == null ? void 0 : y.rows) ? { ...y, rows: y.rows.map(w) } : R;
1603
1613
  }), () => {
1604
- for (const [T, k] of b) f.setQueryData(T, k);
1614
+ for (const [R, y] of b) f.setQueryData(R, y);
1605
1615
  };
1606
1616
  },
1607
1617
  // Labels, rollups and the row's place in the queue follow the server.
1608
1618
  onSaved: () => void f.invalidateQueries({ queryKey: ["queue-items", l] })
1609
1619
  });
1610
1620
  }, Bl = (e, t, n) => {
1611
- const r = Jr(e, t);
1621
+ const r = zr(e, t);
1612
1622
  if (!r) return n;
1613
- const o = On.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
1623
+ const o = Kn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
1614
1624
  return /* @__PURE__ */ a(
1615
1625
  Hs,
1616
1626
  {
1617
- controller: Yr,
1618
- cellKey: `${K(e)}|${t}`,
1627
+ controller: Jr,
1628
+ cellKey: `${D(e)}|${t}`,
1619
1629
  kind: r,
1620
- value: zr(e, t, r),
1621
- label: E(`extra.${t}`, lt(t)),
1630
+ value: Xr(e, t, r),
1631
+ label: T(`extra.${t}`, je(t)),
1622
1632
  choices: s ? Xo(s) : void 0,
1623
1633
  target: r === "m2o" && o ? zo(o.relations, e.collection, t) : null,
1624
1634
  onCommit: (m, p) => Ql(e, t, r, m, p),
1625
1635
  children: n
1626
1636
  }
1627
1637
  );
1628
- }, jl = wt.map((e) => ({
1638
+ }, jl = _t.map((e) => ({
1629
1639
  key: `extra.${e}`,
1630
- header: E(`extra.${e}`, lt(e)),
1640
+ header: T(`extra.${e}`, je(e)),
1631
1641
  sortable: !0,
1632
1642
  render: (t) => Bl(t, e, Ul(t, e))
1633
1643
  }));
@@ -1636,17 +1646,17 @@ function Xc({
1636
1646
  {
1637
1647
  const o = (n = e.extra) == null ? void 0 : n[t];
1638
1648
  if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
1639
- const s = Me(t), m = s ? tt(String(o), s) : String(o), { text: p, title: S } = Kl(m), w = ((i == null ? void 0 : i.extra_field_meta) ?? []).find((k) => k.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], T = Ll(t);
1640
- return (w == null ? void 0 : w.kind) === "relation" && w.target_collection && b.length > 0 && T.enabled && !w.aggregate ? /* @__PURE__ */ a(
1649
+ const s = Me(t), m = s ? nt(String(o), s) : String(o), { text: p, title: S } = Kl(m), w = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((y) => y.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], R = Ll(t);
1650
+ return (w == null ? void 0 : w.kind) === "relation" && w.target_collection && b.length > 0 && R.enabled && !w.aggregate ? /* @__PURE__ */ a(
1641
1651
  "button",
1642
1652
  {
1643
1653
  type: "button",
1644
- onClick: (k) => {
1645
- k.stopPropagation(), Wr({
1654
+ onClick: (y) => {
1655
+ y.stopPropagation(), Hr({
1646
1656
  collection: w.target_collection,
1647
1657
  itemId: b[0],
1648
- layoutId: T.layout_id,
1649
- width: T.width,
1658
+ layoutId: R.layout_id,
1659
+ width: R.width,
1650
1660
  title: m
1651
1661
  });
1652
1662
  },
@@ -1658,8 +1668,8 @@ function Xc({
1658
1668
  "button",
1659
1669
  {
1660
1670
  type: "button",
1661
- onClick: (k) => {
1662
- k.stopPropagation(), pn({ row: e, path: t, value: m });
1671
+ onClick: (y) => {
1672
+ y.stopPropagation(), fn({ row: e, path: t, value: m });
1663
1673
  },
1664
1674
  title: "Show the rows behind this number",
1665
1675
  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",
@@ -1668,53 +1678,53 @@ function Xc({
1668
1678
  ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: S, children: p });
1669
1679
  }
1670
1680
  }
1671
- const Xr = [
1672
- ...Ln ? ["collection"] : [],
1681
+ const Zr = [
1682
+ ...On ? ["collection"] : [],
1673
1683
  "state",
1674
1684
  "owners",
1675
1685
  "aging_hours",
1676
1686
  "state_entered",
1677
1687
  "sla_status",
1678
1688
  "at_risk",
1679
- ...ze ? ["addendums"] : [],
1689
+ ...Xe ? ["addendums"] : [],
1680
1690
  ...ut ? ["fulfilment"] : [],
1681
- ...ve ? ["integrations"] : [],
1691
+ ..._e ? ["integrations"] : [],
1682
1692
  ...mt ? ["send_backs"] : [],
1683
- ...Sr ? ["tasks"] : [],
1684
- ...wt.map((e) => `extra.${e}`)
1693
+ ...Cr ? ["tasks"] : [],
1694
+ ..._t.map((e) => `extra.${e}`)
1685
1695
  ], Il = [
1686
- ...Ln ? ["collection"] : [],
1696
+ ...On ? ["collection"] : [],
1687
1697
  "state",
1688
1698
  "owners",
1689
- ...ze ? ["addendums"] : [],
1699
+ ...Xe ? ["addendums"] : [],
1690
1700
  ...ut ? ["fulfilment"] : [],
1691
- ...ve ? ["integrations"] : [],
1701
+ ..._e ? ["integrations"] : [],
1692
1702
  ...mt ? ["send_backs"] : [],
1693
1703
  "aging_hours",
1694
1704
  "sla_status",
1695
1705
  "at_risk",
1696
- ...wt.slice(0, 2).map((e) => `extra.${e}`)
1697
- ], Vl = (u == null ? void 0 : u.default_columns) ?? null, Dn = Qt ?? Vl, te = new Set(Dn ?? Il);
1698
- ze && !Rt.has("addendums") && te.add("addendums"), ut && !Rt.has("fulfilment") && te.add("fulfilment"), ve && !Rt.has("integrations") && te.add("integrations"), mt && !Rt.has("send_backs") && te.add("send_backs");
1706
+ ..._t.slice(0, 2).map((e) => `extra.${e}`)
1707
+ ], Vl = (u == null ? void 0 : u.default_columns) ?? null, Pn = Bt ?? Vl, te = new Set(Pn ?? Il);
1708
+ Xe && !Et.has("addendums") && te.add("addendums"), ut && !Et.has("fulfilment") && te.add("fulfilment"), _e && !Et.has("integrations") && te.add("integrations"), mt && !Et.has("send_backs") && te.add("send_backs");
1699
1709
  const Gl = new Set(De ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1700
1710
  for (const e of Gl) te.delete(e);
1701
- const Nt = [
1702
- ...(Dn ?? []).filter((e) => Xr.includes(e)),
1703
- ...Xr.filter((e) => !(Dn ?? []).includes(e))
1711
+ const St = [
1712
+ ...(Pn ?? []).filter((e) => Zr.includes(e)),
1713
+ ...Zr.filter((e) => !(Pn ?? []).includes(e))
1704
1714
  ], Wl = no(ro(ao, { activationConstraint: { distance: 4 } }));
1705
1715
  function Hl(e) {
1706
1716
  const { active: t, over: n } = e;
1707
1717
  if (!n || t.id === n.id) return;
1708
- const r = Nt.indexOf(String(t.id)), o = Nt.indexOf(String(n.id));
1709
- r === -1 || o === -1 || Bt(
1710
- co(Nt, r, o).filter((s) => te.has(s))
1718
+ const r = St.indexOf(String(t.id)), o = St.indexOf(String(n.id));
1719
+ r === -1 || o === -1 || jt(
1720
+ co(St, r, o).filter((s) => te.has(s))
1711
1721
  );
1712
1722
  }
1713
- const Zr = Gr.find((e) => e.key === "label"), Yl = {
1714
- ...Zr,
1723
+ const ea = Wr.find((e) => e.key === "label"), Yl = {
1724
+ ...ea,
1715
1725
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1716
1726
  /* @__PURE__ */ a(Rs, { rowId: e.item_id }),
1717
- Zr.render(e, ...t)
1727
+ ea.render(e, ...t)
1718
1728
  ] })
1719
1729
  }, Jl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1720
1730
  (e) => ({
@@ -1733,54 +1743,55 @@ function Xc({
1733
1743
  return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
1734
1744
  }
1735
1745
  })
1736
- ), Kn = [...Gr, ...jl, ...Jl], ea = ii(
1737
- Nt,
1746
+ ), Mn = [...Wr, ...jl, ...Jl], ta = ii(
1747
+ St,
1738
1748
  (e) => {
1739
1749
  var n;
1740
- const t = (n = Kn.find((r) => r.key === e)) == null ? void 0 : n.header;
1750
+ const t = (n = Mn.find((r) => r.key === e)) == null ? void 0 : n.header;
1741
1751
  return typeof t == "string" ? t : e;
1742
1752
  },
1743
1753
  te
1744
1754
  ), zl = {
1745
1755
  key: "__actions__",
1746
1756
  header: "",
1747
- render: (e) => e.collection === "tasks" || e.collection === en ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
1757
+ render: (e) => e.collection === "tasks" || e.collection === tn ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
1748
1758
  Es,
1749
1759
  {
1750
1760
  collection: e.collection,
1751
1761
  id: e.item_id,
1762
+ label: e.label,
1752
1763
  hasPipeline: e.state != null,
1753
- onOpen: () => xt(e),
1764
+ onOpen: () => yt(e),
1754
1765
  onPeek: () => Oe(e),
1755
1766
  urlFor: H.urlFor,
1756
1767
  onDeleted: () => {
1757
- h.request(jn(`/items/${e.collection}/${e.item_id}`)).then(() => {
1758
- D.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
1759
- }).catch((t) => D.error($t(t, "Delete failed")));
1768
+ h.request(In(`/items/${e.collection}/${e.item_id}`)).then(() => {
1769
+ O.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
1770
+ }).catch((t) => O.error(qt(t, "Delete failed")));
1760
1771
  },
1761
1772
  onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
1762
1773
  bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
1763
1774
  disabled: ee
1764
1775
  }
1765
1776
  ) })
1766
- }, zt = [
1777
+ }, Xt = [
1767
1778
  Yl,
1768
- ...Nt.filter((e) => te.has(e)).map((e) => Kn.find((t) => t.key === e)).filter((e) => e !== void 0),
1769
- ...me ? [El] : [],
1779
+ ...St.filter((e) => te.has(e)).map((e) => Mn.find((t) => t.key === e)).filter((e) => e !== void 0),
1780
+ ...pe ? [El] : [],
1770
1781
  zl
1771
- ], ta = V(() => {
1782
+ ], na = V(() => {
1772
1783
  var r;
1773
- const e = u == null ? void 0 : u.default_pins, t = it ?? (e && Object.keys(e).length > 0 ? e : { [((r = zt[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(zt.map((o) => o.key));
1784
+ const e = u == null ? void 0 : u.default_pins, t = it ?? (e && Object.keys(e).length > 0 ? e : { [((r = Xt[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(Xt.map((o) => o.key));
1774
1785
  return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
1775
- }, [it, u == null ? void 0 : u.default_pins, zt.map((e) => e.key).join("|")]), na = [
1786
+ }, [it, u == null ? void 0 : u.default_pins, Xt.map((e) => e.key).join("|")]), ra = [
1776
1787
  { value: "state", label: "State" },
1777
1788
  { value: "collection", label: "Collection" },
1778
1789
  { value: "sla_status", label: "SLA status" },
1779
1790
  { value: "at_risk", label: "At risk" },
1780
1791
  { value: "owners", label: "Owner" },
1781
1792
  { value: "aging", label: "Aging" },
1782
- ...wt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
1783
- ], ra = (e) => async (t, n) => {
1793
+ ..._t.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: T(`extra.${e}`, je(e)) }))
1794
+ ], aa = (e) => async (t, n) => {
1784
1795
  if (!e.target_collection || !e.display_field) return [];
1785
1796
  const r = {
1786
1797
  limit: 25,
@@ -1798,34 +1809,34 @@ function Xc({
1798
1809
  s.length > 0 && (r.filter = JSON.stringify(s.length === 1 ? s[0] : { _and: s }));
1799
1810
  const p = (await h.request(
1800
1811
  L(`/items/${e.target_collection}`, r)
1801
- )).data ?? [], S = Me(e.path), w = Fe[e.path] ? new Set(Fe[e.path]) : null, b = /* @__PURE__ */ new Set(), T = [];
1802
- for (const k of p) {
1803
- const X = k[e.display_field];
1812
+ )).data ?? [], S = Me(e.path), w = Te[e.path] ? new Set(Te[e.path]) : null, b = /* @__PURE__ */ new Set(), R = [];
1813
+ for (const y of p) {
1814
+ const X = y[e.display_field];
1804
1815
  if (X == null || X === "") continue;
1805
1816
  const Z = String(X);
1806
- b.has(Z) || w && !w.has(Z) || (b.add(Z), T.push({ label: S ? tt(Z, S) : Z, value: Z }));
1817
+ b.has(Z) || w && !w.has(Z) || (b.add(Z), R.push({ label: S ? nt(Z, S) : Z, value: Z }));
1807
1818
  }
1808
- return T;
1809
- }, Pn = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
1819
+ return R;
1820
+ }, Qn = new Map(((c == null ? void 0 : c.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
1810
1821
  {
1811
1822
  key: "collection",
1812
- placeholder: E("collection", "Collection"),
1823
+ placeholder: T("collection", "Collection"),
1813
1824
  type: "combobox",
1814
1825
  multi: !0,
1815
- options: ((c == null ? void 0 : c.available_values.collection) ?? []).map((e) => ({
1816
- label: gt(e),
1826
+ options: ((i == null ? void 0 : i.available_values.collection) ?? []).map((e) => ({
1827
+ label: xt(e),
1817
1828
  value: e
1818
1829
  }))
1819
1830
  },
1820
1831
  {
1821
1832
  key: "state",
1822
- placeholder: E("state", "State"),
1833
+ placeholder: T("state", "State"),
1823
1834
  type: "combobox",
1824
1835
  multi: !0,
1825
1836
  // Until the rows land, the pipeline's own states (no counts yet) rather
1826
1837
  // than an empty list.
1827
- options: Rr(
1828
- c ? c.available_values.state ?? [] : Object.keys(we)
1838
+ options: Er(
1839
+ i ? i.available_values.state ?? [] : Object.keys(Ne)
1829
1840
  ).map((e) => {
1830
1841
  var t;
1831
1842
  return {
@@ -1833,7 +1844,7 @@ function Xc({
1833
1844
  value: e,
1834
1845
  // How many rows sit in it under the other active filters (the State
1835
1846
  // filter itself left out, or every other state would read 0).
1836
- count: xr ? xr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1847
+ count: yr ? yr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1837
1848
  };
1838
1849
  })
1839
1850
  },
@@ -1856,21 +1867,21 @@ function Xc({
1856
1867
  { label: "No", value: "no" }
1857
1868
  ]
1858
1869
  },
1859
- ...$r.length > 0 ? [
1870
+ ...qr.length > 0 ? [
1860
1871
  {
1861
1872
  key: "at_risk_rule",
1862
1873
  placeholder: "Highlight rule",
1863
1874
  type: "select",
1864
- options: $r
1875
+ options: qr
1865
1876
  }
1866
1877
  ] : [],
1867
1878
  {
1868
1879
  key: "aging_hours",
1869
- placeholder: E("aging_hours", "Aging (hours)"),
1880
+ placeholder: T("aging_hours", "Aging (hours)"),
1870
1881
  type: "range",
1871
1882
  range_unit: "h"
1872
1883
  },
1873
- ...ze ? [
1884
+ ...Xe ? [
1874
1885
  {
1875
1886
  key: "addendums",
1876
1887
  placeholder: "Addendums",
@@ -1883,10 +1894,10 @@ function Xc({
1883
1894
  ] : [],
1884
1895
  // #630 — integration partners; the queue read model filters on it
1885
1896
  // (live path in memory, materialized cache in SQL).
1886
- ...ve ? [
1897
+ ..._e ? [
1887
1898
  {
1888
1899
  key: "integrations",
1889
- placeholder: E("integrations", "Integrations"),
1900
+ placeholder: T("integrations", "Integrations"),
1890
1901
  type: "select",
1891
1902
  options: Bs.map((e) => ({ label: e.label, value: e.value }))
1892
1903
  }
@@ -1911,18 +1922,18 @@ function Xc({
1911
1922
  ]
1912
1923
  }
1913
1924
  ] : [],
1914
- ...hn.length > 0 ? [
1925
+ ...xn.length > 0 ? [
1915
1926
  {
1916
1927
  key: "labels",
1917
1928
  placeholder: "Triage label",
1918
1929
  type: "combobox",
1919
1930
  multi: !0,
1920
- options: hn.map((e) => ({ label: e, value: e }))
1931
+ options: xn.map((e) => ({ label: e, value: e }))
1921
1932
  }
1922
1933
  ] : [],
1923
1934
  {
1924
1935
  key: "label",
1925
- placeholder: E("label", "Item"),
1936
+ placeholder: T("label", "Item"),
1926
1937
  type: "combobox",
1927
1938
  multi: !0,
1928
1939
  loadOptions: async (e) => ((await h.request(
@@ -1931,17 +1942,17 @@ function Xc({
1931
1942
  },
1932
1943
  {
1933
1944
  key: "owners",
1934
- placeholder: E("owners", "Owners"),
1945
+ placeholder: T("owners", "Owners"),
1935
1946
  type: "combobox",
1936
1947
  multi: !0,
1937
- options: ((c == null ? void 0 : c.available_values.owners) ?? []).map((e) => ({
1948
+ options: ((i == null ? void 0 : i.available_values.owners) ?? []).map((e) => ({
1938
1949
  label: e.name,
1939
1950
  value: e.id
1940
1951
  }))
1941
1952
  },
1942
- ...wt.map((e) => {
1953
+ ..._t.map((e) => {
1943
1954
  var m, p;
1944
- const t = Pn.get(e), n = E(`extra.${e}`, lt(e)), r = { key: `extra.${e}`, placeholder: n }, o = Me(e);
1955
+ const t = Qn.get(e), n = T(`extra.${e}`, je(e)), r = { key: `extra.${e}`, placeholder: n }, o = Me(e);
1945
1956
  if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
1946
1957
  if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
1947
1958
  if ((o == null ? void 0 : o.type) === "boolean")
@@ -1953,57 +1964,57 @@ function Xc({
1953
1964
  { label: o.false_label ?? "No", value: "bool:false" }
1954
1965
  ]
1955
1966
  };
1956
- const s = (m = c == null ? void 0 : c.available_values.extra) == null ? void 0 : m[e];
1967
+ const s = (m = i == null ? void 0 : i.available_values.extra) == null ? void 0 : m[e];
1957
1968
  return s != null && s.length ? {
1958
1969
  ...r,
1959
1970
  type: "combobox",
1960
1971
  multi: !0,
1961
- options: s.map((S) => ({ label: o ? tt(S, o) : S, value: S }))
1972
+ options: s.map((S) => ({ label: o ? nt(S, o) : S, value: S }))
1962
1973
  } : (t == null ? void 0 : t.kind) === "relation" ? {
1963
1974
  ...r,
1964
1975
  type: "combobox",
1965
1976
  multi: !0,
1966
- restricted: !!((p = Fe[e]) != null && p.length),
1967
- loadOptions: ra(t)
1977
+ restricted: !!((p = Te[e]) != null && p.length),
1978
+ loadOptions: aa(t)
1968
1979
  } : { ...r, placeholder: `Search ${n}…`, type: "text" };
1969
1980
  })
1970
- ], Mn = Qe.filter(
1981
+ ], Bn = Qe.filter(
1971
1982
  (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1972
- ), Qn = (e) => {
1983
+ ), jn = (e) => {
1973
1984
  var t;
1974
1985
  return (((t = Qe.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1975
- }, Bn = (() => {
1986
+ }, Un = (() => {
1976
1987
  var n, r;
1977
1988
  const e = [];
1978
- for (const [o, s] of Object.entries(Re)) {
1989
+ for (const [o, s] of Object.entries(Ee)) {
1979
1990
  if (!s || Array.isArray(s) && s.length === 0) continue;
1980
1991
  const m = Qe.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, S = p ? Me(p) : null, w = jo({
1981
- field: Qn(o),
1992
+ field: jn(o),
1982
1993
  type: (m == null ? void 0 : m.type) ?? "select",
1983
1994
  value: s,
1984
1995
  optionLabel: (b) => {
1985
- var T, k;
1986
- return (k = (T = m == null ? void 0 : m.options) == null ? void 0 : T.find((X) => X.value === b)) == null ? void 0 : k.label;
1996
+ var R, y;
1997
+ return (y = (R = m == null ? void 0 : m.options) == null ? void 0 : R.find((X) => X.value === b)) == null ? void 0 : y.label;
1987
1998
  },
1988
1999
  currency: (S == null ? void 0 : S.type) === "number" && S.prefix === "$",
1989
2000
  rangeUnit: m == null ? void 0 : m.range_unit
1990
2001
  });
1991
2002
  w && e.push(w);
1992
2003
  }
1993
- const t = c == null ? void 0 : c.total;
2004
+ const t = i == null ? void 0 : i.total;
1994
2005
  return Uo({
1995
2006
  noun: "items",
1996
2007
  scope: g === "mine" ? "you own" : g === "unowned" ? "with no owners" : g === "claimed" ? "you claimed" : null,
1997
- viewName: ((r = (n = j == null ? void 0 : j.data) == null ? void 0 : n.find((o) => o.id === Xe)) == null ? void 0 : r.name) ?? null,
2008
+ viewName: ((r = (n = j == null ? void 0 : j.data) == null ? void 0 : n.find((o) => o.id === Ze)) == null ? void 0 : r.name) ?? null,
1998
2009
  clauses: e,
1999
2010
  shown: typeof t == "number" ? t : null,
2000
2011
  of: (x == null ? void 0 : x.total) ?? null
2001
2012
  });
2002
- })(), St = new Set(Object.keys(ue.current)), Xl = ((e) => {
2013
+ })(), Ct = new Set(Object.keys(me.current)), Xl = ((e) => {
2003
2014
  var n;
2004
2015
  if (e.some((r) => r.key === "state")) return e;
2005
2016
  const t = Qe.find((r) => r.key === "state");
2006
- return !t || c && !((n = c.available_values.state) != null && n.length) ? e : [...e, t];
2017
+ return !t || i && !((n = i.available_values.state) != null && n.length) ? e : [...e, t];
2007
2018
  })(
2008
2019
  (() => {
2009
2020
  var o;
@@ -2011,28 +2022,28 @@ function Xc({
2011
2022
  var X, Z, F;
2012
2023
  if (!s.key.startsWith("extra.")) return null;
2013
2024
  if (s.type === "combobox") return s;
2014
- const m = s.key.slice(6), p = Pn.get(m), S = St.has(s.key);
2025
+ const m = s.key.slice(6), p = Qn.get(m), S = Ct.has(s.key);
2015
2026
  if ((p == null ? void 0 : p.kind) !== "relation" && !S) return null;
2016
- const w = Me(m), b = (X = c == null ? void 0 : c.available_values.extra) == null ? void 0 : X[m], T = s.placeholder.replace(/^Search (.*)…$/, "$1"), k = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
2027
+ const w = Me(m), b = (X = i == null ? void 0 : i.available_values.extra) == null ? void 0 : X[m], R = s.placeholder.replace(/^Search (.*)…$/, "$1"), y = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
2017
2028
  return b != null && b.length ? {
2018
2029
  key: s.key,
2019
- placeholder: T,
2030
+ placeholder: R,
2020
2031
  type: "combobox",
2021
2032
  multi: !0,
2022
- cascade: k,
2023
- restricted: !!((Z = Fe[m]) != null && Z.length),
2033
+ cascade: y,
2034
+ restricted: !!((Z = Te[m]) != null && Z.length),
2024
2035
  options: b.map((ne) => ({
2025
- label: w && w.type !== "number" ? tt(ne, w) : ne,
2036
+ label: w && w.type !== "number" ? nt(ne, w) : ne,
2026
2037
  value: ne
2027
2038
  }))
2028
2039
  } : (p == null ? void 0 : p.kind) === "relation" ? {
2029
2040
  key: s.key,
2030
- placeholder: T,
2041
+ placeholder: R,
2031
2042
  type: "combobox",
2032
2043
  multi: !0,
2033
- cascade: k,
2034
- restricted: !!((F = Fe[m]) != null && F.length),
2035
- loadOptions: ra(p)
2044
+ cascade: y,
2045
+ restricted: !!((F = Te[m]) != null && F.length),
2046
+ loadOptions: aa(p)
2036
2047
  } : null;
2037
2048
  };
2038
2049
  if (rr.length > 0) {
@@ -2043,25 +2054,25 @@ function Xc({
2043
2054
  if (p.key === "state" || /(^|_)state$/.test(((o = p.path) == null ? void 0 : o[0]) ?? ""))
2044
2055
  w = Qe.find((b) => b.key === "state");
2045
2056
  else {
2046
- const b = Qe.filter((k) => {
2057
+ const b = Qe.filter((y) => {
2047
2058
  var Z;
2048
- if (!k.key.startsWith("extra.") || m.has(k.key)) return !1;
2049
- const X = k.key.slice(6);
2050
- return ((Z = Pn.get(X)) == null ? void 0 : Z.target_collection) === p.collection;
2051
- }), T = b.find((k) => k.key.slice(6).startsWith(`${S}.`)) ?? b[0];
2052
- w = T ? e(T) : null;
2059
+ if (!y.key.startsWith("extra.") || m.has(y.key)) return !1;
2060
+ const X = y.key.slice(6);
2061
+ return ((Z = Qn.get(X)) == null ? void 0 : Z.target_collection) === p.collection;
2062
+ }), R = b.find((y) => y.key.slice(6).startsWith(`${S}.`)) ?? b[0];
2063
+ w = R ? e(R) : null;
2053
2064
  }
2054
2065
  !w || m.has(w.key) || (m.add(w.key), s.push(p.label ? { ...w, placeholder: p.label } : w));
2055
2066
  }
2056
2067
  for (const p of Qe.map(e))
2057
- p && !m.has(p.key) && (St.has(p.key) || p.restricted) && s.push(p);
2068
+ p && !m.has(p.key) && (Ct.has(p.key) || p.restricted) && s.push(p);
2058
2069
  if (s.length > 0) return s;
2059
2070
  }
2060
- const t = Mn.map(e).filter((s) => s !== null), r = [
2061
- ...t.filter((s) => St.has(s.key) || s.restricted),
2062
- ...t.filter((s) => !St.has(s.key) && !s.restricted)
2071
+ const t = Bn.map(e).filter((s) => s !== null), r = [
2072
+ ...t.filter((s) => Ct.has(s.key) || s.restricted),
2073
+ ...t.filter((s) => !Ct.has(s.key) && !s.restricted)
2063
2074
  ].slice(0, 6);
2064
- return r.length > 0 ? r : Mn.filter((s) => s.key === "state" || s.key === "owners");
2075
+ return r.length > 0 ? r : Bn.filter((s) => s.key === "state" || s.key === "owners");
2065
2076
  })()
2066
2077
  ), Zl = (() => {
2067
2078
  if (!x) return null;
@@ -2072,7 +2083,7 @@ function Xc({
2072
2083
  label: "past SLA",
2073
2084
  tone: "text-red-600 dark:text-red-400",
2074
2085
  on: _.sla_status === "breached",
2075
- toggle: () => Ve("sla_status", "breached")
2086
+ toggle: () => Ge("sla_status", "breached")
2076
2087
  },
2077
2088
  {
2078
2089
  key: "warning",
@@ -2080,7 +2091,7 @@ function Xc({
2080
2091
  label: "SLA soon",
2081
2092
  tone: "text-amber-700 dark:text-amber-400",
2082
2093
  on: _.sla_status === "warning",
2083
- toggle: () => Ve("sla_status", "warning")
2094
+ toggle: () => Ge("sla_status", "warning")
2084
2095
  },
2085
2096
  {
2086
2097
  key: "at_risk",
@@ -2088,7 +2099,7 @@ function Xc({
2088
2099
  label: "at risk",
2089
2100
  tone: "text-red-600 dark:text-red-400",
2090
2101
  on: _.at_risk === "yes",
2091
- toggle: () => Ve("at_risk", "yes")
2102
+ toggle: () => Ge("at_risk", "yes")
2092
2103
  },
2093
2104
  {
2094
2105
  key: "unowned",
@@ -2097,7 +2108,7 @@ function Xc({
2097
2108
  tone: "text-slate-600 dark:text-slate-300",
2098
2109
  on: g === "unowned",
2099
2110
  toggle: () => {
2100
- Y(g === "unowned" ? "all" : "unowned"), O(1);
2111
+ Y(g === "unowned" ? "all" : "unowned"), A(1);
2101
2112
  }
2102
2113
  }
2103
2114
  ].filter((n) => n.n > 0 || n.on);
@@ -2113,13 +2124,13 @@ function Xc({
2113
2124
  type: "button",
2114
2125
  onClick: n.toggle,
2115
2126
  "aria-pressed": n.on,
2116
- className: R(
2127
+ className: E(
2117
2128
  "rounded px-1 tabular-nums hover:bg-slate-100 dark:hover:bg-slate-800",
2118
2129
  n.on && "bg-slate-100 dark:bg-slate-800"
2119
2130
  ),
2120
2131
  "data-queue-summary-item": n.key,
2121
2132
  children: [
2122
- /* @__PURE__ */ a("span", { className: R("font-semibold", n.tone), children: n.n.toLocaleString() }),
2133
+ /* @__PURE__ */ a("span", { className: E("font-semibold", n.tone), children: n.n.toLocaleString() }),
2123
2134
  " ",
2124
2135
  n.label
2125
2136
  ]
@@ -2127,9 +2138,9 @@ function Xc({
2127
2138
  n.key
2128
2139
  )),
2129
2140
  /* @__PURE__ */ d("span", { className: "tabular-nums", "data-queue-summary-total": !0, children: [
2130
- ((c == null ? void 0 : c.total) ?? e.total).toLocaleString(),
2141
+ ((i == null ? void 0 : i.total) ?? e.total).toLocaleString(),
2131
2142
  " item",
2132
- ((c == null ? void 0 : c.total) ?? e.total) === 1 ? "" : "s"
2143
+ ((i == null ? void 0 : i.total) ?? e.total) === 1 ? "" : "s"
2133
2144
  ] })
2134
2145
  ]
2135
2146
  }
@@ -2137,14 +2148,14 @@ function Xc({
2137
2148
  })();
2138
2149
  function eo(e) {
2139
2150
  const t = new Set(te);
2140
- t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Wn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Wn((n) => {
2151
+ t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Yn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Yn((n) => {
2141
2152
  const r = new Set(n);
2142
2153
  return r.delete(e), r;
2143
- })), Bt([...t]);
2154
+ })), jt([...t]);
2144
2155
  }
2145
- return At ? (A == null ? void 0 : A((At == null ? void 0 : At.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
2156
+ return Ot ? (K == null ? void 0 : K((Ot == null ? void 0 : Ot.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
2146
2157
  /* @__PURE__ */ d("div", { className: "shrink-0", children: [
2147
- (c == null ? void 0 : c.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
2158
+ (i == null ? void 0 : i.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
2148
2159
  /* @__PURE__ */ a(bo, { className: "h-4 w-4 shrink-0" }),
2149
2160
  /* @__PURE__ */ a("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
2150
2161
  ] }),
@@ -2154,15 +2165,15 @@ function Xc({
2154
2165
  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",
2155
2166
  "data-queue-toolbar": !0,
2156
2167
  children: [
2157
- J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ki.filter((e) => me || e.value !== "claimed").map(
2168
+ J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: wi.filter((e) => pe || e.value !== "claimed").map(
2158
2169
  (e, t) => /* @__PURE__ */ a(
2159
2170
  "button",
2160
2171
  {
2161
2172
  type: "button",
2162
2173
  onClick: () => {
2163
- Y(e.value), O(1);
2174
+ Y(e.value), A(1);
2164
2175
  },
2165
- className: R(
2176
+ className: E(
2166
2177
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
2167
2178
  t > 0 && "border-l border-slate-200 dark:border-border",
2168
2179
  g === 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"
@@ -2172,21 +2183,21 @@ function Xc({
2172
2183
  e.value
2173
2184
  )
2174
2185
  ) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
2175
- J ? Te.length <= 1 ? null : (
2186
+ J ? Re.length <= 1 ? null : (
2176
2187
  // One allowed view means nothing to switch to — no button.
2177
2188
  /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
2178
2189
  { value: "table", label: "Table" },
2179
2190
  { value: "kanban", label: "Kanban" },
2180
2191
  { value: "workload", label: "Workload" }
2181
- ].filter((e) => Te.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
2192
+ ].filter((e) => Re.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
2182
2193
  "button",
2183
2194
  {
2184
2195
  type: "button",
2185
- onClick: () => je(e.value),
2186
- className: R(
2196
+ onClick: () => Ue(e.value),
2197
+ className: E(
2187
2198
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
2188
2199
  t > 0 && "border-l border-slate-200 dark:border-border",
2189
- $ === 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"
2200
+ C === 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"
2190
2201
  ),
2191
2202
  children: e.label
2192
2203
  },
@@ -2211,7 +2222,7 @@ function Xc({
2211
2222
  ]
2212
2223
  }
2213
2224
  ),
2214
- ze && /* @__PURE__ */ d(
2225
+ Xe && /* @__PURE__ */ d(
2215
2226
  "button",
2216
2227
  {
2217
2228
  type: "button",
@@ -2228,10 +2239,10 @@ function Xc({
2228
2239
  ]
2229
2240
  }
2230
2241
  ),
2231
- ve && /* @__PURE__ */ a(
2242
+ _e && /* @__PURE__ */ a(
2232
2243
  js,
2233
2244
  {
2234
- label: E("integrations", "Integrations"),
2245
+ label: T("integrations", "Integrations"),
2235
2246
  value: _.integrations,
2236
2247
  onChange: (e) => Q((t) => {
2237
2248
  const n = { ...t };
@@ -2241,7 +2252,7 @@ function Xc({
2241
2252
  ),
2242
2253
  /* @__PURE__ */ a(Xs, { className: "h-8" }),
2243
2254
  /* @__PURE__ */ a(Ds, {}),
2244
- an > 0 && /* @__PURE__ */ d(
2255
+ ln > 0 && /* @__PURE__ */ d(
2245
2256
  "button",
2246
2257
  {
2247
2258
  type: "button",
@@ -2249,36 +2260,36 @@ function Xc({
2249
2260
  className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
2250
2261
  children: [
2251
2262
  /* @__PURE__ */ a(fo, { className: "h-3 w-3" }),
2252
- an,
2263
+ ln,
2253
2264
  " update",
2254
- an === 1 ? "" : "s",
2265
+ ln === 1 ? "" : "s",
2255
2266
  " · Refresh"
2256
2267
  ]
2257
2268
  }
2258
2269
  ),
2259
2270
  /* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
2260
- $ === "table" && /* @__PURE__ */ d(nt, { children: [
2261
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2271
+ C === "table" && /* @__PURE__ */ d(rt, { children: [
2272
+ /* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
2262
2273
  "button",
2263
2274
  {
2264
2275
  type: "button",
2265
- className: R(
2276
+ className: E(
2266
2277
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2267
- C ? "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"
2278
+ $ ? "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"
2268
2279
  ),
2269
2280
  children: [
2270
- /* @__PURE__ */ a(wa, { className: "h-3.5 w-3.5" }),
2271
- C ? `Group: ${((da = na.find((e) => e.value === C)) == null ? void 0 : da.label) ?? C}` : "Group"
2281
+ /* @__PURE__ */ a(_a, { className: "h-3.5 w-3.5" }),
2282
+ $ ? `Group: ${((ua = ra.find((e) => e.value === $)) == null ? void 0 : ua.label) ?? $}` : "Group"
2272
2283
  ]
2273
2284
  }
2274
2285
  ) }),
2275
- /* @__PURE__ */ a(at, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ta, { children: [
2286
+ /* @__PURE__ */ a(lt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ra, { children: [
2276
2287
  /* @__PURE__ */ a(ai, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2277
- /* @__PURE__ */ d(Ra, { children: [
2288
+ /* @__PURE__ */ d(Ea, { children: [
2278
2289
  /* @__PURE__ */ a(li, { children: "No attribute found." }),
2279
- /* @__PURE__ */ a(qt, { value: "__none__", onSelect: () => ot(null), children: "None" }),
2280
- na.map((e) => /* @__PURE__ */ a(
2281
- qt,
2290
+ /* @__PURE__ */ a(Ft, { value: "__none__", onSelect: () => ot(null), children: "None" }),
2291
+ ra.map((e) => /* @__PURE__ */ a(
2292
+ Ft,
2282
2293
  {
2283
2294
  value: e.label,
2284
2295
  onSelect: () => ot(e.value),
@@ -2289,14 +2300,14 @@ function Xc({
2289
2300
  ] })
2290
2301
  ] }) })
2291
2302
  ] }),
2292
- $ === "table" && /* @__PURE__ */ d(
2303
+ C === "table" && /* @__PURE__ */ d(
2293
2304
  "button",
2294
2305
  {
2295
2306
  type: "button",
2296
2307
  onClick: () => {
2297
- Ue(I === "-priority" ? "" : "-priority"), O(1);
2308
+ Ie(I === "-priority" ? "" : "-priority"), A(1);
2298
2309
  },
2299
- className: R(
2310
+ className: E(
2300
2311
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2301
2312
  I === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2302
2313
  ),
@@ -2306,43 +2317,43 @@ function Xc({
2306
2317
  ]
2307
2318
  }
2308
2319
  ),
2309
- $ === "table" && C && le && /* @__PURE__ */ a(
2320
+ C === "table" && $ && le && /* @__PURE__ */ a(
2310
2321
  "button",
2311
2322
  {
2312
2323
  type: "button",
2313
- onClick: () => tn(
2314
- ye.size > 0 ? /* @__PURE__ */ new Set() : new Set(le.map((e) => e.key))
2324
+ onClick: () => nn(
2325
+ ke.size > 0 ? /* @__PURE__ */ new Set() : new Set(le.map((e) => e.key))
2315
2326
  ),
2316
2327
  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",
2317
- children: ye.size > 0 ? "Expand all" : "Collapse all"
2328
+ children: ke.size > 0 ? "Expand all" : "Collapse all"
2318
2329
  }
2319
2330
  ),
2320
- $ === "kanban" && /* @__PURE__ */ d(nt, { children: [
2321
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2331
+ C === "kanban" && /* @__PURE__ */ d(rt, { children: [
2332
+ /* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
2322
2333
  "button",
2323
2334
  {
2324
2335
  type: "button",
2325
- className: R(
2336
+ className: E(
2326
2337
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2327
2338
  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"
2328
2339
  ),
2329
2340
  children: [
2330
- /* @__PURE__ */ a(wa, { className: "h-3.5 w-3.5" }),
2341
+ /* @__PURE__ */ a(_a, { className: "h-3.5 w-3.5" }),
2331
2342
  st ? `Lanes: ${st === "collection" ? "Collection" : "Owner"}` : "Lanes"
2332
2343
  ]
2333
2344
  }
2334
2345
  ) }),
2335
- /* @__PURE__ */ a(at, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Ta, { children: /* @__PURE__ */ d(Ra, { children: [
2336
- /* @__PURE__ */ a(qt, { value: "none", onSelect: () => nn(null), children: "None" }),
2337
- /* @__PURE__ */ a(qt, { value: "collection", onSelect: () => nn("collection"), children: "Collection" }),
2338
- /* @__PURE__ */ a(qt, { value: "owner", onSelect: () => nn("owners"), children: "Owner" })
2346
+ /* @__PURE__ */ a(lt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Ra, { children: /* @__PURE__ */ d(Ea, { children: [
2347
+ /* @__PURE__ */ a(Ft, { value: "none", onSelect: () => rn(null), children: "None" }),
2348
+ /* @__PURE__ */ a(Ft, { value: "collection", onSelect: () => rn("collection"), children: "Collection" }),
2349
+ /* @__PURE__ */ a(Ft, { value: "owner", onSelect: () => rn("owners"), children: "Owner" })
2339
2350
  ] }) }) })
2340
2351
  ] }),
2341
- G && i && /* @__PURE__ */ d(
2352
+ G && c && /* @__PURE__ */ d(
2342
2353
  "button",
2343
2354
  {
2344
2355
  type: "button",
2345
- onClick: () => G({ id: i.id, name: i.name }),
2356
+ onClick: () => G({ id: c.id, name: c.name }),
2346
2357
  "data-tip": "Open Ask AI with a question about this queue",
2347
2358
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2348
2359
  "data-queue-ask": !0,
@@ -2357,10 +2368,10 @@ function Xc({
2357
2368
  "button",
2358
2369
  {
2359
2370
  type: "button",
2360
- onClick: () => Va((e) => !e),
2371
+ onClick: () => Ga((e) => !e),
2361
2372
  "aria-expanded": ct,
2362
2373
  title: "Trends, aging, pace and states",
2363
- className: R(
2374
+ className: E(
2364
2375
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2365
2376
  ct ? "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"
2366
2377
  ),
@@ -2371,8 +2382,8 @@ function Xc({
2371
2382
  ]
2372
2383
  }
2373
2384
  ),
2374
- $ === "table" && /* @__PURE__ */ d(nt, { children: [
2375
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2385
+ C === "table" && /* @__PURE__ */ d(rt, { children: [
2386
+ /* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
2376
2387
  "button",
2377
2388
  {
2378
2389
  type: "button",
@@ -2383,16 +2394,16 @@ function Xc({
2383
2394
  ]
2384
2395
  }
2385
2396
  ) }),
2386
- /* @__PURE__ */ a(at, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
2397
+ /* @__PURE__ */ a(lt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
2387
2398
  lo,
2388
2399
  {
2389
2400
  sensors: Wl,
2390
2401
  collisionDetection: oo,
2391
2402
  onDragEnd: Hl,
2392
- children: /* @__PURE__ */ a(so, { items: ea, strategy: io, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: ea.map((e) => {
2393
- const t = Kn.find((n) => n.key === e);
2403
+ children: /* @__PURE__ */ a(so, { items: ta, strategy: io, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: ta.map((e) => {
2404
+ const t = Mn.find((n) => n.key === e);
2394
2405
  return /* @__PURE__ */ a(
2395
- Ci,
2406
+ qi,
2396
2407
  {
2397
2408
  id: e,
2398
2409
  label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
@@ -2405,7 +2416,7 @@ function Xc({
2405
2416
  }
2406
2417
  ) })
2407
2418
  ] }),
2408
- $ === "table" && Kt && /* @__PURE__ */ d(
2419
+ C === "table" && Pt && /* @__PURE__ */ d(
2409
2420
  "button",
2410
2421
  {
2411
2422
  type: "button",
@@ -2420,29 +2431,29 @@ function Xc({
2420
2431
  ]
2421
2432
  }
2422
2433
  ),
2423
- $ === "table" && /* @__PURE__ */ a(
2434
+ C === "table" && /* @__PURE__ */ a(
2424
2435
  "button",
2425
2436
  {
2426
2437
  type: "button",
2427
2438
  onClick: () => {
2428
- const e = Tt === "compact" ? "comfortable" : "compact";
2429
- La(e);
2439
+ const e = Rt === "compact" ? "comfortable" : "compact";
2440
+ Aa(e);
2430
2441
  try {
2431
2442
  localStorage.setItem("nvr_table_density", e);
2432
2443
  } catch {
2433
2444
  }
2434
2445
  },
2435
2446
  "aria-label": "Row density",
2436
- title: Tt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2447
+ title: Rt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2437
2448
  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",
2438
- children: Tt === "compact" ? /* @__PURE__ */ a(wo, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(_o, { className: "h-3.5 w-3.5" })
2449
+ children: Rt === "compact" ? /* @__PURE__ */ a(wo, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(_o, { className: "h-3.5 w-3.5" })
2439
2450
  }
2440
2451
  ),
2441
- $ === "table" && Pa && oe.length > 0 && /* @__PURE__ */ d(
2452
+ C === "table" && Ma && oe.length > 0 && /* @__PURE__ */ d(
2442
2453
  "button",
2443
2454
  {
2444
2455
  type: "button",
2445
- onClick: () => Er(),
2456
+ onClick: () => Lr(),
2446
2457
  className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110",
2447
2458
  children: [
2448
2459
  /* @__PURE__ */ a(No, { className: "h-3 w-3 fill-current" }),
@@ -2450,21 +2461,21 @@ function Xc({
2450
2461
  ]
2451
2462
  }
2452
2463
  ),
2453
- !dn && re.length === 1 && (Dt ? /* @__PURE__ */ d(nt, { children: [
2454
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2464
+ !pn && re.length === 1 && (Kt ? /* @__PURE__ */ d(rt, { children: [
2465
+ /* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
2455
2466
  "button",
2456
2467
  {
2457
2468
  type: "button",
2458
2469
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2459
2470
  children: [
2460
- /* @__PURE__ */ a(Zt, { className: "h-3.5 w-3.5" }),
2471
+ /* @__PURE__ */ a(en, { className: "h-3.5 w-3.5" }),
2461
2472
  "New ",
2462
- Un(re[0]),
2463
- /* @__PURE__ */ a(_a, { className: "h-3 w-3 opacity-60" })
2473
+ Vn(re[0]),
2474
+ /* @__PURE__ */ a(Na, { className: "h-3 w-3 opacity-60" })
2464
2475
  ]
2465
2476
  }
2466
2477
  ) }),
2467
- /* @__PURE__ */ d(at, { align: "end", className: "w-60 p-1", children: [
2478
+ /* @__PURE__ */ d(lt, { align: "end", className: "w-60 p-1", children: [
2468
2479
  /* @__PURE__ */ d(
2469
2480
  "button",
2470
2481
  {
@@ -2477,12 +2488,12 @@ function Xc({
2477
2488
  }),
2478
2489
  className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2479
2490
  children: [
2480
- ((ua = Dt.active) == null ? void 0 : ua.create_label) ?? ((ma = Dt.active) == null ? void 0 : ma.name) ?? "Default layout",
2491
+ ((ma = Kt.active) == null ? void 0 : ma.create_label) ?? ((pa = Kt.active) == null ? void 0 : pa.name) ?? "Default layout",
2481
2492
  /* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2482
2493
  ]
2483
2494
  }
2484
2495
  ),
2485
- Dt.options.map((e) => /* @__PURE__ */ a(
2496
+ Kt.options.map((e) => /* @__PURE__ */ a(
2486
2497
  "button",
2487
2498
  {
2488
2499
  type: "button",
@@ -2510,26 +2521,26 @@ function Xc({
2510
2521
  }),
2511
2522
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2512
2523
  children: [
2513
- /* @__PURE__ */ a(Zt, { className: "h-3.5 w-3.5" }),
2524
+ /* @__PURE__ */ a(en, { className: "h-3.5 w-3.5" }),
2514
2525
  "New ",
2515
- Un(re[0])
2526
+ Vn(re[0])
2516
2527
  ]
2517
2528
  }
2518
2529
  )),
2519
- !dn && re.length > 1 && /* @__PURE__ */ d(nt, { children: [
2520
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2530
+ !pn && re.length > 1 && /* @__PURE__ */ d(rt, { children: [
2531
+ /* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
2521
2532
  "button",
2522
2533
  {
2523
2534
  type: "button",
2524
2535
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2525
2536
  children: [
2526
- /* @__PURE__ */ a(Zt, { className: "h-3.5 w-3.5" }),
2537
+ /* @__PURE__ */ a(en, { className: "h-3.5 w-3.5" }),
2527
2538
  "New",
2528
- /* @__PURE__ */ a(_a, { className: "h-3 w-3 opacity-60" })
2539
+ /* @__PURE__ */ a(Na, { className: "h-3 w-3 opacity-60" })
2529
2540
  ]
2530
2541
  }
2531
2542
  ) }),
2532
- /* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children: re.map((e) => /* @__PURE__ */ d(
2543
+ /* @__PURE__ */ a(lt, { align: "end", className: "w-56 p-1", children: re.map((e) => /* @__PURE__ */ d(
2533
2544
  "button",
2534
2545
  {
2535
2546
  type: "button",
@@ -2540,18 +2551,18 @@ function Xc({
2540
2551
  }),
2541
2552
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2542
2553
  children: [
2543
- /* @__PURE__ */ a(Zt, { className: "h-3 w-3 opacity-60" }),
2544
- Un(e)
2554
+ /* @__PURE__ */ a(en, { className: "h-3 w-3 opacity-60" }),
2555
+ Vn(e)
2545
2556
  ]
2546
2557
  },
2547
2558
  e
2548
2559
  )) })
2549
2560
  ] }),
2550
- !dn && Ie && xe && /* @__PURE__ */ a(
2561
+ !pn && Ve && ye && /* @__PURE__ */ a(
2551
2562
  Ms,
2552
2563
  {
2553
- collection: Ie,
2554
- onParsed: (e, t) => xe(`/collections/${Ie}/new`, {
2564
+ collection: Ve,
2565
+ onParsed: (e, t) => ye(`/collections/${Ve}/new`, {
2555
2566
  state: { importResult: e, importTemplateId: t.id }
2556
2567
  })
2557
2568
  }
@@ -2568,80 +2579,80 @@ function Xc({
2568
2579
  children: [
2569
2580
  /* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex divide-x divide-slate-200 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
2570
2581
  /* @__PURE__ */ a(
2571
- Ft,
2582
+ Tt,
2572
2583
  {
2573
2584
  label: "Total",
2574
2585
  count: (x == null ? void 0 : x.total) ?? 0,
2575
2586
  filteredCount: z ? z.total : null,
2576
- active: Object.values(_).every(Ua) && g === "all",
2577
- isLoading: We,
2578
- ...ht("total"),
2579
- onClick: Ia
2587
+ active: Object.values(_).every(Ia) && g === "all",
2588
+ isLoading: He,
2589
+ ...ft("total"),
2590
+ onClick: Va
2580
2591
  }
2581
2592
  ),
2582
2593
  /* @__PURE__ */ a(
2583
- Ft,
2594
+ Tt,
2584
2595
  {
2585
2596
  label: "Warning",
2586
2597
  count: (x == null ? void 0 : x.sla_warning) ?? 0,
2587
2598
  filteredCount: z ? z.sla_warning : null,
2588
2599
  tone: "amber",
2589
2600
  active: _.sla_status === "warning",
2590
- isLoading: We,
2601
+ isLoading: He,
2591
2602
  deltaBadIsUp: !0,
2592
- ...ht("sla_warning"),
2593
- onClick: () => Ve("sla_status", "warning")
2603
+ ...ft("sla_warning"),
2604
+ onClick: () => Ge("sla_status", "warning")
2594
2605
  }
2595
2606
  ),
2596
2607
  /* @__PURE__ */ a(
2597
- Ft,
2608
+ Tt,
2598
2609
  {
2599
2610
  label: "Breached",
2600
2611
  count: (x == null ? void 0 : x.sla_breached) ?? 0,
2601
2612
  filteredCount: z ? z.sla_breached : null,
2602
2613
  tone: "red",
2603
2614
  active: _.sla_status === "breached",
2604
- isLoading: We,
2615
+ isLoading: He,
2605
2616
  deltaBadIsUp: !0,
2606
- ...ht("sla_breached"),
2607
- onClick: () => Ve("sla_status", "breached")
2617
+ ...ft("sla_breached"),
2618
+ onClick: () => Ge("sla_status", "breached")
2608
2619
  }
2609
2620
  ),
2610
2621
  /* @__PURE__ */ a(
2611
- Ft,
2622
+ Tt,
2612
2623
  {
2613
2624
  label: "At Risk",
2614
2625
  count: (x == null ? void 0 : x.at_risk) ?? 0,
2615
2626
  filteredCount: z ? z.at_risk : null,
2616
2627
  tone: "red",
2617
2628
  active: _.at_risk === "yes",
2618
- isLoading: We,
2629
+ isLoading: He,
2619
2630
  deltaBadIsUp: !0,
2620
- ...ht("at_risk"),
2621
- onClick: () => Ve("at_risk", "yes")
2631
+ ...ft("at_risk"),
2632
+ onClick: () => Ge("at_risk", "yes")
2622
2633
  }
2623
2634
  ),
2624
2635
  /* @__PURE__ */ a(
2625
- Ft,
2636
+ Tt,
2626
2637
  {
2627
2638
  label: "Unowned",
2628
2639
  count: (x == null ? void 0 : x.unowned) ?? 0,
2629
2640
  filteredCount: z ? z.unowned : null,
2630
2641
  active: g === "unowned",
2631
- isLoading: We,
2642
+ isLoading: He,
2632
2643
  deltaBadIsUp: !0,
2633
- ...ht("unowned"),
2644
+ ...ft("unowned"),
2634
2645
  onClick: () => {
2635
- Y(g === "unowned" ? "all" : "unowned"), O(1);
2646
+ Y(g === "unowned" ? "all" : "unowned"), A(1);
2636
2647
  }
2637
2648
  }
2638
2649
  )
2639
2650
  ] }),
2640
- pt && x && x.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
2641
- ["0-1d", "0:24", pt.d1],
2642
- ["1-3d", "24:72", pt.d3],
2643
- ["3-7d", "72:168", pt.d7],
2644
- ["7d+", "168:", pt.over]
2651
+ bt && x && x.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
2652
+ ["0-1d", "0:24", bt.d1],
2653
+ ["1-3d", "24:72", bt.d3],
2654
+ ["3-7d", "72:168", bt.d7],
2655
+ ["7d+", "168:", bt.over]
2645
2656
  ].map(([e, t, n]) => /* @__PURE__ */ d(
2646
2657
  "button",
2647
2658
  {
@@ -2650,9 +2661,9 @@ function Xc({
2650
2661
  Q((r) => ({
2651
2662
  ...r,
2652
2663
  aging_hours: r.aging_hours === t ? "" : t
2653
- })), O(1);
2664
+ })), A(1);
2654
2665
  },
2655
- className: R(
2666
+ className: E(
2656
2667
  "rounded-md border px-2 py-1 tabular-nums transition-colors",
2657
2668
  _.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",
2658
2669
  n === 0 && "opacity-45"
@@ -2665,38 +2676,38 @@ function Xc({
2665
2676
  },
2666
2677
  e
2667
2678
  )) }),
2668
- ge && /* @__PURE__ */ a(
2679
+ xe && /* @__PURE__ */ a(
2669
2680
  "span",
2670
2681
  {
2671
2682
  "data-queue-burndown": !0,
2672
- 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"}`,
2683
+ className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${xe.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" : xe.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"}`,
2673
2684
  "data-tip": "Average net change per day over the last 14 days of snapshots",
2674
- children: ge.dir === "down" ? /* @__PURE__ */ d(Ce, { children: [
2685
+ children: xe.dir === "down" ? /* @__PURE__ */ d(qe, { children: [
2675
2686
  "▼ ",
2676
- Math.abs(ge.pace).toFixed(1),
2687
+ Math.abs(xe.pace).toFixed(1),
2677
2688
  "/day — clears in ~",
2678
- ge.days,
2689
+ xe.days,
2679
2690
  " day",
2680
- ge.days === 1 ? "" : "s",
2691
+ xe.days === 1 ? "" : "s",
2681
2692
  " at this pace"
2682
- ] }) : ge.dir === "up" ? /* @__PURE__ */ d(Ce, { children: [
2693
+ ] }) : xe.dir === "up" ? /* @__PURE__ */ d(qe, { children: [
2683
2694
  "▲ Growing ",
2684
- ge.pace.toFixed(1),
2695
+ xe.pace.toFixed(1),
2685
2696
  "/day"
2686
- ] }) : /* @__PURE__ */ a(Ce, { children: "→ Holding steady" })
2697
+ ] }) : /* @__PURE__ */ a(qe, { children: "→ Holding steady" })
2687
2698
  }
2688
2699
  ),
2689
- Tr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Tr.map(([e, t]) => {
2700
+ Rr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Rr.map(([e, t]) => {
2690
2701
  var n;
2691
2702
  return /* @__PURE__ */ a(
2692
- Si,
2703
+ $i,
2693
2704
  {
2694
2705
  label: Ae(e),
2695
2706
  count: t,
2696
2707
  filteredCount: z ? z.by_state[e] ?? 0 : null,
2697
- color: ((n = we[e]) == null ? void 0 : n.color) ?? null,
2698
- active: ja.includes(e),
2699
- onClick: () => Ba(e)
2708
+ color: ((n = Ne[e]) == null ? void 0 : n.color) ?? null,
2709
+ active: Ua.includes(e),
2710
+ onClick: () => ja(e)
2700
2711
  },
2701
2712
  e
2702
2713
  );
@@ -2704,17 +2715,17 @@ function Xc({
2704
2715
  ]
2705
2716
  }
2706
2717
  ),
2707
- $ !== "workload" && /* @__PURE__ */ a(
2708
- bi,
2718
+ C !== "workload" && /* @__PURE__ */ a(
2719
+ fi,
2709
2720
  {
2710
2721
  defs: Xl,
2711
2722
  values: _,
2712
- seededKeys: St,
2723
+ seededKeys: Ct,
2713
2724
  onApply: (e) => {
2714
- Q((t) => ({ ...t, ...e })), O(1);
2725
+ Q((t) => ({ ...t, ...e })), A(1);
2715
2726
  },
2716
2727
  onClear: () => {
2717
- Q({ ...ue.current }), O(1);
2728
+ Q({ ...me.current }), A(1);
2718
2729
  },
2719
2730
  right: Zl
2720
2731
  }
@@ -2725,19 +2736,19 @@ function Xc({
2725
2736
  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",
2726
2737
  "data-queue-saved-views": !0,
2727
2738
  children: [
2728
- ((c == null ? void 0 : c.total) ?? 0) > 0 && pe > 0 && /* @__PURE__ */ d(
2739
+ ((i == null ? void 0 : i.total) ?? 0) > 0 && be > 0 && /* @__PURE__ */ d(
2729
2740
  "span",
2730
2741
  {
2731
- "data-queue-default-hiding": pe,
2742
+ "data-queue-default-hiding": be,
2732
2743
  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",
2733
2744
  children: [
2734
2745
  "Your default ",
2735
- mr(Qn),
2746
+ mr(jn),
2736
2747
  " filter is hiding",
2737
2748
  " ",
2738
- pe.toLocaleString("en-US"),
2749
+ be.toLocaleString("en-US"),
2739
2750
  " item",
2740
- pe === 1 ? "" : "s",
2751
+ be === 1 ? "" : "s",
2741
2752
  " ·",
2742
2753
  /* @__PURE__ */ a(
2743
2754
  "button",
@@ -2762,7 +2773,7 @@ function Xc({
2762
2773
  _.owners.map(
2763
2774
  (e) => {
2764
2775
  var t, n;
2765
- return ((n = (t = c == null ? void 0 : c.available_values.owners) == null ? void 0 : t.find(
2776
+ return ((n = (t = i == null ? void 0 : i.available_values.owners) == null ? void 0 : t.find(
2766
2777
  (r) => String(r.id).toUpperCase() === String(e).toUpperCase()
2767
2778
  )) == null ? void 0 : n.name) ?? "someone";
2768
2779
  }
@@ -2777,7 +2788,7 @@ function Xc({
2777
2788
  Q((e) => {
2778
2789
  const { owners: t, ...n } = e;
2779
2790
  return n;
2780
- }), O(1);
2791
+ }), A(1);
2781
2792
  },
2782
2793
  className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
2783
2794
  children: "✕"
@@ -2792,9 +2803,9 @@ function Xc({
2792
2803
  type: "button",
2793
2804
  onClick: wl,
2794
2805
  title: "Revert to the queue default (filters, columns and sort cleared)",
2795
- className: R(
2806
+ className: E(
2796
2807
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
2797
- Xe == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2808
+ Ze == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2798
2809
  ),
2799
2810
  children: "Default"
2800
2811
  }
@@ -2804,49 +2815,49 @@ function Xc({
2804
2815
  return /* @__PURE__ */ d(
2805
2816
  "span",
2806
2817
  {
2807
- className: R(
2818
+ className: E(
2808
2819
  "group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
2809
- Xe === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2820
+ Ze === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2810
2821
  ),
2811
2822
  children: [
2812
2823
  /* @__PURE__ */ a(
2813
2824
  "button",
2814
2825
  {
2815
2826
  type: "button",
2816
- title: Je === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2817
- onClick: () => ql.mutate(Je === e.id ? null : e.id),
2818
- className: R(
2827
+ title: ze === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2828
+ onClick: () => ql.mutate(ze === e.id ? null : e.id),
2829
+ className: E(
2819
2830
  "shrink-0",
2820
- Je === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2831
+ ze === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2821
2832
  ),
2822
2833
  children: /* @__PURE__ */ a(
2823
2834
  So,
2824
2835
  {
2825
- className: R("h-3 w-3", Je === e.id && "fill-current"),
2826
- "aria-label": Je === e.id ? "Default view" : "Set as default"
2836
+ className: E("h-3 w-3", ze === e.id && "fill-current"),
2837
+ "aria-label": ze === e.id ? "Default view" : "Set as default"
2827
2838
  }
2828
2839
  )
2829
2840
  }
2830
2841
  ),
2831
- /* @__PURE__ */ d("button", { type: "button", onClick: () => vt(e), children: [
2842
+ /* @__PURE__ */ d("button", { type: "button", onClick: () => wt(e), children: [
2832
2843
  e.name,
2833
2844
  e.is_default ? /* @__PURE__ */ a("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ a("span", { className: "ml-1 text-slate-400", children: "· shared" })
2834
2845
  ] }),
2835
- Yt && /* @__PURE__ */ a(
2846
+ Jt && /* @__PURE__ */ a(
2836
2847
  "button",
2837
2848
  {
2838
2849
  type: "button",
2839
2850
  onClick: () => $l.mutate({ viewId: e.id, on: !e.is_default }),
2840
2851
  title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
2841
- className: R(
2852
+ className: E(
2842
2853
  "shrink-0",
2843
2854
  e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2844
2855
  ),
2845
2856
  "aria-label": e.is_default ? "Unset queue default" : "Set queue default",
2846
- children: /* @__PURE__ */ a(Co, { className: R("h-3 w-3", e.is_default && "fill-current") })
2857
+ children: /* @__PURE__ */ a(Co, { className: E("h-3 w-3", e.is_default && "fill-current") })
2847
2858
  }
2848
2859
  ),
2849
- (e.user === N || De) && Xe === e.id && /* @__PURE__ */ a(
2860
+ (e.user === N || De) && Ze === e.id && /* @__PURE__ */ a(
2850
2861
  "button",
2851
2862
  {
2852
2863
  type: "button",
@@ -2855,8 +2866,8 @@ function Xc({
2855
2866
  title: "Update this view with the current filters, scope and sort",
2856
2867
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2857
2868
  "aria-label": `Update view ${e.name}`,
2858
- "data-view-update-state": Ke.isPending ? "saving" : Mr === e.id ? "saved" : "idle",
2859
- children: Ke.isPending && ((t = Ke.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a($o, { className: "h-3 w-3 animate-spin" }) : Mr === e.id ? /* @__PURE__ */ a(
2869
+ "data-view-update-state": Ke.isPending ? "saving" : Qr === e.id ? "saved" : "idle",
2870
+ children: Ke.isPending && ((t = Ke.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a($o, { className: "h-3 w-3 animate-spin" }) : Qr === e.id ? /* @__PURE__ */ a(
2860
2871
  qo,
2861
2872
  {
2862
2873
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
@@ -2865,21 +2876,21 @@ function Xc({
2865
2876
  ) : /* @__PURE__ */ a(Fo, { className: "h-3 w-3" })
2866
2877
  }
2867
2878
  ),
2868
- Xe === e.id && /* @__PURE__ */ a(
2879
+ Ze === e.id && /* @__PURE__ */ a(
2869
2880
  "button",
2870
2881
  {
2871
2882
  type: "button",
2872
- onClick: () => Wa(e.id),
2873
- title: Pt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2874
- className: R(
2883
+ onClick: () => Ha(e.id),
2884
+ title: Mt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2885
+ className: E(
2875
2886
  "shrink-0",
2876
- Pt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2887
+ Mt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2877
2888
  ),
2878
2889
  "aria-label": `Subscribe to view ${e.name}`,
2879
- children: /* @__PURE__ */ a(To, { className: R("h-3 w-3", Pt(e.id) && "fill-current") })
2890
+ children: /* @__PURE__ */ a(To, { className: E("h-3 w-3", Mt(e.id) && "fill-current") })
2880
2891
  }
2881
2892
  ),
2882
- e.user === N && (Rn === e.id ? /* @__PURE__ */ d(
2893
+ e.user === N && (Ln === e.id ? /* @__PURE__ */ d(
2883
2894
  "span",
2884
2895
  {
2885
2896
  className: "flex shrink-0 items-center gap-1",
@@ -2890,8 +2901,8 @@ function Xc({
2890
2901
  "button",
2891
2902
  {
2892
2903
  type: "button",
2893
- onClick: () => Br.mutate(e.id),
2894
- disabled: Br.isPending,
2904
+ onClick: () => jr.mutate(e.id),
2905
+ disabled: jr.isPending,
2895
2906
  className: "font-semibold text-red-600 hover:underline disabled:opacity-50 dark:text-red-400",
2896
2907
  "aria-label": `Yes, delete view ${e.name}`,
2897
2908
  children: "Yes"
@@ -2901,7 +2912,7 @@ function Xc({
2901
2912
  "button",
2902
2913
  {
2903
2914
  type: "button",
2904
- onClick: () => Jt(null),
2915
+ onClick: () => zt(null),
2905
2916
  className: "text-slate-500 hover:underline dark:text-slate-400",
2906
2917
  "aria-label": `Keep view ${e.name}`,
2907
2918
  children: "No"
@@ -2913,7 +2924,7 @@ function Xc({
2913
2924
  "button",
2914
2925
  {
2915
2926
  type: "button",
2916
- onClick: () => Jt(e.id),
2927
+ onClick: () => zt(e.id),
2917
2928
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
2918
2929
  "aria-label": `Delete view ${e.name}`,
2919
2930
  children: "×"
@@ -2924,8 +2935,8 @@ function Xc({
2924
2935
  e.id
2925
2936
  );
2926
2937
  }),
2927
- /* @__PURE__ */ d(nt, { open: vl, onOpenChange: Fn, children: [
2928
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ a(
2938
+ /* @__PURE__ */ d(rt, { open: vl, onOpenChange: Rn, children: [
2939
+ /* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ a(
2929
2940
  "button",
2930
2941
  {
2931
2942
  type: "button",
@@ -2934,16 +2945,16 @@ function Xc({
2934
2945
  children: "☆ Save view"
2935
2946
  }
2936
2947
  ) }),
2937
- /* @__PURE__ */ d(at, { className: "w-[240px] p-3", align: "end", children: [
2948
+ /* @__PURE__ */ d(lt, { className: "w-[240px] p-3", align: "end", children: [
2938
2949
  (() => {
2939
- const e = j == null ? void 0 : j.data.find((t) => t.id === Xe);
2950
+ const e = j == null ? void 0 : j.data.find((t) => t.id === Ze);
2940
2951
  return !e || e.user !== N && !De ? null : /* @__PURE__ */ d(
2941
2952
  "button",
2942
2953
  {
2943
2954
  type: "button",
2944
2955
  disabled: Ke.isPending,
2945
2956
  onClick: () => {
2946
- Ke.mutate(e), Fn(!1);
2957
+ Ke.mutate(e), Rn(!1);
2947
2958
  },
2948
2959
  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",
2949
2960
  children: [
@@ -2957,29 +2968,29 @@ function Xc({
2957
2968
  /* @__PURE__ */ a(
2958
2969
  "input",
2959
2970
  {
2960
- value: Tn,
2961
- onChange: (e) => Lr(e.target.value),
2971
+ value: En,
2972
+ onChange: (e) => Ar(e.target.value),
2962
2973
  placeholder: "View name",
2963
2974
  className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
2964
2975
  }
2965
2976
  ),
2966
- Yt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2977
+ Jt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2967
2978
  /* @__PURE__ */ a(
2968
- Vn,
2979
+ Wn,
2969
2980
  {
2970
- checked: Ar || kt,
2971
- disabled: kt,
2972
- onCheckedChange: (e) => Or(e === !0)
2981
+ checked: Or || vt,
2982
+ disabled: vt,
2983
+ onCheckedChange: (e) => Dr(e === !0)
2973
2984
  }
2974
2985
  ),
2975
2986
  "Share with everyone"
2976
2987
  ] }),
2977
- Yt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2988
+ Jt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2978
2989
  /* @__PURE__ */ a(
2979
- Vn,
2990
+ Wn,
2980
2991
  {
2981
- checked: kt,
2982
- onCheckedChange: (e) => Dr(e === !0)
2992
+ checked: vt,
2993
+ onCheckedChange: (e) => Kr(e === !0)
2983
2994
  }
2984
2995
  ),
2985
2996
  "Set as queue default (everyone starts here)"
@@ -2988,8 +2999,8 @@ function Xc({
2988
2999
  "button",
2989
3000
  {
2990
3001
  type: "button",
2991
- disabled: !Tn.trim() || Pr.isPending,
2992
- onClick: () => Pr.mutate(),
3002
+ disabled: !En.trim() || Mr.isPending,
3003
+ onClick: () => Mr.mutate(),
2993
3004
  className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
2994
3005
  children: "Save current view"
2995
3006
  }
@@ -3000,30 +3011,30 @@ function Xc({
3000
3011
  }
3001
3012
  )
3002
3013
  ] }),
3003
- /* @__PURE__ */ d("div", { ref: Wt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
3004
- cr && /* @__PURE__ */ a(Is, { error: Xa, onRetry: () => void Za(), className: "mb-3" }),
3005
- Bn && /* @__PURE__ */ a(
3014
+ /* @__PURE__ */ d("div", { ref: Ht, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
3015
+ cr && /* @__PURE__ */ a(Is, { error: Za, onRetry: () => void el(), className: "mb-3" }),
3016
+ Un && /* @__PURE__ */ a(
3006
3017
  "p",
3007
3018
  {
3008
3019
  "data-filter-sentence": !0,
3009
- "data-tip": Bn,
3020
+ "data-tip": Un,
3010
3021
  "aria-live": "polite",
3011
3022
  className: "mb-1.5 shrink-0 truncate px-0.5 text-[11.5px] text-slate-500 dark:text-slate-400",
3012
- children: Bn
3023
+ children: Un
3013
3024
  }
3014
3025
  ),
3015
- $ === "table" ? /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
3026
+ C === "table" ? /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
3016
3027
  "div",
3017
3028
  {
3018
- ref: $e.rootRef,
3019
- className: R(
3029
+ ref: Fe.rootRef,
3030
+ className: E(
3020
3031
  "relative min-w-0 flex-1 transition-opacity duration-200",
3021
3032
  br && "pointer-events-none opacity-60"
3022
3033
  ),
3023
3034
  "aria-busy": br || void 0,
3024
3035
  children: [
3025
3036
  hr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
3026
- rl.text ?? "Still working",
3037
+ al.text ?? "Still working",
3027
3038
  " — ",
3028
3039
  hr,
3029
3040
  "s"
@@ -3032,41 +3043,41 @@ function Xc({
3032
3043
  As,
3033
3044
  {
3034
3045
  fillHeight: !0,
3035
- enterKey: kr.current,
3036
- density: Tt,
3046
+ enterKey: vr.current,
3047
+ density: Rt,
3037
3048
  minBodyHeight: 360,
3038
- columns: zt,
3049
+ columns: Xt,
3039
3050
  rows: q,
3040
3051
  rowKey: (e) => `${e.collection}:${e.item_id}`,
3041
- total: (c == null ? void 0 : c.total) ?? 0,
3052
+ total: (i == null ? void 0 : i.total) ?? 0,
3042
3053
  page: de,
3043
- limit: cn,
3044
- isLoading: We,
3045
- onPageChange: O,
3046
- onRowClick: (e) => Gt(e),
3054
+ limit: mn,
3055
+ isLoading: He,
3056
+ onPageChange: A,
3057
+ onRowClick: (e) => Wt(e),
3047
3058
  rowDragProps: (e) => ({
3048
- ...cl({ collection: e.collection, id: e.item_id }),
3049
- ...al.record(e.collection, e.item_id)
3059
+ ...dl({ collection: e.collection, id: e.item_id }),
3060
+ ...ll.record(e.collection, e.item_id)
3050
3061
  }),
3051
3062
  onRowContextMenu: (e, t) => {
3052
- t.preventDefault(), yt({ x: t.clientX, y: t.clientY, row: e });
3063
+ t.preventDefault(), kt({ x: t.clientX, y: t.clientY, row: e });
3053
3064
  },
3054
3065
  rowTitle: (e) => {
3055
- const t = bt.get(K(e));
3056
- return $e.titleFor(K(e)) ?? (t && !t.is_mine ? ss(t) : void 0) ?? (Kr(e.collection, e.item_id) ? zs : void 0);
3066
+ const t = ht.get(D(e));
3067
+ return Fe.titleFor(D(e)) ?? (t && !t.is_mine ? ss(t) : void 0) ?? (Pr(e.collection, e.item_id) ? zs : void 0);
3057
3068
  },
3058
- rowClassName: (e) => R(
3069
+ rowClassName: (e) => E(
3059
3070
  Cl(e),
3060
- Kr(e.collection, e.item_id) && Js
3071
+ Pr(e.collection, e.item_id) && Js
3061
3072
  ),
3062
3073
  emptyMessage: cr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
3063
3074
  Os,
3064
3075
  {
3065
3076
  icon: Ro,
3066
- title: ((pa = c == null ? void 0 : c.empty) == null ? void 0 : pa.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((ba = c == null ? void 0 : c.empty) == null ? void 0 : ba.reason) === "scope_mine" ? "Nothing waiting on you" : ((ha = c == null ? void 0 : c.empty) == null ? void 0 : ha.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3067
- detail: ((fa = c == null ? void 0 : c.empty) == null ? void 0 : fa.reason) === "filters" && pe > 0 ? `Your default ${mr(Qn)} filter is hiding ${pe.toLocaleString("en-US")} item${pe === 1 ? "" : "s"} here.` : ((ga = c == null ? void 0 : c.empty) == null ? void 0 : ga.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." : ((xa = c == null ? void 0 : c.empty) == null ? void 0 : xa.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3068
- action: ((ya = c == null ? void 0 : c.empty) == null ? void 0 : ya.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3069
- pe > 0 && /* @__PURE__ */ d(
3077
+ title: ((ba = i == null ? void 0 : i.empty) == null ? void 0 : ba.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((ha = i == null ? void 0 : i.empty) == null ? void 0 : ha.reason) === "scope_mine" ? "Nothing waiting on you" : ((fa = i == null ? void 0 : i.empty) == null ? void 0 : fa.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3078
+ detail: ((ga = i == null ? void 0 : i.empty) == null ? void 0 : ga.reason) === "filters" && be > 0 ? `Your default ${mr(jn)} filter is hiding ${be.toLocaleString("en-US")} item${be === 1 ? "" : "s"} here.` : ((xa = i == null ? void 0 : i.empty) == null ? void 0 : xa.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." : ((ya = i == null ? void 0 : i.empty) == null ? void 0 : ya.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3079
+ action: ((ka = i == null ? void 0 : i.empty) == null ? void 0 : ka.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3080
+ be > 0 && /* @__PURE__ */ d(
3070
3081
  "button",
3071
3082
  {
3072
3083
  type: "button",
@@ -3075,7 +3086,7 @@ function Xc({
3075
3086
  "data-queue-empty-defaults": !0,
3076
3087
  children: [
3077
3088
  "Show all ",
3078
- pe.toLocaleString("en-US")
3089
+ be.toLocaleString("en-US")
3079
3090
  ]
3080
3091
  }
3081
3092
  ),
@@ -3086,9 +3097,9 @@ function Xc({
3086
3097
  onClick: () => {
3087
3098
  var t;
3088
3099
  const e = {};
3089
- for (const [n, r] of Object.entries(ue.current))
3090
- (t = Fe[n.slice(6)]) != null && t.length && (e[n] = r);
3091
- Q(e), O(1);
3100
+ for (const [n, r] of Object.entries(me.current))
3101
+ (t = Te[n.slice(6)]) != null && t.length && (e[n] = r);
3102
+ Q(e), A(1);
3092
3103
  },
3093
3104
  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",
3094
3105
  "data-queue-empty-clear": !0,
@@ -3100,7 +3111,7 @@ function Xc({
3100
3111
  {
3101
3112
  type: "button",
3102
3113
  onClick: () => {
3103
- Y("all"), O(1);
3114
+ Y("all"), A(1);
3104
3115
  },
3105
3116
  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",
3106
3117
  "data-queue-empty-all": !0,
@@ -3112,24 +3123,24 @@ function Xc({
3112
3123
  ),
3113
3124
  sort: I,
3114
3125
  onSortChange: (e) => {
3115
- Ue(e), O(1);
3126
+ Ie(e), A(1);
3116
3127
  },
3117
- filterDefs: Mn,
3128
+ filterDefs: Bn,
3118
3129
  filterValues: _,
3119
3130
  onFilterChange: (e, t) => {
3120
- Q((n) => ({ ...n, [e]: t })), O(1);
3131
+ Q((n) => ({ ...n, [e]: t })), A(1);
3121
3132
  },
3122
3133
  rowGroups: Rl ?? void 0,
3123
- collapsedGroups: ye,
3134
+ collapsedGroups: ke,
3124
3135
  onToggleGroup: xl,
3125
- selectedIds: Kt && ee ? Pe : void 0,
3126
- onSelectionChange: Kt && ee ? et : void 0,
3136
+ selectedIds: Pt && ee ? Pe : void 0,
3137
+ onSelectionChange: Pt && ee ? tt : void 0,
3127
3138
  hideFilterRow: !0,
3128
3139
  nowrapCells: !0,
3129
- columnPins: ta,
3140
+ columnPins: na,
3130
3141
  onColumnPinChange: (e, t) => {
3131
- rn((n) => {
3132
- const r = { ...n ?? ta };
3142
+ an((n) => {
3143
+ const r = { ...n ?? na };
3133
3144
  return t ? r[e] = t : delete r[e], r;
3134
3145
  });
3135
3146
  },
@@ -3138,14 +3149,14 @@ function Xc({
3138
3149
  footer: /* @__PURE__ */ a(
3139
3150
  ei,
3140
3151
  {
3141
- collections: ft,
3152
+ collections: gt,
3142
3153
  selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
3143
3154
  onToggle: (e) => {
3144
3155
  const t = e.ids.join(",");
3145
3156
  Q((n) => ({
3146
3157
  ...n,
3147
3158
  at_risk_rule: n.at_risk_rule === t ? "" : t
3148
- })), O(1);
3159
+ })), A(1);
3149
3160
  },
3150
3161
  className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
3151
3162
  }
@@ -3154,38 +3165,38 @@ function Xc({
3154
3165
  )
3155
3166
  ]
3156
3167
  }
3157
- ) }) }) : $ === "kanban" ? /* @__PURE__ */ a(
3158
- pi,
3168
+ ) }) }) : C === "kanban" ? /* @__PURE__ */ a(
3169
+ hi,
3159
3170
  {
3160
3171
  items: q,
3161
- onCardClick: (e) => Gt(e),
3162
- onDrop: (e, t) => ll.mutate({ item: e, targetState: t }),
3172
+ onCardClick: (e) => Wt(e),
3173
+ onDrop: (e, t) => ol.mutate({ item: e, targetState: t }),
3163
3174
  onClaim: (e) => Le.mutate(e),
3164
- onRelease: (e) => He.mutate(e),
3175
+ onRelease: (e) => Ye.mutate(e),
3165
3176
  swimlaneBy: st,
3166
- stateLabels: Sn,
3167
- laneLabel: st === "collection" ? gt : void 0,
3168
- claimsEnabled: me,
3177
+ stateLabels: $n,
3178
+ laneLabel: st === "collection" ? xt : void 0,
3179
+ claimsEnabled: pe,
3169
3180
  onDraggingChange: (e) => {
3170
- zn.current = e;
3181
+ cn.current = e;
3171
3182
  }
3172
3183
  }
3173
- ) : /* @__PURE__ */ a(hi, { queueId: l })
3184
+ ) : /* @__PURE__ */ a(gi, { queueId: l })
3174
3185
  ] }),
3175
- Kt && ee && /* @__PURE__ */ d(
3176
- ui,
3186
+ Pt && ee && /* @__PURE__ */ d(
3187
+ pi,
3177
3188
  {
3178
3189
  count: Pe.length,
3179
- claimsEnabled: me,
3180
- showClaim: un("claim"),
3181
- showRelease: un("release"),
3182
- showTransition: un("transition"),
3183
- states: Rr((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
3190
+ claimsEnabled: pe,
3191
+ showClaim: bn("claim"),
3192
+ showRelease: bn("release"),
3193
+ showTransition: bn("transition"),
3194
+ states: Er((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
3184
3195
  value: e,
3185
3196
  label: Ae(e)
3186
3197
  })),
3187
- busy: Ur,
3188
- onClaim: () => En(
3198
+ busy: Ir,
3199
+ onClaim: () => An(
3189
3200
  "Claim",
3190
3201
  (e) => h.request(
3191
3202
  se(`/queues/${l}/claim`, {
@@ -3194,7 +3205,7 @@ function Xc({
3194
3205
  })
3195
3206
  )
3196
3207
  ),
3197
- onRelease: () => En(
3208
+ onRelease: () => An(
3198
3209
  "Release",
3199
3210
  (e) => h.request(
3200
3211
  se(`/queues/${l}/release`, {
@@ -3203,8 +3214,8 @@ function Xc({
3203
3214
  })
3204
3215
  )
3205
3216
  ),
3206
- onTransition: (e) => En("Transition", (t) => fr(t, e)),
3207
- onClear: () => et([]),
3217
+ onTransition: (e) => An("Transition", (t) => fr(t, e)),
3218
+ onClear: () => tt([]),
3208
3219
  children: [
3209
3220
  Pe.length >= 2 && /* @__PURE__ */ a(
3210
3221
  "button",
@@ -3212,9 +3223,9 @@ function Xc({
3212
3223
  type: "button",
3213
3224
  onClick: () => {
3214
3225
  const e = cs(
3215
- q.filter((t) => Pe.includes(K(t)) && t.collection !== "tasks").map((t) => H.urlFor(qn(t)))
3226
+ q.filter((t) => Pe.includes(D(t)) && t.collection !== "tasks").map((t) => H.urlFor(Tn(t)))
3216
3227
  );
3217
- e.blocked > 0 || e.capped > 0 ? D.warning($a(e)) : D.success($a(e));
3228
+ e.blocked > 0 || e.capped > 0 ? O.warning(qa(e)) : O.success(qa(e));
3218
3229
  },
3219
3230
  "data-bulk-open-tabs": !0,
3220
3231
  title: `Open the selected records in new tabs (up to ${is})`,
@@ -3225,12 +3236,12 @@ function Xc({
3225
3236
  /* @__PURE__ */ a(
3226
3237
  Ts,
3227
3238
  {
3228
- targets: q.filter((e) => Pe.includes(K(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3239
+ targets: q.filter((e) => Pe.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3229
3240
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
3230
3241
  tone: "light",
3231
- disabled: Ur,
3242
+ disabled: Ir,
3232
3243
  onDone: (e) => {
3233
- e.failed === 0 && et([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
3244
+ e.failed === 0 && tt([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
3234
3245
  }
3235
3246
  }
3236
3247
  )
@@ -3247,12 +3258,12 @@ function Xc({
3247
3258
  width: ae[0].width,
3248
3259
  title: ae[0].title,
3249
3260
  stack: ae,
3250
- onPush: (e) => _t.push([...ae, e]),
3251
- onPop: () => _t.back(),
3252
- onClose: () => _t.back(ae.length)
3261
+ onPush: (e) => Nt.push([...ae, e]),
3262
+ onPop: () => Nt.back(),
3263
+ onClose: () => Nt.back(ae.length)
3253
3264
  }
3254
3265
  ) : null,
3255
- B && Na(
3266
+ B && Sa(
3256
3267
  /* @__PURE__ */ d(
3257
3268
  "div",
3258
3269
  {
@@ -3267,23 +3278,23 @@ function Xc({
3267
3278
  "data-queue-row-menu": !0,
3268
3279
  children: [
3269
3280
  [
3270
- { label: "Open", run: () => Gt(B.row) },
3281
+ { label: "Open", run: () => Wt(B.row) },
3271
3282
  {
3272
3283
  label: "Open full record",
3273
- run: () => xt(B.row)
3284
+ run: () => yt(B.row)
3274
3285
  },
3275
3286
  { label: "Peek", run: () => Oe(B.row) },
3276
- ...me ? [
3277
- ((ka = B.row.claimed_by) == null ? void 0 : ka.id) === N ? { label: "Release claim", run: () => He.mutate(B.row) } : { label: "Claim", run: () => Le.mutate(B.row) }
3287
+ ...pe ? [
3288
+ ((va = B.row.claimed_by) == null ? void 0 : va.id) === N ? { label: "Release claim", run: () => Ye.mutate(B.row) } : { label: "Claim", run: () => Le.mutate(B.row) }
3278
3289
  ] : [],
3279
3290
  // The friendly id (PW26-76166), never the row id (army 6 M52);
3280
3291
  // a record with no number has nothing to copy.
3281
- ...qa(B.row) ? [
3292
+ ...Fa(B.row) ? [
3282
3293
  {
3283
3294
  label: "Copy ID",
3284
3295
  run: () => {
3285
3296
  var e;
3286
- return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(qa(B.row) ?? ""));
3297
+ return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(Fa(B.row) ?? ""));
3287
3298
  }
3288
3299
  }
3289
3300
  ] : [],
@@ -3292,21 +3303,21 @@ function Xc({
3292
3303
  run: () => {
3293
3304
  var e;
3294
3305
  return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
3295
- `${window.location.origin}${H.urlFor(qn(B.row))}`
3306
+ `${window.location.origin}${H.urlFor(Tn(B.row))}`
3296
3307
  ));
3297
3308
  }
3298
3309
  },
3299
3310
  // Custom actions (#125): the record's registered actions, right here.
3300
- ...Ya(B.row.collection).map((e) => ({
3311
+ ...Ja(B.row.collection).map((e) => ({
3301
3312
  label: e.label,
3302
- run: () => Ja(e, B.row)
3313
+ run: () => za(e, B.row)
3303
3314
  }))
3304
3315
  ].map((e) => /* @__PURE__ */ a(
3305
3316
  "button",
3306
3317
  {
3307
3318
  type: "button",
3308
3319
  onClick: () => {
3309
- e.run(), yt(null);
3320
+ e.run(), kt(null);
3310
3321
  },
3311
3322
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
3312
3323
  children: e.label
@@ -3315,14 +3326,14 @@ function Xc({
3315
3326
  )),
3316
3327
  B.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
3317
3328
  /* @__PURE__ */ a("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
3318
- hn.slice(0, 8).map((e) => {
3329
+ xn.slice(0, 8).map((e) => {
3319
3330
  const t = (B.row.labels ?? []).includes(e);
3320
3331
  return /* @__PURE__ */ d(
3321
3332
  "button",
3322
3333
  {
3323
3334
  type: "button",
3324
3335
  onClick: () => {
3325
- sr(B.row, e), yt(null);
3336
+ sr(B.row, e), kt(null);
3326
3337
  },
3327
3338
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
3328
3339
  children: [
@@ -3346,7 +3357,7 @@ function Xc({
3346
3357
  const n = e.target.elements.namedItem(
3347
3358
  "newlabel"
3348
3359
  ).value.trim();
3349
- n && (sr(B.row, n), yt(null));
3360
+ n && (sr(B.row, n), kt(null));
3350
3361
  },
3351
3362
  className: "px-3 py-1",
3352
3363
  children: /* @__PURE__ */ a(
@@ -3367,56 +3378,57 @@ function Xc({
3367
3378
  ),
3368
3379
  document.body
3369
3380
  ),
3370
- or && Na(
3381
+ or && Sa(
3371
3382
  /* @__PURE__ */ a(
3372
- $i,
3383
+ Fi,
3373
3384
  {
3374
3385
  queueId: l,
3375
3386
  drill: or,
3376
- onClose: () => pn(null),
3387
+ onClose: () => fn(null),
3377
3388
  onOpenRecord: (e, t) => {
3378
- pn(null), H.open({ collection: e, itemId: t, layoutSlug: null });
3389
+ fn(null), H.open({ collection: e, itemId: t, layoutSlug: null });
3379
3390
  }
3380
3391
  }
3381
3392
  ),
3382
3393
  document.body
3383
3394
  ),
3384
3395
  /* @__PURE__ */ a(
3385
- mi,
3396
+ bi,
3386
3397
  {
3387
- item: _e,
3388
- stateLabels: Sn,
3389
- collectionLabel: gt,
3390
- claimsEnabled: me,
3398
+ item: Se,
3399
+ stateLabels: $n,
3400
+ collectionLabel: xt,
3401
+ claimsEnabled: pe,
3391
3402
  columnFormats: Al,
3403
+ fieldLabel: (e) => T(`extra.${e}`, je(e)),
3392
3404
  width: u == null ? void 0 : u.sheet_width,
3393
3405
  itemLayout: u == null ? void 0 : u.item_layout,
3394
3406
  onOpenChange: (e) => {
3395
- e || (Oe(null), $n(!1));
3407
+ e || (Oe(null), Fn(!1));
3396
3408
  },
3397
3409
  onClaim: (e) => Le.mutate(e),
3398
- onRelease: (e) => He.mutate(e),
3410
+ onRelease: (e) => Ye.mutate(e),
3399
3411
  workNextActive: yl,
3400
- onNext: () => _e && Er(_e),
3412
+ onNext: () => Se && Lr(Se),
3401
3413
  refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
3402
3414
  }
3403
3415
  ),
3404
- Mt.dialog
3416
+ Qt.dialog
3405
3417
  ] });
3406
3418
  }
3407
- function $i({
3419
+ function Fi({
3408
3420
  queueId: l,
3409
- drill: y,
3410
- onClose: A,
3411
- onOpenRecord: P
3421
+ drill: k,
3422
+ onClose: K,
3423
+ onOpenRecord: M
3412
3424
  }) {
3413
- const G = Ea(), { data: f, isLoading: h } = W({
3414
- queryKey: ["queue-agg-rows", l, y.row.collection, y.row.item_id, y.path],
3425
+ const G = La(), { data: f, isLoading: h } = W({
3426
+ queryKey: ["queue-agg-rows", l, k.row.collection, k.row.item_id, k.path],
3415
3427
  queryFn: () => G.request(
3416
3428
  L(`/queues/${l}/aggregate-rows`, {
3417
- collection: y.row.collection,
3418
- item_id: y.row.item_id,
3419
- path: y.path
3429
+ collection: k.row.collection,
3430
+ item_id: k.row.item_id,
3431
+ path: k.path
3420
3432
  })
3421
3433
  ).then((N) => N.data)
3422
3434
  });
@@ -3424,7 +3436,7 @@ function $i({
3424
3436
  "div",
3425
3437
  {
3426
3438
  className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
3427
- onClick: A,
3439
+ onClick: K,
3428
3440
  children: /* @__PURE__ */ d(
3429
3441
  "div",
3430
3442
  {
@@ -3433,11 +3445,11 @@ function $i({
3433
3445
  children: [
3434
3446
  /* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
3435
3447
  /* @__PURE__ */ d("div", { children: [
3436
- /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children: y.row.label }),
3448
+ /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children: k.row.label }),
3437
3449
  /* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
3438
- lt(y.path),
3450
+ je(k.path),
3439
3451
  " = ",
3440
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: y.value }),
3452
+ /* @__PURE__ */ a("span", { className: "tabular-nums", children: k.value }),
3441
3453
  " ",
3442
3454
  "— the rows behind this number"
3443
3455
  ] })
@@ -3446,7 +3458,7 @@ function $i({
3446
3458
  "button",
3447
3459
  {
3448
3460
  type: "button",
3449
- onClick: A,
3461
+ onClick: K,
3450
3462
  className: "rounded-md px-2 py-1 text-[12px] text-slate-400 hover:bg-muted",
3451
3463
  children: "✕"
3452
3464
  }
@@ -3457,7 +3469,7 @@ function $i({
3457
3469
  "button",
3458
3470
  {
3459
3471
  type: "button",
3460
- onClick: () => f.target && P(f.target, String(N.id)),
3472
+ onClick: () => f.target && M(f.target, String(N.id)),
3461
3473
  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",
3462
3474
  children: N.label
3463
3475
  }
@@ -3471,5 +3483,5 @@ function $i({
3471
3483
  );
3472
3484
  }
3473
3485
  export {
3474
- Xc as QueueWorklist
3486
+ td as QueueWorklist
3475
3487
  };