@nivaro/react 0.3.95 → 0.3.96

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,38 +1,38 @@
1
- var vn = Object.defineProperty;
2
- var kn = (t, e, r) => e in t ? vn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var Ve = (t, e, r) => kn(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { jsx as n, jsxs as i, Fragment as ye } from "react/jsx-runtime";
5
- import { useQueryClient as Fe, useQuery as oe, useMutation as Pe } from "@tanstack/react-query";
6
- import { ArrowRight as lt, Loader2 as me, Check as We, GitBranch as Xe, AlertTriangle as Nn, ChevronDown as $e, Send as Dt, Users as Ot, Undo2 as _n, Minus as Sn, UserPlus as Cn, X as Ut, Zap as Et, Search as $n } from "lucide-react";
7
- import { useState as I, useRef as ne, useEffect as fe, useMemo as Ie, Suspense as Lt, useCallback as Bt, lazy as Tn } from "react";
1
+ var yn = Object.defineProperty;
2
+ var wn = (t, e, r) => e in t ? yn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var Ve = (t, e, r) => wn(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { jsx as n, jsxs as i, Fragment as xe } from "react/jsx-runtime";
5
+ import { useQueryClient as De, useQuery as oe, useMutation as Pe } from "@tanstack/react-query";
6
+ import { ArrowRight as lt, Loader2 as me, Check as We, GitBranch as Xe, AlertTriangle as vn, ChevronDown as $e, Send as Ft, Users as At, Undo2 as kn, Minus as Nn, UserPlus as _n, X as Ot, Zap as Ut, Search as Sn } from "lucide-react";
7
+ import { useState as I, useRef as ne, useEffect as fe, useMemo as Ie, Suspense as Et, useCallback as Lt, lazy as Cn } from "react";
8
8
  import { toast as Y } from "sonner";
9
- import { useNivaroClient as we, useItemEditAuth as jt } from "../../context.js";
10
- import { get as ce, post as Te, del as qn } from "../../lib/commands.js";
11
- import { errorToastOptions as It, toastError as Mn } from "../../lib/error-toast.js";
9
+ import { useNivaroClient as we, useItemEditAuth as Bt } from "../../context.js";
10
+ import { get as ce, post as Te, del as $n } from "../../lib/commands.js";
11
+ import { errorToastOptions as jt, toastError as Tn } from "../../lib/error-toast.js";
12
12
  import { OPEN_MOVE_STATE_EVENT as Nt } from "../../lib/move-state.js";
13
- import { useRecordSignalWhile as Kt, useRecordSignalPeers as Rn, signalSentence as Pn } from "../../lib/presence-signals.js";
13
+ import { useRecordSignalWhile as It, useRecordSignalPeers as qn, signalSentence as Mn } from "../../lib/presence-signals.js";
14
14
  import { RUN_TRANSITION_EVENT as Ke } from "../../lib/run-transition.js";
15
- import { userErrorMessage as Ae } from "../../lib/safe-error.js";
16
- import { serverNow as Fn } from "../../lib/server-clock.js";
17
- import { userCardQuery as An } from "../../lib/user-cards.js";
18
- import { cn as he, titleCase as Dn, toLocalDateString as On, formatRelative as ot, formatDateTime as _t, humanHours as Un } from "../../lib/utils.js";
19
- import { PushReadinessChip as En } from "../integrations/RecordIntegrationPreview.js";
20
- import { useHeaderFold as Ln } from "../item-edit/HeaderTools.js";
21
- import { invalidateRecordInsights as Qe, invalidateRecordData as De } from "../item-edit/RecordInsights.js";
22
- import { UserChip as Qt } from "../item-edit/UserChip.js";
23
- import { OwnerAvatars as Bn } from "../queue/OwnerAvatars.js";
24
- import { UserAvatar as jn } from "../UserAvatar.js";
15
+ import { userErrorMessage as Fe } from "../../lib/safe-error.js";
16
+ import { serverNow as Rn } from "../../lib/server-clock.js";
17
+ import { userCardQuery as Pn } from "../../lib/user-cards.js";
18
+ import { cn as ye, titleCase as Dn, toLocalDateString as Fn, formatRelative as ot, formatDateTime as _t, humanHours as An } from "../../lib/utils.js";
19
+ import { PushReadinessChip as On } from "../integrations/RecordIntegrationPreview.js";
20
+ import { useHeaderFold as Un } from "../item-edit/HeaderTools.js";
21
+ import { invalidateRecordInsights as Qe, invalidateRecordData as Ae } from "../item-edit/RecordInsights.js";
22
+ import { UserChip as Kt } from "../item-edit/UserChip.js";
23
+ import { OwnerAvatars as En } from "../queue/OwnerAvatars.js";
24
+ import { UserAvatar as Ln } from "../UserAvatar.js";
25
25
  import { Button as ae } from "../ui/button.js";
26
- import { DropdownMenu as Ze, DropdownMenuTrigger as et, DropdownMenuContent as tt, DropdownMenuGroup as St, DropdownMenuSeparator as Ct, DropdownMenuItem as Be, DropdownMenuLabel as In } from "../ui/dropdown-menu.js";
26
+ import { DropdownMenu as Ze, DropdownMenuTrigger as et, DropdownMenuContent as tt, DropdownMenuGroup as St, DropdownMenuSeparator as Ct, DropdownMenuItem as Be, DropdownMenuLabel as Bn } from "../ui/dropdown-menu.js";
27
27
  import { Popover as dt, PopoverTrigger as ct, PopoverContent as ut } from "../ui/popover.js";
28
28
  import { Skeleton as ke } from "../ui/skeleton.js";
29
- import { TooltipProvider as Wt, Tooltip as nt, TooltipTrigger as rt, TooltipContent as at } from "../ui/tooltip.js";
30
- import { isAccessRefusal as zt, deniedToastAction as Ht, WhyOwnersButton as Kn } from "./AccessInsights.js";
31
- import { BranchLanes as Qn } from "./BranchLanes.js";
32
- import { landingState as Wn, landingSkipGroups as zn, joinLabels as $t } from "./landing-state.js";
33
- import { MoveToStatePanel as Hn } from "./MoveToStatePanel.js";
34
- import { SlaClockLine as Gn } from "./SlaClock.js";
35
- const Gt = Tn(
29
+ import { TooltipProvider as Qt, Tooltip as nt, TooltipTrigger as rt, TooltipContent as at } from "../ui/tooltip.js";
30
+ import { isAccessRefusal as Wt, deniedToastAction as zt, WhyOwnersButton as jn } from "./AccessInsights.js";
31
+ import { BranchLanes as In } from "./BranchLanes.js";
32
+ import { landingState as Kn, landingSkipGroups as Qn, joinLabels as $t } from "./landing-state.js";
33
+ import { MoveToStatePanel as Wn } from "./MoveToStatePanel.js";
34
+ import { SlaClockLine as zn } from "./SlaClock.js";
35
+ const Ht = Cn(
36
36
  () => import("./TransitionRequirementsDialog.js").then((t) => ({
37
37
  default: t.TransitionRequirementsDialog
38
38
  }))
@@ -41,7 +41,7 @@ function mt(t, e) {
41
41
  const r = t || "System";
42
42
  return e.on_behalf_of_name ? `${r}, for ${e.on_behalf_of_name}` : r;
43
43
  }
44
- function Vn(t) {
44
+ function Hn(t) {
45
45
  if (t.transition) return null;
46
46
  const e = (t.comment ?? "").trim();
47
47
  if (!e.startsWith("{")) return null;
@@ -76,11 +76,11 @@ const Tt = {
76
76
  rate_limited: "the partner asked us to slow down",
77
77
  unknown: "the partner refused it"
78
78
  };
79
- function Xn(t) {
80
- const e = Math.ceil((new Date(t).getTime() - Fn()) / 6e4);
79
+ function Gn(t) {
80
+ const e = Math.ceil((new Date(t).getTime() - Rn()) / 6e4);
81
81
  return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
82
82
  }
83
- function Yn({ held: t }) {
83
+ function Vn({ held: t }) {
84
84
  return t.length === 0 ? null : /* @__PURE__ */ n(
85
85
  "div",
86
86
  {
@@ -105,7 +105,7 @@ function Yn({ held: t }) {
105
105
  }
106
106
  ),
107
107
  /* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
108
- e.retry_at ? `It tries the same push again ${Xn(e.retry_at)}. ` : "It will not send the same push again on its own. ",
108
+ e.retry_at ? `It tries the same push again ${Gn(e.retry_at)}. ` : "It will not send the same push again on its own. ",
109
109
  "Fix the record so what it sends changes, retry the push, or move the record by hand.",
110
110
  e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
111
111
  ] })
@@ -114,58 +114,58 @@ function Yn({ held: t }) {
114
114
  }
115
115
  );
116
116
  }
117
- function Vt(t) {
117
+ function Gt(t) {
118
118
  var r;
119
119
  const e = t == null ? void 0 : t.response;
120
120
  return ((e == null ? void 0 : e.code) ?? ((r = e == null ? void 0 : e.data) == null ? void 0 : r.code)) === "TRANSITION_DUPLICATE";
121
121
  }
122
- function Xt(t) {
122
+ function Vt(t) {
123
123
  var r;
124
124
  const e = t;
125
125
  return (e == null ? void 0 : e.status) === 422 && ((r = e.response) == null ? void 0 : r.error) === "TRANSITION_REQUIREMENTS" ? e.response.requirements ?? [] : null;
126
126
  }
127
- function Yt(t) {
127
+ function Xt(t) {
128
128
  var s;
129
129
  const e = t == null ? void 0 : t.response, r = (e == null ? void 0 : e.code) ?? ((s = e == null ? void 0 : e.data) == null ? void 0 : s.code);
130
130
  return typeof r == "string" ? r : null;
131
131
  }
132
- function Jt(t) {
133
- if (Yt(t) !== "RECORD_LOCKED") return null;
132
+ function Yt(t) {
133
+ if (Xt(t) !== "RECORD_LOCKED") return null;
134
134
  const e = t == null ? void 0 : t.response, r = e != null && e.data && typeof e.data == "object" ? e.data : e;
135
135
  if ((r == null ? void 0 : r.move_anyway) !== !0) return null;
136
136
  const s = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
137
137
  return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${s ?? "Someone else"} is editing this record right now.`, holder: s };
138
138
  }
139
- const Jn = {
139
+ const Xn = {
140
140
  PRIORITY_REQUIRED: "priority",
141
141
  // A held record does not move forward (efp-ops hold-gate, army 11): taking
142
142
  // the hold off is one deliberate, noted step, then the move is tried again.
143
143
  ON_HOLD: "remove-hold"
144
144
  };
145
- function Zt(t, e) {
146
- const r = Yt(t), s = r ? Jn[r] : void 0;
145
+ function Jt(t, e) {
146
+ const r = Xt(t), s = r ? Xn[r] : void 0;
147
147
  return !r || !s ? null : { code: r, actionKey: s, transitionId: e.transition_id, comment: e.comment };
148
148
  }
149
- const Zn = 600;
150
- function en(t) {
151
- const e = Fe(), [r, s] = I(!1), l = ne(!0);
149
+ const Yn = 600;
150
+ function Zt(t) {
151
+ const e = De(), [r, s] = I(!1), l = ne(!0);
152
152
  fe(() => (l.current = !0, () => {
153
153
  l.current = !1;
154
154
  }), []);
155
155
  const c = ne(t);
156
156
  c.current = t;
157
- const p = Bt(async () => {
157
+ const p = Lt(async () => {
158
158
  s(!0);
159
159
  try {
160
160
  await e.refetchQueries({ queryKey: [...c.current], type: "active" });
161
161
  } catch {
162
162
  }
163
- await new Promise((b) => setTimeout(b, Zn)), l.current && s(!1);
163
+ await new Promise((b) => setTimeout(b, Yn)), l.current && s(!1);
164
164
  }, [e]);
165
165
  return { settling: r, settle: p };
166
166
  }
167
167
  const Me = 1500, qt = 4e3;
168
- class er {
168
+ class Jn {
169
169
  constructor() {
170
170
  Ve(this, "seen", null);
171
171
  Ve(this, "fresh", /* @__PURE__ */ new Map());
@@ -213,9 +213,9 @@ class er {
213
213
  this.seen = null, this.fresh.clear();
214
214
  }
215
215
  }
216
- function tn(t, e) {
216
+ function en(t, e) {
217
217
  const r = ne(null);
218
- r.current || (r.current = new er());
218
+ r.current || (r.current = new Jn());
219
219
  const s = r.current, l = ne(e);
220
220
  l.current !== e && (l.current = e, s.reset());
221
221
  const [, c] = I(0), p = t ? t.join(",") : null;
@@ -235,25 +235,25 @@ function tn(t, e) {
235
235
  })
236
236
  };
237
237
  }
238
- function nn(t, e) {
238
+ function tn(t, e) {
239
239
  return ["approval-brief", t, String(e)];
240
240
  }
241
- function rn(t, e, r) {
241
+ function nn(t, e, r) {
242
242
  return t.request(
243
243
  ce(`/pipelines/instance/${e}/${r}/approval-brief`)
244
244
  ).then((s) => s.data);
245
245
  }
246
- function tr(t) {
246
+ function Zn(t) {
247
247
  return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
248
248
  }
249
249
  function Mt(t) {
250
250
  return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
251
251
  }
252
- function nr(t) {
252
+ function er(t) {
253
253
  const e = Math.max(0, Math.floor(Number(t) || 0));
254
254
  return e === 0 ? "today" : e === 1 ? "1 day ago" : `${e} days ago`;
255
255
  }
256
- function rr(t, e, r = 40) {
256
+ function tr(t, e, r = 40) {
257
257
  const s = (_) => _ == null || _ === "" ? "" : String(_), l = s(t), c = s(e), p = (_) => _ === "" ? "(empty)" : _;
258
258
  if (t === void 0) return { old: null, new: Ye(p(c), 0, r) };
259
259
  if (l.length <= r && c.length <= r) return { old: p(l), new: p(c) };
@@ -266,27 +266,27 @@ function Ye(t, e, r) {
266
266
  const s = Math.min(e, Math.max(0, t.length - r)), l = t.slice(s, s + r);
267
267
  return `${s > 0 ? "…" : ""}${l}${s + r < t.length ? "…" : ""}`;
268
268
  }
269
- const ar = 4e3;
270
- function an(t, e) {
271
- const r = we(), s = Fe();
272
- return Bt(async () => {
269
+ const nr = 4e3;
270
+ function rn(t, e) {
271
+ const r = we(), s = De();
272
+ return Lt(async () => {
273
273
  try {
274
274
  const l = await Promise.race([
275
275
  s.fetchQuery({
276
- queryKey: nn(t, e),
277
- queryFn: () => rn(r, t, e),
276
+ queryKey: tn(t, e),
277
+ queryFn: () => nn(r, t, e),
278
278
  staleTime: 0,
279
279
  retry: !1
280
280
  }),
281
- new Promise((c) => setTimeout(() => c(null), ar))
281
+ new Promise((c) => setTimeout(() => c(null), nr))
282
282
  ]);
283
- return tr(l == null ? void 0 : l.lines);
283
+ return Zn(l == null ? void 0 : l.lines);
284
284
  } catch {
285
285
  return [];
286
286
  }
287
287
  }, [r, s, t, e]);
288
288
  }
289
- function sn({ lines: t }) {
289
+ function an({ lines: t }) {
290
290
  return t.length === 0 ? null : /* @__PURE__ */ i(
291
291
  "div",
292
292
  {
@@ -309,7 +309,7 @@ function Oe(t, e, r) {
309
309
  ), l = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
310
310
  return !!s && !!l && l.sort < s.sort;
311
311
  }
312
- function ln(t, e, r) {
312
+ function sn(t, e, r) {
313
313
  var l;
314
314
  if (!t) return !1;
315
315
  if ((((l = t.order_partners) == null ? void 0 : l.length) ?? 0) > 0) return !0;
@@ -324,59 +324,28 @@ const Rt = {
324
324
  green: "border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-300",
325
325
  blue: "border-sky-200 bg-sky-50 text-sky-800 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-300",
326
326
  purple: "border-violet-200 bg-violet-50 text-violet-800 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-300"
327
- }, Pt = {
328
- red: "text-red-700 dark:text-red-300",
329
- amber: "text-amber-700 dark:text-amber-300",
330
- yellow: "text-yellow-700 dark:text-yellow-300",
331
- green: "text-emerald-700 dark:text-emerald-300",
332
- blue: "text-sky-700 dark:text-sky-300",
333
- purple: "text-violet-700 dark:text-violet-300"
334
327
  };
335
- function on({
336
- flags: t,
337
- variant: e = "chip"
338
- }) {
339
- return !t || t.length === 0 ? null : e === "inline" ? /* @__PURE__ */ n(
328
+ function rr({ flags: t }) {
329
+ return !t || t.length === 0 ? null : /* @__PURE__ */ n(xe, { children: t.map((e) => /* @__PURE__ */ i(
340
330
  "span",
341
331
  {
342
- className: "inline-flex h-6 shrink-0 items-center gap-3 self-center border-x border-slate-200 px-3 dark:border-border",
343
- "data-record-flags-inline": !0,
344
- children: t.map((r) => /* @__PURE__ */ i(
345
- "span",
346
- {
347
- "data-record-flag": r.name,
348
- className: he(
349
- "inline-flex items-center gap-1.5 whitespace-nowrap text-[12px] font-medium",
350
- Pt[r.color] ?? Pt.amber
351
- ),
352
- children: [
353
- /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-current", "aria-hidden": !0 }),
354
- r.name
355
- ]
356
- },
357
- r.name
358
- ))
359
- }
360
- ) : /* @__PURE__ */ n(ye, { children: t.map((r) => /* @__PURE__ */ i(
361
- "span",
362
- {
363
- "data-record-flag": r.name,
364
- className: he(
332
+ "data-record-flag": e.name,
333
+ className: ye(
365
334
  "inline-flex shrink-0 items-center gap-1 self-center rounded-full border px-2 py-0.5 text-[11px] font-semibold",
366
- Rt[r.color] ?? Rt.amber
335
+ Rt[e.color] ?? Rt.amber
367
336
  ),
368
337
  children: [
369
338
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-current", "aria-hidden": !0 }),
370
- r.name
339
+ e.name
371
340
  ]
372
341
  },
373
- r.name
342
+ e.name
374
343
  )) });
375
344
  }
376
- function Ft(t) {
345
+ function Pt(t) {
377
346
  return t.replace(/\s+IIP$/i, "");
378
347
  }
379
- function dn({
348
+ function ln({
380
349
  collection: t,
381
350
  item: e,
382
351
  tx: r
@@ -392,20 +361,20 @@ function dn({
392
361
  staleTime: 2e4
393
362
  });
394
363
  if (l.length === 0) return null;
395
- const p = c != null && c.pushes ? c.pushes.filter((f) => f.status === "would_push" && l.includes(f.api_name)).map((f) => Ft(f.api_name)) : null, b = [...new Set(p ?? l.map(Ft))];
364
+ const p = c != null && c.pushes ? c.pushes.filter((f) => f.status === "would_push" && l.includes(f.api_name)).map((f) => Pt(f.api_name)) : null, b = [...new Set(p ?? l.map(Pt))];
396
365
  return /* @__PURE__ */ i(
397
366
  "p",
398
367
  {
399
368
  "data-order-send-note": !0,
400
369
  className: "flex items-start gap-1.5 rounded-md border border-sky-200 bg-sky-50 px-2.5 py-1.5 text-[12px] text-sky-900 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-200",
401
370
  children: [
402
- /* @__PURE__ */ n(Dt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
371
+ /* @__PURE__ */ n(Ft, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
403
372
  p && p.length === 0 ? "Nothing is sent to a partner for this record — it only moves the record on." : `This places an order with ${b.join(" or ")}. It cannot be called back from here.`
404
373
  ]
405
374
  }
406
375
  );
407
376
  }
408
- function cn(t) {
377
+ function on(t) {
409
378
  return t != null && t.instance ? (t.available_transitions ?? []).some(
410
379
  (e) => {
411
380
  var r;
@@ -413,27 +382,27 @@ function cn(t) {
413
382
  }
414
383
  ) : !1;
415
384
  }
416
- function un(t, e, r, s) {
385
+ function dn(t, e, r, s) {
417
386
  if (!s || s.size === 0) return t;
418
387
  const l = new Set([...s.keys()].map((c) => String(c).toUpperCase()));
419
388
  return t.filter(
420
389
  (c) => !(!c.to_previous && l.has(String(c.to_state).toUpperCase()) && Oe(c, e, r))
421
390
  );
422
391
  }
423
- function mn(t, e, r) {
424
- var f, _, v, y, $, D;
392
+ function cn(t, e, r) {
393
+ var f, _, v, y, $, A;
425
394
  const s = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
426
395
  (E) => E.id === e
427
- ), l = r == null ? void 0 : r.data, c = ((f = l == null ? void 0 : l.new_state) == null ? void 0 : f.id) ?? ((_ = l == null ? void 0 : l.instance) == null ? void 0 : _.current_state) ?? null, p = ((v = l == null ? void 0 : l.new_state) == null ? void 0 : v.label) ?? (s ? ($ = (y = t == null ? void 0 : t.states) == null ? void 0 : y.find((E) => E.id === s.to_state)) == null ? void 0 : $.label : void 0) ?? null, b = ((D = t == null ? void 0 : t.instance) == null ? void 0 : D.current_state) ?? null;
396
+ ), l = r == null ? void 0 : r.data, c = ((f = l == null ? void 0 : l.new_state) == null ? void 0 : f.id) ?? ((_ = l == null ? void 0 : l.instance) == null ? void 0 : _.current_state) ?? null, p = ((v = l == null ? void 0 : l.new_state) == null ? void 0 : v.label) ?? (s ? ($ = (y = t == null ? void 0 : t.states) == null ? void 0 : y.find((E) => E.id === s.to_state)) == null ? void 0 : $.label : void 0) ?? null, b = ((A = t == null ? void 0 : t.instance) == null ? void 0 : A.current_state) ?? null;
428
397
  return b && c && String(b) === String(c) ? "Nothing moved" : s != null && s.label && p ? `${s.label} — now ${p}` : p ? `Moved to ${p}` : s != null && s.label ? `${s.label} done` : "Transition executed";
429
398
  }
430
- const sr = 1200;
431
- function pn(t) {
399
+ const ar = 1200;
400
+ function un(t) {
432
401
  const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
433
402
  let r = !1;
434
403
  const s = setTimeout(() => {
435
404
  r = !0, Y.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
436
- }, sr);
405
+ }, ar);
437
406
  return {
438
407
  /** Options for the result toast: replaces the loading one when shown. */
439
408
  done: () => (clearTimeout(s), r ? { id: e, duration: 7e3 } : {}),
@@ -443,7 +412,7 @@ function pn(t) {
443
412
  }
444
413
  };
445
414
  }
446
- function fn(t, e, r) {
415
+ function mn(t, e, r) {
447
416
  for (const s of [
448
417
  "pipeline-owners-resolved",
449
418
  "pipeline-instance-owners",
@@ -451,7 +420,7 @@ function fn(t, e, r) {
451
420
  ])
452
421
  t.invalidateQueries({ queryKey: [s, e, r] });
453
422
  }
454
- function ir(t, e, r) {
423
+ function sr(t, e, r) {
455
424
  var b;
456
425
  if (!e) return null;
457
426
  const s = new Map(r.map((f) => [String(f.id).toUpperCase(), f.sort])), l = [...t].sort(
@@ -461,7 +430,7 @@ function ir(t, e, r) {
461
430
  const c = s.get(String(l.from_state).toUpperCase()), p = s.get(String(l.to_state).toUpperCase());
462
431
  return c == null || p == null || p >= c ? null : l;
463
432
  }
464
- function lr({ entry: t }) {
433
+ function ir({ entry: t }) {
465
434
  const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
466
435
  return /* @__PURE__ */ i(
467
436
  "div",
@@ -470,7 +439,7 @@ function lr({ entry: t }) {
470
439
  "data-send-back-notice": !0,
471
440
  children: [
472
441
  /* @__PURE__ */ n(
473
- _n,
442
+ kn,
474
443
  {
475
444
  "aria-hidden": !0,
476
445
  className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
@@ -489,7 +458,7 @@ function lr({ entry: t }) {
489
458
  }
490
459
  );
491
460
  }
492
- function hn({
461
+ function pn({
493
462
  collection: t,
494
463
  item: e,
495
464
  offer: r,
@@ -498,11 +467,11 @@ function hn({
498
467
  className: c,
499
468
  style: p
500
469
  }) {
501
- const b = we(), f = Fe(), [_, v] = I(""), { data: y, isLoading: $ } = oe({
470
+ const b = we(), f = De(), [_, v] = I(""), { data: y, isLoading: $ } = oe({
502
471
  queryKey: ["bulk-actions-available-one", t, r.actionKey],
503
472
  queryFn: async () => ((await b.request(ce("/bulk-actions/available", { collection: t }))).data ?? []).find((H) => H.key === r.actionKey) ?? null,
504
473
  staleTime: 6e4
505
- }), D = Pe({
474
+ }), A = Pe({
506
475
  mutationFn: async () => {
507
476
  var T, P;
508
477
  const B = { collection: t, ids: [e], reason: _.trim() || null }, K = ((y == null ? void 0 : y.source) === "extension" ? await b.request(Te(`/bulk-actions/${r.actionKey}/execute`, B)) : await b.request(Te("/bulk-actions/run", { ...B, key: r.actionKey }))).data ?? {};
@@ -512,16 +481,16 @@ function hn({
512
481
  );
513
482
  },
514
483
  onSuccess: () => {
515
- De(f, t, e), Y.success(`${(y == null ? void 0 : y.label) ?? "Done"} — trying again`), s();
484
+ Ae(f, t, e), Y.success(`${(y == null ? void 0 : y.label) ?? "Done"} — trying again`), s();
516
485
  },
517
- onError: (B) => Mn(B, `${(y == null ? void 0 : y.label) ?? "The fix"} failed`)
486
+ onError: (B) => Tn(B, `${(y == null ? void 0 : y.label) ?? "The fix"} failed`)
518
487
  });
519
488
  if ($ || !y) return null;
520
- const E = !D.isPending && (!y.require_reason || _.trim().length > 0);
489
+ const E = !A.isPending && (!y.require_reason || _.trim().length > 0);
521
490
  return /* @__PURE__ */ i(
522
491
  "div",
523
492
  {
524
- className: he(
493
+ className: ye(
525
494
  "space-y-2 rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-500/30 dark:bg-amber-950",
526
495
  c
527
496
  ),
@@ -563,9 +532,9 @@ function hn({
563
532
  size: "sm",
564
533
  className: "h-7 gap-1.5 text-[12px]",
565
534
  disabled: !E,
566
- onClick: () => D.mutate(),
535
+ onClick: () => A.mutate(),
567
536
  children: [
568
- D.isPending && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
537
+ A.isPending && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
569
538
  y.label,
570
539
  ", then try again"
571
540
  ]
@@ -597,9 +566,9 @@ function Ne({
597
566
  }
598
567
  function Je(t) {
599
568
  const e = Math.floor(t / 6e4);
600
- return e < 60 ? `${Math.max(1, e)}m` : Un(t / 36e5);
569
+ return e < 60 ? `${Math.max(1, e)}m` : An(t / 36e5);
601
570
  }
602
- function or({
571
+ function lr({
603
572
  history: t,
604
573
  completedAt: e
605
574
  }) {
@@ -659,7 +628,7 @@ function or({
659
628
  }) })
660
629
  ] });
661
630
  }
662
- function dr({
631
+ function or({
663
632
  states: t,
664
633
  allTransitions: e,
665
634
  availableTransitions: r,
@@ -722,18 +691,18 @@ function dr({
722
691
  }).sort((g, k) => g.sort - k.sort);
723
692
  })();
724
693
  if (y.length < 2) return null;
725
- const $ = y.findIndex((h) => h.id === s), D = new Map(y.map((h, x) => [h.id, x])), E = new Map(t.map((h) => [h.id, h.label]));
694
+ const $ = y.findIndex((h) => h.id === s), A = new Map(y.map((h, x) => [h.id, x])), E = new Map(t.map((h) => [h.id, h.label]));
726
695
  function B(h, x) {
727
- const w = D.get(h);
696
+ const w = A.get(h);
728
697
  return w == null ? [] : [...l].filter((q) => {
729
698
  if (!q.from_state) return !1;
730
- const o = D.get(q.from_state), Q = D.get(q.to_state);
699
+ const o = A.get(q.from_state), Q = A.get(q.to_state);
731
700
  return o == null || Q == null ? !1 : o === w && Q > w || Q < o && o - 1 === w;
732
701
  }).sort((q, o) => new Date(q.timestamp).getTime() - new Date(o.timestamp).getTime());
733
702
  }
734
703
  function H(h) {
735
704
  var x, w, q, o;
736
- return je(h) ? /* @__PURE__ */ n(Et, { className: "inline h-2.5 w-2.5", "aria-label": st(h) }) : ((((x = h.first_name) == null ? void 0 : x[0]) ?? "") + (((w = h.last_name) == null ? void 0 : w[0]) ?? "")).toUpperCase() || ((o = (q = h.user_email) == null ? void 0 : q[0]) == null ? void 0 : o.toUpperCase()) || "?";
705
+ return je(h) ? /* @__PURE__ */ n(Ut, { className: "inline h-2.5 w-2.5", "aria-label": st(h) }) : ((((x = h.first_name) == null ? void 0 : x[0]) ?? "") + (((w = h.last_name) == null ? void 0 : w[0]) ?? "")).toUpperCase() || ((o = (q = h.user_email) == null ? void 0 : q[0]) == null ? void 0 : o.toUpperCase()) || "?";
737
706
  }
738
707
  function K(h) {
739
708
  return mt([h.first_name, h.last_name].filter(Boolean).join(" ") || h.user_email, h);
@@ -743,7 +712,7 @@ function dr({
743
712
  (x, w) => new Date(x.timestamp).getTime() - new Date(w.timestamp).getTime()
744
713
  )) {
745
714
  if (!h.from_state) continue;
746
- const x = D.get(h.from_state), w = D.get(h.to_state);
715
+ const x = A.get(h.from_state), w = A.get(h.to_state);
747
716
  if (!(x == null || w == null || w <= x + 1))
748
717
  for (let q = x + 1; q < w; q++) {
749
718
  const o = y[q].id;
@@ -754,7 +723,7 @@ function dr({
754
723
  const x = E.get(h.from_state ?? "") ?? "the previous step", w = E.get(h.to_state) ?? "the next step", q = je(h) ? "it moved automatically" : `${K(h)} moved it`;
755
724
  return `Passed over on ${_t(h.timestamp)} — ${q} straight from ${x} to ${w}`;
756
725
  }
757
- return /* @__PURE__ */ n(Wt, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: b, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: y.map((h, x) => {
726
+ return /* @__PURE__ */ n(Qt, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: b, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: y.map((h, x) => {
758
727
  const w = h.id === s, q = f.has(h.id), o = q && !w && ($ < 0 || x < $), Q = q && !w && !o, X = !q && !w ? T.get(h.id) : void 0, g = !q && !w ? p == null ? void 0 : p.get(h.id) : void 0, k = X || g ? [...X ? [P(X)] : [], ...g ?? []] : void 0, G = k !== void 0, se = h.color ?? "#94a3b8", ee = x === y.length - 1, re = ee ? null : y[x + 1], z = re ? B(h.id, re.id) : [];
759
728
  return /* @__PURE__ */ i("div", { className: "flex flex-1 items-start", children: [
760
729
  /* @__PURE__ */ i("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
@@ -770,7 +739,7 @@ function dr({
770
739
  border: w || o ? "none" : G ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
771
740
  boxShadow: w ? `0 0 0 3px white, 0 0 0 5px ${se}` : void 0
772
741
  },
773
- children: o ? /* @__PURE__ */ n(We, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : w ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : G ? /* @__PURE__ */ n(Sn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
742
+ children: o ? /* @__PURE__ */ n(We, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : w ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : G ? /* @__PURE__ */ n(Nn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
774
743
  },
775
744
  w ? "cur" : o ? "done" : G ? "skip" : "todo"
776
745
  ),
@@ -797,7 +766,7 @@ function dr({
797
766
  ] }) : /* @__PURE__ */ n(
798
767
  "span",
799
768
  {
800
- className: he(
769
+ className: ye(
801
770
  "w-full break-words text-center leading-snug",
802
771
  !w && !o && "text-slate-500 dark:text-slate-400"
803
772
  ),
@@ -838,7 +807,7 @@ function dr({
838
807
  })(),
839
808
  z.map((C) => {
840
809
  const de = C.from_state !== h.id, J = Math.abs(
841
- (D.get(C.to_state) ?? 0) - (D.get(C.from_state ?? "") ?? 0)
810
+ (A.get(C.to_state) ?? 0) - (A.get(C.from_state ?? "") ?? 0)
842
811
  ) > 1 ? E.get(C.to_state) ?? "" : null;
843
812
  return /* @__PURE__ */ i(nt, { children: [
844
813
  /* @__PURE__ */ n(rt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
@@ -856,7 +825,7 @@ function dr({
856
825
  /* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: ot(C.timestamp) })
857
826
  ] }) }),
858
827
  /* @__PURE__ */ i(at, { side: "top", className: "space-y-0.5 text-[12px]", children: [
859
- je(C) ? /* @__PURE__ */ i(ye, { children: [
828
+ je(C) ? /* @__PURE__ */ i(xe, { children: [
860
829
  /* @__PURE__ */ i("p", { className: "font-medium", children: [
861
830
  de ? "↩ Sent back · " : "",
862
831
  st(C)
@@ -879,9 +848,9 @@ function dr({
879
848
  ] }, h.id);
880
849
  }) }) }) });
881
850
  }
882
- function cr({ history: t }) {
851
+ function dr({ history: t }) {
883
852
  return t.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: t.map((e) => {
884
- const r = je(e), s = r ? st(e) : mt([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l = Vn(e), c = e.comment && !r && !l ? e.comment : null, p = l ?? (r ? it(e) : null);
853
+ const r = je(e), s = r ? st(e) : mt([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l = Hn(e), c = e.comment && !r && !l ? e.comment : null, p = l ?? (r ? it(e) : null);
885
854
  return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
886
855
  /* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
887
856
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
@@ -901,7 +870,7 @@ function cr({ history: t }) {
901
870
  className: "mt-0.5 text-slate-400",
902
871
  "data-history-on-behalf": e.on_behalf_of_name ? e.on_behalf_of ?? "" : void 0,
903
872
  children: [
904
- r && /* @__PURE__ */ n(Et, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
873
+ r && /* @__PURE__ */ n(Ut, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
905
874
  s,
906
875
  p ? ` · ${p}` : "",
907
876
  " · ",
@@ -913,7 +882,7 @@ function cr({ history: t }) {
913
882
  ] }, e.id);
914
883
  }) });
915
884
  }
916
- function ur({ value: t, onChange: e }) {
885
+ function cr({ value: t, onChange: e }) {
917
886
  const r = we(), [s, l] = I(!1), [c, p] = I(""), [b, f] = I(""), _ = ne(null), v = ne(null);
918
887
  fe(() => {
919
888
  s ? setTimeout(() => {
@@ -934,11 +903,11 @@ function ur({ value: t, onChange: e }) {
934
903
  ).then((T) => T.data),
935
904
  enabled: s,
936
905
  staleTime: 3e4
937
- }), { data: D } = oe({
938
- ...An(r, t),
906
+ }), { data: A } = oe({
907
+ ...Pn(r, t),
939
908
  enabled: !!t,
940
909
  staleTime: 5 * 6e4
941
- }), E = y ?? [], B = D ?? E.find((T) => T.id === t) ?? null, H = B ? [B.first_name, B.last_name].filter(Boolean).join(" ").trim() || B.email : t ? "Selected person" : null, K = (T) => [T.first_name, T.last_name].filter(Boolean).join(" ").trim();
910
+ }), E = y ?? [], B = A ?? E.find((T) => T.id === t) ?? null, H = B ? [B.first_name, B.last_name].filter(Boolean).join(" ").trim() || B.email : t ? "Selected person" : null, K = (T) => [T.first_name, T.last_name].filter(Boolean).join(" ").trim();
942
911
  return /* @__PURE__ */ i(dt, { open: s, onOpenChange: l, children: [
943
912
  /* @__PURE__ */ i("div", { className: "relative flex h-8 w-full", children: [
944
913
  /* @__PURE__ */ n(ct, { asChild: !0, children: /* @__PURE__ */ i(
@@ -960,13 +929,13 @@ function ur({ value: t, onChange: e }) {
960
929
  T.stopPropagation(), e("");
961
930
  },
962
931
  className: "absolute right-6 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
963
- children: /* @__PURE__ */ n(Ut, { className: "h-3 w-3" })
932
+ children: /* @__PURE__ */ n(Ot, { className: "h-3 w-3" })
964
933
  }
965
934
  )
966
935
  ] }),
967
936
  /* @__PURE__ */ i(ut, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
968
937
  /* @__PURE__ */ n("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ i("div", { className: "relative", children: [
969
- /* @__PURE__ */ n($n, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
938
+ /* @__PURE__ */ n(Sn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
970
939
  /* @__PURE__ */ n(
971
940
  "input",
972
941
  {
@@ -1007,13 +976,13 @@ function ur({ value: t, onChange: e }) {
1007
976
  ] })
1008
977
  ] });
1009
978
  }
1010
- function At({
979
+ function Dt({
1011
980
  userId: t,
1012
981
  name: e,
1013
982
  email: r,
1014
983
  initials: s
1015
984
  }) {
1016
- return /* @__PURE__ */ n(Qt, { userId: t, children: /* @__PURE__ */ i(
985
+ return /* @__PURE__ */ n(Kt, { userId: t, children: /* @__PURE__ */ i(
1017
986
  "button",
1018
987
  {
1019
988
  type: "button",
@@ -1021,7 +990,7 @@ function At({
1021
990
  className: "group/owner flex min-w-0 flex-1 items-center gap-2.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
1022
991
  children: [
1023
992
  /* @__PURE__ */ n(
1024
- jn,
993
+ Ln,
1025
994
  {
1026
995
  userId: t,
1027
996
  alt: e,
@@ -1037,15 +1006,15 @@ function At({
1037
1006
  }
1038
1007
  ) });
1039
1008
  }
1040
- function mr({
1009
+ function ur({
1041
1010
  collection: t,
1042
1011
  item: e,
1043
1012
  states: r,
1044
1013
  currentStateId: s,
1045
1014
  returned: l = !1
1046
1015
  }) {
1047
- var be, ge, d, _e;
1048
- const c = we(), p = Fe(), { isAdmin: b } = jt(), [f, _] = I(!1), [v, y] = I(""), [$, D] = I(""), [E, B] = I(!1), H = ["pipeline-instance-owners", t, e], K = ["pipeline-owners-can-add", t, e], T = () => c.request(
1016
+ var he, be, d, _e;
1017
+ const c = we(), p = De(), { isAdmin: b } = Bt(), [f, _] = I(!1), [v, y] = I(""), [$, A] = I(""), [E, B] = I(!1), H = ["pipeline-instance-owners", t, e], K = ["pipeline-owners-can-add", t, e], T = () => c.request(
1049
1018
  ce(`/pipelines/instance/${t}/${e}/owners`)
1050
1019
  ).then((a) => {
1051
1020
  var m;
@@ -1068,8 +1037,8 @@ function mr({
1068
1037
  ).then((a) => a.data ?? null),
1069
1038
  enabled: !!s,
1070
1039
  staleTime: 3e4
1071
- }), o = new Set((P ?? []).map((a) => a.user)), Q = s ? (((be = w == null ? void 0 : w[s]) == null ? void 0 : be.owners) ?? []).filter((a) => !o.has(a.id)) : [], X = new Map(
1072
- (s ? ((ge = w == null ? void 0 : w[s]) == null ? void 0 : ge.unavailable) ?? [] : []).map((a) => [
1040
+ }), o = new Set((P ?? []).map((a) => a.user)), Q = s ? (((he = w == null ? void 0 : w[s]) == null ? void 0 : he.owners) ?? []).filter((a) => !o.has(a.id)) : [], X = new Map(
1041
+ (s ? ((be = w == null ? void 0 : w[s]) == null ? void 0 : be.unavailable) ?? [] : []).map((a) => [
1073
1042
  String(a.id).toUpperCase(),
1074
1043
  a
1075
1044
  ])
@@ -1090,12 +1059,12 @@ function mr({
1090
1059
  })
1091
1060
  ),
1092
1061
  onSuccess: () => {
1093
- re(), y(""), D(""), _(!1), Y.success("Owner added");
1062
+ re(), y(""), A(""), _(!1), Y.success("Owner added");
1094
1063
  },
1095
1064
  // The server's reason (a 403 says why), not a bare status phrase.
1096
- onError: (a) => Y.error(Ae(a, "Failed to add owner"))
1065
+ onError: (a) => Y.error(Fe(a, "Failed to add owner"))
1097
1066
  }), C = Pe({
1098
- mutationFn: (a) => c.request(qn(`/pipelines/instance-owners/${a.id}`)),
1067
+ mutationFn: (a) => c.request($n(`/pipelines/instance-owners/${a.id}`)),
1099
1068
  onSuccess: (a, m) => {
1100
1069
  re();
1101
1070
  const N = [m.first_name, m.last_name].filter(Boolean).join(" ") || m.email;
@@ -1107,14 +1076,14 @@ function mr({
1107
1076
  user: m.user,
1108
1077
  state: m.state || void 0
1109
1078
  })
1110
- ).then(() => re()).catch((F) => Y.error(Ae(F, "Could not add the owner back")))
1079
+ ).then(() => re()).catch((D) => Y.error(Fe(D, "Could not add the owner back")))
1111
1080
  }
1112
1081
  });
1113
1082
  },
1114
- onError: (a) => Y.error(Ae(a, "Failed to remove owner"))
1083
+ onError: (a) => Y.error(Fe(a, "Failed to remove owner"))
1115
1084
  }), de = (a) => {
1116
- var F, M;
1117
- const m = ((F = a.first_name) == null ? void 0 : F[0]) ?? "", N = ((M = a.last_name) == null ? void 0 : M[0]) ?? "";
1085
+ var D, M;
1086
+ const m = ((D = a.first_name) == null ? void 0 : D[0]) ?? "", N = ((M = a.last_name) == null ? void 0 : M[0]) ?? "";
1118
1087
  return (`${m}${N}`.trim() || a.email[0] || "?").toUpperCase();
1119
1088
  }, J = (a) => {
1120
1089
  var m;
@@ -1123,7 +1092,7 @@ function mr({
1123
1092
  return /* @__PURE__ */ i("div", { children: [
1124
1093
  /* @__PURE__ */ i("div", { className: "mb-3 flex items-center justify-between", children: [
1125
1094
  /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
1126
- /* @__PURE__ */ n(Ot, { className: "h-3.5 w-3.5" }),
1095
+ /* @__PURE__ */ n(At, { className: "h-3.5 w-3.5" }),
1127
1096
  "Owners",
1128
1097
  L || q ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : ee ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
1129
1098
  "(",
@@ -1132,7 +1101,7 @@ function mr({
1132
1101
  ] })
1133
1102
  ] }),
1134
1103
  /* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
1135
- s && /* @__PURE__ */ n(Kn, { collection: t, itemId: String(e) }),
1104
+ s && /* @__PURE__ */ n(jn, { collection: t, itemId: String(e) }),
1136
1105
  !f && x && /* @__PURE__ */ i(
1137
1106
  "button",
1138
1107
  {
@@ -1140,7 +1109,7 @@ function mr({
1140
1109
  onClick: () => _(!0),
1141
1110
  className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
1142
1111
  children: [
1143
- /* @__PURE__ */ n(Cn, { className: "h-3 w-3" }),
1112
+ /* @__PURE__ */ n(_n, { className: "h-3 w-3" }),
1144
1113
  "Add"
1145
1114
  ]
1146
1115
  }
@@ -1153,7 +1122,7 @@ function mr({
1153
1122
  ] }) : ee ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1154
1123
  l ? "Back with" : "With",
1155
1124
  " ",
1156
- /* @__PURE__ */ n(Qt, { userId: ee.id, children: /* @__PURE__ */ n(
1125
+ /* @__PURE__ */ n(Kt, { userId: ee.id, children: /* @__PURE__ */ n(
1157
1126
  "button",
1158
1127
  {
1159
1128
  type: "button",
@@ -1164,21 +1133,21 @@ function mr({
1164
1133
  ) })
1165
1134
  ] }) : g === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ i("div", { className: "space-y-px", children: [
1166
1135
  Q.map((a) => {
1167
- var F, M;
1168
- const m = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, N = (`${((F = a.first_name) == null ? void 0 : F[0]) ?? ""}${((M = a.last_name) == null ? void 0 : M[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
1136
+ var D, M;
1137
+ const m = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, N = (`${((D = a.first_name) == null ? void 0 : D[0]) ?? ""}${((M = a.last_name) == null ? void 0 : M[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
1169
1138
  return /* @__PURE__ */ i(
1170
1139
  "div",
1171
1140
  {
1172
1141
  className: "-mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
1173
1142
  children: [
1174
- /* @__PURE__ */ n(At, { userId: a.id, name: m, email: a.email, initials: N }),
1143
+ /* @__PURE__ */ n(Dt, { userId: a.id, name: m, email: a.email, initials: N }),
1175
1144
  (() => {
1176
1145
  const R = X.get(String(a.id).toUpperCase());
1177
1146
  return R ? /* @__PURE__ */ n(
1178
1147
  "span",
1179
1148
  {
1180
1149
  "data-owner-unavailable": R.reason,
1181
- className: he(
1150
+ className: ye(
1182
1151
  "shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-medium",
1183
1152
  R.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
1184
1153
  ),
@@ -1206,7 +1175,7 @@ function mr({
1206
1175
  className: "group -mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
1207
1176
  children: [
1208
1177
  /* @__PURE__ */ n(
1209
- At,
1178
+ Dt,
1210
1179
  {
1211
1180
  userId: a.user,
1212
1181
  name: [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email,
@@ -1224,7 +1193,7 @@ function mr({
1224
1193
  disabled: C.isPending,
1225
1194
  onClick: () => C.mutate(a),
1226
1195
  className: "shrink-0 rounded p-0.5 text-slate-300 opacity-0 transition-all hover:text-red-500 focus-visible:opacity-100 group-hover:opacity-100",
1227
- children: /* @__PURE__ */ n(Ut, { className: "h-3 w-3" })
1196
+ children: /* @__PURE__ */ n(Ot, { className: "h-3 w-3" })
1228
1197
  }
1229
1198
  )
1230
1199
  ]
@@ -1234,7 +1203,7 @@ function mr({
1234
1203
  ] }),
1235
1204
  f && /* @__PURE__ */ i("div", { className: "mt-3 space-y-2 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3", children: [
1236
1205
  /* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
1237
- /* @__PURE__ */ n(ur, { value: v, onChange: y }),
1206
+ /* @__PURE__ */ n(cr, { value: v, onChange: y }),
1238
1207
  b ? /* @__PURE__ */ i(dt, { open: E, onOpenChange: B, children: [
1239
1208
  /* @__PURE__ */ n(ct, { asChild: !0, children: /* @__PURE__ */ i(
1240
1209
  "button",
@@ -1248,18 +1217,18 @@ function mr({
1248
1217
  }
1249
1218
  ) }),
1250
1219
  /* @__PURE__ */ n(ut, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((a) => a.id)].map((a) => {
1251
- var F;
1252
- const m = a === "" ? "All states" : ((F = r.find((M) => M.id === a)) == null ? void 0 : F.label) ?? a;
1220
+ var D;
1221
+ const m = a === "" ? "All states" : ((D = r.find((M) => M.id === a)) == null ? void 0 : D.label) ?? a;
1253
1222
  return /* @__PURE__ */ n(
1254
1223
  "button",
1255
1224
  {
1256
1225
  type: "button",
1257
- className: he(
1226
+ className: ye(
1258
1227
  "flex w-full rounded px-2.5 py-1.5 text-left text-[13px] transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
1259
1228
  $ === a && "font-medium text-slate-800 dark:text-slate-200"
1260
1229
  ),
1261
1230
  onClick: () => {
1262
- D(a), B(!1);
1231
+ A(a), B(!1);
1263
1232
  },
1264
1233
  children: m
1265
1234
  },
@@ -1276,7 +1245,7 @@ function mr({
1276
1245
  variant: "ghost",
1277
1246
  className: "h-7 text-[12px]",
1278
1247
  onClick: () => {
1279
- _(!1), y(""), D("");
1248
+ _(!1), y(""), A("");
1280
1249
  },
1281
1250
  children: "Cancel"
1282
1251
  }
@@ -1296,16 +1265,16 @@ function mr({
1296
1265
  ] })
1297
1266
  ] });
1298
1267
  }
1299
- function bn(t, e, r, s) {
1268
+ function fn(t, e, r, s) {
1300
1269
  if (!t || !(r != null && r.length)) return null;
1301
1270
  const c = new Map(r.map((f) => [String(f.id).toUpperCase(), f])).get(String(t.to_state).toUpperCase()), p = Number(e == null ? void 0 : e.sort);
1302
1271
  if (!c || !Number.isFinite(p) || !(Number(c.sort) > p)) return null;
1303
- const b = Wn(String(t.to_state), r, s);
1272
+ const b = Kn(String(t.to_state), r, s);
1304
1273
  return b && b.skipped.length > 0 ? b : null;
1305
1274
  }
1306
- function gn({ landing: t }) {
1275
+ function hn({ landing: t }) {
1307
1276
  if (!t || t.skipped.length === 0) return null;
1308
- const e = zn(t);
1277
+ const e = Qn(t);
1309
1278
  if (e.length === 1) {
1310
1279
  const r = e[0];
1311
1280
  return /* @__PURE__ */ i(
@@ -1352,7 +1321,7 @@ const Re = {
1352
1321
  suspended: "suspended",
1353
1322
  redacted: "redacted"
1354
1323
  };
1355
- function pr({
1324
+ function mr({
1356
1325
  collection: t,
1357
1326
  item: e,
1358
1327
  states: r,
@@ -1377,7 +1346,7 @@ function pr({
1377
1346
  title: "View approval chain",
1378
1347
  className: "flex h-6 w-6 items-center justify-center rounded text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
1379
1348
  onClick: (v) => v.stopPropagation(),
1380
- children: /* @__PURE__ */ n(Ot, { className: "h-3.5 w-3.5" })
1349
+ children: /* @__PURE__ */ n(At, { className: "h-3.5 w-3.5" })
1381
1350
  }
1382
1351
  ) }),
1383
1352
  /* @__PURE__ */ i(ut, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
@@ -1390,28 +1359,28 @@ function pr({
1390
1359
  const y = (((K = b[v.id]) == null ? void 0 : K.owners) ?? []).map((x) => ({
1391
1360
  id: x.id,
1392
1361
  name: [x.first_name, x.last_name].filter(Boolean).join(" ") || x.email
1393
- })), $ = v.id === s, D = ((T = b[v.id]) == null ? void 0 : T.skipped) === !0 && !$, E = (((P = b[v.id]) == null ? void 0 : P.skip_reasons) ?? []).filter(Boolean), B = ((L = b[v.id]) == null ? void 0 : L.unavailable) ?? [], H = ((h = b[v.id]) == null ? void 0 : h.blocked) === !0 && !D;
1362
+ })), $ = v.id === s, A = ((T = b[v.id]) == null ? void 0 : T.skipped) === !0 && !$, E = (((P = b[v.id]) == null ? void 0 : P.skip_reasons) ?? []).filter(Boolean), B = ((L = b[v.id]) == null ? void 0 : L.unavailable) ?? [], H = ((h = b[v.id]) == null ? void 0 : h.blocked) === !0 && !A;
1394
1363
  return /* @__PURE__ */ i(
1395
1364
  "div",
1396
1365
  {
1397
- className: he(
1366
+ className: ye(
1398
1367
  "flex items-center gap-3 px-4 py-2.5",
1399
1368
  // Hex-with-alpha rather than bg-nvr-cyan/N — the
1400
1369
  // nvr-cyan token is an opaque var() so Tailwind silently
1401
1370
  // drops opacity modifiers on it. Kept very light so the
1402
1371
  // tint doesn't clash with the state badge's own color.
1403
1372
  $ && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
1404
- D && "opacity-60",
1373
+ A && "opacity-60",
1405
1374
  H && "bg-red-50 dark:bg-red-500/10"
1406
1375
  ),
1407
1376
  "data-chain-blocked": H ? "" : void 0,
1408
1377
  children: [
1409
1378
  /* @__PURE__ */ n(Ne, { label: v.label, color: v.color, small: !0 }),
1410
- /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5", children: D ? (
1379
+ /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5", children: A ? (
1411
1380
  // Radix tooltip with zero delay — native `title` waits on
1412
1381
  // the OS hover timer, and a truncated reason needs its
1413
1382
  // full text the moment the cursor lands on it.
1414
- /* @__PURE__ */ n(Wt, { delayDuration: 0, children: /* @__PURE__ */ i(nt, { children: [
1383
+ /* @__PURE__ */ n(Qt, { delayDuration: 0, children: /* @__PURE__ */ i(nt, { children: [
1415
1384
  /* @__PURE__ */ n(rt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
1416
1385
  /* @__PURE__ */ n("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-dashed border-slate-300 px-2 py-0.5 text-[10.5px] font-medium text-slate-400 dark:border-slate-600 dark:text-slate-500", children: "Skipped" }),
1417
1386
  E.length > 0 && /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: E.join(" · ") })
@@ -1429,19 +1398,19 @@ function pr({
1429
1398
  }
1430
1399
  )
1431
1400
  ] }) })
1432
- ) : /* @__PURE__ */ i(ye, { children: [
1433
- /* @__PURE__ */ n(Bn, { owners: y, max: 10, emptyLabel: "—" }),
1401
+ ) : /* @__PURE__ */ i(xe, { children: [
1402
+ /* @__PURE__ */ n(En, { owners: y, max: 10, emptyLabel: "—" }),
1434
1403
  B.map((x) => /* @__PURE__ */ i(
1435
1404
  "span",
1436
1405
  {
1437
- "data-tip": `${x.name} is ${Re[x.reason] ?? x.reason}${x.delegate ? ` — ${x.delegate.name} covers${x.delegate.expires_at ? ` until ${On(x.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1438
- className: he(
1406
+ "data-tip": `${x.name} is ${Re[x.reason] ?? x.reason}${x.delegate ? ` — ${x.delegate.name} covers${x.delegate.expires_at ? ` until ${Fn(x.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1407
+ className: ye(
1439
1408
  "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
1440
1409
  x.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
1441
1410
  ),
1442
1411
  children: [
1443
1412
  x.name,
1444
- x.delegate ? /* @__PURE__ */ i(ye, { children: [
1413
+ x.delegate ? /* @__PURE__ */ i(xe, { children: [
1445
1414
  " → ",
1446
1415
  x.delegate.name,
1447
1416
  x.delegate.expires_at && /* @__PURE__ */ i("span", { className: "opacity-70", children: [
@@ -1474,7 +1443,7 @@ function pr({
1474
1443
  ] })
1475
1444
  ] });
1476
1445
  }
1477
- function Gr({
1446
+ function Hr({
1478
1447
  collection: t,
1479
1448
  item: e,
1480
1449
  defaultExpanded: r,
@@ -1488,7 +1457,7 @@ function Gr({
1488
1457
  asRole: v
1489
1458
  }) {
1490
1459
  return e === "new" ? null : /* @__PURE__ */ n(
1491
- fr,
1460
+ pr,
1492
1461
  {
1493
1462
  collection: t,
1494
1463
  item: e,
@@ -1505,14 +1474,14 @@ function Gr({
1505
1474
  `${t}:${e}`
1506
1475
  );
1507
1476
  }
1508
- function xn({
1477
+ function bn({
1509
1478
  collection: t,
1510
1479
  item: e,
1511
1480
  omitLines: r
1512
1481
  }) {
1513
1482
  const s = we(), { data: l } = oe({
1514
- queryKey: nn(t, e),
1515
- queryFn: () => rn(s, t, e),
1483
+ queryKey: tn(t, e),
1484
+ queryFn: () => nn(s, t, e),
1516
1485
  staleTime: 3e4,
1517
1486
  retry: !1
1518
1487
  });
@@ -1523,10 +1492,10 @@ function xn({
1523
1492
  /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
1524
1493
  " ",
1525
1494
  "(",
1526
- nr(l.days_in_state),
1495
+ er(l.days_in_state),
1527
1496
  "):",
1528
1497
  " ",
1529
- l.changed_total === 0 && l.comments === 0 && l.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(ye, { children: [
1498
+ l.changed_total === 0 && l.comments === 0 && l.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(xe, { children: [
1530
1499
  c > 0 && /* @__PURE__ */ i("span", { children: [
1531
1500
  c,
1532
1501
  " field",
@@ -1552,7 +1521,7 @@ function xn({
1552
1521
  ] }),
1553
1522
  l.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
1554
1523
  l.field_changes.slice(0, 5).map((f) => {
1555
- const _ = rr(f.old, f.new);
1524
+ const _ = tr(f.old, f.new);
1556
1525
  return /* @__PURE__ */ i(
1557
1526
  "p",
1558
1527
  {
@@ -1563,7 +1532,7 @@ function xn({
1563
1532
  f.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
1564
1533
  ":",
1565
1534
  " ",
1566
- _.old !== null && /* @__PURE__ */ i(ye, { children: [
1535
+ _.old !== null && /* @__PURE__ */ i(xe, { children: [
1567
1536
  /* @__PURE__ */ n("span", { className: "text-red-600 line-through dark:text-red-400", children: _.old }),
1568
1537
  /* @__PURE__ */ n("span", { "aria-hidden": "true", children: " → " }),
1569
1538
  /* @__PURE__ */ n("span", { className: "sr-only", children: " changed to " })
@@ -1601,7 +1570,7 @@ function xn({
1601
1570
  ))
1602
1571
  ] });
1603
1572
  }
1604
- function fr({
1573
+ function pr({
1605
1574
  collection: t,
1606
1575
  item: e,
1607
1576
  defaultExpanded: r,
@@ -1615,12 +1584,12 @@ function fr({
1615
1584
  asRole: v
1616
1585
  }) {
1617
1586
  var gt, xt, yt;
1618
- const y = we(), $ = Fe(), { isAdmin: D } = jt(), [E, B] = I(0), H = ne(null);
1587
+ const y = we(), $ = De(), { isAdmin: A } = Bt(), [E, B] = I(0), H = ne(null);
1619
1588
  fe(() => {
1620
- if (!D) return;
1589
+ if (!A) return;
1621
1590
  const u = (S) => {
1622
- const A = S.detail;
1623
- !A || A.claimed || A.collection !== t || String(A.item) !== String(e) || (A.claimed = !0, q(!0), B((W) => W + 1), setTimeout(
1591
+ const F = S.detail;
1592
+ !F || F.claimed || F.collection !== t || String(F.item) !== String(e) || (F.claimed = !0, q(!0), B((W) => W + 1), setTimeout(
1624
1593
  () => {
1625
1594
  var W;
1626
1595
  return (W = H.current) == null ? void 0 : W.scrollIntoView({ block: "center", behavior: "smooth" });
@@ -1629,21 +1598,21 @@ function fr({
1629
1598
  ));
1630
1599
  };
1631
1600
  return window.addEventListener(Nt, u), () => window.removeEventListener(Nt, u);
1632
- }, [D, t, e]);
1633
- const [K, T] = I(""), [P, L] = I(null), [h, x] = I(!1), [w, q] = I(!1), [o, Q] = I(null), [X, g] = I(null), [k, G] = I([]), se = an(t, String(e));
1634
- Kt(t, e, "transition", !!P || !!o);
1635
- const ee = Rn(t, e, "transition"), re = ne(!1);
1601
+ }, [A, t, e]);
1602
+ const [K, T] = I(""), [P, L] = I(null), [h, x] = I(!1), [w, q] = I(!1), [o, Q] = I(null), [X, g] = I(null), [k, G] = I([]), se = rn(t, String(e));
1603
+ It(t, e, "transition", !!P || !!o);
1604
+ const ee = qn(t, e, "transition"), re = ne(!1);
1636
1605
  fe(() => {
1637
1606
  !re.current && r !== void 0 && (re.current = !0, q(r));
1638
1607
  }, [r]);
1639
1608
  const z = ne(!1), C = (u) => {
1640
1609
  z.current || (z.current = !0, g(null), j.mutate(u, {
1641
- onSettled: (S, A) => {
1642
- if (A) {
1610
+ onSettled: (S, F) => {
1611
+ if (F) {
1643
1612
  z.current = !1;
1644
1613
  return;
1645
1614
  }
1646
- ge().finally(() => {
1615
+ be().finally(() => {
1647
1616
  z.current = !1;
1648
1617
  });
1649
1618
  }
@@ -1665,8 +1634,8 @@ function fr({
1665
1634
  }
1666
1635
  if (!te) return;
1667
1636
  }
1668
- const S = (xe ?? []).find((te) => te.id === u), A = String((S == null ? void 0 : S.comment_mode) ?? "none"), W = ln(S, (d == null ? void 0 : d.states) ?? [], (Z = d == null ? void 0 : d.instance) == null ? void 0 : Z.current_state);
1669
- if (A !== "optional" && A !== "required") {
1637
+ const S = (ge ?? []).find((te) => te.id === u), F = String((S == null ? void 0 : S.comment_mode) ?? "none"), W = sn(S, (d == null ? void 0 : d.states) ?? [], (Z = d == null ? void 0 : d.instance) == null ? void 0 : Z.current_state);
1638
+ if (F !== "optional" && F !== "required") {
1670
1639
  if (S && !Oe(S, (d == null ? void 0 : d.states) ?? [], (le = d == null ? void 0 : d.instance) == null ? void 0 : le.current_state)) {
1671
1640
  z.current = !0;
1672
1641
  let te = [];
@@ -1688,7 +1657,7 @@ function fr({
1688
1657
  return;
1689
1658
  }
1690
1659
  G([]), L(u);
1691
- }, J = v ? ["pipeline-instance", t, e, v] : ["pipeline-instance", t, e], { settling: be, settle: ge } = en(J), { data: d, isLoading: _e } = oe({
1660
+ }, J = v ? ["pipeline-instance", t, e, v] : ["pipeline-instance", t, e], { settling: he, settle: be } = Zt(J), { data: d, isLoading: _e } = oe({
1692
1661
  queryKey: J,
1693
1662
  queryFn: () => y.request(
1694
1663
  ce(
@@ -1705,7 +1674,7 @@ function fr({
1705
1674
  }
1706
1675
  ),
1707
1676
  staleTime: 1e4
1708
- }), a = tn(
1677
+ }), a = en(
1709
1678
  d ? (d.available_transitions ?? []).map((u) => String(u.id)) : null,
1710
1679
  `${t}:${e}`
1711
1680
  );
@@ -1724,17 +1693,17 @@ function fr({
1724
1693
  ).then((u) => u.data ?? null),
1725
1694
  // Also when a send back is on offer: its target may be a chain step this record skipped.
1726
1695
  // And while a move is being confirmed: the panel names where it really lands.
1727
- enabled: (w || cn(d) || !!P) && !!(d != null && d.instance),
1696
+ enabled: (w || on(d) || !!P) && !!(d != null && d.instance),
1728
1697
  staleTime: 3e4
1729
- }), F = Ie(() => {
1698
+ }), D = Ie(() => {
1730
1699
  if (!m) return null;
1731
1700
  const u = Object.entries(m);
1732
1701
  return u.length === 0 || u.every(([, S]) => S.on_path === void 0) ? null : new Set(u.filter(([, S]) => S.on_path !== !1).map(([S]) => S));
1733
1702
  }, [m]), M = Ie(() => {
1734
1703
  if (!m) return null;
1735
1704
  const u = /* @__PURE__ */ new Map();
1736
- for (const [S, A] of Object.entries(m))
1737
- A.skipped && u.set(S, A.skip_reasons ?? []);
1705
+ for (const [S, F] of Object.entries(m))
1706
+ F.skipped && u.set(S, F.skip_reasons ?? []);
1738
1707
  return u;
1739
1708
  }, [m]), R = Pe({
1740
1709
  mutationFn: () => y.request(Te(`/pipelines/instance/${t}/${e}/start`, {})),
@@ -1746,36 +1715,36 @@ function fr({
1746
1715
  mutationFn: ({
1747
1716
  transition_id: u,
1748
1717
  comment: S,
1749
- reviewed: A,
1718
+ reviewed: F,
1750
1719
  lock_ack: W
1751
1720
  }) => y.request(
1752
1721
  Te(`/pipelines/instance/${t}/${e}/transition`, {
1753
1722
  transition_id: u,
1754
1723
  comment: S,
1755
- ...A ? { reviewed: !0 } : {},
1724
+ ...F ? { reviewed: !0 } : {},
1756
1725
  ...W ? { lock_ack: !0 } : {}
1757
1726
  })
1758
1727
  ),
1759
1728
  onMutate: (u) => {
1760
1729
  var S;
1761
1730
  return {
1762
- slow: pn(
1731
+ slow: un(
1763
1732
  (S = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
1764
- (A) => A.id === u.transition_id
1733
+ (F) => F.id === u.transition_id
1765
1734
  )) == null ? void 0 : S.label
1766
1735
  )
1767
1736
  };
1768
1737
  },
1769
- onSuccess: (u, S, A) => {
1770
- $.invalidateQueries({ queryKey: J }), t === "nivaro_addendums" && $.invalidateQueries({ queryKey: ["addendums"] }), Qe($, t, String(e)), De($, t, String(e)), fn($, t, String(e)), g(null), T(""), L(null), Q(null), Y.success(mn(d, S.transition_id, u), A == null ? void 0 : A.slow.done());
1738
+ onSuccess: (u, S, F) => {
1739
+ $.invalidateQueries({ queryKey: J }), t === "nivaro_addendums" && $.invalidateQueries({ queryKey: ["addendums"] }), Qe($, t, String(e)), Ae($, t, String(e)), mn($, t, String(e)), g(null), T(""), L(null), Q(null), Y.success(cn(d, S.transition_id, u), F == null ? void 0 : F.slow.done());
1771
1740
  },
1772
- onError: (u, S, A) => {
1741
+ onError: (u, S, F) => {
1773
1742
  var te;
1774
- if (A == null || A.slow.fail(), Vt(u)) {
1743
+ if (F == null || F.slow.fail(), Gt(u)) {
1775
1744
  $.invalidateQueries({ queryKey: J });
1776
1745
  return;
1777
1746
  }
1778
- const W = Jt(u);
1747
+ const W = Yt(u);
1779
1748
  if (W) {
1780
1749
  L(null);
1781
1750
  const ve = ((te = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
@@ -1793,7 +1762,7 @@ function fr({
1793
1762
  });
1794
1763
  return;
1795
1764
  }
1796
- const Z = Xt(u);
1765
+ const Z = Vt(u);
1797
1766
  if (Z) {
1798
1767
  Q((ve) => ({
1799
1768
  payload: Z,
@@ -1804,31 +1773,31 @@ function fr({
1804
1773
  return;
1805
1774
  }
1806
1775
  const le = u == null ? void 0 : u.response;
1807
- g(Zt(u, S)), Y.error(Ae(u, "Failed to execute transition"), {
1776
+ g(Jt(u, S)), Y.error(Fe(u, "Failed to execute transition"), {
1808
1777
  duration: 12e3,
1809
1778
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
1810
- ...It(u, { action: "Transition" }),
1779
+ ...jt(u, { action: "Transition" }),
1811
1780
  // #1867: a refusal carries "Why?" — the role, owner or access rule
1812
1781
  // that stopped it, and who can change it.
1813
- ...zt(u) ? {
1814
- action: Ht(y, {
1782
+ ...Wt(u) ? {
1783
+ action: zt(y, {
1815
1784
  collection: t,
1816
1785
  itemId: String(e),
1817
1786
  action: "transition",
1818
1787
  transitionId: S.transition_id
1819
1788
  })
1820
1789
  } : {}
1821
- }), Q(null), L(null), Qe($, t, String(e)), De($, t, String(e)), (le == null ? void 0 : le.status) === 409 && $.invalidateQueries({ queryKey: J });
1790
+ }), Q(null), L(null), Qe($, t, String(e)), Ae($, t, String(e)), (le == null ? void 0 : le.status) === 409 && $.invalidateQueries({ queryKey: J });
1822
1791
  }
1823
1792
  }), ue = ne(de);
1824
1793
  ue.current = de;
1825
1794
  const U = ne((d == null ? void 0 : d.available_transitions) ?? []);
1826
1795
  if (U.current = (d == null ? void 0 : d.available_transitions) ?? [], fe(() => {
1827
1796
  const u = (S) => {
1828
- const A = S.detail;
1829
- if (!A || A.claimed || A.collection !== t || String(A.item) !== String(e)) return;
1830
- A.claimed = !0;
1831
- const W = String(A.transition_id).toUpperCase(), Z = U.current.find((le) => String(le.id).toUpperCase() === W);
1797
+ const F = S.detail;
1798
+ if (!F || F.claimed || F.collection !== t || String(F.item) !== String(e)) return;
1799
+ F.claimed = !0;
1800
+ const W = String(F.transition_id).toUpperCase(), Z = U.current.find((le) => String(le.id).toUpperCase() === W);
1832
1801
  if (!Z) {
1833
1802
  Y.error("That step is not available from where the record is now");
1834
1803
  return;
@@ -1844,20 +1813,20 @@ function fr({
1844
1813
  /* @__PURE__ */ n(ke, { className: "ml-auto h-3.5 w-3.5 rounded" })
1845
1814
  ] }) });
1846
1815
  if (!(d != null && d.binding)) return null;
1847
- const { instance: O, available_transitions: xe, history: Se, states: pe } = d, Ue = new Map((pe ?? []).map((u) => [u.id, u])), Ce = (O == null ? void 0 : O.current_state_obj) ?? null, ie = P ? (xe ?? []).find((u) => u.id === P) : null, yn = ie ? Ue.get(ie.to_state) : null, Ee = bn(ie, Ce, pe, m), ze = (Ee == null ? void 0 : Ee.state) ?? yn, wn = O != null && O.completed_at && xe ? xe.filter(
1816
+ const { instance: O, available_transitions: ge, history: Se, states: pe } = d, Ue = new Map((pe ?? []).map((u) => [u.id, u])), Ce = (O == null ? void 0 : O.current_state_obj) ?? null, ie = P ? (ge ?? []).find((u) => u.id === P) : null, gn = ie ? Ue.get(ie.to_state) : null, Ee = fn(ie, Ce, pe, m), ze = (Ee == null ? void 0 : Ee.state) ?? gn, xn = O != null && O.completed_at && ge ? ge.filter(
1848
1817
  (u) => u.from_state && String(u.from_state).toUpperCase() === String(O.current_state).toUpperCase()
1849
- ) : null, He = O != null && O.completed_at ? wn ?? [] : un(
1850
- xe ?? [],
1818
+ ) : null, He = O != null && O.completed_at ? xn ?? [] : dn(
1819
+ ge ?? [],
1851
1820
  pe ?? [],
1852
1821
  O == null ? void 0 : O.current_state,
1853
1822
  M
1854
1823
  ), pt = He.length > 0, ft = (u, S = !1) => {
1855
- const A = /* @__PURE__ */ new Map();
1824
+ const F = /* @__PURE__ */ new Map();
1856
1825
  for (const W of u) {
1857
- const Z = A.get(W.label) ?? [];
1858
- Z.push(W), A.set(W.label, Z);
1826
+ const Z = F.get(W.label) ?? [];
1827
+ Z.push(W), F.set(W.label, Z);
1859
1828
  }
1860
- return Array.from(A.entries()).map(([W, Z]) => {
1829
+ return Array.from(F.entries()).map(([W, Z]) => {
1861
1830
  var Le, wt;
1862
1831
  const le = ((Le = Z[0]) == null ? void 0 : Le.color) ?? null, te = Z.some((V) => V.id === P), ve = (V) => le ? V ? { backgroundColor: le, borderColor: le } : { borderColor: le, color: le } : void 0;
1863
1832
  if (Z.length === 1) {
@@ -1869,7 +1838,7 @@ function fr({
1869
1838
  variant: te ? "default" : "outline",
1870
1839
  className: `${S ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5 data-[fresh=true]:opacity-60`,
1871
1840
  style: ve(te),
1872
- disabled: j.isPending || be,
1841
+ disabled: j.isPending || he,
1873
1842
  "aria-disabled": a.dimmed(V.id) || void 0,
1874
1843
  "data-fresh": a.dimmed(V.id) || void 0,
1875
1844
  ...a.bind(V.id),
@@ -1892,7 +1861,7 @@ function fr({
1892
1861
  variant: te ? "default" : "outline",
1893
1862
  className: `${S ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1894
1863
  style: ve(te),
1895
- disabled: j.isPending || be,
1864
+ disabled: j.isPending || he,
1896
1865
  children: [
1897
1866
  W,
1898
1867
  /* @__PURE__ */ n($e, { className: "h-3 w-3" })
@@ -1920,7 +1889,7 @@ function fr({
1920
1889
  ] }, W);
1921
1890
  });
1922
1891
  }, Ge = X ? /* @__PURE__ */ n(
1923
- hn,
1892
+ pn,
1924
1893
  {
1925
1894
  collection: t,
1926
1895
  item: String(e),
@@ -1928,7 +1897,7 @@ function fr({
1928
1897
  onDismiss: () => g(null),
1929
1898
  onFixed: () => C({ transition_id: X.transitionId, comment: X.comment })
1930
1899
  }
1931
- ) : null, ht = ir(Se ?? [], O == null ? void 0 : O.current_state, pe ?? []), bt = /* @__PURE__ */ i("div", { className: "space-y-3 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3.5", children: [
1900
+ ) : null, ht = sr(Se ?? [], O == null ? void 0 : O.current_state, pe ?? []), bt = /* @__PURE__ */ i("div", { className: "space-y-3 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3.5", children: [
1932
1901
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
1933
1902
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
1934
1903
  ie && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: ie.label }),
@@ -1938,10 +1907,10 @@ function fr({
1938
1907
  /* @__PURE__ */ n(Ne, { label: ze.label, color: ze.color, small: !0 })
1939
1908
  ] })
1940
1909
  ] }),
1941
- /* @__PURE__ */ n(gn, { landing: Ee }),
1942
- /* @__PURE__ */ n(dn, { collection: t, item: String(e), tx: ie }),
1943
- /* @__PURE__ */ n(xn, { collection: t, item: e, omitLines: k }),
1944
- /* @__PURE__ */ n(sn, { lines: k }),
1910
+ /* @__PURE__ */ n(hn, { landing: Ee }),
1911
+ /* @__PURE__ */ n(ln, { collection: t, item: String(e), tx: ie }),
1912
+ /* @__PURE__ */ n(bn, { collection: t, item: e, omitLines: k }),
1913
+ /* @__PURE__ */ n(an, { lines: k }),
1945
1914
  /* @__PURE__ */ n(
1946
1915
  "input",
1947
1916
  {
@@ -1975,7 +1944,7 @@ function fr({
1975
1944
  transition_id: P,
1976
1945
  comment: K.trim() || void 0
1977
1946
  }),
1978
- children: j.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(ye, { children: [
1947
+ children: j.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(xe, { children: [
1979
1948
  /* @__PURE__ */ n("span", { children: k.length > 0 && ie ? `${ie.label} anyway` : "Confirm" }),
1980
1949
  /* @__PURE__ */ n(We, { className: "h-3 w-3" })
1981
1950
  ] })
@@ -1983,7 +1952,7 @@ function fr({
1983
1952
  )
1984
1953
  ] })
1985
1954
  ] });
1986
- return /* @__PURE__ */ i(ye, { children: [
1955
+ return /* @__PURE__ */ i(xe, { children: [
1987
1956
  /* @__PURE__ */ i(
1988
1957
  "div",
1989
1958
  {
@@ -2003,7 +1972,7 @@ function fr({
2003
1972
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
2004
1973
  _ && /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400", children: "Addendum workflow" }),
2005
1974
  Ce && /* @__PURE__ */ n(Ne, { label: Ce.label, color: Ce.color }),
2006
- /* @__PURE__ */ n(on, { flags: d == null ? void 0 : d.flags }),
1975
+ /* @__PURE__ */ n(rr, { flags: d == null ? void 0 : d.flags }),
2007
1976
  (((gt = d == null ? void 0 : d.auto_held) == null ? void 0 : gt.length) ?? 0) > 0 && /* @__PURE__ */ i(
2008
1977
  "span",
2009
1978
  {
@@ -2012,7 +1981,7 @@ function fr({
2012
1981
  `),
2013
1982
  "data-pipeline-auto-held-pill": !0,
2014
1983
  children: [
2015
- /* @__PURE__ */ n(Nn, { className: "h-3 w-3 shrink-0" }),
1984
+ /* @__PURE__ */ n(vn, { className: "h-3 w-3 shrink-0" }),
2016
1985
  "Needs a person"
2017
1986
  ]
2018
1987
  }
@@ -2028,7 +1997,7 @@ function fr({
2028
1997
  "data-pipeline-approving": !0,
2029
1998
  children: [
2030
1999
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
2031
- Pn(ee, "approving")
2000
+ Mn(ee, "approving")
2032
2001
  ]
2033
2002
  }
2034
2003
  )
@@ -2052,7 +2021,7 @@ function fr({
2052
2021
  }
2053
2022
  ),
2054
2023
  l && ((d == null ? void 0 : d.binding) || (d == null ? void 0 : d.instance)) && /* @__PURE__ */ n(
2055
- pr,
2024
+ mr,
2056
2025
  {
2057
2026
  collection: t,
2058
2027
  item: e,
@@ -2064,7 +2033,7 @@ function fr({
2064
2033
  /* @__PURE__ */ n(
2065
2034
  $e,
2066
2035
  {
2067
- className: he(
2036
+ className: ye(
2068
2037
  "h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
2069
2038
  w && "rotate-180"
2070
2039
  )
@@ -2075,9 +2044,9 @@ function fr({
2075
2044
  ),
2076
2045
  !w && P && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: bt }),
2077
2046
  !w && Ge && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ge }),
2078
- ht && !(O != null && O.completed_at) && /* @__PURE__ */ n(lr, { entry: ht }),
2047
+ ht && !(O != null && O.completed_at) && /* @__PURE__ */ n(ir, { entry: ht }),
2079
2048
  w && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
2080
- /* @__PURE__ */ n(Yn, { held: (d == null ? void 0 : d.auto_held) ?? [] }),
2049
+ /* @__PURE__ */ n(Vn, { held: (d == null ? void 0 : d.auto_held) ?? [] }),
2081
2050
  f && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-amber-100 bg-amber-50 px-5 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/10", children: [
2082
2051
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
2083
2052
  /* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
@@ -2097,20 +2066,20 @@ function fr({
2097
2066
  /* @__PURE__ */ n(ke, { className: "ml-2 h-3 w-24" })
2098
2067
  ] })
2099
2068
  ) : /* @__PURE__ */ n(
2100
- dr,
2069
+ or,
2101
2070
  {
2102
2071
  states: pe,
2103
2072
  allTransitions: (d == null ? void 0 : d.all_transitions) ?? [],
2104
- availableTransitions: xe ?? [],
2073
+ availableTransitions: ge ?? [],
2105
2074
  currentStateId: O.current_state,
2106
2075
  history: Se ?? [],
2107
- onPathIds: F,
2076
+ onPathIds: D,
2108
2077
  skippedStates: M
2109
2078
  }
2110
2079
  ),
2111
- (d == null ? void 0 : d.branches) && /* @__PURE__ */ n(Qn, { data: d.branches }),
2080
+ (d == null ? void 0 : d.branches) && /* @__PURE__ */ n(In, { data: d.branches }),
2112
2081
  /* @__PURE__ */ n(
2113
- or,
2082
+ lr,
2114
2083
  {
2115
2084
  history: Se ?? [],
2116
2085
  completedAt: O.completed_at
@@ -2118,9 +2087,9 @@ function fr({
2118
2087
  )
2119
2088
  ] }),
2120
2089
  /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2121
- !O.completed_at && /* @__PURE__ */ n(Gn, { collection: t, itemId: String(e) }),
2090
+ !O.completed_at && /* @__PURE__ */ n(zn, { collection: t, itemId: String(e) }),
2122
2091
  /* @__PURE__ */ n(
2123
- mr,
2092
+ ur,
2124
2093
  {
2125
2094
  collection: t,
2126
2095
  item: e,
@@ -2151,7 +2120,7 @@ function fr({
2151
2120
  /* @__PURE__ */ n(
2152
2121
  $e,
2153
2122
  {
2154
- className: he(
2123
+ className: ye(
2155
2124
  "h-3.5 w-3.5 transition-transform duration-200",
2156
2125
  h && "rotate-180"
2157
2126
  )
@@ -2167,10 +2136,10 @@ function fr({
2167
2136
  ]
2168
2137
  }
2169
2138
  ),
2170
- h && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(cr, { history: Se ?? [] }) })
2139
+ h && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(dr, { history: Se ?? [] }) })
2171
2140
  ] }),
2172
- D && (pe ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", ref: H, children: /* @__PURE__ */ n(
2173
- Hn,
2141
+ A && (pe ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", ref: H, children: /* @__PURE__ */ n(
2142
+ Wn,
2174
2143
  {
2175
2144
  collection: t,
2176
2145
  item: e,
@@ -2205,8 +2174,8 @@ function fr({
2205
2174
  ]
2206
2175
  }
2207
2176
  ),
2208
- o && /* @__PURE__ */ n(Lt, { fallback: null, children: /* @__PURE__ */ n(
2209
- Gt,
2177
+ o && /* @__PURE__ */ n(Et, { fallback: null, children: /* @__PURE__ */ n(
2178
+ Ht,
2210
2179
  {
2211
2180
  payload: o.payload,
2212
2181
  transitionId: o.transitionId,
@@ -2228,14 +2197,14 @@ function fr({
2228
2197
  ) })
2229
2198
  ] });
2230
2199
  }
2231
- function Vr({
2200
+ function Gr({
2232
2201
  collection: t,
2233
2202
  item: e,
2234
2203
  onBeforeTransition: r,
2235
2204
  wrap: s = !0
2236
2205
  }) {
2237
2206
  return e === "new" ? null : /* @__PURE__ */ n(
2238
- hr,
2207
+ fr,
2239
2208
  {
2240
2209
  collection: t,
2241
2210
  item: e,
@@ -2244,16 +2213,16 @@ function Vr({
2244
2213
  }
2245
2214
  );
2246
2215
  }
2247
- function hr({
2216
+ function fr({
2248
2217
  collection: t,
2249
2218
  item: e,
2250
2219
  onBeforeTransition: r,
2251
2220
  wrap: s = !0
2252
2221
  }) {
2253
- const l = we(), c = Fe(), [p, b] = I(""), [f, _] = I(null), [v, y] = I(null), [$, D] = I(null), [E, B] = I([]), H = an(t, String(e));
2254
- Kt(t, e, "transition", !!f || !!v);
2255
- const K = ne(null), T = Ln(K, !s), P = ne(!1), L = (a) => {
2256
- P.current || (P.current = !0, D(null), k.mutate(a, {
2222
+ const l = we(), c = De(), [p, b] = I(""), [f, _] = I(null), [v, y] = I(null), [$, A] = I(null), [E, B] = I([]), H = rn(t, String(e));
2223
+ It(t, e, "transition", !!f || !!v);
2224
+ const K = ne(null), T = Un(K, !s), P = ne(!1), L = (a) => {
2225
+ P.current || (P.current = !0, A(null), k.mutate(a, {
2257
2226
  onSettled: (m, N) => {
2258
2227
  if (N) {
2259
2228
  P.current = !1;
@@ -2281,7 +2250,7 @@ function hr({
2281
2250
  }
2282
2251
  if (!j) return;
2283
2252
  }
2284
- const m = (ee ?? []).find((j) => j.id === a), N = String((m == null ? void 0 : m.comment_mode) ?? "none"), F = ln(m, (o == null ? void 0 : o.states) ?? [], (M = o == null ? void 0 : o.instance) == null ? void 0 : M.current_state);
2253
+ const m = (ee ?? []).find((j) => j.id === a), N = String((m == null ? void 0 : m.comment_mode) ?? "none"), D = sn(m, (o == null ? void 0 : o.states) ?? [], (M = o == null ? void 0 : o.instance) == null ? void 0 : M.current_state);
2285
2254
  if (N !== "optional" && N !== "required") {
2286
2255
  if (m && !Oe(m, (o == null ? void 0 : o.states) ?? [], (R = o == null ? void 0 : o.instance) == null ? void 0 : R.current_state)) {
2287
2256
  P.current = !0;
@@ -2291,12 +2260,12 @@ function hr({
2291
2260
  } finally {
2292
2261
  P.current = !1;
2293
2262
  }
2294
- if (j.length > 0 || F) {
2263
+ if (j.length > 0 || D) {
2295
2264
  B(j), _(a);
2296
2265
  return;
2297
2266
  }
2298
2267
  }
2299
- if (F) {
2268
+ if (D) {
2300
2269
  B([]), _(a);
2301
2270
  return;
2302
2271
  }
@@ -2304,7 +2273,7 @@ function hr({
2304
2273
  return;
2305
2274
  }
2306
2275
  B([]), _(a);
2307
- }, x = ["pipeline-instance", t, e], { settling: w, settle: q } = en(x), { data: o } = oe({
2276
+ }, x = ["pipeline-instance", t, e], { settling: w, settle: q } = Zt(x), { data: o } = oe({
2308
2277
  queryKey: x,
2309
2278
  queryFn: () => l.request(
2310
2279
  ce(`/pipelines/instance/${t}/${e}`)
@@ -2319,7 +2288,7 @@ function hr({
2319
2288
  }
2320
2289
  ),
2321
2290
  staleTime: 1e4
2322
- }), Q = tn(
2291
+ }), Q = en(
2323
2292
  o ? (o.available_transitions ?? []).map((a) => String(a.id)) : null,
2324
2293
  `${t}:${e}`
2325
2294
  ), { data: X } = oe({
@@ -2328,7 +2297,7 @@ function hr({
2328
2297
  ce(`/pipelines/instance/${t}/${e}/owners/all`)
2329
2298
  ).then((a) => a.data ?? null),
2330
2299
  // Also while a move is being confirmed: the panel names where it really lands.
2331
- enabled: cn(o) || !!f,
2300
+ enabled: on(o) || !!f,
2332
2301
  staleTime: 3e4
2333
2302
  }), g = Ie(() => {
2334
2303
  if (!X) return null;
@@ -2341,19 +2310,19 @@ function hr({
2341
2310
  transition_id: a,
2342
2311
  comment: m,
2343
2312
  reviewed: N,
2344
- lock_ack: F
2313
+ lock_ack: D
2345
2314
  }) => l.request(
2346
2315
  Te(`/pipelines/instance/${t}/${e}/transition`, {
2347
2316
  transition_id: a,
2348
2317
  comment: m,
2349
2318
  ...N ? { reviewed: !0 } : {},
2350
- ...F ? { lock_ack: !0 } : {}
2319
+ ...D ? { lock_ack: !0 } : {}
2351
2320
  })
2352
2321
  ),
2353
2322
  onMutate: (a) => {
2354
2323
  var m;
2355
2324
  return {
2356
- slow: pn(
2325
+ slow: un(
2357
2326
  (m = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
2358
2327
  (N) => N.id === a.transition_id
2359
2328
  )) == null ? void 0 : m.label
@@ -2361,21 +2330,21 @@ function hr({
2361
2330
  };
2362
2331
  },
2363
2332
  onSuccess: (a, m, N) => {
2364
- c.invalidateQueries({ queryKey: x }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Qe(c, t, String(e)), De(c, t, String(e)), fn(c, t, String(e)), D(null), b(""), _(null), y(null), Y.success(mn(o, m.transition_id, a), N == null ? void 0 : N.slow.done());
2333
+ c.invalidateQueries({ queryKey: x }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Qe(c, t, String(e)), Ae(c, t, String(e)), mn(c, t, String(e)), A(null), b(""), _(null), y(null), Y.success(cn(o, m.transition_id, a), N == null ? void 0 : N.slow.done());
2365
2334
  },
2366
2335
  onError: (a, m, N) => {
2367
2336
  var j;
2368
- if (N == null || N.slow.fail(), Vt(a)) {
2337
+ if (N == null || N.slow.fail(), Gt(a)) {
2369
2338
  c.invalidateQueries({ queryKey: x });
2370
2339
  return;
2371
2340
  }
2372
- const F = Jt(a);
2373
- if (F) {
2341
+ const D = Yt(a);
2342
+ if (D) {
2374
2343
  _(null);
2375
2344
  const ue = ((j = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
2376
2345
  (U) => U.id === m.transition_id
2377
2346
  )) == null ? void 0 : j.label) ?? "Move";
2378
- Y.warning(F.message, {
2347
+ Y.warning(D.message, {
2379
2348
  id: `nvr-locked-move:${t}:${String(e)}`,
2380
2349
  duration: 2e4,
2381
2350
  action: {
@@ -2387,7 +2356,7 @@ function hr({
2387
2356
  });
2388
2357
  return;
2389
2358
  }
2390
- const M = Xt(a);
2359
+ const M = Vt(a);
2391
2360
  if (M) {
2392
2361
  y((ue) => ({
2393
2362
  payload: M,
@@ -2398,21 +2367,21 @@ function hr({
2398
2367
  return;
2399
2368
  }
2400
2369
  const R = a == null ? void 0 : a.response;
2401
- D(Zt(a, m)), Y.error(Ae(a, "Failed to execute transition"), {
2370
+ A(Jt(a, m)), Y.error(Fe(a, "Failed to execute transition"), {
2402
2371
  duration: 12e3,
2403
2372
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
2404
- ...It(a, { action: "Transition" }),
2373
+ ...jt(a, { action: "Transition" }),
2405
2374
  // #1867: a refusal carries "Why?" — the role, owner or access rule
2406
2375
  // that stopped it, and who can change it.
2407
- ...zt(a) ? {
2408
- action: Ht(l, {
2376
+ ...Wt(a) ? {
2377
+ action: zt(l, {
2409
2378
  collection: t,
2410
2379
  itemId: String(e),
2411
2380
  action: "transition",
2412
2381
  transitionId: m.transition_id
2413
2382
  })
2414
2383
  } : {}
2415
- }), y(null), _(null), Qe(c, t, String(e)), De(c, t, String(e)), (R == null ? void 0 : R.status) === 409 && c.invalidateQueries({ queryKey: x });
2384
+ }), y(null), _(null), Qe(c, t, String(e)), Ae(c, t, String(e)), (R == null ? void 0 : R.status) === 409 && c.invalidateQueries({ queryKey: x });
2416
2385
  }
2417
2386
  }), G = ne(h);
2418
2387
  G.current = h;
@@ -2422,7 +2391,7 @@ function hr({
2422
2391
  const N = m.detail;
2423
2392
  if (!N || N.claimed || N.collection !== t || String(N.item) !== String(e)) return;
2424
2393
  N.claimed = !0;
2425
- const F = String(N.transition_id).toUpperCase(), M = se.current.find((R) => String(R.id).toUpperCase() === F);
2394
+ const D = String(N.transition_id).toUpperCase(), M = se.current.find((R) => String(R.id).toUpperCase() === D);
2426
2395
  if (!M) {
2427
2396
  Y.error("That step is not available from where the record is now");
2428
2397
  return;
@@ -2431,7 +2400,7 @@ function hr({
2431
2400
  };
2432
2401
  return window.addEventListener(Ke, a), () => window.removeEventListener(Ke, a);
2433
2402
  }, [t, e]), !(o != null && o.binding) || !(o != null && o.instance)) return null;
2434
- const ee = un(
2403
+ const ee = dn(
2435
2404
  (o.available_transitions ?? []).filter(
2436
2405
  (a) => !o.instance.completed_at || a.from_state && String(a.from_state).toUpperCase() === String(o.instance.current_state).toUpperCase()
2437
2406
  ),
@@ -2440,21 +2409,21 @@ function hr({
2440
2409
  o.instance.completed_at ? null : g
2441
2410
  );
2442
2411
  if (ee.length === 0) return null;
2443
- const re = new Map((o.states ?? []).map((a) => [a.id, a])), z = o.instance.current_state_obj ?? null, C = f ? ee.find((a) => a.id === f) : null, de = C ? re.get(C.to_state) : null, J = bn(C, z, o.states ?? [], X), be = (J == null ? void 0 : J.state) ?? de, ge = /* @__PURE__ */ new Map();
2412
+ const re = new Map((o.states ?? []).map((a) => [a.id, a])), z = o.instance.current_state_obj ?? null, C = f ? ee.find((a) => a.id === f) : null, de = C ? re.get(C.to_state) : null, J = fn(C, z, o.states ?? [], X), he = (J == null ? void 0 : J.state) ?? de, be = /* @__PURE__ */ new Map();
2444
2413
  for (const a of ee) {
2445
- const m = ge.get(a.label) ?? [];
2446
- m.push(a), ge.set(a.label, m);
2414
+ const m = be.get(a.label) ?? [];
2415
+ m.push(a), be.set(a.label, m);
2447
2416
  }
2448
2417
  const d = (a) => [...a].sort(
2449
2418
  (m, N) => {
2450
- var F, M;
2451
- return (((F = re.get(m.to_state)) == null ? void 0 : F.sort) ?? 999) - (((M = re.get(N.to_state)) == null ? void 0 : M.sort) ?? 999);
2419
+ var D, M;
2420
+ return (((D = re.get(m.to_state)) == null ? void 0 : D.sort) ?? 999) - (((M = re.get(N.to_state)) == null ? void 0 : M.sort) ?? 999);
2452
2421
  }
2453
2422
  ), _e = (() => {
2454
- var N, F, M;
2423
+ var N, D, M;
2455
2424
  const a = (N = K.current) == null ? void 0 : N.getBoundingClientRect();
2456
2425
  if (!a) return 600;
2457
- const m = (M = (F = K.current) == null ? void 0 : F.closest('[role="dialog"]')) == null ? void 0 : M.getBoundingClientRect();
2426
+ const m = (M = (D = K.current) == null ? void 0 : D.closest('[role="dialog"]')) == null ? void 0 : M.getBoundingClientRect();
2458
2427
  return Math.max(260, Math.min(600, a.right - ((m == null ? void 0 : m.left) ?? 0) - 12));
2459
2428
  })();
2460
2429
  return /* @__PURE__ */ i("div", { ref: K, className: "relative", children: [
@@ -2474,9 +2443,9 @@ function hr({
2474
2443
  ]
2475
2444
  }
2476
2445
  ) }),
2477
- /* @__PURE__ */ n(tt, { align: "end", className: "min-w-[200px]", children: Array.from(ge.entries()).map(
2478
- ([a, m], N, F) => m.length === 1 ? /* @__PURE__ */ i(St, { children: [
2479
- N > 0 && F[N - 1][1].length > 1 && /* @__PURE__ */ n(Ct, {}),
2446
+ /* @__PURE__ */ n(tt, { align: "end", className: "min-w-[200px]", children: Array.from(be.entries()).map(
2447
+ ([a, m], N, D) => m.length === 1 ? /* @__PURE__ */ i(St, { children: [
2448
+ N > 0 && D[N - 1][1].length > 1 && /* @__PURE__ */ n(Ct, {}),
2480
2449
  /* @__PURE__ */ i(Be, { onSelect: () => h(m[0].id), children: [
2481
2450
  m[0].color && /* @__PURE__ */ n(
2482
2451
  "span",
@@ -2489,7 +2458,7 @@ function hr({
2489
2458
  ] })
2490
2459
  ] }, a) : /* @__PURE__ */ i(St, { children: [
2491
2460
  N > 0 && /* @__PURE__ */ n(Ct, {}),
2492
- /* @__PURE__ */ n(In, { className: "text-[11px] text-muted-foreground", children: a }),
2461
+ /* @__PURE__ */ n(Bn, { className: "text-[11px] text-muted-foreground", children: a }),
2493
2462
  d(m).map((M) => {
2494
2463
  var R;
2495
2464
  return /* @__PURE__ */ i(Be, { onSelect: () => h(M.id), children: [
@@ -2505,85 +2474,82 @@ function hr({
2505
2474
  })
2506
2475
  ] }, a)
2507
2476
  ) })
2508
- ] }) : /* @__PURE__ */ i(
2477
+ ] }) : /* @__PURE__ */ n(
2509
2478
  "div",
2510
2479
  {
2511
2480
  className: s ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
2512
- children: [
2513
- /* @__PURE__ */ n(on, { flags: o == null ? void 0 : o.flags, variant: "inline" }),
2514
- Array.from(ge.entries()).map(([a, m]) => {
2515
- var j, ue;
2516
- const N = m.some((U) => {
2517
- var O;
2518
- return (((O = U.order_partners) == null ? void 0 : O.length) ?? 0) > 0;
2519
- }), F = N ? null : ((j = m[0]) == null ? void 0 : j.color) ?? null, M = m.some((U) => U.id === f), R = (U) => F ? U ? { backgroundColor: F, borderColor: F } : { borderColor: F, color: F } : void 0;
2520
- if (m.length === 1) {
2521
- const U = m[0], O = k.isPending && ((ue = k.variables) == null ? void 0 : ue.transition_id) === U.id, xe = /* @__PURE__ */ i(
2522
- ae,
2523
- {
2524
- size: "sm",
2525
- variant: M ? "default" : "outline",
2526
- className: "gap-1.5 text-[12px] data-[fresh=true]:opacity-60",
2527
- style: R(M),
2528
- disabled: k.isPending || w,
2529
- "aria-disabled": Q.dimmed(U.id) || void 0,
2530
- "data-fresh": Q.dimmed(U.id) || void 0,
2531
- ...Q.bind(U.id),
2532
- onClick: () => {
2533
- Q.press(U.id) && h(U.id);
2534
- },
2535
- children: [
2536
- O ? /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }) : N && /* @__PURE__ */ n(Dt, { className: "h-3 w-3", "aria-hidden": !0 }),
2537
- a
2538
- ]
2481
+ children: Array.from(be.entries()).map(([a, m]) => {
2482
+ var j, ue;
2483
+ const N = m.some((U) => {
2484
+ var O;
2485
+ return (((O = U.order_partners) == null ? void 0 : O.length) ?? 0) > 0;
2486
+ }), D = N ? null : ((j = m[0]) == null ? void 0 : j.color) ?? null, M = m.some((U) => U.id === f), R = (U) => D ? U ? { backgroundColor: D, borderColor: D } : { borderColor: D, color: D } : void 0;
2487
+ if (m.length === 1) {
2488
+ const U = m[0], O = k.isPending && ((ue = k.variables) == null ? void 0 : ue.transition_id) === U.id, ge = /* @__PURE__ */ i(
2489
+ ae,
2490
+ {
2491
+ size: "sm",
2492
+ variant: M ? "default" : "outline",
2493
+ className: "gap-1.5 text-[12px] data-[fresh=true]:opacity-60",
2494
+ style: R(M),
2495
+ disabled: k.isPending || w,
2496
+ "aria-disabled": Q.dimmed(U.id) || void 0,
2497
+ "data-fresh": Q.dimmed(U.id) || void 0,
2498
+ ...Q.bind(U.id),
2499
+ onClick: () => {
2500
+ Q.press(U.id) && h(U.id);
2539
2501
  },
2540
- a
2541
- );
2542
- return U.pushes && U.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2543
- xe,
2544
- /* @__PURE__ */ n(
2545
- En,
2546
- {
2547
- collection: t,
2548
- itemId: e,
2549
- transitionId: U.id,
2550
- label: a,
2551
- compact: !0
2552
- }
2553
- )
2554
- ] }, a) : xe;
2555
- }
2556
- return /* @__PURE__ */ i(Ze, { children: [
2557
- /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i(
2558
- ae,
2502
+ children: [
2503
+ O ? /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }) : N && /* @__PURE__ */ n(Ft, { className: "h-3 w-3", "aria-hidden": !0 }),
2504
+ a
2505
+ ]
2506
+ },
2507
+ a
2508
+ );
2509
+ return U.pushes && U.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2510
+ ge,
2511
+ /* @__PURE__ */ n(
2512
+ On,
2559
2513
  {
2560
- size: "sm",
2561
- variant: M ? "default" : "outline",
2562
- className: "gap-1.5 text-[12px]",
2563
- style: R(M),
2564
- disabled: k.isPending || w,
2565
- children: [
2566
- a,
2567
- /* @__PURE__ */ n($e, { className: "h-3 w-3" })
2568
- ]
2514
+ collection: t,
2515
+ itemId: e,
2516
+ transitionId: U.id,
2517
+ label: a,
2518
+ compact: !0
2569
2519
  }
2570
- ) }),
2571
- /* @__PURE__ */ n(tt, { align: "start", children: d(m).map((U) => {
2572
- var O;
2573
- return /* @__PURE__ */ i(Be, { onSelect: () => h(U.id), children: [
2574
- U.color && /* @__PURE__ */ n(
2575
- "span",
2576
- {
2577
- className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
2578
- style: { backgroundColor: U.color }
2579
- }
2580
- ),
2581
- ((O = re.get(U.to_state)) == null ? void 0 : O.label) ?? U.to_state
2582
- ] }, U.id);
2583
- }) })
2584
- ] }, a);
2585
- })
2586
- ]
2520
+ )
2521
+ ] }, a) : ge;
2522
+ }
2523
+ return /* @__PURE__ */ i(Ze, { children: [
2524
+ /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i(
2525
+ ae,
2526
+ {
2527
+ size: "sm",
2528
+ variant: M ? "default" : "outline",
2529
+ className: "gap-1.5 text-[12px]",
2530
+ style: R(M),
2531
+ disabled: k.isPending || w,
2532
+ children: [
2533
+ a,
2534
+ /* @__PURE__ */ n($e, { className: "h-3 w-3" })
2535
+ ]
2536
+ }
2537
+ ) }),
2538
+ /* @__PURE__ */ n(tt, { align: "start", children: d(m).map((U) => {
2539
+ var O;
2540
+ return /* @__PURE__ */ i(Be, { onSelect: () => h(U.id), children: [
2541
+ U.color && /* @__PURE__ */ n(
2542
+ "span",
2543
+ {
2544
+ className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
2545
+ style: { backgroundColor: U.color }
2546
+ }
2547
+ ),
2548
+ ((O = re.get(U.to_state)) == null ? void 0 : O.label) ?? U.to_state
2549
+ ] }, U.id);
2550
+ }) })
2551
+ ] }, a);
2552
+ })
2587
2553
  }
2588
2554
  ),
2589
2555
  f && /* @__PURE__ */ i(
@@ -2595,16 +2561,16 @@ function hr({
2595
2561
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
2596
2562
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
2597
2563
  C && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: C.label }),
2598
- z && be && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2564
+ z && he && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2599
2565
  /* @__PURE__ */ n(Ne, { label: z.label, color: z.color, small: !0 }),
2600
2566
  /* @__PURE__ */ n(lt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2601
- /* @__PURE__ */ n(Ne, { label: be.label, color: be.color, small: !0 })
2567
+ /* @__PURE__ */ n(Ne, { label: he.label, color: he.color, small: !0 })
2602
2568
  ] })
2603
2569
  ] }),
2604
- /* @__PURE__ */ n(gn, { landing: J }),
2605
- /* @__PURE__ */ n(dn, { collection: t, item: String(e), tx: C }),
2606
- /* @__PURE__ */ n(xn, { collection: t, item: e, omitLines: E }),
2607
- /* @__PURE__ */ n(sn, { lines: E }),
2570
+ /* @__PURE__ */ n(hn, { landing: J }),
2571
+ /* @__PURE__ */ n(ln, { collection: t, item: String(e), tx: C }),
2572
+ /* @__PURE__ */ n(bn, { collection: t, item: e, omitLines: E }),
2573
+ /* @__PURE__ */ n(an, { lines: E }),
2608
2574
  /* @__PURE__ */ n(
2609
2575
  "input",
2610
2576
  {
@@ -2638,7 +2604,7 @@ function hr({
2638
2604
  transition_id: f,
2639
2605
  comment: p.trim() || void 0
2640
2606
  }),
2641
- children: k.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(ye, { children: [
2607
+ children: k.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(xe, { children: [
2642
2608
  /* @__PURE__ */ n("span", { children: E.length > 0 && C ? `${C.label} anyway` : "Confirm" }),
2643
2609
  /* @__PURE__ */ n(We, { className: "h-3 w-3" })
2644
2610
  ] })
@@ -2649,19 +2615,19 @@ function hr({
2649
2615
  }
2650
2616
  ),
2651
2617
  $ && !f && /* @__PURE__ */ n(
2652
- hn,
2618
+ pn,
2653
2619
  {
2654
2620
  collection: t,
2655
2621
  item: String(e),
2656
2622
  offer: $,
2657
2623
  className: "absolute right-0 top-full z-50 mt-1 shadow-lg",
2658
2624
  style: { width: _e },
2659
- onDismiss: () => D(null),
2625
+ onDismiss: () => A(null),
2660
2626
  onFixed: () => L({ transition_id: $.transitionId, comment: $.comment })
2661
2627
  }
2662
2628
  ),
2663
- v && /* @__PURE__ */ n(Lt, { fallback: null, children: /* @__PURE__ */ n(
2664
- Gt,
2629
+ v && /* @__PURE__ */ n(Et, { fallback: null, children: /* @__PURE__ */ n(
2630
+ Ht,
2665
2631
  {
2666
2632
  payload: v.payload,
2667
2633
  transitionId: v.transitionId,
@@ -2686,24 +2652,24 @@ function hr({
2686
2652
  export {
2687
2653
  Me as FRESH_BUTTON_MS,
2688
2654
  qt as FRESH_HOVER_MAX_MS,
2689
- er as FreshButtonGuard,
2690
- Gr as PipelinePanel,
2691
- Vr as PipelineTransitionButtons,
2692
- Jn as REFUSAL_FIX_ACTIONS,
2693
- on as RecordFlagChips,
2694
- sr as SLOW_MOVE_MS,
2695
- ln as asksFirst,
2696
- nr as briefAgeText,
2697
- rr as briefDiffPair,
2655
+ Jn as FreshButtonGuard,
2656
+ Hr as PipelinePanel,
2657
+ Gr as PipelineTransitionButtons,
2658
+ Xn as REFUSAL_FIX_ACTIONS,
2659
+ rr as RecordFlagChips,
2660
+ ar as SLOW_MOVE_MS,
2661
+ sn as asksFirst,
2662
+ er as briefAgeText,
2663
+ tr as briefDiffPair,
2698
2664
  Mt as briefLineKey,
2699
- tr as briefWarnings,
2700
- Vt as isDuplicateTransition,
2701
- ir as latestSendBack,
2702
- Jt as lockedMoveOffer,
2703
- Yt as refusalCode,
2704
- Zt as refusalFixFor,
2705
- pn as slowMoveToast,
2706
- Xt as transitionRequirementsFromError,
2707
- mn as transitionToastText,
2708
- un as withoutSkippedSendBacks
2665
+ Zn as briefWarnings,
2666
+ Gt as isDuplicateTransition,
2667
+ sr as latestSendBack,
2668
+ Yt as lockedMoveOffer,
2669
+ Xt as refusalCode,
2670
+ Jt as refusalFixFor,
2671
+ un as slowMoveToast,
2672
+ Vt as transitionRequirementsFromError,
2673
+ cn as transitionToastText,
2674
+ dn as withoutSkippedSendBacks
2709
2675
  };