@nivaro/react 0.3.89 → 0.3.91

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,46 +1,47 @@
1
- var bn = Object.defineProperty;
2
- var gn = (t, e, r) => e in t ? bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var ze = (t, e, r) => gn(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { jsx as n, jsxs as i, Fragment as he } from "react/jsx-runtime";
5
- import { useQueryClient as Re, useQuery as oe, useMutation as Me } from "@tanstack/react-query";
6
- import { ArrowRight as at, Loader2 as me, Check as Ie, GitBranch as He, AlertTriangle as xn, ChevronDown as Se, Send as Mt, Users as Rt, Undo2 as yn, Minus as wn, UserPlus as vn, X as Pt, Zap as Dt, Search as kn } from "lucide-react";
7
- import { useState as K, useRef as se, useEffect as fe, useMemo as Le, Suspense as Ft, useCallback as At, lazy as Nn } from "react";
8
- import { toast as J } from "sonner";
9
- import { useNivaroClient as ge, useItemEditAuth as Ot } from "../../context.js";
10
- import { get as ue, post as Ce, del as _n } from "../../lib/commands.js";
11
- import { errorToastOptions as Ut, toastError as Sn } from "../../lib/error-toast.js";
12
- import { useRecordSignalWhile as Bt, useRecordSignalPeers as Cn, signalSentence as $n } from "../../lib/presence-signals.js";
13
- import { RUN_TRANSITION_EVENT as Ee } from "../../lib/run-transition.js";
14
- import { userErrorMessage as Pe } from "../../lib/safe-error.js";
15
- import { serverNow as Tn } from "../../lib/server-clock.js";
16
- import { userCardQuery as qn } from "../../lib/user-cards.js";
17
- import { cn as be, titleCase as Mn, toLocalDateString as Rn, formatRelative as st, formatDateTime as wt, humanHours as Pn } from "../../lib/utils.js";
18
- import { PushReadinessChip as Dn } from "../integrations/RecordIntegrationPreview.js";
19
- import { useHeaderFold as Fn } from "../item-edit/HeaderTools.js";
20
- import { invalidateRecordInsights as je, invalidateRecordData as De } from "../item-edit/RecordInsights.js";
21
- import { UserChip as Lt } from "../item-edit/UserChip.js";
22
- import { OwnerAvatars as An } from "../queue/OwnerAvatars.js";
23
- import { UserAvatar as On } from "../UserAvatar.js";
1
+ var wn = Object.defineProperty;
2
+ var vn = (t, e, r) => e in t ? wn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var Ve = (t, e, r) => vn(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 kn, ChevronDown as $e, Send as Ft, Users as At, Undo2 as Nn, Minus as _n, UserPlus as Sn, X as Ot, Zap as Ut, Search as Cn } 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 $n } from "react";
8
+ import { toast as Y } from "sonner";
9
+ import { useNivaroClient as we, useItemEditAuth as Bt } from "../../context.js";
10
+ import { get as ce, post as Te, del as Tn } from "../../lib/commands.js";
11
+ import { errorToastOptions as jt, toastError as qn } from "../../lib/error-toast.js";
12
+ import { useRecordSignalWhile as It, useRecordSignalPeers as Mn, signalSentence as Rn } from "../../lib/presence-signals.js";
13
+ import { OPEN_MOVE_STATE_EVENT as Nt } from "../../lib/move-state.js";
14
+ import { RUN_TRANSITION_EVENT as Ke } from "../../lib/run-transition.js";
15
+ import { userErrorMessage as Fe } from "../../lib/safe-error.js";
16
+ import { serverNow as Pn } from "../../lib/server-clock.js";
17
+ import { userCardQuery as Dn } from "../../lib/user-cards.js";
18
+ import { cn as ye, titleCase as Fn, toLocalDateString as An, formatRelative as ot, formatDateTime as _t, humanHours as On } from "../../lib/utils.js";
19
+ import { PushReadinessChip as Un } from "../integrations/RecordIntegrationPreview.js";
20
+ import { useHeaderFold as En } 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 Ln } from "../queue/OwnerAvatars.js";
24
+ import { UserAvatar as Bn } from "../UserAvatar.js";
24
25
  import { Button as ae } from "../ui/button.js";
25
- import { DropdownMenu as Xe, DropdownMenuTrigger as Ye, DropdownMenuContent as Je, DropdownMenuGroup as vt, DropdownMenuSeparator as kt, DropdownMenuItem as Ue, DropdownMenuLabel as Un } from "../ui/dropdown-menu.js";
26
- import { Popover as it, PopoverTrigger as lt, PopoverContent as ot } from "../ui/popover.js";
27
- import { Skeleton as we } from "../ui/skeleton.js";
28
- import { TooltipProvider as Et, Tooltip as Ze, TooltipTrigger as et, TooltipContent as tt } from "../ui/tooltip.js";
29
- import { isAccessRefusal as jt, deniedToastAction as It, WhyOwnersButton as Bn } from "./AccessInsights.js";
30
- import { BranchLanes as Ln } from "./BranchLanes.js";
31
- import { landingState as En, landingSkipGroups as jn, joinLabels as Nt } from "./landing-state.js";
32
- import { MoveToStatePanel as In } from "./MoveToStatePanel.js";
33
- import { SlaClockLine as Kn } from "./SlaClock.js";
34
- const Kt = Nn(
26
+ import { DropdownMenu as Ze, DropdownMenuTrigger as et, DropdownMenuContent as tt, DropdownMenuGroup as St, DropdownMenuSeparator as Ct, DropdownMenuItem as Be, DropdownMenuLabel as jn } from "../ui/dropdown-menu.js";
27
+ import { Popover as dt, PopoverTrigger as ct, PopoverContent as ut } from "../ui/popover.js";
28
+ import { Skeleton as ke } from "../ui/skeleton.js";
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 In } from "./AccessInsights.js";
31
+ import { BranchLanes as Kn } from "./BranchLanes.js";
32
+ import { landingState as Qn, landingSkipGroups as Wn, joinLabels as $t } from "./landing-state.js";
33
+ import { MoveToStatePanel as zn } from "./MoveToStatePanel.js";
34
+ import { SlaClockLine as Hn } from "./SlaClock.js";
35
+ const Ht = $n(
35
36
  () => import("./TransitionRequirementsDialog.js").then((t) => ({
36
37
  default: t.TransitionRequirementsDialog
37
38
  }))
38
39
  );
39
- function dt(t, e) {
40
+ function mt(t, e) {
40
41
  const r = t || "System";
41
42
  return e.on_behalf_of_name ? `${r}, for ${e.on_behalf_of_name}` : r;
42
43
  }
43
- function Qn(t) {
44
+ function Gn(t) {
44
45
  if (t.transition) return null;
45
46
  const e = (t.comment ?? "").trim();
46
47
  if (!e.startsWith("{")) return null;
@@ -54,20 +55,20 @@ function Qn(t) {
54
55
  }
55
56
  return null;
56
57
  }
57
- function Be(t) {
58
+ function je(t) {
58
59
  return !(t.first_name || t.last_name || t.user_email);
59
60
  }
60
- function nt(t) {
61
+ function st(t) {
61
62
  const e = (t.comment ?? "").trim().toLowerCase();
62
63
  return t.origin === "import" || e.startsWith("import:") ? "Imported" : t.origin === "integration" ? "By an integration" : /-state-sync$/.test(e) || e.startsWith("legacy-") ? "Synced from another system" : e === "state-merge" || e === "instance-migration" ? "Moved by an admin script" : "Moved automatically";
63
64
  }
64
- function rt(t) {
65
+ function it(t) {
65
66
  if (t.transition_text) return t.transition_text;
66
67
  if (t.transition_label) return `Rule: ${t.transition_label}`;
67
68
  const e = (t.comment ?? "").trim(), r = /^auto: (.+)$/i.exec(e);
68
69
  return r ? `Rule: ${r[1]}` : /-state-sync$/i.test(e) ? "The state was copied in from the system that owned this record" : /^instance-migration/i.test(e) ? "Moved when the pipeline was reshaped" : /^state-merge/i.test(e) ? "Moved when two states were merged" : null;
69
70
  }
70
- const _t = {
71
+ const Tt = {
71
72
  validation: "the partner refused what we sent",
72
73
  not_found: "the partner could not find what we referred to",
73
74
  auth: "the partner refused our credentials",
@@ -75,24 +76,24 @@ const _t = {
75
76
  rate_limited: "the partner asked us to slow down",
76
77
  unknown: "the partner refused it"
77
78
  };
78
- function Wn(t) {
79
- const e = Math.ceil((new Date(t).getTime() - Tn()) / 6e4);
79
+ function Vn(t) {
80
+ const e = Math.ceil((new Date(t).getTime() - Pn()) / 6e4);
80
81
  return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
81
82
  }
82
- function zn({ held: t }) {
83
+ function Xn({ held: t }) {
83
84
  return t.length === 0 ? null : /* @__PURE__ */ n(
84
85
  "div",
85
86
  {
86
87
  className: "space-y-2 border-b border-amber-100 bg-amber-50 px-5 py-3 dark:border-amber-500/20 dark:bg-amber-500/10",
87
88
  "data-pipeline-auto-held": !0,
88
89
  children: t.map((e) => {
89
- const r = e.transition_label ?? "An automatic move", a = _t[e.error_class ?? "unknown"] ?? _t.unknown;
90
+ const r = e.transition_label ?? "An automatic move", s = Tt[e.error_class ?? "unknown"] ?? Tt.unknown;
90
91
  return /* @__PURE__ */ i("div", { className: "text-[12px] text-amber-800 dark:text-amber-300", children: [
91
92
  /* @__PURE__ */ i("p", { className: "font-medium", children: [
92
93
  "Needs a person: ",
93
94
  r,
94
95
  " stopped retrying — ",
95
- a,
96
+ s,
96
97
  "."
97
98
  ] }),
98
99
  e.error && /* @__PURE__ */ n(
@@ -104,7 +105,7 @@ function zn({ held: t }) {
104
105
  }
105
106
  ),
106
107
  /* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
107
- e.retry_at ? `It tries the same push again ${Wn(e.retry_at)}. ` : "It will not send the same push again on its own. ",
108
+ e.retry_at ? `It tries the same push again ${Vn(e.retry_at)}. ` : "It will not send the same push again on its own. ",
108
109
  "Fix the record so what it sends changes, retry the push, or move the record by hand.",
109
110
  e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
110
111
  ] })
@@ -113,75 +114,75 @@ function zn({ held: t }) {
113
114
  }
114
115
  );
115
116
  }
116
- function Qt(t) {
117
+ function Gt(t) {
117
118
  var r;
118
119
  const e = t == null ? void 0 : t.response;
119
120
  return ((e == null ? void 0 : e.code) ?? ((r = e == null ? void 0 : e.data) == null ? void 0 : r.code)) === "TRANSITION_DUPLICATE";
120
121
  }
121
- function Wt(t) {
122
+ function Vt(t) {
122
123
  var r;
123
124
  const e = t;
124
125
  return (e == null ? void 0 : e.status) === 422 && ((r = e.response) == null ? void 0 : r.error) === "TRANSITION_REQUIREMENTS" ? e.response.requirements ?? [] : null;
125
126
  }
126
- function zt(t) {
127
- var a;
128
- const e = t == null ? void 0 : t.response, r = (e == null ? void 0 : e.code) ?? ((a = e == null ? void 0 : e.data) == null ? void 0 : a.code);
127
+ function Xt(t) {
128
+ var s;
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);
129
130
  return typeof r == "string" ? r : null;
130
131
  }
131
- function Ht(t) {
132
- if (zt(t) !== "RECORD_LOCKED") return null;
132
+ function Yt(t) {
133
+ if (Xt(t) !== "RECORD_LOCKED") return null;
133
134
  const e = t == null ? void 0 : t.response, r = e != null && e.data && typeof e.data == "object" ? e.data : e;
134
135
  if ((r == null ? void 0 : r.move_anyway) !== !0) return null;
135
- const a = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
136
- return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${a ?? "Someone else"} is editing this record right now.`, holder: a };
136
+ const s = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
137
+ return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${s ?? "Someone else"} is editing this record right now.`, holder: s };
137
138
  }
138
- const Hn = {
139
+ const Yn = {
139
140
  PRIORITY_REQUIRED: "priority",
140
141
  // A held record does not move forward (efp-ops hold-gate, army 11): taking
141
142
  // the hold off is one deliberate, noted step, then the move is tried again.
142
143
  ON_HOLD: "remove-hold"
143
144
  };
144
- function Gt(t, e) {
145
- const r = zt(t), a = r ? Hn[r] : void 0;
146
- return !r || !a ? null : { code: r, actionKey: a, transitionId: e.transition_id, comment: e.comment };
145
+ function Jt(t, e) {
146
+ const r = Xt(t), s = r ? Yn[r] : void 0;
147
+ return !r || !s ? null : { code: r, actionKey: s, transitionId: e.transition_id, comment: e.comment };
147
148
  }
148
- const Gn = 600;
149
- function Vt(t) {
150
- const e = Re(), [r, a] = K(!1), l = se(!0);
149
+ const Jn = 600;
150
+ function Zt(t) {
151
+ const e = De(), [r, s] = I(!1), l = ne(!0);
151
152
  fe(() => (l.current = !0, () => {
152
153
  l.current = !1;
153
154
  }), []);
154
- const c = se(t);
155
+ const c = ne(t);
155
156
  c.current = t;
156
- const u = At(async () => {
157
- a(!0);
157
+ const p = Lt(async () => {
158
+ s(!0);
158
159
  try {
159
160
  await e.refetchQueries({ queryKey: [...c.current], type: "active" });
160
161
  } catch {
161
162
  }
162
- await new Promise((h) => setTimeout(h, Gn)), l.current && a(!1);
163
+ await new Promise((b) => setTimeout(b, Jn)), l.current && s(!1);
163
164
  }, [e]);
164
- return { settling: r, settle: u };
165
+ return { settling: r, settle: p };
165
166
  }
166
- const Te = 1500, St = 4e3;
167
- class Vn {
167
+ const Me = 1500, qt = 4e3;
168
+ class Zn {
168
169
  constructor() {
169
- ze(this, "seen", null);
170
- ze(this, "fresh", /* @__PURE__ */ new Map());
170
+ Ve(this, "seen", null);
171
+ Ve(this, "fresh", /* @__PURE__ */ new Map());
171
172
  }
172
173
  /** Feed the ids on offer now. */
173
174
  observe(e, r) {
174
- const a = new Set(e.map((l) => String(l).toUpperCase()));
175
+ const s = new Set(e.map((l) => String(l).toUpperCase()));
175
176
  if (this.seen)
176
- for (const l of a)
177
+ for (const l of s)
177
178
  this.seen.has(l) || this.fresh.set(l, { at: r, hovered: !1, left: !1 });
178
- for (const l of [...this.fresh.keys()]) a.has(l) || this.fresh.delete(l);
179
- this.seen = a;
179
+ for (const l of [...this.fresh.keys()]) s.has(l) || this.fresh.delete(l);
180
+ this.seen = s;
180
181
  }
181
182
  /** The pointer is on the button. */
182
183
  enter(e, r) {
183
- const a = this.fresh.get(String(e).toUpperCase());
184
- a && !a.left && r - a.at < Te && (a.hovered = !0);
184
+ const s = this.fresh.get(String(e).toUpperCase());
185
+ s && !s.left && r - s.at < Me && (s.hovered = !0);
185
186
  }
186
187
  /** The pointer left the button. */
187
188
  leave(e) {
@@ -190,102 +191,102 @@ class Vn {
190
191
  }
191
192
  /** Still inert (no state change)? */
192
193
  inert(e, r) {
193
- const a = this.fresh.get(String(e).toUpperCase());
194
- return !a || r - a.at >= St ? !1 : r - a.at < Te || a.hovered && !a.left;
194
+ const s = this.fresh.get(String(e).toUpperCase());
195
+ return !s || r - s.at >= qt ? !1 : r - s.at < Me || s.hovered && !s.left;
195
196
  }
196
197
  /** A press: true = let it through. A press inside the window counts as the pointer being there. */
197
198
  press(e, r) {
198
- const a = String(e).toUpperCase(), l = this.fresh.get(a);
199
- return l ? r - l.at < Te ? (l.hovered = !0, l.left = !1, !1) : l.hovered && !l.left && r - l.at < St ? !1 : (this.fresh.delete(a), !0) : !0;
199
+ const s = String(e).toUpperCase(), l = this.fresh.get(s);
200
+ return l ? r - l.at < Me ? (l.hovered = !0, l.left = !1, !1) : l.hovered && !l.left && r - l.at < qt ? !1 : (this.fresh.delete(s), !0) : !0;
200
201
  }
201
202
  /** Inside its time window (drawn dimmed)? */
202
203
  timed(e, r) {
203
- const a = this.fresh.get(String(e).toUpperCase());
204
- return !!a && r - a.at < Te;
204
+ const s = this.fresh.get(String(e).toUpperCase());
205
+ return !!s && r - s.at < Me;
205
206
  }
206
207
  /** Any button still inside its time window? */
207
208
  hasTimed(e) {
208
- for (const r of this.fresh.values()) if (e - r.at < Te) return !0;
209
+ for (const r of this.fresh.values()) if (e - r.at < Me) return !0;
209
210
  return !1;
210
211
  }
211
212
  reset() {
212
213
  this.seen = null, this.fresh.clear();
213
214
  }
214
215
  }
215
- function Xt(t, e) {
216
- const r = se(null);
217
- r.current || (r.current = new Vn());
218
- const a = r.current, l = se(e);
219
- l.current !== e && (l.current = e, a.reset());
220
- const [, c] = K(0), u = t ? t.join(",") : null;
221
- return Le(() => {
222
- t && a.observe(t, Date.now());
223
- }, [a, u]), fe(() => {
224
- if (!a.hasTimed(Date.now())) return;
225
- const h = setTimeout(() => c((f) => f + 1), Te + 20);
226
- return () => clearTimeout(h);
227
- }, [a, u]), {
228
- dimmed: (h) => a.timed(h, Date.now()),
229
- press: (h) => a.press(h, Date.now()),
230
- bind: (h) => ({
231
- onPointerEnter: () => a.enter(h, Date.now()),
232
- onPointerMove: () => a.enter(h, Date.now()),
233
- onPointerLeave: () => a.leave(h)
216
+ function en(t, e) {
217
+ const r = ne(null);
218
+ r.current || (r.current = new Zn());
219
+ const s = r.current, l = ne(e);
220
+ l.current !== e && (l.current = e, s.reset());
221
+ const [, c] = I(0), p = t ? t.join(",") : null;
222
+ return Ie(() => {
223
+ t && s.observe(t, Date.now());
224
+ }, [s, p]), fe(() => {
225
+ if (!s.hasTimed(Date.now())) return;
226
+ const b = setTimeout(() => c((f) => f + 1), Me + 20);
227
+ return () => clearTimeout(b);
228
+ }, [s, p]), {
229
+ dimmed: (b) => s.timed(b, Date.now()),
230
+ press: (b) => s.press(b, Date.now()),
231
+ bind: (b) => ({
232
+ onPointerEnter: () => s.enter(b, Date.now()),
233
+ onPointerMove: () => s.enter(b, Date.now()),
234
+ onPointerLeave: () => s.leave(b)
234
235
  })
235
236
  };
236
237
  }
237
- function Yt(t, e) {
238
+ function tn(t, e) {
238
239
  return ["approval-brief", t, String(e)];
239
240
  }
240
- function Jt(t, e, r) {
241
+ function nn(t, e, r) {
241
242
  return t.request(
242
- ue(`/pipelines/instance/${e}/${r}/approval-brief`)
243
- ).then((a) => a.data);
243
+ ce(`/pipelines/instance/${e}/${r}/approval-brief`)
244
+ ).then((s) => s.data);
244
245
  }
245
- function Xn(t) {
246
+ function er(t) {
246
247
  return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
247
248
  }
248
- function Ct(t) {
249
+ function Mt(t) {
249
250
  return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
250
251
  }
251
- function Yn(t) {
252
+ function tr(t) {
252
253
  const e = Math.max(0, Math.floor(Number(t) || 0));
253
254
  return e === 0 ? "today" : e === 1 ? "1 day ago" : `${e} days ago`;
254
255
  }
255
- function Jn(t, e, r = 40) {
256
- const a = (N) => N == null || N === "" ? "" : String(N), l = a(t), c = a(e), u = (N) => N === "" ? "(empty)" : N;
257
- if (t === void 0) return { old: null, new: Ge(u(c), 0, r) };
258
- if (l.length <= r && c.length <= r) return { old: u(l), new: u(c) };
259
- let h = 0;
260
- for (; h < l.length && h < c.length && l[h] === c[h]; ) h++;
261
- const f = h > r / 2 ? h - Math.floor(r / 3) : 0;
262
- return { old: Ge(u(l), f, r), new: Ge(u(c), f, r) };
256
+ function nr(t, e, r = 40) {
257
+ const s = (_) => _ == null || _ === "" ? "" : String(_), l = s(t), c = s(e), p = (_) => _ === "" ? "(empty)" : _;
258
+ if (t === void 0) return { old: null, new: Ye(p(c), 0, r) };
259
+ if (l.length <= r && c.length <= r) return { old: p(l), new: p(c) };
260
+ let b = 0;
261
+ for (; b < l.length && b < c.length && l[b] === c[b]; ) b++;
262
+ const f = b > r / 2 ? b - Math.floor(r / 3) : 0;
263
+ return { old: Ye(p(l), f, r), new: Ye(p(c), f, r) };
263
264
  }
264
- function Ge(t, e, r) {
265
- const a = Math.min(e, Math.max(0, t.length - r)), l = t.slice(a, a + r);
266
- return `${a > 0 ? "…" : ""}${l}${a + r < t.length ? "…" : ""}`;
265
+ function Ye(t, e, r) {
266
+ const s = Math.min(e, Math.max(0, t.length - r)), l = t.slice(s, s + r);
267
+ return `${s > 0 ? "…" : ""}${l}${s + r < t.length ? "…" : ""}`;
267
268
  }
268
- const Zn = 4e3;
269
- function Zt(t, e) {
270
- const r = ge(), a = Re();
271
- return At(async () => {
269
+ const rr = 4e3;
270
+ function rn(t, e) {
271
+ const r = we(), s = De();
272
+ return Lt(async () => {
272
273
  try {
273
274
  const l = await Promise.race([
274
- a.fetchQuery({
275
- queryKey: Yt(t, e),
276
- queryFn: () => Jt(r, t, e),
275
+ s.fetchQuery({
276
+ queryKey: tn(t, e),
277
+ queryFn: () => nn(r, t, e),
277
278
  staleTime: 0,
278
279
  retry: !1
279
280
  }),
280
- new Promise((c) => setTimeout(() => c(null), Zn))
281
+ new Promise((c) => setTimeout(() => c(null), rr))
281
282
  ]);
282
- return Xn(l == null ? void 0 : l.lines);
283
+ return er(l == null ? void 0 : l.lines);
283
284
  } catch {
284
285
  return [];
285
286
  }
286
- }, [r, a, t, e]);
287
+ }, [r, s, t, e]);
287
288
  }
288
- function en({ lines: t }) {
289
+ function an({ lines: t }) {
289
290
  return t.length === 0 ? null : /* @__PURE__ */ i(
290
291
  "div",
291
292
  {
@@ -301,22 +302,22 @@ function en({ lines: t }) {
301
302
  }
302
303
  );
303
304
  }
304
- function Fe(t, e, r) {
305
+ function Oe(t, e, r) {
305
306
  if (!r) return !1;
306
- const a = e.find(
307
+ const s = e.find(
307
308
  (c) => String(c.id).toUpperCase() === String(r).toUpperCase()
308
309
  ), l = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
309
- return !!a && !!l && l.sort < a.sort;
310
+ return !!s && !!l && l.sort < s.sort;
310
311
  }
311
- function tn(t, e, r) {
312
+ function sn(t, e, r) {
312
313
  var l;
313
314
  if (!t) return !1;
314
315
  if ((((l = t.order_partners) == null ? void 0 : l.length) ?? 0) > 0) return !0;
315
- if (Fe(t, e, r)) return !1;
316
- const a = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
317
- return !!(a != null && a.is_terminal) && !/(^|_)cancel/i.test(String(a.key ?? ""));
316
+ if (Oe(t, e, r)) return !1;
317
+ const s = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
318
+ return !!(s != null && s.is_terminal) && !/(^|_)cancel/i.test(String(s.key ?? ""));
318
319
  }
319
- const $t = {
320
+ const Rt = {
320
321
  red: "border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
321
322
  amber: "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300",
322
323
  yellow: "border-yellow-200 bg-yellow-50 text-yellow-800 dark:border-yellow-500/30 dark:bg-yellow-500/10 dark:text-yellow-300",
@@ -324,14 +325,14 @@ const $t = {
324
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",
325
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"
326
327
  };
327
- function nn({ flags: t }) {
328
- return !t || t.length === 0 ? null : /* @__PURE__ */ n(he, { children: t.map((e) => /* @__PURE__ */ i(
328
+ function ln({ flags: t }) {
329
+ return !t || t.length === 0 ? null : /* @__PURE__ */ n(xe, { children: t.map((e) => /* @__PURE__ */ i(
329
330
  "span",
330
331
  {
331
332
  "data-record-flag": e.name,
332
- className: be(
333
+ className: ye(
333
334
  "inline-flex shrink-0 items-center gap-1 self-center rounded-full border px-2 py-0.5 text-[11px] font-semibold",
334
- $t[e.color] ?? $t.amber
335
+ Rt[e.color] ?? Rt.amber
335
336
  ),
336
337
  children: [
337
338
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-current", "aria-hidden": !0 }),
@@ -341,18 +342,18 @@ function nn({ flags: t }) {
341
342
  e.name
342
343
  )) });
343
344
  }
344
- function Tt(t) {
345
+ function Pt(t) {
345
346
  return t.replace(/\s+IIP$/i, "");
346
347
  }
347
- function rn({
348
+ function on({
348
349
  collection: t,
349
350
  item: e,
350
351
  tx: r
351
352
  }) {
352
- const a = ge(), l = (r == null ? void 0 : r.order_partners) ?? [], { data: c } = oe({
353
+ const s = we(), l = (r == null ? void 0 : r.order_partners) ?? [], { data: c } = oe({
353
354
  queryKey: ["push-preflight", t, e, "t", (r == null ? void 0 : r.id) ?? ""],
354
- queryFn: () => a.request(
355
- ue(`/integration-preview/${t}/${encodeURIComponent(e)}/preflight`, {
355
+ queryFn: () => s.request(
356
+ ce(`/integration-preview/${t}/${encodeURIComponent(e)}/preflight`, {
356
357
  transition_id: (r == null ? void 0 : r.id) ?? ""
357
358
  })
358
359
  ).then((f) => f.data),
@@ -360,76 +361,76 @@ function rn({
360
361
  staleTime: 2e4
361
362
  });
362
363
  if (l.length === 0) return null;
363
- const u = c != null && c.pushes ? c.pushes.filter((f) => f.status === "would_push" && l.includes(f.api_name)).map((f) => Tt(f.api_name)) : null, h = [...new Set(u ?? l.map(Tt))];
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))];
364
365
  return /* @__PURE__ */ i(
365
366
  "p",
366
367
  {
367
368
  "data-order-send-note": !0,
368
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",
369
370
  children: [
370
- /* @__PURE__ */ n(Mt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
371
- u && u.length === 0 ? "Nothing is sent to a partner for this record — it only moves the record on." : `This places an order with ${h.join(" or ")}. It cannot be called back from here.`
371
+ /* @__PURE__ */ n(Ft, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
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.`
372
373
  ]
373
374
  }
374
375
  );
375
376
  }
376
- function an(t) {
377
+ function dn(t) {
377
378
  return t != null && t.instance ? (t.available_transitions ?? []).some(
378
379
  (e) => {
379
380
  var r;
380
- return Fe(e, t.states ?? [], (r = t.instance) == null ? void 0 : r.current_state);
381
+ return Oe(e, t.states ?? [], (r = t.instance) == null ? void 0 : r.current_state);
381
382
  }
382
383
  ) : !1;
383
384
  }
384
- function sn(t, e, r, a) {
385
- if (!a || a.size === 0) return t;
386
- const l = new Set([...a.keys()].map((c) => String(c).toUpperCase()));
385
+ function cn(t, e, r, s) {
386
+ if (!s || s.size === 0) return t;
387
+ const l = new Set([...s.keys()].map((c) => String(c).toUpperCase()));
387
388
  return t.filter(
388
- (c) => !(!c.to_previous && l.has(String(c.to_state).toUpperCase()) && Fe(c, e, r))
389
+ (c) => !(!c.to_previous && l.has(String(c.to_state).toUpperCase()) && Oe(c, e, r))
389
390
  );
390
391
  }
391
- function ln(t, e, r) {
392
- var f, N, v, x, q, A;
393
- const a = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
394
- (U) => U.id === e
395
- ), l = r == null ? void 0 : r.data, c = ((f = l == null ? void 0 : l.new_state) == null ? void 0 : f.id) ?? ((N = l == null ? void 0 : l.instance) == null ? void 0 : N.current_state) ?? null, u = ((v = l == null ? void 0 : l.new_state) == null ? void 0 : v.label) ?? (a ? (q = (x = t == null ? void 0 : t.states) == null ? void 0 : x.find((U) => U.id === a.to_state)) == null ? void 0 : q.label : void 0) ?? null, h = ((A = t == null ? void 0 : t.instance) == null ? void 0 : A.current_state) ?? null;
396
- return h && c && String(h) === String(c) ? "Nothing moved" : a != null && a.label && u ? `${a.label} — now ${u}` : u ? `Moved to ${u}` : a != null && a.label ? `${a.label} done` : "Transition executed";
392
+ function un(t, e, r) {
393
+ var f, _, v, y, $, A;
394
+ const s = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
395
+ (E) => E.id === e
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;
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";
397
398
  }
398
- const er = 1200;
399
- function on(t) {
399
+ const ar = 1200;
400
+ function mn(t) {
400
401
  const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
401
402
  let r = !1;
402
- const a = setTimeout(() => {
403
- r = !0, J.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
404
- }, er);
403
+ const s = setTimeout(() => {
404
+ r = !0, Y.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
405
+ }, ar);
405
406
  return {
406
407
  /** Options for the result toast: replaces the loading one when shown. */
407
- done: () => (clearTimeout(a), r ? { id: e, duration: 7e3 } : {}),
408
+ done: () => (clearTimeout(s), r ? { id: e, duration: 7e3 } : {}),
408
409
  /** An error toast of its own follows — drop the loading one. */
409
410
  fail: () => {
410
- clearTimeout(a), r && J.dismiss(e);
411
+ clearTimeout(s), r && Y.dismiss(e);
411
412
  }
412
413
  };
413
414
  }
414
- function dn(t, e, r) {
415
- for (const a of [
415
+ function pn(t, e, r) {
416
+ for (const s of [
416
417
  "pipeline-owners-resolved",
417
418
  "pipeline-instance-owners",
418
419
  "pipeline-all-owners"
419
420
  ])
420
- t.invalidateQueries({ queryKey: [a, e, r] });
421
+ t.invalidateQueries({ queryKey: [s, e, r] });
421
422
  }
422
- function tr(t, e, r) {
423
- var h;
423
+ function sr(t, e, r) {
424
+ var b;
424
425
  if (!e) return null;
425
- const a = new Map(r.map((f) => [String(f.id).toUpperCase(), f.sort])), l = [...t].sort(
426
- (f, N) => new Date(N.timestamp).getTime() - new Date(f.timestamp).getTime()
426
+ const s = new Map(r.map((f) => [String(f.id).toUpperCase(), f.sort])), l = [...t].sort(
427
+ (f, _) => new Date(_.timestamp).getTime() - new Date(f.timestamp).getTime()
427
428
  )[0];
428
- if (!(l != null && l.from_state) || String(l.to_state).toUpperCase() !== String(e).toUpperCase() || !((h = l.comment) != null && h.trim()) || l.origin && l.origin !== "person") return null;
429
- const c = a.get(String(l.from_state).toUpperCase()), u = a.get(String(l.to_state).toUpperCase());
430
- return c == null || u == null || u >= c ? null : l;
429
+ if (!(l != null && l.from_state) || String(l.to_state).toUpperCase() !== String(e).toUpperCase() || !((b = l.comment) != null && b.trim()) || l.origin && l.origin !== "person") return null;
430
+ const c = s.get(String(l.from_state).toUpperCase()), p = s.get(String(l.to_state).toUpperCase());
431
+ return c == null || p == null || p >= c ? null : l;
431
432
  }
432
- function nr({ entry: t }) {
433
+ function ir({ entry: t }) {
433
434
  const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
434
435
  return /* @__PURE__ */ i(
435
436
  "div",
@@ -438,7 +439,7 @@ function nr({ entry: t }) {
438
439
  "data-send-back-notice": !0,
439
440
  children: [
440
441
  /* @__PURE__ */ n(
441
- yn,
442
+ Nn,
442
443
  {
443
444
  "aria-hidden": !0,
444
445
  className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
@@ -448,65 +449,65 @@ function nr({ entry: t }) {
448
449
  /* @__PURE__ */ n("p", { className: "whitespace-pre-line break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: t.comment }),
449
450
  /* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
450
451
  "Sent back by ",
451
- dt(e, t),
452
+ mt(e, t),
452
453
  " · ",
453
- st(t.timestamp)
454
+ ot(t.timestamp)
454
455
  ] })
455
456
  ] })
456
457
  ]
457
458
  }
458
459
  );
459
460
  }
460
- function cn({
461
+ function fn({
461
462
  collection: t,
462
463
  item: e,
463
464
  offer: r,
464
- onFixed: a,
465
+ onFixed: s,
465
466
  onDismiss: l,
466
467
  className: c,
467
- style: u
468
+ style: p
468
469
  }) {
469
- const h = ge(), f = Re(), [N, v] = K(""), { data: x, isLoading: q } = oe({
470
+ const b = we(), f = De(), [_, v] = I(""), { data: y, isLoading: $ } = oe({
470
471
  queryKey: ["bulk-actions-available-one", t, r.actionKey],
471
- queryFn: async () => ((await h.request(ue("/bulk-actions/available", { collection: t }))).data ?? []).find((j) => j.key === r.actionKey) ?? null,
472
+ queryFn: async () => ((await b.request(ce("/bulk-actions/available", { collection: t }))).data ?? []).find((H) => H.key === r.actionKey) ?? null,
472
473
  staleTime: 6e4
473
- }), A = Me({
474
+ }), A = Pe({
474
475
  mutationFn: async () => {
475
- var M, L;
476
- const E = { collection: t, ids: [e], reason: N.trim() || null }, B = ((x == null ? void 0 : x.source) === "extension" ? await h.request(Ce(`/bulk-actions/${r.actionKey}/execute`, E)) : await h.request(Ce("/bulk-actions/run", { ...E, key: r.actionKey }))).data ?? {};
477
- if ((x == null ? void 0 : x.source) !== "extension" && !(B.succeeded && B.succeeded > 0))
476
+ var T, P;
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 ?? {};
478
+ if ((y == null ? void 0 : y.source) !== "extension" && !(K.succeeded && K.succeeded > 0))
478
479
  throw new Error(
479
- ((L = (M = B.errors) == null ? void 0 : M[0]) == null ? void 0 : L.error) || `${(x == null ? void 0 : x.label) ?? "The fix"} did not change the record`
480
+ ((P = (T = K.errors) == null ? void 0 : T[0]) == null ? void 0 : P.error) || `${(y == null ? void 0 : y.label) ?? "The fix"} did not change the record`
480
481
  );
481
482
  },
482
483
  onSuccess: () => {
483
- De(f, t, e), J.success(`${(x == null ? void 0 : x.label) ?? "Done"} — trying again`), a();
484
+ Ae(f, t, e), Y.success(`${(y == null ? void 0 : y.label) ?? "Done"} — trying again`), s();
484
485
  },
485
- onError: (E) => Sn(E, `${(x == null ? void 0 : x.label) ?? "The fix"} failed`)
486
+ onError: (B) => qn(B, `${(y == null ? void 0 : y.label) ?? "The fix"} failed`)
486
487
  });
487
- if (q || !x) return null;
488
- const U = !A.isPending && (!x.require_reason || N.trim().length > 0);
488
+ if ($ || !y) return null;
489
+ const E = !A.isPending && (!y.require_reason || _.trim().length > 0);
489
490
  return /* @__PURE__ */ i(
490
491
  "div",
491
492
  {
492
- className: be(
493
+ className: ye(
493
494
  "space-y-2 rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-500/30 dark:bg-amber-950",
494
495
  c
495
496
  ),
496
- style: u,
497
+ style: p,
497
498
  "data-refusal-fix": r.code,
498
499
  children: [
499
500
  /* @__PURE__ */ i("p", { className: "text-[12px] text-amber-950 dark:text-amber-100", children: [
500
501
  "You can fix this here: ",
501
- x.label,
502
+ y.label,
502
503
  ", then the move is tried again."
503
504
  ] }),
504
- x.require_reason && /* @__PURE__ */ n(
505
+ y.require_reason && /* @__PURE__ */ n(
505
506
  "input",
506
507
  {
507
508
  type: "text",
508
- value: N,
509
- onChange: (E) => v(E.target.value),
509
+ value: _,
510
+ onChange: (B) => v(B.target.value),
510
511
  placeholder: "Reason (required)",
511
512
  "aria-label": "Reason",
512
513
  className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30 dark:border-border dark:bg-card"
@@ -530,11 +531,11 @@ function cn({
530
531
  type: "button",
531
532
  size: "sm",
532
533
  className: "h-7 gap-1.5 text-[12px]",
533
- disabled: !U,
534
+ disabled: !E,
534
535
  onClick: () => A.mutate(),
535
536
  children: [
536
537
  A.isPending && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
537
- x.label,
538
+ y.label,
538
539
  ", then try again"
539
540
  ]
540
541
  }
@@ -544,7 +545,7 @@ function cn({
544
545
  }
545
546
  );
546
547
  }
547
- function ve({
548
+ function Ne({
548
549
  label: t,
549
550
  color: e,
550
551
  small: r
@@ -563,187 +564,187 @@ function ve({
563
564
  t
564
565
  );
565
566
  }
566
- function Ve(t) {
567
+ function Je(t) {
567
568
  const e = Math.floor(t / 6e4);
568
- return e < 60 ? `${Math.max(1, e)}m` : Pn(t / 36e5);
569
+ return e < 60 ? `${Math.max(1, e)}m` : On(t / 36e5);
569
570
  }
570
- function rr({
571
+ function lr({
571
572
  history: t,
572
573
  completedAt: e
573
574
  }) {
574
575
  const r = [...t].sort(
575
- (u, h) => new Date(u.timestamp).getTime() - new Date(h.timestamp).getTime()
576
+ (p, b) => new Date(p.timestamp).getTime() - new Date(b.timestamp).getTime()
576
577
  );
577
578
  if (r.length === 0) return null;
578
- const a = e ? new Date(e).getTime() : Date.now(), l = r.map((u, h) => {
579
- const f = new Date(u.timestamp).getTime(), N = h + 1 < r.length ? new Date(r[h + 1].timestamp).getTime() : a;
579
+ const s = e ? new Date(e).getTime() : Date.now(), l = r.map((p, b) => {
580
+ const f = new Date(p.timestamp).getTime(), _ = b + 1 < r.length ? new Date(r[b + 1].timestamp).getTime() : s;
580
581
  return {
581
- key: u.id,
582
- label: u.to_state_label,
583
- color: u.to_state_color,
584
- ms: Math.max(0, N - f),
585
- current: h === r.length - 1 && !e
582
+ key: p.id,
583
+ label: p.to_state_label,
584
+ color: p.to_state_color,
585
+ ms: Math.max(0, _ - f),
586
+ current: b === r.length - 1 && !e
586
587
  };
587
- }).filter((u) => u.ms > 0 || u.current);
588
+ }).filter((p) => p.ms > 0 || p.current);
588
589
  if (l.length < 2) return null;
589
- const c = l.reduce((u, h) => u + h.ms, 0);
590
+ const c = l.reduce((p, b) => p + b.ms, 0);
590
591
  return c <= 0 ? null : /* @__PURE__ */ i("div", { "data-state-timeline": !0, children: [
591
592
  /* @__PURE__ */ i("div", { className: "mb-1 flex items-center justify-between", children: [
592
593
  /* @__PURE__ */ n("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Time in step" }),
593
594
  /* @__PURE__ */ i("p", { className: "text-[10px] tabular-nums text-slate-400 dark:text-slate-500", children: [
594
- Ve(c),
595
+ Je(c),
595
596
  " total",
596
597
  e ? "" : " · so far"
597
598
  ] })
598
599
  ] }),
599
- /* @__PURE__ */ n("div", { className: "flex h-4 w-full overflow-hidden rounded", children: l.map((u) => {
600
- const h = u.ms / c * 100;
600
+ /* @__PURE__ */ n("div", { className: "flex h-4 w-full overflow-hidden rounded", children: l.map((p) => {
601
+ const b = p.ms / c * 100;
601
602
  return /* @__PURE__ */ i(
602
603
  "div",
603
604
  {
604
- "data-tip": `${u.label} — ${Ve(u.ms)}${u.current ? " (current)" : ""}`,
605
+ "data-tip": `${p.label} — ${Je(p.ms)}${p.current ? " (current)" : ""}`,
605
606
  className: "relative flex min-w-[8px] items-center overflow-hidden border-r border-white/60 last:border-r-0 dark:border-black/30",
606
607
  style: {
607
- width: `${h}%`,
608
- backgroundColor: u.color ? `${u.color}55` : "rgba(100,116,139,.25)"
608
+ width: `${b}%`,
609
+ backgroundColor: p.color ? `${p.color}55` : "rgba(100,116,139,.25)"
609
610
  },
610
611
  children: [
611
- h >= 14 && /* @__PURE__ */ i("span", { className: "truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
612
- u.label,
612
+ b >= 14 && /* @__PURE__ */ i("span", { className: "truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
613
+ p.label,
613
614
  " · ",
614
- Ve(u.ms)
615
+ Je(p.ms)
615
616
  ] }),
616
- u.current && /* @__PURE__ */ n(
617
+ p.current && /* @__PURE__ */ n(
617
618
  "span",
618
619
  {
619
620
  className: "absolute inset-y-0 right-0 w-[2px]",
620
- style: { backgroundColor: u.color ?? "#64748b" }
621
+ style: { backgroundColor: p.color ?? "#64748b" }
621
622
  }
622
623
  )
623
624
  ]
624
625
  },
625
- u.key
626
+ p.key
626
627
  );
627
628
  }) })
628
629
  ] });
629
630
  }
630
- function ar({
631
+ function or({
631
632
  states: t,
632
633
  allTransitions: e,
633
634
  availableTransitions: r,
634
- currentStateId: a,
635
+ currentStateId: s,
635
636
  history: l,
636
637
  onPathIds: c,
637
- skippedStates: u
638
+ skippedStates: p
638
639
  }) {
639
- var I;
640
- const h = se(null);
640
+ var L;
641
+ const b = ne(null);
641
642
  fe(() => {
642
- const m = h.current;
643
- if (!m || m.scrollWidth <= m.clientWidth) return;
644
- const g = m.querySelector("[data-track-current]");
645
- if (!g) return;
646
- const k = m.getBoundingClientRect(), R = g.getBoundingClientRect();
647
- m.scrollLeft += R.left + R.width / 2 - (k.left + k.width / 2);
648
- }, [a]);
649
- const f = new Set(l.map((m) => m.to_state)), N = t.find((m) => m.is_initial);
650
- N && N.id !== a && f.add(N.id);
651
- const v = (I = l[0]) == null ? void 0 : I.from_state;
652
- v && v !== a && f.add(v);
653
- const x = (() => {
643
+ const h = b.current;
644
+ if (!h || h.scrollWidth <= h.clientWidth) return;
645
+ const x = h.querySelector("[data-track-current]");
646
+ if (!x) return;
647
+ const w = h.getBoundingClientRect(), q = x.getBoundingClientRect();
648
+ h.scrollLeft += q.left + q.width / 2 - (w.left + w.width / 2);
649
+ }, [s]);
650
+ const f = new Set(l.map((h) => h.to_state)), _ = t.find((h) => h.is_initial);
651
+ _ && _.id !== s && f.add(_.id);
652
+ const v = (L = l[0]) == null ? void 0 : L.from_state;
653
+ v && v !== s && f.add(v);
654
+ const y = (() => {
654
655
  if (c)
655
- return t.filter((y) => c.has(y.id) || f.has(y.id) || y.id === a).filter((y) => {
656
- const _ = y.stage_visibility ?? "always";
657
- return _ === "hide" ? !1 : _ === "hide_unless_active" ? f.has(y.id) || y.id === a : !0;
658
- }).sort((y, _) => y.sort - _.sort);
656
+ return t.filter((g) => c.has(g.id) || f.has(g.id) || g.id === s).filter((g) => {
657
+ const k = g.stage_visibility ?? "always";
658
+ return k === "hide" ? !1 : k === "hide_unless_active" ? f.has(g.id) || g.id === s : !0;
659
+ }).sort((g, k) => g.sort - k.sort);
659
660
  if (e.length === 0) {
660
- const y = /* @__PURE__ */ new Set([...f]);
661
- return a && y.add(a), t.filter((_) => y.has(_.id)).sort((_, H) => _.sort - H.sort);
661
+ const g = /* @__PURE__ */ new Set([...f]);
662
+ return s && g.add(s), t.filter((k) => g.has(k.id)).sort((k, G) => k.sort - G.sort);
662
663
  }
663
- const m = new Set(
664
- l.filter((y) => y.from_state).map((y) => `${y.from_state}:${y.to_state}`)
665
- ), g = new Set(l.map((y) => y.from_state).filter(Boolean)), k = e.filter((y) => y.from_state !== null), R = /* @__PURE__ */ new Map();
666
- for (const y of k) {
667
- const _ = y.from_state;
668
- if (g.has(_) && !m.has(`${_}:${y.to_state}`)) continue;
669
- const H = R.get(_) ?? [];
670
- H.push(y.to_state), R.set(_, H);
664
+ const h = new Set(
665
+ l.filter((g) => g.from_state).map((g) => `${g.from_state}:${g.to_state}`)
666
+ ), x = new Set(l.map((g) => g.from_state).filter(Boolean)), w = e.filter((g) => g.from_state !== null), q = /* @__PURE__ */ new Map();
667
+ for (const g of w) {
668
+ const k = g.from_state;
669
+ if (x.has(k) && !h.has(`${k}:${g.to_state}`)) continue;
670
+ const G = q.get(k) ?? [];
671
+ G.push(g.to_state), q.set(k, G);
671
672
  }
672
- if (a) {
673
- const y = k.filter((_) => _.from_state === a).map((_) => _.to_state);
674
- R.set(a, [
675
- .../* @__PURE__ */ new Set([...r.map((_) => _.to_state), ...y])
673
+ if (s) {
674
+ const g = w.filter((k) => k.from_state === s).map((k) => k.to_state);
675
+ q.set(s, [
676
+ .../* @__PURE__ */ new Set([...r.map((k) => k.to_state), ...g])
676
677
  ]);
677
678
  }
678
- const d = /* @__PURE__ */ new Set(), Q = t.filter((y) => y.is_initial).map((y) => y.id);
679
+ const o = /* @__PURE__ */ new Set(), Q = t.filter((g) => g.is_initial).map((g) => g.id);
679
680
  for (; Q.length; ) {
680
- const y = Q.shift();
681
- if (!d.has(y)) {
682
- d.add(y);
683
- for (const _ of R.get(y) ?? []) d.has(_) || Q.push(_);
681
+ const g = Q.shift();
682
+ if (!o.has(g)) {
683
+ o.add(g);
684
+ for (const k of q.get(g) ?? []) o.has(k) || Q.push(k);
684
685
  }
685
686
  }
686
- const Z = /* @__PURE__ */ new Set([...d, ...f]);
687
- return a && Z.add(a), t.filter((y) => Z.has(y.id)).filter((y) => {
688
- const _ = y.stage_visibility ?? "always";
689
- return _ === "hide" ? !1 : _ === "hide_unless_active" ? f.has(y.id) || y.id === a : !0;
690
- }).sort((y, _) => y.sort - _.sort);
687
+ const X = /* @__PURE__ */ new Set([...o, ...f]);
688
+ return s && X.add(s), t.filter((g) => X.has(g.id)).filter((g) => {
689
+ const k = g.stage_visibility ?? "always";
690
+ return k === "hide" ? !1 : k === "hide_unless_active" ? f.has(g.id) || g.id === s : !0;
691
+ }).sort((g, k) => g.sort - k.sort);
691
692
  })();
692
- if (x.length < 2) return null;
693
- const q = x.findIndex((m) => m.id === a), A = new Map(x.map((m, g) => [m.id, g])), U = new Map(t.map((m) => [m.id, m.label]));
694
- function E(m, g) {
695
- const k = A.get(m);
696
- return k == null ? [] : [...l].filter((R) => {
697
- if (!R.from_state) return !1;
698
- const d = A.get(R.from_state), Q = A.get(R.to_state);
699
- return d == null || Q == null ? !1 : d === k && Q > k || Q < d && d - 1 === k;
700
- }).sort((R, d) => new Date(R.timestamp).getTime() - new Date(d.timestamp).getTime());
693
+ if (y.length < 2) return null;
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]));
695
+ function B(h, x) {
696
+ const w = A.get(h);
697
+ return w == null ? [] : [...l].filter((q) => {
698
+ if (!q.from_state) return !1;
699
+ const o = A.get(q.from_state), Q = A.get(q.to_state);
700
+ return o == null || Q == null ? !1 : o === w && Q > w || Q < o && o - 1 === w;
701
+ }).sort((q, o) => new Date(q.timestamp).getTime() - new Date(o.timestamp).getTime());
701
702
  }
702
- function j(m) {
703
- var g, k, R, d;
704
- return Be(m) ? /* @__PURE__ */ n(Dt, { className: "inline h-2.5 w-2.5", "aria-label": nt(m) }) : ((((g = m.first_name) == null ? void 0 : g[0]) ?? "") + (((k = m.last_name) == null ? void 0 : k[0]) ?? "")).toUpperCase() || ((d = (R = m.user_email) == null ? void 0 : R[0]) == null ? void 0 : d.toUpperCase()) || "?";
703
+ function H(h) {
704
+ var x, w, q, o;
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()) || "?";
705
706
  }
706
- function B(m) {
707
- return dt([m.first_name, m.last_name].filter(Boolean).join(" ") || m.user_email, m);
707
+ function K(h) {
708
+ return mt([h.first_name, h.last_name].filter(Boolean).join(" ") || h.user_email, h);
708
709
  }
709
- const M = /* @__PURE__ */ new Map();
710
- for (const m of [...l].sort(
711
- (g, k) => new Date(g.timestamp).getTime() - new Date(k.timestamp).getTime()
710
+ const T = /* @__PURE__ */ new Map();
711
+ for (const h of [...l].sort(
712
+ (x, w) => new Date(x.timestamp).getTime() - new Date(w.timestamp).getTime()
712
713
  )) {
713
- if (!m.from_state) continue;
714
- const g = A.get(m.from_state), k = A.get(m.to_state);
715
- if (!(g == null || k == null || k <= g + 1))
716
- for (let R = g + 1; R < k; R++) {
717
- const d = x[R].id;
718
- !f.has(d) && !M.has(d) && M.set(d, m);
714
+ if (!h.from_state) continue;
715
+ const x = A.get(h.from_state), w = A.get(h.to_state);
716
+ if (!(x == null || w == null || w <= x + 1))
717
+ for (let q = x + 1; q < w; q++) {
718
+ const o = y[q].id;
719
+ !f.has(o) && !T.has(o) && T.set(o, h);
719
720
  }
720
721
  }
721
- function L(m) {
722
- const g = U.get(m.from_state ?? "") ?? "the previous step", k = U.get(m.to_state) ?? "the next step", R = Be(m) ? "it moved automatically" : `${B(m)} moved it`;
723
- return `Passed over on ${wt(m.timestamp)} — ${R} straight from ${g} to ${k}`;
722
+ function P(h) {
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`;
724
+ return `Passed over on ${_t(h.timestamp)} — ${q} straight from ${x} to ${w}`;
724
725
  }
725
- return /* @__PURE__ */ n(Et, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: h, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: x.map((m, g) => {
726
- const k = m.id === a, R = f.has(m.id), d = R && !k && (q < 0 || g < q), Q = R && !k && !d, Z = !R && !k ? M.get(m.id) : void 0, y = !R && !k ? u == null ? void 0 : u.get(m.id) : void 0, _ = Z || y ? [...Z ? [L(Z)] : [], ...y ?? []] : void 0, H = _ !== void 0, W = m.color ?? "#94a3b8", G = g === x.length - 1, ee = G ? null : x[g + 1], V = ee ? E(m.id, ee.id) : [];
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) => {
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) : [];
727
728
  return /* @__PURE__ */ i("div", { className: "flex flex-1 items-start", children: [
728
729
  /* @__PURE__ */ i("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
729
730
  /* @__PURE__ */ n(
730
731
  "div",
731
732
  {
732
- "data-track-current": k || void 0,
733
- className: `flex h-7 w-7 shrink-0 items-center justify-center rounded-full ${k || d ? "nvr-fill-sweep" : ""}`,
734
- "data-tip": Q ? `Passed before the record was sent back — it needs this step again.${m.description ? ` ${m.description}` : ""}` : m.description || void 0,
733
+ "data-track-current": w || void 0,
734
+ className: `flex h-7 w-7 shrink-0 items-center justify-center rounded-full ${w || o ? "nvr-fill-sweep" : ""}`,
735
+ "data-tip": Q ? `Passed before the record was sent back — it needs this step again.${h.description ? ` ${h.description}` : ""}` : h.description || void 0,
735
736
  "data-track-again": Q || void 0,
736
737
  style: {
737
- backgroundColor: k || d ? W : H ? "transparent" : "#f1f5f9",
738
- border: k || d ? "none" : H ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
739
- boxShadow: k ? `0 0 0 3px white, 0 0 0 5px ${W}` : void 0
738
+ backgroundColor: w || o ? se : G ? "transparent" : "#f1f5f9",
739
+ border: w || o ? "none" : G ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
740
+ boxShadow: w ? `0 0 0 3px white, 0 0 0 5px ${se}` : void 0
740
741
  },
741
- children: d ? /* @__PURE__ */ n(Ie, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : k ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : H ? /* @__PURE__ */ n(wn, { 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(_n, { 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
743
  },
743
- k ? "cur" : d ? "done" : H ? "skip" : "todo"
744
+ w ? "cur" : o ? "done" : G ? "skip" : "todo"
744
745
  ),
745
- H ? /* @__PURE__ */ i(Ze, { children: [
746
- /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ n(
746
+ G ? /* @__PURE__ */ i(nt, { children: [
747
+ /* @__PURE__ */ n(rt, { asChild: !0, children: /* @__PURE__ */ n(
747
748
  "span",
748
749
  {
749
750
  className: "w-full cursor-help break-words text-center leading-snug",
@@ -755,39 +756,39 @@ function ar({
755
756
  textDecoration: "line-through",
756
757
  textDecorationColor: "#cbd5e1"
757
758
  },
758
- children: m.label
759
+ children: h.label
759
760
  }
760
761
  ) }),
761
- /* @__PURE__ */ i(tt, { className: "max-w-[260px]", children: [
762
+ /* @__PURE__ */ i(at, { className: "max-w-[260px]", children: [
762
763
  /* @__PURE__ */ n("p", { className: "text-[11px] font-medium", children: "Skipped for this record" }),
763
- _.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: _.map(($) => /* @__PURE__ */ n("li", { children: $ }, $)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
764
+ k.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: k.map((C) => /* @__PURE__ */ n("li", { children: C }, C)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
764
765
  ] })
765
766
  ] }) : /* @__PURE__ */ n(
766
767
  "span",
767
768
  {
768
- className: be(
769
+ className: ye(
769
770
  "w-full break-words text-center leading-snug",
770
- !k && !d && "text-slate-500 dark:text-slate-400"
771
+ !w && !o && "text-slate-500 dark:text-slate-400"
771
772
  ),
772
773
  style: {
773
774
  fontSize: "11px",
774
- color: k ? W : d ? "#475569" : void 0,
775
- fontWeight: k ? 600 : d ? 500 : 400,
775
+ color: w ? se : o ? "#475569" : void 0,
776
+ fontWeight: w ? 600 : o ? 500 : 400,
776
777
  wordBreak: "break-word"
777
778
  },
778
- children: m.label
779
+ children: h.label
779
780
  }
780
781
  )
781
782
  ] }),
782
- !G && /* @__PURE__ */ i("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
783
+ !ee && /* @__PURE__ */ i("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
783
784
  (() => {
784
- const $ = d ? `${W}55` : "#e8ecf0";
785
+ const C = o ? `${se}55` : "#e8ecf0";
785
786
  return /* @__PURE__ */ i("div", { className: "flex w-full shrink-0 items-center", children: [
786
787
  /* @__PURE__ */ n(
787
788
  "div",
788
789
  {
789
790
  className: "h-0.5 flex-1 rounded-l-sm",
790
- style: { backgroundColor: $ }
791
+ style: { backgroundColor: C }
791
792
  }
792
793
  ),
793
794
  /* @__PURE__ */ n(
@@ -798,65 +799,65 @@ function ar({
798
799
  height: 0,
799
800
  borderTop: "3px solid transparent",
800
801
  borderBottom: "3px solid transparent",
801
- borderLeft: `5px solid ${$}`
802
+ borderLeft: `5px solid ${C}`
802
803
  }
803
804
  }
804
805
  )
805
806
  ] });
806
807
  })(),
807
- V.map(($) => {
808
- const pe = $.from_state !== m.id, o = Math.abs(
809
- (A.get($.to_state) ?? 0) - (A.get($.from_state ?? "") ?? 0)
810
- ) > 1 ? U.get($.to_state) ?? "" : null;
811
- return /* @__PURE__ */ i(Ze, { children: [
812
- /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
808
+ z.map((C) => {
809
+ const de = C.from_state !== h.id, J = Math.abs(
810
+ (A.get(C.to_state) ?? 0) - (A.get(C.from_state ?? "") ?? 0)
811
+ ) > 1 ? E.get(C.to_state) ?? "" : null;
812
+ return /* @__PURE__ */ i(nt, { children: [
813
+ /* @__PURE__ */ n(rt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
813
814
  /* @__PURE__ */ i(
814
815
  "span",
815
816
  {
816
817
  className: "text-center font-mono text-[9px] font-semibold leading-none",
817
- style: { color: pe ? "#d97706" : "#475569" },
818
+ style: { color: de ? "#d97706" : "#475569" },
818
819
  children: [
819
- pe && "↩ ",
820
- j($)
820
+ de && "↩ ",
821
+ H(C)
821
822
  ]
822
823
  }
823
824
  ),
824
- /* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: st($.timestamp) })
825
+ /* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: ot(C.timestamp) })
825
826
  ] }) }),
826
- /* @__PURE__ */ i(tt, { side: "top", className: "space-y-0.5 text-[12px]", children: [
827
- Be($) ? /* @__PURE__ */ i(he, { children: [
827
+ /* @__PURE__ */ i(at, { side: "top", className: "space-y-0.5 text-[12px]", children: [
828
+ je(C) ? /* @__PURE__ */ i(xe, { children: [
828
829
  /* @__PURE__ */ i("p", { className: "font-medium", children: [
829
- pe ? "↩ Sent back · " : "",
830
- nt($)
830
+ de ? "↩ Sent back · " : "",
831
+ st(C)
831
832
  ] }),
832
- rt($) && /* @__PURE__ */ n("p", { className: "max-w-[280px] text-muted-foreground", children: rt($) })
833
+ it(C) && /* @__PURE__ */ n("p", { className: "max-w-[280px] text-muted-foreground", children: it(C) })
833
834
  ] }) : /* @__PURE__ */ i("p", { className: "font-medium", children: [
834
- pe ? "↩ Sent back by" : "Approved by",
835
+ de ? "↩ Sent back by" : "Approved by",
835
836
  " ",
836
- B($)
837
+ K(C)
837
838
  ] }),
838
- o && /* @__PURE__ */ i("p", { className: "text-muted-foreground", children: [
839
+ J && /* @__PURE__ */ i("p", { className: "text-muted-foreground", children: [
839
840
  "→ straight to ",
840
- o
841
+ J
841
842
  ] }),
842
- /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: wt($.timestamp) })
843
+ /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: _t(C.timestamp) })
843
844
  ] })
844
- ] }, $.id);
845
+ ] }, C.id);
845
846
  })
846
847
  ] })
847
- ] }, m.id);
848
+ ] }, h.id);
848
849
  }) }) }) });
849
850
  }
850
- function sr({ history: t }) {
851
+ function dr({ history: t }) {
851
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) => {
852
- const r = Be(e), a = r ? nt(e) : dt([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l = Qn(e), c = e.comment && !r && !l ? e.comment : null, u = l ?? (r ? rt(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 = Gn(e), c = e.comment && !r && !l ? e.comment : null, p = l ?? (r ? it(e) : null);
853
854
  return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
854
855
  /* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
855
856
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
856
857
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
857
- e.from_state_label ? /* @__PURE__ */ n(ve, { label: e.from_state_label, color: e.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
858
- /* @__PURE__ */ n(at, { className: "h-3 w-3 shrink-0 text-slate-300" }),
859
- /* @__PURE__ */ n(ve, { label: e.to_state_label, color: e.to_state_color, small: !0 })
858
+ e.from_state_label ? /* @__PURE__ */ n(Ne, { label: e.from_state_label, color: e.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
859
+ /* @__PURE__ */ n(lt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
860
+ /* @__PURE__ */ n(Ne, { label: e.to_state_label, color: e.to_state_color, small: !0 })
860
861
  ] }),
861
862
  c && /* @__PURE__ */ i("p", { className: "mt-1 text-slate-500 italic", children: [
862
863
  '"',
@@ -869,11 +870,11 @@ function sr({ history: t }) {
869
870
  className: "mt-0.5 text-slate-400",
870
871
  "data-history-on-behalf": e.on_behalf_of_name ? e.on_behalf_of ?? "" : void 0,
871
872
  children: [
872
- r && /* @__PURE__ */ n(Dt, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
873
- a,
874
- u ? ` · ${u}` : "",
873
+ r && /* @__PURE__ */ n(Ut, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
874
+ s,
875
+ p ? ` · ${p}` : "",
875
876
  " · ",
876
- st(e.timestamp)
877
+ ot(e.timestamp)
877
878
  ]
878
879
  }
879
880
  )
@@ -881,42 +882,42 @@ function sr({ history: t }) {
881
882
  ] }, e.id);
882
883
  }) });
883
884
  }
884
- function ir({ value: t, onChange: e }) {
885
- const r = ge(), [a, l] = K(!1), [c, u] = K(""), [h, f] = K(""), N = se(null), v = se(null);
885
+ function cr({ value: t, onChange: e }) {
886
+ const r = we(), [s, l] = I(!1), [c, p] = I(""), [b, f] = I(""), _ = ne(null), v = ne(null);
886
887
  fe(() => {
887
- a ? setTimeout(() => {
888
- var M;
889
- return (M = N.current) == null ? void 0 : M.focus();
890
- }, 50) : u("");
891
- }, [a]), fe(() => (v.current && clearTimeout(v.current), v.current = setTimeout(() => f(c), 250), () => {
888
+ s ? setTimeout(() => {
889
+ var T;
890
+ return (T = _.current) == null ? void 0 : T.focus();
891
+ }, 50) : p("");
892
+ }, [s]), fe(() => (v.current && clearTimeout(v.current), v.current = setTimeout(() => f(c), 250), () => {
892
893
  v.current && clearTimeout(v.current);
893
894
  }), [c]);
894
- const { data: x, isLoading: q } = oe({
895
- queryKey: ["users", "async-search", h],
895
+ const { data: y, isLoading: $ } = oe({
896
+ queryKey: ["users", "async-search", b],
896
897
  queryFn: () => r.request(
897
- ue("/users", {
898
+ ce("/users", {
898
899
  limit: 50,
899
900
  sort: "first_name",
900
- ...h ? { search: h } : {}
901
+ ...b ? { search: b } : {}
901
902
  })
902
- ).then((M) => M.data),
903
- enabled: a,
903
+ ).then((T) => T.data),
904
+ enabled: s,
904
905
  staleTime: 3e4
905
906
  }), { data: A } = oe({
906
- ...qn(r, t),
907
+ ...Dn(r, t),
907
908
  enabled: !!t,
908
909
  staleTime: 5 * 6e4
909
- }), U = x ?? [], E = A ?? U.find((M) => M.id === t) ?? null, j = E ? [E.first_name, E.last_name].filter(Boolean).join(" ").trim() || E.email : t ? "Selected person" : null, B = (M) => [M.first_name, M.last_name].filter(Boolean).join(" ").trim();
910
- return /* @__PURE__ */ i(it, { open: a, onOpenChange: l, children: [
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();
911
+ return /* @__PURE__ */ i(dt, { open: s, onOpenChange: l, children: [
911
912
  /* @__PURE__ */ i("div", { className: "relative flex h-8 w-full", children: [
912
- /* @__PURE__ */ n(lt, { asChild: !0, children: /* @__PURE__ */ i(
913
+ /* @__PURE__ */ n(ct, { asChild: !0, children: /* @__PURE__ */ i(
913
914
  "button",
914
915
  {
915
916
  type: "button",
916
917
  className: "flex h-full w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-left text-[13px] text-slate-700 hover:border-slate-300",
917
918
  children: [
918
- /* @__PURE__ */ n("span", { className: `flex-1 truncate ${j ? "" : "text-slate-400"}`, children: j ?? "Select a user…" }),
919
- /* @__PURE__ */ n(Se, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
919
+ /* @__PURE__ */ n("span", { className: `flex-1 truncate ${H ? "" : "text-slate-400"}`, children: H ?? "Select a user…" }),
920
+ /* @__PURE__ */ n($e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
920
921
  ]
921
922
  }
922
923
  ) }),
@@ -924,64 +925,64 @@ function ir({ value: t, onChange: e }) {
924
925
  "button",
925
926
  {
926
927
  type: "button",
927
- onClick: (M) => {
928
- M.stopPropagation(), e("");
928
+ onClick: (T) => {
929
+ T.stopPropagation(), e("");
929
930
  },
930
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",
931
- children: /* @__PURE__ */ n(Pt, { className: "h-3 w-3" })
932
+ children: /* @__PURE__ */ n(Ot, { className: "h-3 w-3" })
932
933
  }
933
934
  )
934
935
  ] }),
935
- /* @__PURE__ */ i(ot, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
936
+ /* @__PURE__ */ i(ut, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
936
937
  /* @__PURE__ */ n("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ i("div", { className: "relative", children: [
937
- /* @__PURE__ */ n(kn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
938
+ /* @__PURE__ */ n(Cn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
938
939
  /* @__PURE__ */ n(
939
940
  "input",
940
941
  {
941
- ref: N,
942
+ ref: _,
942
943
  value: c,
943
- onChange: (M) => u(M.target.value),
944
+ onChange: (T) => p(T.target.value),
944
945
  placeholder: "Search users…",
945
946
  className: "h-7 w-full rounded-md bg-slate-50 pl-7 pr-2 text-[12px] placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-nvr-cyan/40"
946
947
  }
947
948
  )
948
949
  ] }) }),
949
- /* @__PURE__ */ n("div", { className: "max-h-56 overflow-y-auto py-1", children: q ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
950
+ /* @__PURE__ */ n("div", { className: "max-h-56 overflow-y-auto py-1", children: $ ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
950
951
  /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }),
951
952
  "Loading…"
952
- ] }) : U.length === 0 ? /* @__PURE__ */ n("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : U.map((M) => {
953
- const L = B(M), I = L ? `${L} (${M.email})` : M.email, m = M.id === t;
953
+ ] }) : E.length === 0 ? /* @__PURE__ */ n("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : E.map((T) => {
954
+ const P = K(T), L = P ? `${P} (${T.email})` : T.email, h = T.id === t;
954
955
  return /* @__PURE__ */ i(
955
956
  "button",
956
957
  {
957
958
  type: "button",
958
959
  onClick: () => {
959
- e(M.id), l(!1);
960
+ e(T.id), l(!1);
960
961
  },
961
- className: `flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] hover:bg-slate-50 ${m ? "font-medium text-slate-800" : "text-slate-600"}`,
962
+ className: `flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] hover:bg-slate-50 ${h ? "font-medium text-slate-800" : "text-slate-600"}`,
962
963
  children: [
963
964
  /* @__PURE__ */ n(
964
- Ie,
965
+ We,
965
966
  {
966
- className: `h-3.5 w-3.5 shrink-0 ${m ? "text-nvr-cyan" : "opacity-0"}`
967
+ className: `h-3.5 w-3.5 shrink-0 ${h ? "text-nvr-cyan" : "opacity-0"}`
967
968
  }
968
969
  ),
969
- I
970
+ L
970
971
  ]
971
972
  },
972
- M.id
973
+ T.id
973
974
  );
974
975
  }) })
975
976
  ] })
976
977
  ] });
977
978
  }
978
- function qt({
979
+ function Dt({
979
980
  userId: t,
980
981
  name: e,
981
982
  email: r,
982
- initials: a
983
+ initials: s
983
984
  }) {
984
- return /* @__PURE__ */ n(Lt, { userId: t, children: /* @__PURE__ */ i(
985
+ return /* @__PURE__ */ n(Kt, { userId: t, children: /* @__PURE__ */ i(
985
986
  "button",
986
987
  {
987
988
  type: "button",
@@ -989,12 +990,12 @@ function qt({
989
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",
990
991
  children: [
991
992
  /* @__PURE__ */ n(
992
- On,
993
+ Bn,
993
994
  {
994
995
  userId: t,
995
996
  alt: e,
996
997
  className: "h-6 w-6",
997
- fallback: /* @__PURE__ */ n("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80 dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: a })
998
+ fallback: /* @__PURE__ */ n("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80 dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: s })
998
999
  }
999
1000
  ),
1000
1001
  /* @__PURE__ */ i("span", { className: "min-w-0 flex-1", children: [
@@ -1005,157 +1006,157 @@ function qt({
1005
1006
  }
1006
1007
  ) });
1007
1008
  }
1008
- function lr({
1009
+ function ur({
1009
1010
  collection: t,
1010
1011
  item: e,
1011
1012
  states: r,
1012
- currentStateId: a,
1013
+ currentStateId: s,
1013
1014
  returned: l = !1
1014
1015
  }) {
1015
- var xe, ce, de, ke;
1016
- const c = ge(), u = Re(), { isAdmin: h } = Ot(), [f, N] = K(!1), [v, x] = K(""), [q, A] = K(""), [U, E] = K(!1), j = ["pipeline-instance-owners", t, e], B = ["pipeline-owners-can-add", t, e], M = () => c.request(
1017
- ue(`/pipelines/instance/${t}/${e}/owners`)
1018
- ).then((s) => {
1019
- var b;
1020
- return u.setQueryData(B, ((b = s.meta) == null ? void 0 : b.can_add) ?? null), s;
1021
- }), { data: L, isLoading: I } = oe({
1022
- queryKey: j,
1023
- queryFn: () => M().then((s) => s.data)
1024
- }), { data: m } = oe({
1025
- queryKey: B,
1026
- queryFn: () => M().then((s) => {
1027
- var b;
1028
- return ((b = s.meta) == null ? void 0 : b.can_add) ?? null;
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(
1018
+ ce(`/pipelines/instance/${t}/${e}/owners`)
1019
+ ).then((a) => {
1020
+ var m;
1021
+ return p.setQueryData(K, ((m = a.meta) == null ? void 0 : m.can_add) ?? null), a;
1022
+ }), { data: P, isLoading: L } = oe({
1023
+ queryKey: H,
1024
+ queryFn: () => T().then((a) => a.data)
1025
+ }), { data: h } = oe({
1026
+ queryKey: K,
1027
+ queryFn: () => T().then((a) => {
1028
+ var m;
1029
+ return ((m = a.meta) == null ? void 0 : m.can_add) ?? null;
1029
1030
  }),
1030
- enabled: !I,
1031
+ enabled: !L,
1031
1032
  staleTime: 3e4
1032
- }), g = typeof m == "boolean" ? m : h, { data: k, isLoading: R } = oe({
1033
+ }), x = typeof h == "boolean" ? h : b, { data: w, isLoading: q } = oe({
1033
1034
  queryKey: ["pipeline-all-owners", t, e],
1034
1035
  queryFn: () => c.request(
1035
- ue(`/pipelines/instance/${t}/${e}/owners/all`)
1036
- ).then((s) => s.data ?? null),
1037
- enabled: !!a,
1036
+ ce(`/pipelines/instance/${t}/${e}/owners/all`)
1037
+ ).then((a) => a.data ?? null),
1038
+ enabled: !!s,
1038
1039
  staleTime: 3e4
1039
- }), d = new Set((L ?? []).map((s) => s.user)), Q = a ? (((xe = k == null ? void 0 : k[a]) == null ? void 0 : xe.owners) ?? []).filter((s) => !d.has(s.id)) : [], Z = new Map(
1040
- (a ? ((ce = k == null ? void 0 : k[a]) == null ? void 0 : ce.unavailable) ?? [] : []).map((s) => [
1041
- String(s.id).toUpperCase(),
1042
- s
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) => [
1042
+ String(a.id).toUpperCase(),
1043
+ a
1043
1044
  ])
1044
- ), y = Q.length + ((L == null ? void 0 : L.length) ?? 0), _ = !!((de = r.find((s) => s.id === a)) != null && de.is_initial), H = !I && !R, { data: W } = oe({
1045
+ ), g = Q.length + ((P == null ? void 0 : P.length) ?? 0), k = !!((d = r.find((a) => a.id === s)) != null && d.is_initial), G = !L && !q, { data: se } = oe({
1045
1046
  queryKey: ["pipeline-record-creator", t, e],
1046
1047
  queryFn: () => c.request(
1047
- ue(`/pipelines/instance/${t}/${e}/creator`)
1048
- ).then((s) => s.data ?? null),
1049
- enabled: _ && H && y === 0,
1048
+ ce(`/pipelines/instance/${t}/${e}/creator`)
1049
+ ).then((a) => a.data ?? null),
1050
+ enabled: k && G && g === 0,
1050
1051
  staleTime: 6e4
1051
- }), G = _ && y === 0 && (W != null && W.name) ? W : null, ee = () => {
1052
- u.invalidateQueries({ queryKey: j }), u.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
1053
- }, V = Me({
1052
+ }), ee = k && g === 0 && (se != null && se.name) ? se : null, re = () => {
1053
+ p.invalidateQueries({ queryKey: H }), p.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
1054
+ }, z = Pe({
1054
1055
  mutationFn: () => c.request(
1055
- Ce(`/pipelines/instance/${t}/${e}/owners`, {
1056
+ Te(`/pipelines/instance/${t}/${e}/owners`, {
1056
1057
  user: v,
1057
- state: q || void 0
1058
+ state: $ || void 0
1058
1059
  })
1059
1060
  ),
1060
1061
  onSuccess: () => {
1061
- ee(), x(""), A(""), N(!1), J.success("Owner added");
1062
+ re(), y(""), A(""), _(!1), Y.success("Owner added");
1062
1063
  },
1063
1064
  // The server's reason (a 403 says why), not a bare status phrase.
1064
- onError: (s) => J.error(Pe(s, "Failed to add owner"))
1065
- }), $ = Me({
1066
- mutationFn: (s) => c.request(_n(`/pipelines/instance-owners/${s.id}`)),
1067
- onSuccess: (s, b) => {
1068
- ee();
1069
- const w = [b.first_name, b.last_name].filter(Boolean).join(" ") || b.email;
1070
- J.success(`${w} removed as an owner`, {
1065
+ onError: (a) => Y.error(Fe(a, "Failed to add owner"))
1066
+ }), C = Pe({
1067
+ mutationFn: (a) => c.request(Tn(`/pipelines/instance-owners/${a.id}`)),
1068
+ onSuccess: (a, m) => {
1069
+ re();
1070
+ const N = [m.first_name, m.last_name].filter(Boolean).join(" ") || m.email;
1071
+ Y.success(`${N} removed as an owner`, {
1071
1072
  action: {
1072
1073
  label: "Undo",
1073
1074
  onClick: () => void c.request(
1074
- Ce(`/pipelines/instance/${t}/${e}/owners`, {
1075
- user: b.user,
1076
- state: b.state || void 0
1075
+ Te(`/pipelines/instance/${t}/${e}/owners`, {
1076
+ user: m.user,
1077
+ state: m.state || void 0
1077
1078
  })
1078
- ).then(() => ee()).catch((S) => J.error(Pe(S, "Could not add the owner back")))
1079
+ ).then(() => re()).catch((D) => Y.error(Fe(D, "Could not add the owner back")))
1079
1080
  }
1080
1081
  });
1081
1082
  },
1082
- onError: (s) => J.error(Pe(s, "Failed to remove owner"))
1083
- }), pe = (s) => {
1084
- var S, P;
1085
- const b = ((S = s.first_name) == null ? void 0 : S[0]) ?? "", w = ((P = s.last_name) == null ? void 0 : P[0]) ?? "";
1086
- return (`${b}${w}`.trim() || s.email[0] || "?").toUpperCase();
1087
- }, o = (s) => {
1088
- var b;
1089
- return s ? ((b = r.find((w) => w.id === s || w.key === s)) == null ? void 0 : b.label) ?? s : null;
1083
+ onError: (a) => Y.error(Fe(a, "Failed to remove owner"))
1084
+ }), de = (a) => {
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]) ?? "";
1087
+ return (`${m}${N}`.trim() || a.email[0] || "?").toUpperCase();
1088
+ }, J = (a) => {
1089
+ var m;
1090
+ return a ? ((m = r.find((N) => N.id === a || N.key === a)) == null ? void 0 : m.label) ?? a : null;
1090
1091
  };
1091
1092
  return /* @__PURE__ */ i("div", { children: [
1092
1093
  /* @__PURE__ */ i("div", { className: "mb-3 flex items-center justify-between", children: [
1093
1094
  /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
1094
- /* @__PURE__ */ n(Rt, { className: "h-3.5 w-3.5" }),
1095
+ /* @__PURE__ */ n(At, { className: "h-3.5 w-3.5" }),
1095
1096
  "Owners",
1096
- I || R ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : G ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
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: [
1097
1098
  "(",
1098
- y,
1099
+ g,
1099
1100
  ")"
1100
1101
  ] })
1101
1102
  ] }),
1102
1103
  /* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
1103
- a && /* @__PURE__ */ n(Bn, { collection: t, itemId: String(e) }),
1104
- !f && g && /* @__PURE__ */ i(
1104
+ s && /* @__PURE__ */ n(In, { collection: t, itemId: String(e) }),
1105
+ !f && x && /* @__PURE__ */ i(
1105
1106
  "button",
1106
1107
  {
1107
1108
  type: "button",
1108
- onClick: () => N(!0),
1109
+ onClick: () => _(!0),
1109
1110
  className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
1110
1111
  children: [
1111
- /* @__PURE__ */ n(vn, { className: "h-3 w-3" }),
1112
+ /* @__PURE__ */ n(Sn, { className: "h-3 w-3" }),
1112
1113
  "Add"
1113
1114
  ]
1114
1115
  }
1115
1116
  )
1116
1117
  ] })
1117
1118
  ] }),
1118
- I || R ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
1119
+ L || q ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
1119
1120
  /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }),
1120
1121
  "Resolving owners…"
1121
- ] }) : G ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1122
+ ] }) : ee ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1122
1123
  l ? "Back with" : "With",
1123
1124
  " ",
1124
- /* @__PURE__ */ n(Lt, { userId: G.id, children: /* @__PURE__ */ n(
1125
+ /* @__PURE__ */ n(Kt, { userId: ee.id, children: /* @__PURE__ */ n(
1125
1126
  "button",
1126
1127
  {
1127
1128
  type: "button",
1128
- "aria-label": `${G.name} — profile`,
1129
+ "aria-label": `${ee.name} — profile`,
1129
1130
  className: "rounded font-medium text-slate-700 underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:text-foreground",
1130
- children: G.name
1131
+ children: ee.name
1131
1132
  }
1132
1133
  ) })
1133
- ] }) : y === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ i("div", { className: "space-y-px", children: [
1134
- Q.map((s) => {
1135
- var S, P;
1136
- const b = [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email, w = (`${((S = s.first_name) == null ? void 0 : S[0]) ?? ""}${((P = s.last_name) == null ? void 0 : P[0]) ?? ""}`.trim() || s.email[0] || "?").toUpperCase();
1134
+ ] }) : g === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ i("div", { className: "space-y-px", children: [
1135
+ Q.map((a) => {
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();
1137
1138
  return /* @__PURE__ */ i(
1138
1139
  "div",
1139
1140
  {
1140
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",
1141
1142
  children: [
1142
- /* @__PURE__ */ n(qt, { userId: s.id, name: b, email: s.email, initials: w }),
1143
+ /* @__PURE__ */ n(Dt, { userId: a.id, name: m, email: a.email, initials: N }),
1143
1144
  (() => {
1144
- const D = Z.get(String(s.id).toUpperCase());
1145
- return D ? /* @__PURE__ */ n(
1145
+ const R = X.get(String(a.id).toUpperCase());
1146
+ return R ? /* @__PURE__ */ n(
1146
1147
  "span",
1147
1148
  {
1148
- "data-owner-unavailable": D.reason,
1149
- className: be(
1149
+ "data-owner-unavailable": R.reason,
1150
+ className: ye(
1150
1151
  "shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-medium",
1151
- D.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"
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"
1152
1153
  ),
1153
- "data-tip": D.delegate ? `${b} is ${qe[D.reason] ?? D.reason} — ${D.delegate.name} covers` : `${b} is ${qe[D.reason] ?? D.reason} and can't approve this step`,
1154
- children: D.delegate ? `${qe[D.reason] ?? D.reason} · ${D.delegate.name} covers` : qe[D.reason] ?? D.reason
1154
+ "data-tip": R.delegate ? `${m} is ${Re[R.reason] ?? R.reason} — ${R.delegate.name} covers` : `${m} is ${Re[R.reason] ?? R.reason} and can't approve this step`,
1155
+ children: R.delegate ? `${Re[R.reason] ?? R.reason} · ${R.delegate.name} covers` : Re[R.reason] ?? R.reason
1155
1156
  }
1156
1157
  ) : null;
1157
1158
  })(),
1158
- s.queue_only ? /* @__PURE__ */ n(
1159
+ a.queue_only ? /* @__PURE__ */ n(
1159
1160
  "span",
1160
1161
  {
1161
1162
  className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-800 dark:text-slate-400",
@@ -1165,73 +1166,73 @@ function lr({
1165
1166
  ) : /* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy/70 dark:text-nvr-cyan", children: "owner group" })
1166
1167
  ]
1167
1168
  },
1168
- `group-${s.id}`
1169
+ `group-${a.id}`
1169
1170
  );
1170
1171
  }),
1171
- (L ?? []).map((s) => /* @__PURE__ */ i(
1172
+ (P ?? []).map((a) => /* @__PURE__ */ i(
1172
1173
  "div",
1173
1174
  {
1174
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",
1175
1176
  children: [
1176
1177
  /* @__PURE__ */ n(
1177
- qt,
1178
+ Dt,
1178
1179
  {
1179
- userId: s.user,
1180
- name: [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email,
1181
- email: s.email,
1182
- initials: pe(s)
1180
+ userId: a.user,
1181
+ name: [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email,
1182
+ email: a.email,
1183
+ initials: de(a)
1183
1184
  }
1184
1185
  ),
1185
1186
  /* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400", children: "manual" }),
1186
- /* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] text-slate-500", children: s.state ? o(s.state) : "all states" }),
1187
+ /* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] text-slate-500", children: a.state ? J(a.state) : "all states" }),
1187
1188
  /* @__PURE__ */ n(
1188
1189
  "button",
1189
1190
  {
1190
1191
  type: "button",
1191
- "aria-label": `Remove ${[s.first_name, s.last_name].filter(Boolean).join(" ") || s.email} as an owner`,
1192
- disabled: $.isPending,
1193
- onClick: () => $.mutate(s),
1192
+ "aria-label": `Remove ${[a.first_name, a.last_name].filter(Boolean).join(" ") || a.email} as an owner`,
1193
+ disabled: C.isPending,
1194
+ onClick: () => C.mutate(a),
1194
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",
1195
- children: /* @__PURE__ */ n(Pt, { className: "h-3 w-3" })
1196
+ children: /* @__PURE__ */ n(Ot, { className: "h-3 w-3" })
1196
1197
  }
1197
1198
  )
1198
1199
  ]
1199
1200
  },
1200
- s.id
1201
+ a.id
1201
1202
  ))
1202
1203
  ] }),
1203
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: [
1204
1205
  /* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
1205
- /* @__PURE__ */ n(ir, { value: v, onChange: x }),
1206
- h ? /* @__PURE__ */ i(it, { open: U, onOpenChange: E, children: [
1207
- /* @__PURE__ */ n(lt, { asChild: !0, children: /* @__PURE__ */ i(
1206
+ /* @__PURE__ */ n(cr, { value: v, onChange: y }),
1207
+ b ? /* @__PURE__ */ i(dt, { open: E, onOpenChange: B, children: [
1208
+ /* @__PURE__ */ n(ct, { asChild: !0, children: /* @__PURE__ */ i(
1208
1209
  "button",
1209
1210
  {
1210
1211
  type: "button",
1211
1212
  className: "flex h-8 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-2.5 text-left text-[13px] text-slate-700 transition-colors hover:border-slate-300 dark:border-border dark:bg-transparent dark:text-slate-300",
1212
1213
  children: [
1213
- /* @__PURE__ */ n("span", { className: "truncate", children: q ? ((ke = r.find((s) => s.id === q)) == null ? void 0 : ke.label) ?? q : "All states" }),
1214
- /* @__PURE__ */ n(Se, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
1214
+ /* @__PURE__ */ n("span", { className: "truncate", children: $ ? ((_e = r.find((a) => a.id === $)) == null ? void 0 : _e.label) ?? $ : "All states" }),
1215
+ /* @__PURE__ */ n($e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
1215
1216
  ]
1216
1217
  }
1217
1218
  ) }),
1218
- /* @__PURE__ */ n(ot, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((s) => s.id)].map((s) => {
1219
- var S;
1220
- const b = s === "" ? "All states" : ((S = r.find((P) => P.id === s)) == null ? void 0 : S.label) ?? s;
1219
+ /* @__PURE__ */ n(ut, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((a) => a.id)].map((a) => {
1220
+ var D;
1221
+ const m = a === "" ? "All states" : ((D = r.find((M) => M.id === a)) == null ? void 0 : D.label) ?? a;
1221
1222
  return /* @__PURE__ */ n(
1222
1223
  "button",
1223
1224
  {
1224
1225
  type: "button",
1225
- className: be(
1226
+ className: ye(
1226
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",
1227
- q === s && "font-medium text-slate-800 dark:text-slate-200"
1228
+ $ === a && "font-medium text-slate-800 dark:text-slate-200"
1228
1229
  ),
1229
1230
  onClick: () => {
1230
- A(s), E(!1);
1231
+ A(a), B(!1);
1231
1232
  },
1232
- children: b
1233
+ children: m
1233
1234
  },
1234
- s
1235
+ a
1235
1236
  );
1236
1237
  }) })
1237
1238
  ] }) : /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "Hands off the current step." }),
@@ -1244,7 +1245,7 @@ function lr({
1244
1245
  variant: "ghost",
1245
1246
  className: "h-7 text-[12px]",
1246
1247
  onClick: () => {
1247
- N(!1), x(""), A("");
1248
+ _(!1), y(""), A("");
1248
1249
  },
1249
1250
  children: "Cancel"
1250
1251
  }
@@ -1255,25 +1256,25 @@ function lr({
1255
1256
  type: "button",
1256
1257
  size: "sm",
1257
1258
  className: "h-7 text-[12px]",
1258
- disabled: !v || V.isPending,
1259
- onClick: () => V.mutate(),
1260
- children: V.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : "Add"
1259
+ disabled: !v || z.isPending,
1260
+ onClick: () => z.mutate(),
1261
+ children: z.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : "Add"
1261
1262
  }
1262
1263
  )
1263
1264
  ] })
1264
1265
  ] })
1265
1266
  ] });
1266
1267
  }
1267
- function un(t, e, r, a) {
1268
+ function hn(t, e, r, s) {
1268
1269
  if (!t || !(r != null && r.length)) return null;
1269
- const c = new Map(r.map((f) => [String(f.id).toUpperCase(), f])).get(String(t.to_state).toUpperCase()), u = Number(e == null ? void 0 : e.sort);
1270
- if (!c || !Number.isFinite(u) || !(Number(c.sort) > u)) return null;
1271
- const h = En(String(t.to_state), r, a);
1272
- return h && h.skipped.length > 0 ? h : null;
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);
1271
+ if (!c || !Number.isFinite(p) || !(Number(c.sort) > p)) return null;
1272
+ const b = Qn(String(t.to_state), r, s);
1273
+ return b && b.skipped.length > 0 ? b : null;
1273
1274
  }
1274
- function mn({ landing: t }) {
1275
+ function bn({ landing: t }) {
1275
1276
  if (!t || t.skipped.length === 0) return null;
1276
- const e = jn(t);
1277
+ const e = Wn(t);
1277
1278
  if (e.length === 1) {
1278
1279
  const r = e[0];
1279
1280
  return /* @__PURE__ */ i(
@@ -1286,7 +1287,7 @@ function mn({ landing: t }) {
1286
1287
  /* @__PURE__ */ n("span", { className: "font-medium", children: t.state.label }),
1287
1288
  " —",
1288
1289
  " ",
1289
- Nt(r.labels),
1290
+ $t(r.labels),
1290
1291
  " ",
1291
1292
  r.labels.length === 1 ? "is" : "are",
1292
1293
  " skipped",
@@ -1308,114 +1309,114 @@ function mn({ landing: t }) {
1308
1309
  ". Skipped on the way:"
1309
1310
  ] }),
1310
1311
  /* @__PURE__ */ n("ul", { className: "mt-0.5 list-disc space-y-0.5 pl-4", children: e.map((r) => /* @__PURE__ */ i("li", { children: [
1311
- /* @__PURE__ */ n("span", { className: "font-medium", children: Nt(r.labels) }),
1312
+ /* @__PURE__ */ n("span", { className: "font-medium", children: $t(r.labels) }),
1312
1313
  r.reason ? ` — ${r.reason}` : ""
1313
1314
  ] }, r.labels.join("|"))) })
1314
1315
  ]
1315
1316
  }
1316
1317
  );
1317
1318
  }
1318
- const qe = {
1319
+ const Re = {
1319
1320
  out: "out of office",
1320
1321
  suspended: "suspended",
1321
1322
  redacted: "redacted"
1322
1323
  };
1323
- function or({
1324
+ function mr({
1324
1325
  collection: t,
1325
1326
  item: e,
1326
1327
  states: r,
1327
- currentStateId: a
1328
+ currentStateId: s
1328
1329
  }) {
1329
- const l = ge(), [c, u] = K(!1), { data: h, isLoading: f } = oe({
1330
+ const l = we(), [c, p] = I(!1), { data: b, isLoading: f } = oe({
1330
1331
  queryKey: ["pipeline-all-owners", t, e],
1331
1332
  queryFn: () => l.request(
1332
- ue(`/pipelines/instance/${t}/${e}/owners/all`)
1333
+ ce(`/pipelines/instance/${t}/${e}/owners/all`)
1333
1334
  ).then((v) => v.data ?? null),
1334
1335
  enabled: c,
1335
1336
  staleTime: 3e4
1336
- }), N = [...r].filter((v) => {
1337
- var x;
1338
- return !h || ((x = h[v.id]) == null ? void 0 : x.on_path) !== !1;
1339
- }).sort((v, x) => v.sort - x.sort);
1340
- return /* @__PURE__ */ i(it, { open: c, onOpenChange: u, children: [
1341
- /* @__PURE__ */ n(lt, { asChild: !0, children: /* @__PURE__ */ n(
1337
+ }), _ = [...r].filter((v) => {
1338
+ var y;
1339
+ return !b || ((y = b[v.id]) == null ? void 0 : y.on_path) !== !1;
1340
+ }).sort((v, y) => v.sort - y.sort);
1341
+ return /* @__PURE__ */ i(dt, { open: c, onOpenChange: p, children: [
1342
+ /* @__PURE__ */ n(ct, { asChild: !0, children: /* @__PURE__ */ n(
1342
1343
  "button",
1343
1344
  {
1344
1345
  type: "button",
1345
1346
  title: "View approval chain",
1346
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",
1347
1348
  onClick: (v) => v.stopPropagation(),
1348
- children: /* @__PURE__ */ n(Rt, { className: "h-3.5 w-3.5" })
1349
+ children: /* @__PURE__ */ n(At, { className: "h-3.5 w-3.5" })
1349
1350
  }
1350
1351
  ) }),
1351
- /* @__PURE__ */ i(ot, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
1352
+ /* @__PURE__ */ i(ut, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
1352
1353
  /* @__PURE__ */ i("div", { className: "border-b border-slate-100 px-4 py-3", children: [
1353
1354
  /* @__PURE__ */ n("p", { className: "text-[12px] font-semibold text-slate-700", children: "Approval Chain" }),
1354
1355
  /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-400 mt-0.5", children: "Owners per pipeline state" })
1355
1356
  ] }),
1356
- /* @__PURE__ */ n("div", { className: "max-h-[504px] overflow-y-auto", children: f ? /* @__PURE__ */ n("div", { className: "space-y-px p-3", children: [1, 2, 3].map((v) => /* @__PURE__ */ n(we, { className: "h-10 w-full" }, v)) }) : h ? /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: N.map((v) => {
1357
- var B, M, L, I, m;
1358
- const x = (((B = h[v.id]) == null ? void 0 : B.owners) ?? []).map((g) => ({
1359
- id: g.id,
1360
- name: [g.first_name, g.last_name].filter(Boolean).join(" ") || g.email
1361
- })), q = v.id === a, A = ((M = h[v.id]) == null ? void 0 : M.skipped) === !0 && !q, U = (((L = h[v.id]) == null ? void 0 : L.skip_reasons) ?? []).filter(Boolean), E = ((I = h[v.id]) == null ? void 0 : I.unavailable) ?? [], j = ((m = h[v.id]) == null ? void 0 : m.blocked) === !0 && !A;
1357
+ /* @__PURE__ */ n("div", { className: "max-h-[504px] overflow-y-auto", children: f ? /* @__PURE__ */ n("div", { className: "space-y-px p-3", children: [1, 2, 3].map((v) => /* @__PURE__ */ n(ke, { className: "h-10 w-full" }, v)) }) : b ? /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: _.map((v) => {
1358
+ var K, T, P, L, h;
1359
+ const y = (((K = b[v.id]) == null ? void 0 : K.owners) ?? []).map((x) => ({
1360
+ id: x.id,
1361
+ name: [x.first_name, x.last_name].filter(Boolean).join(" ") || x.email
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;
1362
1363
  return /* @__PURE__ */ i(
1363
1364
  "div",
1364
1365
  {
1365
- className: be(
1366
+ className: ye(
1366
1367
  "flex items-center gap-3 px-4 py-2.5",
1367
1368
  // Hex-with-alpha rather than bg-nvr-cyan/N — the
1368
1369
  // nvr-cyan token is an opaque var() so Tailwind silently
1369
1370
  // drops opacity modifiers on it. Kept very light so the
1370
1371
  // tint doesn't clash with the state badge's own color.
1371
- q && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
1372
+ $ && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
1372
1373
  A && "opacity-60",
1373
- j && "bg-red-50 dark:bg-red-500/10"
1374
+ H && "bg-red-50 dark:bg-red-500/10"
1374
1375
  ),
1375
- "data-chain-blocked": j ? "" : void 0,
1376
+ "data-chain-blocked": H ? "" : void 0,
1376
1377
  children: [
1377
- /* @__PURE__ */ n(ve, { label: v.label, color: v.color, small: !0 }),
1378
+ /* @__PURE__ */ n(Ne, { label: v.label, color: v.color, small: !0 }),
1378
1379
  /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5", children: A ? (
1379
1380
  // Radix tooltip with zero delay — native `title` waits on
1380
1381
  // the OS hover timer, and a truncated reason needs its
1381
1382
  // full text the moment the cursor lands on it.
1382
- /* @__PURE__ */ n(Et, { delayDuration: 0, children: /* @__PURE__ */ i(Ze, { children: [
1383
- /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
1383
+ /* @__PURE__ */ n(Qt, { delayDuration: 0, children: /* @__PURE__ */ i(nt, { children: [
1384
+ /* @__PURE__ */ n(rt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
1384
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" }),
1385
- U.length > 0 && /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: U.join(" · ") })
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(" · ") })
1386
1387
  ] }) }),
1387
1388
  /* @__PURE__ */ i(
1388
- tt,
1389
+ at,
1389
1390
  {
1390
1391
  side: "bottom",
1391
1392
  align: "start",
1392
1393
  className: "max-w-[420px] space-y-0.5 text-[11.5px] leading-snug",
1393
1394
  children: [
1394
1395
  /* @__PURE__ */ n("p", { className: "text-slate-500 dark:text-slate-400", children: "The pipeline will pass through this state without stopping:" }),
1395
- U.length > 0 ? U.map((g) => /* @__PURE__ */ n("p", { children: g }, g)) : /* @__PURE__ */ n("p", { children: "Skip criteria currently match" })
1396
+ E.length > 0 ? E.map((x) => /* @__PURE__ */ n("p", { children: x }, x)) : /* @__PURE__ */ n("p", { children: "Skip criteria currently match" })
1396
1397
  ]
1397
1398
  }
1398
1399
  )
1399
1400
  ] }) })
1400
- ) : /* @__PURE__ */ i(he, { children: [
1401
- /* @__PURE__ */ n(An, { owners: x, max: 10, emptyLabel: "—" }),
1402
- E.map((g) => /* @__PURE__ */ i(
1401
+ ) : /* @__PURE__ */ i(xe, { children: [
1402
+ /* @__PURE__ */ n(Ln, { owners: y, max: 10, emptyLabel: "—" }),
1403
+ B.map((x) => /* @__PURE__ */ i(
1403
1404
  "span",
1404
1405
  {
1405
- "data-tip": `${g.name} is ${qe[g.reason] ?? g.reason}${g.delegate ? ` — ${g.delegate.name} covers${g.delegate.expires_at ? ` until ${Rn(g.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1406
- className: be(
1406
+ "data-tip": `${x.name} is ${Re[x.reason] ?? x.reason}${x.delegate ? ` — ${x.delegate.name} covers${x.delegate.expires_at ? ` until ${An(x.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1407
+ className: ye(
1407
1408
  "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
1408
- g.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"
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"
1409
1410
  ),
1410
1411
  children: [
1411
- g.name,
1412
- g.delegate ? /* @__PURE__ */ i(he, { children: [
1412
+ x.name,
1413
+ x.delegate ? /* @__PURE__ */ i(xe, { children: [
1413
1414
  " → ",
1414
- g.delegate.name,
1415
- g.delegate.expires_at && /* @__PURE__ */ i("span", { className: "opacity-70", children: [
1415
+ x.delegate.name,
1416
+ x.delegate.expires_at && /* @__PURE__ */ i("span", { className: "opacity-70", children: [
1416
1417
  ", until",
1417
1418
  " ",
1418
- new Date(g.delegate.expires_at).toLocaleDateString(
1419
+ new Date(x.delegate.expires_at).toLocaleDateString(
1419
1420
  void 0,
1420
1421
  {
1421
1422
  month: "short",
@@ -1426,13 +1427,13 @@ function or({
1426
1427
  ] }) : /* @__PURE__ */ i("span", { className: "opacity-80", children: [
1427
1428
  " ",
1428
1429
  "· ",
1429
- qe[g.reason] ?? g.reason
1430
+ Re[x.reason] ?? x.reason
1430
1431
  ] })
1431
1432
  ]
1432
1433
  },
1433
- g.id
1434
+ x.id
1434
1435
  )),
1435
- j && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-red-600 px-2 py-0.5 text-[10.5px] font-semibold text-white", children: "No one can act here" })
1436
+ H && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-red-600 px-2 py-0.5 text-[10.5px] font-semibold text-white", children: "No one can act here" })
1436
1437
  ] }) })
1437
1438
  ]
1438
1439
  },
@@ -1442,59 +1443,59 @@ function or({
1442
1443
  ] })
1443
1444
  ] });
1444
1445
  }
1445
- function Ir({
1446
+ function Hr({
1446
1447
  collection: t,
1447
1448
  item: e,
1448
1449
  defaultExpanded: r,
1449
- title: a,
1450
+ title: s,
1450
1451
  showApprovalChain: l,
1451
1452
  hideActionsCollapsed: c,
1452
- hideActionsExpanded: u,
1453
- onBeforeTransition: h,
1453
+ hideActionsExpanded: p,
1454
+ onBeforeTransition: b,
1454
1455
  addendumPending: f,
1455
- addendumView: N,
1456
+ addendumView: _,
1456
1457
  asRole: v
1457
1458
  }) {
1458
1459
  return e === "new" ? null : /* @__PURE__ */ n(
1459
- dr,
1460
+ pr,
1460
1461
  {
1461
1462
  collection: t,
1462
1463
  item: e,
1463
1464
  defaultExpanded: r,
1464
- title: a,
1465
+ title: s,
1465
1466
  showApprovalChain: l,
1466
1467
  hideActionsCollapsed: c,
1467
- hideActionsExpanded: u,
1468
- onBeforeTransition: h,
1468
+ hideActionsExpanded: p,
1469
+ onBeforeTransition: b,
1469
1470
  addendumPending: f,
1470
- addendumView: N,
1471
+ addendumView: _,
1471
1472
  asRole: v
1472
1473
  },
1473
1474
  `${t}:${e}`
1474
1475
  );
1475
1476
  }
1476
- function pn({
1477
+ function gn({
1477
1478
  collection: t,
1478
1479
  item: e,
1479
1480
  omitLines: r
1480
1481
  }) {
1481
- const a = ge(), { data: l } = oe({
1482
- queryKey: Yt(t, e),
1483
- queryFn: () => Jt(a, t, e),
1482
+ const s = we(), { data: l } = oe({
1483
+ queryKey: tn(t, e),
1484
+ queryFn: () => nn(s, t, e),
1484
1485
  staleTime: 3e4,
1485
1486
  retry: !1
1486
1487
  });
1487
1488
  if (!l) return null;
1488
- const c = l.changed_by_people ?? l.changed_total, u = new Set((r ?? []).map(Ct)), h = (l.lines ?? []).filter((f) => !u.has(Ct(f)));
1489
+ const c = l.changed_by_people ?? l.changed_total, p = new Set((r ?? []).map(Mt)), b = (l.lines ?? []).filter((f) => !p.has(Mt(f)));
1489
1490
  return /* @__PURE__ */ i("div", { className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[11.5px] dark:border-border dark:bg-card", children: [
1490
1491
  /* @__PURE__ */ i("p", { className: "text-slate-500 dark:text-muted-foreground", children: [
1491
1492
  /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
1492
1493
  " ",
1493
1494
  "(",
1494
- Yn(l.days_in_state),
1495
+ tr(l.days_in_state),
1495
1496
  "):",
1496
1497
  " ",
1497
- l.changed_total === 0 && l.comments === 0 && l.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(he, { 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: [
1498
1499
  c > 0 && /* @__PURE__ */ i("span", { children: [
1499
1500
  c,
1500
1501
  " field",
@@ -1520,23 +1521,23 @@ function pn({
1520
1521
  ] }),
1521
1522
  l.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
1522
1523
  l.field_changes.slice(0, 5).map((f) => {
1523
- const N = Jn(f.old, f.new);
1524
+ const _ = nr(f.old, f.new);
1524
1525
  return /* @__PURE__ */ i(
1525
1526
  "p",
1526
1527
  {
1527
1528
  "data-brief-change": f.field,
1528
1529
  className: "text-[11px] text-slate-500 dark:text-muted-foreground",
1529
1530
  children: [
1530
- /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: f.label || Mn(f.field) }),
1531
+ /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: f.label || Fn(f.field) }),
1531
1532
  f.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
1532
1533
  ":",
1533
1534
  " ",
1534
- N.old !== null && /* @__PURE__ */ i(he, { children: [
1535
- /* @__PURE__ */ n("span", { className: "text-red-600 line-through dark:text-red-400", children: N.old }),
1535
+ _.old !== null && /* @__PURE__ */ i(xe, { children: [
1536
+ /* @__PURE__ */ n("span", { className: "text-red-600 line-through dark:text-red-400", children: _.old }),
1536
1537
  /* @__PURE__ */ n("span", { "aria-hidden": "true", children: " → " }),
1537
1538
  /* @__PURE__ */ n("span", { className: "sr-only", children: " changed to " })
1538
1539
  ] }),
1539
- /* @__PURE__ */ n("span", { className: "text-emerald-700 dark:text-emerald-400", children: N.new })
1540
+ /* @__PURE__ */ n("span", { className: "text-emerald-700 dark:text-emerald-400", children: _.new })
1540
1541
  ]
1541
1542
  },
1542
1543
  f.field
@@ -1548,7 +1549,7 @@ function pn({
1548
1549
  " more — see History for the full trail"
1549
1550
  ] })
1550
1551
  ] }),
1551
- h.map((f) => /* @__PURE__ */ i(
1552
+ b.map((f) => /* @__PURE__ */ i(
1552
1553
  "p",
1553
1554
  {
1554
1555
  "data-brief-line": f.label,
@@ -1569,86 +1570,101 @@ function pn({
1569
1570
  ))
1570
1571
  ] });
1571
1572
  }
1572
- function dr({
1573
+ function pr({
1573
1574
  collection: t,
1574
1575
  item: e,
1575
1576
  defaultExpanded: r,
1576
- title: a,
1577
+ title: s,
1577
1578
  showApprovalChain: l,
1578
1579
  hideActionsCollapsed: c,
1579
- hideActionsExpanded: u,
1580
- onBeforeTransition: h,
1580
+ hideActionsExpanded: p,
1581
+ onBeforeTransition: b,
1581
1582
  addendumPending: f,
1582
- addendumView: N,
1583
+ addendumView: _,
1583
1584
  asRole: v
1584
1585
  }) {
1585
- var ft, ht, bt;
1586
- const x = ge(), q = Re(), { isAdmin: A } = Ot(), [U, E] = K(""), [j, B] = K(null), [M, L] = K(!1), [I, m] = K(!1), [g, k] = K(null), [R, d] = K(null), [Q, Z] = K([]), y = Zt(t, String(e));
1587
- Bt(t, e, "transition", !!j || !!g);
1588
- const _ = Cn(t, e, "transition"), H = se(!1);
1586
+ var gt, xt, yt;
1587
+ const y = we(), $ = De(), { isAdmin: A } = Bt(), [E, B] = I(0), H = ne(null);
1589
1588
  fe(() => {
1590
- !H.current && r !== void 0 && (H.current = !0, m(r));
1589
+ if (!A) return;
1590
+ const u = (S) => {
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(
1593
+ () => {
1594
+ var W;
1595
+ return (W = H.current) == null ? void 0 : W.scrollIntoView({ block: "center", behavior: "smooth" });
1596
+ },
1597
+ 80
1598
+ ));
1599
+ };
1600
+ return window.addEventListener(Nt, u), () => window.removeEventListener(Nt, u);
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 = Mn(t, e, "transition"), re = ne(!1);
1605
+ fe(() => {
1606
+ !re.current && r !== void 0 && (re.current = !0, q(r));
1591
1607
  }, [r]);
1592
- const W = se(!1), G = (p) => {
1593
- W.current || (W.current = !0, d(null), S.mutate(p, {
1594
- onSettled: (C, O) => {
1595
- if (O) {
1596
- W.current = !1;
1608
+ const z = ne(!1), C = (u) => {
1609
+ z.current || (z.current = !0, g(null), j.mutate(u, {
1610
+ onSettled: (S, F) => {
1611
+ if (F) {
1612
+ z.current = !1;
1597
1613
  return;
1598
1614
  }
1599
- pe().finally(() => {
1600
- W.current = !1;
1615
+ be().finally(() => {
1616
+ z.current = !1;
1601
1617
  });
1602
1618
  }
1603
1619
  }));
1604
- }, ee = async (p) => {
1605
- var te, le;
1606
- if (W.current) return;
1607
- if (j === p) {
1608
- B(null);
1620
+ }, de = async (u) => {
1621
+ var Z, le;
1622
+ if (z.current) return;
1623
+ if (P === u) {
1624
+ L(null);
1609
1625
  return;
1610
1626
  }
1611
- if (h) {
1612
- W.current = !0;
1613
- let ne = !1;
1627
+ if (b) {
1628
+ z.current = !0;
1629
+ let te = !1;
1614
1630
  try {
1615
- ne = await h();
1631
+ te = await b();
1616
1632
  } finally {
1617
- W.current = !1;
1633
+ z.current = !1;
1618
1634
  }
1619
- if (!ne) return;
1635
+ if (!te) return;
1620
1636
  }
1621
- const C = (re ?? []).find((ne) => ne.id === p), O = String((C == null ? void 0 : C.comment_mode) ?? "none"), Y = tn(C, (o == null ? void 0 : o.states) ?? [], (te = o == null ? void 0 : o.instance) == null ? void 0 : te.current_state);
1622
- if (O !== "optional" && O !== "required") {
1623
- if (C && !Fe(C, (o == null ? void 0 : o.states) ?? [], (le = o == null ? void 0 : o.instance) == null ? void 0 : le.current_state)) {
1624
- W.current = !0;
1625
- let ne = [];
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") {
1639
+ if (S && !Oe(S, (d == null ? void 0 : d.states) ?? [], (le = d == null ? void 0 : d.instance) == null ? void 0 : le.current_state)) {
1640
+ z.current = !0;
1641
+ let te = [];
1626
1642
  try {
1627
- ne = await y();
1643
+ te = await se();
1628
1644
  } finally {
1629
- W.current = !1;
1645
+ z.current = !1;
1630
1646
  }
1631
- if (ne.length > 0 || Y) {
1632
- Z(ne), B(p);
1647
+ if (te.length > 0 || W) {
1648
+ G(te), L(u);
1633
1649
  return;
1634
1650
  }
1635
1651
  }
1636
- if (Y) {
1637
- Z([]), B(p);
1652
+ if (W) {
1653
+ G([]), L(u);
1638
1654
  return;
1639
1655
  }
1640
- G({ transition_id: p });
1656
+ C({ transition_id: u });
1641
1657
  return;
1642
1658
  }
1643
- Z([]), B(p);
1644
- }, V = v ? ["pipeline-instance", t, e, v] : ["pipeline-instance", t, e], { settling: $, settle: pe } = Vt(V), { data: o, isLoading: xe } = oe({
1645
- queryKey: V,
1646
- queryFn: () => x.request(
1647
- ue(
1659
+ G([]), L(u);
1660
+ }, J = v ? ["pipeline-instance", t, e, v] : ["pipeline-instance", t, e], { settling: he, settle: be } = Zt(J), { data: d, isLoading: _e } = oe({
1661
+ queryKey: J,
1662
+ queryFn: () => y.request(
1663
+ ce(
1648
1664
  `/pipelines/instance/${t}/${e}${v ? `?as_role=${encodeURIComponent(v)}` : ""}`
1649
1665
  )
1650
1666
  ).then(
1651
- (p) => p.data ?? {
1667
+ (u) => u.data ?? {
1652
1668
  instance: null,
1653
1669
  states: [],
1654
1670
  available_transitions: [],
@@ -1658,249 +1674,249 @@ function dr({
1658
1674
  }
1659
1675
  ),
1660
1676
  staleTime: 1e4
1661
- }), ce = Xt(
1662
- o ? (o.available_transitions ?? []).map((p) => String(p.id)) : null,
1677
+ }), a = en(
1678
+ d ? (d.available_transitions ?? []).map((u) => String(u.id)) : null,
1663
1679
  `${t}:${e}`
1664
1680
  );
1665
1681
  fe(
1666
- () => q.getQueryCache().subscribe((p) => {
1667
- if (p.type !== "updated" || p.action.type !== "success") return;
1668
- const C = p.query.queryKey;
1669
- Array.isArray(C) && C[0] === "item" && C[1] === t && String(C[2]) === e && q.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
1682
+ () => $.getQueryCache().subscribe((u) => {
1683
+ if (u.type !== "updated" || u.action.type !== "success") return;
1684
+ const S = u.query.queryKey;
1685
+ Array.isArray(S) && S[0] === "item" && S[1] === t && String(S[2]) === e && $.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
1670
1686
  }),
1671
- [q, t, e]
1687
+ [$, t, e]
1672
1688
  );
1673
- const { data: de, isLoading: ke } = oe({
1689
+ const { data: m, isLoading: N } = oe({
1674
1690
  queryKey: ["pipeline-all-owners", t, e],
1675
- queryFn: () => x.request(
1676
- ue(`/pipelines/instance/${t}/${e}/owners/all`)
1677
- ).then((p) => p.data ?? null),
1691
+ queryFn: () => y.request(
1692
+ ce(`/pipelines/instance/${t}/${e}/owners/all`)
1693
+ ).then((u) => u.data ?? null),
1678
1694
  // Also when a send back is on offer: its target may be a chain step this record skipped.
1679
1695
  // And while a move is being confirmed: the panel names where it really lands.
1680
- enabled: (I || an(o) || !!j) && !!(o != null && o.instance),
1696
+ enabled: (w || dn(d) || !!P) && !!(d != null && d.instance),
1681
1697
  staleTime: 3e4
1682
- }), s = Le(() => {
1683
- if (!de) return null;
1684
- const p = Object.entries(de);
1685
- return p.length === 0 || p.every(([, C]) => C.on_path === void 0) ? null : new Set(p.filter(([, C]) => C.on_path !== !1).map(([C]) => C));
1686
- }, [de]), b = Le(() => {
1687
- if (!de) return null;
1688
- const p = /* @__PURE__ */ new Map();
1689
- for (const [C, O] of Object.entries(de))
1690
- O.skipped && p.set(C, O.skip_reasons ?? []);
1691
- return p;
1692
- }, [de]), w = Me({
1693
- mutationFn: () => x.request(Ce(`/pipelines/instance/${t}/${e}/start`, {})),
1698
+ }), D = Ie(() => {
1699
+ if (!m) return null;
1700
+ const u = Object.entries(m);
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));
1702
+ }, [m]), M = Ie(() => {
1703
+ if (!m) return null;
1704
+ const u = /* @__PURE__ */ new Map();
1705
+ for (const [S, F] of Object.entries(m))
1706
+ F.skipped && u.set(S, F.skip_reasons ?? []);
1707
+ return u;
1708
+ }, [m]), R = Pe({
1709
+ mutationFn: () => y.request(Te(`/pipelines/instance/${t}/${e}/start`, {})),
1694
1710
  onSuccess: () => {
1695
- q.invalidateQueries({ queryKey: V }), J.success("Pipeline started");
1711
+ $.invalidateQueries({ queryKey: J }), Y.success("Pipeline started");
1696
1712
  },
1697
- onError: () => J.error("Failed to start pipeline")
1698
- }), S = Me({
1713
+ onError: () => Y.error("Failed to start pipeline")
1714
+ }), j = Pe({
1699
1715
  mutationFn: ({
1700
- transition_id: p,
1701
- comment: C,
1702
- reviewed: O,
1703
- lock_ack: Y
1704
- }) => x.request(
1705
- Ce(`/pipelines/instance/${t}/${e}/transition`, {
1706
- transition_id: p,
1707
- comment: C,
1708
- ...O ? { reviewed: !0 } : {},
1709
- ...Y ? { lock_ack: !0 } : {}
1716
+ transition_id: u,
1717
+ comment: S,
1718
+ reviewed: F,
1719
+ lock_ack: W
1720
+ }) => y.request(
1721
+ Te(`/pipelines/instance/${t}/${e}/transition`, {
1722
+ transition_id: u,
1723
+ comment: S,
1724
+ ...F ? { reviewed: !0 } : {},
1725
+ ...W ? { lock_ack: !0 } : {}
1710
1726
  })
1711
1727
  ),
1712
- onMutate: (p) => {
1713
- var C;
1728
+ onMutate: (u) => {
1729
+ var S;
1714
1730
  return {
1715
- slow: on(
1716
- (C = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
1717
- (O) => O.id === p.transition_id
1718
- )) == null ? void 0 : C.label
1731
+ slow: mn(
1732
+ (S = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
1733
+ (F) => F.id === u.transition_id
1734
+ )) == null ? void 0 : S.label
1719
1735
  )
1720
1736
  };
1721
1737
  },
1722
- onSuccess: (p, C, O) => {
1723
- q.invalidateQueries({ queryKey: V }), t === "nivaro_addendums" && q.invalidateQueries({ queryKey: ["addendums"] }), je(q, t, String(e)), De(q, t, String(e)), dn(q, t, String(e)), d(null), E(""), B(null), k(null), J.success(ln(o, C.transition_id, p), O == null ? void 0 : O.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)), pn($, t, String(e)), g(null), T(""), L(null), Q(null), Y.success(un(d, S.transition_id, u), F == null ? void 0 : F.slow.done());
1724
1740
  },
1725
- onError: (p, C, O) => {
1726
- var ne;
1727
- if (O == null || O.slow.fail(), Qt(p)) {
1728
- q.invalidateQueries({ queryKey: V });
1741
+ onError: (u, S, F) => {
1742
+ var te;
1743
+ if (F == null || F.slow.fail(), Gt(u)) {
1744
+ $.invalidateQueries({ queryKey: J });
1729
1745
  return;
1730
1746
  }
1731
- const Y = Ht(p);
1732
- if (Y) {
1733
- B(null);
1734
- const ye = ((ne = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
1735
- (Oe) => Oe.id === C.transition_id
1736
- )) == null ? void 0 : ne.label) ?? "Move";
1737
- J.warning(Y.message, {
1747
+ const W = Yt(u);
1748
+ if (W) {
1749
+ L(null);
1750
+ const ve = ((te = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
1751
+ (Le) => Le.id === S.transition_id
1752
+ )) == null ? void 0 : te.label) ?? "Move";
1753
+ Y.warning(W.message, {
1738
1754
  id: `nvr-locked-move:${t}:${String(e)}`,
1739
1755
  duration: 2e4,
1740
1756
  action: {
1741
- label: `${ye} anyway`,
1742
- onClick: () => G({ ...C, lock_ack: !0 })
1757
+ label: `${ve} anyway`,
1758
+ onClick: () => C({ ...S, lock_ack: !0 })
1743
1759
  },
1744
1760
  cancel: { label: "Wait", onClick: () => {
1745
1761
  } }
1746
1762
  });
1747
1763
  return;
1748
1764
  }
1749
- const te = Wt(p);
1750
- if (te) {
1751
- k((ye) => ({
1752
- payload: te,
1753
- transitionId: C.transition_id,
1754
- comment: C.comment,
1755
- revision: ((ye == null ? void 0 : ye.revision) ?? 0) + 1
1765
+ const Z = Vt(u);
1766
+ if (Z) {
1767
+ Q((ve) => ({
1768
+ payload: Z,
1769
+ transitionId: S.transition_id,
1770
+ comment: S.comment,
1771
+ revision: ((ve == null ? void 0 : ve.revision) ?? 0) + 1
1756
1772
  }));
1757
1773
  return;
1758
1774
  }
1759
- const le = p == null ? void 0 : p.response;
1760
- d(Gt(p, C)), J.error(Pe(p, "Failed to execute transition"), {
1775
+ const le = u == null ? void 0 : u.response;
1776
+ g(Jt(u, S)), Y.error(Fe(u, "Failed to execute transition"), {
1761
1777
  duration: 12e3,
1762
1778
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
1763
- ...Ut(p, { action: "Transition" }),
1779
+ ...jt(u, { action: "Transition" }),
1764
1780
  // #1867: a refusal carries "Why?" — the role, owner or access rule
1765
1781
  // that stopped it, and who can change it.
1766
- ...jt(p) ? {
1767
- action: It(x, {
1782
+ ...Wt(u) ? {
1783
+ action: zt(y, {
1768
1784
  collection: t,
1769
1785
  itemId: String(e),
1770
1786
  action: "transition",
1771
- transitionId: C.transition_id
1787
+ transitionId: S.transition_id
1772
1788
  })
1773
1789
  } : {}
1774
- }), k(null), B(null), je(q, t, String(e)), De(q, t, String(e)), (le == null ? void 0 : le.status) === 409 && q.invalidateQueries({ queryKey: V });
1790
+ }), Q(null), L(null), Qe($, t, String(e)), Ae($, t, String(e)), (le == null ? void 0 : le.status) === 409 && $.invalidateQueries({ queryKey: J });
1775
1791
  }
1776
- }), P = se(ee);
1777
- P.current = ee;
1778
- const D = se((o == null ? void 0 : o.available_transitions) ?? []);
1779
- if (D.current = (o == null ? void 0 : o.available_transitions) ?? [], fe(() => {
1780
- const p = (C) => {
1781
- const O = C.detail;
1782
- if (!O || O.claimed || O.collection !== t || String(O.item) !== String(e)) return;
1783
- O.claimed = !0;
1784
- const Y = String(O.transition_id).toUpperCase(), te = D.current.find((le) => String(le.id).toUpperCase() === Y);
1785
- if (!te) {
1786
- J.error("That step is not available from where the record is now");
1792
+ }), ue = ne(de);
1793
+ ue.current = de;
1794
+ const U = ne((d == null ? void 0 : d.available_transitions) ?? []);
1795
+ if (U.current = (d == null ? void 0 : d.available_transitions) ?? [], fe(() => {
1796
+ const u = (S) => {
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);
1801
+ if (!Z) {
1802
+ Y.error("That step is not available from where the record is now");
1787
1803
  return;
1788
1804
  }
1789
- P.current(te.id);
1805
+ ue.current(Z.id);
1790
1806
  };
1791
- return window.addEventListener(Ee, p), () => window.removeEventListener(Ee, p);
1792
- }, [t, e]), xe)
1807
+ return window.addEventListener(Ke, u), () => window.removeEventListener(Ke, u);
1808
+ }, [t, e]), _e)
1793
1809
  return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ i("div", { className: "flex w-full items-center gap-2.5 px-5 py-3.5", children: [
1794
- /* @__PURE__ */ n(we, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
1795
- /* @__PURE__ */ n(we, { className: "h-4 w-20" }),
1796
- /* @__PURE__ */ n(we, { className: "h-[22px] w-40 rounded-full" }),
1797
- /* @__PURE__ */ n(we, { className: "ml-auto h-3.5 w-3.5 rounded" })
1810
+ /* @__PURE__ */ n(ke, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
1811
+ /* @__PURE__ */ n(ke, { className: "h-4 w-20" }),
1812
+ /* @__PURE__ */ n(ke, { className: "h-[22px] w-40 rounded-full" }),
1813
+ /* @__PURE__ */ n(ke, { className: "ml-auto h-3.5 w-3.5 rounded" })
1798
1814
  ] }) });
1799
- if (!(o != null && o.binding)) return null;
1800
- const { instance: T, available_transitions: re, history: F, states: X } = o, Ne = new Map((X ?? []).map((p) => [p.id, p])), _e = (T == null ? void 0 : T.current_state_obj) ?? null, ie = j ? (re ?? []).find((p) => p.id === j) : null, fn = ie ? Ne.get(ie.to_state) : null, Ae = un(ie, _e, X, de), Ke = (Ae == null ? void 0 : Ae.state) ?? fn, hn = T != null && T.completed_at && re ? re.filter(
1801
- (p) => p.from_state && String(p.from_state).toUpperCase() === String(T.current_state).toUpperCase()
1802
- ) : null, Qe = T != null && T.completed_at ? hn ?? [] : sn(
1803
- re ?? [],
1804
- X ?? [],
1805
- T == null ? void 0 : T.current_state,
1806
- b
1807
- ), ct = Qe.length > 0, ut = (p, C = !1) => {
1808
- const O = /* @__PURE__ */ new Map();
1809
- for (const Y of p) {
1810
- const te = O.get(Y.label) ?? [];
1811
- te.push(Y), O.set(Y.label, te);
1815
+ if (!(d != null && d.binding)) return null;
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, xn = ie ? Ue.get(ie.to_state) : null, Ee = hn(ie, Ce, pe, m), ze = (Ee == null ? void 0 : Ee.state) ?? xn, yn = O != null && O.completed_at && ge ? ge.filter(
1817
+ (u) => u.from_state && String(u.from_state).toUpperCase() === String(O.current_state).toUpperCase()
1818
+ ) : null, He = O != null && O.completed_at ? yn ?? [] : cn(
1819
+ ge ?? [],
1820
+ pe ?? [],
1821
+ O == null ? void 0 : O.current_state,
1822
+ M
1823
+ ), pt = He.length > 0, ft = (u, S = !1) => {
1824
+ const F = /* @__PURE__ */ new Map();
1825
+ for (const W of u) {
1826
+ const Z = F.get(W.label) ?? [];
1827
+ Z.push(W), F.set(W.label, Z);
1812
1828
  }
1813
- return Array.from(O.entries()).map(([Y, te]) => {
1814
- var Oe, gt;
1815
- const le = ((Oe = te[0]) == null ? void 0 : Oe.color) ?? null, ne = te.some((z) => z.id === j), ye = (z) => le ? z ? { backgroundColor: le, borderColor: le } : { borderColor: le, color: le } : void 0;
1816
- if (te.length === 1) {
1817
- const z = te[0], $e = S.isPending && ((gt = S.variables) == null ? void 0 : gt.transition_id) === z.id;
1829
+ return Array.from(F.entries()).map(([W, Z]) => {
1830
+ var Le, wt;
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;
1832
+ if (Z.length === 1) {
1833
+ const V = Z[0], qe = j.isPending && ((wt = j.variables) == null ? void 0 : wt.transition_id) === V.id;
1818
1834
  return /* @__PURE__ */ i(
1819
1835
  ae,
1820
1836
  {
1821
1837
  size: "sm",
1822
- variant: ne ? "default" : "outline",
1823
- className: `${C ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5 data-[fresh=true]:opacity-60`,
1824
- style: ye(ne),
1825
- disabled: S.isPending || $,
1826
- "aria-disabled": ce.dimmed(z.id) || void 0,
1827
- "data-fresh": ce.dimmed(z.id) || void 0,
1828
- ...ce.bind(z.id),
1838
+ variant: te ? "default" : "outline",
1839
+ className: `${S ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5 data-[fresh=true]:opacity-60`,
1840
+ style: ve(te),
1841
+ disabled: j.isPending || he,
1842
+ "aria-disabled": a.dimmed(V.id) || void 0,
1843
+ "data-fresh": a.dimmed(V.id) || void 0,
1844
+ ...a.bind(V.id),
1829
1845
  onClick: () => {
1830
- ce.press(z.id) && ee(z.id);
1846
+ a.press(V.id) && de(V.id);
1831
1847
  },
1832
1848
  children: [
1833
- $e && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
1834
- Y
1849
+ qe && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
1850
+ W
1835
1851
  ]
1836
1852
  },
1837
- Y
1853
+ W
1838
1854
  );
1839
1855
  }
1840
- return /* @__PURE__ */ i(Xe, { children: [
1841
- /* @__PURE__ */ n(Ye, { asChild: !0, children: /* @__PURE__ */ i(
1856
+ return /* @__PURE__ */ i(Ze, { children: [
1857
+ /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i(
1842
1858
  ae,
1843
1859
  {
1844
1860
  size: "sm",
1845
- variant: ne ? "default" : "outline",
1846
- className: `${C ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1847
- style: ye(ne),
1848
- disabled: S.isPending || $,
1861
+ variant: te ? "default" : "outline",
1862
+ className: `${S ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1863
+ style: ve(te),
1864
+ disabled: j.isPending || he,
1849
1865
  children: [
1850
- Y,
1851
- /* @__PURE__ */ n(Se, { className: "h-3 w-3" })
1866
+ W,
1867
+ /* @__PURE__ */ n($e, { className: "h-3 w-3" })
1852
1868
  ]
1853
1869
  }
1854
1870
  ) }),
1855
- /* @__PURE__ */ n(Je, { align: "start", children: [...te].sort(
1856
- (z, $e) => {
1857
- var xt, yt;
1858
- return (((xt = Ne.get(z.to_state)) == null ? void 0 : xt.sort) ?? 999) - (((yt = Ne.get($e.to_state)) == null ? void 0 : yt.sort) ?? 999);
1871
+ /* @__PURE__ */ n(tt, { align: "start", children: [...Z].sort(
1872
+ (V, qe) => {
1873
+ var vt, kt;
1874
+ return (((vt = Ue.get(V.to_state)) == null ? void 0 : vt.sort) ?? 999) - (((kt = Ue.get(qe.to_state)) == null ? void 0 : kt.sort) ?? 999);
1859
1875
  }
1860
- ).map((z) => {
1861
- var $e;
1862
- return /* @__PURE__ */ i(Ue, { onSelect: () => ee(z.id), children: [
1863
- z.color && /* @__PURE__ */ n(
1876
+ ).map((V) => {
1877
+ var qe;
1878
+ return /* @__PURE__ */ i(Be, { onSelect: () => de(V.id), children: [
1879
+ V.color && /* @__PURE__ */ n(
1864
1880
  "span",
1865
1881
  {
1866
1882
  className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
1867
- style: { backgroundColor: z.color }
1883
+ style: { backgroundColor: V.color }
1868
1884
  }
1869
1885
  ),
1870
- (($e = Ne.get(z.to_state)) == null ? void 0 : $e.label) ?? z.to_state
1871
- ] }, z.id);
1886
+ ((qe = Ue.get(V.to_state)) == null ? void 0 : qe.label) ?? V.to_state
1887
+ ] }, V.id);
1872
1888
  }) })
1873
- ] }, Y);
1889
+ ] }, W);
1874
1890
  });
1875
- }, We = R ? /* @__PURE__ */ n(
1876
- cn,
1891
+ }, Ge = X ? /* @__PURE__ */ n(
1892
+ fn,
1877
1893
  {
1878
1894
  collection: t,
1879
1895
  item: String(e),
1880
- offer: R,
1881
- onDismiss: () => d(null),
1882
- onFixed: () => G({ transition_id: R.transitionId, comment: R.comment })
1896
+ offer: X,
1897
+ onDismiss: () => g(null),
1898
+ onFixed: () => C({ transition_id: X.transitionId, comment: X.comment })
1883
1899
  }
1884
- ) : null, mt = tr(F ?? [], T == null ? void 0 : T.current_state, X ?? []), pt = /* @__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: [
1885
1901
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
1886
1902
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
1887
1903
  ie && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: ie.label }),
1888
- _e && Ke && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
1889
- /* @__PURE__ */ n(ve, { label: _e.label, color: _e.color, small: !0 }),
1890
- /* @__PURE__ */ n(at, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1891
- /* @__PURE__ */ n(ve, { label: Ke.label, color: Ke.color, small: !0 })
1904
+ Ce && ze && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
1905
+ /* @__PURE__ */ n(Ne, { label: Ce.label, color: Ce.color, small: !0 }),
1906
+ /* @__PURE__ */ n(lt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1907
+ /* @__PURE__ */ n(Ne, { label: ze.label, color: ze.color, small: !0 })
1892
1908
  ] })
1893
1909
  ] }),
1894
- /* @__PURE__ */ n(mn, { landing: Ae }),
1895
- /* @__PURE__ */ n(rn, { collection: t, item: String(e), tx: ie }),
1896
- /* @__PURE__ */ n(pn, { collection: t, item: e, omitLines: Q }),
1897
- /* @__PURE__ */ n(en, { lines: Q }),
1910
+ /* @__PURE__ */ n(bn, { landing: Ee }),
1911
+ /* @__PURE__ */ n(on, { collection: t, item: String(e), tx: ie }),
1912
+ /* @__PURE__ */ n(gn, { collection: t, item: e, omitLines: k }),
1913
+ /* @__PURE__ */ n(an, { lines: k }),
1898
1914
  /* @__PURE__ */ n(
1899
1915
  "input",
1900
1916
  {
1901
1917
  type: "text",
1902
- value: U,
1903
- onChange: (p) => E(p.target.value),
1918
+ value: K,
1919
+ onChange: (u) => T(u.target.value),
1904
1920
  placeholder: String((ie == null ? void 0 : ie.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
1905
1921
  className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
1906
1922
  }
@@ -1913,7 +1929,7 @@ function dr({
1913
1929
  size: "sm",
1914
1930
  variant: "ghost",
1915
1931
  className: "h-7 text-[12px]",
1916
- onClick: () => B(null),
1932
+ onClick: () => L(null),
1917
1933
  children: "Cancel"
1918
1934
  }
1919
1935
  ),
@@ -1923,49 +1939,49 @@ function dr({
1923
1939
  type: "button",
1924
1940
  size: "sm",
1925
1941
  className: "h-7 gap-1.5 text-[12px]",
1926
- disabled: S.isPending || String((ie == null ? void 0 : ie.comment_mode) ?? "") === "required" && U.trim() === "",
1927
- onClick: () => G({
1928
- transition_id: j,
1929
- comment: U.trim() || void 0
1942
+ disabled: j.isPending || String((ie == null ? void 0 : ie.comment_mode) ?? "") === "required" && K.trim() === "",
1943
+ onClick: () => C({
1944
+ transition_id: P,
1945
+ comment: K.trim() || void 0
1930
1946
  }),
1931
- children: S.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(he, { children: [
1932
- /* @__PURE__ */ n("span", { children: Q.length > 0 && ie ? `${ie.label} anyway` : "Confirm" }),
1933
- /* @__PURE__ */ n(Ie, { className: "h-3 w-3" })
1947
+ children: j.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(xe, { children: [
1948
+ /* @__PURE__ */ n("span", { children: k.length > 0 && ie ? `${ie.label} anyway` : "Confirm" }),
1949
+ /* @__PURE__ */ n(We, { className: "h-3 w-3" })
1934
1950
  ] })
1935
1951
  }
1936
1952
  )
1937
1953
  ] })
1938
1954
  ] });
1939
- return /* @__PURE__ */ i(he, { children: [
1955
+ return /* @__PURE__ */ i(xe, { children: [
1940
1956
  /* @__PURE__ */ i(
1941
1957
  "div",
1942
1958
  {
1943
- className: `overflow-hidden rounded-xl border bg-white dark:bg-card ${N ? "border-amber-300 dark:border-amber-600/50" : "border-slate-200 dark:border-border"}`,
1959
+ className: `overflow-hidden rounded-xl border bg-white dark:bg-card ${_ ? "border-amber-300 dark:border-amber-600/50" : "border-slate-200 dark:border-border"}`,
1944
1960
  children: [
1945
1961
  /* @__PURE__ */ i(
1946
1962
  "div",
1947
1963
  {
1948
1964
  role: "button",
1949
1965
  tabIndex: 0,
1950
- onClick: () => m((p) => !p),
1951
- onKeyDown: (p) => (p.key === "Enter" || p.key === " ") && m((C) => !C),
1966
+ onClick: () => q((u) => !u),
1967
+ onKeyDown: (u) => (u.key === "Enter" || u.key === " ") && q((S) => !S),
1952
1968
  className: "flex w-full cursor-pointer items-center gap-2.5 px-5 py-3.5 transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
1953
1969
  children: [
1954
- /* @__PURE__ */ n(He, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
1955
- /* @__PURE__ */ n("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: a || "Pipeline" }),
1970
+ /* @__PURE__ */ n(Xe, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
1971
+ /* @__PURE__ */ n("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: s || "Pipeline" }),
1956
1972
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
1957
- N && /* @__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" }),
1958
- _e && /* @__PURE__ */ n(ve, { label: _e.label, color: _e.color }),
1959
- /* @__PURE__ */ n(nn, { flags: o == null ? void 0 : o.flags }),
1960
- (((ft = o == null ? void 0 : o.auto_held) == null ? void 0 : ft.length) ?? 0) > 0 && /* @__PURE__ */ i(
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" }),
1974
+ Ce && /* @__PURE__ */ n(Ne, { label: Ce.label, color: Ce.color }),
1975
+ /* @__PURE__ */ n(ln, { flags: d == null ? void 0 : d.flags }),
1976
+ (((gt = d == null ? void 0 : d.auto_held) == null ? void 0 : gt.length) ?? 0) > 0 && /* @__PURE__ */ i(
1961
1977
  "span",
1962
1978
  {
1963
1979
  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",
1964
- "data-tip": ((o == null ? void 0 : o.auto_held) ?? []).map((p) => `${p.transition_label ?? "Automatic move"}: ${p.error ?? "refused"}`).join(`
1980
+ "data-tip": ((d == null ? void 0 : d.auto_held) ?? []).map((u) => `${u.transition_label ?? "Automatic move"}: ${u.error ?? "refused"}`).join(`
1965
1981
  `),
1966
1982
  "data-pipeline-auto-held-pill": !0,
1967
1983
  children: [
1968
- /* @__PURE__ */ n(xn, { className: "h-3 w-3 shrink-0" }),
1984
+ /* @__PURE__ */ n(kn, { className: "h-3 w-3 shrink-0" }),
1969
1985
  "Needs a person"
1970
1986
  ]
1971
1987
  }
@@ -1974,124 +1990,124 @@ function dr({
1974
1990
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse shrink-0" }),
1975
1991
  "Addendum in review"
1976
1992
  ] }),
1977
- _.length > 0 && /* @__PURE__ */ i(
1993
+ ee.length > 0 && /* @__PURE__ */ i(
1978
1994
  "span",
1979
1995
  {
1980
1996
  className: "flex items-center gap-1 rounded-full border border-sky-200 bg-sky-50 px-2 py-0.5 text-[11px] font-medium text-sky-700 dark:border-sky-500/20 dark:bg-sky-500/10 dark:text-sky-300",
1981
1997
  "data-pipeline-approving": !0,
1982
1998
  children: [
1983
1999
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
1984
- $n(_, "approving")
2000
+ Rn(ee, "approving")
1985
2001
  ]
1986
2002
  }
1987
2003
  )
1988
2004
  ] }),
1989
- /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", onClick: (p) => p.stopPropagation(), children: [
1990
- !I && ct && !c && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: ut(Qe, !0) }),
1991
- !I && !T && (o == null ? void 0 : o.binding) && /* @__PURE__ */ i(
2005
+ /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", onClick: (u) => u.stopPropagation(), children: [
2006
+ !w && pt && !c && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: ft(He, !0) }),
2007
+ !w && !O && (d == null ? void 0 : d.binding) && /* @__PURE__ */ i(
1992
2008
  ae,
1993
2009
  {
1994
2010
  size: "sm",
1995
2011
  variant: "outline",
1996
2012
  className: "h-7 gap-1.5 text-[11px]",
1997
- onClick: (p) => {
1998
- p.stopPropagation(), w.mutate();
2013
+ onClick: (u) => {
2014
+ u.stopPropagation(), R.mutate();
1999
2015
  },
2000
- disabled: w.isPending,
2016
+ disabled: R.isPending,
2001
2017
  children: [
2002
- w.isPending ? /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(He, { className: "h-3 w-3" }),
2018
+ R.isPending ? /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(Xe, { className: "h-3 w-3" }),
2003
2019
  "Start"
2004
2020
  ]
2005
2021
  }
2006
2022
  ),
2007
- l && ((o == null ? void 0 : o.binding) || (o == null ? void 0 : o.instance)) && /* @__PURE__ */ n(
2008
- or,
2023
+ l && ((d == null ? void 0 : d.binding) || (d == null ? void 0 : d.instance)) && /* @__PURE__ */ n(
2024
+ mr,
2009
2025
  {
2010
2026
  collection: t,
2011
2027
  item: e,
2012
- states: X ?? [],
2013
- currentStateId: ((ht = o == null ? void 0 : o.instance) == null ? void 0 : ht.current_state) ?? null
2028
+ states: pe ?? [],
2029
+ currentStateId: ((xt = d == null ? void 0 : d.instance) == null ? void 0 : xt.current_state) ?? null
2014
2030
  }
2015
2031
  )
2016
2032
  ] }),
2017
2033
  /* @__PURE__ */ n(
2018
- Se,
2034
+ $e,
2019
2035
  {
2020
- className: be(
2036
+ className: ye(
2021
2037
  "h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
2022
- I && "rotate-180"
2038
+ w && "rotate-180"
2023
2039
  )
2024
2040
  }
2025
2041
  )
2026
2042
  ]
2027
2043
  }
2028
2044
  ),
2029
- !I && j && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: pt }),
2030
- !I && We && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: We }),
2031
- mt && !(T != null && T.completed_at) && /* @__PURE__ */ n(nr, { entry: mt }),
2032
- I && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
2033
- /* @__PURE__ */ n(zn, { held: (o == null ? void 0 : o.auto_held) ?? [] }),
2045
+ !w && P && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: bt }),
2046
+ !w && Ge && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ge }),
2047
+ ht && !(O != null && O.completed_at) && /* @__PURE__ */ n(ir, { entry: ht }),
2048
+ w && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
2049
+ /* @__PURE__ */ n(Xn, { held: (d == null ? void 0 : d.auto_held) ?? [] }),
2034
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: [
2035
2051
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
2036
2052
  /* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
2037
2053
  ] }),
2038
- T ? /* @__PURE__ */ i("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
2039
- (X ?? []).length > 1 && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2040
- ke ? (
2054
+ O ? /* @__PURE__ */ i("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
2055
+ (pe ?? []).length > 1 && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2056
+ N ? (
2041
2057
  // Path pruning arrives with the owners query — rendering
2042
2058
  // the UNPRUNED track first meant every state briefly
2043
2059
  // showed, then snapped into formation. Hold a same-height
2044
2060
  // placeholder until the real shape is known.
2045
2061
  /* @__PURE__ */ i("div", { className: "flex h-[52px] items-center gap-2", children: [
2046
- [0, 1, 2, 3, 4].map((p) => /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
2047
- /* @__PURE__ */ n(we, { className: "h-7 w-7 rounded-full" }),
2048
- p < 4 && /* @__PURE__ */ n(we, { className: "h-0.5 w-10" })
2049
- ] }, p)),
2050
- /* @__PURE__ */ n(we, { className: "ml-2 h-3 w-24" })
2062
+ [0, 1, 2, 3, 4].map((u) => /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
2063
+ /* @__PURE__ */ n(ke, { className: "h-7 w-7 rounded-full" }),
2064
+ u < 4 && /* @__PURE__ */ n(ke, { className: "h-0.5 w-10" })
2065
+ ] }, u)),
2066
+ /* @__PURE__ */ n(ke, { className: "ml-2 h-3 w-24" })
2051
2067
  ] })
2052
2068
  ) : /* @__PURE__ */ n(
2053
- ar,
2069
+ or,
2054
2070
  {
2055
- states: X,
2056
- allTransitions: (o == null ? void 0 : o.all_transitions) ?? [],
2057
- availableTransitions: re ?? [],
2058
- currentStateId: T.current_state,
2059
- history: F ?? [],
2060
- onPathIds: s,
2061
- skippedStates: b
2071
+ states: pe,
2072
+ allTransitions: (d == null ? void 0 : d.all_transitions) ?? [],
2073
+ availableTransitions: ge ?? [],
2074
+ currentStateId: O.current_state,
2075
+ history: Se ?? [],
2076
+ onPathIds: D,
2077
+ skippedStates: M
2062
2078
  }
2063
2079
  ),
2064
- (o == null ? void 0 : o.branches) && /* @__PURE__ */ n(Ln, { data: o.branches }),
2080
+ (d == null ? void 0 : d.branches) && /* @__PURE__ */ n(Kn, { data: d.branches }),
2065
2081
  /* @__PURE__ */ n(
2066
- rr,
2082
+ lr,
2067
2083
  {
2068
- history: F ?? [],
2069
- completedAt: T.completed_at
2084
+ history: Se ?? [],
2085
+ completedAt: O.completed_at
2070
2086
  }
2071
2087
  )
2072
2088
  ] }),
2073
2089
  /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2074
- !T.completed_at && /* @__PURE__ */ n(Kn, { collection: t, itemId: String(e) }),
2090
+ !O.completed_at && /* @__PURE__ */ n(Hn, { collection: t, itemId: String(e) }),
2075
2091
  /* @__PURE__ */ n(
2076
- lr,
2092
+ ur,
2077
2093
  {
2078
2094
  collection: t,
2079
2095
  item: e,
2080
- states: X ?? [],
2081
- currentStateId: ((bt = o == null ? void 0 : o.instance) == null ? void 0 : bt.current_state) ?? null,
2082
- returned: ((o == null ? void 0 : o.history) ?? []).some(
2083
- (p) => {
2084
- var C;
2085
- return !!p.from_state && p.to_state === ((C = o == null ? void 0 : o.instance) == null ? void 0 : C.current_state);
2096
+ states: pe ?? [],
2097
+ currentStateId: ((yt = d == null ? void 0 : d.instance) == null ? void 0 : yt.current_state) ?? null,
2098
+ returned: ((d == null ? void 0 : d.history) ?? []).some(
2099
+ (u) => {
2100
+ var S;
2101
+ return !!u.from_state && u.to_state === ((S = d == null ? void 0 : d.instance) == null ? void 0 : S.current_state);
2086
2102
  }
2087
2103
  )
2088
2104
  }
2089
2105
  )
2090
2106
  ] }),
2091
- ct && !u && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2092
- /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children: ut(Qe) }),
2093
- j && pt,
2094
- We
2107
+ pt && !p && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2108
+ /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children: ft(He) }),
2109
+ P && bt,
2110
+ Ge
2095
2111
  ] }),
2096
2112
  /* @__PURE__ */ i("div", { className: "px-5 py-3", children: [
2097
2113
  /* @__PURE__ */ i(
@@ -2099,14 +2115,14 @@ function dr({
2099
2115
  {
2100
2116
  type: "button",
2101
2117
  className: "flex items-center gap-1.5 text-[12px] text-slate-400 transition-colors hover:text-slate-600",
2102
- onClick: () => L((p) => !p),
2118
+ onClick: () => x((u) => !u),
2103
2119
  children: [
2104
2120
  /* @__PURE__ */ n(
2105
- Se,
2121
+ $e,
2106
2122
  {
2107
- className: be(
2123
+ className: ye(
2108
2124
  "h-3.5 w-3.5 transition-transform duration-200",
2109
- M && "rotate-180"
2125
+ h && "rotate-180"
2110
2126
  )
2111
2127
  }
2112
2128
  ),
@@ -2114,23 +2130,24 @@ function dr({
2114
2130
  " ",
2115
2131
  /* @__PURE__ */ i("span", { className: "tabular-nums", children: [
2116
2132
  "(",
2117
- (F == null ? void 0 : F.length) ?? 0,
2133
+ (Se == null ? void 0 : Se.length) ?? 0,
2118
2134
  ")"
2119
2135
  ] })
2120
2136
  ]
2121
2137
  }
2122
2138
  ),
2123
- M && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(sr, { history: F ?? [] }) })
2139
+ h && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(dr, { history: Se ?? [] }) })
2124
2140
  ] }),
2125
- A && (X ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", children: /* @__PURE__ */ n(
2126
- In,
2141
+ A && (pe ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", ref: H, children: /* @__PURE__ */ n(
2142
+ zn,
2127
2143
  {
2128
2144
  collection: t,
2129
2145
  item: e,
2130
- states: X ?? [],
2131
- currentStateId: T.current_state ?? null,
2146
+ states: pe ?? [],
2147
+ currentStateId: O.current_state ?? null,
2148
+ openSignal: E,
2132
2149
  onMoved: () => {
2133
- q.invalidateQueries({ queryKey: V }), q.invalidateQueries({
2150
+ $.invalidateQueries({ queryKey: J }), $.invalidateQueries({
2134
2151
  queryKey: ["pipeline-instance", t, e]
2135
2152
  });
2136
2153
  }
@@ -2144,10 +2161,10 @@ function dr({
2144
2161
  size: "sm",
2145
2162
  variant: "outline",
2146
2163
  className: "shrink-0 gap-1.5 text-[12px]",
2147
- onClick: () => w.mutate(),
2148
- disabled: w.isPending,
2164
+ onClick: () => R.mutate(),
2165
+ disabled: R.isPending,
2149
2166
  children: [
2150
- w.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(He, { className: "h-3.5 w-3.5" }),
2167
+ R.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(Xe, { className: "h-3.5 w-3.5" }),
2151
2168
  "Start Pipeline"
2152
2169
  ]
2153
2170
  }
@@ -2157,111 +2174,111 @@ function dr({
2157
2174
  ]
2158
2175
  }
2159
2176
  ),
2160
- g && /* @__PURE__ */ n(Ft, { fallback: null, children: /* @__PURE__ */ n(
2161
- Kt,
2177
+ o && /* @__PURE__ */ n(Et, { fallback: null, children: /* @__PURE__ */ n(
2178
+ Ht,
2162
2179
  {
2163
- payload: g.payload,
2164
- transitionId: g.transitionId,
2165
- isRetry: g.revision > 1,
2180
+ payload: o.payload,
2181
+ transitionId: o.transitionId,
2182
+ isRetry: o.revision > 1,
2166
2183
  onSubmitted: () => (
2167
2184
  // mutateAsync so the dialog can stay busy until the transition
2168
2185
  // settles; the mutation's own onError/onSuccess handle the outcome.
2169
- S.mutateAsync({
2170
- transition_id: g.transitionId,
2171
- comment: g.comment,
2186
+ j.mutateAsync({
2187
+ transition_id: o.transitionId,
2188
+ comment: o.comment,
2172
2189
  reviewed: !0
2173
2190
  }).catch(() => {
2174
2191
  })
2175
2192
  ),
2176
- executing: S.isPending,
2177
- onClose: () => k(null)
2193
+ executing: j.isPending,
2194
+ onClose: () => Q(null)
2178
2195
  },
2179
- g.revision
2196
+ o.revision
2180
2197
  ) })
2181
2198
  ] });
2182
2199
  }
2183
- function Kr({
2200
+ function Gr({
2184
2201
  collection: t,
2185
2202
  item: e,
2186
2203
  onBeforeTransition: r,
2187
- wrap: a = !0
2204
+ wrap: s = !0
2188
2205
  }) {
2189
2206
  return e === "new" ? null : /* @__PURE__ */ n(
2190
- cr,
2207
+ fr,
2191
2208
  {
2192
2209
  collection: t,
2193
2210
  item: e,
2194
2211
  onBeforeTransition: r,
2195
- wrap: a
2212
+ wrap: s
2196
2213
  }
2197
2214
  );
2198
2215
  }
2199
- function cr({
2216
+ function fr({
2200
2217
  collection: t,
2201
2218
  item: e,
2202
2219
  onBeforeTransition: r,
2203
- wrap: a = !0
2220
+ wrap: s = !0
2204
2221
  }) {
2205
- const l = ge(), c = Re(), [u, h] = K(""), [f, N] = K(null), [v, x] = K(null), [q, A] = K(null), [U, E] = K([]), j = Zt(t, String(e));
2206
- Bt(t, e, "transition", !!f || !!v);
2207
- const B = se(null), M = Fn(B, !a), L = se(!1), I = (s) => {
2208
- L.current || (L.current = !0, A(null), _.mutate(s, {
2209
- onSettled: (b, w) => {
2210
- if (w) {
2211
- L.current = !1;
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 = En(K, !s), P = ne(!1), L = (a) => {
2225
+ P.current || (P.current = !0, A(null), k.mutate(a, {
2226
+ onSettled: (m, N) => {
2227
+ if (N) {
2228
+ P.current = !1;
2212
2229
  return;
2213
2230
  }
2214
- R().finally(() => {
2215
- L.current = !1;
2231
+ q().finally(() => {
2232
+ P.current = !1;
2216
2233
  });
2217
2234
  }
2218
2235
  }));
2219
- }, m = async (s) => {
2220
- var P, D;
2221
- if (L.current) return;
2222
- if (f === s) {
2223
- N(null);
2236
+ }, h = async (a) => {
2237
+ var M, R;
2238
+ if (P.current) return;
2239
+ if (f === a) {
2240
+ _(null);
2224
2241
  return;
2225
2242
  }
2226
2243
  if (r) {
2227
- L.current = !0;
2228
- let T = !1;
2244
+ P.current = !0;
2245
+ let j = !1;
2229
2246
  try {
2230
- T = await r();
2247
+ j = await r();
2231
2248
  } finally {
2232
- L.current = !1;
2249
+ P.current = !1;
2233
2250
  }
2234
- if (!T) return;
2251
+ if (!j) return;
2235
2252
  }
2236
- const b = (G ?? []).find((T) => T.id === s), w = String((b == null ? void 0 : b.comment_mode) ?? "none"), S = tn(b, (d == null ? void 0 : d.states) ?? [], (P = d == null ? void 0 : d.instance) == null ? void 0 : P.current_state);
2237
- if (w !== "optional" && w !== "required") {
2238
- if (b && !Fe(b, (d == null ? void 0 : d.states) ?? [], (D = d == null ? void 0 : d.instance) == null ? void 0 : D.current_state)) {
2239
- L.current = !0;
2240
- let T = [];
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);
2254
+ if (N !== "optional" && N !== "required") {
2255
+ if (m && !Oe(m, (o == null ? void 0 : o.states) ?? [], (R = o == null ? void 0 : o.instance) == null ? void 0 : R.current_state)) {
2256
+ P.current = !0;
2257
+ let j = [];
2241
2258
  try {
2242
- T = await j();
2259
+ j = await H();
2243
2260
  } finally {
2244
- L.current = !1;
2261
+ P.current = !1;
2245
2262
  }
2246
- if (T.length > 0 || S) {
2247
- E(T), N(s);
2263
+ if (j.length > 0 || D) {
2264
+ B(j), _(a);
2248
2265
  return;
2249
2266
  }
2250
2267
  }
2251
- if (S) {
2252
- E([]), N(s);
2268
+ if (D) {
2269
+ B([]), _(a);
2253
2270
  return;
2254
2271
  }
2255
- I({ transition_id: s });
2272
+ L({ transition_id: a });
2256
2273
  return;
2257
2274
  }
2258
- E([]), N(s);
2259
- }, g = ["pipeline-instance", t, e], { settling: k, settle: R } = Vt(g), { data: d } = oe({
2260
- queryKey: g,
2275
+ B([]), _(a);
2276
+ }, x = ["pipeline-instance", t, e], { settling: w, settle: q } = Zt(x), { data: o } = oe({
2277
+ queryKey: x,
2261
2278
  queryFn: () => l.request(
2262
- ue(`/pipelines/instance/${t}/${e}`)
2279
+ ce(`/pipelines/instance/${t}/${e}`)
2263
2280
  ).then(
2264
- (s) => s.data ?? {
2281
+ (a) => a.data ?? {
2265
2282
  instance: null,
2266
2283
  states: [],
2267
2284
  available_transitions: [],
@@ -2271,269 +2288,269 @@ function cr({
2271
2288
  }
2272
2289
  ),
2273
2290
  staleTime: 1e4
2274
- }), Q = Xt(
2275
- d ? (d.available_transitions ?? []).map((s) => String(s.id)) : null,
2291
+ }), Q = en(
2292
+ o ? (o.available_transitions ?? []).map((a) => String(a.id)) : null,
2276
2293
  `${t}:${e}`
2277
- ), { data: Z } = oe({
2294
+ ), { data: X } = oe({
2278
2295
  queryKey: ["pipeline-all-owners", t, e],
2279
2296
  queryFn: () => l.request(
2280
- ue(`/pipelines/instance/${t}/${e}/owners/all`)
2281
- ).then((s) => s.data ?? null),
2297
+ ce(`/pipelines/instance/${t}/${e}/owners/all`)
2298
+ ).then((a) => a.data ?? null),
2282
2299
  // Also while a move is being confirmed: the panel names where it really lands.
2283
- enabled: an(d) || !!f,
2300
+ enabled: dn(o) || !!f,
2284
2301
  staleTime: 3e4
2285
- }), y = Le(() => {
2286
- if (!Z) return null;
2287
- const s = /* @__PURE__ */ new Map();
2288
- for (const [b, w] of Object.entries(Z))
2289
- w.skipped && s.set(b, w.skip_reasons ?? []);
2290
- return s;
2291
- }, [Z]), _ = Me({
2302
+ }), g = Ie(() => {
2303
+ if (!X) return null;
2304
+ const a = /* @__PURE__ */ new Map();
2305
+ for (const [m, N] of Object.entries(X))
2306
+ N.skipped && a.set(m, N.skip_reasons ?? []);
2307
+ return a;
2308
+ }, [X]), k = Pe({
2292
2309
  mutationFn: ({
2293
- transition_id: s,
2294
- comment: b,
2295
- reviewed: w,
2296
- lock_ack: S
2310
+ transition_id: a,
2311
+ comment: m,
2312
+ reviewed: N,
2313
+ lock_ack: D
2297
2314
  }) => l.request(
2298
- Ce(`/pipelines/instance/${t}/${e}/transition`, {
2299
- transition_id: s,
2300
- comment: b,
2301
- ...w ? { reviewed: !0 } : {},
2302
- ...S ? { lock_ack: !0 } : {}
2315
+ Te(`/pipelines/instance/${t}/${e}/transition`, {
2316
+ transition_id: a,
2317
+ comment: m,
2318
+ ...N ? { reviewed: !0 } : {},
2319
+ ...D ? { lock_ack: !0 } : {}
2303
2320
  })
2304
2321
  ),
2305
- onMutate: (s) => {
2306
- var b;
2322
+ onMutate: (a) => {
2323
+ var m;
2307
2324
  return {
2308
- slow: on(
2309
- (b = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
2310
- (w) => w.id === s.transition_id
2311
- )) == null ? void 0 : b.label
2325
+ slow: mn(
2326
+ (m = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
2327
+ (N) => N.id === a.transition_id
2328
+ )) == null ? void 0 : m.label
2312
2329
  )
2313
2330
  };
2314
2331
  },
2315
- onSuccess: (s, b, w) => {
2316
- c.invalidateQueries({ queryKey: g }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), je(c, t, String(e)), De(c, t, String(e)), dn(c, t, String(e)), A(null), h(""), N(null), x(null), J.success(ln(d, b.transition_id, s), w == null ? void 0 : w.slow.done());
2332
+ onSuccess: (a, m, N) => {
2333
+ c.invalidateQueries({ queryKey: x }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Qe(c, t, String(e)), Ae(c, t, String(e)), pn(c, t, String(e)), A(null), b(""), _(null), y(null), Y.success(un(o, m.transition_id, a), N == null ? void 0 : N.slow.done());
2317
2334
  },
2318
- onError: (s, b, w) => {
2319
- var T;
2320
- if (w == null || w.slow.fail(), Qt(s)) {
2321
- c.invalidateQueries({ queryKey: g });
2335
+ onError: (a, m, N) => {
2336
+ var j;
2337
+ if (N == null || N.slow.fail(), Gt(a)) {
2338
+ c.invalidateQueries({ queryKey: x });
2322
2339
  return;
2323
2340
  }
2324
- const S = Ht(s);
2325
- if (S) {
2326
- N(null);
2327
- const re = ((T = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
2328
- (F) => F.id === b.transition_id
2329
- )) == null ? void 0 : T.label) ?? "Move";
2330
- J.warning(S.message, {
2341
+ const D = Yt(a);
2342
+ if (D) {
2343
+ _(null);
2344
+ const ue = ((j = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
2345
+ (U) => U.id === m.transition_id
2346
+ )) == null ? void 0 : j.label) ?? "Move";
2347
+ Y.warning(D.message, {
2331
2348
  id: `nvr-locked-move:${t}:${String(e)}`,
2332
2349
  duration: 2e4,
2333
2350
  action: {
2334
- label: `${re} anyway`,
2335
- onClick: () => I({ ...b, lock_ack: !0 })
2351
+ label: `${ue} anyway`,
2352
+ onClick: () => L({ ...m, lock_ack: !0 })
2336
2353
  },
2337
2354
  cancel: { label: "Wait", onClick: () => {
2338
2355
  } }
2339
2356
  });
2340
2357
  return;
2341
2358
  }
2342
- const P = Wt(s);
2343
- if (P) {
2344
- x((re) => ({
2345
- payload: P,
2346
- transitionId: b.transition_id,
2347
- comment: b.comment,
2348
- revision: ((re == null ? void 0 : re.revision) ?? 0) + 1
2359
+ const M = Vt(a);
2360
+ if (M) {
2361
+ y((ue) => ({
2362
+ payload: M,
2363
+ transitionId: m.transition_id,
2364
+ comment: m.comment,
2365
+ revision: ((ue == null ? void 0 : ue.revision) ?? 0) + 1
2349
2366
  }));
2350
2367
  return;
2351
2368
  }
2352
- const D = s == null ? void 0 : s.response;
2353
- A(Gt(s, b)), J.error(Pe(s, "Failed to execute transition"), {
2369
+ const R = a == null ? void 0 : a.response;
2370
+ A(Jt(a, m)), Y.error(Fe(a, "Failed to execute transition"), {
2354
2371
  duration: 12e3,
2355
2372
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
2356
- ...Ut(s, { action: "Transition" }),
2373
+ ...jt(a, { action: "Transition" }),
2357
2374
  // #1867: a refusal carries "Why?" — the role, owner or access rule
2358
2375
  // that stopped it, and who can change it.
2359
- ...jt(s) ? {
2360
- action: It(l, {
2376
+ ...Wt(a) ? {
2377
+ action: zt(l, {
2361
2378
  collection: t,
2362
2379
  itemId: String(e),
2363
2380
  action: "transition",
2364
- transitionId: b.transition_id
2381
+ transitionId: m.transition_id
2365
2382
  })
2366
2383
  } : {}
2367
- }), x(null), N(null), je(c, t, String(e)), De(c, t, String(e)), (D == null ? void 0 : D.status) === 409 && c.invalidateQueries({ queryKey: g });
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 });
2368
2385
  }
2369
- }), H = se(m);
2370
- H.current = m;
2371
- const W = se((d == null ? void 0 : d.available_transitions) ?? []);
2372
- if (W.current = (d == null ? void 0 : d.available_transitions) ?? [], fe(() => {
2373
- const s = (b) => {
2374
- const w = b.detail;
2375
- if (!w || w.claimed || w.collection !== t || String(w.item) !== String(e)) return;
2376
- w.claimed = !0;
2377
- const S = String(w.transition_id).toUpperCase(), P = W.current.find((D) => String(D.id).toUpperCase() === S);
2378
- if (!P) {
2379
- J.error("That step is not available from where the record is now");
2386
+ }), G = ne(h);
2387
+ G.current = h;
2388
+ const se = ne((o == null ? void 0 : o.available_transitions) ?? []);
2389
+ if (se.current = (o == null ? void 0 : o.available_transitions) ?? [], fe(() => {
2390
+ const a = (m) => {
2391
+ const N = m.detail;
2392
+ if (!N || N.claimed || N.collection !== t || String(N.item) !== String(e)) return;
2393
+ N.claimed = !0;
2394
+ const D = String(N.transition_id).toUpperCase(), M = se.current.find((R) => String(R.id).toUpperCase() === D);
2395
+ if (!M) {
2396
+ Y.error("That step is not available from where the record is now");
2380
2397
  return;
2381
2398
  }
2382
- H.current(P.id);
2399
+ G.current(M.id);
2383
2400
  };
2384
- return window.addEventListener(Ee, s), () => window.removeEventListener(Ee, s);
2385
- }, [t, e]), !(d != null && d.binding) || !(d != null && d.instance)) return null;
2386
- const G = sn(
2387
- (d.available_transitions ?? []).filter(
2388
- (s) => !d.instance.completed_at || s.from_state && String(s.from_state).toUpperCase() === String(d.instance.current_state).toUpperCase()
2401
+ return window.addEventListener(Ke, a), () => window.removeEventListener(Ke, a);
2402
+ }, [t, e]), !(o != null && o.binding) || !(o != null && o.instance)) return null;
2403
+ const ee = cn(
2404
+ (o.available_transitions ?? []).filter(
2405
+ (a) => !o.instance.completed_at || a.from_state && String(a.from_state).toUpperCase() === String(o.instance.current_state).toUpperCase()
2389
2406
  ),
2390
- d.states ?? [],
2391
- d.instance.current_state,
2392
- d.instance.completed_at ? null : y
2407
+ o.states ?? [],
2408
+ o.instance.current_state,
2409
+ o.instance.completed_at ? null : g
2393
2410
  );
2394
- if (G.length === 0) return null;
2395
- const ee = new Map((d.states ?? []).map((s) => [s.id, s])), V = d.instance.current_state_obj ?? null, $ = f ? G.find((s) => s.id === f) : null, pe = $ ? ee.get($.to_state) : null, o = un($, V, d.states ?? [], Z), xe = (o == null ? void 0 : o.state) ?? pe, ce = /* @__PURE__ */ new Map();
2396
- for (const s of G) {
2397
- const b = ce.get(s.label) ?? [];
2398
- b.push(s), ce.set(s.label, b);
2411
+ if (ee.length === 0) return null;
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 = hn(C, z, o.states ?? [], X), he = (J == null ? void 0 : J.state) ?? de, be = /* @__PURE__ */ new Map();
2413
+ for (const a of ee) {
2414
+ const m = be.get(a.label) ?? [];
2415
+ m.push(a), be.set(a.label, m);
2399
2416
  }
2400
- const de = (s) => [...s].sort(
2401
- (b, w) => {
2402
- var S, P;
2403
- return (((S = ee.get(b.to_state)) == null ? void 0 : S.sort) ?? 999) - (((P = ee.get(w.to_state)) == null ? void 0 : P.sort) ?? 999);
2417
+ const d = (a) => [...a].sort(
2418
+ (m, N) => {
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);
2404
2421
  }
2405
- ), ke = (() => {
2406
- var w, S, P;
2407
- const s = (w = B.current) == null ? void 0 : w.getBoundingClientRect();
2408
- if (!s) return 600;
2409
- const b = (P = (S = B.current) == null ? void 0 : S.closest('[role="dialog"]')) == null ? void 0 : P.getBoundingClientRect();
2410
- return Math.max(260, Math.min(600, s.right - ((b == null ? void 0 : b.left) ?? 0) - 12));
2422
+ ), _e = (() => {
2423
+ var N, D, M;
2424
+ const a = (N = K.current) == null ? void 0 : N.getBoundingClientRect();
2425
+ if (!a) return 600;
2426
+ const m = (M = (D = K.current) == null ? void 0 : D.closest('[role="dialog"]')) == null ? void 0 : M.getBoundingClientRect();
2427
+ return Math.max(260, Math.min(600, a.right - ((m == null ? void 0 : m.left) ?? 0) - 12));
2411
2428
  })();
2412
- return /* @__PURE__ */ i("div", { ref: B, className: "relative", children: [
2413
- M ? /* @__PURE__ */ i(Xe, { children: [
2414
- /* @__PURE__ */ n(Ye, { asChild: !0, children: /* @__PURE__ */ i(
2429
+ return /* @__PURE__ */ i("div", { ref: K, className: "relative", children: [
2430
+ T ? /* @__PURE__ */ i(Ze, { children: [
2431
+ /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i(
2415
2432
  ae,
2416
2433
  {
2417
2434
  size: "sm",
2418
2435
  variant: "outline",
2419
2436
  className: "shrink-0 gap-1.5 text-[12px]",
2420
- disabled: _.isPending || k,
2437
+ disabled: k.isPending || w,
2421
2438
  "data-transitions-folded": !0,
2422
2439
  children: [
2423
- _.isPending && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
2440
+ k.isPending && /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }),
2424
2441
  "Actions",
2425
- /* @__PURE__ */ n(Se, { className: "h-3 w-3" })
2442
+ /* @__PURE__ */ n($e, { className: "h-3 w-3" })
2426
2443
  ]
2427
2444
  }
2428
2445
  ) }),
2429
- /* @__PURE__ */ n(Je, { align: "end", className: "min-w-[200px]", children: Array.from(ce.entries()).map(
2430
- ([s, b], w, S) => b.length === 1 ? /* @__PURE__ */ i(vt, { children: [
2431
- w > 0 && S[w - 1][1].length > 1 && /* @__PURE__ */ n(kt, {}),
2432
- /* @__PURE__ */ i(Ue, { onSelect: () => m(b[0].id), children: [
2433
- b[0].color && /* @__PURE__ */ n(
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, {}),
2449
+ /* @__PURE__ */ i(Be, { onSelect: () => h(m[0].id), children: [
2450
+ m[0].color && /* @__PURE__ */ n(
2434
2451
  "span",
2435
2452
  {
2436
2453
  className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
2437
- style: { backgroundColor: b[0].color }
2454
+ style: { backgroundColor: m[0].color }
2438
2455
  }
2439
2456
  ),
2440
- s
2457
+ a
2441
2458
  ] })
2442
- ] }, s) : /* @__PURE__ */ i(vt, { children: [
2443
- w > 0 && /* @__PURE__ */ n(kt, {}),
2444
- /* @__PURE__ */ n(Un, { className: "text-[11px] text-muted-foreground", children: s }),
2445
- de(b).map((P) => {
2446
- var D;
2447
- return /* @__PURE__ */ i(Ue, { onSelect: () => m(P.id), children: [
2448
- P.color && /* @__PURE__ */ n(
2459
+ ] }, a) : /* @__PURE__ */ i(St, { children: [
2460
+ N > 0 && /* @__PURE__ */ n(Ct, {}),
2461
+ /* @__PURE__ */ n(jn, { className: "text-[11px] text-muted-foreground", children: a }),
2462
+ d(m).map((M) => {
2463
+ var R;
2464
+ return /* @__PURE__ */ i(Be, { onSelect: () => h(M.id), children: [
2465
+ M.color && /* @__PURE__ */ n(
2449
2466
  "span",
2450
2467
  {
2451
2468
  className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
2452
- style: { backgroundColor: P.color }
2469
+ style: { backgroundColor: M.color }
2453
2470
  }
2454
2471
  ),
2455
- ((D = ee.get(P.to_state)) == null ? void 0 : D.label) ?? P.to_state
2456
- ] }, P.id);
2472
+ ((R = re.get(M.to_state)) == null ? void 0 : R.label) ?? M.to_state
2473
+ ] }, M.id);
2457
2474
  })
2458
- ] }, s)
2475
+ ] }, a)
2459
2476
  ) })
2460
2477
  ] }) : /* @__PURE__ */ i(
2461
2478
  "div",
2462
2479
  {
2463
- className: a ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
2480
+ className: s ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
2464
2481
  children: [
2465
- /* @__PURE__ */ n(nn, { flags: d == null ? void 0 : d.flags }),
2466
- Array.from(ce.entries()).map(([s, b]) => {
2467
- var T, re;
2468
- const w = b.some((F) => {
2469
- var X;
2470
- return (((X = F.order_partners) == null ? void 0 : X.length) ?? 0) > 0;
2471
- }), S = w ? null : ((T = b[0]) == null ? void 0 : T.color) ?? null, P = b.some((F) => F.id === f), D = (F) => S ? F ? { backgroundColor: S, borderColor: S } : { borderColor: S, color: S } : void 0;
2472
- if (b.length === 1) {
2473
- const F = b[0], X = _.isPending && ((re = _.variables) == null ? void 0 : re.transition_id) === F.id, Ne = /* @__PURE__ */ i(
2482
+ /* @__PURE__ */ n(ln, { flags: o == null ? void 0 : o.flags }),
2483
+ Array.from(be.entries()).map(([a, m]) => {
2484
+ var j, ue;
2485
+ const N = m.some((U) => {
2486
+ var O;
2487
+ return (((O = U.order_partners) == null ? void 0 : O.length) ?? 0) > 0;
2488
+ }), 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;
2489
+ if (m.length === 1) {
2490
+ const U = m[0], O = k.isPending && ((ue = k.variables) == null ? void 0 : ue.transition_id) === U.id, ge = /* @__PURE__ */ i(
2474
2491
  ae,
2475
2492
  {
2476
2493
  size: "sm",
2477
- variant: P ? "default" : "outline",
2494
+ variant: M ? "default" : "outline",
2478
2495
  className: "gap-1.5 text-[12px] data-[fresh=true]:opacity-60",
2479
- style: D(P),
2480
- disabled: _.isPending || k,
2481
- "aria-disabled": Q.dimmed(F.id) || void 0,
2482
- "data-fresh": Q.dimmed(F.id) || void 0,
2483
- ...Q.bind(F.id),
2496
+ style: R(M),
2497
+ disabled: k.isPending || w,
2498
+ "aria-disabled": Q.dimmed(U.id) || void 0,
2499
+ "data-fresh": Q.dimmed(U.id) || void 0,
2500
+ ...Q.bind(U.id),
2484
2501
  onClick: () => {
2485
- Q.press(F.id) && m(F.id);
2502
+ Q.press(U.id) && h(U.id);
2486
2503
  },
2487
2504
  children: [
2488
- X ? /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }) : w && /* @__PURE__ */ n(Mt, { className: "h-3 w-3", "aria-hidden": !0 }),
2489
- s
2505
+ O ? /* @__PURE__ */ n(me, { className: "h-3 w-3 animate-spin" }) : N && /* @__PURE__ */ n(Ft, { className: "h-3 w-3", "aria-hidden": !0 }),
2506
+ a
2490
2507
  ]
2491
2508
  },
2492
- s
2509
+ a
2493
2510
  );
2494
- return F.pushes && F.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2495
- Ne,
2511
+ return U.pushes && U.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2512
+ ge,
2496
2513
  /* @__PURE__ */ n(
2497
- Dn,
2514
+ Un,
2498
2515
  {
2499
2516
  collection: t,
2500
2517
  itemId: e,
2501
- transitionId: F.id,
2502
- label: s,
2518
+ transitionId: U.id,
2519
+ label: a,
2503
2520
  compact: !0
2504
2521
  }
2505
2522
  )
2506
- ] }, s) : Ne;
2523
+ ] }, a) : ge;
2507
2524
  }
2508
- return /* @__PURE__ */ i(Xe, { children: [
2509
- /* @__PURE__ */ n(Ye, { asChild: !0, children: /* @__PURE__ */ i(
2525
+ return /* @__PURE__ */ i(Ze, { children: [
2526
+ /* @__PURE__ */ n(et, { asChild: !0, children: /* @__PURE__ */ i(
2510
2527
  ae,
2511
2528
  {
2512
2529
  size: "sm",
2513
- variant: P ? "default" : "outline",
2530
+ variant: M ? "default" : "outline",
2514
2531
  className: "gap-1.5 text-[12px]",
2515
- style: D(P),
2516
- disabled: _.isPending || k,
2532
+ style: R(M),
2533
+ disabled: k.isPending || w,
2517
2534
  children: [
2518
- s,
2519
- /* @__PURE__ */ n(Se, { className: "h-3 w-3" })
2535
+ a,
2536
+ /* @__PURE__ */ n($e, { className: "h-3 w-3" })
2520
2537
  ]
2521
2538
  }
2522
2539
  ) }),
2523
- /* @__PURE__ */ n(Je, { align: "start", children: de(b).map((F) => {
2524
- var X;
2525
- return /* @__PURE__ */ i(Ue, { onSelect: () => m(F.id), children: [
2526
- F.color && /* @__PURE__ */ n(
2540
+ /* @__PURE__ */ n(tt, { align: "start", children: d(m).map((U) => {
2541
+ var O;
2542
+ return /* @__PURE__ */ i(Be, { onSelect: () => h(U.id), children: [
2543
+ U.color && /* @__PURE__ */ n(
2527
2544
  "span",
2528
2545
  {
2529
2546
  className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
2530
- style: { backgroundColor: F.color }
2547
+ style: { backgroundColor: U.color }
2531
2548
  }
2532
2549
  ),
2533
- ((X = ee.get(F.to_state)) == null ? void 0 : X.label) ?? F.to_state
2534
- ] }, F.id);
2550
+ ((O = re.get(U.to_state)) == null ? void 0 : O.label) ?? U.to_state
2551
+ ] }, U.id);
2535
2552
  }) })
2536
- ] }, s);
2553
+ ] }, a);
2537
2554
  })
2538
2555
  ]
2539
2556
  }
@@ -2542,28 +2559,28 @@ function cr({
2542
2559
  "div",
2543
2560
  {
2544
2561
  className: "absolute right-0 top-full z-50 mt-1 space-y-3 rounded-lg border border-slate-200 bg-white shadow-lg dark:bg-card dark:border-border p-3.5",
2545
- style: { width: ke },
2562
+ style: { width: _e },
2546
2563
  children: [
2547
2564
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
2548
2565
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
2549
- $ && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: $.label }),
2550
- V && xe && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2551
- /* @__PURE__ */ n(ve, { label: V.label, color: V.color, small: !0 }),
2552
- /* @__PURE__ */ n(at, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2553
- /* @__PURE__ */ n(ve, { label: xe.label, color: xe.color, small: !0 })
2566
+ C && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: C.label }),
2567
+ z && he && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2568
+ /* @__PURE__ */ n(Ne, { label: z.label, color: z.color, small: !0 }),
2569
+ /* @__PURE__ */ n(lt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2570
+ /* @__PURE__ */ n(Ne, { label: he.label, color: he.color, small: !0 })
2554
2571
  ] })
2555
2572
  ] }),
2556
- /* @__PURE__ */ n(mn, { landing: o }),
2557
- /* @__PURE__ */ n(rn, { collection: t, item: String(e), tx: $ }),
2558
- /* @__PURE__ */ n(pn, { collection: t, item: e, omitLines: U }),
2559
- /* @__PURE__ */ n(en, { lines: U }),
2573
+ /* @__PURE__ */ n(bn, { landing: J }),
2574
+ /* @__PURE__ */ n(on, { collection: t, item: String(e), tx: C }),
2575
+ /* @__PURE__ */ n(gn, { collection: t, item: e, omitLines: E }),
2576
+ /* @__PURE__ */ n(an, { lines: E }),
2560
2577
  /* @__PURE__ */ n(
2561
2578
  "input",
2562
2579
  {
2563
2580
  type: "text",
2564
- value: u,
2565
- onChange: (s) => h(s.target.value),
2566
- placeholder: String(($ == null ? void 0 : $.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
2581
+ value: p,
2582
+ onChange: (a) => b(a.target.value),
2583
+ placeholder: String((C == null ? void 0 : C.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
2567
2584
  className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
2568
2585
  }
2569
2586
  ),
@@ -2575,7 +2592,7 @@ function cr({
2575
2592
  size: "sm",
2576
2593
  variant: "ghost",
2577
2594
  className: "h-7 text-[12px]",
2578
- onClick: () => N(null),
2595
+ onClick: () => _(null),
2579
2596
  children: "Cancel"
2580
2597
  }
2581
2598
  ),
@@ -2585,14 +2602,14 @@ function cr({
2585
2602
  type: "button",
2586
2603
  size: "sm",
2587
2604
  className: "h-7 gap-1.5 text-[12px]",
2588
- disabled: _.isPending || String(($ == null ? void 0 : $.comment_mode) ?? "") === "required" && u.trim() === "",
2589
- onClick: () => I({
2605
+ disabled: k.isPending || String((C == null ? void 0 : C.comment_mode) ?? "") === "required" && p.trim() === "",
2606
+ onClick: () => L({
2590
2607
  transition_id: f,
2591
- comment: u.trim() || void 0
2608
+ comment: p.trim() || void 0
2592
2609
  }),
2593
- children: _.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(he, { children: [
2594
- /* @__PURE__ */ n("span", { children: U.length > 0 && $ ? `${$.label} anyway` : "Confirm" }),
2595
- /* @__PURE__ */ n(Ie, { className: "h-3 w-3" })
2610
+ children: k.isPending ? /* @__PURE__ */ n(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(xe, { children: [
2611
+ /* @__PURE__ */ n("span", { children: E.length > 0 && C ? `${C.label} anyway` : "Confirm" }),
2612
+ /* @__PURE__ */ n(We, { className: "h-3 w-3" })
2596
2613
  ] })
2597
2614
  }
2598
2615
  )
@@ -2600,20 +2617,20 @@ function cr({
2600
2617
  ]
2601
2618
  }
2602
2619
  ),
2603
- q && !f && /* @__PURE__ */ n(
2604
- cn,
2620
+ $ && !f && /* @__PURE__ */ n(
2621
+ fn,
2605
2622
  {
2606
2623
  collection: t,
2607
2624
  item: String(e),
2608
- offer: q,
2625
+ offer: $,
2609
2626
  className: "absolute right-0 top-full z-50 mt-1 shadow-lg",
2610
- style: { width: ke },
2627
+ style: { width: _e },
2611
2628
  onDismiss: () => A(null),
2612
- onFixed: () => I({ transition_id: q.transitionId, comment: q.comment })
2629
+ onFixed: () => L({ transition_id: $.transitionId, comment: $.comment })
2613
2630
  }
2614
2631
  ),
2615
- v && /* @__PURE__ */ n(Ft, { fallback: null, children: /* @__PURE__ */ n(
2616
- Kt,
2632
+ v && /* @__PURE__ */ n(Et, { fallback: null, children: /* @__PURE__ */ n(
2633
+ Ht,
2617
2634
  {
2618
2635
  payload: v.payload,
2619
2636
  transitionId: v.transitionId,
@@ -2621,41 +2638,41 @@ function cr({
2621
2638
  onSubmitted: () => (
2622
2639
  // mutateAsync so the dialog can stay busy until the transition
2623
2640
  // settles; the mutation's own onError/onSuccess handle the outcome.
2624
- _.mutateAsync({
2641
+ k.mutateAsync({
2625
2642
  transition_id: v.transitionId,
2626
2643
  comment: v.comment,
2627
2644
  reviewed: !0
2628
2645
  }).catch(() => {
2629
2646
  })
2630
2647
  ),
2631
- executing: _.isPending,
2632
- onClose: () => x(null)
2648
+ executing: k.isPending,
2649
+ onClose: () => y(null)
2633
2650
  },
2634
2651
  v.revision
2635
2652
  ) })
2636
2653
  ] });
2637
2654
  }
2638
2655
  export {
2639
- Te as FRESH_BUTTON_MS,
2640
- St as FRESH_HOVER_MAX_MS,
2641
- Vn as FreshButtonGuard,
2642
- Ir as PipelinePanel,
2643
- Kr as PipelineTransitionButtons,
2644
- Hn as REFUSAL_FIX_ACTIONS,
2645
- nn as RecordFlagChips,
2646
- er as SLOW_MOVE_MS,
2647
- tn as asksFirst,
2648
- Yn as briefAgeText,
2649
- Jn as briefDiffPair,
2650
- Ct as briefLineKey,
2651
- Xn as briefWarnings,
2652
- Qt as isDuplicateTransition,
2653
- tr as latestSendBack,
2654
- Ht as lockedMoveOffer,
2655
- zt as refusalCode,
2656
- Gt as refusalFixFor,
2657
- on as slowMoveToast,
2658
- Wt as transitionRequirementsFromError,
2659
- ln as transitionToastText,
2660
- sn as withoutSkippedSendBacks
2656
+ Me as FRESH_BUTTON_MS,
2657
+ qt as FRESH_HOVER_MAX_MS,
2658
+ Zn as FreshButtonGuard,
2659
+ Hr as PipelinePanel,
2660
+ Gr as PipelineTransitionButtons,
2661
+ Yn as REFUSAL_FIX_ACTIONS,
2662
+ ln as RecordFlagChips,
2663
+ ar as SLOW_MOVE_MS,
2664
+ sn as asksFirst,
2665
+ tr as briefAgeText,
2666
+ nr as briefDiffPair,
2667
+ Mt as briefLineKey,
2668
+ er as briefWarnings,
2669
+ Gt as isDuplicateTransition,
2670
+ sr as latestSendBack,
2671
+ Yt as lockedMoveOffer,
2672
+ Xt as refusalCode,
2673
+ Jt as refusalFixFor,
2674
+ mn as slowMoveToast,
2675
+ Vt as transitionRequirementsFromError,
2676
+ un as transitionToastText,
2677
+ cn as withoutSkippedSendBacks
2661
2678
  };