@nivaro/react 0.3.41 → 0.3.43

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 (97) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +733 -15
  5. package/dist/index.js +820 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/ProfileView.js +776 -1003
  20. package/dist/shared/components/RecentRecordsRail.js +34 -16
  21. package/dist/shared/components/RecordReadView.js +500 -477
  22. package/dist/shared/components/Skeletons.js +199 -0
  23. package/dist/shared/components/SlowNotice.js +63 -0
  24. package/dist/shared/components/Term.js +23 -0
  25. package/dist/shared/components/WidgetSlot.js +350 -353
  26. package/dist/shared/components/access/PermissionSummary.js +106 -0
  27. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  28. package/dist/shared/components/chat/ChatPanel.js +902 -886
  29. package/dist/shared/components/chat/MemberPaging.js +70 -0
  30. package/dist/shared/components/chat/RoomParts.js +147 -117
  31. package/dist/shared/components/chat/ScreenClip.js +73 -69
  32. package/dist/shared/components/chat/chat-core.js +449 -396
  33. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  34. package/dist/shared/components/help-videos/api.js +2 -5
  35. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  36. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  37. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  38. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  39. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  40. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  41. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  42. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  43. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  44. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  45. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  46. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  47. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  48. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  49. package/dist/shared/components/item-edit/field-sources.js +33 -0
  50. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  51. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  52. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  53. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  54. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  55. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  56. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  57. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  58. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  59. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  60. package/dist/shared/components/list/InlineEdit.js +363 -0
  61. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  62. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  63. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  64. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  65. package/dist/shared/components/notifications/changes-lines.js +24 -0
  66. package/dist/shared/components/notifications/why-lines.js +64 -0
  67. package/dist/shared/components/panels/CommentPanel.js +316 -281
  68. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  69. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  70. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  71. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  72. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  73. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  74. package/dist/shared/components/profile/PersonProfile.js +57 -52
  75. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  76. package/dist/shared/hooks/useSlowReason.js +39 -0
  77. package/dist/shared/lib/activity-sentence.js +670 -0
  78. package/dist/shared/lib/config-sentences.js +418 -0
  79. package/dist/shared/lib/core-glossary.js +229 -0
  80. package/dist/shared/lib/error-hints.js +159 -0
  81. package/dist/shared/lib/error-message.js +105 -0
  82. package/dist/shared/lib/error-toast.js +22 -0
  83. package/dist/shared/lib/field-comments.js +25 -0
  84. package/dist/shared/lib/filter-sentence.js +261 -0
  85. package/dist/shared/lib/glossary.js +55 -48
  86. package/dist/shared/lib/idle-reload.js +138 -0
  87. package/dist/shared/lib/layout-resolve.js +42 -29
  88. package/dist/shared/lib/list-inline-edit.js +190 -0
  89. package/dist/shared/lib/list-link.js +147 -0
  90. package/dist/shared/lib/nav-trail.js +107 -0
  91. package/dist/shared/lib/prefetch.js +259 -106
  92. package/dist/shared/lib/record-ref.js +72 -0
  93. package/dist/shared/lib/reload-holds.js +25 -0
  94. package/dist/shared/lib/safe-error.js +52 -24
  95. package/dist/shared/lib/skeleton-shapes.js +72 -0
  96. package/dist/shared/lib/slow-reason.js +63 -0
  97. package/package.json +1 -1
@@ -1,20 +1,21 @@
1
- import { jsxs as a, jsx as e, Fragment as R } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as e, Fragment as S } from "react/jsx-runtime";
2
2
  import { useQueryClient as oe, useQuery as X, useMutation as Y } from "@tanstack/react-query";
3
3
  import { FileSpreadsheet as Ne, Download as Z, RotateCcw as ve, Undo2 as ee, Ban as we, ArrowRight as ye, AlertTriangle as Ce, Loader2 as H, Search as $e, ChevronDown as ie, ChevronRight as ce, Check as ue, Copy as me, ExternalLink as _e } from "lucide-react";
4
- import { useState as N, useEffect as he, useMemo as pe } from "react";
4
+ import { useState as k, useEffect as he, useMemo as pe } from "react";
5
5
  import { useNivaroClient as te, useApiFetchConfig as Re, useItemNavigation as Se } from "../../context.js";
6
6
  import { useDebounced as Te } from "../../hooks/useDebounced.js";
7
7
  import { get as xe, post as J } from "../../lib/commands.js";
8
+ import { errorSentence as ae } from "../../lib/error-message.js";
8
9
  import { parseImportLog as Le } from "../../lib/import-log.js";
9
10
  import { formatDateTime as se, formatNumber as h, cn as b, formatFileSize as qe, titleCase as Ee } from "../../lib/utils.js";
10
11
  import { ExplainButton as Fe } from "../ai/ExplainButton.js";
11
- import { Button as S } from "../ui/button.js";
12
+ import { Button as T } from "../ui/button.js";
12
13
  import { Input as Ke } from "../ui/input.js";
13
14
  import { Sheet as Pe, SheetContent as De, SheetTitle as je, SheetDescription as Me } from "../ui/sheet.js";
14
15
  import { Skeleton as G } from "../ui/skeleton.js";
15
16
  import { LIVE_POLL_MS as fe, useElapsed as Oe, StatusPill as Ue } from "./run-parts.js";
16
17
  import { runMode as be, runnerName as ze, formatDuration as ne } from "./types.js";
17
- const B = 50, K = {
18
+ const B = 50, P = {
18
19
  created: {
19
20
  label: "Created",
20
21
  one: "created",
@@ -57,17 +58,17 @@ const B = 50, K = {
57
58
  bar: "bg-[#ef4444]",
58
59
  dot: "bg-[#ef4444]"
59
60
  }
60
- }, v = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0ea5e9]/60 focus-visible:ring-offset-0", ge = (t) => Ee(
61
+ }, w = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0ea5e9]/60 focus-visible:ring-offset-0", ge = (t) => Ee(
61
62
  String(t ?? "").replace(/_junction$/i, " links").replace(/_/g, " ")
62
63
  );
63
- function le(t) {
64
+ function de(t) {
64
65
  if (t < 1e3) return `${Math.round(t)} ms`;
65
66
  if (t < 6e4) return `${(t / 1e3).toFixed(1)}s`;
66
67
  const n = Math.floor(t / 6e4), o = Math.round(t % 6e4 / 1e3);
67
68
  return `${n}m ${String(o).padStart(2, "0")}s`;
68
69
  }
69
70
  function ke() {
70
- const { apiBase: t, authHeaders: n, credentials: o } = Re(), [l, i] = N(null), [c, p] = N(null);
71
+ const { apiBase: t, authHeaders: n, credentials: o } = Re(), [d, i] = k(null), [c, p] = k(null);
71
72
  async function u(s, g) {
72
73
  i(s), p(null);
73
74
  try {
@@ -76,27 +77,27 @@ function ke() {
76
77
  const m = await r.json().catch(() => null);
77
78
  throw new Error((m == null ? void 0 : m.error) || r.statusText);
78
79
  }
79
- const f = URL.createObjectURL(await r.blob()), x = document.createElement("a");
80
- x.href = f, x.download = g, document.body.appendChild(x), x.click(), x.remove(), URL.revokeObjectURL(f);
80
+ const x = URL.createObjectURL(await r.blob()), f = document.createElement("a");
81
+ f.href = x, f.download = g, document.body.appendChild(f), f.click(), f.remove(), URL.revokeObjectURL(x);
81
82
  } catch (r) {
82
83
  p(r.message);
83
84
  } finally {
84
85
  i(null);
85
86
  }
86
87
  }
87
- return { download: u, busy: l, error: c };
88
+ return { download: u, busy: d, error: c };
88
89
  }
89
- function T({ children: t, aside: n }) {
90
+ function L({ children: t, aside: n }) {
90
91
  return /* @__PURE__ */ a("div", { className: "mb-2 flex items-baseline justify-between gap-3", children: [
91
92
  /* @__PURE__ */ e("h3", { className: "text-[12.5px] font-semibold text-slate-900 dark:text-foreground", children: t }),
92
93
  n && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-2", children: n })
93
94
  ] });
94
95
  }
95
- function P({
96
+ function D({
96
97
  onClick: t,
97
98
  children: n,
98
99
  disabled: o,
99
- ...l
100
+ ...d
100
101
  }) {
101
102
  return /* @__PURE__ */ e(
102
103
  "button",
@@ -106,9 +107,9 @@ function P({
106
107
  disabled: o,
107
108
  className: b(
108
109
  "inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11.5px] font-medium text-[#0369a1] transition-colors hover:bg-slate-100 disabled:opacity-50 dark:text-[#7dd3fc] dark:hover:bg-muted",
109
- v
110
+ w
110
111
  ),
111
- ...l,
112
+ ...d,
112
113
  children: n
113
114
  }
114
115
  );
@@ -118,16 +119,16 @@ function Be({
118
119
  kind: n,
119
120
  onKind: o
120
121
  }) {
121
- const l = t.counts, i = (l.other ?? []).filter((s) => s.count > 0), c = i.reduce((s, g) => s + g.count, 0), p = l.created + l.updated + l.unchanged + l.skipped + l.failed + c, u = [
122
- { key: "created", n: l.created },
123
- { key: "updated", n: l.updated },
124
- { key: "unchanged", n: l.unchanged },
125
- { key: "skipped", n: l.skipped },
126
- { key: "failed", n: l.failed }
122
+ const d = t.counts, i = (d.other ?? []).filter((s) => s.count > 0), c = i.reduce((s, g) => s + g.count, 0), p = d.created + d.updated + d.unchanged + d.skipped + d.failed + c, u = [
123
+ { key: "created", n: d.created },
124
+ { key: "updated", n: d.updated },
125
+ { key: "unchanged", n: d.unchanged },
126
+ { key: "skipped", n: d.skipped },
127
+ { key: "failed", n: d.failed }
127
128
  ];
128
129
  return /* @__PURE__ */ a("section", { "data-run-result": !0, children: [
129
130
  /* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-px overflow-hidden rounded-md border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: u.map(({ key: s, n: g }) => {
130
- const r = K[s], f = s !== "unchanged" && g > 0, x = n === s, m = /* @__PURE__ */ a(R, { children: [
131
+ const r = P[s], x = s !== "unchanged" && g > 0, f = n === s, m = /* @__PURE__ */ a(S, { children: [
131
132
  /* @__PURE__ */ e(
132
133
  "span",
133
134
  {
@@ -140,17 +141,17 @@ function Be({
140
141
  ),
141
142
  /* @__PURE__ */ e("span", { className: "mt-0.5 block text-[11.5px] text-slate-600 dark:text-muted-foreground", children: r.label })
142
143
  ] });
143
- return f ? /* @__PURE__ */ e(
144
+ return x ? /* @__PURE__ */ e(
144
145
  "button",
145
146
  {
146
147
  type: "button",
147
148
  "data-run-count": s,
148
- "aria-pressed": x,
149
- onClick: () => o(x ? null : s),
149
+ "aria-pressed": f,
150
+ onClick: () => o(f ? null : s),
150
151
  className: b(
151
152
  "px-3 py-2 text-left transition-colors",
152
- x ? "bg-[#f0f9ff] dark:bg-[#0c2a3d]" : "bg-white hover:bg-slate-50 dark:bg-card dark:hover:bg-muted/40",
153
- v
153
+ f ? "bg-[#f0f9ff] dark:bg-[#0c2a3d]" : "bg-white hover:bg-slate-50 dark:bg-card dark:hover:bg-muted/40",
154
+ w
154
155
  ),
155
156
  children: m
156
157
  },
@@ -162,12 +163,12 @@ function Be({
162
163
  {
163
164
  className: "mt-2 flex h-1.5 overflow-hidden rounded-full bg-slate-100 dark:bg-muted",
164
165
  role: "img",
165
- "aria-label": u.filter((s) => s.n > 0).map((s) => `${h(s.n)} ${K[s.key].one}`).join(", "),
166
+ "aria-label": u.filter((s) => s.n > 0).map((s) => `${h(s.n)} ${P[s.key].one}`).join(", "),
166
167
  children: [
167
168
  u.filter((s) => s.n > 0).map((s) => /* @__PURE__ */ e(
168
169
  "span",
169
170
  {
170
- className: K[s.key].bar,
171
+ className: P[s.key].bar,
171
172
  style: { width: `${Math.max(s.n / p * 100, 0.6)}%` }
172
173
  },
173
174
  s.key
@@ -198,7 +199,7 @@ function Be({
198
199
  ] });
199
200
  }
200
201
  function Qe({ u: t, runId: n }) {
201
- const [o, l] = N(!1), [i, c] = N(!1), p = t.distinct - t.values.length;
202
+ const [o, d] = k(!1), [i, c] = k(!1), p = t.distinct - t.values.length;
202
203
  return /* @__PURE__ */ a("li", { className: "border-b border-slate-100 last:border-b-0 dark:border-border/60", children: [
203
204
  /* @__PURE__ */ a(
204
205
  "button",
@@ -206,10 +207,10 @@ function Qe({ u: t, runId: n }) {
206
207
  type: "button",
207
208
  "data-run-unmatched": t.column,
208
209
  "aria-expanded": o,
209
- onClick: () => l((u) => !u),
210
+ onClick: () => d((u) => !u),
210
211
  className: b(
211
212
  "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/40",
212
- v
213
+ w
213
214
  ),
214
215
  children: [
215
216
  o ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
@@ -248,7 +249,7 @@ function Qe({ u: t, runId: n }) {
248
249
  ] })
249
250
  ] }),
250
251
  /* @__PURE__ */ a(
251
- P,
252
+ D,
252
253
  {
253
254
  "data-run-unmatched-copy": t.column,
254
255
  onClick: () => {
@@ -275,15 +276,15 @@ function Ve({
275
276
  report: t,
276
277
  runId: n,
277
278
  isAdmin: o,
278
- onKind: l
279
+ onKind: d
279
280
  }) {
280
281
  const { download: i, busy: c } = ke(), p = Object.entries(t.skipped).filter(([, u]) => u > 0);
281
282
  return t.unmatched.length === 0 && p.length === 0 && t.counts.failed === 0 ? null : /* @__PURE__ */ a("section", { "data-run-attention": !0, children: [
282
283
  /* @__PURE__ */ e(
283
- T,
284
+ L,
284
285
  {
285
286
  aside: o && t.unmatched.length > 0 ? /* @__PURE__ */ a(
286
- P,
287
+ D,
287
288
  {
288
289
  "data-run-unmatched-download": !0,
289
290
  disabled: c != null,
@@ -305,10 +306,10 @@ function Ve({
305
306
  "button",
306
307
  {
307
308
  type: "button",
308
- onClick: () => l("failed"),
309
+ onClick: () => d("failed"),
309
310
  className: b(
310
311
  "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/40",
311
- v
312
+ w
312
313
  ),
313
314
  children: [
314
315
  /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 shrink-0 text-[#dc2626] dark:text-[#fca5a5]" }),
@@ -329,10 +330,10 @@ function Ve({
329
330
  "button",
330
331
  {
331
332
  type: "button",
332
- onClick: () => l("skipped"),
333
+ onClick: () => d("skipped"),
333
334
  className: b(
334
335
  "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/40",
335
- v
336
+ w
336
337
  ),
337
338
  children: [
338
339
  /* @__PURE__ */ e("span", { className: "ml-[3px] h-1.5 w-1.5 shrink-0 rounded-full bg-[#f59e0b]" }),
@@ -356,18 +357,18 @@ function Ve({
356
357
  }
357
358
  function We({ item: t }) {
358
359
  if (t.changes.length === 0) return null;
359
- const n = t.kind === "created", o = t.changes.some((l) => l.from_known);
360
+ const n = t.kind === "created", o = t.changes.some((d) => d.from_known);
360
361
  return /* @__PURE__ */ a("table", { className: "w-full border-collapse text-[12px]", "data-run-changes": !0, children: [
361
362
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { className: "text-left text-[11px] text-slate-500 dark:text-muted-foreground", children: [
362
363
  /* @__PURE__ */ e("th", { className: "w-[34%] pb-1 pr-3 font-medium", children: "Field" }),
363
364
  !n && /* @__PURE__ */ e("th", { className: "w-[33%] pb-1 pr-3 font-medium", children: "Before" }),
364
365
  /* @__PURE__ */ e("th", { className: "pb-1 font-medium", children: n ? "Value" : "After" })
365
366
  ] }) }),
366
- /* @__PURE__ */ e("tbody", { children: t.changes.map((l) => /* @__PURE__ */ a("tr", { className: "border-t border-slate-100 align-top dark:border-border/60", children: [
367
- /* @__PURE__ */ e("td", { className: "py-1 pr-3 text-slate-600 dark:text-muted-foreground", children: l.label }),
368
- !n && /* @__PURE__ */ e("td", { className: "break-words py-1 pr-3 tabular-nums text-slate-500 dark:text-muted-foreground", children: l.from_known ? l.from ? /* @__PURE__ */ e("span", { className: "line-through decoration-slate-300 dark:decoration-slate-600", children: l.from }) : /* @__PURE__ */ e("span", { className: "italic", children: "empty" }) : /* @__PURE__ */ e("span", { className: "italic", children: "not kept" }) }),
369
- /* @__PURE__ */ e("td", { className: "break-words py-1 font-medium tabular-nums text-slate-900 dark:text-foreground", children: l.to || /* @__PURE__ */ e("span", { className: "font-normal italic text-slate-500", children: "empty" }) })
370
- ] }, l.field)) }),
367
+ /* @__PURE__ */ e("tbody", { children: t.changes.map((d) => /* @__PURE__ */ a("tr", { className: "border-t border-slate-100 align-top dark:border-border/60", children: [
368
+ /* @__PURE__ */ e("td", { className: "py-1 pr-3 text-slate-600 dark:text-muted-foreground", children: d.label }),
369
+ !n && /* @__PURE__ */ e("td", { className: "break-words py-1 pr-3 tabular-nums text-slate-500 dark:text-muted-foreground", children: d.from_known ? d.from ? /* @__PURE__ */ e("span", { className: "line-through decoration-slate-300 dark:decoration-slate-600", children: d.from }) : /* @__PURE__ */ e("span", { className: "italic", children: "empty" }) : /* @__PURE__ */ e("span", { className: "italic", children: "not kept" }) }),
370
+ /* @__PURE__ */ e("td", { className: "break-words py-1 font-medium tabular-nums text-slate-900 dark:text-foreground", children: d.to || /* @__PURE__ */ e("span", { className: "font-normal italic text-slate-500", children: "empty" }) })
371
+ ] }, d.field)) }),
371
372
  !n && !o && /* @__PURE__ */ e("caption", { className: "caption-bottom pt-1.5 text-left text-[11px] text-slate-500 dark:text-muted-foreground", children: "This run was read back from recorded changes, which keep the new value only." })
372
373
  ] });
373
374
  }
@@ -375,10 +376,10 @@ function Ae({
375
376
  item: t,
376
377
  manyCollections: n,
377
378
  isAdmin: o,
378
- onRevert: l,
379
+ onRevert: d,
379
380
  reverting: i
380
381
  }) {
381
- const [c, p] = N(!1), { urlFor: u, open: s } = Se(), g = K[t.kind], r = !!t.collection && !!t.item_id && t.kind !== "failed" && t.kind !== "removed", f = t.kind === "skipped" || t.kind === "failed" || t.kind === "removed" ? t.message ?? "" : t.kind === "created" ? `${t.changes.length} field${t.changes.length === 1 ? "" : "s"}` : t.changes.slice(0, 3).map((m) => m.label).join(", ") + (t.changes.length > 3 ? ` +${t.changes.length - 3}` : ""), x = o && !t.reverted_at && (t.kind === "created" || t.kind === "updated") && r;
382
+ const [c, p] = k(!1), { urlFor: u, open: s } = Se(), g = P[t.kind], r = !!t.collection && !!t.item_id && t.kind !== "failed" && t.kind !== "removed", x = t.kind === "skipped" || t.kind === "failed" || t.kind === "removed" ? t.message ?? "" : t.kind === "created" ? `${t.changes.length} field${t.changes.length === 1 ? "" : "s"}` : t.changes.slice(0, 3).map((m) => m.label).join(", ") + (t.changes.length > 3 ? ` +${t.changes.length - 3}` : ""), f = o && !t.reverted_at && (t.kind === "created" || t.kind === "updated") && r;
382
383
  return /* @__PURE__ */ a(
383
384
  "li",
384
385
  {
@@ -395,7 +396,7 @@ function Ae({
395
396
  className: b(
396
397
  "grid w-full grid-cols-[14px_minmax(0,1.2fr)_minmax(0,1.3fr)_72px] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/40",
397
398
  c && "bg-slate-50 dark:bg-muted/30",
398
- v
399
+ w
399
400
  ),
400
401
  children: [
401
402
  c ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5 text-slate-400" }),
@@ -420,9 +421,9 @@ function Ae({
420
421
  ] }),
421
422
  /* @__PURE__ */ a("span", { className: "truncate text-[12px] text-slate-600 dark:text-muted-foreground", children: [
422
423
  /* @__PURE__ */ e("span", { className: b("font-medium", g.text), children: g.label }),
423
- f && /* @__PURE__ */ a(R, { children: [
424
+ x && /* @__PURE__ */ a(S, { children: [
424
425
  " · ",
425
- f
426
+ x
426
427
  ] })
427
428
  ] }),
428
429
  /* @__PURE__ */ e("span", { className: "shrink-0 text-right font-mono text-[11px] tabular-nums text-slate-500 dark:text-muted-foreground", children: t.row != null ? `row ${h(t.row)}` : "" })
@@ -445,7 +446,7 @@ function Ae({
445
446
  "Revert: ",
446
447
  t.revert_note
447
448
  ] }),
448
- (r || x) && /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-1", children: [
449
+ (r || f) && /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-1", children: [
449
450
  r && /* @__PURE__ */ a(
450
451
  "a",
451
452
  {
@@ -462,7 +463,7 @@ function Ae({
462
463
  },
463
464
  className: b(
464
465
  "inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11.5px] font-medium text-[#0369a1] hover:bg-slate-100 dark:text-[#7dd3fc] dark:hover:bg-muted",
465
- v
466
+ w
466
467
  ),
467
468
  children: [
468
469
  /* @__PURE__ */ e(_e, { className: "h-3 w-3" }),
@@ -470,12 +471,12 @@ function Ae({
470
471
  ]
471
472
  }
472
473
  ),
473
- x && /* @__PURE__ */ a(
474
- P,
474
+ f && /* @__PURE__ */ a(
475
+ D,
475
476
  {
476
477
  "data-run-item-revert": !0,
477
478
  disabled: i,
478
- onClick: () => l(t),
479
+ onClick: () => d(t),
479
480
  children: [
480
481
  i ? /* @__PURE__ */ e(H, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(ee, { className: "h-3 w-3" }),
481
482
  t.kind === "created" ? "Remove this record" : "Put this record back"
@@ -492,60 +493,57 @@ function Ie({
492
493
  runId: t,
493
494
  report: n,
494
495
  kind: o,
495
- onKind: l,
496
+ onKind: d,
496
497
  isAdmin: i,
497
498
  live: c
498
499
  }) {
499
- var O, U, z;
500
- const p = te(), u = oe(), { download: s, busy: g, error: r } = ke(), [f, x] = N(""), [m, Q] = N(null), [w, L] = N(1), [q, D] = N(null), C = Te(f, 300);
501
- he(() => L(1), [o, m, C, t]);
502
- const $ = { kind: o ?? "", collection: m ?? "", search: C, page: w, limit: B }, y = X({
503
- queryKey: ["staged-import-run-items", t, $],
500
+ var U, z, v;
501
+ const p = te(), u = oe(), { download: s, busy: g, error: r } = ke(), [x, f] = k(""), [m, Q] = k(null), [y, q] = k(1), [E, j] = k(null), $ = Te(x, 300);
502
+ he(() => q(1), [o, m, $, t]);
503
+ const _ = { kind: o ?? "", collection: m ?? "", search: $, page: y, limit: B }, C = X({
504
+ queryKey: ["staged-import-run-items", t, _],
504
505
  queryFn: () => p.request(
505
- xe(`/staged-imports/${t}/items`, $)
506
+ xe(`/staged-imports/${t}/items`, _)
506
507
  ),
507
- placeholderData: (d) => d,
508
+ placeholderData: (l) => l,
508
509
  refetchInterval: c ? fe : !1
509
- }), E = Y({
510
- mutationFn: (d) => p.request(
511
- J(`/staged-imports/${t}/revert`, { item_ids: [d.id] })
510
+ }), F = Y({
511
+ mutationFn: (l) => p.request(
512
+ J(`/staged-imports/${t}/revert`, { item_ids: [l.id] })
512
513
  ),
513
- onSuccess: (d) => {
514
- const k = d.data;
515
- D(
516
- k.failed ? `Could not be reverted: ${k.failures[0] ?? "unknown reason"}` : k.removed ? "Removed. The record is in the trash." : k.restored ? "Put back to the values it held before the import." : "Left as it is: it changed again after the import."
514
+ onSuccess: (l) => {
515
+ const N = l.data;
516
+ j(
517
+ N.failed ? `Could not be reverted: ${N.failures[0] ?? "unknown reason"}` : N.removed ? "Removed. The record is in the trash." : N.restored ? "Put back to the values it held before the import." : "Left as it is: it changed again after the import."
517
518
  ), u.invalidateQueries({ queryKey: ["staged-import-run-items", t] }), u.invalidateQueries({ queryKey: ["staged-import-run", t] });
518
519
  },
519
- onError: (d) => {
520
- var k;
521
- return D(((k = d.response) == null ? void 0 : k.error) ?? d.message);
522
- }
523
- }), F = ((O = y.data) == null ? void 0 : O.facets) ?? {}, j = Object.keys(F.collection ?? n.collections ?? {}), _ = ((U = y.data) == null ? void 0 : U.total) ?? 0, M = ((z = y.data) == null ? void 0 : z.data) ?? [], V = n.items_stored ?? 0, W = [
524
- { key: null, label: "All", n: Object.values(F.kind ?? {}).reduce((d, k) => d + k, 0) },
525
- ...["created", "updated", "removed", "skipped", "failed"].map((d) => {
526
- var k;
527
- return { key: d, label: K[d].label, n: ((k = F.kind) == null ? void 0 : k[d]) ?? 0 };
528
- }).filter((d) => d.n > 0 || d.key === o)
520
+ onError: (l) => j(ae(l, "That did not work"))
521
+ }), K = ((U = C.data) == null ? void 0 : U.facets) ?? {}, M = Object.keys(K.collection ?? n.collections ?? {}), R = ((z = C.data) == null ? void 0 : z.total) ?? 0, O = ((v = C.data) == null ? void 0 : v.data) ?? [], V = n.items_stored ?? 0, W = [
522
+ { key: null, label: "All", n: Object.values(K.kind ?? {}).reduce((l, N) => l + N, 0) },
523
+ ...["created", "updated", "removed", "skipped", "failed"].map((l) => {
524
+ var N;
525
+ return { key: l, label: P[l].label, n: ((N = K.kind) == null ? void 0 : N[l]) ?? 0 };
526
+ }).filter((l) => l.n > 0 || l.key === o)
529
527
  ];
530
- return V === 0 && !y.isLoading && _ === 0 && !C && !o ? /* @__PURE__ */ a("section", { "data-run-records": !0, children: [
531
- /* @__PURE__ */ e(T, { children: "Records" }),
528
+ return V === 0 && !C.isLoading && R === 0 && !$ && !o ? /* @__PURE__ */ a("section", { "data-run-records": !0, children: [
529
+ /* @__PURE__ */ e(L, { children: "Records" }),
532
530
  /* @__PURE__ */ e("p", { className: "rounded-md border border-dashed border-slate-200 px-3 py-4 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground", children: "This run changed no records and left no rows out. Every row in the file already matched what is stored." })
533
531
  ] }) : /* @__PURE__ */ a("section", { "data-run-records": !0, children: [
534
532
  /* @__PURE__ */ e(
535
- T,
533
+ L,
536
534
  {
537
535
  aside: i ? /* @__PURE__ */ a(
538
- P,
536
+ D,
539
537
  {
540
538
  "data-run-items-download": !0,
541
- disabled: g != null || _ === 0,
539
+ disabled: g != null || R === 0,
542
540
  onClick: () => s(
543
- `/staged-imports/${t}/items.csv?kind=${o ?? ""}&collection=${m ?? ""}&search=${encodeURIComponent(C)}`,
541
+ `/staged-imports/${t}/items.csv?kind=${o ?? ""}&collection=${m ?? ""}&search=${encodeURIComponent($)}`,
544
542
  `import-run-${t}${o ? `-${o}` : ""}.csv`
545
543
  ),
546
544
  children: [
547
545
  g ? /* @__PURE__ */ e(H, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Z, { className: "h-3 w-3" }),
548
- o ? `${K[o].label} as CSV` : "All as CSV"
546
+ o ? `${P[o].label} as CSV` : "All as CSV"
549
547
  ]
550
548
  }
551
549
  ) : null,
@@ -559,50 +557,50 @@ function Ie({
559
557
  role: "group",
560
558
  "aria-label": "Show",
561
559
  className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border",
562
- children: W.map((d) => /* @__PURE__ */ a(
560
+ children: W.map((l) => /* @__PURE__ */ a(
563
561
  "button",
564
562
  {
565
563
  type: "button",
566
- "data-run-kind": d.key ?? "all",
567
- "aria-pressed": o === d.key,
568
- onClick: () => l(d.key),
564
+ "data-run-kind": l.key ?? "all",
565
+ "aria-pressed": o === l.key,
566
+ onClick: () => d(l.key),
569
567
  className: b(
570
568
  "border-r border-slate-200 px-2.5 py-1 text-[12px] transition-colors last:border-r-0 dark:border-border",
571
- o === d.key ? "bg-[#0f172a] font-medium text-[#ffffff] dark:bg-[#e2e8f0] dark:text-[#0f172a]" : "bg-white text-slate-700 hover:bg-slate-50 dark:bg-card dark:text-foreground dark:hover:bg-muted/40",
572
- v
569
+ o === l.key ? "bg-[#0f172a] font-medium text-[#ffffff] dark:bg-[#e2e8f0] dark:text-[#0f172a]" : "bg-white text-slate-700 hover:bg-slate-50 dark:bg-card dark:text-foreground dark:hover:bg-muted/40",
570
+ w
573
571
  ),
574
572
  children: [
575
- d.label,
573
+ l.label,
576
574
  " ",
577
- /* @__PURE__ */ e("span", { className: "tabular-nums opacity-75", children: h(d.n) })
575
+ /* @__PURE__ */ e("span", { className: "tabular-nums opacity-75", children: h(l.n) })
578
576
  ]
579
577
  },
580
- d.key ?? "all"
578
+ l.key ?? "all"
581
579
  ))
582
580
  }
583
581
  ),
584
- j.length > 1 && // biome-ignore lint/a11y/useSemanticElements: a fieldset brings a border and legend this strip does not want
582
+ M.length > 1 && // biome-ignore lint/a11y/useSemanticElements: a fieldset brings a border and legend this strip does not want
585
583
  /* @__PURE__ */ e(
586
584
  "div",
587
585
  {
588
586
  role: "group",
589
587
  "aria-label": "Collection",
590
588
  className: "flex flex-wrap items-center gap-1 text-[12px]",
591
- children: [null, ...j].map((d) => /* @__PURE__ */ e(
589
+ children: [null, ...M].map((l) => /* @__PURE__ */ e(
592
590
  "button",
593
591
  {
594
592
  type: "button",
595
- "data-run-collection": d ?? "every",
596
- "aria-pressed": m === d,
597
- onClick: () => Q(d),
593
+ "data-run-collection": l ?? "every",
594
+ "aria-pressed": m === l,
595
+ onClick: () => Q(l),
598
596
  className: b(
599
597
  "rounded-full border px-2 py-0.5 transition-colors",
600
- m === d ? "border-[#0ea5e9] bg-[#f0f9ff] text-[#0369a1] dark:bg-[#0c2a3d] dark:text-[#7dd3fc]" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted/40",
601
- v
598
+ m === l ? "border-[#0ea5e9] bg-[#f0f9ff] text-[#0369a1] dark:bg-[#0c2a3d] dark:text-[#7dd3fc]" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted/40",
599
+ w
602
600
  ),
603
- children: d ? ge(d) : "Every collection"
601
+ children: l ? ge(l) : "Every collection"
604
602
  },
605
- d ?? "every"
603
+ l ?? "every"
606
604
  ))
607
605
  }
608
606
  ),
@@ -611,8 +609,8 @@ function Ie({
611
609
  /* @__PURE__ */ e(
612
610
  Ke,
613
611
  {
614
- value: f,
615
- onChange: (d) => x(d.target.value),
612
+ value: x,
613
+ onChange: (l) => f(l.target.value),
616
614
  placeholder: "Find a record or a value",
617
615
  "aria-label": "Find a record or a value",
618
616
  "data-run-search": !0,
@@ -621,12 +619,12 @@ function Ie({
621
619
  )
622
620
  ] })
623
621
  ] }),
624
- (q || r) && /* @__PURE__ */ e(
622
+ (E || r) && /* @__PURE__ */ e(
625
623
  "p",
626
624
  {
627
625
  role: "status",
628
626
  className: "mb-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-1.5 text-[12px] text-slate-700 dark:border-border dark:bg-muted/40 dark:text-foreground",
629
- children: q ?? r
627
+ children: E ?? r
630
628
  }
631
629
  ),
632
630
  /* @__PURE__ */ e(
@@ -634,55 +632,55 @@ function Ie({
634
632
  {
635
633
  className: b(
636
634
  "overflow-hidden rounded-md border border-slate-200 transition-opacity dark:border-border",
637
- y.isFetching && !y.isLoading && "opacity-70"
635
+ C.isFetching && !C.isLoading && "opacity-70"
638
636
  ),
639
- children: y.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-1.5 p-3", children: [0, 1, 2, 3, 4, 5].map((d) => /* @__PURE__ */ e(G, { className: "h-5 w-full" }, d)) }) : M.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12.5px] text-slate-600 dark:text-muted-foreground", children: C ? `Nothing in this run matches “${C}”.` : "Nothing to show for this choice." }) : /* @__PURE__ */ e("ul", { children: M.map((d) => {
640
- var k;
637
+ children: C.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-1.5 p-3", children: [0, 1, 2, 3, 4, 5].map((l) => /* @__PURE__ */ e(G, { className: "h-5 w-full" }, l)) }) : O.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12.5px] text-slate-600 dark:text-muted-foreground", children: $ ? `Nothing in this run matches “${$}”.` : "Nothing to show for this choice." }) : /* @__PURE__ */ e("ul", { children: O.map((l) => {
638
+ var N;
641
639
  return /* @__PURE__ */ e(
642
640
  Ae,
643
641
  {
644
- item: d,
645
- manyCollections: j.length > 1,
642
+ item: l,
643
+ manyCollections: M.length > 1,
646
644
  isAdmin: i,
647
645
  onRevert: (A) => {
648
- D(null), E.mutate(A);
646
+ j(null), F.mutate(A);
649
647
  },
650
- reverting: E.isPending && ((k = E.variables) == null ? void 0 : k.id) === d.id
648
+ reverting: F.isPending && ((N = F.variables) == null ? void 0 : N.id) === l.id
651
649
  },
652
- d.id
650
+ l.id
653
651
  );
654
652
  }) })
655
653
  }
656
654
  ),
657
- _ > B && /* @__PURE__ */ a("div", { className: "mt-2 flex items-center justify-between text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
655
+ R > B && /* @__PURE__ */ a("div", { className: "mt-2 flex items-center justify-between text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
658
656
  /* @__PURE__ */ a("span", { className: "tabular-nums", children: [
659
- h((w - 1) * B + 1),
657
+ h((y - 1) * B + 1),
660
658
  "–",
661
- h(Math.min(w * B, _)),
659
+ h(Math.min(y * B, R)),
662
660
  " of",
663
661
  " ",
664
- h(_)
662
+ h(R)
665
663
  ] }),
666
664
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
667
665
  /* @__PURE__ */ e(
668
- S,
666
+ T,
669
667
  {
670
668
  variant: "outline",
671
669
  size: "sm",
672
670
  className: "h-6 px-2 text-[11.5px]",
673
- disabled: w <= 1,
674
- onClick: () => L((d) => d - 1),
671
+ disabled: y <= 1,
672
+ onClick: () => q((l) => l - 1),
675
673
  children: "Previous"
676
674
  }
677
675
  ),
678
676
  /* @__PURE__ */ e(
679
- S,
677
+ T,
680
678
  {
681
679
  variant: "outline",
682
680
  size: "sm",
683
681
  className: "h-6 px-2 text-[11.5px]",
684
- disabled: w * B >= _,
685
- onClick: () => L((d) => d + 1),
682
+ disabled: y * B >= R,
683
+ onClick: () => q((l) => l + 1),
686
684
  children: "Next"
687
685
  }
688
686
  )
@@ -699,13 +697,13 @@ function Ie({
699
697
  function Ge({ report: t }) {
700
698
  const n = t.phases.filter((i) => i.ms > 0 || (i.count ?? 0) > 0);
701
699
  if (n.length === 0) return null;
702
- const o = Math.max(...n.map((i) => i.ms), 1), l = n.reduce((i, c) => i + c.ms, 0);
700
+ const o = Math.max(...n.map((i) => i.ms), 1), d = n.reduce((i, c) => i + c.ms, 0);
703
701
  return /* @__PURE__ */ a("section", { "data-run-phases": !0, children: [
704
702
  /* @__PURE__ */ e(
705
- T,
703
+ L,
706
704
  {
707
705
  aside: /* @__PURE__ */ a("span", { className: "text-[11.5px] tabular-nums text-slate-600 dark:text-muted-foreground", children: [
708
- le(l),
706
+ de(d),
709
707
  " in all"
710
708
  ] }),
711
709
  children: "Where the time went"
@@ -745,7 +743,7 @@ function Ge({ report: t }) {
745
743
  )
746
744
  }
747
745
  ),
748
- /* @__PURE__ */ e("span", { className: "text-right font-mono text-[11.5px] tabular-nums text-slate-700 dark:text-foreground", children: le(i.ms) })
746
+ /* @__PURE__ */ e("span", { className: "text-right font-mono text-[11.5px] tabular-nums text-slate-700 dark:text-foreground", children: de(i.ms) })
749
747
  ]
750
748
  },
751
749
  i.key
@@ -757,28 +755,25 @@ function He({
757
755
  onDone: n,
758
756
  onClose: o
759
757
  }) {
760
- var r, f;
761
- const l = te(), i = X({
758
+ var r, x;
759
+ const d = te(), i = X({
762
760
  queryKey: ["staged-import-revert-preview", t],
763
- queryFn: () => l.request(
761
+ queryFn: () => d.request(
764
762
  J(`/staged-imports/${t}/revert/preview`, {})
765
763
  ),
766
764
  staleTime: 0,
767
765
  gcTime: 0
768
- }), [c, p] = N(null), u = Y({
769
- mutationFn: () => l.request(
766
+ }), [c, p] = k(null), u = Y({
767
+ mutationFn: () => d.request(
770
768
  J(`/staged-imports/${t}/revert`, {})
771
769
  ),
772
- onSuccess: (x) => {
773
- const m = x.data;
770
+ onSuccess: (f) => {
771
+ const m = f.data;
774
772
  p(
775
773
  m.done ? `${h(m.removed ?? 0)} removed, ${h(m.restored ?? 0)} put back, ${h(m.left_alone ?? 0)} left as they are${m.failed ? `, ${h(m.failed)} failed` : ""}.` : `Reverting ${h(m.queued ?? 0)} records in the background. Rows here turn to Reverted as they land; Background Jobs shows the progress.`
776
774
  ), n();
777
775
  },
778
- onError: (x) => {
779
- var m;
780
- return p(((m = x.response) == null ? void 0 : m.error) ?? x.message);
781
- }
776
+ onError: (f) => p(ae(f, "That did not work"))
782
777
  }), s = (r = i.data) == null ? void 0 : r.data, g = s ? s.remove + s.restore + s.partly : 0;
783
778
  return /* @__PURE__ */ a(
784
779
  "div",
@@ -790,14 +785,14 @@ function He({
790
785
  i.isLoading ? /* @__PURE__ */ a("p", { className: "mt-1.5 flex items-center gap-2 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
791
786
  /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5 animate-spin" }),
792
787
  " Checking each record against what is stored now…"
793
- ] }) : i.isError || !s ? /* @__PURE__ */ e("p", { className: "mt-1.5 text-[12px] text-[#b91c1c] dark:text-[#fca5a5]", children: ((f = i.error) == null ? void 0 : f.message) ?? "The preview could not be read." }) : c ? /* @__PURE__ */ e(
788
+ ] }) : i.isError || !s ? /* @__PURE__ */ e("p", { className: "mt-1.5 text-[12px] text-[#b91c1c] dark:text-[#fca5a5]", children: ((x = i.error) == null ? void 0 : x.message) ?? "The preview could not be read." }) : c ? /* @__PURE__ */ e(
794
789
  "p",
795
790
  {
796
791
  role: "status",
797
792
  className: "mt-1.5 max-w-[78ch] text-[12px] text-slate-700 dark:text-foreground",
798
793
  children: c
799
794
  }
800
- ) : /* @__PURE__ */ a(R, { children: [
795
+ ) : /* @__PURE__ */ a(S, { children: [
801
796
  /* @__PURE__ */ a("ul", { className: "mt-1.5 space-y-0.5 text-[12px] text-slate-700 dark:text-foreground", children: [
802
797
  /* @__PURE__ */ a("li", { "data-revert-restore": !0, children: [
803
798
  /* @__PURE__ */ e("span", { className: "font-semibold tabular-nums", children: h(s.restore + s.partly) }),
@@ -826,18 +821,18 @@ function He({
826
821
  ] }),
827
822
  s.left.length > 0 && /* @__PURE__ */ a("details", { className: "mt-1.5 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
828
823
  /* @__PURE__ */ e("summary", { className: "cursor-pointer select-none", children: "Which records stay, and why" }),
829
- /* @__PURE__ */ e("ul", { className: "mt-1 max-h-32 space-y-0.5 overflow-y-auto", children: s.left.map((x) => /* @__PURE__ */ a("li", { children: [
830
- /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-foreground", children: x.label || `#${x.item_id}` }),
824
+ /* @__PURE__ */ e("ul", { className: "mt-1 max-h-32 space-y-0.5 overflow-y-auto", children: s.left.map((f) => /* @__PURE__ */ a("li", { children: [
825
+ /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-foreground", children: f.label || `#${f.item_id}` }),
831
826
  " ",
832
827
  "· ",
833
- x.note
834
- ] }, x.id)) })
828
+ f.note
829
+ ] }, f.id)) })
835
830
  ] }),
836
831
  /* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[78ch] text-[11.5px] text-slate-600 dark:text-muted-foreground", children: "Each change is written under your name and can be seen in the record's history. Work the run did outside the records listed here is not undone." })
837
832
  ] }),
838
833
  /* @__PURE__ */ a("div", { className: "mt-2.5 flex items-center gap-2", children: [
839
834
  !c && s && /* @__PURE__ */ a(
840
- S,
835
+ T,
841
836
  {
842
837
  size: "sm",
843
838
  variant: "destructive",
@@ -850,7 +845,7 @@ function He({
850
845
  ]
851
846
  }
852
847
  ),
853
- /* @__PURE__ */ e(S, { size: "sm", variant: "ghost", onClick: o, children: c ? "Close" : "Keep the run as it is" })
848
+ /* @__PURE__ */ e(T, { size: "sm", variant: "ghost", onClick: o, children: c ? "Close" : "Keep the run as it is" })
854
849
  ] })
855
850
  ]
856
851
  }
@@ -871,7 +866,7 @@ function Je({ run: t }) {
871
866
  className: "inline-flex flex-wrap items-center gap-1 font-mono text-[11px]",
872
867
  children: [
873
868
  t.staging_table || `staging_${t.import_key}`,
874
- n === "procedure" ? /* @__PURE__ */ a(R, { children: [
869
+ n === "procedure" ? /* @__PURE__ */ a(S, { children: [
875
870
  /* @__PURE__ */ e(ye, { className: "h-3 w-3 text-slate-400" }),
876
871
  o
877
872
  ] }) : /* @__PURE__ */ e("span", { className: "font-sans", children: "· load only" })
@@ -885,46 +880,46 @@ function I({ label: t, children: n }) {
885
880
  /* @__PURE__ */ e("dd", { className: "truncate text-[12.5px] text-slate-900 dark:text-foreground", children: n })
886
881
  ] });
887
882
  }
888
- function Nt({
883
+ function vt({
889
884
  run: t,
890
885
  runId: n,
891
886
  stage: o,
892
- isAdmin: l,
887
+ isAdmin: d,
893
888
  onClose: i,
894
889
  onRequeue: c,
895
890
  onCancel: p
896
891
  }) {
897
- var M, V, W, O, U, z;
892
+ var O, V, W, U, z;
898
893
  const u = te(), s = oe(), g = X({
899
894
  queryKey: ["staged-import-run", n],
900
895
  queryFn: () => u.request(xe(`/staged-imports/${n}`)),
901
896
  enabled: n != null,
902
- refetchInterval: (d) => {
903
- var k, A, ae, re;
904
- return ((A = (k = d.state.data) == null ? void 0 : k.data) == null ? void 0 : A.status) === "running" || ((re = (ae = d.state.data) == null ? void 0 : ae.data) == null ? void 0 : re.status) === "queued" ? fe : !1;
897
+ refetchInterval: (v) => {
898
+ var l, N, A, re;
899
+ return ((N = (l = v.state.data) == null ? void 0 : l.data) == null ? void 0 : N.status) === "running" || ((re = (A = v.state.data) == null ? void 0 : A.data) == null ? void 0 : re.status) === "queued" ? fe : !1;
905
900
  }
906
- }), r = ((M = g.data) == null ? void 0 : M.data) ?? t, f = ((W = (V = g.data) == null ? void 0 : V.data) == null ? void 0 : W.report) ?? null, x = Oe((r == null ? void 0 : r.started_at) ?? (r == null ? void 0 : r.created_at), (r == null ? void 0 : r.status) === "running"), m = r != null && r.file ? u.fileUrl(r.file) : null, [Q, w] = N(null), [L, q] = N(!1), [D, C] = N(!1);
901
+ }), r = ((O = g.data) == null ? void 0 : O.data) ?? t, x = ((W = (V = g.data) == null ? void 0 : V.data) == null ? void 0 : W.report) ?? null, f = Oe((r == null ? void 0 : r.started_at) ?? (r == null ? void 0 : r.created_at), (r == null ? void 0 : r.status) === "running"), m = r != null && r.file ? u.fileUrl(r.file) : null, [Q, y] = k(null), [q, E] = k(!1), [j, $] = k(!1);
907
902
  he(() => {
908
- w(null), q(!1), C(!1);
903
+ y(null), E(!1), $(!1);
909
904
  }, [n]);
910
- const $ = Y({
905
+ const _ = Y({
911
906
  mutationFn: () => u.request(
912
907
  J(`/staged-imports/${n}/report/rebuild`, {})
913
908
  ),
914
909
  onSuccess: () => void s.invalidateQueries({ queryKey: ["staged-import-run", n] })
915
- }), y = r ? be(r).mode : null, E = (r == null ? void 0 : r.status) === "completed" || (r == null ? void 0 : r.status) === "error", F = l && !!f && E && (f.counts.created > 0 || f.counts.updated > 0), j = !!f, _ = pe(() => r ? /* @__PURE__ */ a("dl", { className: "mt-3 grid grid-cols-2 gap-x-5 gap-y-2 sm:grid-cols-4", children: [
910
+ }), C = r ? be(r).mode : null, F = (r == null ? void 0 : r.status) === "completed" || (r == null ? void 0 : r.status) === "error", K = d && !!x && F && (x.counts.created > 0 || x.counts.updated > 0), M = !!x, R = pe(() => r ? /* @__PURE__ */ a("dl", { className: "mt-3 grid grid-cols-2 gap-x-5 gap-y-2 sm:grid-cols-4", children: [
916
911
  /* @__PURE__ */ e(I, { label: "Queued by", children: ze(r) ?? "—" }),
917
912
  /* @__PURE__ */ e(I, { label: r.finished_at ? "Finished" : r.started_at ? "Started" : "Queued", children: se(r.finished_at ?? r.started_at ?? r.created_at ?? /* @__PURE__ */ new Date()) }),
918
913
  /* @__PURE__ */ e(I, { label: "Took", children: /* @__PURE__ */ e("span", { className: "tabular-nums", children: ne(r.duration) }) }),
919
914
  /* @__PURE__ */ e(I, { label: "Rows in the file", children: /* @__PURE__ */ e("span", { className: "tabular-nums", children: r.row_count == null ? "—" : h(r.row_count) }) })
920
915
  ] }) : null, [r]);
921
- return /* @__PURE__ */ e(Pe, { open: n != null, onOpenChange: (d) => !d && i(), children: /* @__PURE__ */ a(
916
+ return /* @__PURE__ */ e(Pe, { open: n != null, onOpenChange: (v) => !v && i(), children: /* @__PURE__ */ a(
922
917
  De,
923
918
  {
924
919
  side: "right",
925
- className: b("p-0 sm:max-w-none", j ? "w-[min(860px,96vw)]" : "w-[min(560px,94vw)]"),
920
+ className: b("p-0 sm:max-w-none", M ? "w-[min(860px,96vw)]" : "w-[min(560px,94vw)]"),
926
921
  children: [
927
- /* @__PURE__ */ e(je, { className: "sr-only", children: r ? `Import run ${r.id}: ${((O = r.definition_label) == null ? void 0 : O.trim()) || r.import_key}` : "Import run" }),
922
+ /* @__PURE__ */ e(je, { className: "sr-only", children: r ? `Import run ${r.id}: ${((U = r.definition_label) == null ? void 0 : U.trim()) || r.import_key}` : "Import run" }),
928
923
  /* @__PURE__ */ e(Me, { className: "sr-only", children: "What the run did, what needs a look, the records it touched and its log." }),
929
924
  r ? /* @__PURE__ */ a("div", { className: "flex h-full flex-col", "data-run-sheet": r.id, children: [
930
925
  /* @__PURE__ */ a("header", { className: "shrink-0 border-b border-slate-200 px-5 py-4 pr-12 dark:border-border", children: [
@@ -946,26 +941,26 @@ function Nt({
946
941
  }
947
942
  )
948
943
  ] }),
949
- /* @__PURE__ */ e("h2", { className: "mt-1.5 text-[16px] font-semibold text-slate-900 dark:text-foreground", children: ((U = r.definition_label) == null ? void 0 : U.trim()) || r.import_key }),
944
+ /* @__PURE__ */ e("h2", { className: "mt-1.5 text-[16px] font-semibold text-slate-900 dark:text-foreground", children: ((z = r.definition_label) == null ? void 0 : z.trim()) || r.import_key }),
950
945
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: /* @__PURE__ */ e(Je, { run: r }) }),
951
946
  o && r.status === "running" && /* @__PURE__ */ a("p", { className: "mt-2 text-[12px] text-[#0284a8] dark:text-nvr-cyan", children: [
952
947
  o,
953
- x != null && ` · ${ne(x)} elapsed`
948
+ f != null && ` · ${ne(f)} elapsed`
954
949
  ] }),
955
- _
950
+ R
956
951
  ] }),
957
952
  /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-4", children: [
958
- f ? /* @__PURE__ */ a(R, { children: [
959
- /* @__PURE__ */ e(Be, { report: f, kind: Q, onKind: w }),
953
+ x ? /* @__PURE__ */ a(S, { children: [
954
+ /* @__PURE__ */ e(Be, { report: x, kind: Q, onKind: y }),
960
955
  /* @__PURE__ */ e(
961
956
  Ve,
962
957
  {
963
- report: f,
958
+ report: x,
964
959
  runId: r.id,
965
- isAdmin: l,
966
- onKind: (d) => {
967
- var k;
968
- w(d), (k = document.querySelector("[data-run-records]")) == null || k.scrollIntoView({ block: "start", behavior: "smooth" });
960
+ isAdmin: d,
961
+ onKind: (v) => {
962
+ var l;
963
+ y(v), (l = document.querySelector("[data-run-records]")) == null || l.scrollIntoView({ block: "start", behavior: "smooth" });
969
964
  }
970
965
  }
971
966
  ),
@@ -973,43 +968,43 @@ function Nt({
973
968
  Ie,
974
969
  {
975
970
  runId: r.id,
976
- report: f,
971
+ report: x,
977
972
  kind: Q,
978
- onKind: w,
979
- isAdmin: l,
980
- live: D
973
+ onKind: y,
974
+ isAdmin: d,
975
+ live: j
981
976
  }
982
977
  ),
983
- /* @__PURE__ */ e(Ge, { report: f }),
984
- f.notes.length > 0 && /* @__PURE__ */ a("section", { "data-run-notes": !0, children: [
985
- /* @__PURE__ */ e(T, { children: "Worth knowing" }),
986
- /* @__PURE__ */ e("ul", { className: "max-w-[78ch] space-y-1.5 text-[12px] leading-relaxed text-slate-700 dark:text-foreground", children: f.notes.map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
978
+ /* @__PURE__ */ e(Ge, { report: x }),
979
+ x.notes.length > 0 && /* @__PURE__ */ a("section", { "data-run-notes": !0, children: [
980
+ /* @__PURE__ */ e(L, { children: "Worth knowing" }),
981
+ /* @__PURE__ */ e("ul", { className: "max-w-[78ch] space-y-1.5 text-[12px] leading-relaxed text-slate-700 dark:text-foreground", children: x.notes.map((v) => /* @__PURE__ */ e("li", { children: v }, v)) })
987
982
  ] })
988
- ] }) : E && /* @__PURE__ */ a("section", { "data-run-no-report": !0, children: [
983
+ ] }) : F && /* @__PURE__ */ a("section", { "data-run-no-report": !0, children: [
989
984
  /* @__PURE__ */ a("p", { className: "max-w-[64ch] rounded-md border border-dashed border-slate-200 px-3 py-3 text-[12.5px] leading-relaxed text-slate-600 dark:border-border dark:text-muted-foreground", children: [
990
- y === "procedure" || y === "load" ? "This run went through a stored procedure, which writes straight to the tables. It kept its timings and its log, and no record-by-record detail." : "This run finished before record-by-record detail was kept.",
991
- l && /* @__PURE__ */ a(R, { children: [
985
+ C === "procedure" || C === "load" ? "This run went through a stored procedure, which writes straight to the tables. It kept its timings and its log, and no record-by-record detail." : "This run finished before record-by-record detail was kept.",
986
+ d && /* @__PURE__ */ a(S, { children: [
992
987
  " ",
993
988
  /* @__PURE__ */ e(
994
989
  "button",
995
990
  {
996
991
  type: "button",
997
992
  "data-run-rebuild": !0,
998
- disabled: $.isPending,
999
- onClick: () => $.mutate(),
993
+ disabled: _.isPending,
994
+ onClick: () => _.mutate(),
1000
995
  className: b(
1001
996
  "font-medium text-[#0369a1] underline-offset-2 hover:underline disabled:opacity-60 dark:text-[#7dd3fc]",
1002
- v
997
+ w
1003
998
  ),
1004
- children: $.isPending ? "Reading…" : "Read it back from recorded changes"
999
+ children: _.isPending ? "Reading…" : "Read it back from recorded changes"
1005
1000
  }
1006
1001
  )
1007
1002
  ] })
1008
1003
  ] }),
1009
- $.isError && /* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[64ch] text-[12px] text-slate-700 dark:text-foreground", children: ((z = $.error.response) == null ? void 0 : z.error) ?? $.error.message })
1004
+ _.isError && /* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[64ch] text-[12px] text-slate-700 dark:text-foreground", children: ae(_.error, "The rebuild did not start") })
1010
1005
  ] }),
1011
1006
  /* @__PURE__ */ a("section", { "data-run-file": !0, children: [
1012
- /* @__PURE__ */ e(T, { children: "File" }),
1007
+ /* @__PURE__ */ e(L, { children: "File" }),
1013
1008
  r.file_name || r.file ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2.5 rounded-md border border-slate-200 px-3 py-2 dark:border-border", children: [
1014
1009
  /* @__PURE__ */ e(Ne, { className: "h-4 w-4 shrink-0 text-slate-400" }),
1015
1010
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
@@ -1025,7 +1020,7 @@ function Nt({
1025
1020
  "data-run-file-download": !0,
1026
1021
  className: b(
1027
1022
  "rounded p-1 text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-800 dark:hover:bg-muted",
1028
- v
1023
+ w
1029
1024
  ),
1030
1025
  "aria-label": "Download the source file",
1031
1026
  children: /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5" })
@@ -1033,7 +1028,7 @@ function Nt({
1033
1028
  )
1034
1029
  ] }) : /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: "No file is attached, so this run cannot be queued again." })
1035
1030
  ] }),
1036
- l && r.status !== "running" && (r.status === "error" || (r.duration ?? 0) >= Ye) && /* @__PURE__ */ e("section", { "data-run-explain": !0, children: /* @__PURE__ */ e(
1031
+ d && r.status !== "running" && (r.status === "error" || (r.duration ?? 0) >= Ye) && /* @__PURE__ */ e("section", { "data-run-explain": !0, children: /* @__PURE__ */ e(
1037
1032
  Fe,
1038
1033
  {
1039
1034
  kind: "import-run",
@@ -1041,27 +1036,27 @@ function Nt({
1041
1036
  label: r.status === "completed" ? "Explain why this was slow" : "Explain this failure"
1042
1037
  }
1043
1038
  ) }),
1044
- /* @__PURE__ */ e("section", { "data-run-log": !0, children: f ? /* @__PURE__ */ a("details", { children: [
1039
+ /* @__PURE__ */ e("section", { "data-run-log": !0, children: x ? /* @__PURE__ */ a("details", { children: [
1045
1040
  /* @__PURE__ */ e("summary", { className: "cursor-pointer select-none text-[12.5px] font-semibold text-slate-900 dark:text-foreground", children: "The run's own log" }),
1046
- /* @__PURE__ */ e(de, { run: r })
1047
- ] }) : /* @__PURE__ */ a(R, { children: [
1048
- /* @__PURE__ */ e(T, { children: "Log" }),
1049
- /* @__PURE__ */ e(de, { run: r })
1041
+ /* @__PURE__ */ e(le, { run: r })
1042
+ ] }) : /* @__PURE__ */ a(S, { children: [
1043
+ /* @__PURE__ */ e(L, { children: "Log" }),
1044
+ /* @__PURE__ */ e(le, { run: r })
1050
1045
  ] }) })
1051
1046
  ] }),
1052
- L && F && /* @__PURE__ */ e(
1047
+ q && K && /* @__PURE__ */ e(
1053
1048
  He,
1054
1049
  {
1055
1050
  runId: r.id,
1056
- onClose: () => q(!1),
1051
+ onClose: () => E(!1),
1057
1052
  onDone: () => {
1058
- C(!0), s.invalidateQueries({ queryKey: ["staged-import-run", r.id] }), s.invalidateQueries({ queryKey: ["staged-import-run-items", r.id] });
1053
+ $(!0), s.invalidateQueries({ queryKey: ["staged-import-run", r.id] }), s.invalidateQueries({ queryKey: ["staged-import-run-items", r.id] });
1059
1054
  }
1060
1055
  }
1061
1056
  ),
1062
- l && /* @__PURE__ */ a("footer", { className: "flex shrink-0 flex-wrap items-center gap-2 border-t border-slate-200 px-5 py-3 dark:border-border", children: [
1057
+ d && /* @__PURE__ */ a("footer", { className: "flex shrink-0 flex-wrap items-center gap-2 border-t border-slate-200 px-5 py-3 dark:border-border", children: [
1063
1058
  /* @__PURE__ */ a(
1064
- S,
1059
+ T,
1065
1060
  {
1066
1061
  variant: "outline",
1067
1062
  size: "sm",
@@ -1073,20 +1068,20 @@ function Nt({
1073
1068
  ]
1074
1069
  }
1075
1070
  ),
1076
- F && !L && /* @__PURE__ */ a(
1077
- S,
1071
+ K && !q && /* @__PURE__ */ a(
1072
+ T,
1078
1073
  {
1079
1074
  variant: "outline",
1080
1075
  size: "sm",
1081
1076
  "data-run-revert-open": !0,
1082
- onClick: () => q(!0),
1077
+ onClick: () => E(!0),
1083
1078
  children: [
1084
1079
  /* @__PURE__ */ e(ee, { className: "h-3.5 w-3.5" }),
1085
1080
  " Revert…"
1086
1081
  ]
1087
1082
  }
1088
1083
  ),
1089
- r.status !== "completed" && /* @__PURE__ */ a(S, { variant: "ghost", size: "sm", onClick: () => p(r.id), children: [
1084
+ r.status !== "completed" && /* @__PURE__ */ a(T, { variant: "ghost", size: "sm", onClick: () => p(r.id), children: [
1090
1085
  /* @__PURE__ */ e(we, { className: "h-3.5 w-3.5" }),
1091
1086
  " Cancel"
1092
1087
  ] })
@@ -1102,14 +1097,14 @@ function Nt({
1102
1097
  }
1103
1098
  const Xe = 40, Ye = 120, Ze = "rounded border border-slate-200 bg-slate-50 px-1.5 py-0.5 font-mono text-[11px] text-slate-700 dark:border-border dark:bg-muted/40 dark:text-foreground";
1104
1099
  function et({ text: t }) {
1105
- const [n, o] = N(!1);
1100
+ const [n, o] = k(!1);
1106
1101
  return /* @__PURE__ */ a(
1107
- P,
1102
+ D,
1108
1103
  {
1109
1104
  "data-run-log-copy": !0,
1110
1105
  onClick: () => {
1111
- var l;
1112
- (l = navigator.clipboard) == null || l.writeText(t).then(() => {
1106
+ var d;
1107
+ (d = navigator.clipboard) == null || d.writeText(t).then(() => {
1113
1108
  o(!0), setTimeout(() => o(!1), 1600);
1114
1109
  });
1115
1110
  },
@@ -1173,7 +1168,7 @@ function tt({ line: t }) {
1173
1168
  }
1174
1169
  const at = (t) => t && t.charAt(0).toUpperCase() + t.slice(1);
1175
1170
  function rt({ error: t }) {
1176
- const [n, o] = N(!1), l = n ? t.values : t.values.slice(0, Xe), i = t.values.reduce((c, p) => c + p.count, 0);
1171
+ const [n, o] = k(!1), d = n ? t.values : t.values.slice(0, Xe), i = t.values.reduce((c, p) => c + p.count, 0);
1177
1172
  return /* @__PURE__ */ a(
1178
1173
  "div",
1179
1174
  {
@@ -1200,7 +1195,7 @@ function rt({ error: t }) {
1200
1195
  children: "The database gave no reason."
1201
1196
  }
1202
1197
  ) : null,
1203
- t.values.length > 0 && /* @__PURE__ */ a(R, { children: [
1198
+ t.values.length > 0 && /* @__PURE__ */ a(S, { children: [
1204
1199
  /* @__PURE__ */ a(
1205
1200
  "p",
1206
1201
  {
@@ -1221,7 +1216,7 @@ function rt({ error: t }) {
1221
1216
  }
1222
1217
  ),
1223
1218
  /* @__PURE__ */ a("ul", { "data-run-log-values": !0, className: "mt-1.5 flex flex-wrap gap-1", children: [
1224
- l.map((c) => /* @__PURE__ */ a(
1219
+ d.map((c) => /* @__PURE__ */ a(
1225
1220
  "li",
1226
1221
  {
1227
1222
  className: "rounded border border-[#fecaca] bg-[#ffffff] px-1.5 py-0.5 font-mono text-[11px] text-[#7f1d1d] dark:border-[#7f1d1d] dark:bg-[#1f0d10] dark:text-[#fee2e2]",
@@ -1235,18 +1230,18 @@ function rt({ error: t }) {
1235
1230
  },
1236
1231
  c.value
1237
1232
  )),
1238
- t.values.length > l.length && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ a(
1233
+ t.values.length > d.length && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ a(
1239
1234
  "button",
1240
1235
  {
1241
1236
  type: "button",
1242
1237
  onClick: () => o(!0),
1243
1238
  className: b(
1244
1239
  "rounded px-1 py-0.5 text-[11px] font-medium text-[#7f1d1d] underline decoration-dotted underline-offset-2 dark:text-[#fee2e2]",
1245
- v
1240
+ w
1246
1241
  ),
1247
1242
  children: [
1248
1243
  "Show ",
1249
- h(t.values.length - l.length),
1244
+ h(t.values.length - d.length),
1250
1245
  " more"
1251
1246
  ]
1252
1247
  }
@@ -1262,8 +1257,8 @@ function rt({ error: t }) {
1262
1257
  }
1263
1258
  );
1264
1259
  }
1265
- function de({ run: t }) {
1266
- const [n, o] = N(!1), l = pe(
1260
+ function le({ run: t }) {
1261
+ const [n, o] = k(!1), d = pe(
1267
1262
  () => Le(t.logs, t.status === "error"),
1268
1263
  [t.logs, t.status]
1269
1264
  );
@@ -1280,14 +1275,14 @@ function de({ run: t }) {
1280
1275
  ),
1281
1276
  children: t.logs
1282
1277
  }
1283
- ) : l.error ? /* @__PURE__ */ e(rt, { error: l.error }) : /* @__PURE__ */ a("div", { className: "overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
1278
+ ) : d.error ? /* @__PURE__ */ e(rt, { error: d.error }) : /* @__PURE__ */ a("div", { className: "overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
1284
1279
  /* @__PURE__ */ a(
1285
1280
  "div",
1286
1281
  {
1287
1282
  "data-run-log-headline": !0,
1288
1283
  className: "flex flex-wrap items-baseline gap-x-4 gap-y-1 bg-slate-50 px-3 py-2 dark:bg-muted/30",
1289
1284
  children: [
1290
- l.headline.map((c, p) => /* @__PURE__ */ a(
1285
+ d.headline.map((c, p) => /* @__PURE__ */ a(
1291
1286
  "p",
1292
1287
  {
1293
1288
  className: "text-[12px] leading-snug text-slate-700 dark:text-foreground",
@@ -1307,29 +1302,29 @@ function de({ run: t }) {
1307
1302
  },
1308
1303
  `${c.label ?? c.text ?? ""}-${p}`
1309
1304
  )),
1310
- l.time && /* @__PURE__ */ e(
1305
+ d.time && /* @__PURE__ */ e(
1311
1306
  "span",
1312
1307
  {
1313
1308
  "data-run-log-time": !0,
1314
1309
  className: "ml-auto font-mono text-[11.5px] tabular-nums text-slate-700 dark:text-foreground",
1315
- children: l.time
1310
+ children: d.time
1316
1311
  }
1317
1312
  )
1318
1313
  ]
1319
1314
  }
1320
1315
  ),
1321
- l.lines.length > 0 && /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 border-t border-slate-200 dark:divide-border/60 dark:border-border", children: l.lines.map((c, p) => (
1316
+ d.lines.length > 0 && /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 border-t border-slate-200 dark:divide-border/60 dark:border-border", children: d.lines.map((c, p) => (
1322
1317
  // biome-ignore lint/suspicious/noArrayIndexKey: two lines may read the same and the log never reorders
1323
1318
  /* @__PURE__ */ e(tt, { line: c }, `${c.label}-${p}`)
1324
1319
  )) })
1325
1320
  ] }),
1326
1321
  /* @__PURE__ */ a("div", { className: "mt-1.5 flex items-center gap-1", children: [
1327
1322
  /* @__PURE__ */ e(et, { text: t.logs }),
1328
- /* @__PURE__ */ e(P, { "data-run-log-plain": !0, onClick: () => o((c) => !c), children: n ? "Show as a list" : "Show as written" })
1323
+ /* @__PURE__ */ e(D, { "data-run-log-plain": !0, onClick: () => o((c) => !c), children: n ? "Show as a list" : "Show as written" })
1329
1324
  ] })
1330
1325
  ] });
1331
1326
  }
1332
1327
  export {
1333
- Nt as RunDetailSheet,
1328
+ vt as RunDetailSheet,
1334
1329
  ke as useDownload
1335
1330
  };