@nivaro/react 0.3.57 → 0.3.58

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 (50) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +5 -1
  4. package/dist/shared/components/CollectionBrowserView.js +2633 -2590
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  40. package/dist/shared/components/queue/QueueWorklist.js +357 -358
  41. package/dist/shared/components/queue/group-sums.js +27 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  43. package/dist/shared/lib/back-closes.js +25 -0
  44. package/dist/shared/lib/form-usage-beacon.js +7 -7
  45. package/dist/shared/lib/list-page-memory.js +41 -0
  46. package/dist/shared/lib/live.js +44 -44
  47. package/dist/shared/lib/own-writes.js +76 -28
  48. package/dist/shared/lib/request-gate.js +110 -109
  49. package/dist/shared/lib/validation-rules.js +34 -19
  50. package/package.json +1 -1
@@ -1,22 +1,22 @@
1
1
  import { jsxs as a, jsx as r, Fragment as A } from "react/jsx-runtime";
2
- import { AlertOctagon as F, AlertTriangle as O, ChevronRight as B, Loader2 as M, ChevronDown as W, ExternalLink as G } from "lucide-react";
3
- import { useState as L, useMemo as V, useId as X, useRef as q } from "react";
4
- import { useItemEditAuth as H } from "../../../context.js";
5
- import { userErrorMessage as I } from "../../../lib/safe-error.js";
6
- import { cn as x, titleCase as J } from "../../../lib/utils.js";
7
- import { ExplainButton as Q } from "../../ai/ExplainButton.js";
8
- import { useDrillWindows as Y, DrillTag as Z } from "../../chaos/DrillTag.js";
9
- import { useSignalAction as ee, useDismissRows as te, useSnooze as ne } from "./api.js";
10
- import { canDrill as re, RowDrill as oe } from "./drill/index.js";
11
- import { SnoozeMenu as R, DismissButton as ie } from "./SnoozeMenu.js";
12
- import { TONE_FILL as se, TONE_TEXT as T, agoText as ae, exactTime as U, TONE_SOFT as le, ageOf as de } from "./tone.js";
13
- const ce = ["retry_submission", "extension"], ue = (t) => t.kind === "extension" ? j(t) : t.kind, j = (t) => `${t.kind}:${t.id ?? ""}`;
14
- function me(t) {
2
+ import { AlertOctagon as O, AlertTriangle as W, ChevronRight as I, 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";
5
+ import { userErrorMessage as P } 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
15
  let e = null;
16
16
  for (const m of t.rows) (!e || m.first_seen < e) && (e = m.first_seen);
17
17
  return e;
18
18
  }
19
- function _e({
19
+ function De({
20
20
  signal: t,
21
21
  expanded: e,
22
22
  onToggle: m,
@@ -24,7 +24,7 @@ function _e({
24
24
  onExplain: p,
25
25
  canExplain: l
26
26
  }) {
27
- const h = t.severity === "critical", v = h ? "negative" : "warning", S = h ? F : O, y = me(t), z = Y(), $ = t.rows.reduce(
27
+ const h = t.severity === "critical", v = h ? "negative" : "warning", S = h ? O : W, y = pe(t), z = Z(), $ = t.rows.reduce(
28
28
  (N, D) => !N || D.first_seen > N ? D.first_seen : N,
29
29
  null
30
30
  ), k = t.rows[0], [b, C] = L(!1), _ = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
@@ -49,7 +49,7 @@ function _e({
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
- le[v]
52
+ de[v]
53
53
  ),
54
54
  "data-tip": h ? "Critical — something is failing now" : "Worth a look",
55
55
  children: /* @__PURE__ */ r(S, { className: x("h-3.5 w-3.5", T[v]), "aria-hidden": !0 })
@@ -58,14 +58,14 @@ function _e({
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
60
  /* @__PURE__ */ r("span", { className: "text-[13.5px] font-semibold text-foreground", children: t.label }),
61
- $ && /* @__PURE__ */ r(Z, { windows: z, at: $, className: "self-center" }),
61
+ $ && /* @__PURE__ */ r(ee, { windows: z, at: $, className: "self-center" }),
62
62
  t.error ? /* @__PURE__ */ r("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
63
  /* @__PURE__ */ r("span", { className: x("font-semibold", T[v]), children: t.count }),
64
64
  " open",
65
- y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${U(y)}`, children: [
65
+ y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${j(y)}`, children: [
66
66
  " ",
67
67
  "· oldest ",
68
- de(y)
68
+ ce(y)
69
69
  ] }),
70
70
  t.snoozed.length > 0 && /* @__PURE__ */ a(A, { children: [
71
71
  " · ",
@@ -74,10 +74,10 @@ function _e({
74
74
  ] })
75
75
  ] })
76
76
  ] }),
77
- /* @__PURE__ */ r("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${k.detail}` : ""}` : t.description })
77
+ /* @__PURE__ */ r("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 })
78
78
  ] }),
79
79
  /* @__PURE__ */ r(
80
- B,
80
+ I,
81
81
  {
82
82
  className: x(
83
83
  "mt-1 h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200",
@@ -96,7 +96,7 @@ function _e({
96
96
  ] }) : /* @__PURE__ */ a(A, { children: [
97
97
  /* @__PURE__ */ r("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
98
98
  /* @__PURE__ */ r(
99
- pe,
99
+ fe,
100
100
  {
101
101
  signal: t,
102
102
  rows: t.rows,
@@ -124,7 +124,7 @@ function _e({
124
124
  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
125
  children: [
126
126
  /* @__PURE__ */ r(
127
- B,
127
+ I,
128
128
  {
129
129
  className: x("h-3.5 w-3.5 transition-transform", b && "rotate-90")
130
130
  }
@@ -135,21 +135,21 @@ function _e({
135
135
  ]
136
136
  }
137
137
  ),
138
- b && /* @__PURE__ */ r(he, { signal: t })
138
+ b && /* @__PURE__ */ r(be, { signal: t })
139
139
  ] })
140
140
  ] })
141
141
  ]
142
142
  }
143
143
  );
144
144
  }
145
- function pe({
145
+ function fe({
146
146
  signal: t,
147
147
  rows: e,
148
148
  onOpenRecord: m,
149
149
  onExplain: g,
150
150
  canExplain: p
151
151
  }) {
152
- const l = ee(), h = te(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = V(() => {
152
+ const l = te(), h = ne(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = X(() => {
153
153
  if (!e.some((s) => s.group)) return null;
154
154
  const o = /* @__PURE__ */ new Map();
155
155
  for (const s of e) {
@@ -169,7 +169,7 @@ function pe({
169
169
  return u;
170
170
  }), k((n) => new Set([...n].filter((u) => !i.includes(u))));
171
171
  } catch (c) {
172
- const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? I(c, "The action failed");
172
+ const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? P(c, "The action failed");
173
173
  S((u) => {
174
174
  const f = { ...u };
175
175
  for (const w of i) f[w] = { key: w, ok: !1, message: n };
@@ -185,7 +185,7 @@ function pe({
185
185
  try {
186
186
  await h.mutateAsync({ signal: t.id, row_keys: s }), k((d) => new Set([...d].filter((c) => !s.includes(c))));
187
187
  } catch (d) {
188
- const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? I(d, "Could not dismiss");
188
+ const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? P(d, "Could not dismiss");
189
189
  S((n) => {
190
190
  const u = { ...n };
191
191
  for (const f of s) u[f] = { key: f, ok: !1, message: c };
@@ -207,7 +207,7 @@ function pe({
207
207
  }
208
208
  C(o, [s]);
209
209
  }, D = (o, s) => /* @__PURE__ */ r(
210
- fe,
210
+ he,
211
211
  {
212
212
  signal: t,
213
213
  row: o,
@@ -267,12 +267,12 @@ function pe({
267
267
  for (const n of s) {
268
268
  const u = /* @__PURE__ */ new Set();
269
269
  for (const f of n.actions) {
270
- if (!ce.includes(f.kind)) continue;
271
- const w = ue(f);
270
+ if (!ue.includes(f.kind)) continue;
271
+ const w = me(f);
272
272
  if (u.has(w)) continue;
273
273
  u.add(w);
274
- const K = d.get(w) ?? { action: f, rows: [] };
275
- K.rows.push(n), d.set(w, K);
274
+ const B = d.get(w) ?? { action: f, rows: [] };
275
+ B.rows.push(n), d.set(w, B);
276
276
  }
277
277
  }
278
278
  const c = s.some((n) => y.has(n.key));
@@ -333,7 +333,7 @@ function pe({
333
333
  }
334
334
  ),
335
335
  /* @__PURE__ */ r(
336
- R,
336
+ U,
337
337
  {
338
338
  signal: t.id,
339
339
  signalLabel: t.label,
@@ -347,10 +347,10 @@ function pe({
347
347
  ] }, o.key);
348
348
  }) });
349
349
  }
350
- function P(t) {
351
- return t.label ? t.label : `${J(t.collection).replace(/s$/, "")} ${t.id}`;
350
+ function E(t) {
351
+ return t.label ? t.label : `${Q(t.collection).replace(/s$/, "")} ${t.id}`;
352
352
  }
353
- function fe({
353
+ function he({
354
354
  signal: t,
355
355
  row: e,
356
356
  result: m,
@@ -365,7 +365,7 @@ function fe({
365
365
  var i, d, c;
366
366
  const z = e.since ?? e.first_seen, $ = e.actions.filter(
367
367
  (n) => !(n.kind === "open" && e.record) && !(n.kind === "explain" && (y == null ? void 0 : y(n)) === !1)
368
- ), { isAdmin: k } = H(), [b, C] = L(!1), _ = X(), N = q(null), D = re(e.drill), o = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
368
+ ), { isAdmin: k } = J(), [b, C] = L(!1), _ = q(), N = H(null), D = oe(e.drill), o = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
369
369
  var u;
370
370
  return n.kind === "retry_submission" && n.id === ((u = e.drill) == null ? void 0 : u.id);
371
371
  }) : void 0, s = () => {
@@ -397,12 +397,12 @@ function fe({
397
397
  "p",
398
398
  {
399
399
  className: "mt-0.5 line-clamp-2 break-words text-[12px] leading-snug text-muted-foreground",
400
- "data-tip": e.detail.length > 140 ? e.detail.slice(0, 900) : void 0,
401
- children: e.detail
400
+ "data-tip": e.detail.length > 140 || K(e.detail) !== e.detail.trim() ? e.detail.slice(0, 900) : void 0,
401
+ children: K(e.detail)
402
402
  }
403
403
  ),
404
404
  /* @__PURE__ */ r(
405
- E,
405
+ R,
406
406
  {
407
407
  since: z,
408
408
  record: e.record,
@@ -425,7 +425,7 @@ function fe({
425
425
  {
426
426
  className: x(
427
427
  "mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full",
428
- se[m.ok ? "positive" : "negative"]
428
+ ae[m.ok ? "positive" : "negative"]
429
429
  )
430
430
  }
431
431
  ),
@@ -435,7 +435,7 @@ function fe({
435
435
  )
436
436
  ] }),
437
437
  /* @__PURE__ */ r(
438
- E,
438
+ R,
439
439
  {
440
440
  since: z,
441
441
  record: e.record,
@@ -464,7 +464,7 @@ function fe({
464
464
  children: [
465
465
  "Details",
466
466
  /* @__PURE__ */ r(
467
- W,
467
+ G,
468
468
  {
469
469
  className: x(
470
470
  "h-3 w-3 transition-transform duration-200",
@@ -489,11 +489,11 @@ function fe({
489
489
  n.label
490
490
  ]
491
491
  },
492
- j(n)
492
+ F(n)
493
493
  )),
494
- /* @__PURE__ */ r(ie, { signal: t.id, rowKey: e.key }),
494
+ /* @__PURE__ */ r(se, { signal: t.id, rowKey: e.key }),
495
495
  /* @__PURE__ */ r(
496
- R,
496
+ U,
497
497
  {
498
498
  signal: t.id,
499
499
  signalLabel: t.label,
@@ -505,7 +505,7 @@ function fe({
505
505
  ] })
506
506
  ] }),
507
507
  k && /* @__PURE__ */ r("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": e.key, children: /* @__PURE__ */ r(
508
- Q,
508
+ Y,
509
509
  {
510
510
  kind: "signal-row",
511
511
  params: { signal: t.id, row_key: e.key },
@@ -523,7 +523,7 @@ function fe({
523
523
  },
524
524
  className: "border-t border-border pb-4 pl-11 pr-4 pt-3",
525
525
  children: /* @__PURE__ */ r(
526
- oe,
526
+ ie,
527
527
  {
528
528
  drill: e.drill,
529
529
  onOpenRecord: S,
@@ -537,7 +537,7 @@ function fe({
537
537
  }
538
538
  );
539
539
  }
540
- function E({
540
+ function R({
541
541
  since: t,
542
542
  record: e,
543
543
  onOpenRecord: m,
@@ -545,9 +545,9 @@ function E({
545
545
  stacked: p
546
546
  }) {
547
547
  return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground", g), children: [
548
- /* @__PURE__ */ a("span", { "data-tip": U(t), className: "tabular-nums", children: [
548
+ /* @__PURE__ */ a("span", { "data-tip": j(t), className: "tabular-nums", children: [
549
549
  "Since ",
550
- ae(t)
550
+ le(t)
551
551
  ] }),
552
552
  e && /* @__PURE__ */ a(A, { children: [
553
553
  !p && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "·" }),
@@ -559,16 +559,16 @@ function E({
559
559
  onClick: () => m(e.collection, e.id),
560
560
  className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground",
561
561
  children: [
562
- P(e),
563
- /* @__PURE__ */ r(G, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
562
+ E(e),
563
+ /* @__PURE__ */ r(V, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
564
564
  ]
565
565
  }
566
- ) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: P(e) })
566
+ ) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: E(e) })
567
567
  ] })
568
568
  ] });
569
569
  }
570
- function he({ signal: t }) {
571
- const { remove: e } = ne(), m = /* @__PURE__ */ new Map();
570
+ function be({ signal: t }) {
571
+ const { remove: e } = re(), m = /* @__PURE__ */ new Map();
572
572
  for (const p of t.snoozed) {
573
573
  if (!p.snooze) continue;
574
574
  const l = m.get(p.snooze.id) ?? [];
@@ -608,6 +608,6 @@ function he({ signal: t }) {
608
608
  }) });
609
609
  }
610
610
  export {
611
- _e as SignalCard,
612
- me as oldestSeen
611
+ De as SignalCard,
612
+ pe as oldestSeen
613
613
  };
@@ -1,56 +1,78 @@
1
- const g = {
1
+ const d = {
2
2
  negative: "text-[color:var(--nvr-role-negative,#dc2626)] dark:text-[color:var(--nvr-role-negative-dark,#e08383)]",
3
3
  warning: "text-[color:var(--nvr-role-warning,#b45309)] dark:text-[color:var(--nvr-role-warning-dark,#d4936a)]",
4
4
  positive: "text-[color:var(--nvr-role-positive,#15803d)] dark:text-[color:var(--nvr-role-positive-dark,#9fbf8a)]",
5
5
  info: "text-[color:var(--nvr-role-info,#4f46e5)] dark:text-[color:var(--nvr-role-info-dark,#8fa6c9)]",
6
6
  neutral: "text-muted-foreground"
7
- }, s = {
7
+ }, f = {
8
8
  negative: "bg-[color:color-mix(in_srgb,var(--nvr-role-negative,#dc2626)_9%,transparent)] dark:bg-[color:color-mix(in_srgb,var(--nvr-role-negative-dark,#e08383)_14%,transparent)]",
9
9
  warning: "bg-[color:color-mix(in_srgb,var(--nvr-role-warning,#b45309)_9%,transparent)] dark:bg-[color:color-mix(in_srgb,var(--nvr-role-warning-dark,#d4936a)_14%,transparent)]",
10
10
  positive: "bg-[color:color-mix(in_srgb,var(--nvr-role-positive,#15803d)_9%,transparent)] dark:bg-[color:color-mix(in_srgb,var(--nvr-role-positive-dark,#9fbf8a)_14%,transparent)]",
11
11
  info: "bg-[color:color-mix(in_srgb,var(--nvr-role-info,#4f46e5)_8%,transparent)] dark:bg-[color:color-mix(in_srgb,var(--nvr-role-info-dark,#8fa6c9)_14%,transparent)]",
12
12
  neutral: "bg-muted"
13
- }, d = {
13
+ }, b = {
14
14
  negative: "bg-[color:var(--nvr-role-negative,#dc2626)] dark:bg-[color:var(--nvr-role-negative-dark,#e08383)]",
15
15
  warning: "bg-[color:var(--nvr-role-warning,#b45309)] dark:bg-[color:var(--nvr-role-warning-dark,#d4936a)]",
16
16
  positive: "bg-[color:var(--nvr-role-positive,#15803d)] dark:bg-[color:var(--nvr-role-positive-dark,#9fbf8a)]",
17
17
  info: "bg-[color:var(--nvr-role-info,#4f46e5)] dark:bg-[color:var(--nvr-role-info-dark,#8fa6c9)]",
18
18
  neutral: "bg-muted-foreground/40"
19
- }, b = {
19
+ }, m = {
20
20
  negative: "border-[color:color-mix(in_srgb,var(--nvr-role-negative,#dc2626)_35%,transparent)] dark:border-[color:color-mix(in_srgb,var(--nvr-role-negative-dark,#e08383)_35%,transparent)]",
21
21
  warning: "border-[color:color-mix(in_srgb,var(--nvr-role-warning,#b45309)_35%,transparent)] dark:border-[color:color-mix(in_srgb,var(--nvr-role-warning-dark,#d4936a)_35%,transparent)]"
22
22
  };
23
- function c(o, r = Date.now()) {
24
- if (!o) return null;
25
- const l = new Date(o).getTime();
26
- if (Number.isNaN(l)) return null;
27
- const n = Math.max(0, Math.floor((r - l) / 6e4));
28
- if (n < 1) return "just now";
29
- if (n < 60) return `${n}m`;
30
- const e = Math.floor(n / 60);
31
- if (e < 48) return `${e}h`;
32
- const t = Math.floor(e / 24);
33
- if (t < 60) return `${t}d`;
34
- const a = Math.floor(t / 30.44);
23
+ function v(n, r = Date.now()) {
24
+ if (!n) return null;
25
+ const e = new Date(n).getTime();
26
+ if (Number.isNaN(e)) return null;
27
+ const o = Math.max(0, Math.floor((r - e) / 6e4));
28
+ if (o < 1) return "just now";
29
+ if (o < 60) return `${o}m`;
30
+ const t = Math.floor(o / 60);
31
+ if (t < 48) return `${t}h`;
32
+ const i = Math.floor(t / 24);
33
+ if (i < 60) return `${i}d`;
34
+ const a = Math.floor(i / 30.44);
35
35
  if (a < 24) return `${a}mo`;
36
- const i = Math.floor(a / 12), v = a - i * 12;
37
- return v > 0 ? `${i}y ${v}mo` : `${i}y`;
36
+ const l = Math.floor(a / 12), c = a - l * 12;
37
+ return c > 0 ? `${l}y ${c}mo` : `${l}y`;
38
38
  }
39
- function f(o) {
40
- const r = c(o);
39
+ function u(n) {
40
+ const r = v(n);
41
41
  return r ? r === "just now" ? r : `${r} ago` : "never";
42
42
  }
43
- function u(o) {
44
- if (!o) return "";
45
- const r = new Date(o);
43
+ function _(n) {
44
+ if (!n) return "";
45
+ const r = new Date(n);
46
46
  return Number.isNaN(r.getTime()) ? "" : `${r.toLocaleString()} · ${r.toISOString()}`;
47
47
  }
48
+ const g = /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?/g, s = /:?\s*\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
49
+ function p(n) {
50
+ let r = String(n ?? "").trim();
51
+ if (!r) return "";
52
+ if (r.startsWith("{") && r.endsWith("}"))
53
+ try {
54
+ const e = JSON.parse(r), o = e.message ?? e.error ?? e.detail;
55
+ typeof o == "string" && o.trim() && (r = o.trim().replace(/\s*-\s*$/, ""));
56
+ } catch {
57
+ }
58
+ return r = r.replace(g, (e) => {
59
+ const o = new Date(e);
60
+ return Number.isNaN(o.getTime()) ? e : o.toLocaleString("en-US", {
61
+ month: "short",
62
+ day: "numeric",
63
+ year: "numeric",
64
+ hour: "numeric",
65
+ minute: "2-digit"
66
+ });
67
+ }), r.replace(s, "").replace(/\s{2,}/g, " ").trim();
68
+ }
48
69
  export {
49
- b as TONE_BORDER,
50
- d as TONE_FILL,
51
- s as TONE_SOFT,
52
- g as TONE_TEXT,
53
- c as ageOf,
54
- f as agoText,
55
- u as exactTime
70
+ m as TONE_BORDER,
71
+ b as TONE_FILL,
72
+ f as TONE_SOFT,
73
+ d as TONE_TEXT,
74
+ v as ageOf,
75
+ u as agoText,
76
+ _ as exactTime,
77
+ p as plainDetail
56
78
  };