@nivaro/react 0.3.41 → 0.3.42

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 (96) 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 +644 -15
  5. package/dist/index.js +814 -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/prefetch.js +259 -106
  91. package/dist/shared/lib/record-ref.js +72 -0
  92. package/dist/shared/lib/reload-holds.js +25 -0
  93. package/dist/shared/lib/safe-error.js +52 -24
  94. package/dist/shared/lib/skeleton-shapes.js +72 -0
  95. package/dist/shared/lib/slow-reason.js +63 -0
  96. package/package.json +1 -1
@@ -1,170 +1,171 @@
1
- import { jsx as e, jsxs as r, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as a, Fragment as $ } from "react/jsx-runtime";
2
2
  import { useQueryClient as q, useQuery as K, useMutation as S } from "@tanstack/react-query";
3
3
  import { Search as L, Loader2 as A, Play as Q, ChevronDown as M } from "lucide-react";
4
- import { useState as f, useRef as P, useEffect as E } from "react";
4
+ import { useState as b, useRef as P, useEffect as E } from "react";
5
5
  import { useNivaroClient as O } from "../../../context.js";
6
6
  import { get as H, post as R } from "../../../lib/commands.js";
7
- import { cn as p } from "../../../lib/utils.js";
7
+ import { cn as m } from "../../../lib/utils.js";
8
8
  import { Sheet as j, SheetContent as U, SheetTitle as N, SheetDescription as w } from "../../ui/sheet.js";
9
9
  import { IntegrationObligationsView as V } from "../IntegrationObligationsView.js";
10
10
  import { usePartner as W, useCallDetail as X } from "./api.js";
11
- import { HealthPill as z, PartnerFlags as G, fmtPct as J, fmtMs as b, HourlyBars as Y } from "./PartnerBits.js";
12
- import { SubmissionRow as Z } from "./SubmissionRow.js";
13
- import { TONE_TEXT as g, TONE_SOFT as x, agoText as D, exactTime as F } from "./tone.js";
14
- import { describeCallTrigger as I, TriggerChip as ee } from "./drill/trigger.js";
11
+ import { ErrorExplanation as z } from "./ErrorExplanation.js";
12
+ import { HealthPill as G, PartnerFlags as J, fmtPct as Y, fmtMs as v, HourlyBars as Z } from "./PartnerBits.js";
13
+ import { SubmissionRow as I } from "./SubmissionRow.js";
14
+ import { TONE_TEXT as h, TONE_SOFT as f, agoText as D, exactTime as F } from "./tone.js";
15
+ import { describeCallTrigger as ee, TriggerChip as te } from "./drill/trigger.js";
15
16
  import { HeaderTable as k, CodeBlock as C, isTruncatedBody as _, pretty as T } from "./drill/json.js";
16
- import { HttpStatusChip as te } from "./drill/status.js";
17
- function re(o) {
18
- return o != null && o >= 200 && o < 300;
17
+ import { HttpStatusChip as re } from "./drill/status.js";
18
+ function ae(l) {
19
+ return l != null && l >= 200 && l < 300;
19
20
  }
20
- const ae = [
21
+ const ne = [
21
22
  { key: "calls", label: "Recent calls" },
22
23
  { key: "submissions", label: "Submissions" },
23
24
  { key: "obligations", label: "Obligations" },
24
25
  { key: "contracts", label: "Contracts" }
25
26
  ];
26
- function Te({ apiId: o, onClose: t, initialTab: a = "calls" }) {
27
- const { data: n, isLoading: i, isError: c } = W(o), [s, l] = f(a), d = n == null ? void 0 : n.card, u = P(0), v = (m) => {
28
- u.current += m ? 1 : -1;
27
+ function Se({ apiId: l, onClose: t, initialTab: r = "calls" }) {
28
+ const { data: n, isLoading: o, isError: u } = W(l), [i, d] = b(r), c = n == null ? void 0 : n.card, g = P(0), x = (s) => {
29
+ g.current += s ? 1 : -1;
29
30
  };
30
- return /* @__PURE__ */ e(j, { open: !0, onOpenChange: (m) => !m && t(), children: /* @__PURE__ */ r(
31
+ return /* @__PURE__ */ e(j, { open: !0, onOpenChange: (s) => !s && t(), children: /* @__PURE__ */ a(
31
32
  U,
32
33
  {
33
34
  className: "flex flex-col gap-0 overflow-hidden p-0",
34
35
  style: { width: 1040, maxWidth: "94vw" },
35
- "data-ic-partner-detail": o,
36
- onEscapeKeyDown: (m) => {
37
- u.current > 0 && m.preventDefault();
36
+ "data-ic-partner-detail": l,
37
+ onEscapeKeyDown: (s) => {
38
+ g.current > 0 && s.preventDefault();
38
39
  },
39
40
  children: [
40
- /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-6 pb-0 pt-5", children: i || !d ? /* @__PURE__ */ r("div", { className: "space-y-2 pb-4", children: [
41
+ /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-6 pb-0 pt-5", children: o || !c ? /* @__PURE__ */ a("div", { className: "space-y-2 pb-4", children: [
41
42
  /* @__PURE__ */ e(N, { className: "sr-only", children: "Partner" }),
42
43
  /* @__PURE__ */ e(w, { className: "sr-only", children: "Loading partner detail" }),
43
44
  /* @__PURE__ */ e("div", { className: "h-5 w-48 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
44
45
  /* @__PURE__ */ e("div", { className: "h-4 w-80 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
45
- c && /* @__PURE__ */ e("p", { className: p("text-[12.5px]", g.negative), children: "Couldn't load this partner." })
46
- ] }) : /* @__PURE__ */ r($, { children: [
47
- /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2.5 pr-8", children: [
48
- /* @__PURE__ */ e(N, { className: "text-[17px] font-semibold", children: d.name }),
49
- /* @__PURE__ */ e(z, { health: d.health }),
50
- /* @__PURE__ */ e(G, { card: d })
46
+ u && /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "Couldn't load this partner." })
47
+ ] }) : /* @__PURE__ */ a($, { children: [
48
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2.5 pr-8", children: [
49
+ /* @__PURE__ */ e(N, { className: "text-[17px] font-semibold", children: c.name }),
50
+ /* @__PURE__ */ e(G, { health: c.health }),
51
+ /* @__PURE__ */ e(J, { card: c })
51
52
  ] }),
52
- /* @__PURE__ */ r(w, { className: "mt-1 text-[12.5px] text-muted-foreground", children: [
53
- d.calls24,
53
+ /* @__PURE__ */ a(w, { className: "mt-1 text-[12.5px] text-muted-foreground", children: [
54
+ c.calls24,
54
55
  " call",
55
- d.calls24 === 1 ? "" : "s",
56
+ c.calls24 === 1 ? "" : "s",
56
57
  " in the last 24 hours ·",
57
58
  " ",
58
- J(d.success_pct24),
59
+ Y(c.success_pct24),
59
60
  " succeeded · typically ",
60
- b(d.p50_ms),
61
+ v(c.p50_ms),
61
62
  ", slowest",
62
63
  " ",
63
- b(d.p95_ms),
64
- d.owner ? ` · owner ${d.owner.name}` : ""
64
+ v(c.p95_ms),
65
+ c.owner ? ` · owner ${c.owner.name}` : ""
65
66
  ] }),
66
- /* @__PURE__ */ e(Y, { hourly: d.hourly, className: "mt-3 max-w-[720px]" }),
67
- /* @__PURE__ */ e("div", { role: "tablist", "aria-label": "Partner detail", className: "-mb-px mt-3 flex gap-5", children: ae.map((m) => /* @__PURE__ */ e(
67
+ /* @__PURE__ */ e(Z, { hourly: c.hourly, className: "mt-3 max-w-[720px]" }),
68
+ /* @__PURE__ */ e("div", { role: "tablist", "aria-label": "Partner detail", className: "-mb-px mt-3 flex gap-5", children: ne.map((s) => /* @__PURE__ */ e(
68
69
  "button",
69
70
  {
70
71
  type: "button",
71
72
  role: "tab",
72
- "aria-selected": s === m.key,
73
- "data-ic-detail-tab": m.key,
74
- onClick: () => l(m.key),
75
- className: p(
73
+ "aria-selected": i === s.key,
74
+ "data-ic-detail-tab": s.key,
75
+ onClick: () => d(s.key),
76
+ className: m(
76
77
  "border-b-2 pb-2 pt-1 text-[12.5px] font-medium transition-colors",
77
- s === m.key ? "border-nvr-cyan text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
78
+ i === s.key ? "border-nvr-cyan text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
78
79
  ),
79
- children: m.label
80
+ children: s.label
80
81
  },
81
- m.key
82
+ s.key
82
83
  )) })
83
84
  ] }) }),
84
- /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto bg-muted/30 px-6 py-5", children: [
85
- n && s === "calls" && /* @__PURE__ */ e(ne, { apiId: o, calls: n.calls, onCallOpenChange: v }),
86
- n && s === "submissions" && /* @__PURE__ */ e(le, { apiId: o }),
87
- n && s === "obligations" && /* @__PURE__ */ e(V, { api: n.card.name }),
88
- n && s === "contracts" && /* @__PURE__ */ e(de, { apiId: o, data: n })
85
+ /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto bg-muted/30 px-6 py-5", children: [
86
+ n && i === "calls" && /* @__PURE__ */ e(se, { apiId: l, calls: n.calls, onCallOpenChange: x }),
87
+ n && i === "submissions" && /* @__PURE__ */ e(de, { apiId: l }),
88
+ n && i === "obligations" && /* @__PURE__ */ e(V, { api: n.card.name }),
89
+ n && i === "contracts" && /* @__PURE__ */ e(ce, { apiId: l, data: n })
89
90
  ] })
90
91
  ]
91
92
  }
92
93
  ) });
93
94
  }
94
- function ne({
95
- apiId: o,
95
+ function se({
96
+ apiId: l,
96
97
  calls: t,
97
- onCallOpenChange: a
98
+ onCallOpenChange: r
98
99
  }) {
99
- const [n, i] = f(!1), c = t.filter((l) => !l.ok).length, s = n ? t.filter((l) => !l.ok) : t;
100
- return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
101
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
102
- /* @__PURE__ */ r("p", { className: "text-[12.5px] text-muted-foreground", children: [
100
+ const [n, o] = b(!1), u = t.filter((d) => !d.ok).length, i = n ? t.filter((d) => !d.ok) : t;
101
+ return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
102
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
103
+ /* @__PURE__ */ a("p", { className: "text-[12.5px] text-muted-foreground", children: [
103
104
  "The latest ",
104
105
  t.length,
105
106
  " call",
106
107
  t.length === 1 ? "" : "s",
107
108
  " made to this partner."
108
109
  ] }),
109
- /* @__PURE__ */ r("label", { className: "ml-auto inline-flex cursor-pointer items-center gap-2 text-[12.5px] text-foreground", children: [
110
+ /* @__PURE__ */ a("label", { className: "ml-auto inline-flex cursor-pointer items-center gap-2 text-[12.5px] text-foreground", children: [
110
111
  /* @__PURE__ */ e(
111
112
  "input",
112
113
  {
113
114
  type: "checkbox",
114
115
  checked: n,
115
- onChange: (l) => i(l.target.checked),
116
+ onChange: (d) => o(d.target.checked),
116
117
  "data-ic-failures-only": !0,
117
118
  className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
118
119
  }
119
120
  ),
120
121
  "Failures only",
121
- /* @__PURE__ */ r("span", { className: "tabular-nums text-muted-foreground", children: [
122
+ /* @__PURE__ */ a("span", { className: "tabular-nums text-muted-foreground", children: [
122
123
  "(",
123
- c,
124
+ u,
124
125
  ")"
125
126
  ] })
126
127
  ] })
127
128
  ] }),
128
- s.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: n ? "No failed calls in this window." : "No calls recorded in the last 14 days." }) : /* @__PURE__ */ e(
129
+ i.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: n ? "No failed calls in this window." : "No calls recorded in the last 14 days." }) : /* @__PURE__ */ e(
129
130
  "ul",
130
131
  {
131
132
  className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card",
132
133
  "data-ic-calls": !0,
133
- children: s.map((l) => /* @__PURE__ */ e(se, { apiId: o, call: l, onOpenChange: a }, l.key))
134
+ children: i.map((d) => /* @__PURE__ */ e(ie, { apiId: l, call: d, onOpenChange: r }, d.key))
134
135
  }
135
136
  )
136
137
  ] });
137
138
  }
138
- function se({
139
- apiId: o,
139
+ function ie({
140
+ apiId: l,
140
141
  call: t,
141
- onOpenChange: a
142
+ onOpenChange: r
142
143
  }) {
143
- var d;
144
- const [n, i] = f(!1), c = P(null), s = I(t.triggered_by, t.user), l = () => {
145
- var u;
146
- i(!1), (u = c.current) == null || u.focus();
144
+ var c, g, x;
145
+ const [n, o] = b(!1), u = P(null), i = ee(t.triggered_by, t.user), d = () => {
146
+ var s;
147
+ o(!1), (s = u.current) == null || s.focus();
147
148
  };
148
149
  return E(() => {
149
150
  if (n)
150
- return a(!0), () => a(!1);
151
- }, [n]), /* @__PURE__ */ r(
151
+ return r(!0), () => r(!1);
152
+ }, [n]), /* @__PURE__ */ a(
152
153
  "li",
153
154
  {
154
155
  "data-ic-call": t.id,
155
156
  "data-ic-call-source": t.source,
156
- className: p(n && "bg-muted/30"),
157
+ className: m(n && "bg-muted/30"),
157
158
  children: [
158
- /* @__PURE__ */ r(
159
+ /* @__PURE__ */ a(
159
160
  "button",
160
161
  {
161
- ref: c,
162
+ ref: u,
162
163
  type: "button",
163
164
  "aria-expanded": n,
164
165
  "data-ic-call-toggle": t.id,
165
- onClick: () => i((u) => !u),
166
- onKeyDown: (u) => {
167
- u.key === "Escape" && n && (u.preventDefault(), u.stopPropagation(), i(!1));
166
+ onClick: () => o((s) => !s),
167
+ onKeyDown: (s) => {
168
+ s.key === "Escape" && n && (s.preventDefault(), s.stopPropagation(), o(!1));
168
169
  },
169
170
  className: "flex w-full items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
170
171
  children: [
@@ -176,7 +177,7 @@ function se({
176
177
  children: D(t.created_at)
177
178
  }
178
179
  ),
179
- /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate font-mono text-[11.5px] text-foreground", children: [
180
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate font-mono text-[11.5px] text-foreground", children: [
180
181
  /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: t.method ?? "" }),
181
182
  " ",
182
183
  t.path ?? "—"
@@ -184,37 +185,37 @@ function se({
184
185
  /* @__PURE__ */ e(
185
186
  "span",
186
187
  {
187
- className: p(
188
+ className: m(
188
189
  "w-10 shrink-0 text-right text-[11.5px] font-medium tabular-nums",
189
- t.ok ? g.positive : g.negative
190
+ t.ok ? h.positive : h.negative
190
191
  ),
191
192
  children: t.status ?? (t.ok ? "ok" : "none")
192
193
  }
193
194
  ),
194
- /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[11.5px] tabular-nums text-muted-foreground", children: b(t.duration_ms) }),
195
- t.error && /* @__PURE__ */ e(
195
+ /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[11.5px] tabular-nums text-muted-foreground", children: v(t.duration_ms) }),
196
+ (((c = t.explanation) == null ? void 0 : c.sentence) ?? t.error) && /* @__PURE__ */ e(
196
197
  "span",
197
198
  {
198
- className: p(
199
- "min-w-0 max-w-[200px] shrink truncate text-[11.5px]",
200
- g.negative
199
+ className: m(
200
+ "min-w-0 max-w-[260px] shrink truncate text-[11.5px]",
201
+ h.negative
201
202
  ),
202
- "data-tip": t.error.length > 50 ? t.error.slice(0, 900) : void 0,
203
- children: t.error
203
+ "data-tip": t.explanation ? t.explanation.sentence : t.error && t.error.length > 50 ? t.error.slice(0, 900) : void 0,
204
+ children: ((g = t.explanation) == null ? void 0 : g.sentence) ?? t.error
204
205
  }
205
206
  ),
206
207
  /* @__PURE__ */ e(
207
208
  "span",
208
209
  {
209
210
  className: "min-w-0 max-w-[160px] shrink truncate text-[11px] text-muted-foreground",
210
- "data-tip": ((d = t.user) == null ? void 0 : d.email) ?? void 0,
211
- children: s.label
211
+ "data-tip": ((x = t.user) == null ? void 0 : x.email) ?? void 0,
212
+ children: i.label
212
213
  }
213
214
  ),
214
215
  /* @__PURE__ */ e(
215
216
  M,
216
217
  {
217
- className: p(
218
+ className: m(
218
219
  "h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",
219
220
  n && "rotate-180"
220
221
  ),
@@ -236,199 +237,199 @@ function se({
236
237
  {
237
238
  "aria-label": `Call detail — ${t.method ?? ""} ${t.path ?? ""}`.trim(),
238
239
  "data-ic-call-open": t.id,
239
- onKeyDown: (u) => {
240
- u.key === "Escape" && (u.stopPropagation(), l());
240
+ onKeyDown: (s) => {
241
+ s.key === "Escape" && (s.stopPropagation(), d());
241
242
  },
242
243
  className: "border-t border-border px-3 py-3",
243
- children: t.source === "outbound" ? /* @__PURE__ */ e("p", { className: "text-[12px] italic text-muted-foreground", "data-ic-call-empty": !0, children: "No request/response recorded for this call." }) : /* @__PURE__ */ e(ie, { apiId: o, callId: t.id })
244
+ children: t.source === "outbound" ? /* @__PURE__ */ e("p", { className: "text-[12px] italic text-muted-foreground", "data-ic-call-empty": !0, children: "No request/response recorded for this call." }) : /* @__PURE__ */ e(oe, { apiId: l, callId: t.id })
244
245
  }
245
246
  )
246
247
  ]
247
248
  }
248
249
  );
249
250
  }
250
- function ie({ apiId: o, callId: t }) {
251
- const { data: a, isLoading: n, isError: i } = X(o, t);
252
- return n ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
251
+ function oe({ apiId: l, callId: t }) {
252
+ const { data: r, isLoading: n, isError: o } = X(l, t);
253
+ return n ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
253
254
  /* @__PURE__ */ e("div", { className: "h-4 w-40 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
254
- /* @__PURE__ */ r("div", { className: "grid gap-3 lg:grid-cols-2", children: [
255
+ /* @__PURE__ */ a("div", { className: "grid gap-3 lg:grid-cols-2", children: [
255
256
  /* @__PURE__ */ e("div", { className: "h-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
256
257
  /* @__PURE__ */ e("div", { className: "h-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" })
257
258
  ] })
258
- ] }) : i || !a ? /* @__PURE__ */ e("p", { className: p("text-[12.5px]", g.negative), children: "Couldn't load this call." }) : /* @__PURE__ */ r("div", { className: "space-y-3", children: [
259
- /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", "data-ic-call-section": "trigger", children: [
259
+ ] }) : o || !r ? /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "Couldn't load this call." }) : /* @__PURE__ */ a("div", { className: "space-y-3", children: [
260
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", "data-ic-call-section": "trigger", children: [
260
261
  /* @__PURE__ */ e("span", { className: "text-[11.5px] font-semibold text-muted-foreground", children: "Triggered by" }),
261
- /* @__PURE__ */ e(ee, { triggeredBy: a.triggered_by, user: a.user })
262
+ /* @__PURE__ */ e(te, { triggeredBy: r.triggered_by, user: r.user })
262
263
  ] }),
263
- /* @__PURE__ */ r("div", { className: "grid gap-3 lg:grid-cols-2", children: [
264
- /* @__PURE__ */ r("div", { className: "min-w-0 space-y-2", "data-ic-call-section": "request", children: [
264
+ /* @__PURE__ */ a("div", { className: "grid gap-3 lg:grid-cols-2", children: [
265
+ /* @__PURE__ */ a("div", { className: "min-w-0 space-y-2", "data-ic-call-section": "request", children: [
265
266
  /* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-muted-foreground", children: "Request" }),
266
- /* @__PURE__ */ r(
267
+ /* @__PURE__ */ a(
267
268
  "p",
268
269
  {
269
270
  className: "truncate font-mono text-[11.5px] text-foreground",
270
- "data-tip": a.url ?? void 0,
271
+ "data-tip": r.url ?? void 0,
271
272
  children: [
272
- /* @__PURE__ */ e("span", { className: "font-semibold text-muted-foreground", children: a.method ?? "—" }),
273
+ /* @__PURE__ */ e("span", { className: "font-semibold text-muted-foreground", children: r.method ?? "—" }),
273
274
  " ",
274
- a.url ?? "—"
275
+ r.url ?? "—"
275
276
  ]
276
277
  }
277
278
  ),
278
- /* @__PURE__ */ e(k, { headers: a.request_headers }),
279
+ /* @__PURE__ */ e(k, { headers: r.request_headers }),
279
280
  /* @__PURE__ */ e(
280
281
  C,
281
282
  {
282
283
  label: "Body",
283
- value: T(a.request_body),
284
+ value: T(r.request_body),
284
285
  fold: !0,
285
- truncated: _(a.request_body)
286
+ truncated: _(r.request_body)
286
287
  }
287
288
  )
288
289
  ] }),
289
- /* @__PURE__ */ r("div", { className: "min-w-0 space-y-2", "data-ic-call-section": "response", children: [
290
+ /* @__PURE__ */ a("div", { className: "min-w-0 space-y-2", "data-ic-call-section": "response", children: [
290
291
  /* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-muted-foreground", children: "Response" }),
291
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
292
- /* @__PURE__ */ e(te, { status: a.response_status, ok: re(a.response_status) }),
293
- /* @__PURE__ */ e("span", { className: "text-[11.5px] tabular-nums text-muted-foreground", children: b(a.duration_ms) })
292
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
293
+ /* @__PURE__ */ e(re, { status: r.response_status, ok: ae(r.response_status) }),
294
+ /* @__PURE__ */ e("span", { className: "text-[11.5px] tabular-nums text-muted-foreground", children: v(r.duration_ms) })
294
295
  ] }),
295
- a.error && /* @__PURE__ */ e(
296
+ r.explanation ? /* @__PURE__ */ e(z, { explanation: r.explanation, raw: r.error }) : r.error && /* @__PURE__ */ e(
296
297
  "p",
297
298
  {
298
- className: p(
299
+ className: m(
299
300
  "rounded px-2 py-1.5 text-[11.5px]",
300
- x.negative,
301
- g.negative
301
+ f.negative,
302
+ h.negative
302
303
  ),
303
- children: a.error
304
+ children: r.error
304
305
  }
305
306
  ),
306
- /* @__PURE__ */ e(k, { headers: a.response_headers }),
307
+ /* @__PURE__ */ e(k, { headers: r.response_headers }),
307
308
  /* @__PURE__ */ e(
308
309
  C,
309
310
  {
310
311
  label: "Body",
311
- value: T(a.response_body),
312
+ value: T(r.response_body),
312
313
  fold: !0,
313
- truncated: _(a.response_body)
314
+ truncated: _(r.response_body)
314
315
  }
315
316
  )
316
317
  ] })
317
318
  ] })
318
319
  ] });
319
320
  }
320
- const oe = "endpoint_path";
321
- function le({ apiId: o }) {
322
- const t = O(), a = q(), [n, i] = f(""), [c, s] = f("");
321
+ const le = "endpoint_path";
322
+ function de({ apiId: l }) {
323
+ const t = O(), r = q(), [n, o] = b(""), [u, i] = b("");
323
324
  E(() => {
324
- const h = setTimeout(() => s(n.trim()), 350);
325
- return () => clearTimeout(h);
325
+ const p = setTimeout(() => i(n.trim()), 350);
326
+ return () => clearTimeout(p);
326
327
  }, [n]);
327
- const l = c.length >= 2 ? c : oe, { data: d, isLoading: u, isError: v } = K({
328
- queryKey: ["erp-submissions", "partner", o, l],
328
+ const d = u.length >= 2 ? u : le, { data: c, isLoading: g, isError: x } = K({
329
+ queryKey: ["erp-submissions", "partner", l, d],
329
330
  queryFn: () => t.request(
330
- H("/erp-submissions/search", { external_api: o, q: l, limit: 50 })
331
- ).then((h) => h.data)
332
- }), m = S({
333
- mutationFn: (h) => t.request(R(`/erp-submissions/${h}/retry`)),
331
+ H("/erp-submissions/search", { external_api: l, q: d, limit: 50 })
332
+ ).then((p) => p.data)
333
+ }), s = S({
334
+ mutationFn: (p) => t.request(R(`/erp-submissions/${p}/retry`)),
334
335
  onSettled: () => {
335
- a.invalidateQueries({ queryKey: ["erp-submissions"] }), a.invalidateQueries({ queryKey: ["erp-submission-attempts"] }), a.invalidateQueries({ queryKey: ["integration-partner", o] });
336
+ r.invalidateQueries({ queryKey: ["erp-submissions"] }), r.invalidateQueries({ queryKey: ["erp-submission-attempts"] }), r.invalidateQueries({ queryKey: ["integration-partner", l] });
336
337
  }
337
- }), y = d ?? [];
338
- return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
339
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
340
- /* @__PURE__ */ r("div", { className: "relative w-full max-w-[420px]", children: [
338
+ }), y = c ?? [];
339
+ return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
340
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
341
+ /* @__PURE__ */ a("div", { className: "relative w-full max-w-[420px]", children: [
341
342
  /* @__PURE__ */ e(L, { className: "pointer-events-none absolute left-2.5 top-2 h-3.5 w-3.5 text-muted-foreground" }),
342
343
  /* @__PURE__ */ e(
343
344
  "input",
344
345
  {
345
346
  value: n,
346
- onChange: (h) => i(h.target.value),
347
+ onChange: (p) => o(p.target.value),
347
348
  placeholder: "Find a reference, record id or error text",
348
349
  "data-ic-submission-search": !0,
349
350
  className: "h-8 w-full rounded-md border border-border bg-card pl-8 pr-2.5 text-[12.5px] text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
350
351
  }
351
352
  )
352
353
  ] }),
353
- /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: c.length >= 2 ? `Matching “${c}”` : "Newest 50 from the last 90 days" })
354
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: u.length >= 2 ? `Matching “${u}”` : "Newest 50 from the last 90 days" })
354
355
  ] }),
355
- u ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((h) => /* @__PURE__ */ e("div", { className: "h-10 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, h)) }) : v ? /* @__PURE__ */ e("p", { className: p("text-[12.5px]", g.negative), children: "Couldn't load submissions." }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: c.length >= 2 ? "Nothing sent to this partner matches that." : "Nothing has been sent to this partner in the last 90 days." }) : /* @__PURE__ */ e("div", { className: "space-y-2", "data-ic-submissions": !0, children: y.map((h) => /* @__PURE__ */ e("div", { className: "bg-card", children: /* @__PURE__ */ e(
356
- Z,
356
+ g ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((p) => /* @__PURE__ */ e("div", { className: "h-10 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, p)) }) : x ? /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "Couldn't load submissions." }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: u.length >= 2 ? "Nothing sent to this partner matches that." : "Nothing has been sent to this partner in the last 90 days." }) : /* @__PURE__ */ e("div", { className: "space-y-2", "data-ic-submissions": !0, children: y.map((p) => /* @__PURE__ */ e("div", { className: "bg-card", children: /* @__PURE__ */ e(
357
+ I,
357
358
  {
358
- sub: h,
359
- onRetry: (B) => m.mutate(B),
360
- retrying: m.isPending && m.variables === h.id
359
+ sub: p,
360
+ onRetry: (B) => s.mutate(B),
361
+ retrying: s.isPending && s.variables === p.id
361
362
  }
362
- ) }, h.id)) })
363
+ ) }, p.id)) })
363
364
  ] });
364
365
  }
365
- function de({ apiId: o, data: t }) {
366
- const a = O(), n = q(), i = S({
367
- mutationFn: () => a.request(
368
- R(`/external-apis/${o}/contracts/run`)
369
- ).then((s) => s.data),
370
- onSettled: () => n.invalidateQueries({ queryKey: ["integration-partner", o] })
371
- }), c = t.contracts;
372
- return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
373
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
366
+ function ce({ apiId: l, data: t }) {
367
+ const r = O(), n = q(), o = S({
368
+ mutationFn: () => r.request(
369
+ R(`/external-apis/${l}/contracts/run`)
370
+ ).then((i) => i.data),
371
+ onSettled: () => n.invalidateQueries({ queryKey: ["integration-partner", l] })
372
+ }), u = t.contracts;
373
+ return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
374
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
374
375
  /* @__PURE__ */ e("p", { className: "max-w-[70ch] text-[12.5px] text-muted-foreground", children: "A contract is a saved check that an endpoint still answers the way this system expects. Running them calls the partner's read-only endpoints now." }),
375
- /* @__PURE__ */ r(
376
+ /* @__PURE__ */ a(
376
377
  "button",
377
378
  {
378
379
  type: "button",
379
- disabled: i.isPending || c.length === 0,
380
- onClick: () => i.mutate(),
380
+ disabled: o.isPending || u.length === 0,
381
+ onClick: () => o.mutate(),
381
382
  "data-ic-run-contracts": !0,
382
383
  className: "ml-auto inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-[12.5px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
383
384
  children: [
384
- i.isPending ? /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
385
+ o.isPending ? /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
385
386
  "Run contracts"
386
387
  ]
387
388
  }
388
389
  )
389
390
  ] }),
390
- i.data && /* @__PURE__ */ e(
391
+ o.data && /* @__PURE__ */ e(
391
392
  "p",
392
393
  {
393
394
  role: "status",
394
- className: p(
395
+ className: m(
395
396
  "rounded-md px-3 py-2 text-[12.5px] font-medium",
396
- i.data.failed > 0 ? x.negative : x.positive,
397
- i.data.failed > 0 ? g.negative : g.positive
397
+ o.data.failed > 0 ? f.negative : f.positive,
398
+ o.data.failed > 0 ? h.negative : h.positive
398
399
  ),
399
- children: i.data.failed > 0 ? `${i.data.failed} of ${i.data.results.length} failing` : `All ${i.data.results.length} passed`
400
+ children: o.data.failed > 0 ? `${o.data.failed} of ${o.data.results.length} failing` : `All ${o.data.results.length} passed`
400
401
  }
401
402
  ),
402
- i.isError && /* @__PURE__ */ e("p", { className: p("text-[12.5px]", g.negative), children: "The contracts couldn't run." }),
403
- c.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: "No contracts on this partner's endpoints yet. Add one from the endpoint's settings on the external API page." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card", children: c.map((s) => {
404
- const l = s.last_run == null ? "never" : s.ok ? "ok" : "failed";
405
- return /* @__PURE__ */ r("li", { "data-ic-contract": l, className: "flex gap-3 px-4 py-2.5", children: [
403
+ o.isError && /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "The contracts couldn't run." }),
404
+ u.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: "No contracts on this partner's endpoints yet. Add one from the endpoint's settings on the external API page." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card", children: u.map((i) => {
405
+ const d = i.last_run == null ? "never" : i.ok ? "ok" : "failed";
406
+ return /* @__PURE__ */ a("li", { "data-ic-contract": d, className: "flex gap-3 px-4 py-2.5", children: [
406
407
  /* @__PURE__ */ e(
407
408
  "span",
408
409
  {
409
- className: p(
410
+ className: m(
410
411
  "mt-0.5 shrink-0 rounded px-1.5 py-px text-[11px] font-semibold",
411
- l === "ok" ? p(x.positive, g.positive) : l === "failed" ? p(x.negative, g.negative) : "bg-muted text-muted-foreground"
412
+ d === "ok" ? m(f.positive, h.positive) : d === "failed" ? m(f.negative, h.negative) : "bg-muted text-muted-foreground"
412
413
  ),
413
- children: l === "ok" ? "Passing" : l === "failed" ? "Failing" : "Not run"
414
+ children: d === "ok" ? "Passing" : d === "failed" ? "Failing" : "Not run"
414
415
  }
415
416
  ),
416
- /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
417
- /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-foreground", children: s.name }),
418
- s.detail && /* @__PURE__ */ e("p", { className: "mt-0.5 line-clamp-2 text-[12px] text-muted-foreground", children: s.detail })
417
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
418
+ /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-foreground", children: i.name }),
419
+ i.detail && /* @__PURE__ */ e("p", { className: "mt-0.5 line-clamp-2 text-[12px] text-muted-foreground", children: i.detail })
419
420
  ] }),
420
421
  /* @__PURE__ */ e(
421
422
  "span",
422
423
  {
423
424
  className: "shrink-0 text-[12px] text-muted-foreground",
424
- "data-tip": F(s.last_run),
425
- children: s.last_run ? D(s.last_run) : ""
425
+ "data-tip": F(i.last_run),
426
+ children: i.last_run ? D(i.last_run) : ""
426
427
  }
427
428
  )
428
- ] }, s.endpoint_id);
429
+ ] }, i.endpoint_id);
429
430
  }) })
430
431
  ] });
431
432
  }
432
433
  export {
433
- Te as PartnerDetail
434
+ Se as PartnerDetail
434
435
  };