@nivaro/react 0.3.58 → 0.3.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/fields/RelationField.js +110 -80
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useRelationOptions.js +1 -0
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +32 -1
  6. package/dist/index.js +523 -520
  7. package/dist/shared/components/CollectionBrowserView.js +2083 -2052
  8. package/dist/shared/components/DataTable.js +497 -465
  9. package/dist/shared/components/ItemEditForm.js +4430 -4282
  10. package/dist/shared/components/PageRenderer.js +537 -508
  11. package/dist/shared/components/QueryTable.js +74 -74
  12. package/dist/shared/components/WidgetSlot.js +543 -520
  13. package/dist/shared/components/alerts/AlertManagerView.js +269 -275
  14. package/dist/shared/components/alerts/types.js +37 -14
  15. package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
  16. package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
  17. package/dist/shared/components/item-edit/InlineTableField.js +2461 -2421
  18. package/dist/shared/components/item-edit/M2MCombobox.js +141 -137
  19. package/dist/shared/components/item-edit/PlanGrid.js +876 -820
  20. package/dist/shared/components/item-edit/QuickCreateButton.js +323 -130
  21. package/dist/shared/components/item-edit/RelationCombobox.js +408 -375
  22. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +255 -156
  23. package/dist/shared/components/item-edit/SummaryPanel.js +356 -343
  24. package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
  25. package/dist/shared/components/item-edit/line-midair.js +82 -75
  26. package/dist/shared/components/item-edit/save-outcome.js +6 -4
  27. package/dist/shared/components/panels/ItemLockBanner.js +212 -209
  28. package/dist/shared/components/panels/PipelinePanel.js +775 -737
  29. package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
  30. package/dist/shared/components/panels/RevisionsPanel.js +313 -299
  31. package/dist/shared/components/pipeline/PipelineEditorView.js +26 -16
  32. package/dist/shared/components/queue/QueueQuickFilters.js +13 -13
  33. package/dist/shared/components/queue/QueueWorklist.js +978 -953
  34. package/dist/shared/components/queue/live-state-aspect.js +9 -5
  35. package/dist/shared/components/widgets/ReviewListWidget.js +152 -149
  36. package/dist/shared/lib/display-prefs.js +60 -52
  37. package/dist/shared/lib/draft-store.js +71 -48
  38. package/dist/shared/lib/expression.js +53 -53
  39. package/dist/shared/lib/list-page-memory.js +42 -20
  40. package/dist/shared/lib/money-input.js +45 -0
  41. package/dist/shared/lib/sanitize-html.js +10 -6
  42. package/dist/shared/lib/staged-row-labels.js +18 -0
  43. package/package.json +1 -1
@@ -1,10 +1,14 @@
1
- function r(e, t) {
2
- return e || t ? { refresh: !0, pill: 0, stats: !0 } : { refresh: !1, pill: 1, stats: !0 };
1
+ function t(e, r) {
2
+ return e || r ? { refresh: !0, pill: 0, stats: !0 } : { refresh: !1, pill: 1, stats: !0 };
3
3
  }
4
- function l(e) {
4
+ function n(e) {
5
5
  return !e.table || e.busy || typeof e.liveTotal != "number" || typeof e.rowsTotal != "number" ? !1 : e.liveTotal !== e.rowsTotal;
6
6
  }
7
+ function l(e) {
8
+ return e.pending <= 0 || !e.busy || typeof e.liveTotal != "number" || typeof e.rowsTotal != "number" ? 0 : e.liveTotal !== e.rowsTotal ? e.pending : 0;
9
+ }
7
10
  export {
8
- r as stateAspectEffect,
9
- l as statsOutrunRows
11
+ l as offscreenPill,
12
+ t as stateAspectEffect,
13
+ n as statsOutrunRows
10
14
  };
@@ -1,13 +1,13 @@
1
- import { jsx as n, jsxs as b } from "react/jsx-runtime";
2
- import { useQuery as ae } from "@tanstack/react-query";
3
- import { ChevronRight as se, AlertCircle as oe } from "lucide-react";
4
- import { useState as D, useMemo as K } from "react";
5
- import { useNivaroClient as ie, useItemEditAuth as de } from "../../context.js";
6
- import { useBackCloses as ue } from "../../lib/back-closes.js";
7
- import { post as W, patch as ce } from "../../lib/commands.js";
8
- import { formatDateTime as Z, cn as H, formatDate as me } from "../../lib/utils.js";
9
- import { TooltipProvider as pe, Tooltip as be, TooltipTrigger as fe, TooltipContent as xe } from "../ui/tooltip.js";
10
- function Q(r) {
1
+ import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
+ import { useQuery as se } from "@tanstack/react-query";
3
+ import { ChevronRight as oe, AlertCircle as ie } from "lucide-react";
4
+ import { useState as D, useMemo as W } from "react";
5
+ import { useNivaroClient as de, useItemEditAuth as ue } from "../../context.js";
6
+ import { useBackCloses as ce } from "../../lib/back-closes.js";
7
+ import { post as H, patch as me } from "../../lib/commands.js";
8
+ import { formatDateTime as ee, cn as Q, formatDate as pe } from "../../lib/utils.js";
9
+ import { TooltipProvider as be, Tooltip as fe, TooltipTrigger as xe, TooltipContent as he } from "../ui/tooltip.js";
10
+ function X(r) {
11
11
  return r === !0 || r === 1 || r === "1" || r === "true";
12
12
  }
13
13
  function F(r, t) {
@@ -18,7 +18,7 @@ function F(r, t) {
18
18
  }
19
19
  if (t === "date" || t === "datetime") {
20
20
  const a = new Date(r);
21
- return Number.isNaN(a.getTime()) ? String(r) : t === "date" ? me(typeof r == "string" ? r : a) : Z(a);
21
+ return Number.isNaN(a.getTime()) ? String(r) : t === "date" ? pe(typeof r == "string" ? r : a) : ee(a);
22
22
  }
23
23
  return String(r);
24
24
  }
@@ -30,7 +30,7 @@ const R = {
30
30
  purple: "#9333ea",
31
31
  slate: "#64748b"
32
32
  };
33
- function he(r) {
33
+ function we(r) {
34
34
  return {
35
35
  backgroundColor: r ? `${r}22` : "#f1f5f9",
36
36
  color: r ?? "#475569",
@@ -43,90 +43,90 @@ function I({ label: r, color: t }) {
43
43
  "span",
44
44
  {
45
45
  className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium",
46
- style: he(a),
46
+ style: we(a),
47
47
  children: r
48
48
  }
49
49
  );
50
50
  }
51
- function we(r, t) {
51
+ function ye(r, t) {
52
52
  if (r == null || r === "")
53
53
  return t.empty_label ? { label: t.empty_label, color: t.empty_color ?? "blue" } : { label: "—", color: null };
54
- const a = t.options.find((u) => u.value === String(r));
54
+ const a = t.options.find((b) => b.value === String(r));
55
55
  return a ? { label: a.status_label || a.label, color: a.color } : { label: String(r), color: null };
56
56
  }
57
- function ye(r, t) {
57
+ function ke(r, t) {
58
58
  const a = /* @__PURE__ */ new Map();
59
59
  for (const x of r.rows) {
60
60
  const s = String(x.group ?? ""), h = a.get(s);
61
61
  h ? h.push(x) : a.set(s, [x]);
62
62
  }
63
- const u = Array.from(a.entries()).map(([x, s]) => {
63
+ const b = Array.from(a.entries()).map(([x, s]) => {
64
64
  const w = new Set(s.map((j) => String(j.status ?? ""))).size > 1, O = w ? null : s[0].status;
65
- let $ = null;
66
- return t && s.every((C) => t in C.values) && ($ = s.reduce((C, E) => C + (Number(E.values[t]) || 0), 0)), { key: x, rows: s, count: s.length, sum: $, uniformStatus: O, mixedStatus: w };
65
+ let C = null;
66
+ return t && s.every((q) => t in q.values) && (C = s.reduce((q, E) => q + (Number(E.values[t]) || 0), 0)), { key: x, rows: s, count: s.length, sum: C, uniformStatus: O, mixedStatus: w };
67
67
  });
68
- return u.sort((x, s) => x.key.localeCompare(s.key, void 0, { numeric: !0 })), u;
68
+ return b.sort((x, s) => x.key.localeCompare(s.key, void 0, { numeric: !0 })), b;
69
69
  }
70
- function X(r, t, a) {
71
- let u = null;
70
+ function J(r, t, a) {
71
+ let b = null;
72
72
  for (const x of r) {
73
73
  const s = x.values[t];
74
74
  if (s == null || s === "") continue;
75
75
  const h = typeof s == "number" ? s : Date.parse(String(s)), w = Number.isNaN(h) ? Number(s) : h;
76
- Number.isFinite(w) && (u == null || (a ? w > u : w < u)) && (u = w);
76
+ Number.isFinite(w) && (b == null || (a ? w > b : w < b)) && (b = w);
77
77
  }
78
- return u;
78
+ return b;
79
79
  }
80
- function J(r, t) {
81
- const a = r.rows[0], u = (x) => {
80
+ function Y(r, t) {
81
+ const a = r.rows[0], b = (x) => {
82
82
  const s = t.find((w) => w.role === x);
83
83
  if (!s || !a) return null;
84
84
  const h = a.values[s.field];
85
85
  return h == null || h === "" ? null : `${s.prefix ?? ""}${F(h, s.format)}`;
86
86
  };
87
- return { title: u("title") ?? (r.key || "—"), subtitle: u("subtitle") };
87
+ return { title: b("title") ?? (r.key || "—"), subtitle: b("subtitle") };
88
88
  }
89
- function Y(r, t) {
89
+ function Z(r, t) {
90
90
  const a = (t == null ? void 0 : t.trim()) || "row";
91
91
  return `${r} ${a}${r === 1 ? "" : "s"}`;
92
92
  }
93
- function ke(r, t, a) {
94
- const u = a != null && a.trim() ? `${a.trim()} ` : "";
95
- return `${r.label} ${u}${t.title}${t.subtitle ? ` · ${t.subtitle}` : ""}?`;
93
+ function ge(r, t, a) {
94
+ const b = a != null && a.trim() ? `${a.trim()} ` : "";
95
+ return `${r.label} ${b}${t.title}${t.subtitle ? ` · ${t.subtitle}` : ""}?`;
96
96
  }
97
- function Ae({
97
+ function De({
98
98
  data: r,
99
99
  config: t,
100
100
  loading: a,
101
- error: u,
101
+ error: b,
102
102
  onRefetch: x,
103
103
  hostRecordId: s,
104
104
  emptyLabel: h
105
105
  }) {
106
- const w = ie(), { userId: O } = de(), [$, j] = D(() => /* @__PURE__ */ new Set()), [C, E] = D(null), [L, ee] = D({}), [c, _] = D(null), [P, U] = D("");
107
- ue(() => _(null), c != null);
108
- const V = K(() => {
109
- const e = r ? ye(r, t.aggregate_sum) : [], i = t.group_sort;
110
- if (!(i != null && i.field)) return e;
111
- const f = i.direction === "desc";
112
- return [...e].sort((k, m) => {
113
- const p = X(k.rows, i.field, f), y = X(m.rows, i.field, f);
114
- return p == null && y == null ? 0 : p == null ? 1 : y == null ? -1 : f ? y - p : p - y;
106
+ const w = de(), { userId: O } = ue(), [C, j] = D(() => /* @__PURE__ */ new Set()), [q, E] = D(null), [L, te] = D({}), [c, _] = D(null), [P, U] = D("");
107
+ ce(() => _(null), c != null);
108
+ const V = W(() => {
109
+ const e = r ? ke(r, t.aggregate_sum) : [], o = t.group_sort;
110
+ if (!(o != null && o.field)) return e;
111
+ const m = o.direction === "desc";
112
+ return [...e].sort((y, d) => {
113
+ const p = J(y.rows, o.field, m), k = J(d.rows, o.field, m);
114
+ return p == null && k == null ? 0 : p == null ? 1 : k == null ? -1 : m ? k - p : p - k;
115
115
  });
116
- }, [r, t.aggregate_sum, t.group_sort]), G = K(() => ((r == null ? void 0 : r.rows) ?? []).map((e) => String(e.id)), [r]), { data: q } = ae({
116
+ }, [r, t.aggregate_sum, t.group_sort]), G = W(() => ((r == null ? void 0 : r.rows) ?? []).map((e) => String(e.id)), [r]), { data: T } = se({
117
117
  queryKey: ["review-list-enrich", t.enrich_endpoint ?? "", G.join(",")],
118
118
  queryFn: () => w.request(
119
- W(t.enrich_endpoint, { ids: G })
119
+ H(t.enrich_endpoint, { ids: G })
120
120
  ).then((e) => {
121
- var i;
122
- return ((i = e == null ? void 0 : e.data) == null ? void 0 : i.rows) ?? {};
121
+ var o;
122
+ return ((o = e == null ? void 0 : e.data) == null ? void 0 : o.rows) ?? {};
123
123
  }).catch(() => ({})),
124
124
  enabled: !!t.enrich_endpoint && G.length > 0,
125
125
  staleTime: 3e4
126
- }), T = (e) => q == null ? void 0 : q[String(e)], z = !!q && Object.values(q).some((e) => {
127
- var i;
128
- return (((i = e.chips) == null ? void 0 : i.length) ?? 0) > 0;
129
- }), te = V.length === 1;
126
+ }), S = (e) => T == null ? void 0 : T[String(e)], z = !!T && Object.values(T).some((e) => {
127
+ var o;
128
+ return (((o = e.chips) == null ? void 0 : o.length) ?? 0) > 0;
129
+ }), re = V.length === 1;
130
130
  if (a)
131
131
  return /* @__PURE__ */ n("div", { className: "space-y-2", children: [0, 1].map((e) => /* @__PURE__ */ n(
132
132
  "div",
@@ -135,102 +135,105 @@ function Ae({
135
135
  },
136
136
  e
137
137
  )) });
138
- if (u)
139
- return /* @__PURE__ */ n("p", { className: "text-[12px] text-red-500", children: u });
138
+ if (b)
139
+ return /* @__PURE__ */ n("p", { className: "text-[12px] text-red-500", children: b });
140
140
  if (!r || r.rows.length === 0)
141
141
  return /* @__PURE__ */ n("p", { className: "text-[12px] italic text-slate-400", children: h ? `No ${h.toLowerCase()} yet` : "Nothing here yet" });
142
- const re = (e) => {
143
- j((i) => {
144
- const f = new Set(i);
145
- return f.has(e) ? f.delete(e) : f.add(e), f;
142
+ const le = (e) => {
143
+ j((o) => {
144
+ const m = new Set(o);
145
+ return m.has(e) ? m.delete(e) : m.add(e), m;
146
146
  });
147
- }, le = (e, i) => {
148
- U(""), _({ group: e, option: i });
149
- }, ne = async (e, i, f) => {
147
+ }, B = (e, o) => e.rows.map((m) => {
148
+ var y, d, p;
149
+ return (p = (d = (y = S(m.id)) == null ? void 0 : y.confirm_notices) == null ? void 0 : d[o.value]) == null ? void 0 : p.trim();
150
+ }).find((m) => !!m) ?? o.confirm_notice ?? null, ne = (e, o) => {
151
+ U(""), _({ group: e, option: o });
152
+ }, ae = async (e, o, m) => {
150
153
  E(e.key);
151
- let k = null;
154
+ let y = null;
152
155
  if (t.status.action_endpoint)
153
156
  try {
154
157
  await w.request(
155
- W(t.status.action_endpoint, {
156
- ids: e.rows.map((m) => m.id),
157
- status: i.value,
158
+ H(t.status.action_endpoint, {
159
+ ids: e.rows.map((d) => d.id),
160
+ status: o.value,
158
161
  // The status each row showed: the endpoint may refuse (409) rows
159
162
  // someone changed since this list loaded instead of overwriting
160
163
  // them. The refetch below shows what they are now.
161
164
  expected: Object.fromEntries(
162
- e.rows.map((m) => [String(m.id), m.status == null ? null : String(m.status)])
165
+ e.rows.map((d) => [String(d.id), d.status == null ? null : String(d.status)])
163
166
  ),
164
- ...f ? { note: f } : {},
167
+ ...m ? { note: m } : {},
165
168
  ...s != null && s !== "" ? { workflow_id: Number(s) } : {}
166
169
  })
167
170
  );
168
- } catch (m) {
169
- const p = m == null ? void 0 : m.response;
170
- k = (p == null ? void 0 : p.error) ?? "Failed to update";
171
+ } catch (d) {
172
+ const p = d == null ? void 0 : d.response;
173
+ y = (p == null ? void 0 : p.error) ?? "Failed to update";
171
174
  }
172
175
  else {
173
- const m = t.status.stamp_date_field ? (/* @__PURE__ */ new Date()).toISOString() : void 0, y = (await Promise.all(
176
+ const d = t.status.stamp_date_field ? (/* @__PURE__ */ new Date()).toISOString() : void 0, k = (await Promise.all(
174
177
  e.rows.map(async (N) => {
175
- const g = { [t.status.field]: i.value };
176
- t.status.stamp_user_field && O && (g[t.status.stamp_user_field] = O), t.status.stamp_date_field && (g[t.status.stamp_date_field] = m), f && (g._change_reason = f);
178
+ const g = { [t.status.field]: o.value };
179
+ t.status.stamp_user_field && O && (g[t.status.stamp_user_field] = O), t.status.stamp_date_field && (g[t.status.stamp_date_field] = d), m && (g._change_reason = m);
177
180
  try {
178
- return await w.request(ce(`/items/${t.collection}/${N.id}`, g)), { ok: !0 };
179
- } catch (S) {
180
- const v = S == null ? void 0 : S.response;
181
+ return await w.request(me(`/items/${t.collection}/${N.id}`, g)), { ok: !0 };
182
+ } catch ($) {
183
+ const v = $ == null ? void 0 : $.response;
181
184
  return { ok: !1, error: (v == null ? void 0 : v.error) ?? "Failed to update" };
182
185
  }
183
186
  })
184
187
  )).filter((N) => !N.ok);
185
- y.length > 0 && (k = `${y.length} of ${e.rows.length} row(s) failed to update`);
188
+ k.length > 0 && (y = `${k.length} of ${e.rows.length} row(s) failed to update`);
186
189
  }
187
- E(null), ee((m) => {
188
- const p = { ...m };
189
- return k ? p[e.key] = k : delete p[e.key], p;
190
+ E(null), te((d) => {
191
+ const p = { ...d };
192
+ return y ? p[e.key] = y : delete p[e.key], p;
190
193
  }), x();
191
- }, B = r.columns.line_columns, M = r.columns.group_meta;
192
- return /* @__PURE__ */ n(pe, { delayDuration: 200, children: /* @__PURE__ */ b("div", { className: "space-y-2", children: [
194
+ }, K = r.columns.line_columns, M = r.columns.group_meta;
195
+ return /* @__PURE__ */ n(be, { delayDuration: 200, children: /* @__PURE__ */ f("div", { className: "space-y-2", children: [
193
196
  r.truncated && /* @__PURE__ */ n("p", { className: "text-[11px] text-amber-600 dark:text-amber-400", children: "Showing first 2000 rows — some rows may be missing." }),
194
197
  V.map((e) => {
195
- const i = te ? !$.has(e.key) : $.has(e.key), f = e.rows.every((l) => {
196
- var d;
197
- return ((d = T(l.id)) == null ? void 0 : d.can_act) !== !1;
198
- }), k = e.rows.map((l) => {
199
- var d;
200
- return (d = T(l.id)) == null ? void 0 : d.reason;
201
- }).find((l) => !!l) ?? "Only the workflow contact chain (or the PO requestor for invalid holds) can decide this", m = e.rows.map((l) => {
202
- var d, o;
203
- return (o = (d = T(l.id)) == null ? void 0 : d.note) == null ? void 0 : o.trim();
204
- }).find((l) => !!l) ?? null, p = J(e, M), y = e.mixedStatus ? { label: "Mixed", color: null } : we(e.uniformStatus, t.status), N = e.rows[0], g = N.stamp_user, S = N.stamp_date, v = e.rows.reduce((l, d) => {
205
- var o;
206
- for (const A of ((o = T(d.id)) == null ? void 0 : o.chips) ?? []) {
198
+ const o = re ? !C.has(e.key) : C.has(e.key), m = e.rows.every((l) => {
199
+ var u;
200
+ return ((u = S(l.id)) == null ? void 0 : u.can_act) !== !1;
201
+ }), y = e.rows.map((l) => {
202
+ var u;
203
+ return (u = S(l.id)) == null ? void 0 : u.reason;
204
+ }).find((l) => !!l) ?? "Only the workflow contact chain (or the PO requestor for invalid holds) can decide this", d = e.rows.map((l) => {
205
+ var u, i;
206
+ return (i = (u = S(l.id)) == null ? void 0 : u.note) == null ? void 0 : i.trim();
207
+ }).find((l) => !!l) ?? null, p = Y(e, M), k = e.mixedStatus ? { label: "Mixed", color: null } : ye(e.uniformStatus, t.status), N = e.rows[0], g = N.stamp_user, $ = N.stamp_date, v = e.rows.reduce((l, u) => {
208
+ var i;
209
+ for (const A of ((i = S(u.id)) == null ? void 0 : i.chips) ?? []) {
207
210
  if (A.tone === "danger") return "danger";
208
211
  A.tone === "warn" && l == null && (l = "warn");
209
212
  }
210
213
  return l;
211
214
  }, null);
212
- return /* @__PURE__ */ b(
215
+ return /* @__PURE__ */ f(
213
216
  "div",
214
217
  {
215
218
  "data-review-group": e.key,
216
219
  "data-review-tone": v ?? void 0,
217
- className: H(
220
+ className: Q(
218
221
  "rounded-md border",
219
222
  v === "danger" ? "border-l-2 border-l-red-500 border-red-200 bg-red-50/40 dark:border-red-500/40 dark:bg-red-500/5" : v === "warn" ? "border-l-2 border-l-amber-500 border-amber-200 bg-amber-50/40 dark:border-amber-500/40 dark:bg-amber-500/5" : "border-slate-200 dark:border-border"
220
223
  ),
221
224
  children: [
222
- /* @__PURE__ */ b("div", { className: "flex w-full flex-wrap items-center gap-2 px-3 py-2", children: [
223
- /* @__PURE__ */ b(
225
+ /* @__PURE__ */ f("div", { className: "flex w-full flex-wrap items-center gap-2 px-3 py-2", children: [
226
+ /* @__PURE__ */ f(
224
227
  "button",
225
228
  {
226
229
  type: "button",
227
- onClick: () => re(e.key),
230
+ onClick: () => le(e.key),
228
231
  className: "flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",
229
232
  children: [
230
233
  /* @__PURE__ */ n(
231
- se,
234
+ oe,
232
235
  {
233
- className: `h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform ${i ? "rotate-90" : ""}`
236
+ className: `h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform ${o ? "rotate-90" : ""}`
234
237
  }
235
238
  ),
236
239
  /* @__PURE__ */ n(
@@ -242,60 +245,60 @@ function Ae({
242
245
  }
243
246
  ),
244
247
  p.subtitle && /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: p.subtitle }),
245
- /* @__PURE__ */ b("span", { className: "text-[11px] text-slate-400", children: [
246
- Y(e.count, t.row_noun),
248
+ /* @__PURE__ */ f("span", { className: "text-[11px] text-slate-400", children: [
249
+ Z(e.count, t.row_noun),
247
250
  e.sum != null ? ` · ${F(e.sum, t.aggregate_sum_format ?? "number")}` : ""
248
251
  ] }),
249
252
  M.map((l) => {
250
253
  if (l.role) return null;
251
- const d = N.values[l.field];
252
- return l.format === "flag" ? Q(d) ? /* @__PURE__ */ n(I, { label: l.label, color: l.color ?? "amber" }, l.field) : null : d == null || d === "" ? null : /* @__PURE__ */ b(
254
+ const u = N.values[l.field];
255
+ return l.format === "flag" ? X(u) ? /* @__PURE__ */ n(I, { label: l.label, color: l.color ?? "amber" }, l.field) : null : u == null || u === "" ? null : /* @__PURE__ */ f(
253
256
  "span",
254
257
  {
255
258
  className: "rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-800 dark:text-slate-400",
256
259
  children: [
257
260
  l.label,
258
261
  ": ",
259
- F(d, l.format)
262
+ F(u, l.format)
260
263
  ]
261
264
  },
262
265
  l.field
263
266
  );
264
267
  }),
265
- /* @__PURE__ */ n(I, { label: y.label, color: y.color }),
266
- g && /* @__PURE__ */ b(be, { children: [
267
- /* @__PURE__ */ n(fe, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "cursor-default text-[11px] text-slate-400 underline decoration-dotted", children: g.label }) }),
268
- /* @__PURE__ */ b(xe, { side: "top", className: "text-[12px]", children: [
268
+ /* @__PURE__ */ n(I, { label: k.label, color: k.color }),
269
+ g && /* @__PURE__ */ f(fe, { children: [
270
+ /* @__PURE__ */ n(xe, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "cursor-default text-[11px] text-slate-400 underline decoration-dotted", children: g.label }) }),
271
+ /* @__PURE__ */ f(he, { side: "top", className: "text-[12px]", children: [
269
272
  /* @__PURE__ */ n("p", { className: "font-medium", children: g.label }),
270
- S && /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Z(S) })
273
+ $ && /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: ee($) })
271
274
  ] })
272
275
  ] })
273
276
  ]
274
277
  }
275
278
  ),
276
- /* @__PURE__ */ b("span", { className: "flex flex-wrap items-center gap-1.5", children: [
277
- !f && /* @__PURE__ */ n(
279
+ /* @__PURE__ */ f("span", { className: "flex flex-wrap items-center gap-1.5", children: [
280
+ !m && /* @__PURE__ */ n(
278
281
  "span",
279
282
  {
280
283
  className: "text-[11px] text-slate-400",
281
- title: k,
284
+ title: y,
282
285
  "data-review-view-only": !0,
283
286
  children: "View only"
284
287
  }
285
288
  ),
286
- f && t.status.options.map((l) => {
287
- const d = !e.mixedStatus && String(e.uniformStatus) === l.value, o = R[l.color] ?? R.slate, A = C === e.key;
289
+ m && t.status.options.map((l) => {
290
+ const u = !e.mixedStatus && String(e.uniformStatus) === l.value, i = R[l.color] ?? R.slate, A = q === e.key;
288
291
  return /* @__PURE__ */ n(
289
292
  "button",
290
293
  {
291
294
  type: "button",
292
- disabled: A || d,
293
- onClick: () => le(e, l),
295
+ disabled: A || u,
296
+ onClick: () => ne(e, l),
294
297
  className: "rounded-md border px-2.5 py-1 text-[11px] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",
295
298
  style: {
296
- backgroundColor: d ? `${o}22` : "transparent",
297
- borderColor: `${o}55`,
298
- color: o
299
+ backgroundColor: u ? `${i}22` : "transparent",
300
+ borderColor: `${i}55`,
301
+ color: i
299
302
  },
300
303
  children: A ? "…" : l.label
301
304
  },
@@ -304,7 +307,7 @@ function Ae({
304
307
  })
305
308
  ] })
306
309
  ] }),
307
- m && /* @__PURE__ */ b(
310
+ d && /* @__PURE__ */ f(
308
311
  "p",
309
312
  {
310
313
  "data-review-decision-note": !0,
@@ -312,42 +315,42 @@ function Ae({
312
315
  children: [
313
316
  /* @__PURE__ */ n("span", { className: "font-medium", children: "Reason:" }),
314
317
  " ",
315
- /* @__PURE__ */ n("span", { className: "whitespace-pre-line", children: m })
318
+ /* @__PURE__ */ n("span", { className: "whitespace-pre-line", children: d })
316
319
  ]
317
320
  }
318
321
  ),
319
- L[e.key] && /* @__PURE__ */ b("p", { className: "flex items-center gap-1 px-3 pb-2 text-[11px] text-red-600", children: [
320
- /* @__PURE__ */ n(oe, { className: "h-3 w-3 shrink-0" }),
322
+ L[e.key] && /* @__PURE__ */ f("p", { className: "flex items-center gap-1 px-3 pb-2 text-[11px] text-red-600", children: [
323
+ /* @__PURE__ */ n(ie, { className: "h-3 w-3 shrink-0" }),
321
324
  L[e.key]
322
325
  ] }),
323
- i && /* @__PURE__ */ n("div", { className: "overflow-x-auto border-t border-slate-100 dark:border-border/50", children: /* @__PURE__ */ b("table", { className: "w-full border-collapse text-[12px]", children: [
324
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ b("tr", { className: "border-b border-slate-200 bg-slate-50/60 text-left text-[11px] font-medium text-slate-400 dark:border-border dark:bg-white/[0.02]", children: [
325
- B.map((l) => /* @__PURE__ */ n("th", { className: "px-2.5 py-1.5 font-medium", children: l.label }, l.field)),
326
+ o && /* @__PURE__ */ n("div", { className: "overflow-x-auto border-t border-slate-100 dark:border-border/50", children: /* @__PURE__ */ f("table", { className: "w-full border-collapse text-[12px]", children: [
327
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ f("tr", { className: "border-b border-slate-200 bg-slate-50/60 text-left text-[11px] font-medium text-slate-400 dark:border-border dark:bg-white/[0.02]", children: [
328
+ K.map((l) => /* @__PURE__ */ n("th", { className: "px-2.5 py-1.5 font-medium", children: l.label }, l.field)),
326
329
  z && /* @__PURE__ */ n("th", { className: "px-2.5 py-1.5 font-medium", children: "Match" })
327
330
  ] }) }),
328
331
  /* @__PURE__ */ n("tbody", { children: e.rows.map((l) => {
329
- var d;
330
- return /* @__PURE__ */ b(
332
+ var u;
333
+ return /* @__PURE__ */ f(
331
334
  "tr",
332
335
  {
333
336
  className: "border-b border-slate-100 last:border-b-0 dark:border-border/50",
334
337
  children: [
335
- B.map((o) => /* @__PURE__ */ n(
338
+ K.map((i) => /* @__PURE__ */ n(
336
339
  "td",
337
340
  {
338
341
  className: "px-2.5 py-1.5 text-slate-600 dark:text-slate-300",
339
- children: o.format === "flag" ? Q(l.values[o.field]) ? /* @__PURE__ */ n(I, { label: o.label, color: o.color ?? "amber" }) : "—" : F(l.values[o.field], o.format)
342
+ children: i.format === "flag" ? X(l.values[i.field]) ? /* @__PURE__ */ n(I, { label: i.label, color: i.color ?? "amber" }) : "—" : F(l.values[i.field], i.format)
340
343
  },
341
- o.field
344
+ i.field
342
345
  )),
343
- z && /* @__PURE__ */ n("td", { className: "px-2.5 py-1.5", children: /* @__PURE__ */ n("span", { className: "flex flex-wrap gap-1", children: (((d = T(l.id)) == null ? void 0 : d.chips) ?? []).map((o) => /* @__PURE__ */ n(
346
+ z && /* @__PURE__ */ n("td", { className: "px-2.5 py-1.5", children: /* @__PURE__ */ n("span", { className: "flex flex-wrap gap-1", children: (((u = S(l.id)) == null ? void 0 : u.chips) ?? []).map((i) => /* @__PURE__ */ n(
344
347
  "span",
345
348
  {
346
- title: o.title,
347
- className: o.tone === "ok" ? "rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400" : o.tone === "danger" ? "rounded-full bg-red-50 px-2 py-0.5 text-[10.5px] font-medium text-red-700 dark:bg-red-500/10 dark:text-red-400" : o.tone === "warn" ? "rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400" : "rounded-full bg-slate-100 px-2 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-slate-800 dark:text-slate-300",
348
- children: o.label
349
+ title: i.title,
350
+ className: i.tone === "ok" ? "rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400" : i.tone === "danger" ? "rounded-full bg-red-50 px-2 py-0.5 text-[10.5px] font-medium text-red-700 dark:bg-red-500/10 dark:text-red-400" : i.tone === "warn" ? "rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400" : "rounded-full bg-slate-100 px-2 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-slate-800 dark:text-slate-300",
351
+ children: i.label
349
352
  },
350
- o.label
353
+ i.label
351
354
  )) }) })
352
355
  ]
353
356
  },
@@ -368,7 +371,7 @@ function Ae({
368
371
  onKeyDown: (e) => {
369
372
  e.key === "Escape" && (e.stopPropagation(), _(null));
370
373
  },
371
- children: /* @__PURE__ */ b(
374
+ children: /* @__PURE__ */ f(
372
375
  "div",
373
376
  {
374
377
  role: "dialog",
@@ -383,15 +386,15 @@ function Ae({
383
386
  {
384
387
  id: "review-confirm-title",
385
388
  className: "text-[13px] font-medium text-slate-700 dark:text-slate-200",
386
- children: ke(
389
+ children: ge(
387
390
  c.option,
388
- J(c.group, M),
391
+ Y(c.group, M),
389
392
  t.group_noun
390
393
  )
391
394
  }
392
395
  ),
393
- /* @__PURE__ */ b("p", { className: "mt-1 rounded-md border border-slate-200 bg-slate-50 px-2.5 py-1.5 text-[12px] tabular-nums text-slate-600 dark:border-border dark:bg-white/[0.03] dark:text-slate-300", children: [
394
- Y(c.group.count, t.row_noun),
396
+ /* @__PURE__ */ f("p", { className: "mt-1 rounded-md border border-slate-200 bg-slate-50 px-2.5 py-1.5 text-[12px] tabular-nums text-slate-600 dark:border-border dark:bg-white/[0.03] dark:text-slate-300", children: [
397
+ Z(c.group.count, t.row_noun),
395
398
  c.group.sum != null ? ` · ${F(c.group.sum, t.aggregate_sum_format ?? "number")}` : ""
396
399
  ] }),
397
400
  /* @__PURE__ */ n(
@@ -399,7 +402,7 @@ function Ae({
399
402
  {
400
403
  className: "mt-1.5 text-[11px] text-slate-500 dark:text-slate-400",
401
404
  "data-review-confirm-notice": !0,
402
- children: c.option.confirm_notice ? `${c.option.confirm_notice}${c.option.require_note ? " A reason is required." : ""}` : c.option.require_note ? "A reason is required for this decision. It is recorded with the record." : "Nothing changes until you confirm. A note is optional and is recorded with the decision."
405
+ children: B(c.group, c.option) ? `${B(c.group, c.option)}${c.option.require_note ? " A reason is required." : ""}` : c.option.require_note ? "A reason is required for this decision. It is recorded with the record." : "Nothing changes until you confirm. A note is optional and is recorded with the decision."
403
406
  }
404
407
  ),
405
408
  /* @__PURE__ */ n(
@@ -415,7 +418,7 @@ function Ae({
415
418
  placeholder: c.option.require_note ? "Why is this being rejected?" : "Note (optional)"
416
419
  }
417
420
  ),
418
- /* @__PURE__ */ b("div", { className: "mt-3 flex items-center justify-end gap-1.5", children: [
421
+ /* @__PURE__ */ f("div", { className: "mt-3 flex items-center justify-end gap-1.5", children: [
419
422
  /* @__PURE__ */ n(
420
423
  "button",
421
424
  {
@@ -434,9 +437,9 @@ function Ae({
434
437
  disabled: !!c.option.require_note && !P.trim(),
435
438
  onClick: () => {
436
439
  const e = c;
437
- _(null), ne(e.group, e.option, P.trim() || null);
440
+ _(null), ae(e.group, e.option, P.trim() || null);
438
441
  },
439
- className: H(
442
+ className: Q(
440
443
  "rounded px-3 py-1 text-[11px] font-medium hover:brightness-110 disabled:opacity-50",
441
444
  c.option.require_note ? "bg-red-600 text-white" : "bg-nvr-cyan text-white"
442
445
  ),
@@ -452,10 +455,10 @@ function Ae({
452
455
  ] }) });
453
456
  }
454
457
  export {
455
- Ae as ReviewListWidget,
458
+ De as ReviewListWidget,
456
459
  R as STATUS_COLOR_HEX,
457
- ke as confirmTitle,
458
- Y as countLabel,
460
+ ge as confirmTitle,
461
+ Z as countLabel,
459
462
  F as formatValue,
460
- J as groupName
463
+ Y as groupName
461
464
  };