@nivaro/react 0.3.117 → 0.3.118

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 (137) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/file-live.js +69 -54
  73. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  74. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  75. package/dist/shared/components/item-edit/removed-line.js +31 -25
  76. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  77. package/dist/shared/components/list/ListViewers.js +46 -35
  78. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  79. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  80. package/dist/shared/components/panels/AlertBanners.js +82 -72
  81. package/dist/shared/components/panels/BranchLanes.js +22 -22
  82. package/dist/shared/components/panels/CommentImages.js +123 -102
  83. package/dist/shared/components/panels/CommentPanel.js +186 -185
  84. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  85. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  86. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  87. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  88. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  89. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  90. package/dist/shared/components/profile/AgentNameField.js +107 -81
  91. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  92. package/dist/shared/components/profile/PersonAccess.js +599 -495
  93. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  94. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  95. package/dist/shared/components/profile/primitives.js +1 -1
  96. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  97. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  98. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  99. package/dist/shared/components/support/AssignRules.js +1733 -0
  100. package/dist/shared/components/support/PersonPick.js +88 -0
  101. package/dist/shared/components/support/RequestList.js +790 -0
  102. package/dist/shared/components/support/ScreenShare.js +158 -152
  103. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  104. package/dist/shared/components/support/SupportView.js +140 -246
  105. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  106. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  107. package/dist/shared/components/support/assign-rules-text.js +171 -0
  108. package/dist/shared/components/support/support-list.js +125 -0
  109. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  110. package/dist/shared/components/ui/checkbox.js +6 -6
  111. package/dist/shared/components/ui/select.js +43 -39
  112. package/dist/shared/components/ui/sheet.js +9 -9
  113. package/dist/shared/components/ui/switch.js +12 -11
  114. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  115. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  116. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  117. package/dist/shared/lib/activity-sentence.js +103 -91
  118. package/dist/shared/lib/agent-presence.js +27 -21
  119. package/dist/shared/lib/approval-progress.js +2 -2
  120. package/dist/shared/lib/copy-rules.js +31 -24
  121. package/dist/shared/lib/derived-causes.js +113 -78
  122. package/dist/shared/lib/grid-cursors.js +26 -26
  123. package/dist/shared/lib/label-flash.js +27 -0
  124. package/dist/shared/lib/list-return.js +137 -125
  125. package/dist/shared/lib/live-deltas.js +40 -34
  126. package/dist/shared/lib/live-groups.js +56 -52
  127. package/dist/shared/lib/live-preference.js +64 -59
  128. package/dist/shared/lib/live-screen.js +223 -192
  129. package/dist/shared/lib/partner-failure.js +11 -11
  130. package/dist/shared/lib/rollup-recalc.js +68 -64
  131. package/dist/shared/lib/screen-refresh.js +74 -68
  132. package/dist/shared/lib/screen-share.js +108 -104
  133. package/dist/shared/lib/send-status.js +77 -61
  134. package/dist/shared/lib/text-diff-window.js +29 -0
  135. package/dist/shared/lib/watch-list.js +210 -209
  136. package/dist/shared/lib/widget-image-render.js +72 -49
  137. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
- import { jsxs as a, jsx as o, Fragment as A } from "react/jsx-runtime";
2
- import { AlertOctagon as O, AlertTriangle as W, ChevronRight as E, Loader2 as M, ChevronDown as G, ExternalLink as V } from "lucide-react";
3
- import { useState as L, useMemo as X, useId as q, useRef as H } from "react";
4
- import { useItemEditAuth as J } from "../../../context.js";
1
+ import { jsxs as a, jsx as r, Fragment as T } from "react/jsx-runtime";
2
+ import { BellOff as F, AlertOctagon as W, AlertTriangle as q, ChevronRight as E, Loader2 as M, ChevronDown as G, ExternalLink as V } from "lucide-react";
3
+ import { useState as A, useMemo as X, useId as H, useRef as J } from "react";
4
+ import { useItemEditAuth as Q } from "../../../context.js";
5
5
  import { userErrorMessage as I } from "../../../lib/safe-error.js";
6
- import { cn as x, titleCase as Q } from "../../../lib/utils.js";
7
- import { ExplainButton as Y } from "../../ai/ExplainButton.js";
8
- import { useDrillWindows as Z, DrillTag as ee } from "../../chaos/DrillTag.js";
9
- import { useSignalAction as te, useDismissRows as ne, useSnooze as re } from "./api.js";
10
- import { canDrill as oe, RowDrill as ie } from "./drill/index.js";
11
- import { SnoozeMenu as U, DismissButton as se } from "./SnoozeMenu.js";
12
- import { plainDetail as K, TONE_FILL as ae, TONE_TEXT as T, agoText as le, exactTime as j, TONE_SOFT as de, ageOf as ce } from "./tone.js";
13
- const ue = ["retry_submission", "extension"], me = (t) => t.kind === "extension" ? F(t) : t.kind, F = (t) => `${t.kind}:${t.id ?? ""}`;
14
- function pe(t) {
15
- let e = null;
16
- for (const m of t.rows) (!e || m.first_seen < e) && (e = m.first_seen);
17
- return e;
6
+ import { cn as x, titleCase as Y } from "../../../lib/utils.js";
7
+ import { ExplainButton as Z } from "../../ai/ExplainButton.js";
8
+ import { useDrillWindows as ee, DrillTag as te } from "../../chaos/DrillTag.js";
9
+ import { useSignalAction as ne, useDismissRows as oe, useSnooze as re } from "./api.js";
10
+ import { canDrill as ie, RowDrill as se } from "./drill/index.js";
11
+ import { SnoozeMenu as R, DismissButton as ae } from "./SnoozeMenu.js";
12
+ import { plainDetail as B, TONE_FILL as le, TONE_TEXT as L, agoText as de, exactTime as U, TONE_SOFT as ce, ageOf as ue } from "./tone.js";
13
+ const me = ["retry_submission", "extension"], pe = (e) => e.kind === "extension" ? j(e) : e.kind, j = (e) => `${e.kind}:${e.id ?? ""}`;
14
+ function he(e) {
15
+ let t = null;
16
+ for (const m of e.rows) (!t || m.first_seen < t) && (t = m.first_seen);
17
+ return t;
18
18
  }
19
- function De({
20
- signal: t,
21
- expanded: e,
19
+ function Te({
20
+ signal: e,
21
+ expanded: t,
22
22
  onToggle: m,
23
23
  onOpenRecord: g,
24
24
  onExplain: p,
25
25
  canExplain: l
26
26
  }) {
27
- const f = t.severity === "critical", v = f ? "negative" : "warning", S = f ? O : W, y = pe(t), z = Z(), $ = t.rows.reduce(
28
- (N, D) => !N || D.first_seen > N ? D.first_seen : N,
27
+ const f = e.severity === "critical", y = !e.error && e.count === 0, k = y ? "neutral" : f ? "negative" : "warning", w = y ? F : f ? W : q, v = he(e), C = ee(), S = e.rows.reduce(
28
+ (N, o) => !N || o.first_seen > N ? o.first_seen : N,
29
29
  null
30
- ), k = t.rows[0], [b, C] = L(!1), _ = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
30
+ ), b = e.rows[0], [z, _] = A(!1), D = `ic-signal-body-${e.id.replace(/[^a-z0-9]/gi, "-")}`;
31
31
  return /* @__PURE__ */ a(
32
32
  "section",
33
33
  {
34
- "data-ic-signal": t.id,
35
- "data-ic-severity": t.severity,
34
+ "data-ic-signal": e.id,
35
+ "data-ic-severity": e.severity,
36
36
  className: "overflow-hidden rounded-lg border border-border bg-card",
37
37
  children: [
38
38
  /* @__PURE__ */ a(
@@ -40,48 +40,55 @@ function De({
40
40
  {
41
41
  type: "button",
42
42
  onClick: m,
43
- "aria-expanded": e,
44
- "aria-controls": _,
43
+ "aria-expanded": t,
44
+ "aria-controls": D,
45
45
  className: "flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
46
46
  children: [
47
- /* @__PURE__ */ o(
47
+ /* @__PURE__ */ r(
48
48
  "span",
49
49
  {
50
50
  className: x(
51
51
  "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md",
52
- de[v]
52
+ ce[k]
53
53
  ),
54
- "data-tip": f ? "Critical — something is failing now" : "Worth a look",
55
- children: /* @__PURE__ */ o(S, { className: x("h-3.5 w-3.5", T[v]), "aria-hidden": !0 })
54
+ "data-tip": y ? "Nothing open — only snoozed rows" : f ? "Critical — something is failing now" : "Worth a look",
55
+ children: /* @__PURE__ */ r(w, { className: x("h-3.5 w-3.5", L[k]), "aria-hidden": !0 })
56
56
  }
57
57
  ),
58
58
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
59
59
  /* @__PURE__ */ a("span", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
60
- /* @__PURE__ */ o("span", { className: "text-[13.5px] font-semibold text-foreground", children: t.label }),
61
- $ && /* @__PURE__ */ o(ee, { windows: z, at: $, className: "self-center" }),
62
- t.error ? /* @__PURE__ */ o("span", { className: x("text-[12px] font-medium", T.negative), children: "Couldn't evaluate" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
63
- /* @__PURE__ */ o("span", { className: x("font-semibold", T[v]), children: t.count }),
64
- " open",
65
- y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${j(y)}`, children: [
60
+ /* @__PURE__ */ r("span", { className: "text-[13.5px] font-semibold text-foreground", children: e.label }),
61
+ S && /* @__PURE__ */ r(te, { windows: C, at: S, className: "self-center" }),
62
+ e.error ? /* @__PURE__ */ r("span", { className: x("text-[12px] font-medium", L.negative), children: "Couldn't evaluate" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
63
+ y && e.snoozed.length > 0 ? /* @__PURE__ */ a(T, { children: [
64
+ /* @__PURE__ */ r("span", { className: "font-semibold text-foreground", children: e.snoozed.length }),
65
+ " ",
66
+ "snoozed · none open"
67
+ ] }) : /* @__PURE__ */ a(T, { children: [
68
+ /* @__PURE__ */ r("span", { className: x("font-semibold", L[k]), children: e.count }),
69
+ " ",
70
+ "open"
71
+ ] }),
72
+ v && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${U(v)}`, children: [
66
73
  " ",
67
74
  "· oldest ",
68
- ce(y)
75
+ ue(v)
69
76
  ] }),
70
- t.snoozed.length > 0 && /* @__PURE__ */ a(A, { children: [
77
+ !y && e.snoozed.length > 0 && /* @__PURE__ */ a(T, { children: [
71
78
  " · ",
72
- t.snoozed.length,
79
+ e.snoozed.length,
73
80
  " snoozed"
74
81
  ] })
75
82
  ] })
76
83
  ] }),
77
- /* @__PURE__ */ o("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${K(k.detail)}` : ""}` : t.description })
84
+ /* @__PURE__ */ r("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: e.error ? e.error : b ? `${b.title}${b.detail ? ` — ${B(b.detail)}` : ""}` : e.description })
78
85
  ] }),
79
- /* @__PURE__ */ o(
86
+ /* @__PURE__ */ r(
80
87
  E,
81
88
  {
82
89
  className: x(
83
90
  "mt-1 h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200",
84
- e && "rotate-90"
91
+ t && "rotate-90"
85
92
  ),
86
93
  "aria-hidden": !0
87
94
  }
@@ -89,155 +96,155 @@ function De({
89
96
  ]
90
97
  }
91
98
  ),
92
- e && /* @__PURE__ */ a("div", { id: _, className: "border-t border-border", children: [
93
- t.error ? /* @__PURE__ */ a("p", { className: x("px-4 py-3 text-[12.5px]", T.negative), children: [
99
+ t && /* @__PURE__ */ a("div", { id: D, className: "border-t border-border", children: [
100
+ e.error ? /* @__PURE__ */ a("p", { className: x("px-4 py-3 text-[12.5px]", L.negative), children: [
94
101
  "Couldn't evaluate · ",
95
- t.error
96
- ] }) : /* @__PURE__ */ a(A, { children: [
97
- /* @__PURE__ */ o("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
98
- /* @__PURE__ */ o(
99
- he,
102
+ e.error
103
+ ] }) : /* @__PURE__ */ a(T, { children: [
104
+ /* @__PURE__ */ r("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: e.description }),
105
+ /* @__PURE__ */ r(
106
+ fe,
100
107
  {
101
- signal: t,
102
- rows: t.rows,
108
+ signal: e,
109
+ rows: e.rows,
103
110
  onOpenRecord: g,
104
111
  onExplain: p,
105
112
  canExplain: l
106
113
  }
107
114
  ),
108
- t.count > t.shown && /* @__PURE__ */ a("p", { className: "px-4 pb-3 text-[12px] text-muted-foreground", children: [
115
+ e.count > e.shown && /* @__PURE__ */ a("p", { className: "px-4 pb-3 text-[12px] text-muted-foreground", children: [
109
116
  "Showing ",
110
- t.shown,
117
+ e.shown,
111
118
  " of ",
112
- t.count,
119
+ e.count,
113
120
  ". The rest appear as these are cleared."
114
121
  ] })
115
122
  ] }),
116
- t.snoozed.length > 0 && /* @__PURE__ */ a("div", { className: "border-t border-border", children: [
123
+ e.snoozed.length > 0 && /* @__PURE__ */ a("div", { className: "border-t border-border", children: [
117
124
  /* @__PURE__ */ a(
118
125
  "button",
119
126
  {
120
127
  type: "button",
121
- onClick: () => C((N) => !N),
122
- "aria-expanded": b,
123
- "data-ic-snoozed-fold": t.snoozed.length,
128
+ onClick: () => _((N) => !N),
129
+ "aria-expanded": z,
130
+ "data-ic-snoozed-fold": e.snoozed.length,
124
131
  className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12px] font-medium text-muted-foreground hover:text-foreground",
125
132
  children: [
126
- /* @__PURE__ */ o(
133
+ /* @__PURE__ */ r(
127
134
  E,
128
135
  {
129
- className: x("h-3.5 w-3.5 transition-transform", b && "rotate-90")
136
+ className: x("h-3.5 w-3.5 transition-transform", z && "rotate-90")
130
137
  }
131
138
  ),
132
139
  "Snoozed (",
133
- t.snoozed.length,
140
+ e.snoozed.length,
134
141
  ")"
135
142
  ]
136
143
  }
137
144
  ),
138
- b && /* @__PURE__ */ o(be, { signal: t })
145
+ z && /* @__PURE__ */ r(ge, { signal: e })
139
146
  ] })
140
147
  ] })
141
148
  ]
142
149
  }
143
150
  );
144
151
  }
145
- function he({
146
- signal: t,
147
- rows: e,
152
+ function fe({
153
+ signal: e,
154
+ rows: t,
148
155
  onOpenRecord: m,
149
156
  onExplain: g,
150
157
  canExplain: p
151
158
  }) {
152
- const l = te(), f = ne(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = X(() => {
153
- if (!e.some((s) => s.group)) return null;
154
- const r = /* @__PURE__ */ new Map();
155
- for (const s of e) {
156
- const i = s.group ?? "—", d = r.get(i) ?? { key: i, label: s.group_label ?? s.group ?? "Other", rows: [] };
157
- d.rows.push(s), r.set(i, d);
159
+ const l = ne(), f = oe(), [y, k] = A({}), [w, v] = A(/* @__PURE__ */ new Set()), [C, S] = A(/* @__PURE__ */ new Set()), b = X(() => {
160
+ if (!t.some((s) => s.group)) return null;
161
+ const o = /* @__PURE__ */ new Map();
162
+ for (const s of t) {
163
+ const i = s.group ?? "—", d = o.get(i) ?? { key: i, label: s.group_label ?? s.group ?? "Other", rows: [] };
164
+ d.rows.push(s), o.set(i, d);
158
165
  }
159
- return [...r.values()].sort((s, i) => i.rows.length - s.rows.length);
160
- }, [e]), C = async (r, s) => {
166
+ return [...o.values()].sort((s, i) => i.rows.length - s.rows.length);
167
+ }, [t]), z = async (o, s) => {
161
168
  var d;
162
169
  const i = s.map((c) => c.key);
163
- z((c) => /* @__PURE__ */ new Set([...c, ...i]));
170
+ v((c) => /* @__PURE__ */ new Set([...c, ...i]));
164
171
  try {
165
- const c = await l.mutateAsync({ signal: t.id, row_keys: i, action: r });
166
- S((n) => {
172
+ const c = await l.mutateAsync({ signal: e.id, row_keys: i, action: o });
173
+ k((n) => {
167
174
  const u = { ...n };
168
175
  for (const h of c) u[h.key] = h;
169
176
  return u;
170
- }), k((n) => new Set([...n].filter((u) => !i.includes(u))));
177
+ }), S((n) => new Set([...n].filter((u) => !i.includes(u))));
171
178
  } catch (c) {
172
179
  const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? I(c, "The action failed");
173
- S((u) => {
180
+ k((u) => {
174
181
  const h = { ...u };
175
- for (const w of i) h[w] = { key: w, ok: !1, message: n };
182
+ for (const $ of i) h[$] = { key: $, ok: !1, message: n };
176
183
  return h;
177
184
  });
178
185
  } finally {
179
- z((c) => new Set([...c].filter((n) => !i.includes(n))));
186
+ v((c) => new Set([...c].filter((n) => !i.includes(n))));
180
187
  }
181
- }, _ = async (r) => {
188
+ }, _ = async (o) => {
182
189
  var i;
183
- const s = r.map((d) => d.key);
184
- z((d) => /* @__PURE__ */ new Set([...d, ...s]));
190
+ const s = o.map((d) => d.key);
191
+ v((d) => /* @__PURE__ */ new Set([...d, ...s]));
185
192
  try {
186
- await f.mutateAsync({ signal: t.id, row_keys: s }), k((d) => new Set([...d].filter((c) => !s.includes(c))));
193
+ await f.mutateAsync({ signal: e.id, row_keys: s }), S((d) => new Set([...d].filter((c) => !s.includes(c))));
187
194
  } catch (d) {
188
195
  const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? I(d, "Could not dismiss");
189
- S((n) => {
196
+ k((n) => {
190
197
  const u = { ...n };
191
198
  for (const h of s) u[h] = { key: h, ok: !1, message: c };
192
199
  return u;
193
200
  });
194
201
  } finally {
195
- z((d) => new Set([...d].filter((c) => !s.includes(c))));
202
+ v((d) => new Set([...d].filter((c) => !s.includes(c))));
196
203
  }
197
- }, N = (r, s) => {
204
+ }, D = (o, s) => {
198
205
  var i, d, c, n;
199
- if (r.kind === "open") {
200
- const u = ((i = r.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), h = ((c = r.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
206
+ if (o.kind === "open") {
207
+ const u = ((i = o.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), h = ((c = o.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
201
208
  u && h && (m == null || m(u, String(h)));
202
209
  return;
203
210
  }
204
- if (r.kind === "explain") {
205
- g == null || g(r, s);
211
+ if (o.kind === "explain") {
212
+ g == null || g(o, s);
206
213
  return;
207
214
  }
208
- C(r, [s]);
209
- }, D = (r, s) => /* @__PURE__ */ o(
210
- fe,
215
+ z(o, [s]);
216
+ }, N = (o, s) => /* @__PURE__ */ r(
217
+ be,
211
218
  {
212
- signal: t,
213
- row: r,
214
- result: v[r.key],
215
- busy: y.has(r.key),
219
+ signal: e,
220
+ row: o,
221
+ result: y[o.key],
222
+ busy: w.has(o.key),
216
223
  selectable: s,
217
- selected: $.has(r.key),
218
- onSelect: (i) => k((d) => {
224
+ selected: C.has(o.key),
225
+ onSelect: (i) => S((d) => {
219
226
  const c = new Set(d);
220
- return i ? c.add(r.key) : c.delete(r.key), c;
227
+ return i ? c.add(o.key) : c.delete(o.key), c;
221
228
  }),
222
- onAction: (i) => N(i, r),
229
+ onAction: (i) => D(i, o),
223
230
  onOpenRecord: m,
224
231
  canExplain: p
225
232
  },
226
- r.key
233
+ o.key
227
234
  );
228
235
  if (!b) {
229
- const r = e.length > 0 && e.every((i) => $.has(i.key)), s = e.filter((i) => $.has(i.key));
236
+ const o = t.length > 0 && t.every((i) => C.has(i.key)), s = t.filter((i) => C.has(i.key));
230
237
  return /* @__PURE__ */ a("div", { children: [
231
- e.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
232
- /* @__PURE__ */ o(
238
+ t.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
239
+ /* @__PURE__ */ r(
233
240
  "input",
234
241
  {
235
242
  type: "checkbox",
236
- checked: r,
243
+ checked: o,
237
244
  ref: (i) => {
238
- i && (i.indeterminate = s.length > 0 && !r);
245
+ i && (i.indeterminate = s.length > 0 && !o);
239
246
  },
240
- onChange: (i) => k(new Set(i.target.checked ? e.map((d) => d.key) : [])),
247
+ onChange: (i) => S(new Set(i.target.checked ? t.map((d) => d.key) : [])),
241
248
  "aria-label": "Select every problem",
242
249
  "data-ic-select-all": !0,
243
250
  className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
@@ -248,37 +255,37 @@ function he({
248
255
  {
249
256
  type: "button",
250
257
  "data-ic-bulk-action": "dismiss",
251
- disabled: s.some((i) => y.has(i.key)),
258
+ disabled: s.some((i) => w.has(i.key)),
252
259
  onClick: () => void _(s),
253
260
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
254
261
  children: [
255
- s.some((i) => y.has(i.key)) && /* @__PURE__ */ o(M, { className: "h-3 w-3 animate-spin" }),
262
+ s.some((i) => w.has(i.key)) && /* @__PURE__ */ r(M, { className: "h-3 w-3 animate-spin" }),
256
263
  "Dismiss selected ",
257
264
  s.length
258
265
  ]
259
266
  }
260
- ) : /* @__PURE__ */ o("span", { className: "text-[12px] text-muted-foreground", children: "Select problems to dismiss several at once" })
267
+ ) : /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: "Select problems to dismiss several at once" })
261
268
  ] }),
262
- /* @__PURE__ */ o("ul", { className: "divide-y divide-border", children: e.map((i) => D(i, !0)) })
269
+ /* @__PURE__ */ r("ul", { className: "divide-y divide-border", children: t.map((i) => N(i, !0)) })
263
270
  ] });
264
271
  }
265
- return /* @__PURE__ */ o("div", { className: "pb-1", children: b.map((r) => {
266
- const s = r.rows.filter((n) => $.has(n.key)), i = r.rows.length > 0 && s.length === r.rows.length, d = /* @__PURE__ */ new Map();
272
+ return /* @__PURE__ */ r("div", { className: "pb-1", children: b.map((o) => {
273
+ const s = o.rows.filter((n) => C.has(n.key)), i = o.rows.length > 0 && s.length === o.rows.length, d = /* @__PURE__ */ new Map();
267
274
  for (const n of s) {
268
275
  const u = /* @__PURE__ */ new Set();
269
276
  for (const h of n.actions) {
270
- if (!ue.includes(h.kind)) continue;
271
- const w = me(h);
272
- if (u.has(w)) continue;
273
- u.add(w);
274
- const B = d.get(w) ?? { action: h, rows: [] };
275
- B.rows.push(n), d.set(w, B);
277
+ if (!me.includes(h.kind)) continue;
278
+ const $ = pe(h);
279
+ if (u.has($)) continue;
280
+ u.add($);
281
+ const K = d.get($) ?? { action: h, rows: [] };
282
+ K.rows.push(n), d.set($, K);
276
283
  }
277
284
  }
278
- const c = s.some((n) => y.has(n.key));
279
- return /* @__PURE__ */ a("div", { "data-ic-group": r.key, className: "mt-2 first:mt-1", children: [
285
+ const c = s.some((n) => w.has(n.key));
286
+ return /* @__PURE__ */ a("div", { "data-ic-group": o.key, className: "mt-2 first:mt-1", children: [
280
287
  /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
281
- /* @__PURE__ */ o(
288
+ /* @__PURE__ */ r(
282
289
  "input",
283
290
  {
284
291
  type: "checkbox",
@@ -286,19 +293,19 @@ function he({
286
293
  ref: (n) => {
287
294
  n && (n.indeterminate = s.length > 0 && !i);
288
295
  },
289
- onChange: (n) => k((u) => {
296
+ onChange: (n) => S((u) => {
290
297
  const h = new Set(u);
291
- for (const w of r.rows)
292
- n.target.checked ? h.add(w.key) : h.delete(w.key);
298
+ for (const $ of o.rows)
299
+ n.target.checked ? h.add($.key) : h.delete($.key);
293
300
  return h;
294
301
  }),
295
- "aria-label": `Select every problem in ${r.label}`,
296
- "data-ic-group-select": r.key,
302
+ "aria-label": `Select every problem in ${o.label}`,
303
+ "data-ic-group-select": o.key,
297
304
  className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
298
305
  }
299
306
  ),
300
- /* @__PURE__ */ o("span", { className: "text-[12.5px] font-semibold text-foreground", children: r.label }),
301
- /* @__PURE__ */ o("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: r.rows.length }),
307
+ /* @__PURE__ */ r("span", { className: "text-[12.5px] font-semibold text-foreground", children: o.label }),
308
+ /* @__PURE__ */ r("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: o.rows.length }),
302
309
  /* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1", children: [
303
310
  [...d.entries()].map(([n, u]) => /* @__PURE__ */ a(
304
311
  "button",
@@ -306,7 +313,7 @@ function he({
306
313
  type: "button",
307
314
  "data-ic-bulk-action": u.action.kind,
308
315
  onClick: () => {
309
- C(u.action, u.rows);
316
+ z(u.action, u.rows);
310
317
  },
311
318
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted",
312
319
  children: [
@@ -326,94 +333,94 @@ function he({
326
333
  onClick: () => void _(s),
327
334
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
328
335
  children: [
329
- c && /* @__PURE__ */ o(M, { className: "h-3 w-3 animate-spin" }),
336
+ c && /* @__PURE__ */ r(M, { className: "h-3 w-3 animate-spin" }),
330
337
  "Dismiss selected ",
331
338
  s.length
332
339
  ]
333
340
  }
334
341
  ),
335
- /* @__PURE__ */ o(
336
- U,
342
+ /* @__PURE__ */ r(
343
+ R,
337
344
  {
338
- signal: t.id,
339
- signalLabel: t.label,
340
- group: { key: r.key, label: r.label },
345
+ signal: e.id,
346
+ signalLabel: e.label,
347
+ group: { key: o.key, label: o.label },
341
348
  defaultScope: "group"
342
349
  }
343
350
  )
344
351
  ] })
345
352
  ] }),
346
- /* @__PURE__ */ o(
353
+ /* @__PURE__ */ r(
347
354
  "ul",
348
355
  {
349
- "data-ic-group-rows": r.key,
356
+ "data-ic-group-rows": o.key,
350
357
  className: "ml-[23px] divide-y divide-border border-l border-border",
351
- children: r.rows.map((n) => D(n, !0))
358
+ children: o.rows.map((n) => N(n, !0))
352
359
  }
353
360
  )
354
- ] }, r.key);
361
+ ] }, o.key);
355
362
  }) });
356
363
  }
357
- function P(t) {
358
- return t.label ? t.label : `${Q(t.collection).replace(/s$/, "")} ${t.id}`;
364
+ function P(e) {
365
+ return e.label ? e.label : `${Y(e.collection).replace(/s$/, "")} ${e.id}`;
359
366
  }
360
- function fe({
361
- signal: t,
362
- row: e,
367
+ function be({
368
+ signal: e,
369
+ row: t,
363
370
  result: m,
364
371
  busy: g,
365
372
  selectable: p,
366
373
  selected: l,
367
374
  onSelect: f,
368
- onAction: v,
369
- onOpenRecord: S,
370
- canExplain: y
375
+ onAction: y,
376
+ onOpenRecord: k,
377
+ canExplain: w
371
378
  }) {
372
379
  var i, d, c;
373
- const z = e.since ?? e.first_seen, $ = e.actions.filter(
374
- (n) => !(n.kind === "open" && e.record) && !(n.kind === "explain" && (y == null ? void 0 : y(n)) === !1)
375
- ), { isAdmin: k } = J(), [b, C] = L(!1), _ = q(), N = H(null), D = oe(e.drill), r = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
380
+ const v = t.since ?? t.first_seen, C = t.actions.filter(
381
+ (n) => !(n.kind === "open" && t.record) && !(n.kind === "explain" && (w == null ? void 0 : w(n)) === !1)
382
+ ), { isAdmin: S } = Q(), [b, z] = A(!1), _ = H(), D = J(null), N = ie(t.drill), o = ((i = t.drill) == null ? void 0 : i.kind) === "submission" ? t.actions.find((n) => {
376
383
  var u;
377
- return n.kind === "retry_submission" && n.id === ((u = e.drill) == null ? void 0 : u.id);
384
+ return n.kind === "retry_submission" && n.id === ((u = t.drill) == null ? void 0 : u.id);
378
385
  }) : void 0, s = () => {
379
386
  var n;
380
- C(!1), (n = N.current) == null || n.focus();
387
+ z(!1), (n = D.current) == null || n.focus();
381
388
  };
382
389
  return /* @__PURE__ */ a(
383
390
  "li",
384
391
  {
385
- "data-ic-row": e.key,
392
+ "data-ic-row": t.key,
386
393
  "data-ic-row-open": b ? "" : void 0,
387
394
  className: x(b && "bg-muted/30"),
388
395
  children: [
389
396
  /* @__PURE__ */ a("div", { className: "flex gap-3 px-4 py-2.5", children: [
390
- p && /* @__PURE__ */ o(
397
+ p && /* @__PURE__ */ r(
391
398
  "input",
392
399
  {
393
400
  type: "checkbox",
394
401
  checked: l,
395
402
  onChange: (n) => f(n.target.checked),
396
- "aria-label": `Select ${e.title}`,
397
- "data-ic-select-row": e.key,
403
+ "aria-label": `Select ${t.title}`,
404
+ "data-ic-select-row": t.key,
398
405
  className: "mt-1 h-3.5 w-3.5 shrink-0 accent-[rgb(var(--nvr-cyan-rgb))]"
399
406
  }
400
407
  ),
401
408
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
402
- /* @__PURE__ */ o("p", { className: "text-[12.5px] font-medium text-foreground", children: e.title }),
403
- e.detail && /* @__PURE__ */ o(
409
+ /* @__PURE__ */ r("p", { className: "text-[12.5px] font-medium text-foreground", children: t.title }),
410
+ t.detail && /* @__PURE__ */ r(
404
411
  "p",
405
412
  {
406
413
  className: "mt-0.5 line-clamp-2 break-words text-[12px] leading-snug text-muted-foreground",
407
- "data-tip": e.detail.length > 140 || K(e.detail) !== e.detail.trim() ? e.detail.slice(0, 900) : void 0,
408
- children: K(e.detail)
414
+ "data-tip": t.detail.length > 140 || B(t.detail) !== t.detail.trim() ? t.detail.slice(0, 900) : void 0,
415
+ children: B(t.detail)
409
416
  }
410
417
  ),
411
- /* @__PURE__ */ o(
412
- R,
418
+ /* @__PURE__ */ r(
419
+ O,
413
420
  {
414
- since: z,
415
- record: e.record,
416
- onOpenRecord: S,
421
+ since: v,
422
+ record: t.record,
423
+ onOpenRecord: k,
417
424
  className: "mt-1 flex-wrap gap-x-2 xl:hidden"
418
425
  }
419
426
  ),
@@ -424,15 +431,15 @@ function fe({
424
431
  "data-ic-result": m.ok ? "ok" : "failed",
425
432
  className: x(
426
433
  "mt-1 flex items-start gap-1.5 text-[12px] font-medium",
427
- T[m.ok ? "positive" : "negative"]
434
+ L[m.ok ? "positive" : "negative"]
428
435
  ),
429
436
  children: [
430
- /* @__PURE__ */ o(
437
+ /* @__PURE__ */ r(
431
438
  "span",
432
439
  {
433
440
  className: x(
434
441
  "mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full",
435
- ae[m.ok ? "positive" : "negative"]
442
+ le[m.ok ? "positive" : "negative"]
436
443
  )
437
444
  }
438
445
  ),
@@ -441,28 +448,28 @@ function fe({
441
448
  }
442
449
  )
443
450
  ] }),
444
- /* @__PURE__ */ o(
445
- R,
451
+ /* @__PURE__ */ r(
452
+ O,
446
453
  {
447
- since: z,
448
- record: e.record,
449
- onOpenRecord: S,
454
+ since: v,
455
+ record: t.record,
456
+ onOpenRecord: k,
450
457
  className: "hidden w-[210px] shrink-0 flex-col items-start gap-0.5 pt-0.5 xl:flex",
451
458
  stacked: !0
452
459
  }
453
460
  ),
454
461
  /* @__PURE__ */ a("div", { className: "flex shrink-0 items-start gap-1", children: [
455
- D && /* @__PURE__ */ a(
462
+ N && /* @__PURE__ */ a(
456
463
  "button",
457
464
  {
458
- ref: N,
465
+ ref: D,
459
466
  type: "button",
460
- "data-ic-drill-toggle": `${(d = e.drill) == null ? void 0 : d.kind}:${(c = e.drill) == null ? void 0 : c.id}`,
467
+ "data-ic-drill-toggle": `${(d = t.drill) == null ? void 0 : d.kind}:${(c = t.drill) == null ? void 0 : c.id}`,
461
468
  "aria-expanded": b,
462
469
  "aria-controls": b ? _ : void 0,
463
- onClick: () => C((n) => !n),
470
+ onClick: () => z((n) => !n),
464
471
  onKeyDown: (n) => {
465
- n.key === "Escape" && b && (n.preventDefault(), n.stopPropagation(), C(!1));
472
+ n.key === "Escape" && b && (n.preventDefault(), n.stopPropagation(), z(!1));
466
473
  },
467
474
  className: x(
468
475
  "inline-flex h-7 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
@@ -470,7 +477,7 @@ function fe({
470
477
  ),
471
478
  children: [
472
479
  "Details",
473
- /* @__PURE__ */ o(
480
+ /* @__PURE__ */ r(
474
481
  G,
475
482
  {
476
483
  className: x(
@@ -483,58 +490,58 @@ function fe({
483
490
  ]
484
491
  }
485
492
  ),
486
- $.map((n) => /* @__PURE__ */ a(
493
+ C.map((n) => /* @__PURE__ */ a(
487
494
  "button",
488
495
  {
489
496
  type: "button",
490
497
  "data-ic-action": n.kind,
491
498
  disabled: g,
492
- onClick: () => v(n),
499
+ onClick: () => y(n),
493
500
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
494
501
  children: [
495
- g && n.kind !== "explain" && /* @__PURE__ */ o(M, { className: "h-3 w-3 animate-spin" }),
502
+ g && n.kind !== "explain" && /* @__PURE__ */ r(M, { className: "h-3 w-3 animate-spin" }),
496
503
  n.label
497
504
  ]
498
505
  },
499
- F(n)
506
+ j(n)
500
507
  )),
501
- /* @__PURE__ */ o(se, { signal: t.id, rowKey: e.key }),
502
- /* @__PURE__ */ o(
503
- U,
508
+ /* @__PURE__ */ r(ae, { signal: e.id, rowKey: t.key }),
509
+ /* @__PURE__ */ r(
510
+ R,
504
511
  {
505
- signal: t.id,
506
- signalLabel: t.label,
507
- rowKey: e.key,
508
- group: e.group ? { key: e.group, label: e.group_label ?? e.group } : void 0,
512
+ signal: e.id,
513
+ signalLabel: e.label,
514
+ rowKey: t.key,
515
+ group: t.group ? { key: t.group, label: t.group_label ?? t.group } : void 0,
509
516
  compact: !0
510
517
  }
511
518
  )
512
519
  ] })
513
520
  ] }),
514
- k && /* @__PURE__ */ o("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": e.key, children: /* @__PURE__ */ o(
515
- Y,
521
+ S && /* @__PURE__ */ r("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": t.key, children: /* @__PURE__ */ r(
522
+ Z,
516
523
  {
517
524
  kind: "signal-row",
518
- params: { signal: t.id, row_key: e.key },
519
- label: t.id.startsWith("core:unanswered-") ? "Explain this" : "Explain this failure"
525
+ params: { signal: e.id, row_key: t.key },
526
+ label: e.id.startsWith("core:unanswered-") ? "Explain this" : "Explain this failure"
520
527
  }
521
528
  ) }),
522
- b && D && e.drill && // Esc anywhere inside the open drill collapses it.
523
- /* @__PURE__ */ o(
529
+ b && N && t.drill && // Esc anywhere inside the open drill collapses it.
530
+ /* @__PURE__ */ r(
524
531
  "section",
525
532
  {
526
533
  id: _,
527
- "aria-label": `Details: ${e.title}`,
534
+ "aria-label": `Details: ${t.title}`,
528
535
  onKeyDown: (n) => {
529
536
  n.key === "Escape" && !n.defaultPrevented && (n.stopPropagation(), s());
530
537
  },
531
538
  className: "border-t border-border pb-4 pl-11 pr-4 pt-3",
532
- children: /* @__PURE__ */ o(
533
- ie,
539
+ children: /* @__PURE__ */ r(
540
+ se,
534
541
  {
535
- drill: e.drill,
536
- onOpenRecord: S,
537
- onRetry: r ? () => v(r) : void 0,
542
+ drill: t.drill,
543
+ onOpenRecord: k,
544
+ onRetry: o ? () => y(o) : void 0,
538
545
  retryBusy: g
539
546
  }
540
547
  )
@@ -544,46 +551,46 @@ function fe({
544
551
  }
545
552
  );
546
553
  }
547
- function R({
548
- since: t,
549
- record: e,
554
+ function O({
555
+ since: e,
556
+ record: t,
550
557
  onOpenRecord: m,
551
558
  className: g,
552
559
  stacked: p
553
560
  }) {
554
561
  return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground", g), children: [
555
- /* @__PURE__ */ a("span", { "data-tip": j(t), className: "tabular-nums", children: [
562
+ /* @__PURE__ */ a("span", { "data-tip": U(e), className: "tabular-nums", children: [
556
563
  "Since ",
557
- le(t)
564
+ de(e)
558
565
  ] }),
559
- e && /* @__PURE__ */ a(A, { children: [
560
- !p && /* @__PURE__ */ o("span", { "aria-hidden": !0, children: "·" }),
566
+ t && /* @__PURE__ */ a(T, { children: [
567
+ !p && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "·" }),
561
568
  m ? /* @__PURE__ */ a(
562
569
  "button",
563
570
  {
564
571
  type: "button",
565
- "data-ic-record": `${e.collection}:${e.id}`,
566
- onClick: () => m(e.collection, e.id),
572
+ "data-ic-record": `${t.collection}:${t.id}`,
573
+ onClick: () => m(t.collection, t.id),
567
574
  className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground",
568
575
  children: [
569
- P(e),
570
- /* @__PURE__ */ o(V, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
576
+ P(t),
577
+ /* @__PURE__ */ r(V, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
571
578
  ]
572
579
  }
573
- ) : /* @__PURE__ */ o("span", { className: "font-medium text-foreground", children: P(e) })
580
+ ) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: P(t) })
574
581
  ] })
575
582
  ] });
576
583
  }
577
- function be({ signal: t }) {
578
- const { remove: e } = re(), m = /* @__PURE__ */ new Map();
579
- for (const p of t.snoozed) {
584
+ function ge({ signal: e }) {
585
+ const { remove: t } = re(), m = /* @__PURE__ */ new Map();
586
+ for (const p of e.snoozed) {
580
587
  if (!p.snooze) continue;
581
588
  const l = m.get(p.snooze.id) ?? [];
582
589
  l.push(p), m.set(p.snooze.id, l);
583
590
  }
584
- const g = (p) => new Set(p.map((f) => f.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${t.label}”`;
585
- return /* @__PURE__ */ o("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: t.snoozed.map((p) => {
586
- const l = p.snooze, f = l ? m.get(l.id) ?? [] : [], v = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
591
+ const g = (p) => new Set(p.map((f) => f.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${e.label}”`;
592
+ return /* @__PURE__ */ r("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: e.snoozed.map((p) => {
593
+ const l = p.snooze, f = l ? m.get(l.id) ?? [] : [], y = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
587
594
  month: "short",
588
595
  day: "numeric",
589
596
  hour: "numeric",
@@ -591,22 +598,22 @@ function be({ signal: t }) {
591
598
  })}` : ""}`;
592
599
  return /* @__PURE__ */ a("li", { "data-ic-row": p.key, "data-ic-snoozed": !0, className: "flex gap-3 px-4 py-2", children: [
593
600
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
594
- /* @__PURE__ */ o("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
601
+ /* @__PURE__ */ r("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
595
602
  /* @__PURE__ */ a("p", { className: "text-[11.5px] text-muted-foreground", children: [
596
- v,
603
+ y,
597
604
  f.length > 1 ? ` with ${g(f)}` : "",
598
605
  l != null && l.note ? ` — “${l.note}”` : ""
599
606
  ] })
600
607
  ] }),
601
- l && /* @__PURE__ */ o(
608
+ l && /* @__PURE__ */ r(
602
609
  "button",
603
610
  {
604
611
  type: "button",
605
612
  "data-ic-unsnooze": l.id,
606
613
  "data-ic-unsnooze-count": f.length,
607
614
  "data-tip": f.length > 1 ? `This snooze covers ${f.length} problems (${g(f)}) — they all come back` : void 0,
608
- disabled: e.isPending && e.variables === l.id,
609
- onClick: () => e.mutate(l.id),
615
+ disabled: t.isPending && t.variables === l.id,
616
+ onClick: () => t.mutate(l.id),
610
617
  className: "h-7 shrink-0 rounded-md px-2.5 text-[12px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-60",
611
618
  children: f.length > 1 ? `Unsnooze all ${f.length}` : l != null && l.until_occurrence ? "Undo" : "Unsnooze"
612
619
  }
@@ -615,6 +622,6 @@ function be({ signal: t }) {
615
622
  }) });
616
623
  }
617
624
  export {
618
- De as SignalCard,
619
- pe as oldestSeen
625
+ Te as SignalCard,
626
+ he as oldestSeen
620
627
  };