@nivaro/react 0.3.134 → 0.3.136

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.
@@ -10,7 +10,7 @@ import { noteReplayIdle as Me, createReplayIdleState as Ne, REPLAY_IDLE_RESTART_
10
10
  import { noteReplayEvent as Ue, createReplayCheckoutState as We } from "../shared/lib/replay-checkout.js";
11
11
  import { instrumentConsole as He, instrumentRequests as Ke, redactSecrets as $e } from "../shared/lib/replay-context.js";
12
12
  import { instrumentSocket as Be } from "../shared/lib/replay-socket.js";
13
- const ze = "nivaro-react@0.3.134", V = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, X = () => typeof navigator > "u" || navigator.onLine !== !1;
13
+ const ze = "nivaro-react@0.3.136", V = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, X = () => typeof navigator > "u" || navigator.onLine !== !1;
14
14
  function Je(o) {
15
15
  return typeof o.url != "string" || typeof fetch != "function" ? null : (f, u) => {
16
16
  const l = typeof o.getToken == "function" ? o.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -3803,10 +3803,15 @@ export declare interface ErrorDescription {
3803
3803
  * in. Closed by default — the person reads what happened and what to do; the
3804
3804
  * reference is there for whoever helps them.
3805
3805
  */
3806
- export declare function ErrorDetails({ description: d, action, className }: {
3806
+ export declare function ErrorDetails({ description: d, action, rows, className }: {
3807
3807
  description: ErrorDescription;
3808
3808
  /** What the person was doing ("Save record"), for the copy. */
3809
3809
  action?: string;
3810
+ /** Extra facts for support (the stored answer, record ids), shown after the code. */
3811
+ rows?: Array<{
3812
+ label: string;
3813
+ value: string;
3814
+ }>;
3810
3815
  className?: string;
3811
3816
  }): JSX.Element | null;
3812
3817
 
@@ -1,37 +1,43 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { ChevronRight as C, Copy as I, LifeBuoy as N, WifiOff as E, Ban as A, AlertTriangle as j, ArrowLeft as T, LogIn as q, RotateCw as v } from "lucide-react";
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { ChevronRight as w, Copy as I, LifeBuoy as y, WifiOff as E, Ban as A, AlertTriangle as j, ArrowLeft as T, LogIn as q, RotateCw as v } from "lucide-react";
3
3
  import { useState as B, useMemo as D } from "react";
4
4
  import { openSupportForError as R, runErrorAction as O } from "../lib/error-actions.js";
5
5
  import { copyErrorDetails as S, describeLoadError as F, describeError as H } from "../lib/error-message.js";
6
- import { cn as o } from "../lib/utils.js";
6
+ import { cn as i } from "../lib/utils.js";
7
7
  const M = {
8
8
  retry: v,
9
9
  reload: v,
10
10
  "sign-in": q,
11
11
  "go-back": T,
12
- contact: N
12
+ contact: y
13
13
  };
14
- function y({
14
+ function N({
15
15
  description: e,
16
16
  action: s,
17
- className: d
17
+ rows: a,
18
+ className: u
18
19
  }) {
19
- const [l, m] = B(null);
20
- return !e.requestId && !e.code && !e.status && !e.technical ? null : /* @__PURE__ */ n("details", { "data-error-details": "", className: o("group text-[11.5px]", d), children: [
20
+ const [p, c] = B(null);
21
+ return !e.requestId && !e.code && !e.status && !e.technical && !(a != null && a.length) ? null : /* @__PURE__ */ n("details", { "data-error-details": "", className: i("group text-[11.5px]", u), children: [
21
22
  /* @__PURE__ */ n("summary", { className: "inline-flex cursor-pointer list-none items-center gap-1 rounded text-slate-500 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-muted-foreground dark:hover:text-foreground [&::-webkit-details-marker]:hidden", children: [
22
- /* @__PURE__ */ t(C, { className: "h-3 w-3 transition-transform group-open:rotate-90", "aria-hidden": !0 }),
23
+ /* @__PURE__ */ r(w, { className: "h-3 w-3 transition-transform group-open:rotate-90", "aria-hidden": !0 }),
23
24
  "Details for support"
24
25
  ] }),
25
26
  /* @__PURE__ */ n("div", { className: "mt-1.5 space-y-1 rounded-md border border-slate-200 bg-slate-50 px-2.5 py-2 text-left text-slate-600 dark:border-border dark:bg-muted/40 dark:text-muted-foreground", children: [
26
27
  e.requestId && /* @__PURE__ */ n("p", { children: [
27
28
  "Reference: ",
28
- /* @__PURE__ */ t("span", { className: "select-all font-mono", children: e.requestId })
29
+ /* @__PURE__ */ r("span", { className: "select-all font-mono", children: e.requestId })
29
30
  ] }),
30
31
  (e.code || e.status) && /* @__PURE__ */ n("p", { children: [
31
32
  "Code:",
32
33
  " ",
33
- /* @__PURE__ */ t("span", { className: "font-mono", children: [e.code, e.status ? `HTTP ${e.status}` : null].filter(Boolean).join(" · ") })
34
+ /* @__PURE__ */ r("span", { className: "font-mono", children: [e.code, e.status ? `HTTP ${e.status}` : null].filter(Boolean).join(" · ") })
34
35
  ] }),
36
+ a == null ? void 0 : a.map((o) => /* @__PURE__ */ n("p", { "data-error-detail-row": o.label, children: [
37
+ o.label,
38
+ ": ",
39
+ /* @__PURE__ */ r("span", { className: "select-all break-words font-mono", children: o.value })
40
+ ] }, o.label)),
35
41
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 pt-0.5", children: [
36
42
  /* @__PURE__ */ n(
37
43
  "button",
@@ -39,12 +45,12 @@ function y({
39
45
  type: "button",
40
46
  "data-error-copy": "",
41
47
  onClick: () => {
42
- S(e, { action: s }).then(m);
48
+ S(e, { action: s }).then(c);
43
49
  },
44
50
  className: "inline-flex items-center gap-1 font-medium text-sky-700 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-nvr-cyan",
45
51
  children: [
46
- /* @__PURE__ */ t(I, { className: "h-3 w-3", "aria-hidden": !0 }),
47
- l === !0 ? "Copied" : l === !1 ? "Could not copy" : "Copy details"
52
+ /* @__PURE__ */ r(I, { className: "h-3 w-3", "aria-hidden": !0 }),
53
+ p === !0 ? "Copied" : p === !1 ? "Could not copy" : "Copy details"
48
54
  ]
49
55
  }
50
56
  ),
@@ -56,7 +62,7 @@ function y({
56
62
  onClick: () => R(e, { action: s }),
57
63
  className: "inline-flex items-center gap-1 font-medium text-sky-700 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-nvr-cyan",
58
64
  children: [
59
- /* @__PURE__ */ t(N, { className: "h-3 w-3", "aria-hidden": !0 }),
65
+ /* @__PURE__ */ r(y, { className: "h-3 w-3", "aria-hidden": !0 }),
60
66
  "Ask for help"
61
67
  ]
62
68
  }
@@ -68,102 +74,102 @@ function y({
68
74
  function J({
69
75
  error: e,
70
76
  description: s,
71
- what: d,
72
- fallback: l,
73
- onRetry: m,
74
- actionLabel: u,
75
- action: f,
76
- variant: a = "inline",
77
- centered: w = !1,
78
- fieldLabels: p,
77
+ what: a,
78
+ fallback: u,
79
+ onRetry: p,
80
+ actionLabel: c,
81
+ action: o,
82
+ variant: d = "inline",
83
+ centered: C = !1,
84
+ fieldLabels: b,
79
85
  className: x
80
86
  }) {
81
- const r = D(
82
- () => s ?? (d ? F(e, d, { fieldLabels: p }) : H(e, l, { fieldLabels: p })),
83
- [s, e, d, l, p]
84
- ), i = f === void 0 ? r.action : f, h = r.kind === "offline" || r.kind === "network" ? E : r.kind === "forbidden" ? A : j, g = i ? M[i.kind] : null, b = i && g && /* @__PURE__ */ n(
87
+ const t = D(
88
+ () => s ?? (a ? F(e, a, { fieldLabels: b }) : H(e, u, { fieldLabels: b })),
89
+ [s, e, a, u, b]
90
+ ), l = o === void 0 ? t.action : o, h = t.kind === "offline" || t.kind === "network" ? E : t.kind === "forbidden" ? A : j, g = l ? M[l.kind] : null, f = l && g && /* @__PURE__ */ n(
85
91
  "button",
86
92
  {
87
93
  type: "button",
88
- "data-error-action": i.kind,
89
- onClick: () => O(i.kind, r, { retry: m, action: u }),
90
- className: o(
94
+ "data-error-action": l.kind,
95
+ onClick: () => O(l.kind, t, { retry: p, action: c }),
96
+ className: i(
91
97
  "inline-flex items-center gap-1.5 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
92
- a === "banner" ? "h-6 shrink-0 rounded border border-amber-400/60 bg-white px-2 text-[12px] text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15" : a === "page" ? "h-8 rounded-md border border-slate-300 bg-white px-3 text-[12.5px] text-slate-800 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-foreground dark:hover:bg-muted" : "rounded text-[12px] text-sky-700 hover:underline dark:text-nvr-cyan"
98
+ d === "banner" ? "h-6 shrink-0 rounded border border-amber-400/60 bg-white px-2 text-[12px] text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15" : d === "page" ? "h-8 rounded-md border border-slate-300 bg-white px-3 text-[12.5px] text-slate-800 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-foreground dark:hover:bg-muted" : "rounded text-[12px] text-sky-700 hover:underline dark:text-nvr-cyan"
93
99
  ),
94
100
  children: [
95
- /* @__PURE__ */ t(g, { className: "h-3 w-3", "aria-hidden": !0 }),
96
- i.label
101
+ /* @__PURE__ */ r(g, { className: "h-3 w-3", "aria-hidden": !0 }),
102
+ l.label
97
103
  ]
98
104
  }
99
105
  );
100
- if (a === "banner")
106
+ if (d === "banner")
101
107
  return /* @__PURE__ */ n(
102
108
  "div",
103
109
  {
104
110
  role: "alert",
105
111
  "data-error-notice": "banner",
106
- "data-error-kind": r.kind ?? "",
107
- className: o(
112
+ "data-error-kind": t.kind ?? "",
113
+ className: i(
108
114
  "flex shrink-0 flex-wrap items-start gap-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200",
109
115
  x
110
116
  ),
111
117
  children: [
112
- /* @__PURE__ */ t(h, { "aria-hidden": !0, className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
118
+ /* @__PURE__ */ r(h, { "aria-hidden": !0, className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
113
119
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
114
- /* @__PURE__ */ t("p", { className: "font-medium", children: r.title }),
115
- r.hint && /* @__PURE__ */ t("p", { className: "text-amber-800 dark:text-amber-200/80", children: r.hint }),
116
- /* @__PURE__ */ t(y, { description: r, action: u, className: "mt-1" })
120
+ /* @__PURE__ */ r("p", { className: "font-medium", children: t.title }),
121
+ t.hint && /* @__PURE__ */ r("p", { className: "text-amber-800 dark:text-amber-200/80", children: t.hint }),
122
+ /* @__PURE__ */ r(N, { description: t, action: c, className: "mt-1" })
117
123
  ] }),
118
- b
124
+ f
119
125
  ]
120
126
  }
121
127
  );
122
- const c = a === "page" || w, k = /* @__PURE__ */ n(
128
+ const m = d === "page" || C, k = /* @__PURE__ */ n(
123
129
  "div",
124
130
  {
125
131
  role: "alert",
126
- "data-error-notice": a,
132
+ "data-error-notice": d,
127
133
  "data-load-error": "",
128
- "data-error-kind": r.kind ?? "",
129
- className: o(
134
+ "data-error-kind": t.kind ?? "",
135
+ className: i(
130
136
  "flex gap-2 text-[12px] text-slate-600 dark:text-muted-foreground",
131
- c ? "max-w-[360px] flex-col items-center text-center" : "items-start",
132
- a !== "page" && x
137
+ m ? "max-w-[360px] flex-col items-center text-center" : "items-start",
138
+ d !== "page" && x
133
139
  ),
134
140
  children: [
135
- /* @__PURE__ */ t(
141
+ /* @__PURE__ */ r(
136
142
  h,
137
143
  {
138
- className: o(
144
+ className: i(
139
145
  "shrink-0 text-amber-500",
140
- c ? "h-5 w-5" : "mt-px h-3.5 w-3.5",
141
- r.kind === "forbidden" && "text-slate-400"
146
+ m ? "h-5 w-5" : "mt-px h-3.5 w-3.5",
147
+ t.kind === "forbidden" && "text-slate-400"
142
148
  ),
143
149
  "aria-hidden": !0
144
150
  }
145
151
  ),
146
- /* @__PURE__ */ n("div", { className: o("min-w-0", c && "flex flex-col items-center gap-1"), children: [
147
- /* @__PURE__ */ t(
152
+ /* @__PURE__ */ n("div", { className: i("min-w-0", m && "flex flex-col items-center gap-1"), children: [
153
+ /* @__PURE__ */ r(
148
154
  "p",
149
155
  {
150
- className: o(
156
+ className: i(
151
157
  "leading-snug [text-wrap:balance]",
152
- c ? "text-[13.5px] font-semibold text-slate-900 dark:text-foreground" : "font-medium text-slate-800 dark:text-foreground"
158
+ m ? "text-[13.5px] font-semibold text-slate-900 dark:text-foreground" : "font-medium text-slate-800 dark:text-foreground"
153
159
  ),
154
- children: r.title
160
+ children: t.title
155
161
  }
156
162
  ),
157
- r.hint && /* @__PURE__ */ t("p", { className: "leading-snug [text-wrap:balance]", children: r.hint }),
158
- b && /* @__PURE__ */ t("div", { className: c ? "mt-1.5" : "mt-1", children: b }),
159
- /* @__PURE__ */ t(y, { description: r, action: u, className: "mt-1.5" })
163
+ t.hint && /* @__PURE__ */ r("p", { className: "leading-snug [text-wrap:balance]", children: t.hint }),
164
+ f && /* @__PURE__ */ r("div", { className: m ? "mt-1.5" : "mt-1", children: f }),
165
+ /* @__PURE__ */ r(N, { description: t, action: c, className: "mt-1.5" })
160
166
  ] })
161
167
  ]
162
168
  }
163
169
  );
164
- return a !== "page" ? k : /* @__PURE__ */ t("div", { className: o("flex min-h-[200px] flex-1 items-center justify-center p-8", x), children: k });
170
+ return d !== "page" ? k : /* @__PURE__ */ r("div", { className: i("flex min-h-[200px] flex-1 items-center justify-center p-8", x), children: k });
165
171
  }
166
172
  export {
167
- y as ErrorDetails,
173
+ N as ErrorDetails,
168
174
  J as ErrorNotice
169
175
  };
@@ -11,7 +11,7 @@ import { Skeleton as k } from "../ui/skeleton.js";
11
11
  import { TrendBars as H } from "./charts.js";
12
12
  import { DrillSheet as ce } from "./drill.js";
13
13
  import { DrillContext as me, Segmented as K, FilterPicker as A, Panel as $, Num as m, Delta as j, OutcomeChip as G, ShareBar as Z } from "./ui.js";
14
- import { useParamState as he, writeDrill as pe, titleize as _, fmtRange as ue, pct as L, fmtInt as E, mins as M } from "./url.js";
14
+ import { useParamState as he, writeDrill as pe, titleize as _, fmtRange as ue, pct as L, fmtInt as E, mins as P } from "./url.js";
15
15
  const B = [
16
16
  { value: "24h", label: "24h" },
17
17
  { value: "7d", label: "7d" },
@@ -81,7 +81,7 @@ function fe({
81
81
  return r.set("by", y), d && (r.set("from", d.window.from), r.set("to", d.window.to), r.set("asof", d.asof)), p.request(q(`/delivery-analytics/breakdown?${r.toString()}`)).then((c) => c.data);
82
82
  },
83
83
  staleTime: 6e4
84
- }), R = y === "category" ? d == null ? void 0 : d.breakdown : g.data, P = ne(
84
+ }), R = y === "category" ? d == null ? void 0 : d.breakdown : g.data, D = ne(
85
85
  (r, c, u) => b((v) => {
86
86
  pe(v, r, c), u != null && u.sort && v.set("ds", u.sort);
87
87
  }),
@@ -106,8 +106,8 @@ function fe({
106
106
  for (const c of d.channels)
107
107
  for (const u of c.statuses) r.set(`ch.${c.channel}=${u.status}`, u.label);
108
108
  return r;
109
- }, [d, R]), D = h.get("window") ?? "7d", Y = Number(h.get("acted") ?? 24);
110
- return /* @__PURE__ */ l(me.Provider, { value: P, children: [
109
+ }, [d, R]), M = h.get("window") ?? "7d", Y = Number(h.get("acted") ?? 24);
110
+ return /* @__PURE__ */ l(me.Provider, { value: s.isPlaceholderData ? null : D, children: [
111
111
  /* @__PURE__ */ l("div", { className: f("flex flex-1 min-h-0 flex-col", i), "data-nvr-delivery-analytics": "", children: [
112
112
  /* @__PURE__ */ l(
113
113
  "header",
@@ -123,7 +123,7 @@ function fe({
123
123
  K,
124
124
  {
125
125
  ariaLabel: "Window",
126
- value: B.some((r) => r.value === D) ? D : "custom",
126
+ value: B.some((r) => r.value === M) ? M : "custom",
127
127
  options: [...B],
128
128
  onChange: (r) => b((c) => {
129
129
  c.set("window", String(r)), c.delete("from"), c.delete("to");
@@ -133,7 +133,7 @@ function fe({
133
133
  /* @__PURE__ */ e(
134
134
  ge,
135
135
  {
136
- active: D === "custom",
136
+ active: M === "custom",
137
137
  from: h.get("from"),
138
138
  to: h.get("to"),
139
139
  onApply: (r, c) => b((u) => {
@@ -284,7 +284,7 @@ function ge({
284
284
  "aria-pressed": i,
285
285
  className: f(
286
286
  "inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
287
- i ? "border-slate-900 bg-slate-900 text-white dark:border-nvr-cyan dark:bg-nvr-cyan dark:text-[#172940]" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-muted-foreground dark:hover:bg-muted"
287
+ i ? "border-[#0f172a] bg-[#0f172a] text-white dark:border-nvr-cyan dark:bg-nvr-cyan dark:text-[#172940]" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-muted-foreground dark:hover:bg-muted"
288
288
  ),
289
289
  children: [
290
290
  /* @__PURE__ */ e(ee, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
@@ -297,7 +297,7 @@ function ge({
297
297
  [
298
298
  ["From", n, N],
299
299
  ["To", s, d]
300
- ].map(([g, R, P]) => /* @__PURE__ */ l("label", { className: "block text-[12px] text-slate-600 dark:text-muted-foreground", children: [
300
+ ].map(([g, R, D]) => /* @__PURE__ */ l("label", { className: "block text-[12px] text-slate-600 dark:text-muted-foreground", children: [
301
301
  g,
302
302
  /* @__PURE__ */ e(
303
303
  "input",
@@ -305,7 +305,7 @@ function ge({
305
305
  type: "date",
306
306
  value: R,
307
307
  max: p,
308
- onChange: (C) => P(C.target.value),
308
+ onChange: (C) => D(C.target.value),
309
309
  className: "mt-0.5 block h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12.5px] text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:border-border dark:bg-background dark:text-foreground"
310
310
  }
311
311
  )
@@ -481,7 +481,7 @@ function we({ summary: i }) {
481
481
  label: "Time to read",
482
482
  sub: /* @__PURE__ */ l(w, { children: [
483
483
  "p90 ",
484
- M(t.ttr.p90),
484
+ P(t.ttr.p90),
485
485
  " · over",
486
486
  " ",
487
487
  /* @__PURE__ */ e(m, { cell: t.timed, label: "Read, with a read time", sort: "ttr" })
@@ -493,7 +493,7 @@ function we({ summary: i }) {
493
493
  label: "Read, slowest first",
494
494
  sort: "ttr",
495
495
  tip: "Median — show these, slowest first",
496
- children: M(t.ttr.p50)
496
+ children: P(t.ttr.p50)
497
497
  }
498
498
  )
499
499
  }
@@ -1027,10 +1027,10 @@ function _e({
1027
1027
  label: `${s.label} · read, slowest first`,
1028
1028
  sort: "ttr",
1029
1029
  tip: "Show the reads behind this, slowest first",
1030
- children: M(s.p50)
1030
+ children: P(s.p50)
1031
1031
  }
1032
1032
  ) }),
1033
- /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: M(s.p90) }),
1033
+ /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: P(s.p90) }),
1034
1034
  /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-right", children: /* @__PURE__ */ l("span", { className: "inline-flex items-baseline gap-1", children: [
1035
1035
  /* @__PURE__ */ e(m, { cell: s.acted, label: `${s.label} · acted`, children: s.eligible.n ? L(s.acted.n, s.eligible.n) : "–" }),
1036
1036
  s.eligible.n > 0 && /* @__PURE__ */ l("span", { className: "text-[11px] text-slate-400", children: [
@@ -1,26 +1,26 @@
1
- import { jsxs as b, jsx as r } from "react/jsx-runtime";
2
- import { useContext as N, useMemo as g, useState as S, useEffect as C } from "react";
1
+ import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
+ import { useContext as N, useMemo as y, useState as S, useEffect as C } from "react";
3
3
  import { RechartsGate as E } from "../charts/RechartsGate.js";
4
4
  import { COLOR_ROLES as R } from "../QueryTable.js";
5
5
  import { Skeleton as $ } from "../ui/skeleton.js";
6
6
  import { DrillContext as D } from "./ui.js";
7
- import { bucketLabel as f, fmtInt as y } from "./url.js";
8
- const h = () => typeof document < "u" && document.documentElement.classList.contains("dark");
7
+ import { bucketLabel as f, fmtInt as h } from "./url.js";
8
+ const v = () => typeof document < "u" && document.documentElement.classList.contains("dark");
9
9
  function O() {
10
- const [a, n] = S(h);
10
+ const [a, n] = S(v);
11
11
  return C(() => {
12
12
  if (typeof document > "u") return;
13
- const d = new MutationObserver(() => n(h()));
13
+ const d = new MutationObserver(() => n(v()));
14
14
  return d.observe(document.documentElement, { attributes: !0, attributeFilter: ["class"] }), () => d.disconnect();
15
15
  }, []), a;
16
16
  }
17
- const v = (a, n) => R[a][n ? 1 : 0];
17
+ const w = (a, n) => R[a][n ? 1 : 0];
18
18
  function T({
19
19
  summary: a,
20
20
  kind: n,
21
21
  height: d = 168
22
22
  }) {
23
- const l = O(), w = N(D), o = a.window.bucket, s = g(() => {
23
+ const l = O(), m = N(D), o = a.window.bucket, s = y(() => {
24
24
  const t = a.series;
25
25
  return n === "notifications" ? [
26
26
  {
@@ -46,19 +46,19 @@ function T({
46
46
  {
47
47
  key: "delivered",
48
48
  label: "Sent",
49
- color: v("info", l),
49
+ color: w("info", l),
50
50
  cells: t.map((e) => e.email_delivered),
51
51
  drillLabel: (e) => `Emails sent · ${f(e, o)}`
52
52
  },
53
53
  {
54
54
  key: "failed",
55
55
  label: "Failed",
56
- color: v("negative", l),
56
+ color: w("negative", l),
57
57
  cells: t.map((e) => e.email_failed),
58
58
  drillLabel: (e) => `Emails failed · ${f(e, o)}`
59
59
  }
60
60
  ];
61
- }, [a.series, n, l, o]), p = g(
61
+ }, [a.series, n, l, o]), k = y(
62
62
  () => a.series.map((t, e) => ({
63
63
  bucket: t.bucket,
64
64
  label: f(t.bucket, o),
@@ -68,12 +68,12 @@ function T({
68
68
  }))
69
69
  })),
70
70
  [a.series, s, o]
71
- ), L = p.every((t) => s.every((e) => t[e.key] === 0)), k = l ? "#94a3b8" : "#64748b";
72
- return /* @__PURE__ */ b("div", { children: [
73
- /* @__PURE__ */ r("ul", { className: "mb-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: s.map((t) => /* @__PURE__ */ b("li", { className: "inline-flex items-center gap-1.5", children: [
71
+ ), L = k.every((t) => s.every((e) => t[e.key] === 0)), x = l ? "#94a3b8" : "#64748b";
72
+ return /* @__PURE__ */ p("div", { children: [
73
+ /* @__PURE__ */ r("ul", { className: "mb-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: s.map((t) => /* @__PURE__ */ p("li", { className: "inline-flex items-center gap-1.5", children: [
74
74
  /* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-sm", style: { background: t.color }, "aria-hidden": !0 }),
75
75
  t.label,
76
- /* @__PURE__ */ r("span", { className: "tabular-nums text-slate-400 dark:text-muted-foreground/70", children: y(t.cells.reduce((e, i) => e + i.n, 0)) })
76
+ /* @__PURE__ */ r("span", { className: "tabular-nums text-slate-400 dark:text-muted-foreground/70", children: h(t.cells.reduce((e, i) => e + i.n, 0)) })
77
77
  ] }, t.key)) }),
78
78
  L ? /* @__PURE__ */ r(
79
79
  "p",
@@ -82,10 +82,10 @@ function T({
82
82
  style: { height: d },
83
83
  children: n === "notifications" ? "No notifications in this window." : "No email in this window."
84
84
  }
85
- ) : /* @__PURE__ */ r("div", { style: { height: d }, role: "img", "aria-label": `${n} per ${o}`, children: /* @__PURE__ */ r(E, { fallback: /* @__PURE__ */ r($, { className: "h-full w-full", "aria-busy": "true" }), children: (t) => /* @__PURE__ */ r(t.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ b(
85
+ ) : /* @__PURE__ */ r("div", { style: { height: d }, role: "img", "aria-label": `${n} per ${o}`, children: /* @__PURE__ */ r(E, { fallback: /* @__PURE__ */ r($, { className: "h-full w-full", "aria-busy": "true" }), children: (t) => /* @__PURE__ */ r(t.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ p(
86
86
  t.BarChart,
87
87
  {
88
- data: p,
88
+ data: k,
89
89
  margin: { top: 4, right: 4, left: 0, bottom: 0 },
90
90
  barCategoryGap: "18%",
91
91
  children: [
@@ -94,7 +94,7 @@ function T({
94
94
  t.XAxis,
95
95
  {
96
96
  dataKey: "label",
97
- tick: { fontSize: 10.5, fill: k },
97
+ tick: { fontSize: 10.5, fill: x },
98
98
  tickLine: !1,
99
99
  axisLine: !1,
100
100
  interval: "preserveStartEnd",
@@ -104,7 +104,7 @@ function T({
104
104
  /* @__PURE__ */ r(
105
105
  t.YAxis,
106
106
  {
107
- tick: { fontSize: 10.5, fill: k },
107
+ tick: { fontSize: 10.5, fill: x },
108
108
  tickLine: !1,
109
109
  axisLine: !1,
110
110
  allowDecimals: !1,
@@ -125,7 +125,7 @@ function T({
125
125
  formatter: (e, i) => {
126
126
  var c;
127
127
  return [
128
- y(Number(e)),
128
+ h(Number(e)),
129
129
  ((c = s.find((u) => u.key === i)) == null ? void 0 : c.label) ?? String(i)
130
130
  ];
131
131
  }
@@ -138,11 +138,11 @@ function T({
138
138
  stackId: "a",
139
139
  fill: e.color,
140
140
  radius: i === s.length - 1 ? [2, 2, 0, 0] : 0,
141
- cursor: "pointer",
141
+ cursor: m ? "pointer" : "default",
142
142
  isAnimationActive: !1,
143
143
  onClick: (c, u) => {
144
- const m = e.cells[u], x = a.series[u];
145
- m && m.n > 0 && x && w(m, e.drillLabel(x.bucket));
144
+ const b = e.cells[u], g = a.series[u];
145
+ m && b && b.n > 0 && g && m(b, e.drillLabel(g.bucket));
146
146
  }
147
147
  },
148
148
  e.key