@nivaro/react 0.3.116 → 0.3.117

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,6 +1,6 @@
1
1
  import { jsxs as t, jsx as e, Fragment as ye } from "react/jsx-runtime";
2
- import { useSensors as Jt, useSensor as et, PointerSensor as Xt, KeyboardSensor as Zt, DndContext as Ye, closestCenter as Ie } from "@dnd-kit/core";
3
- import { sortableKeyboardCoordinates as ea, SortableContext as Je, verticalListSortingStrategy as Xe, arrayMove as Ze, useSortable as ft } from "@dnd-kit/sortable";
2
+ import { useSensors as Jt, useSensor as tt, PointerSensor as Xt, KeyboardSensor as Zt, DndContext as Ie, closestCenter as Je } from "@dnd-kit/core";
3
+ import { sortableKeyboardCoordinates as ea, SortableContext as Xe, verticalListSortingStrategy as Ze, arrayMove as et, useSortable as ft } from "@dnd-kit/sortable";
4
4
  import { CSS as gt } from "@dnd-kit/utilities";
5
5
  import { useMutation as M, useQueryClient as _e, useQuery as V } from "@tanstack/react-query";
6
6
  import { X as Ne, ArrowLeft as Ra, Check as we, Pencil as Le, Download as Ta, Plus as ve, Trash2 as Se, ArrowRight as ta, Zap as Pa, PlugZap as Aa, Filter as bt, Link2 as Kt, LayoutGrid as La, Link2Off as Da, ListChecks as aa, Loader2 as ke, GripVertical as yt, Settings as ja, GitFork as Ma, ChevronDown as Oe, Search as vt, History as Ka, ChevronRight as Nt, ExternalLink as za } from "lucide-react";
@@ -15,7 +15,7 @@ import { toastError as zt } from "../../lib/error-toast.js";
15
15
  import { useLiveFade as Ga } from "../../lib/live-screen.js";
16
16
  import { queryKeys as ze } from "../../lib/query-keys.js";
17
17
  import { useStateCensus as ra, censusByState as Ya, oldestHint as Ia, stateListPath as Ja } from "../../lib/state-census.js";
18
- import { cn as J, formatRelative as Xa, titleCase as st } from "../../lib/utils.js";
18
+ import { cn as J, formatRelative as Xa, titleCase as nt } from "../../lib/utils.js";
19
19
  import { ExplainCard as Za } from "../ai/ExplainButton.js";
20
20
  import { ConfigChangeStrip as es } from "../ConfigChangeStrip.js";
21
21
  import { ConfigHistoryButton as ts } from "../ConfigHistory.js";
@@ -35,16 +35,17 @@ import { Select as ls, SelectTrigger as is, SelectValue as os, SelectContent as
35
35
  import { Skeleton as je } from "../ui/skeleton.js";
36
36
  import { Switch as Ee } from "../ui/switch.js";
37
37
  import { Textarea as ia } from "../ui/textarea.js";
38
+ import { BindingStartStateSettings as ms } from "./BindingStartStateSettings.js";
38
39
  import { FieldPicker as xt } from "./FieldPicker.js";
39
- import { OwnerMatrix as ms } from "./OwnerMatrix.js";
40
- import { OwnerMatrixSheetActions as ps } from "./OwnerMatrixSheet.js";
41
- import { OwnerMatrixVersionsCard as us } from "./OwnerMatrixVersionsCard.js";
42
- import { TemplateLintCard as hs, SkipReportCard as xs } from "./PipelineHealthCards.js";
43
- import { PipelineSkipCriteria as fs } from "./PipelineSkipCriteria.js";
44
- import { PipelineStateOwners as gs } from "./PipelineStateOwners.js";
45
- import { findM2ORelation as bs, extractTemplateFields as ys, renderDisplayTemplate as mt } from "./relations.js";
46
- import { TeamsView as vs } from "./TeamsView.js";
47
- import { useScopeDimensions as Ns, rankTeamForFilters as ws, tierOrder as Ut } from "./teamScopes.js";
40
+ import { OwnerMatrix as ps } from "./OwnerMatrix.js";
41
+ import { OwnerMatrixSheetActions as us } from "./OwnerMatrixSheet.js";
42
+ import { OwnerMatrixVersionsCard as hs } from "./OwnerMatrixVersionsCard.js";
43
+ import { TemplateLintCard as xs, SkipReportCard as fs } from "./PipelineHealthCards.js";
44
+ import { PipelineSkipCriteria as gs } from "./PipelineSkipCriteria.js";
45
+ import { PipelineStateOwners as bs } from "./PipelineStateOwners.js";
46
+ import { findM2ORelation as ys, extractTemplateFields as vs, renderDisplayTemplate as mt } from "./relations.js";
47
+ import { TeamsView as Ns } from "./TeamsView.js";
48
+ import { useScopeDimensions as ws, rankTeamForFilters as ks, tierOrder as Ut } from "./teamScopes.js";
48
49
  const oa = "rgb(var(--nvr-cyan-rgb, 0 206 255))", Me = "rounded bg-red-50 px-1.5 text-[11px] font-semibold text-red-700 hover:text-red-700 dark:bg-red-500/10 dark:text-red-400";
49
50
  function he({
50
51
  value: a,
@@ -142,7 +143,7 @@ function he({
142
143
  ] })
143
144
  ] });
144
145
  }
145
- function ks({
146
+ function _s({
146
147
  values: a,
147
148
  onChange: n,
148
149
  options: o,
@@ -227,7 +228,7 @@ function ks({
227
228
  ] })
228
229
  ] });
229
230
  }
230
- const _s = [
231
+ const Cs = [
231
232
  "#6b7280",
232
233
  "#ef4444",
233
234
  "#f97316",
@@ -238,7 +239,7 @@ const _s = [
238
239
  "#8b5cf6",
239
240
  "#ec4899"
240
241
  ];
241
- function tt({
242
+ function at({
242
243
  value: a,
243
244
  onChange: n
244
245
  }) {
@@ -255,7 +256,7 @@ function tt({
255
256
  title: "No color"
256
257
  }
257
258
  ),
258
- _s.map((o) => /* @__PURE__ */ e(
259
+ Cs.map((o) => /* @__PURE__ */ e(
259
260
  "button",
260
261
  {
261
262
  type: "button",
@@ -358,7 +359,7 @@ function Wt({
358
359
  ] }),
359
360
  /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
360
361
  /* @__PURE__ */ e(H, { className: "text-[12px]", children: "Color" }),
361
- /* @__PURE__ */ e(tt, { value: m.color, onChange: (l) => p("color", l) })
362
+ /* @__PURE__ */ e(at, { value: m.color, onChange: (l) => p("color", l) })
362
363
  ] }),
363
364
  /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
364
365
  /* @__PURE__ */ e(H, { className: "text-[12px]", children: "Help text" }),
@@ -548,10 +549,10 @@ function Yt() {
548
549
  }
549
550
  );
550
551
  }
551
- function Cs(a) {
552
+ function Ss(a) {
552
553
  return a ? Array.isArray(a) ? a.map(String).filter(Boolean) : typeof a == "string" && a.trim() ? [a] : [] : [];
553
554
  }
554
- function Ss({
555
+ function qs({
555
556
  relatedCollection: a,
556
557
  value: n,
557
558
  onChange: o
@@ -559,22 +560,22 @@ function Ss({
559
560
  const f = Z(), [i, m] = $(!1), [d, p] = $(""), l = Ke(null);
560
561
  ue(() => {
561
562
  i ? setTimeout(() => {
562
- var O;
563
- return (O = l.current) == null ? void 0 : O.focus();
563
+ var R;
564
+ return (R = l.current) == null ? void 0 : R.focus();
564
565
  }, 50) : p("");
565
566
  }, [i]);
566
567
  const { data: v } = V({
567
568
  queryKey: ze.collectionMeta(a),
568
- queryFn: () => f.request(G(`/collections/${a}`)).then((O) => O.data),
569
+ queryFn: () => f.request(G(`/collections/${a}`)).then((R) => R.data),
569
570
  staleTime: 6e4,
570
571
  enabled: !!a
571
- }), h = ((v == null ? void 0 : v.fields) ?? []).map((O) => O.field), u = (v == null ? void 0 : v.display_template) ?? null, y = ["name", "title", "label", "display_name", "subject", "email", "slug"], x = [
572
- .../* @__PURE__ */ new Set(["id", ...ys(u), ...y])
573
- ], g = h.length ? x.filter((O) => O === "id" || h.includes(O)).join(",") : "id", { data: C, isLoading: r, isError: w } = V({
572
+ }), h = ((v == null ? void 0 : v.fields) ?? []).map((R) => R.field), u = (v == null ? void 0 : v.display_template) ?? null, y = ["name", "title", "label", "display_name", "subject", "email", "slug"], x = [
573
+ .../* @__PURE__ */ new Set(["id", ...vs(u), ...y])
574
+ ], g = h.length ? x.filter((R) => R === "id" || h.includes(R)).join(",") : "id", { data: C, isLoading: r, isError: w } = V({
574
575
  queryKey: ["relation-picker-items", a, g],
575
576
  queryFn: () => f.request(
576
577
  G(`/items/${a}`, { limit: 200, fields: g })
577
- ).then((O) => O.data),
578
+ ).then((R) => R.data),
578
579
  staleTime: 3e4,
579
580
  // Fetch when dropdown opens OR when there are existing values to resolve labels
580
581
  enabled: (i || n.length > 0) && !!h.length,
@@ -587,23 +588,23 @@ function Ss({
587
588
  {
588
589
  type: "text",
589
590
  value: n.join(", "),
590
- onChange: (O) => o(
591
- O.target.value.split(",").map((b) => b.trim()).filter(Boolean)
591
+ onChange: (R) => o(
592
+ R.target.value.split(",").map((b) => b.trim()).filter(Boolean)
592
593
  ),
593
594
  placeholder: "Value (comma-separated)",
594
595
  className: "h-8 text-[12px]"
595
596
  }
596
597
  );
597
598
  const N = C ?? [];
598
- function S(O) {
599
- const b = N.find((c) => String(c.id) === O);
600
- return b ? mt(u, b) : O;
599
+ function S(R) {
600
+ const b = N.find((c) => String(c.id) === R);
601
+ return b ? mt(u, b) : R;
601
602
  }
602
- function A(O) {
603
- o(n.includes(O) ? n.filter((b) => b !== O) : [...n, O]);
603
+ function L(R) {
604
+ o(n.includes(R) ? n.filter((b) => b !== R) : [...n, R]);
604
605
  }
605
606
  const D = d ? N.filter(
606
- (O) => mt(u, O).toLowerCase().includes(d.toLowerCase())
607
+ (R) => mt(u, R).toLowerCase().includes(d.toLowerCase())
607
608
  ) : N;
608
609
  return /* @__PURE__ */ t(Be, { open: i, onOpenChange: m, children: [
609
610
  /* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ e(Ue, { asChild: !0, children: /* @__PURE__ */ t(
@@ -615,22 +616,22 @@ function Ss({
615
616
  n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-400 px-0.5", children: "Select…" }) : r ? /* @__PURE__ */ t("span", { className: "flex items-center gap-1 text-[12px] text-slate-400", children: [
616
617
  /* @__PURE__ */ e(ke, { className: "h-3 w-3 animate-spin" }),
617
618
  "Loading…"
618
- ] }) : n.map((O) => /* @__PURE__ */ t(
619
+ ] }) : n.map((R) => /* @__PURE__ */ t(
619
620
  "span",
620
621
  {
621
622
  className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
622
623
  children: [
623
- S(O),
624
+ S(R),
624
625
  /* @__PURE__ */ e(
625
626
  "span",
626
627
  {
627
628
  role: "button",
628
629
  tabIndex: 0,
629
630
  onClick: (b) => {
630
- b.stopPropagation(), A(O);
631
+ b.stopPropagation(), L(R);
631
632
  },
632
633
  onKeyDown: (b) => {
633
- (b.key === "Enter" || b.key === " ") && (b.stopPropagation(), A(O));
634
+ (b.key === "Enter" || b.key === " ") && (b.stopPropagation(), L(R));
634
635
  },
635
636
  className: "cursor-pointer text-nvr-navy/50 hover:text-red-500 dark:text-nvr-cyan/60",
636
637
  children: "×"
@@ -638,7 +639,7 @@ function Ss({
638
639
  )
639
640
  ]
640
641
  },
641
- O
642
+ R
642
643
  )),
643
644
  /* @__PURE__ */ e(Oe, { className: "ml-auto h-3.5 w-3.5 shrink-0 text-slate-400" })
644
645
  ]
@@ -652,7 +653,7 @@ function Ss({
652
653
  {
653
654
  ref: l,
654
655
  value: d,
655
- onChange: (O) => p(O.target.value),
656
+ onChange: (R) => p(R.target.value),
656
657
  placeholder: "Search…",
657
658
  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"
658
659
  }
@@ -661,13 +662,13 @@ function Ss({
661
662
  /* @__PURE__ */ e("div", { className: "max-h-56 overflow-y-auto py-1", children: r ? /* @__PURE__ */ t("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
662
663
  /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5 animate-spin" }),
663
664
  "Loading…"
664
- ] }) : D.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : D.map((O) => {
665
- const b = mt(u, O), c = String(O.id), k = n.includes(c);
665
+ ] }) : D.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : D.map((R) => {
666
+ const b = mt(u, R), c = String(R.id), k = n.includes(c);
666
667
  return /* @__PURE__ */ t(
667
668
  "button",
668
669
  {
669
670
  type: "button",
670
- onClick: () => A(c),
671
+ onClick: () => L(c),
671
672
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-[12px] hover:bg-slate-50 ${k ? "font-medium text-slate-800" : "text-slate-600"}`,
672
673
  children: [
673
674
  /* @__PURE__ */ e(
@@ -685,7 +686,7 @@ function Ss({
685
686
  ] })
686
687
  ] });
687
688
  }
688
- const qs = [
689
+ const $s = [
689
690
  { value: "eq", label: "equals" },
690
691
  { value: "neq", label: "not equals" },
691
692
  { value: "gt", label: "greater than" },
@@ -695,8 +696,8 @@ const qs = [
695
696
  { value: "contains", label: "contains" },
696
697
  { value: "null", label: "is empty" },
697
698
  { value: "nnull", label: "is not empty" }
698
- ], $s = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), Fs = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), Es = /* @__PURE__ */ new Set(["boolean"]);
699
- function Os({
699
+ ], Fs = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), Es = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), Os = /* @__PURE__ */ new Set(["boolean"]);
700
+ function Rs({
700
701
  rules: a,
701
702
  onChange: n,
702
703
  collection: o
@@ -714,7 +715,7 @@ function Os({
714
715
  if (!r.includes(".")) {
715
716
  const w = v.find((N) => N.field === r);
716
717
  if (w) {
717
- const N = bs(h, o ?? "", r);
718
+ const N = ys(h, o ?? "", r);
718
719
  return { type: w.type, relatedCollection: (N == null ? void 0 : N.one_collection) ?? void 0 };
719
720
  }
720
721
  }
@@ -722,7 +723,7 @@ function Os({
722
723
  }
723
724
  const y = (r, w) => n(a.map((N, S) => S === r ? { ...N, ...w } : N)), x = (r) => n(a.filter((w, N) => N !== r));
724
725
  function g(r) {
725
- return r ? r.split(".").map(st).join(" → ") : "";
726
+ return r ? r.split(".").map(nt).join(" → ") : "";
726
727
  }
727
728
  return /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-200 pt-3", children: [
728
729
  /* @__PURE__ */ t(
@@ -743,7 +744,7 @@ function Os({
743
744
  i && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
744
745
  /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Transition is only offered when all conditions match the record — use two transitions with opposite conditions to branch." }),
745
746
  a.map((r, w) => {
746
- const N = r.op === "null" || r.op === "nnull", S = u(r.field), A = $s.has(S.type), D = Fs.has(S.type), O = Es.has(S.type), b = !!S.relatedCollection;
747
+ const N = r.op === "null" || r.op === "nnull", S = u(r.field), L = Fs.has(S.type), D = Es.has(S.type), R = Os.has(S.type), b = !!S.relatedCollection;
747
748
  return /* @__PURE__ */ t(
748
749
  "div",
749
750
  {
@@ -776,18 +777,18 @@ function Os({
776
777
  {
777
778
  value: r.op,
778
779
  onChange: (c) => y(w, { op: c || "eq" }),
779
- options: qs.map((c) => ({ value: c.value, label: c.label })),
780
+ options: $s.map((c) => ({ value: c.value, label: c.label })),
780
781
  placeholder: "Operator…"
781
782
  }
782
783
  ) }),
783
784
  !N && /* @__PURE__ */ e("div", { className: "flex-1 min-w-[120px]", children: b ? /* @__PURE__ */ e(
784
- Ss,
785
+ qs,
785
786
  {
786
787
  relatedCollection: S.relatedCollection,
787
- value: Cs(r.value),
788
+ value: Ss(r.value),
788
789
  onChange: (c) => y(w, { value: c.length === 1 ? c[0] : c })
789
790
  }
790
- ) : O ? /* @__PURE__ */ e(
791
+ ) : R ? /* @__PURE__ */ e(
791
792
  he,
792
793
  {
793
794
  value: String(r.value ?? ""),
@@ -809,7 +810,7 @@ function Os({
809
810
  ) : /* @__PURE__ */ e(
810
811
  W,
811
812
  {
812
- type: A ? "number" : "text",
813
+ type: L ? "number" : "text",
813
814
  value: String(r.value ?? ""),
814
815
  onChange: (c) => y(w, { value: c.target.value }),
815
816
  placeholder: "Value",
@@ -847,7 +848,7 @@ function Os({
847
848
  ] })
848
849
  ] });
849
850
  }
850
- function Rs({
851
+ function Ts({
851
852
  requirement: a,
852
853
  childRelations: n,
853
854
  onChange: o,
@@ -970,7 +971,7 @@ function Rs({
970
971
  ] })
971
972
  ] });
972
973
  }
973
- function Ts({
974
+ function Ps({
974
975
  requirements: a,
975
976
  onChange: n,
976
977
  collection: o
@@ -1001,7 +1002,7 @@ function Ts({
1001
1002
  i && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
1002
1003
  /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Block this transition until every row of a child relation has the listed fields filled in. Prompts the user with a fill-in dialog when rows are incomplete." }),
1003
1004
  a.map((u, y) => /* @__PURE__ */ e(
1004
- Rs,
1005
+ Ts,
1005
1006
  {
1006
1007
  requirement: u,
1007
1008
  childRelations: l,
@@ -1071,10 +1072,10 @@ function Fe({
1071
1072
  ] });
1072
1073
  }
1073
1074
  const pt = "__custom__";
1074
- function Ps(a) {
1075
+ function As(a) {
1075
1076
  return a.status === "live" ? `Live v${a.published_version ?? "?"}` : a.status === "draft" ? "Draft changes" : "Not published";
1076
1077
  }
1077
- function As({
1078
+ function Ls({
1078
1079
  externalApi: a,
1079
1080
  value: n,
1080
1081
  onChange: o
@@ -1093,7 +1094,7 @@ function As({
1093
1094
  { value: pt, label: "Custom (inline Liquid)" },
1094
1095
  ...(d ?? []).map((x) => ({
1095
1096
  value: x.key,
1096
- label: `${x.label} · ${Ps(x)}`
1097
+ label: `${x.label} · ${As(x)}`
1097
1098
  }))
1098
1099
  ], v = (p ?? []).find((x) => x.name === m || String(x.id) === m), h = v ? String(v.id) : m, u = n ? `/external-apis/${encodeURIComponent(h)}/payloads/${encodeURIComponent(n)}` : null, y = u ? i.consoleUrl ? i.consoleUrl(u) : u : null;
1099
1100
  return /* @__PURE__ */ t("div", { className: "space-y-1", children: [
@@ -1123,7 +1124,7 @@ function As({
1123
1124
  ] })
1124
1125
  ] });
1125
1126
  }
1126
- function Ls({
1127
+ function Ds({
1127
1128
  actions: a,
1128
1129
  onChange: n
1129
1130
  }) {
@@ -1261,7 +1262,7 @@ function Ls({
1261
1262
  ] })
1262
1263
  ] }),
1263
1264
  d.type === "erp_submit" && /* @__PURE__ */ e(
1264
- As,
1265
+ Ls,
1265
1266
  {
1266
1267
  externalApi: String(d.external_api ?? ""),
1267
1268
  value: d.payload_template_key,
@@ -1433,7 +1434,7 @@ function ut({
1433
1434
  /* @__PURE__ */ e(H, { className: "text-[12px]", children: l.to_previous ? "Fallback state" : `To State${l.to_states.length !== 1 ? "s" : ""}` }),
1434
1435
  l.to_previous && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "The real target is the record's previous state — this only applies when history can't answer (the record started in this state, or the prior state was removed)." }),
1435
1436
  /* @__PURE__ */ e(
1436
- ks,
1437
+ _s,
1437
1438
  {
1438
1439
  values: l.to_states,
1439
1440
  onChange: (r) => h("to_states", r),
@@ -1471,10 +1472,10 @@ function ut({
1471
1472
  ] }),
1472
1473
  !f && /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
1473
1474
  /* @__PURE__ */ e(H, { className: "text-[12px]", children: "Color" }),
1474
- /* @__PURE__ */ e(tt, { value: l.color, onChange: (r) => h("color", r) })
1475
+ /* @__PURE__ */ e(at, { value: l.color, onChange: (r) => h("color", r) })
1475
1476
  ] }),
1476
1477
  /* @__PURE__ */ e(
1477
- Os,
1478
+ Rs,
1478
1479
  {
1479
1480
  rules: l.condition_rules ?? [],
1480
1481
  onChange: (r) => h("condition_rules", r),
@@ -1482,7 +1483,7 @@ function ut({
1482
1483
  }
1483
1484
  ),
1484
1485
  /* @__PURE__ */ e(
1485
- Ts,
1486
+ Ps,
1486
1487
  {
1487
1488
  requirements: l.requirements ?? [],
1488
1489
  onChange: (r) => h("requirements", r.length > 0 ? r : null),
@@ -1490,7 +1491,7 @@ function ut({
1490
1491
  }
1491
1492
  ),
1492
1493
  /* @__PURE__ */ e(
1493
- Ls,
1494
+ Ds,
1494
1495
  {
1495
1496
  actions: l.actions ?? [],
1496
1497
  onChange: (r) => h("actions", r.length > 0 ? r : null)
@@ -1621,31 +1622,31 @@ function ut({
1621
1622
  ] })
1622
1623
  ] });
1623
1624
  }
1624
- function Ds(a) {
1625
+ function js(a) {
1625
1626
  var f, i;
1626
1627
  const n = ((f = a.first_name) == null ? void 0 : f[0]) ?? "", o = ((i = a.last_name) == null ? void 0 : i[0]) ?? "";
1627
1628
  return (n + o).toUpperCase() || a.email[0].toUpperCase();
1628
1629
  }
1629
- function js(a) {
1630
+ function Ms(a) {
1630
1631
  const n = a.filter((i) => !i.filters || i.filters.length === 0), o = /* @__PURE__ */ new Set(), f = [];
1631
1632
  for (const i of n)
1632
1633
  for (const m of i.users)
1633
1634
  o.has(m.user) || (o.add(m.user), f.push(m));
1634
1635
  return f;
1635
1636
  }
1636
- function Ms(a) {
1637
+ function Ks(a) {
1637
1638
  var i, m, d;
1638
1639
  const n = (a.filters ?? []).map((p) => {
1639
- const l = st(p.field.split(".").pop() ?? p.field), v = Array.isArray(p.value) ? p.value.join(", ") : String(p.value ?? ""), h = p.op === "_eq" || p.op === "eq" ? "=" : p.op === "_in" || p.op === "in" ? "is" : p.op;
1640
+ const l = nt(p.field.split(".").pop() ?? p.field), v = Array.isArray(p.value) ? p.value.join(", ") : String(p.value ?? ""), h = p.op === "_eq" || p.op === "eq" ? "=" : p.op === "_in" || p.op === "in" ? "is" : p.op;
1640
1641
  return `${l} ${h} ${v}`.trim();
1641
1642
  }).join(" and "), o = a.users.length + (((i = a.teams) == null ? void 0 : i.length) ?? 0), f = o === 0 ? "nobody yet" : `${o} ${o === 1 ? "owner" : "owners"}`;
1642
1643
  return `${((m = a.name) == null ? void 0 : m.trim()) || n || "Owner group"}${(d = a.name) != null && d.trim() && n ? ` (${n})` : ""} · ${f}`;
1643
1644
  }
1644
- function Ks(a, n, o) {
1645
+ function zs(a, n, o) {
1645
1646
  const f = a.toLocaleString("en-US"), i = a === 1 ? "group" : "groups";
1646
1647
  return o ? n ? `+${f} by ${n}` : `+${f} more ${i}` : n ? `${f} owner ${i} by ${n}` : `${f} owner ${i}`;
1647
1648
  }
1648
- function zs({
1649
+ function Bs({
1649
1650
  users: a,
1650
1651
  valueGroups: n
1651
1652
  }) {
@@ -1653,9 +1654,9 @@ function zs({
1653
1654
  if (!a.length && !o) return null;
1654
1655
  const f = new Set(
1655
1656
  n.flatMap((p) => (p.filters ?? []).map((l) => l.field.split(".").pop() ?? l.field))
1656
- ), i = Ks(
1657
+ ), i = zs(
1657
1658
  o,
1658
- f.size === 1 ? st([...f][0]) : null,
1659
+ f.size === 1 ? nt([...f][0]) : null,
1659
1660
  a.length > 0
1660
1661
  ), m = a.slice(0, 4), d = a.length - m.length;
1661
1662
  return /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
@@ -1665,7 +1666,7 @@ function zs({
1665
1666
  {
1666
1667
  title: `${p.first_name ?? ""} ${p.last_name ?? ""}`.trim() || p.email,
1667
1668
  className: "flex h-5 w-5 items-center justify-center rounded-full border border-white bg-nvr-cyan/20 text-[9px] font-semibold text-[#007a99] dark:border-card dark:bg-nvr-cyan/25 dark:text-nvr-cyan",
1668
- children: Ds(p)
1669
+ children: js(p)
1669
1670
  },
1670
1671
  p.user
1671
1672
  )),
@@ -1679,7 +1680,7 @@ function zs({
1679
1680
  {
1680
1681
  "data-owner-value-groups": o,
1681
1682
  "data-tip": `Owners for particular records:
1682
- ${n.map(Ms).join(`
1683
+ ${n.map(Ks).join(`
1683
1684
  `)}`,
1684
1685
  className: "relative whitespace-nowrap rounded-full bg-slate-100 px-1.5 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
1685
1686
  children: [
@@ -1690,7 +1691,7 @@ ${n.map(Ms).join(`
1690
1691
  )
1691
1692
  ] });
1692
1693
  }
1693
- function Bs({
1694
+ function Us({
1694
1695
  s: a,
1695
1696
  census: n,
1696
1697
  onOpen: o
@@ -1699,7 +1700,7 @@ function Bs({
1699
1700
  return /* @__PURE__ */ e("span", { "data-state-census": "0", className: "text-[11.5px] tabular-nums text-slate-400", children: "none now" });
1700
1701
  const f = n.byCollection.filter((m) => m.count > 0), i = "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11.5px] tabular-nums text-slate-600";
1701
1702
  return /* @__PURE__ */ e("div", { "data-state-census": n.count, className: "flex flex-wrap items-center gap-1", children: f.map((m) => {
1702
- const d = Ia(m.oldestAt), p = /^nivaro_/.test(m.collection), l = m.collection === "nivaro_addendums" ? "Addendums" : st(m.collection), v = /* @__PURE__ */ t(ye, { children: [
1703
+ const d = Ia(m.oldestAt), p = /^nivaro_/.test(m.collection), l = m.collection === "nivaro_addendums" ? "Addendums" : nt(m.collection), v = /* @__PURE__ */ t(ye, { children: [
1703
1704
  /* @__PURE__ */ e("b", { className: "font-semibold text-slate-800 dark:text-slate-100", children: m.count.toLocaleString("en-US") }),
1704
1705
  ` ${l}`,
1705
1706
  d ? /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: [
@@ -1721,7 +1722,7 @@ function Bs({
1721
1722
  );
1722
1723
  }) });
1723
1724
  }
1724
- function Us({
1725
+ function Qs({
1725
1726
  s: a,
1726
1727
  groups: n,
1727
1728
  expandedStateId: o,
@@ -1770,11 +1771,11 @@ function Us({
1770
1771
  a.lock_record && /* @__PURE__ */ e(Ce, { variant: "outline", className: "text-[10px] h-4 px-1", children: "locked" })
1771
1772
  ] }),
1772
1773
  (d || n.length > 0) && /* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 empty:hidden", children: [
1773
- d && /* @__PURE__ */ e(Bs, { s: a, census: d, onOpen: (g) => x.navigate(g) }),
1774
+ d && /* @__PURE__ */ e(Us, { s: a, census: d, onOpen: (g) => x.navigate(g) }),
1774
1775
  /* @__PURE__ */ e(
1775
- zs,
1776
+ Bs,
1776
1777
  {
1777
- users: js(n),
1778
+ users: Ms(n),
1778
1779
  valueGroups: n.filter((g) => g.filters && g.filters.length > 0)
1779
1780
  }
1780
1781
  )
@@ -1817,7 +1818,7 @@ function Us({
1817
1818
  }
1818
1819
  );
1819
1820
  }
1820
- function Qs({
1821
+ function Ws({
1821
1822
  d: a,
1822
1823
  siblings: n,
1823
1824
  onSave: o,
@@ -1946,7 +1947,7 @@ function Qs({
1946
1947
  ] })
1947
1948
  ] });
1948
1949
  }
1949
- function Ws({
1950
+ function Hs({
1950
1951
  d: a,
1951
1952
  siblings: n,
1952
1953
  onEdit: o,
@@ -1999,7 +2000,7 @@ function Ws({
1999
2000
  ] }),
2000
2001
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0", children: [
2001
2002
  /* @__PURE__ */ e(
2002
- Qs,
2003
+ Ws,
2003
2004
  {
2004
2005
  d: a,
2005
2006
  siblings: n,
@@ -2033,7 +2034,7 @@ function Ws({
2033
2034
  }
2034
2035
  );
2035
2036
  }
2036
- function Hs({
2037
+ function Vs({
2037
2038
  binding: a,
2038
2039
  templateId: n
2039
2040
  }) {
@@ -2043,8 +2044,8 @@ function Hs({
2043
2044
  d(i.map((c) => c.id));
2044
2045
  }, [i]);
2045
2046
  const p = m.map((c) => i.find((k) => k.id === c)).filter(Boolean), l = Jt(
2046
- et(Xt),
2047
- et(Zt, { coordinateGetter: ea })
2047
+ tt(Xt),
2048
+ tt(Zt, { coordinateGetter: ea })
2048
2049
  ), [v, h] = $(null), [u, y] = $({
2049
2050
  field: "",
2050
2051
  label: "",
@@ -2073,7 +2074,7 @@ function Hs({
2073
2074
  w(), h(null), P.success("Dimension updated");
2074
2075
  },
2075
2076
  onError: () => P.error("Failed to update dimension")
2076
- }), A = M({
2077
+ }), L = M({
2077
2078
  mutationFn: (c) => o.request($e(`/pipelines/dimensions/${c}`)),
2078
2079
  onSuccess: () => {
2079
2080
  w(), P.success("Dimension deleted");
@@ -2087,10 +2088,10 @@ function Hs({
2087
2088
  is_row_axis: c.is_row_axis,
2088
2089
  required: c.required
2089
2090
  });
2090
- }, O = (c) => {
2091
+ }, R = (c) => {
2091
2092
  const { active: k, over: E } = c;
2092
2093
  if (!E || k.id === E.id) return;
2093
- const F = m.indexOf(k.id), B = m.indexOf(E.id), j = Ze(m, F, B);
2094
+ const F = m.indexOf(k.id), B = m.indexOf(E.id), j = et(m, F, B);
2094
2095
  d(j), j.forEach((K, Q) => {
2095
2096
  var te;
2096
2097
  ((te = i.find((ae) => ae.id === K)) == null ? void 0 : te.sort) !== Q && S.mutate({ dimId: K, body: { sort: Q } });
@@ -2098,7 +2099,7 @@ function Hs({
2098
2099
  };
2099
2100
  return /* @__PURE__ */ t("div", { className: "border-t border-slate-100 bg-slate-50/50 px-4 pt-3 pb-4 space-y-3 rounded-b-lg", children: [
2100
2101
  i.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400 py-0.5", children: "No dimensions — add one below." }),
2101
- i.length > 0 && /* @__PURE__ */ e(Ye, { sensors: l, collisionDetection: Ie, onDragEnd: O, children: /* @__PURE__ */ e(Je, { items: m, strategy: Xe, children: /* @__PURE__ */ e("div", { className: "space-y-1.5", children: p.map(
2102
+ i.length > 0 && /* @__PURE__ */ e(Ie, { sensors: l, collisionDetection: Je, onDragEnd: R, children: /* @__PURE__ */ e(Xe, { items: m, strategy: Ze, children: /* @__PURE__ */ e("div", { className: "space-y-1.5", children: p.map(
2102
2103
  (c) => v === c.id ? /* @__PURE__ */ t(
2103
2104
  "div",
2104
2105
  {
@@ -2191,12 +2192,12 @@ function Hs({
2191
2192
  },
2192
2193
  c.id
2193
2194
  ) : /* @__PURE__ */ e(
2194
- Ws,
2195
+ Hs,
2195
2196
  {
2196
2197
  d: c,
2197
2198
  siblings: p,
2198
2199
  onEdit: () => D(c),
2199
- onDelete: () => A.mutate(c.id),
2200
+ onDelete: () => L.mutate(c.id),
2200
2201
  onSaveCascade: (k) => S.mutate({
2201
2202
  dimId: c.id,
2202
2203
  body: { cascade: k }
@@ -2282,27 +2283,27 @@ function Hs({
2282
2283
  ] })
2283
2284
  ] });
2284
2285
  }
2285
- function rr({
2286
+ function ir({
2286
2287
  templateId: a,
2287
2288
  onBack: n,
2288
2289
  onExport: o,
2289
2290
  hidden: f
2290
2291
  }) {
2291
2292
  var jt;
2292
- const i = Z(), m = _e(), d = new Set(f ?? []), [p, l] = $(!1), [v, h] = $(""), [u, y] = $(!1), [x, g] = $(null), [C, r] = $(!1), [w, N] = $(null), [S, A] = $(null), [D, O] = $(
2293
+ const i = Z(), m = _e(), d = new Set(f ?? []), [p, l] = $(!1), [v, h] = $(""), [u, y] = $(!1), [x, g] = $(null), [C, r] = $(!1), [w, N] = $(null), [S, L] = $(null), [D, R] = $(
2293
2294
  null
2294
2295
  ), [b, c] = $(""), [k, E] = $(""), [F, B] = $(null), [j, K] = $(!1), [Q, te] = $([]), ae = Jt(
2295
- et(Xt),
2296
- et(Zt, { coordinateGetter: ea })
2296
+ tt(Xt),
2297
+ tt(Zt, { coordinateGetter: ea })
2297
2298
  ), { data: ce } = V({
2298
2299
  queryKey: ["collection-fields", b],
2299
2300
  queryFn: () => i.request(G(`/collections/${b}`)).then((s) => {
2300
2301
  var _;
2301
- return (((_ = s.data) == null ? void 0 : _.fields) ?? []).filter((R) => !R.hidden);
2302
+ return (((_ = s.data) == null ? void 0 : _.fields) ?? []).filter((O) => !O.hidden);
2302
2303
  }),
2303
2304
  enabled: !!b
2304
- }), [de, nt] = $(null), {
2305
- data: L,
2305
+ }), [de, rt] = $(null), {
2306
+ data: A,
2306
2307
  isLoading: We,
2307
2308
  isError: U,
2308
2309
  error: X,
@@ -2313,38 +2314,38 @@ function rr({
2313
2314
  enabled: !!a
2314
2315
  }), [pe, wt] = $([]), [He, kt] = $({});
2315
2316
  ue(() => {
2316
- const s = (L == null ? void 0 : L.states) ?? [];
2317
+ const s = (A == null ? void 0 : A.states) ?? [];
2317
2318
  te(s.map((_) => _.id));
2318
- }, [L == null ? void 0 : L.states]), ue(() => {
2319
- const s = Vt((L == null ? void 0 : L.transitions) ?? []);
2319
+ }, [A == null ? void 0 : A.states]), ue(() => {
2320
+ const s = Vt((A == null ? void 0 : A.transitions) ?? []);
2320
2321
  wt(s.map((_) => _.label)), kt(
2321
- Object.fromEntries(s.map((_) => [_.label, _.routes.map((R) => R.ids[0])]))
2322
+ Object.fromEntries(s.map((_) => [_.label, _.routes.map((O) => O.ids[0])]))
2322
2323
  );
2323
- }, [L == null ? void 0 : L.transitions]);
2324
+ }, [A == null ? void 0 : A.transitions]);
2324
2325
  const { data: ha } = V({
2325
2326
  queryKey: ["collections", "tables_only"],
2326
2327
  queryFn: () => i.request(G("/collections?tables_only=true")).then((s) => s.data)
2327
- }), { data: rt } = V({
2328
+ }), { data: lt } = V({
2328
2329
  queryKey: ["pipeline-all-owner-groups", a],
2329
2330
  queryFn: () => i.request(G(`/pipelines/${a}/owner-groups`)).then((s) => s.data),
2330
2331
  enabled: !!a
2331
2332
  }), xa = ht(
2332
- () => ((L == null ? void 0 : L.bindings) ?? []).map((s) => s.collection),
2333
- [L == null ? void 0 : L.bindings]
2333
+ () => ((A == null ? void 0 : A.bindings) ?? []).map((s) => s.collection),
2334
+ [A == null ? void 0 : A.bindings]
2334
2335
  ), { data: Re, dataUpdatedAt: fa } = ra(
2335
2336
  a,
2336
2337
  xa
2337
2338
  ), ga = ht(
2338
2339
  () => Ya(
2339
2340
  (Re == null ? void 0 : Re.data) ?? [],
2340
- ((L == null ? void 0 : L.states) ?? []).map((s) => s.id)
2341
+ ((A == null ? void 0 : A.states) ?? []).map((s) => s.id)
2341
2342
  ),
2342
- [Re, L == null ? void 0 : L.states]
2343
+ [Re, A == null ? void 0 : A.states]
2343
2344
  ), ba = Ga(fa), se = () => {
2344
2345
  m.invalidateQueries({ queryKey: ["pipeline-template", a] }), m.invalidateQueries({ queryKey: ["pipeline-templates"] }), m.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
2345
2346
  }, ya = sa(Qa), { change: _t, clear: Ct } = Va("pipeline", a, {
2346
2347
  meId: ya.userId || null
2347
- }), va = p || u || !!x || C || !!w || !!D, lt = M({
2348
+ }), va = p || u || !!x || C || !!w || !!D, it = M({
2348
2349
  mutationFn: (s) => i.request(be(`/pipelines/${a}`, s)),
2349
2350
  onSuccess: () => {
2350
2351
  se(), l(!1);
@@ -2356,7 +2357,7 @@ function rr({
2356
2357
  se(), y(!1);
2357
2358
  },
2358
2359
  onError: () => P.error("Failed to add state")
2359
- }), it = M({
2360
+ }), ot = M({
2360
2361
  mutationFn: ({ stateId: s, body: _ }) => i.request(be(`/pipelines/states/${s}`, _)),
2361
2362
  onSuccess: () => {
2362
2363
  se(), g(null);
@@ -2368,8 +2369,8 @@ function rr({
2368
2369
  se(), P.success("State deleted");
2369
2370
  },
2370
2371
  onError: (s) => {
2371
- var R;
2372
- const _ = ((R = s == null ? void 0 : s.response) == null ? void 0 : R.error) ?? (s == null ? void 0 : s.message);
2372
+ var O;
2373
+ const _ = ((O = s == null ? void 0 : s.response) == null ? void 0 : O.error) ?? (s == null ? void 0 : s.message);
2373
2374
  P.error(_ || "Failed to delete state", { duration: 9e3 });
2374
2375
  }
2375
2376
  }), qt = M({
@@ -2392,8 +2393,8 @@ function rr({
2392
2393
  actions: s.actions,
2393
2394
  sort: 0
2394
2395
  };
2395
- for (const R of s.to_states)
2396
- await i.request(I(`/pipelines/${a}/transitions`, { ..._, to_state: R }));
2396
+ for (const O of s.to_states)
2397
+ await i.request(I(`/pipelines/${a}/transitions`, { ..._, to_state: O }));
2397
2398
  },
2398
2399
  onSuccess: () => {
2399
2400
  se(), r(!1);
@@ -2404,7 +2405,7 @@ function rr({
2404
2405
  labelGroup: s,
2405
2406
  data: _
2406
2407
  }) => {
2407
- for (const R of _.to_states)
2408
+ for (const O of _.to_states)
2408
2409
  await i.request(
2409
2410
  I(`/pipelines/${a}/transitions`, {
2410
2411
  from_state: _.from_state,
@@ -2422,7 +2423,7 @@ function rr({
2422
2423
  group_label: null,
2423
2424
  actions: _.actions,
2424
2425
  sort: Math.max(s.minSort, ...s.routes.map((Y) => Y.minSort)),
2425
- to_state: R
2426
+ to_state: O
2426
2427
  })
2427
2428
  );
2428
2429
  },
@@ -2432,9 +2433,9 @@ function rr({
2432
2433
  onError: () => P.error("Failed to add route")
2433
2434
  }), Ft = M({
2434
2435
  mutationFn: async ({ route: s, data: _ }) => {
2435
- const R = /* @__PURE__ */ new Map();
2436
+ const O = /* @__PURE__ */ new Map();
2436
2437
  s.to_states.forEach((q, z) => {
2437
- R.set(q, s.ids[z]);
2438
+ O.set(q, s.ids[z]);
2438
2439
  });
2439
2440
  const Y = new Set(_.to_states), ee = {
2440
2441
  from_state: _.from_state,
@@ -2453,7 +2454,7 @@ function rr({
2453
2454
  actions: _.actions
2454
2455
  };
2455
2456
  for (const q of _.to_states) {
2456
- const z = R.get(q);
2457
+ const z = O.get(q);
2457
2458
  z ? await i.request(be(`/pipelines/transitions/${z}`, { ...ee, to_state: q })) : await i.request(
2458
2459
  I(`/pipelines/${a}/transitions`, {
2459
2460
  ...ee,
@@ -2463,11 +2464,11 @@ function rr({
2463
2464
  })
2464
2465
  );
2465
2466
  }
2466
- for (const [q, z] of R)
2467
+ for (const [q, z] of O)
2467
2468
  Y.has(q) || await i.request($e(`/pipelines/transitions/${z}`));
2468
2469
  },
2469
2470
  onSuccess: () => {
2470
- se(), O(null);
2471
+ se(), R(null);
2471
2472
  },
2472
2473
  onError: (s) => {
2473
2474
  zt(s, "Failed to update route");
@@ -2482,15 +2483,15 @@ function rr({
2482
2483
  onError: () => P.error("Failed to delete")
2483
2484
  }), wa = M({
2484
2485
  mutationFn: async (s) => {
2485
- for (const { id: _, sort: R } of s)
2486
- await i.request(be(`/pipelines/transitions/${_}`, { sort: R }));
2486
+ for (const { id: _, sort: O } of s)
2487
+ await i.request(be(`/pipelines/transitions/${_}`, { sort: O }));
2487
2488
  },
2488
2489
  onSuccess: () => se(),
2489
2490
  onError: () => P.error("Failed to reorder")
2490
2491
  }), ka = M({
2491
2492
  mutationFn: async ({ ids: s, color: _ }) => {
2492
- for (const R of s)
2493
- await i.request(be(`/pipelines/transitions/${R}`, { color: _ }));
2493
+ for (const O of s)
2494
+ await i.request(be(`/pipelines/transitions/${O}`, { color: _ }));
2494
2495
  },
2495
2496
  onSuccess: () => se(),
2496
2497
  onError: () => P.error("Failed to update color")
@@ -2498,10 +2499,10 @@ function rr({
2498
2499
  mutationFn: async ({
2499
2500
  from: s,
2500
2501
  label: _,
2501
- confirmed: R
2502
+ confirmed: O
2502
2503
  }) => {
2503
2504
  var ee, q;
2504
- if (!R) {
2505
+ if (!O) {
2505
2506
  const ne = ((ee = (await i.request(I(`/pipelines/${a}/transitions/rename`, { from: s, to: _, dry_run: !0 }))).data) == null ? void 0 : ee.references) ?? [];
2506
2507
  if (ne.length > 0) return { pending: { from: s, to: _, references: ne } };
2507
2508
  }
@@ -2514,9 +2515,9 @@ function rr({
2514
2515
  Ve(s.pending);
2515
2516
  return;
2516
2517
  }
2517
- const R = "done" in s ? s.done.filter((Y) => Y.rewritten).length : 0;
2518
- se(), A(null), Ve(null), P.success(
2519
- R ? `Renamed to "${_}" · ${R} reference${R === 1 ? "" : "s"} updated` : `Renamed to "${_}"`
2518
+ const O = "done" in s ? s.done.filter((Y) => Y.rewritten).length : 0;
2519
+ se(), L(null), Ve(null), P.success(
2520
+ O ? `Renamed to "${_}" · ${O} reference${O === 1 ? "" : "s"} updated` : `Renamed to "${_}"`
2520
2521
  );
2521
2522
  },
2522
2523
  onError: (s) => {
@@ -2534,14 +2535,14 @@ function rr({
2534
2535
  se(), P.success("Collection unbound");
2535
2536
  },
2536
2537
  onError: () => P.error("Failed to unbind")
2537
- }), ot = M({
2538
+ }), Ge = M({
2538
2539
  mutationFn: ({
2539
2540
  bindingId: s,
2540
2541
  body: _
2541
2542
  }) => i.request(be(`/pipelines/bindings/${s}`, _)),
2542
2543
  onSuccess: () => se(),
2543
2544
  onError: () => P.error("Failed to update binding")
2544
- }), Rt = Ke(!1), Tt = !!L;
2545
+ }), Rt = Ke(!1), Tt = !!A;
2545
2546
  if (ue(() => {
2546
2547
  if (!Tt || Rt.current || typeof window > "u" || window.location.hash !== "#owner-matrix") return;
2547
2548
  Rt.current = !0;
@@ -2550,7 +2551,7 @@ function rr({
2550
2551
  (_ = document.getElementById("owner-matrix")) == null || _.scrollIntoView({ block: "start" });
2551
2552
  }, 50);
2552
2553
  return () => window.clearTimeout(s);
2553
- }, [Tt]), U && !L)
2554
+ }, [Tt]), U && !A)
2554
2555
  return /* @__PURE__ */ e(
2555
2556
  rs,
2556
2557
  {
@@ -2559,18 +2560,18 @@ function rr({
2559
2560
  onRetry: () => void me()
2560
2561
  }
2561
2562
  );
2562
- if (We || !L)
2563
+ if (We || !A)
2563
2564
  return /* @__PURE__ */ t("div", { className: "p-8 space-y-4", children: [
2564
2565
  /* @__PURE__ */ e(je, { className: "h-8 w-64" }),
2565
2566
  /* @__PURE__ */ e(je, { className: "h-48 rounded-xl" }),
2566
2567
  /* @__PURE__ */ e(je, { className: "h-48 rounded-xl" })
2567
2568
  ] });
2568
- const le = L.states ?? [], Pt = L.transitions ?? [], ie = L.bindings ?? [], Pe = [...new Set(ie.map((s) => s.collection))], Ca = ha ?? [], ct = Q.length > 0 ? Q.map((s) => le.find((_) => _.id === s)).filter(Boolean) : le, At = new Map(le.map((s) => [s.id, s])), dt = new Map(Vt(Pt).map((s) => [s.label, s])), Lt = pe.map((s) => dt.get(s)).filter((s) => !!s);
2569
- function Dt(s, _, R) {
2569
+ const le = A.states ?? [], Pt = A.transitions ?? [], ie = A.bindings ?? [], Pe = [...new Set(ie.map((s) => s.collection))], Ca = ha ?? [], ct = Q.length > 0 ? Q.map((s) => le.find((_) => _.id === s)).filter(Boolean) : le, At = new Map(le.map((s) => [s.id, s])), dt = new Map(Vt(Pt).map((s) => [s.label, s])), Lt = pe.map((s) => dt.get(s)).filter((s) => !!s);
2570
+ function Dt(s, _, O) {
2570
2571
  const Y = [];
2571
2572
  let ee = 0;
2572
2573
  for (const q of s) {
2573
- const z = R.get(q);
2574
+ const z = O.get(q);
2574
2575
  if (z)
2575
2576
  for (const ne of _[q] ?? []) {
2576
2577
  const fe = z.routes.find((xe) => xe.ids[0] === ne);
@@ -2583,28 +2584,28 @@ function rr({
2583
2584
  wa.mutate(Y);
2584
2585
  }
2585
2586
  function Sa(s) {
2586
- const { active: _, over: R } = s;
2587
- if (!R || _.id === R.id) return;
2588
- const Y = Ze(
2587
+ const { active: _, over: O } = s;
2588
+ if (!O || _.id === O.id) return;
2589
+ const Y = et(
2589
2590
  pe,
2590
2591
  pe.indexOf(_.id),
2591
- pe.indexOf(R.id)
2592
+ pe.indexOf(O.id)
2592
2593
  );
2593
2594
  wt(Y), Dt(Y, He, dt);
2594
2595
  }
2595
2596
  function qa(s, _) {
2596
- const { active: R, over: Y } = _;
2597
- if (!Y || R.id === Y.id) return;
2598
- const ee = He[s] ?? [], q = Ze(ee, ee.indexOf(R.id), ee.indexOf(Y.id)), z = { ...He, [s]: q };
2597
+ const { active: O, over: Y } = _;
2598
+ if (!Y || O.id === Y.id) return;
2599
+ const ee = He[s] ?? [], q = et(ee, ee.indexOf(O.id), ee.indexOf(Y.id)), z = { ...He, [s]: q };
2599
2600
  kt(z), Dt(pe, z, dt);
2600
2601
  }
2601
2602
  const $a = ie.some((s) => (s.dimensions ?? []).length > 0), Fa = new Set(ie.map((s) => s.collection)), Ea = Ca.filter((s) => !Fa.has(s.collection)), Oa = (s) => {
2602
- const { active: _, over: R } = s;
2603
- if (!R || _.id === R.id) return;
2604
- const Y = Q.indexOf(_.id), ee = Q.indexOf(R.id), q = Ze(Q, Y, ee);
2603
+ const { active: _, over: O } = s;
2604
+ if (!O || _.id === O.id) return;
2605
+ const Y = Q.indexOf(_.id), ee = Q.indexOf(O.id), q = et(Q, Y, ee);
2605
2606
  te(q), q.forEach((z, ne) => {
2606
2607
  var fe;
2607
- ((fe = le.find((xe) => xe.id === z)) == null ? void 0 : fe.sort) !== ne && it.mutate({ stateId: z, body: { sort: ne } });
2608
+ ((fe = le.find((xe) => xe.id === z)) == null ? void 0 : fe.sort) !== ne && ot.mutate({ stateId: z, body: { sort: ne } });
2608
2609
  });
2609
2610
  };
2610
2611
  return /* @__PURE__ */ t(ye, { children: [
@@ -2631,7 +2632,7 @@ function rr({
2631
2632
  {
2632
2633
  className: "flex items-center gap-1.5",
2633
2634
  onSubmit: (s) => {
2634
- s.preventDefault(), v.trim() && lt.mutate({ name: v.trim() });
2635
+ s.preventDefault(), v.trim() && it.mutate({ name: v.trim() });
2635
2636
  },
2636
2637
  children: [
2637
2638
  /* @__PURE__ */ e(
@@ -2663,10 +2664,10 @@ function rr({
2663
2664
  type: "button",
2664
2665
  className: "flex items-center gap-1.5 font-medium text-slate-800 hover:text-slate-600",
2665
2666
  onClick: () => {
2666
- h(L.name), l(!0);
2667
+ h(A.name), l(!0);
2667
2668
  },
2668
2669
  children: [
2669
- L.name,
2670
+ A.name,
2670
2671
  /* @__PURE__ */ e(Le, { className: "h-3 w-3 text-slate-400" })
2671
2672
  ]
2672
2673
  }
@@ -2678,7 +2679,7 @@ function rr({
2678
2679
  {
2679
2680
  collection: "nivaro_workflow_templates",
2680
2681
  item: a,
2681
- title: `History · ${L.name}`
2682
+ title: `History · ${A.name}`
2682
2683
  }
2683
2684
  ),
2684
2685
  o && /* @__PURE__ */ t(
@@ -2721,12 +2722,12 @@ function rr({
2721
2722
  /* @__PURE__ */ e(
2722
2723
  W,
2723
2724
  {
2724
- defaultValue: L.description ?? "",
2725
+ defaultValue: A.description ?? "",
2725
2726
  placeholder: "What does this pipeline govern?",
2726
2727
  className: "text-[13px]",
2727
2728
  onBlur: (s) => {
2728
2729
  const _ = s.target.value.trim() || null;
2729
- _ !== L.description && lt.mutate({ description: _ });
2730
+ _ !== A.description && it.mutate({ description: _ });
2730
2731
  }
2731
2732
  }
2732
2733
  )
@@ -2734,10 +2735,10 @@ function rr({
2734
2735
  /* @__PURE__ */ t("div", { className: "shrink-0 space-y-1.5", children: [
2735
2736
  /* @__PURE__ */ e(H, { className: "text-[12px]", children: "Accent color" }),
2736
2737
  /* @__PURE__ */ e(
2737
- tt,
2738
+ at,
2738
2739
  {
2739
- value: L.color,
2740
- onChange: (s) => lt.mutate({ color: s })
2740
+ value: A.color,
2741
+ onChange: (s) => it.mutate({ color: s })
2741
2742
  }
2742
2743
  )
2743
2744
  ] })
@@ -2774,29 +2775,29 @@ function rr({
2774
2775
  ] }),
2775
2776
  le.length === 0 && !u && /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-400", children: "No states yet. States define the stages a record can be in." }),
2776
2777
  /* @__PURE__ */ e(
2777
- Ye,
2778
+ Ie,
2778
2779
  {
2779
2780
  sensors: ae,
2780
- collisionDetection: Ie,
2781
+ collisionDetection: Je,
2781
2782
  onDragEnd: Oa,
2782
- children: /* @__PURE__ */ e(Je, { items: Q, strategy: Xe, children: /* @__PURE__ */ t("div", { className: "space-y-2", ref: ba, children: [
2783
+ children: /* @__PURE__ */ e(Xe, { items: Q, strategy: Ze, children: /* @__PURE__ */ t("div", { className: "space-y-2", ref: ba, children: [
2783
2784
  ct.map((s) => {
2784
- var _, R;
2785
+ var _, O;
2785
2786
  return /* @__PURE__ */ t("div", { children: [
2786
2787
  (x == null ? void 0 : x.id) === s.id ? /* @__PURE__ */ e(
2787
2788
  Wt,
2788
2789
  {
2789
2790
  reach: Pe,
2790
2791
  initial: s,
2791
- saving: it.isPending,
2792
- onSave: (Y) => it.mutate({ stateId: s.id, body: Y }),
2792
+ saving: ot.isPending,
2793
+ onSave: (Y) => ot.mutate({ stateId: s.id, body: Y }),
2793
2794
  onCancel: () => g(null)
2794
2795
  }
2795
2796
  ) : /* @__PURE__ */ e(
2796
- Us,
2797
+ Qs,
2797
2798
  {
2798
2799
  s,
2799
- groups: (rt == null ? void 0 : rt[s.id]) ?? [],
2800
+ groups: (lt == null ? void 0 : lt[s.id]) ?? [],
2800
2801
  expandedStateId: F,
2801
2802
  onToggleExpand: () => B(F === s.id ? null : s.id),
2802
2803
  onEdit: () => g(s),
@@ -2806,7 +2807,7 @@ function rr({
2806
2807
  ),
2807
2808
  F === s.id && (x == null ? void 0 : x.id) !== s.id && /* @__PURE__ */ t("div", { className: "ml-4 mb-2 mt-2 rounded-xl border border-slate-200 bg-slate-50 p-4 space-y-4", children: [
2808
2809
  /* @__PURE__ */ e(
2809
- gs,
2810
+ bs,
2810
2811
  {
2811
2812
  stateId: s.id,
2812
2813
  stateName: s.label,
@@ -2815,13 +2816,13 @@ function rr({
2815
2816
  }
2816
2817
  ),
2817
2818
  /* @__PURE__ */ e("div", { className: "border-t border-slate-200 pt-4", children: /* @__PURE__ */ e(
2818
- fs,
2819
+ gs,
2819
2820
  {
2820
2821
  stateId: s.id,
2821
2822
  stateName: s.label,
2822
2823
  templateId: a,
2823
2824
  initialCriteria: s.skip_criteria ?? null,
2824
- collection: (R = ie[0]) == null ? void 0 : R.collection
2825
+ collection: (O = ie[0]) == null ? void 0 : O.collection
2825
2826
  }
2826
2827
  ) })
2827
2828
  ] })
@@ -2866,14 +2867,14 @@ function rr({
2866
2867
  le.length < 2 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Add at least 2 states before defining transitions." }),
2867
2868
  /* @__PURE__ */ t("div", { className: "space-y-3", children: [
2868
2869
  /* @__PURE__ */ e(
2869
- Ye,
2870
+ Ie,
2870
2871
  {
2871
2872
  sensors: ae,
2872
- collisionDetection: Ie,
2873
+ collisionDetection: Je,
2873
2874
  onDragEnd: Sa,
2874
- children: /* @__PURE__ */ e(Je, { items: pe, strategy: Xe, children: Lt.map((s) => {
2875
+ children: /* @__PURE__ */ e(Xe, { items: pe, strategy: Ze, children: Lt.map((s) => {
2875
2876
  var ee;
2876
- const _ = new Map(s.routes.map((q) => [q.ids[0], q])), R = He[s.label] ?? s.routes.map((q) => q.ids[0]), Y = R.map((q) => _.get(q)).filter((q) => !!q);
2877
+ const _ = new Map(s.routes.map((q) => [q.ids[0], q])), O = He[s.label] ?? s.routes.map((q) => q.ids[0]), Y = O.map((q) => _.get(q)).filter((q) => !!q);
2877
2878
  return /* @__PURE__ */ e(Gt, { id: s.label, children: /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
2878
2879
  /* @__PURE__ */ t("div", { className: "group/hdr flex items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border dark:bg-muted/50", children: [
2879
2880
  /* @__PURE__ */ e(Yt, {}),
@@ -2896,7 +2897,7 @@ function rr({
2896
2897
  children: [
2897
2898
  /* @__PURE__ */ e("p", { className: "mb-2 text-[11px] font-medium text-slate-500", children: "Group color" }),
2898
2899
  /* @__PURE__ */ e(
2899
- tt,
2900
+ at,
2900
2901
  {
2901
2902
  value: s.color,
2902
2903
  onChange: (q) => {
@@ -2924,12 +2925,12 @@ function rr({
2924
2925
  {
2925
2926
  autoFocus: !0,
2926
2927
  value: q,
2927
- onChange: (oe) => A({
2928
+ onChange: (oe) => L({
2928
2929
  from: s.label,
2929
2930
  value: oe.target.value
2930
2931
  }),
2931
2932
  onKeyDown: (oe) => {
2932
- oe.key === "Enter" && (oe.preventDefault(), xe()), oe.key === "Escape" && A(null);
2933
+ oe.key === "Enter" && (oe.preventDefault(), xe()), oe.key === "Escape" && L(null);
2933
2934
  },
2934
2935
  "aria-label": "Button label",
2935
2936
  className: "h-7 max-w-[260px] text-[13px] font-semibold"
@@ -2952,7 +2953,7 @@ function rr({
2952
2953
  {
2953
2954
  type: "button",
2954
2955
  onClick: () => {
2955
- A(null), Ve(null);
2956
+ L(null), Ve(null);
2956
2957
  },
2957
2958
  title: "Cancel (Esc)",
2958
2959
  className: "rounded p-1 text-slate-400 hover:bg-slate-100",
@@ -3008,7 +3009,7 @@ function rr({
3008
3009
  "button",
3009
3010
  {
3010
3011
  type: "button",
3011
- onClick: () => A({ from: s.label, value: s.label }),
3012
+ onClick: () => L({ from: s.label, value: s.label }),
3012
3013
  title: "Rename this button",
3013
3014
  "aria-label": `Rename ${s.label}`,
3014
3015
  className: "rounded p-1 text-slate-300 opacity-0 hover:text-slate-600 group-hover/hdr:opacity-100 transition-opacity",
@@ -3048,16 +3049,16 @@ function rr({
3048
3049
  )
3049
3050
  ] }),
3050
3051
  /* @__PURE__ */ e(
3051
- Ye,
3052
+ Ie,
3052
3053
  {
3053
3054
  sensors: ae,
3054
- collisionDetection: Ie,
3055
+ collisionDetection: Je,
3055
3056
  onDragEnd: (q) => qa(s.label, q),
3056
3057
  children: /* @__PURE__ */ e(
3057
- Je,
3058
+ Xe,
3058
3059
  {
3059
- items: R,
3060
- strategy: Xe,
3060
+ items: O,
3061
+ strategy: Ze,
3061
3062
  children: Y.map((q) => {
3062
3063
  var xe;
3063
3064
  const z = `${s.label}|${q.from_state ?? "_any_"}|${q.ids[0]}`, ne = q.from_state ? At.get(q.from_state) : null;
@@ -3094,7 +3095,7 @@ function rr({
3094
3095
  collection: (xe = ie[0]) == null ? void 0 : xe.collection,
3095
3096
  saving: Ft.isPending,
3096
3097
  onSave: (re) => Ft.mutate({ route: q, data: re }),
3097
- onCancel: () => O(null)
3098
+ onCancel: () => R(null)
3098
3099
  }
3099
3100
  )
3100
3101
  },
@@ -3178,7 +3179,7 @@ function rr({
3178
3179
  "button",
3179
3180
  {
3180
3181
  type: "button",
3181
- onClick: () => O({ label: s.label, route: q }),
3182
+ onClick: () => R({ label: s.label, route: q }),
3182
3183
  className: "rounded p-1 text-slate-400 hover:text-slate-700",
3183
3184
  children: /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" })
3184
3185
  }
@@ -3234,7 +3235,7 @@ function rr({
3234
3235
  ] })
3235
3236
  ] })
3236
3237
  ] }),
3237
- !d.has("branches") && /* @__PURE__ */ e(en, { templateId: a, states: ct }),
3238
+ !d.has("branches") && /* @__PURE__ */ e(tn, { templateId: a, states: ct }),
3238
3239
  !d.has("bindings") && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3239
3240
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
3240
3241
  "Applied to Collections",
@@ -3259,10 +3260,10 @@ function rr({
3259
3260
  {
3260
3261
  type: "checkbox",
3261
3262
  checked: !!s.auto_start,
3262
- onChange: (R) => ot.mutate({
3263
+ onChange: (O) => Ge.mutate({
3263
3264
  bindingId: s.id,
3264
3265
  body: {
3265
- auto_start: R.target.checked,
3266
+ auto_start: O.target.checked,
3266
3267
  auto_start_state: s.auto_start_state
3267
3268
  }
3268
3269
  }),
@@ -3274,12 +3275,12 @@ function rr({
3274
3275
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
3275
3276
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Owner fallback:" }),
3276
3277
  /* @__PURE__ */ e(
3277
- Js,
3278
+ Xs,
3278
3279
  {
3279
3280
  value: s.owner_fallback_field ?? "",
3280
- onCommit: (R) => ot.mutate({
3281
+ onCommit: (O) => Ge.mutate({
3281
3282
  bindingId: s.id,
3282
- body: { owner_fallback_field: R || null }
3283
+ body: { owner_fallback_field: O || null }
3283
3284
  })
3284
3285
  }
3285
3286
  )
@@ -3290,13 +3291,13 @@ function rr({
3290
3291
  he,
3291
3292
  {
3292
3293
  value: s.auto_start_state ?? "",
3293
- onChange: (R) => ot.mutate({
3294
+ onChange: (O) => Ge.mutate({
3294
3295
  bindingId: s.id,
3295
- body: { auto_start: !0, auto_start_state: R || null }
3296
+ body: { auto_start: !0, auto_start_state: O || null }
3296
3297
  }),
3297
- options: ((L == null ? void 0 : L.states) ?? []).map((R) => ({
3298
- value: R.id,
3299
- label: R.label
3298
+ options: ((A == null ? void 0 : A.states) ?? []).map((O) => ({
3299
+ value: O.id,
3300
+ label: O.label
3300
3301
  })),
3301
3302
  noneLabel: "First initial state",
3302
3303
  placeholder: "First initial state",
@@ -3304,14 +3305,29 @@ function rr({
3304
3305
  }
3305
3306
  )
3306
3307
  ] })
3307
- ] })
3308
+ ] }),
3309
+ /* @__PURE__ */ e(
3310
+ ms,
3311
+ {
3312
+ collection: s.collection,
3313
+ roles: s.start_state_roles,
3314
+ allowed: s.start_state_allowed,
3315
+ states: ((A == null ? void 0 : A.states) ?? []).map((O) => ({
3316
+ id: String(O.id),
3317
+ key: O.key,
3318
+ label: O.label,
3319
+ is_initial: !!O.is_initial
3320
+ })),
3321
+ onSave: (O) => Ge.mutate({ bindingId: s.id, body: O })
3322
+ }
3323
+ )
3308
3324
  ] }),
3309
3325
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0", children: [
3310
3326
  /* @__PURE__ */ t(
3311
3327
  "button",
3312
3328
  {
3313
3329
  type: "button",
3314
- onClick: () => nt(de === s.id ? null : s.id),
3330
+ onClick: () => rt(de === s.id ? null : s.id),
3315
3331
  className: J(
3316
3332
  "flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
3317
3333
  de === s.id ? "bg-nvr-cyan/10 text-nvr-cyan" : "text-slate-500 hover:bg-slate-100 hover:text-slate-700"
@@ -3342,7 +3358,7 @@ function rr({
3342
3358
  )
3343
3359
  ] })
3344
3360
  ] }),
3345
- de === s.id && /* @__PURE__ */ e(Hs, { binding: s, templateId: a })
3361
+ de === s.id && /* @__PURE__ */ e(Vs, { binding: s, templateId: a })
3346
3362
  ] }, s.id);
3347
3363
  }) }),
3348
3364
  /* @__PURE__ */ t("div", { className: "space-y-2 pt-2", children: [
@@ -3412,7 +3428,7 @@ function rr({
3412
3428
  ] }),
3413
3429
  /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-wrap gap-1.5 sm:justify-end", children: [
3414
3430
  /* @__PURE__ */ e(
3415
- ps,
3431
+ us,
3416
3432
  {
3417
3433
  templateId: a,
3418
3434
  collections: ie.map((s) => s.collection)
@@ -3433,27 +3449,27 @@ function rr({
3433
3449
  )
3434
3450
  ] })
3435
3451
  ] }),
3436
- /* @__PURE__ */ e(ms, { templateId: a, states: ct, bindings: ie })
3452
+ /* @__PURE__ */ e(ps, { templateId: a, states: ct, bindings: ie })
3437
3453
  ]
3438
3454
  }
3439
3455
  ),
3440
- j && /* @__PURE__ */ e(mn, { onClose: () => K(!1) }),
3441
- !d.has("simulator") && /* @__PURE__ */ e(tn, { bindings: ie }),
3442
- !d.has("canvas") && /* @__PURE__ */ e(on, { templateId: a }),
3443
- !d.has("flow-map") && /* @__PURE__ */ e(cn, { templateId: a }),
3456
+ j && /* @__PURE__ */ e(pn, { onClose: () => K(!1) }),
3457
+ !d.has("simulator") && /* @__PURE__ */ e(an, { bindings: ie }),
3458
+ !d.has("canvas") && /* @__PURE__ */ e(cn, { templateId: a }),
3459
+ !d.has("flow-map") && /* @__PURE__ */ e(dn, { templateId: a }),
3444
3460
  !d.has("cumulative-flow") && /* @__PURE__ */ e(ss, { templateId: a }),
3445
- !d.has("replay") && /* @__PURE__ */ e(dn, { templateId: a }),
3446
- !d.has("migration") && /* @__PURE__ */ e(ln, { templateId: a }),
3447
- !d.has("lint") && /* @__PURE__ */ e(hs, { templateId: a }),
3448
- !d.has("coverage") && /* @__PURE__ */ e(nn, { templateId: a, states: le }),
3449
- !d.has("skip-report") && /* @__PURE__ */ e(xs, { templateId: a }),
3450
- !d.has("ai-review") && /* @__PURE__ */ e(Vs, { templateId: a }),
3451
- !d.has("versions") && /* @__PURE__ */ e(Gs, { templateId: a }),
3452
- !d.has("matrix-versions") && /* @__PURE__ */ e(us, { templateId: a })
3461
+ !d.has("replay") && /* @__PURE__ */ e(mn, { templateId: a }),
3462
+ !d.has("migration") && /* @__PURE__ */ e(on, { templateId: a }),
3463
+ !d.has("lint") && /* @__PURE__ */ e(xs, { templateId: a }),
3464
+ !d.has("coverage") && /* @__PURE__ */ e(rn, { templateId: a, states: le }),
3465
+ !d.has("skip-report") && /* @__PURE__ */ e(fs, { templateId: a }),
3466
+ !d.has("ai-review") && /* @__PURE__ */ e(Gs, { templateId: a }),
3467
+ !d.has("versions") && /* @__PURE__ */ e(Ys, { templateId: a }),
3468
+ !d.has("matrix-versions") && /* @__PURE__ */ e(hs, { templateId: a })
3453
3469
  ] })
3454
3470
  ] });
3455
3471
  }
3456
- function Vs({ templateId: a }) {
3472
+ function Gs({ templateId: a }) {
3457
3473
  const n = Z(), [o, f] = $(
3458
3474
  null
3459
3475
  ), i = M({
@@ -3496,7 +3512,7 @@ function Vs({ templateId: a }) {
3496
3512
  ] })
3497
3513
  ] });
3498
3514
  }
3499
- function Gs({ templateId: a }) {
3515
+ function Ys({ templateId: a }) {
3500
3516
  const n = Z(), o = _e(), [f, i] = $(null), [m, d] = $(null), { data: p, isFetching: l } = V({
3501
3517
  queryKey: ["pipeline-version-diff", a, m],
3502
3518
  queryFn: () => n.request(G(`/pipelines/${a}/versions/${m}/diff`)).then((y) => y.data),
@@ -3581,16 +3597,16 @@ function Gs({ templateId: a }) {
3581
3597
  ] })
3582
3598
  ] }, y.id);
3583
3599
  }) }),
3584
- m != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: l ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : p ? /* @__PURE__ */ e(Ys, { fromVersion: p.from_version, to: p.to, diff: p.diff }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Could not load the diff." }) }),
3600
+ m != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: l ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : p ? /* @__PURE__ */ e(Is, { fromVersion: p.from_version, to: p.to, diff: p.diff }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Could not load the diff." }) }),
3585
3601
  /* @__PURE__ */ e("p", { className: "text-[10.5px] text-slate-400", children: "Restore snapshots the current config first, then upserts states/transitions/bindings by id — states are never deleted, and transitions with execution history are kept." })
3586
3602
  ] });
3587
3603
  }
3588
- function Ge(a) {
3604
+ function Ye(a) {
3589
3605
  if (a == null || a === "") return "(empty)";
3590
3606
  const n = typeof a == "string" ? a : JSON.stringify(a);
3591
3607
  return n.length > 80 ? `${n.slice(0, 80)}…` : n;
3592
3608
  }
3593
- function Ys({
3609
+ function Is({
3594
3610
  fromVersion: a,
3595
3611
  to: n,
3596
3612
  diff: o
@@ -3618,10 +3634,10 @@ function Ys({
3618
3634
  /* @__PURE__ */ e("span", { className: "font-mono", children: m.field }),
3619
3635
  ":",
3620
3636
  " ",
3621
- /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ge(m.from) }),
3637
+ /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ye(m.from) }),
3622
3638
  " ",
3623
3639
  "→ ",
3624
- /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ge(m.to) })
3640
+ /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ye(m.to) })
3625
3641
  ]
3626
3642
  },
3627
3643
  m.field
@@ -3661,11 +3677,11 @@ function Ys({
3661
3677
  /* @__PURE__ */ e("span", { className: "font-mono", children: l.field }),
3662
3678
  ":",
3663
3679
  " ",
3664
- /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ge(l.from) }),
3680
+ /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ye(l.from) }),
3665
3681
  " ",
3666
3682
  "→",
3667
3683
  " ",
3668
- /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ge(l.to) })
3684
+ /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ye(l.to) })
3669
3685
  ]
3670
3686
  },
3671
3687
  l.field
@@ -3678,10 +3694,10 @@ function Ys({
3678
3694
  function da(a, n) {
3679
3695
  return a.filter((o) => !o.is_terminal && !n.includes(o.key)).map((o) => ({ value: o.key, label: o.label }));
3680
3696
  }
3681
- function Is(a) {
3697
+ function Js(a) {
3682
3698
  return a ? `Runs only while the record is in ${a}, by that step's owners or an administrator.` : "No starting step: only an administrator can run this split.";
3683
3699
  }
3684
- function at({
3700
+ function st({
3685
3701
  state: a,
3686
3702
  selected: n,
3687
3703
  onClick: o
@@ -3697,7 +3713,7 @@ function at({
3697
3713
  a.label
3698
3714
  ] }) : /* @__PURE__ */ e("span", { className: f, style: i, children: a.label });
3699
3715
  }
3700
- function Js({ value: a, onCommit: n }) {
3716
+ function Xs({ value: a, onCommit: n }) {
3701
3717
  const [o, f] = $(a);
3702
3718
  return ue(() => f(a), [a]), /* @__PURE__ */ e(
3703
3719
  "input",
@@ -3716,7 +3732,7 @@ function Js({ value: a, onCommit: n }) {
3716
3732
  }
3717
3733
  );
3718
3734
  }
3719
- function Xs({
3735
+ function Zs({
3720
3736
  states: a,
3721
3737
  saving: n,
3722
3738
  onSave: o,
@@ -3762,7 +3778,7 @@ function Xs({
3762
3778
  "text-[11px]",
3763
3779
  h ? "text-slate-500" : "text-amber-700 dark:text-amber-400"
3764
3780
  ),
3765
- children: Is(x)
3781
+ children: Js(x)
3766
3782
  }
3767
3783
  )
3768
3784
  ] }),
@@ -3772,7 +3788,7 @@ function Xs({
3772
3788
  /* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(pick 2 or more — the record enters ALL of them at once)" })
3773
3789
  ] }),
3774
3790
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: a.map((r) => /* @__PURE__ */ e(
3775
- at,
3791
+ st,
3776
3792
  {
3777
3793
  state: r,
3778
3794
  selected: d.includes(r.key),
@@ -3787,7 +3803,7 @@ function Xs({
3787
3803
  /* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(auto-entered when every branch reaches a terminal state)" })
3788
3804
  ] }),
3789
3805
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: a.filter((r) => !d.includes(r.key)).map((r) => /* @__PURE__ */ e(
3790
- at,
3806
+ st,
3791
3807
  {
3792
3808
  state: r,
3793
3809
  selected: l === r.key,
@@ -3817,7 +3833,7 @@ function Xs({
3817
3833
  ] })
3818
3834
  ] });
3819
3835
  }
3820
- function Zs({
3836
+ function en({
3821
3837
  split: a,
3822
3838
  states: n,
3823
3839
  saving: o,
@@ -3856,7 +3872,7 @@ function Zs({
3856
3872
  )
3857
3873
  ] });
3858
3874
  }
3859
- function en({
3875
+ function tn({
3860
3876
  templateId: a,
3861
3877
  states: n
3862
3878
  }) {
@@ -3929,7 +3945,7 @@ function en({
3929
3945
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
3930
3946
  /* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-700", children: g.label }),
3931
3947
  /* @__PURE__ */ e(
3932
- Zs,
3948
+ en,
3933
3949
  {
3934
3950
  split: g,
3935
3951
  states: n,
@@ -3938,9 +3954,9 @@ function en({
3938
3954
  }
3939
3955
  ),
3940
3956
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
3941
- g.branch_state_objs.map((r) => /* @__PURE__ */ e(at, { state: r }, r.id)),
3957
+ g.branch_state_objs.map((r) => /* @__PURE__ */ e(st, { state: r }, r.id)),
3942
3958
  /* @__PURE__ */ e(ta, { className: "h-3 w-3 shrink-0 text-slate-300" }),
3943
- g.join_state_obj ? /* @__PURE__ */ e(at, { state: g.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
3959
+ g.join_state_obj ? /* @__PURE__ */ e(st, { state: g.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
3944
3960
  ] })
3945
3961
  ] }),
3946
3962
  d === g.id ? /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-2", children: [
@@ -3981,7 +3997,7 @@ function en({
3981
3997
  );
3982
3998
  }),
3983
3999
  i && /* @__PURE__ */ e(
3984
- Xs,
4000
+ Zs,
3985
4001
  {
3986
4002
  states: n,
3987
4003
  saving: u.isPending,
@@ -3991,7 +4007,7 @@ function en({
3991
4007
  )
3992
4008
  ] });
3993
4009
  }
3994
- function tn({ bindings: a }) {
4010
+ function an({ bindings: a }) {
3995
4011
  var v;
3996
4012
  const n = Z(), [o, f] = $(""), [i, m] = $(""), d = i || ((v = a[0]) == null ? void 0 : v.collection) || "", p = M({
3997
4013
  mutationFn: () => n.request(I("/pipelines/simulate", { collection: d, item_id: o.trim() })).then((h) => h.data),
@@ -4186,25 +4202,25 @@ function ma({
4186
4202
  ] })
4187
4203
  ] });
4188
4204
  }
4189
- function an({
4205
+ function sn({
4190
4206
  templateId: a,
4191
4207
  cluster: n,
4192
4208
  onDone: o
4193
4209
  }) {
4194
4210
  var w, N;
4195
- const f = Z(), i = _e(), m = !!((w = n.suggestion) != null && w.group_id) && n.suggestion.mismatched_filters.length === 0, d = Object.values(n.dims).filter(Boolean).join(" · ") || "New group", [p, l] = $(d), [v, h] = $([]), [u, y] = $([]), x = Ns(), { data: g } = V({
4211
+ const f = Z(), i = _e(), m = !!((w = n.suggestion) != null && w.group_id) && n.suggestion.mismatched_filters.length === 0, d = Object.values(n.dims).filter(Boolean).join(" · ") || "New group", [p, l] = $(d), [v, h] = $([]), [u, y] = $([]), x = ws(), { data: g } = V({
4196
4212
  queryKey: ["user-groups-teams"],
4197
4213
  queryFn: () => f.request(G("/user-groups")).then((S) => S.data),
4198
4214
  staleTime: 6e4
4199
4215
  }), C = (g ?? []).map((S) => ({
4200
4216
  ...S,
4201
- rank: ws(S.scopes, n.filters, x, n.collection)
4217
+ rank: ks(S.scopes, n.filters, x, n.collection)
4202
4218
  })).sort(
4203
- (S, A) => Ut(S.rank.tier) - Ut(A.rank.tier) || S.name.localeCompare(A.name, void 0, { sensitivity: "base" })
4219
+ (S, L) => Ut(S.rank.tier) - Ut(L.rank.tier) || S.name.localeCompare(L.name, void 0, { sensitivity: "base" })
4204
4220
  ), r = M({
4205
4221
  mutationFn: async () => {
4206
- var A;
4207
- let S = m ? String((A = n.suggestion) == null ? void 0 : A.group_id) : null;
4222
+ var L;
4223
+ let S = m ? String((L = n.suggestion) == null ? void 0 : L.group_id) : null;
4208
4224
  if (!S) {
4209
4225
  const D = await f.request(
4210
4226
  I(`/pipelines/states/${n.state_id}/owner-groups`, {
@@ -4224,15 +4240,15 @@ function an({
4224
4240
  return v.length + u.length;
4225
4241
  },
4226
4242
  onSuccess: (S) => {
4227
- var A;
4243
+ var L;
4228
4244
  P.success(
4229
- m ? `Added ${S} owner${S === 1 ? "" : "s"} to ${(A = n.suggestion) == null ? void 0 : A.group_label}` : `Created "${p.trim() || d}" with ${S} owner${S === 1 ? "" : "s"}`
4245
+ m ? `Added ${S} owner${S === 1 ? "" : "s"} to ${(L = n.suggestion) == null ? void 0 : L.group_label}` : `Created "${p.trim() || d}" with ${S} owner${S === 1 ? "" : "s"}`
4230
4246
  ), i.invalidateQueries({ queryKey: ["owner-gaps", a] }), i.invalidateQueries({ queryKey: ["owner-lint", a] }), i.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] }), o();
4231
4247
  },
4232
4248
  onError: (S) => {
4233
- var A;
4249
+ var L;
4234
4250
  return P.error(
4235
- ((A = S == null ? void 0 : S.response) == null ? void 0 : A.error) ?? "Assignment failed",
4251
+ ((L = S == null ? void 0 : S.response) == null ? void 0 : L.error) ?? "Assignment failed",
4236
4252
  { duration: 9e3 }
4237
4253
  );
4238
4254
  }
@@ -4257,16 +4273,16 @@ function an({
4257
4273
  C.length > 0 && /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1", children: [
4258
4274
  /* @__PURE__ */ e("span", { className: "mr-0.5 text-[10.5px] font-medium uppercase tracking-wide text-slate-400", children: "Teams" }),
4259
4275
  C.map((S) => {
4260
- const A = u.includes(S.id);
4276
+ const L = u.includes(S.id);
4261
4277
  return /* @__PURE__ */ t(
4262
4278
  "button",
4263
4279
  {
4264
4280
  type: "button",
4265
4281
  "data-tip": S.rank.tier === "out" ? `Outside this combination — ${S.rank.mismatches.join("; ")}. Picking it is an override.` : S.rank.tier === "suggested" ? "Scoped to this combination" : void 0,
4266
- onClick: () => y(A ? u.filter((D) => D !== S.id) : [...u, S.id]),
4282
+ onClick: () => y(L ? u.filter((D) => D !== S.id) : [...u, S.id]),
4267
4283
  className: J(
4268
4284
  "inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] transition-colors",
4269
- A ? "border-violet-300 bg-violet-100 font-medium text-violet-700 dark:border-violet-500/40 dark:bg-violet-500/15 dark:text-violet-300" : S.rank.tier === "out" ? "border-amber-200 text-amber-700 hover:bg-amber-50 dark:border-amber-500/30 dark:text-amber-400 dark:hover:bg-amber-500/10" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300"
4285
+ L ? "border-violet-300 bg-violet-100 font-medium text-violet-700 dark:border-violet-500/40 dark:bg-violet-500/15 dark:text-violet-300" : S.rank.tier === "out" ? "border-amber-200 text-amber-700 hover:bg-amber-50 dark:border-amber-500/30 dark:text-amber-400 dark:hover:bg-amber-500/10" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300"
4270
4286
  ),
4271
4287
  children: [
4272
4288
  S.rank.tier === "suggested" && /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-emerald-500" }),
@@ -4294,7 +4310,7 @@ function an({
4294
4310
  ] })
4295
4311
  ] });
4296
4312
  }
4297
- function sn({ templateId: a, finding: n }) {
4313
+ function nn({ templateId: a, finding: n }) {
4298
4314
  const o = Z(), f = _e(), [i, m] = $(
4299
4315
  "idle"
4300
4316
  ), [d, p] = $([]), l = (r) => {
@@ -4490,7 +4506,7 @@ function sn({ templateId: a, finding: n }) {
4490
4506
  ] })
4491
4507
  ] });
4492
4508
  }
4493
- function nn({
4509
+ function rn({
4494
4510
  templateId: a,
4495
4511
  states: n
4496
4512
  }) {
@@ -4517,14 +4533,14 @@ function nn({
4517
4533
  onError: () => P.error("Cleanup failed")
4518
4534
  }), C = (h == null ? void 0 : h.clusters) ?? [], r = h == null ? void 0 : h.dead_seats, w = ((x == null ? void 0 : x.findings) ?? []).filter((b) => b.type !== "inactive_member"), N = C.reduce((b, c) => b + c.count, 0), S = new Map(
4519
4535
  n.map((b) => [b.key, { label: b.label, color: b.color ?? null }])
4520
- ), A = /* @__PURE__ */ new Map();
4536
+ ), L = /* @__PURE__ */ new Map();
4521
4537
  for (const b of C) {
4522
4538
  const c = b.state_key ?? "(unknown state)";
4523
- A.set(c, [...A.get(c) ?? [], b]);
4539
+ L.set(c, [...L.get(c) ?? [], b]);
4524
4540
  }
4525
- const D = [...A.entries()].sort(
4541
+ const D = [...L.entries()].sort(
4526
4542
  (b, c) => c[1].reduce((k, E) => k + E.count, 0) - b[1].reduce((k, E) => k + E.count, 0)
4527
- ), O = (b, c) => /* @__PURE__ */ t(
4543
+ ), R = (b, c) => /* @__PURE__ */ t(
4528
4544
  "span",
4529
4545
  {
4530
4546
  className: "inline-flex items-baseline gap-1 rounded border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] dark:border-border dark:bg-muted/40",
@@ -4711,7 +4727,7 @@ function nn({
4711
4727
  /* @__PURE__ */ t("div", { className: "px-3 py-2", children: [
4712
4728
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
4713
4729
  /* @__PURE__ */ e("span", { className: "w-8 shrink-0 text-[13px] font-semibold tabular-nums text-slate-800 dark:text-foreground", children: F.count }),
4714
- Object.entries(F.dims).filter(([, K]) => K).length > 0 ? Object.entries(F.dims).filter(([, K]) => K).map(([K, Q]) => O(K, Q)) : /* @__PURE__ */ e("span", { className: "text-[11px] italic text-slate-400", children: "no dimension values resolved" }),
4730
+ Object.entries(F.dims).filter(([, K]) => K).length > 0 ? Object.entries(F.dims).filter(([, K]) => K).map(([K, Q]) => R(K, Q)) : /* @__PURE__ */ e("span", { className: "text-[11px] italic text-slate-400", children: "no dimension values resolved" }),
4715
4731
  /* @__PURE__ */ t(
4716
4732
  "span",
4717
4733
  {
@@ -4767,7 +4783,7 @@ function nn({
4767
4783
  "No group comes close — assigning creates one for this combination."
4768
4784
  ] }) }),
4769
4785
  l === j && /* @__PURE__ */ e(
4770
- an,
4786
+ sn,
4771
4787
  {
4772
4788
  templateId: a,
4773
4789
  cluster: F,
@@ -4797,7 +4813,7 @@ function nn({
4797
4813
  ] }),
4798
4814
  /* @__PURE__ */ e("div", { className: "max-h-96 divide-y divide-slate-100 overflow-y-auto px-3 dark:divide-border/60", children: w.map((b, c) => (
4799
4815
  // biome-ignore lint/suspicious/noArrayIndexKey: findings are positional
4800
- /* @__PURE__ */ e(sn, { templateId: a, finding: b }, c)
4816
+ /* @__PURE__ */ e(nn, { templateId: a, finding: b }, c)
4801
4817
  )) })
4802
4818
  ] })
4803
4819
  ] })
@@ -4813,13 +4829,13 @@ function ua(a) {
4813
4829
  const o = n[n.length - 1].replace(/s$/i, "");
4814
4830
  return pa(o);
4815
4831
  }
4816
- function rn(a) {
4832
+ function ln(a) {
4817
4833
  return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (n) => ua(n));
4818
4834
  }
4819
4835
  function It(a, n) {
4820
- return Array.isArray(a) && a.length > 0 ? a.join(", ") : rn(n.map((o) => o.replace(/ \(wants \d+\)$/, "")).join(", "));
4836
+ return Array.isArray(a) && a.length > 0 ? a.join(", ") : ln(n.map((o) => o.replace(/ \(wants \d+\)$/, "")).join(", "));
4821
4837
  }
4822
- function ln({ templateId: a }) {
4838
+ function on({ templateId: a }) {
4823
4839
  const n = Z(), o = _e(), [f, i] = $(""), [m, d] = $(""), [p, l] = $(!1), { data: v } = V({
4824
4840
  queryKey: ["pipeline-bindings-start", a],
4825
4841
  queryFn: () => n.request(
@@ -4932,7 +4948,7 @@ function ln({ templateId: a }) {
4932
4948
  ] })
4933
4949
  ] });
4934
4950
  }
4935
- function on({ templateId: a }) {
4951
+ function cn({ templateId: a }) {
4936
4952
  const n = Z(), [o, f] = $(
4937
4953
  null
4938
4954
  ), [i, m] = $(() => {
@@ -4979,8 +4995,8 @@ function on({ templateId: a }) {
4979
4995
  de = Math.max(de, X.length), X.forEach((me, pe) => {
4980
4996
  ce.set(me, { x: 20 + U * (K + te), y: 20 + pe * (Q + ae) });
4981
4997
  });
4982
- const nt = 60 + (Math.max(0, ...j.keys()) + 1) * (K + te), L = 60 + de * (Q + ae);
4983
- return { pos: ce, width: nt, height: L, NODE_W: K, NODE_H: Q };
4998
+ const rt = 60 + (Math.max(0, ...j.keys()) + 1) * (K + te), A = 60 + de * (Q + ae);
4999
+ return { pos: ce, width: rt, height: A, NODE_W: K, NODE_H: Q };
4984
5000
  }, [l, v]), u = (c) => i[c] ?? h.pos.get(c) ?? { x: 20, y: 20 }, [y, x] = $(null), [g, C] = $(null), r = _e(), w = M({
4985
5001
  mutationFn: (c) => n.request(
4986
5002
  I(`/pipelines/${a}/transitions`, {
@@ -5017,7 +5033,7 @@ function on({ templateId: a }) {
5017
5033
  y: Math.max(0, k.origY + c.clientY - k.startY)
5018
5034
  }
5019
5035
  }));
5020
- }, A = () => {
5036
+ }, L = () => {
5021
5037
  if (y) {
5022
5038
  if (g) {
5023
5039
  const c = l.find((k) => {
@@ -5030,7 +5046,7 @@ function on({ templateId: a }) {
5030
5046
  return;
5031
5047
  }
5032
5048
  d.current && (d.current = null, m((c) => (localStorage.setItem(`nvr_canvas_${a}`, JSON.stringify(c)), c)));
5033
- }, D = (o == null ? void 0 : o.kind) === "state" ? l.find((c) => String(c.id) === o.id) : null, O = (o == null ? void 0 : o.kind) === "transition" ? v.find((c) => String(c.id) === o.id) : null, b = (c) => {
5049
+ }, D = (o == null ? void 0 : o.kind) === "state" ? l.find((c) => String(c.id) === o.id) : null, R = (o == null ? void 0 : o.kind) === "transition" ? v.find((c) => String(c.id) === o.id) : null, b = (c) => {
5034
5050
  const E = Array.from(document.querySelectorAll("h3, p, span, button")).find((F) => {
5035
5051
  var B;
5036
5052
  return ((B = F.textContent) == null ? void 0 : B.trim()) === c;
@@ -5046,7 +5062,7 @@ function on({ templateId: a }) {
5046
5062
  width: Math.max(h.width, 600),
5047
5063
  height: Math.max(h.height, 200),
5048
5064
  onPointerMove: S,
5049
- onPointerUp: A,
5065
+ onPointerUp: L,
5050
5066
  role: "img",
5051
5067
  "aria-label": "Workflow state machine",
5052
5068
  children: [
@@ -5177,7 +5193,7 @@ function on({ templateId: a }) {
5177
5193
  ]
5178
5194
  }
5179
5195
  ) }),
5180
- (D || O) && /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center gap-3 rounded-md border border-slate-100 px-3 py-2 text-[12.5px] dark:border-border", children: [
5196
+ (D || R) && /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center gap-3 rounded-md border border-slate-100 px-3 py-2 text-[12.5px] dark:border-border", children: [
5181
5197
  D && /* @__PURE__ */ t(ye, { children: [
5182
5198
  /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-foreground", children: D.label }),
5183
5199
  /* @__PURE__ */ t("span", { className: "text-slate-400", children: [
@@ -5200,18 +5216,18 @@ function on({ templateId: a }) {
5200
5216
  }
5201
5217
  )
5202
5218
  ] }),
5203
- O && /* @__PURE__ */ t(ye, { children: [
5204
- /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-foreground", children: O.label }),
5205
- O.auto_trigger && /* @__PURE__ */ e("span", { className: "text-amber-600", children: "⚡ automatic" }),
5206
- O.group_label && /* @__PURE__ */ t("span", { className: "text-slate-400", children: [
5219
+ R && /* @__PURE__ */ t(ye, { children: [
5220
+ /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-foreground", children: R.label }),
5221
+ R.auto_trigger && /* @__PURE__ */ e("span", { className: "text-amber-600", children: "⚡ automatic" }),
5222
+ R.group_label && /* @__PURE__ */ t("span", { className: "text-slate-400", children: [
5207
5223
  "group: ",
5208
- O.group_label
5224
+ R.group_label
5209
5225
  ] }),
5210
5226
  /* @__PURE__ */ e(
5211
5227
  "button",
5212
5228
  {
5213
5229
  type: "button",
5214
- onClick: () => b(O.label),
5230
+ onClick: () => b(R.label),
5215
5231
  className: "text-nvr-cyan underline decoration-dotted underline-offset-2",
5216
5232
  children: "Edit in the Transitions list ↑"
5217
5233
  }
@@ -5229,8 +5245,8 @@ function on({ templateId: a }) {
5229
5245
  ] })
5230
5246
  ] });
5231
5247
  }
5232
- function cn({ templateId: a }) {
5233
- var D, O;
5248
+ function dn({ templateId: a }) {
5249
+ var D, R;
5234
5250
  const n = Z(), [o, f] = $(90), [i, m] = $(null), { data: d } = V({
5235
5251
  queryKey: ["flow-map", a, o],
5236
5252
  queryFn: () => n.request(
@@ -5256,7 +5272,7 @@ function cn({ templateId: a }) {
5256
5272
  w.set(b.from, (w.get(b.from) ?? 0) + B), N.set(b.to, (N.get(b.to) ?? 0) + j);
5257
5273
  const te = ge + 8, ae = Ae - ge - 8, ce = (te + ae) / 2, de = `M ${te} ${K} C ${ce} ${K}, ${ce} ${Q}, ${ae} ${Q} L ${ae} ${Q + j} C ${ce} ${Q + j}, ${ce} ${K + B}, ${te} ${K + B} Z`;
5258
5274
  return { f: b, path: de };
5259
- }), A = new Map(p.map((b) => [b.id, b]));
5275
+ }), L = new Map(p.map((b) => [b.id, b]));
5260
5276
  return p.length === 0 ? null : /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4 dark:border-border dark:bg-card", children: [
5261
5277
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
5262
5278
  /* @__PURE__ */ t("div", { children: [
@@ -5311,7 +5327,7 @@ function cn({ templateId: a }) {
5311
5327
  width: ge,
5312
5328
  height: c.h,
5313
5329
  rx: 4,
5314
- fill: ((k = A.get(b)) == null ? void 0 : k.color) ?? "#94a3b8",
5330
+ fill: ((k = L.get(b)) == null ? void 0 : k.color) ?? "#94a3b8",
5315
5331
  opacity: 0.15
5316
5332
  }
5317
5333
  ),
@@ -5323,7 +5339,7 @@ function cn({ templateId: a }) {
5323
5339
  width: 6,
5324
5340
  height: c.h,
5325
5341
  rx: 2,
5326
- fill: ((E = A.get(b)) == null ? void 0 : E.color) ?? "#94a3b8"
5342
+ fill: ((E = L.get(b)) == null ? void 0 : E.color) ?? "#94a3b8"
5327
5343
  }
5328
5344
  ),
5329
5345
  /* @__PURE__ */ e(
@@ -5333,7 +5349,7 @@ function cn({ templateId: a }) {
5333
5349
  y: c.y + c.h / 2 + 3,
5334
5350
  textAnchor: "end",
5335
5351
  className: "fill-slate-700 text-[10.5px] font-medium dark:fill-slate-200",
5336
- children: (((F = A.get(b)) == null ? void 0 : F.label) ?? "").slice(0, 32)
5352
+ children: (((F = L.get(b)) == null ? void 0 : F.label) ?? "").slice(0, 32)
5337
5353
  }
5338
5354
  )
5339
5355
  ] }, `L-${b}`);
@@ -5349,7 +5365,7 @@ function cn({ templateId: a }) {
5349
5365
  width: ge,
5350
5366
  height: c.h,
5351
5367
  rx: 4,
5352
- fill: ((k = A.get(b)) == null ? void 0 : k.color) ?? "#94a3b8",
5368
+ fill: ((k = L.get(b)) == null ? void 0 : k.color) ?? "#94a3b8",
5353
5369
  opacity: 0.15
5354
5370
  }
5355
5371
  ),
@@ -5361,7 +5377,7 @@ function cn({ templateId: a }) {
5361
5377
  width: 6,
5362
5378
  height: c.h,
5363
5379
  rx: 2,
5364
- fill: ((E = A.get(b)) == null ? void 0 : E.color) ?? "#94a3b8"
5380
+ fill: ((E = L.get(b)) == null ? void 0 : E.color) ?? "#94a3b8"
5365
5381
  }
5366
5382
  ),
5367
5383
  /* @__PURE__ */ e(
@@ -5370,17 +5386,17 @@ function cn({ templateId: a }) {
5370
5386
  x: Ae - ge + 8,
5371
5387
  y: c.y + c.h / 2 + 3,
5372
5388
  className: "fill-slate-700 text-[10.5px] font-medium dark:fill-slate-200",
5373
- children: (((F = A.get(b)) == null ? void 0 : F.label) ?? "").slice(0, 32)
5389
+ children: (((F = L.get(b)) == null ? void 0 : F.label) ?? "").slice(0, 32)
5374
5390
  }
5375
5391
  )
5376
5392
  ] }, `R-${b}`);
5377
5393
  })
5378
5394
  ] }),
5379
5395
  i && /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-600", children: [
5380
- /* @__PURE__ */ e("strong", { children: (D = A.get(i.from)) == null ? void 0 : D.label }),
5396
+ /* @__PURE__ */ e("strong", { children: (D = L.get(i.from)) == null ? void 0 : D.label }),
5381
5397
  " →",
5382
5398
  " ",
5383
- /* @__PURE__ */ e("strong", { children: (O = A.get(i.to)) == null ? void 0 : O.label }),
5399
+ /* @__PURE__ */ e("strong", { children: (R = L.get(i.to)) == null ? void 0 : R.label }),
5384
5400
  ": ",
5385
5401
  i.count.toLocaleString(),
5386
5402
  " ",
@@ -5390,7 +5406,7 @@ function cn({ templateId: a }) {
5390
5406
  ] })
5391
5407
  ] });
5392
5408
  }
5393
- function dn({ templateId: a }) {
5409
+ function mn({ templateId: a }) {
5394
5410
  const n = Z(), [o, f] = $(90), [i, m] = $(0), [d, p] = $(!1), [l, v] = $(!0), { data: h } = V({
5395
5411
  queryKey: ["pipeline-replay", a, o],
5396
5412
  queryFn: () => n.request(G(`/pipelines/${a}/replay`, { days: o })).then((w) => w.data),
@@ -5520,7 +5536,7 @@ function dn({ templateId: a }) {
5520
5536
  ] })
5521
5537
  ] });
5522
5538
  }
5523
- function mn({ onClose: a }) {
5539
+ function pn({ onClose: a }) {
5524
5540
  return ue(() => {
5525
5541
  const n = (o) => {
5526
5542
  o.key === "Escape" && a();
@@ -5552,19 +5568,19 @@ function mn({ onClose: a }) {
5552
5568
  }
5553
5569
  )
5554
5570
  ] }),
5555
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(vs, { compact: !0 }) })
5571
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(Ns, { compact: !0 }) })
5556
5572
  ] })
5557
5573
  ] }),
5558
5574
  document.body
5559
5575
  );
5560
5576
  }
5561
5577
  export {
5562
- Vs as AiReviewCard,
5563
- nn as OwnerGapsCard,
5564
- rr as PipelineEditorView,
5565
- tn as PipelineSimulatorCard,
5566
- Ks as ownerGroupsLabel,
5567
- Is as splitStartNote,
5578
+ Gs as AiReviewCard,
5579
+ rn as OwnerGapsCard,
5580
+ ir as PipelineEditorView,
5581
+ an as PipelineSimulatorCard,
5582
+ zs as ownerGroupsLabel,
5583
+ Js as splitStartNote,
5568
5584
  da as splitStartOptions,
5569
5585
  It as suggestionList
5570
5586
  };