@photon-ai/pho-ui 4.26.0 → 4.27.1

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 (128) hide show
  1. package/README.md +2 -2
  2. package/dist/chunks/{avatar-PgBOfszL.js → avatar-BJvgi8ON.js} +24 -30
  3. package/dist/chunks/avatar-BJvgi8ON.js.map +1 -0
  4. package/dist/chunks/{basic-page-aep8pM4s.js → basic-page-DSPzDKrZ.js} +79 -82
  5. package/dist/chunks/basic-page-DSPzDKrZ.js.map +1 -0
  6. package/dist/chunks/{box-search-CMl5bQ7Y.js → box-search-DD2EPtDy.js} +18 -19
  7. package/dist/chunks/box-search-DD2EPtDy.js.map +1 -0
  8. package/dist/chunks/{calendar-DDWITGo4.js → calendar-s-QRks1Z.js} +66 -69
  9. package/dist/chunks/calendar-s-QRks1Z.js.map +1 -0
  10. package/dist/chunks/{chat-D98GCjbe.js → chat-D6SGRahp.js} +226 -276
  11. package/dist/chunks/chat-D6SGRahp.js.map +1 -0
  12. package/dist/chunks/{checkbox-D8smFViR.js → checkbox-B3fVczYP.js} +2 -2
  13. package/dist/chunks/checkbox-B3fVczYP.js.map +1 -0
  14. package/dist/chunks/{close-button-Ck4rY1Fp.js → close-button-Bwv_OoCZ.js} +2 -2
  15. package/dist/chunks/close-button-Bwv_OoCZ.js.map +1 -0
  16. package/dist/chunks/{code-block-CthLWfxd.js → code-block-CiZWZBO2.js} +169 -238
  17. package/dist/chunks/code-block-CiZWZBO2.js.map +1 -0
  18. package/dist/chunks/copy-button-DNNZu6r4.js +69 -0
  19. package/dist/chunks/copy-button-DNNZu6r4.js.map +1 -0
  20. package/dist/chunks/{data-table-C1tLUdw0.js → data-table-CshUlqIu.js} +11 -12
  21. package/dist/chunks/data-table-CshUlqIu.js.map +1 -0
  22. package/dist/chunks/{date-picker-D-sWo3i8.js → date-picker-BaAkim2u.js} +126 -151
  23. package/dist/chunks/date-picker-BaAkim2u.js.map +1 -0
  24. package/dist/chunks/{description-list-DcTvBHzI.js → description-list-VTNz1MmJ.js} +2 -2
  25. package/dist/chunks/{description-list-DcTvBHzI.js.map → description-list-VTNz1MmJ.js.map} +1 -1
  26. package/dist/chunks/{dialog-H72fZGtf.js → dialog-C116Qr0w.js} +2 -2
  27. package/dist/chunks/{dialog-H72fZGtf.js.map → dialog-C116Qr0w.js.map} +1 -1
  28. package/dist/chunks/{filter-bar-D_sBAT5Y.js → filter-bar-DI5JO1Cd.js} +63 -72
  29. package/dist/chunks/filter-bar-DI5JO1Cd.js.map +1 -0
  30. package/dist/chunks/{ghost-search-CMUI2UH0.js → ghost-search-DhADxaWi.js} +11 -12
  31. package/dist/chunks/ghost-search-DhADxaWi.js.map +1 -0
  32. package/dist/chunks/icons-eq5FZ3Yc.js +1254 -0
  33. package/dist/chunks/icons-eq5FZ3Yc.js.map +1 -0
  34. package/dist/chunks/{input-DWnb33UF.js → input-hrrPhzXp.js} +37 -56
  35. package/dist/chunks/input-hrrPhzXp.js.map +1 -0
  36. package/dist/chunks/{message-DRAWQlW-.js → message-DO-zoM2w.js} +7 -8
  37. package/dist/chunks/message-DO-zoM2w.js.map +1 -0
  38. package/dist/chunks/{select-Dux2SBVc.js → select-DlyDd7AB.js} +10 -10
  39. package/dist/chunks/select-DlyDd7AB.js.map +1 -0
  40. package/dist/chunks/{sidebar-ttBkgGRh.js → sidebar-DTRcoxrB.js} +95 -111
  41. package/dist/chunks/sidebar-DTRcoxrB.js.map +1 -0
  42. package/dist/chunks/{toast-Cbnn8lcA.js → toast-Btwu5Kjk.js} +7 -7
  43. package/dist/chunks/toast-Btwu5Kjk.js.map +1 -0
  44. package/dist/chunks/{trace-ClMpG82z.js → trace-CKYAff2U.js} +498 -607
  45. package/dist/chunks/trace-CKYAff2U.js.map +1 -0
  46. package/dist/components/avatar.js +1 -1
  47. package/dist/components/button.js +1 -1
  48. package/dist/components/calendar.js +1 -1
  49. package/dist/components/chat.js +1 -1
  50. package/dist/components/checkbox.js +1 -1
  51. package/dist/components/code-block.js +1 -1
  52. package/dist/components/command.js +36 -37
  53. package/dist/components/command.js.map +1 -1
  54. package/dist/components/copy-button.js +1 -1
  55. package/dist/components/data-table.js +2 -2
  56. package/dist/components/date-picker.js +1 -1
  57. package/dist/components/description-list.js +1 -1
  58. package/dist/components/dialog.js +1 -1
  59. package/dist/components/error.js +252 -11
  60. package/dist/components/error.js.map +1 -0
  61. package/dist/components/filter-bar.js +1 -1
  62. package/dist/components/input.js +1 -1
  63. package/dist/components/message.js +1 -1
  64. package/dist/components/notification.js +27 -34
  65. package/dist/components/notification.js.map +1 -1
  66. package/dist/components/phone-input.js +3 -4
  67. package/dist/components/phone-input.js.map +1 -1
  68. package/dist/components/scope.js +52 -53
  69. package/dist/components/scope.js.map +1 -1
  70. package/dist/components/select.js +1 -1
  71. package/dist/components/theme-toggle.js +69 -95
  72. package/dist/components/theme-toggle.js.map +1 -1
  73. package/dist/components/toast.js +1 -1
  74. package/dist/components/trace.js +1 -1
  75. package/dist/icons.js +235 -78
  76. package/dist/icons.js.map +1 -1
  77. package/dist/index.js +158 -158
  78. package/dist/sections/basic-page.js +2 -2
  79. package/dist/sections/sidebar.js +1 -1
  80. package/dist/src/components/avatar/avatar.d.ts +1 -1
  81. package/dist/src/components/message/message-status.d.ts +7 -8
  82. package/dist/src/components/notification/notification.d.ts +2 -2
  83. package/dist/src/components/trace/decorations.d.ts +3 -3
  84. package/dist/src/icons/index.d.ts +1 -0
  85. package/dist/src/icons/photon/icons.d.ts +315 -0
  86. package/dist/src/icons/photon/index.d.ts +2 -0
  87. package/dist/src/icons/photon/photon-icon.d.ts +51 -0
  88. package/package.json +5 -3
  89. package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js +0 -14
  90. package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +0 -1
  91. package/dist/chunks/IconCheck-DwSMn1wK.js +0 -11
  92. package/dist/chunks/IconCheck-DwSMn1wK.js.map +0 -1
  93. package/dist/chunks/IconChevronDown-Cd68NnX2.js +0 -11
  94. package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +0 -1
  95. package/dist/chunks/IconChevronLeft-CptqhdxO.js +0 -11
  96. package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +0 -1
  97. package/dist/chunks/IconChevronRight-BNkXCTk6.js +0 -11
  98. package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +0 -1
  99. package/dist/chunks/IconChevronUp-Bxllwz8J.js +0 -11
  100. package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +0 -1
  101. package/dist/chunks/IconInfoCircle-CTAynhe8.js +0 -21
  102. package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +0 -1
  103. package/dist/chunks/IconSearch-DkcWWZ1H.js +0 -14
  104. package/dist/chunks/IconSearch-DkcWWZ1H.js.map +0 -1
  105. package/dist/chunks/IconX-DnPlFC68.js +0 -14
  106. package/dist/chunks/IconX-DnPlFC68.js.map +0 -1
  107. package/dist/chunks/avatar-PgBOfszL.js.map +0 -1
  108. package/dist/chunks/basic-page-aep8pM4s.js.map +0 -1
  109. package/dist/chunks/box-search-CMl5bQ7Y.js.map +0 -1
  110. package/dist/chunks/calendar-DDWITGo4.js.map +0 -1
  111. package/dist/chunks/chat-D98GCjbe.js.map +0 -1
  112. package/dist/chunks/checkbox-D8smFViR.js.map +0 -1
  113. package/dist/chunks/close-button-Ck4rY1Fp.js.map +0 -1
  114. package/dist/chunks/code-block-CthLWfxd.js.map +0 -1
  115. package/dist/chunks/copy-button-BLvirhXk.js +0 -76
  116. package/dist/chunks/copy-button-BLvirhXk.js.map +0 -1
  117. package/dist/chunks/data-table-C1tLUdw0.js.map +0 -1
  118. package/dist/chunks/date-picker-D-sWo3i8.js.map +0 -1
  119. package/dist/chunks/error-BT71wcUd.js +0 -270
  120. package/dist/chunks/error-BT71wcUd.js.map +0 -1
  121. package/dist/chunks/filter-bar-D_sBAT5Y.js.map +0 -1
  122. package/dist/chunks/ghost-search-CMUI2UH0.js.map +0 -1
  123. package/dist/chunks/input-DWnb33UF.js.map +0 -1
  124. package/dist/chunks/message-DRAWQlW-.js.map +0 -1
  125. package/dist/chunks/select-Dux2SBVc.js.map +0 -1
  126. package/dist/chunks/sidebar-ttBkgGRh.js.map +0 -1
  127. package/dist/chunks/toast-Cbnn8lcA.js.map +0 -1
  128. package/dist/chunks/trace-ClMpG82z.js.map +0 -1
@@ -1,63 +1,28 @@
1
1
  "use client";
2
- import { t as S } from "./cn-CPbhpG1q.js";
3
- import { t as j } from "./createReactComponent-yKZn9MIX.js";
4
- import { t as Ie } from "./IconChevronDown-Cd68NnX2.js";
5
- import { t as He } from "./IconChevronRight-BNkXCTk6.js";
6
- import { t as Te } from "./IconChevronUp-Bxllwz8J.js";
7
- import { t as Ze } from "./IconX-DnPlFC68.js";
8
- import { t as ge } from "./collapsible-CR4QWjFh.js";
2
+ import { t as M } from "./cn-CPbhpG1q.js";
3
+ import { F as Te, Ft as He, G as Ze, K as Je, L as Ye, M as _e, O as Qe, P as qe, b as et, f as tt, ut as nt } from "./icons-eq5FZ3Yc.js";
4
+ import { t as ce } from "./createReactComponent-yKZn9MIX.js";
5
+ import { t as ve } from "./collapsible-CR4QWjFh.js";
9
6
  import { t as he } from "./skeleton-CqZlGphn.js";
10
- import { i as Je, n as Ye, r as Qe, t as qe } from "./chrome-Dyvv0FVf.js";
11
- import { t as et } from "./ghost-search-CMUI2UH0.js";
12
- import { i as tt, r as nt } from "./badge-CVViIYj_.js";
13
- import { createContext as de, useCallback as F, useContext as ue, useEffect as ae, useId as at, useMemo as O, useRef as fe, useState as Y } from "react";
7
+ import { i as at, n as rt, r as st, t as ot } from "./chrome-Dyvv0FVf.js";
8
+ import { t as it } from "./ghost-search-DhADxaWi.js";
9
+ import { i as lt, r as ct } from "./badge-CVViIYj_.js";
10
+ import { createContext as de, useCallback as F, useContext as ue, useEffect as ne, useId as dt, useMemo as O, useRef as fe, useState as J } from "react";
14
11
  import { Fragment as Ee, jsx as s, jsxs as N } from "react/jsx-runtime";
15
- import { useRender as q } from "@base-ui/react/use-render";
16
- var rt = [
17
- ["path", {
18
- d: "M5 12l14 0",
19
- key: "svg-0"
20
- }],
21
- ["path", {
22
- d: "M15 16l4 -4",
23
- key: "svg-1"
24
- }],
25
- ["path", {
26
- d: "M15 8l4 4",
27
- key: "svg-2"
28
- }]
29
- ], st = j("outline", "arrow-narrow-right", "ArrowNarrowRight", rt), ot = [["path", {
30
- d: "M7 10h14l-4 -4",
31
- key: "svg-0"
32
- }], ["path", {
33
- d: "M17 14h-14l4 4",
34
- key: "svg-1"
35
- }]], it = j("outline", "arrows-exchange", "ArrowsExchange", ot), lt = [["path", {
12
+ import { useRender as Q } from "@base-ui/react/use-render";
13
+ var ut = [["path", {
36
14
  d: "M7 7l5 5l5 -5",
37
15
  key: "svg-0"
38
16
  }], ["path", {
39
17
  d: "M7 13l5 5l5 -5",
40
18
  key: "svg-1"
41
- }]], ct = j("outline", "chevrons-down", "ChevronsDown", lt), dt = [["path", {
19
+ }]], pt = ce("outline", "chevrons-down", "ChevronsDown", ut), ht = [["path", {
42
20
  d: "M7 11l5 -5l5 5",
43
21
  key: "svg-0"
44
22
  }], ["path", {
45
23
  d: "M7 17l5 -5l5 5",
46
24
  key: "svg-1"
47
- }]], ut = j("outline", "chevrons-up", "ChevronsUp", dt), pt = [
48
- ["path", {
49
- d: "M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",
50
- key: "svg-0"
51
- }],
52
- ["path", {
53
- d: "M4 6v6a8 3 0 0 0 16 0v-6",
54
- key: "svg-1"
55
- }],
56
- ["path", {
57
- d: "M4 12v6a8 3 0 0 0 16 0v-6",
58
- key: "svg-2"
59
- }]
60
- ], ht = j("outline", "database", "Database", pt), mt = [
25
+ }]], mt = ce("outline", "chevrons-up", "ChevronsUp", ht), ft = [
61
26
  ["path", {
62
27
  d: "M14 3v4a1 1 0 0 0 1 1h4",
63
28
  key: "svg-0"
@@ -74,85 +39,11 @@ var rt = [
74
39
  d: "M18.5 19.5l2.5 2.5",
75
40
  key: "svg-3"
76
41
  }]
77
- ], ft = j("outline", "file-search", "FileSearch", mt), vt = [
78
- ["path", {
79
- d: "M8 9h8",
80
- key: "svg-0"
81
- }],
82
- ["path", {
83
- d: "M8 13h6",
84
- key: "svg-1"
85
- }],
86
- ["path", {
87
- d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",
88
- key: "svg-2"
89
- }]
90
- ], gt = j("outline", "message", "Message", vt), bt = [
91
- ["path", {
92
- d: "M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4",
93
- key: "svg-0"
94
- }],
95
- ["path", {
96
- d: "M12 2v2",
97
- key: "svg-1"
98
- }],
99
- ["path", {
100
- d: "M9 12v9",
101
- key: "svg-2"
102
- }],
103
- ["path", {
104
- d: "M15 12v9",
105
- key: "svg-3"
106
- }],
107
- ["path", {
108
- d: "M5 16l4 -2",
109
- key: "svg-4"
110
- }],
111
- ["path", {
112
- d: "M15 14l4 2",
113
- key: "svg-5"
114
- }],
115
- ["path", {
116
- d: "M9 18h6",
117
- key: "svg-6"
118
- }],
119
- ["path", {
120
- d: "M10 8v.01",
121
- key: "svg-7"
122
- }],
123
- ["path", {
124
- d: "M14 8v.01",
125
- key: "svg-8"
126
- }]
127
- ], xt = j("outline", "robot", "Robot", bt), yt = [["path", {
42
+ ], bt = ce("outline", "file-search", "FileSearch", ft), vt = [["path", {
128
43
  d: "M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",
129
44
  key: "svg-0"
130
- }]], be = j("outline", "sparkles", "Sparkles", yt), wt = [["path", {
131
- d: "M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",
132
- key: "svg-0"
133
- }]], Nt = j("outline", "tool", "Tool", wt), kt = [
134
- ["path", {
135
- d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
136
- key: "svg-0"
137
- }],
138
- ["path", {
139
- d: "M3.6 9h16.8",
140
- key: "svg-1"
141
- }],
142
- ["path", {
143
- d: "M3.6 15h16.8",
144
- key: "svg-2"
145
- }],
146
- ["path", {
147
- d: "M11.5 3a17 17 0 0 0 0 18",
148
- key: "svg-3"
149
- }],
150
- ["path", {
151
- d: "M12.5 3a17 17 0 0 1 0 18",
152
- key: "svg-4"
153
- }]
154
- ], Mt = j("outline", "world", "World", kt), xe = [0, 1], J = 1e-3, X = (e) => typeof e == "number" && Number.isFinite(e);
155
- function At(e) {
45
+ }]], ge = ce("outline", "sparkles", "Sparkles", vt), xe = [0, 1], Z = 1e-3, G = (e) => typeof e == "number" && Number.isFinite(e);
46
+ function gt(e) {
156
47
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
157
48
  for (const r of e.values()) r.parentSpanId != null && e.has(r.parentSpanId) ? t.set(r.id, r.parentSpanId) : (t.set(r.id, null), r.parentSpanId != null && n.add(r.id));
158
49
  const a = /* @__PURE__ */ new Set();
@@ -174,38 +65,38 @@ function At(e) {
174
65
  orphans: n
175
66
  };
176
67
  }
177
- function $e(e) {
178
- const t = new Map(e.map((h) => [h.id, h])), { parents: n, orphans: a } = At(t), r = /* @__PURE__ */ new Map();
68
+ function Pe(e) {
69
+ const t = new Map(e.map((h) => [h.id, h])), { parents: n, orphans: a } = gt(t), r = /* @__PURE__ */ new Map();
179
70
  for (const h of t.values()) {
180
- const g = n.get(h.id) ?? null, M = r.get(g) ?? [];
181
- M.push(h), r.set(g, M);
71
+ const v = n.get(h.id) ?? null, A = r.get(v) ?? [];
72
+ A.push(h), r.set(v, A);
182
73
  }
183
74
  let o = 1 / 0;
184
- for (const h of t.values()) X(h.startedAt) && h.startedAt < o && (o = h.startedAt);
75
+ for (const h of t.values()) G(h.startedAt) && h.startedAt < o && (o = h.startedAt);
185
76
  o === 1 / 0 && (o = 0);
186
- const l = (h, g) => {
187
- let M = !1, m = h.startedAt;
188
- X(m) || (m = g ?? o, M = !0);
189
- let b = h.endedAt;
190
- b != null && (!X(b) || b < m) && (b = m, M = !0);
191
- const k = X(h.latencyMs) && h.latencyMs >= 0 ? h.latencyMs : null;
77
+ const l = (h, v) => {
78
+ let A = !1, m = h.startedAt;
79
+ G(m) || (m = v ?? o, A = !0);
80
+ let g = h.endedAt;
81
+ g != null && (!G(g) || g < m) && (g = m, A = !0);
82
+ const k = G(h.latencyMs) && h.latencyMs >= 0 ? h.latencyMs : null;
192
83
  return {
193
84
  startedAt: m,
194
- endedAt: b,
85
+ endedAt: g,
195
86
  latencyMs: k,
196
- repaired: M
87
+ repaired: A
197
88
  };
198
89
  }, i = [], c = /* @__PURE__ */ new Map();
199
90
  let d = 0;
200
- const x = (h, g, M) => {
201
- const m = l(h, M), b = r.get(h.id) ?? [], k = {
91
+ const x = (h, v, A) => {
92
+ const m = l(h, A), g = r.get(h.id) ?? [], k = {
202
93
  ...h,
203
94
  parentSpanId: n.get(h.id) ?? null,
204
95
  startedAt: m.startedAt,
205
96
  endedAt: m.endedAt,
206
97
  latencyMs: m.latencyMs,
207
- depth: g,
208
- hasChildren: b.length > 0,
98
+ depth: v,
99
+ hasChildren: g.length > 0,
209
100
  isCollapsed: !1,
210
101
  descendants: 0,
211
102
  descendantErrors: 0,
@@ -214,23 +105,23 @@ function $e(e) {
214
105
  serverChildId: null
215
106
  };
216
107
  m.repaired && (d += 1), i.push(k), c.set(k.id, k);
217
- const y = b.map(($) => ({
218
- kid: $,
219
- start: X($.startedAt) ? $.startedAt : m.startedAt
108
+ const y = g.map((P) => ({
109
+ kid: P,
110
+ start: G(P.startedAt) ? P.startedAt : m.startedAt
220
111
  }));
221
- y.sort(($, E) => $.start - E.start);
222
- let T = 0, z = 0;
223
- for (const { kid: $ } of y) {
224
- const E = x($, g + 1, m.startedAt);
225
- T += 1 + E.descendants, z += (E.status === "failed" ? 1 : 0) + E.descendantErrors, k.kind === "client" && k.serverChildId == null && E.kind === "server" && (k.serverChildId = E.id);
112
+ y.sort((P, E) => P.start - E.start);
113
+ let _ = 0, L = 0;
114
+ for (const { kid: P } of y) {
115
+ const E = x(P, v + 1, m.startedAt);
116
+ _ += 1 + E.descendants, L += (E.status === "failed" ? 1 : 0) + E.descendantErrors, k.kind === "client" && k.serverChildId == null && E.kind === "server" && (k.serverChildId = E.id);
226
117
  }
227
- return k.descendants = T, k.descendantErrors = z, k;
228
- }, v = (r.get(null) ?? []).map((h) => ({
118
+ return k.descendants = _, k.descendantErrors = L, k;
119
+ }, b = (r.get(null) ?? []).map((h) => ({
229
120
  root: h,
230
- start: X(h.startedAt) ? h.startedAt : o
121
+ start: G(h.startedAt) ? h.startedAt : o
231
122
  }));
232
- v.sort((h, g) => h.start - g.start);
233
- for (const { root: h } of v) x(h, 0, null);
123
+ b.sort((h, v) => h.start - v.start);
124
+ for (const { root: h } of b) x(h, 0, null);
234
125
  return {
235
126
  spans: i,
236
127
  byId: c,
@@ -238,7 +129,7 @@ function $e(e) {
238
129
  repaired: d
239
130
  };
240
131
  }
241
- function Pe(e, t) {
132
+ function $e(e, t) {
242
133
  const n = [];
243
134
  let a = null;
244
135
  for (const r of e.spans) {
@@ -253,41 +144,41 @@ function Pe(e, t) {
253
144
  }
254
145
  return n;
255
146
  }
256
- function Zn(e, t = /* @__PURE__ */ new Set()) {
257
- return Pe($e(e), t);
147
+ function Fn(e, t = /* @__PURE__ */ new Set()) {
148
+ return $e(Pe(e), t);
258
149
  }
259
- function Ct(e, t) {
150
+ function xt(e, t) {
260
151
  const n = [];
261
152
  let a = e.get(t)?.parentSpanId ?? null;
262
153
  for (; a != null && !n.includes(a); )
263
154
  n.push(a), a = e.get(a)?.parentSpanId ?? null;
264
155
  return n;
265
156
  }
266
- function St(e) {
157
+ function yt(e) {
267
158
  return e.filter((t) => t.hasChildren).map((t) => t.id);
268
159
  }
269
- function _t(e, t) {
160
+ function wt(e, t) {
270
161
  return e.filter((n) => n.hasChildren).every((n) => t.has(n.id));
271
162
  }
272
- function It(e, t) {
163
+ function Nt(e, t) {
273
164
  const n = new Set(t);
274
165
  let a;
275
166
  for (const r of e) a && r.depth <= a.depth ? (n.add(a.id), a = r.hasChildren && !n.has(r.id) ? r : void 0) : r.hasChildren && !n.has(r.id) && (a = r);
276
167
  return a && n.add(a.id), Array.from(n);
277
168
  }
278
- function Tt(e, t) {
169
+ function kt(e, t) {
279
170
  const n = new Set(t);
280
171
  let a = -1, r = !0;
281
172
  for (const o of e)
282
173
  o.depth <= a && (r = !0), r && n.has(o.id) && (n.delete(o.id), r = !1, a = o.depth);
283
174
  return Array.from(n);
284
175
  }
285
- function Et(e, t) {
176
+ function At(e, t) {
286
177
  let n = 1 / 0, a = -1 / 0;
287
178
  for (const r of e) {
288
- if (!X(r.startedAt)) continue;
179
+ if (!G(r.startedAt)) continue;
289
180
  r.startedAt < n && (n = r.startedAt);
290
- const o = X(r.endedAt) ? r.endedAt : t ?? r.startedAt;
181
+ const o = G(r.endedAt) ? r.endedAt : t ?? r.startedAt;
291
182
  o > a && (a = o);
292
183
  }
293
184
  return n === 1 / 0 ? {
@@ -298,39 +189,39 @@ function Et(e, t) {
298
189
  max: Math.max(a, n)
299
190
  };
300
191
  }
301
- var le = (e) => Math.min(1, Math.max(0, e));
302
- function ie(e) {
192
+ var ie = (e) => Math.min(1, Math.max(0, e));
193
+ function oe(e) {
303
194
  let [t, n] = e;
304
- if (X(t) || (t = 0), X(n) || (n = 1), n < t && ([t, n] = [n, t]), t = le(t), n = le(n), n - t < 1e-3) {
195
+ if (G(t) || (t = 0), G(n) || (n = 1), n < t && ([t, n] = [n, t]), t = ie(t), n = ie(n), n - t < 1e-3) {
305
196
  const a = (t + n) / 2;
306
- t = le(a - J / 2), n = le(t + J), t = n - J;
197
+ t = ie(a - Z / 2), n = ie(t + Z), t = n - Z;
307
198
  }
308
199
  return [t, n];
309
200
  }
310
- function $t(e, t) {
201
+ function Ct(e, t) {
311
202
  const n = e.max - e.min;
312
203
  return {
313
204
  min: e.min + t[0] * n,
314
205
  max: e.min + t[1] * n
315
206
  };
316
207
  }
317
- function Pt(e, t, n = 0.5) {
318
- const [a, r] = e, o = r - a, l = Math.min(1, Math.max(J, o * t));
208
+ function St(e, t, n = 0.5) {
209
+ const [a, r] = e, o = r - a, l = Math.min(1, Math.max(Z, o * t));
319
210
  let i = a + n * o - n * l;
320
- return i = Math.min(Math.max(i, 0), 1 - l), ie([i, i + l]);
211
+ return i = Math.min(Math.max(i, 0), 1 - l), oe([i, i + l]);
321
212
  }
322
- function Dt(e, t) {
213
+ function Mt(e, t) {
323
214
  const [n, a] = e, r = a - n;
324
215
  let o = n + t * r;
325
- return o = Math.min(Math.max(o, 0), 1 - r), ie([o, o + r]);
216
+ return o = Math.min(Math.max(o, 0), 1 - r), oe([o, o + r]);
326
217
  }
327
- function Jn(e, t) {
218
+ function Kn(e, t) {
328
219
  return e[0] + t * (e[1] - e[0]);
329
220
  }
330
- function Rt(e) {
221
+ function It(e) {
331
222
  return e[0] <= 0 && e[1] >= 1;
332
223
  }
333
- function zt({ startedAt: e, endedAt: t, timeRange: n, now: a }) {
224
+ function Tt({ startedAt: e, endedAt: t, timeRange: n, now: a }) {
334
225
  const r = Math.max(1, n.max - n.min), o = t ?? a ?? n.max, l = (e - n.min) / r * 100, i = (o - n.min) / r * 100, c = Math.min(100, Math.max(0, l)), d = Math.min(100, Math.max(c, i));
335
226
  return {
336
227
  leftPercent: c,
@@ -342,7 +233,7 @@ function zt({ startedAt: e, endedAt: t, timeRange: n, now: a }) {
342
233
  clippedEnd: i > 100 && l < 100
343
234
  };
344
235
  }
345
- function Lt(e) {
236
+ function _t(e) {
346
237
  if (e == null) return "";
347
238
  if (typeof e == "object") try {
348
239
  return JSON.stringify(e);
@@ -351,7 +242,7 @@ function Lt(e) {
351
242
  }
352
243
  return String(e);
353
244
  }
354
- function Ot(e, t) {
245
+ function Et(e, t) {
355
246
  if (e == null || e.trim() === "") return null;
356
247
  const n = [], a = [];
357
248
  for (const i of e.match(/[^\s"]+|"([^"]*)"/g) ?? []) {
@@ -375,7 +266,7 @@ function Ot(e, t) {
375
266
  if (c != null)
376
267
  for (const d of Object.keys(c)) {
377
268
  if (o(d)) continue;
378
- const x = Lt(c[d]);
269
+ const x = _t(c[d]);
379
270
  if (x !== "" && (r(d) || r(x) || r(`${d}=${x}`))) {
380
271
  l.add(i.id);
381
272
  break;
@@ -384,117 +275,117 @@ function Ot(e, t) {
384
275
  }
385
276
  return l;
386
277
  }
387
- var De = de(null), Re = de(null), ze = de(null);
388
- function G() {
278
+ var De = de(null), ze = de(null), Le = de(null);
279
+ function j() {
389
280
  const e = ue(De);
390
281
  if (e == null) throw new Error("SpanPrimitive parts render inside SpanPrimitive.Provider.");
391
282
  return e;
392
283
  }
393
- function ee() {
394
- const e = ue(Re);
284
+ function q() {
285
+ const e = ue(ze);
395
286
  if (e == null) throw new Error("SpanPrimitive parts render inside SpanPrimitive.Children.");
396
287
  return e;
397
288
  }
398
289
  var ye = [];
399
- function Ft({ spans: e, defaultCollapsed: t, collapsed: n, onCollapsedChange: a, now: r, query: o = "", keepFoldsOnMatch: l = !1, defaultView: i, view: c, onViewChange: d, children: x }) {
400
- const v = O(() => $e(e), [e]), [h, g] = Y(() => t ?? ye), M = n ?? h, m = O(() => new Set(M), [M]), b = F((I) => {
401
- const P = Array.from(new Set(I));
402
- n == null && g(P), a?.(P);
403
- }, [n, a]), k = F((I) => {
404
- const P = new Set(m);
405
- P.has(I) ? P.delete(I) : P.add(I), b(Array.from(P));
406
- }, [m, b]), { spans: y, byId: T } = v, z = F(() => b(ye), [b]), $ = F(() => b(St(y)), [y, b]), E = F(() => b(Tt(y, m)), [
290
+ function Pt({ spans: e, defaultCollapsed: t, collapsed: n, onCollapsedChange: a, now: r, query: o = "", keepFoldsOnMatch: l = !1, defaultView: i, view: c, onViewChange: d, children: x }) {
291
+ const b = O(() => Pe(e), [e]), [h, v] = J(() => t ?? ye), A = n ?? h, m = O(() => new Set(A), [A]), g = F((T) => {
292
+ const $ = Array.from(new Set(T));
293
+ n == null && v($), a?.($);
294
+ }, [n, a]), k = F((T) => {
295
+ const $ = new Set(m);
296
+ $.has(T) ? $.delete(T) : $.add(T), g(Array.from($));
297
+ }, [m, g]), { spans: y, byId: _ } = b, L = F(() => g(ye), [g]), P = F(() => g(yt(y)), [y, g]), E = F(() => g(kt(y, m)), [
407
298
  y,
408
299
  m,
409
- b
410
- ]), C = F(() => b(It(y, m)), [
300
+ g
301
+ ]), S = F(() => g(Nt(y, m)), [
411
302
  y,
412
303
  m,
413
- b
414
- ]), _ = !_t(y, m), L = y.some((I) => I.hasChildren && m.has(I.id)), p = O(() => Ot(o, y), [o, y]);
415
- ae(() => {
304
+ g
305
+ ]), I = !wt(y, m), R = y.some((T) => T.hasChildren && m.has(T.id)), p = O(() => Et(o, y), [o, y]);
306
+ ne(() => {
416
307
  if (l || p == null || p.size === 0) return;
417
- const I = /* @__PURE__ */ new Set();
418
- for (const P of p) for (const Z of Ct(T, P)) m.has(Z) && I.add(Z);
419
- I.size !== 0 && b(M.filter((P) => !I.has(P)));
308
+ const T = /* @__PURE__ */ new Set();
309
+ for (const $ of p) for (const H of xt(_, $)) m.has(H) && T.add(H);
310
+ T.size !== 0 && g(A.filter(($) => !T.has($)));
420
311
  }, [
421
312
  p,
422
313
  l,
423
- T,
314
+ _,
424
315
  m,
425
- M,
426
- b
316
+ A,
317
+ g
427
318
  ]);
428
- const f = O(() => Pe(v, m), [v, m]), w = O(() => Et(y, r), [y, r]), [A, te] = Y(() => ie(i ?? xe)), D = O(() => ie(c ?? A), [c, A]), R = F((I) => {
429
- const P = ie(I);
430
- c == null && te(P), d?.(P);
431
- }, [c, d]), B = F((I, P) => R(Pt(D, I, P)), [D, R]), W = F((I) => R(Dt(D, I)), [D, R]), ne = F(() => R(xe), [R]), V = O(() => $t(w, D), [w, D]), re = O(() => ({
319
+ const f = O(() => $e(b, m), [b, m]), w = O(() => At(y, r), [y, r]), [C, ee] = J(() => oe(i ?? xe)), D = O(() => oe(c ?? C), [c, C]), z = F((T) => {
320
+ const $ = oe(T);
321
+ c == null && ee($), d?.($);
322
+ }, [c, d]), W = F((T, $) => z(St(D, T, $)), [D, z]), K = F((T) => z(Mt(D, T)), [D, z]), te = F(() => z(xe), [z]), V = O(() => Ct(w, D), [w, D]), ae = O(() => ({
432
323
  spans: f,
433
324
  all: y,
434
- byId: T,
435
- orphans: v.orphans,
436
- repaired: v.repaired,
325
+ byId: _,
326
+ orphans: b.orphans,
327
+ repaired: b.repaired,
437
328
  range: w,
438
329
  view: D,
439
330
  viewRange: V,
440
- zoomed: !Rt(D),
331
+ zoomed: !It(D),
441
332
  now: r,
442
333
  collapsed: m,
443
334
  toggle: k,
444
- setCollapsed: b,
445
- expandAll: z,
446
- collapseAll: $,
335
+ setCollapsed: g,
336
+ expandAll: L,
337
+ collapseAll: P,
447
338
  expandOne: E,
448
- collapseOne: C,
449
- canExpand: L,
450
- canCollapse: _,
339
+ collapseOne: S,
340
+ canExpand: R,
341
+ canCollapse: I,
451
342
  query: o,
452
343
  matches: p,
453
- setView: R,
454
- zoom: B,
455
- pan: W,
456
- resetView: ne
344
+ setView: z,
345
+ zoom: W,
346
+ pan: K,
347
+ resetView: te
457
348
  }), [
458
349
  f,
459
350
  y,
460
- T,
461
- v.orphans,
462
- v.repaired,
351
+ _,
352
+ b.orphans,
353
+ b.repaired,
463
354
  w,
464
355
  D,
465
356
  V,
466
357
  r,
467
358
  m,
468
359
  k,
469
- b,
470
- z,
471
- $,
472
- E,
473
- C,
360
+ g,
474
361
  L,
475
- _,
362
+ P,
363
+ E,
364
+ S,
365
+ R,
366
+ I,
476
367
  o,
477
368
  p,
478
- R,
479
- B,
369
+ z,
480
370
  W,
481
- ne
371
+ K,
372
+ te
482
373
  ]);
483
374
  return /* @__PURE__ */ s(De.Provider, {
484
- value: re,
375
+ value: ae,
485
376
  children: x
486
377
  });
487
378
  }
488
- function Wt({ children: e }) {
489
- const { spans: t } = G();
490
- return t.map((n) => /* @__PURE__ */ s(Re.Provider, {
379
+ function $t({ children: e }) {
380
+ const { spans: t } = j();
381
+ return t.map((n) => /* @__PURE__ */ s(ze.Provider, {
491
382
  value: n,
492
383
  children: e(n)
493
384
  }, n.id));
494
385
  }
495
- function Kt({ render: e, ref: t, ...n }) {
496
- const a = ee(), { matches: r } = G();
497
- return q({
386
+ function Dt({ render: e, ref: t, ...n }) {
387
+ const a = q(), { matches: r } = j();
388
+ return Q({
498
389
  render: e,
499
390
  ref: t,
500
391
  defaultTagName: "div",
@@ -511,9 +402,9 @@ function Kt({ render: e, ref: t, ...n }) {
511
402
  }
512
403
  });
513
404
  }
514
- function Bt({ render: e, ref: t, baseIndent: n = 8, indentPerLevel: a = 12, style: r, ...o }) {
515
- const l = ee();
516
- return q({
405
+ function zt({ render: e, ref: t, baseIndent: n = 8, indentPerLevel: a = 12, style: r, ...o }) {
406
+ const l = q();
407
+ return Q({
517
408
  render: e,
518
409
  ref: t,
519
410
  defaultTagName: "div",
@@ -527,9 +418,9 @@ function Bt({ render: e, ref: t, baseIndent: n = 8, indentPerLevel: a = 12, styl
527
418
  }
528
419
  });
529
420
  }
530
- function Vt({ render: e, ref: t, onClick: n, ...a }) {
531
- const r = ee(), { toggle: o } = G();
532
- return q({
421
+ function Lt({ render: e, ref: t, onClick: n, ...a }) {
422
+ const r = q(), { toggle: o } = j();
423
+ return Q({
533
424
  render: e,
534
425
  ref: t,
535
426
  enabled: r.hasChildren,
@@ -544,9 +435,9 @@ function Vt({ render: e, ref: t, onClick: n, ...a }) {
544
435
  }
545
436
  });
546
437
  }
547
- function Ut({ render: e, ref: t, ...n }) {
548
- const a = ee();
549
- return q({
438
+ function Rt({ render: e, ref: t, ...n }) {
439
+ const a = q();
440
+ return Q({
550
441
  render: e,
551
442
  ref: t,
552
443
  defaultTagName: "span",
@@ -557,9 +448,9 @@ function Ut({ render: e, ref: t, ...n }) {
557
448
  }
558
449
  });
559
450
  }
560
- function jt({ render: e, ref: t, children: n, ...a }) {
561
- const r = ee();
562
- return q({
451
+ function Ot({ render: e, ref: t, children: n, ...a }) {
452
+ const r = q();
453
+ return Q({
563
454
  render: e,
564
455
  ref: t,
565
456
  defaultTagName: "span",
@@ -570,9 +461,9 @@ function jt({ render: e, ref: t, children: n, ...a }) {
570
461
  }
571
462
  });
572
463
  }
573
- function Gt({ render: e, ref: t, children: n, ...a }) {
574
- const r = ee();
575
- return q({
464
+ function Ft({ render: e, ref: t, children: n, ...a }) {
465
+ const r = q();
466
+ return Q({
576
467
  render: e,
577
468
  ref: t,
578
469
  defaultTagName: "span",
@@ -582,12 +473,12 @@ function Gt({ render: e, ref: t, children: n, ...a }) {
582
473
  }
583
474
  });
584
475
  }
585
- function Xt({ render: e, ref: t, timeRange: n, paddingEnd: a = 0, style: r, ...o }) {
586
- const l = G(), i = O(() => {
587
- const v = n ?? l.viewRange, h = Math.max(1, v.max - v.min);
476
+ function Kt({ render: e, ref: t, timeRange: n, paddingEnd: a = 0, style: r, ...o }) {
477
+ const l = j(), i = O(() => {
478
+ const b = n ?? l.viewRange, h = Math.max(1, b.max - b.min);
588
479
  return {
589
- min: v.min,
590
- max: v.max + h * Math.max(0, a)
480
+ min: b.min,
481
+ max: b.max + h * Math.max(0, a)
591
482
  };
592
483
  }, [
593
484
  n,
@@ -598,7 +489,7 @@ function Xt({ render: e, ref: t, timeRange: n, paddingEnd: a = 0, style: r, ...o
598
489
  "--span-timeline-min-ms": i.min,
599
490
  "--span-timeline-max-ms": i.max,
600
491
  "--span-timeline-range-ms": c
601
- }, x = q({
492
+ }, x = Q({
602
493
  render: e,
603
494
  ref: t,
604
495
  defaultTagName: "div",
@@ -608,13 +499,13 @@ function Xt({ render: e, ref: t, timeRange: n, paddingEnd: a = 0, style: r, ...o
608
499
  "data-span-timeline": ""
609
500
  }
610
501
  });
611
- return /* @__PURE__ */ s(ze.Provider, {
502
+ return /* @__PURE__ */ s(Le.Provider, {
612
503
  value: i,
613
504
  children: x
614
505
  });
615
506
  }
616
- function Ht({ render: e, ref: t, now: n, timeRange: a, style: r, ...o }) {
617
- const l = ee(), i = G(), c = ue(ze), d = zt({
507
+ function Bt({ render: e, ref: t, now: n, timeRange: a, style: r, ...o }) {
508
+ const l = q(), i = j(), c = ue(Le), d = Tt({
618
509
  startedAt: l.startedAt,
619
510
  endedAt: l.endedAt,
620
511
  timeRange: a ?? c ?? i.viewRange,
@@ -629,7 +520,7 @@ function Ht({ render: e, ref: t, now: n, timeRange: a, style: r, ...o }) {
629
520
  "--span-timeline-width": `${d.widthPercent}%`,
630
521
  "--span-timeline-duration-ms": d.durationMs
631
522
  };
632
- return q({
523
+ return Q({
633
524
  render: e,
634
525
  ref: t,
635
526
  defaultTagName: "div",
@@ -644,24 +535,24 @@ function Ht({ render: e, ref: t, now: n, timeRange: a, style: r, ...o }) {
644
535
  }
645
536
  });
646
537
  }
647
- var H = {
648
- Provider: Ft,
649
- Children: Wt,
650
- Root: Kt,
651
- Indent: Bt,
652
- CollapseToggle: Vt,
653
- StatusIndicator: Ut,
654
- TypeBadge: jt,
655
- Name: Gt,
656
- Timeline: Xt,
657
- TimelineBar: Ht
658
- }, Zt = (e) => {
538
+ var X = {
539
+ Provider: Pt,
540
+ Children: $t,
541
+ Root: Dt,
542
+ Indent: zt,
543
+ CollapseToggle: Lt,
544
+ StatusIndicator: Rt,
545
+ TypeBadge: Ot,
546
+ Name: Ft,
547
+ Timeline: Kt,
548
+ TimelineBar: Bt
549
+ }, Wt = (e) => {
659
550
  const t = Number(e.trim());
660
551
  return t >= 500 && t < 600;
661
- }, Le = [
552
+ }, Re = [
662
553
  {
663
554
  namespace: "db",
664
- icon: ht,
555
+ icon: Ze,
665
556
  pills: [{
666
557
  label: "db.system",
667
558
  keys: ["db.system.name", "db.system"]
@@ -669,11 +560,11 @@ var H = {
669
560
  },
670
561
  {
671
562
  namespace: "http",
672
- icon: Mt,
563
+ icon: nt,
673
564
  pills: [{
674
565
  label: "http.status_code",
675
566
  keys: ["http.response.status_code", "http.status_code"],
676
- error: Zt
567
+ error: Wt
677
568
  }, {
678
569
  label: "http.method",
679
570
  keys: ["http.request.method", "http.method"]
@@ -681,11 +572,11 @@ var H = {
681
572
  },
682
573
  {
683
574
  namespace: "messaging",
684
- icon: gt
575
+ icon: He
685
576
  },
686
577
  {
687
578
  namespace: "rpc",
688
- icon: it,
579
+ icon: Qe,
689
580
  pills: [{
690
581
  label: "rpc.system",
691
582
  keys: ["rpc.system.name", "rpc.system"]
@@ -698,28 +589,28 @@ var H = {
698
589
  keys: ["gen_ai.request.model"]
699
590
  }]
700
591
  }
701
- ], Jt = {
592
+ ], Vt = {
702
593
  agent: {
703
- icon: xt,
594
+ icon: et,
704
595
  label: "Agent"
705
596
  },
706
597
  llm: {
707
- icon: be,
598
+ icon: ge,
708
599
  label: "LLM call"
709
600
  },
710
601
  tool: {
711
- icon: Nt,
602
+ icon: Je,
712
603
  label: "Tool call"
713
604
  },
714
605
  retrieval: {
715
- icon: ft,
606
+ icon: bt,
716
607
  label: "Retrieval"
717
608
  },
718
609
  generic: {
719
- icon: be,
610
+ icon: ge,
720
611
  label: "GenAI span"
721
612
  }
722
- }, Yt = {
613
+ }, Ut = {
723
614
  chat: "llm",
724
615
  text_completion: "llm",
725
616
  generate_content: "llm",
@@ -729,7 +620,7 @@ var H = {
729
620
  embeddings: "retrieval",
730
621
  retrieve: "retrieval"
731
622
  };
732
- function Qt(e) {
623
+ function jt(e) {
733
624
  if (e == null) return "";
734
625
  if (e instanceof Uint8Array) return JSON.stringify(Array.from(e));
735
626
  if (typeof e == "object") try {
@@ -739,37 +630,37 @@ function Qt(e) {
739
630
  }
740
631
  return String(e).trim();
741
632
  }
742
- function ve(e, t) {
633
+ function be(e, t) {
743
634
  if (e == null) return null;
744
635
  for (const n of t) {
745
636
  if (!(n in e)) continue;
746
- const a = Qt(e[n]);
637
+ const a = jt(e[n]);
747
638
  if (a !== "") return a;
748
639
  }
749
640
  return null;
750
641
  }
751
- function qt(e) {
642
+ function Gt(e) {
752
643
  if (e == null) return null;
753
- const t = ve(e, ["gen_ai.operation.name"]);
754
- return t != null ? Yt[t.toLowerCase()] ?? "generic" : Object.keys(e).some((n) => n.startsWith("gen_ai.")) ? "generic" : null;
644
+ const t = be(e, ["gen_ai.operation.name"]);
645
+ return t != null ? Ut[t.toLowerCase()] ?? "generic" : Object.keys(e).some((n) => n.startsWith("gen_ai.")) ? "generic" : null;
755
646
  }
756
- function en(e) {
757
- const t = qt(e);
758
- if (t != null) return Jt[t];
647
+ function Xt(e) {
648
+ const t = Gt(e);
649
+ if (t != null) return Vt[t];
759
650
  if (e == null) return null;
760
651
  const n = /* @__PURE__ */ new Set();
761
652
  for (const a of Object.keys(e)) {
762
653
  const r = a.indexOf(".");
763
654
  r > 0 && n.add(a.slice(0, r));
764
655
  }
765
- for (const a of Le) if (a.icon && n.has(a.namespace)) return { icon: a.icon };
656
+ for (const a of Re) if (a.icon && n.has(a.namespace)) return { icon: a.icon };
766
657
  return null;
767
658
  }
768
- function tn(e) {
659
+ function Ht(e) {
769
660
  const t = [];
770
661
  if (e == null) return t;
771
- for (const n of Le) for (const a of n.pills ?? []) {
772
- const r = ve(e, a.keys);
662
+ for (const n of Re) for (const a of n.pills ?? []) {
663
+ const r = be(e, a.keys);
773
664
  if (r == null) continue;
774
665
  const o = {
775
666
  label: a.label,
@@ -779,10 +670,10 @@ function tn(e) {
779
670
  }
780
671
  return t;
781
672
  }
782
- function nn(e) {
783
- return ve(e, ["peer.service", "server.address"]);
673
+ function Zt(e) {
674
+ return be(e, ["peer.service", "server.address"]);
784
675
  }
785
- function an(e) {
676
+ function Jt(e) {
786
677
  return e.map((t) => {
787
678
  const n = t.endedAt ?? null, a = {
788
679
  id: t.id,
@@ -797,7 +688,7 @@ function an(e) {
797
688
  return t.kind != null && (a.kind = t.kind), t.service != null && (a.service = t.service), t.attributes != null && (a.attributes = t.attributes), a;
798
689
  });
799
690
  }
800
- function rn(e, t) {
691
+ function Yt(e, t) {
801
692
  return e.latencyMs != null ? Math.max(0, e.latencyMs) : e.endedAt != null ? Math.max(0, e.endedAt - e.startedAt) : t != null ? Math.max(0, t - e.startedAt) : null;
802
693
  }
803
694
  var we = (e) => Math.min(1, Math.max(0, e));
@@ -808,7 +699,7 @@ function Ne(e, t, n) {
808
699
  width: we(Math.max(o, (r - t.min) / a)) - o
809
700
  };
810
701
  }
811
- function sn(e, t = 6) {
702
+ function Qt(e, t = 6) {
812
703
  if (e <= 0) return 1;
813
704
  const n = e / t, a = 10 ** Math.floor(Math.log10(n));
814
705
  for (const r of [
@@ -819,13 +710,13 @@ function sn(e, t = 6) {
819
710
  ]) if (r * a >= n) return r * a;
820
711
  return 10 * a;
821
712
  }
822
- function on(e, t) {
713
+ function qt(e, t) {
823
714
  const n = t - e;
824
715
  if (!(n > 0)) return [{
825
716
  at: 0,
826
717
  ms: e
827
718
  }];
828
- const a = sn(n), r = [], o = Math.ceil(e / a - 1e-9) * a;
719
+ const a = Qt(n), r = [], o = Math.ceil(e / a - 1e-9) * a;
829
720
  for (let l = o; l <= t + 1e-9; l += a) {
830
721
  const i = Number(l.toFixed(6));
831
722
  r.push({
@@ -835,7 +726,7 @@ function on(e, t) {
835
726
  }
836
727
  return r;
837
728
  }
838
- function Q(e) {
729
+ function Y(e) {
839
730
  if (!Number.isFinite(e)) return "";
840
731
  const t = Math.abs(e);
841
732
  return t < 10 ? `${e.toFixed(2)} ms` : t < 100 ? `${e.toFixed(1)} ms` : t < 1e3 ? `${Math.round(e)} ms` : t < 6e4 ? `${(e / 1e3).toFixed(2)} s` : `${(e / 6e4).toFixed(1)} min`;
@@ -843,21 +734,21 @@ function Q(e) {
843
734
  function Oe(e) {
844
735
  return e === 0 ? "0" : e >= 1e3 ? `${Number((e / 1e3).toFixed(2))} s` : `${Number(e.toFixed(2))} ms`;
845
736
  }
846
- var ln = 7.5, oe = 4, cn = 4;
737
+ var en = 7.5, se = 4, tn = 4;
847
738
  function Fe(e, t) {
848
739
  if (e.length === 0 || t <= 0) return [];
849
740
  const n = [];
850
741
  for (const a of e) {
851
- const r = Oe(a.ms), o = Math.max(r.length * ln, 8), l = a.at * t, i = l + oe + o > t, c = i ? "end" : "start", d = i ? l - oe - o : l + oe, x = i ? l - oe : l + oe + o;
852
- let v = !1;
853
- for (; n.length > 0 && !(d >= n[n.length - 1].right + cn); ) {
742
+ const r = Oe(a.ms), o = Math.max(r.length * en, 8), l = a.at * t, i = l + se + o > t, c = i ? "end" : "start", d = i ? l - se - o : l + se, x = i ? l - se : l + se + o;
743
+ let b = !1;
744
+ for (; n.length > 0 && !(d >= n[n.length - 1].right + tn); ) {
854
745
  if (!i) {
855
- v = !0;
746
+ b = !0;
856
747
  break;
857
748
  }
858
749
  n.pop();
859
750
  }
860
- v || n.push({
751
+ b || n.push({
861
752
  tick: a,
862
753
  align: c,
863
754
  left: d,
@@ -869,60 +760,60 @@ function Fe(e, t) {
869
760
  align: r
870
761
  }));
871
762
  }
872
- function Yn(e, t) {
763
+ function Bn(e, t) {
873
764
  return Fe(e, t).map((n) => n.ms);
874
765
  }
875
- function K(e) {
766
+ function B(e) {
876
767
  return `${Number((e * 100).toFixed(4))}%`;
877
768
  }
878
- var We = S(Qe, "overflow-hidden"), Ke = "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)]", dn = "absolute inset-y-0 left-5 right-5", Be = 20, Ve = 16, un = 26;
879
- function pn(e) {
880
- return `${Be + e * Ve + un}px`;
769
+ var Ke = M(st, "overflow-hidden"), Be = "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)]", nn = "absolute inset-y-0 left-5 right-5", We = 20, Ve = 16, an = 26;
770
+ function rn(e) {
771
+ return `${We + e * Ve + an}px`;
881
772
  }
882
- var hn = 250, ke = 0.8, Me = 0.5, mn = 0.1, fn = 0.3, vn = 5e-3, gn = {
773
+ var sn = 250, ke = 0.8, Ae = 0.5, on = 0.1, ln = 0.3, cn = 5e-3, dn = {
883
774
  completed: "bg-pho-inverse/25",
884
775
  failed: "bg-pho-error-ink",
885
776
  running: "bg-pho-inverse/15 motion-safe:animate-pulse",
886
777
  skipped: "border-pho-secondary border border-dashed bg-transparent"
887
- }, Ae = {
778
+ }, Ce = {
888
779
  completed: "bg-pho-inverse",
889
780
  failed: "bg-pho-error-ink",
890
781
  running: "bg-pho-inverse/40",
891
782
  skipped: "border-pho-secondary border bg-transparent"
892
- }, bn = "border-pho-error-ink border bg-transparent", xn = {
783
+ }, un = "border-pho-error-ink border bg-transparent", pn = {
893
784
  completed: null,
894
785
  failed: "Failed.",
895
786
  running: "Running.",
896
787
  skipped: "Skipped."
897
- }, se = "text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-100 ease-linear focus-visible:outline-2 disabled:pointer-events-none disabled:opacity-40", Ce = (e) => ({ backgroundImage: `linear-gradient(to ${e === "left" ? "right" : "left"}, color-mix(in srgb, var(--background-color-pho-inverse) 18%, transparent), transparent)` }), ce = (e, t, n = `${t}s`) => `${e} ${e === 1 ? t : n}`;
788
+ }, re = "text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-100 ease-linear focus-visible:outline-2 disabled:pointer-events-none disabled:opacity-40", Se = (e) => ({ backgroundImage: `linear-gradient(to ${e === "left" ? "right" : "left"}, color-mix(in srgb, var(--background-color-pho-inverse) 18%, transparent), transparent)` }), le = (e, t, n = `${t}s`) => `${e} ${e === 1 ? t : n}`;
898
789
  function Ue({ className: e, clippedStart: t, clippedEnd: n, children: a }) {
899
790
  return /* @__PURE__ */ N("div", {
900
- className: S("border-pho-secondary relative border-l", e),
791
+ className: M("border-pho-secondary relative border-l", e),
901
792
  children: [
902
793
  /* @__PURE__ */ s("div", {
903
794
  "data-trace-track": "",
904
- className: dn,
795
+ className: nn,
905
796
  children: a
906
797
  }),
907
798
  t ? /* @__PURE__ */ s("span", {
908
799
  "aria-hidden": !0,
909
800
  "data-trace-clipped": "start",
910
801
  className: "pointer-events-none absolute top-1/2 left-0 h-4 w-2 -translate-y-1/2",
911
- style: Ce("left")
802
+ style: Se("left")
912
803
  }) : null,
913
804
  n ? /* @__PURE__ */ s("span", {
914
805
  "aria-hidden": !0,
915
806
  "data-trace-clipped": "end",
916
807
  className: "pointer-events-none absolute top-1/2 right-0 h-4 w-2 -translate-y-1/2",
917
- style: Ce("right")
808
+ style: Se("right")
918
809
  }) : null
919
810
  ]
920
811
  });
921
812
  }
922
- function yn(e, t) {
813
+ function hn(e, t) {
923
814
  return t > 0.5 ? "inside" : e + t > 0.8 ? "before" : "after";
924
815
  }
925
- function wn(e) {
816
+ function mn(e) {
926
817
  if (!(e instanceof HTMLElement)) return !1;
927
818
  const t = e.tagName;
928
819
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable;
@@ -933,62 +824,62 @@ function Ge() {
933
824
  if (e == null) throw new Error("Trace rows render inside Trace.Waterfall only.");
934
825
  return e;
935
826
  }
936
- function Nn() {
937
- const e = Ge(), t = ee(), { viewRange: n, now: a, byId: r, matches: o } = G(), { id: l, name: i, type: c, status: d, depth: x, isCollapsed: v, hasChildren: h } = t, g = e.spans.get(l), M = e.selectedId != null && e.selectedId === l, m = M && g != null ? e.renderSpanDetail?.(g) ?? null : null, b = e.renderSpanDetail != null ? `${e.idBase}-span-${l}` : void 0, k = e.onSelect ? () => e.onSelect?.(M ? null : l) : void 0, { left: y, width: T } = Ne(t, n, a), z = t.endedAt ?? a ?? n.max, $ = t.startedAt < n.min && z > n.min, E = z > n.max && t.startedAt < n.max, C = z <= n.min, _ = C || t.startedAt >= n.max, L = C ? "before" : "after", p = yn(y, T), f = rn(t, a), w = f == null ? null : Q(f), A = [t.service, c].filter(Boolean).join(", "), te = v ? t.descendants : 0, D = v ? t.descendantErrors : 0, R = xn[d], B = d === "failed", W = en(t.attributes), ne = tn(t.attributes), V = v && t.kind === "client" && t.serverChildId != null ? r.get(t.serverChildId) : void 0, re = V != null ? V.service ?? V.name : !h && (t.kind === "client" || t.kind === "producer") ? nn(t.attributes) : null, I = V ? Ne(V, n, a) : null, P = o?.has(l) ?? !1, Z = e.activeMatchId === l, pe = (u) => u === "after" ? {
938
- left: `calc(${K(y + T)} + 0.375rem)`,
939
- maxWidth: `calc(${K(1 - y - T)} - 0.375rem)`
827
+ function fn() {
828
+ const e = Ge(), t = q(), { viewRange: n, now: a, byId: r, matches: o } = j(), { id: l, name: i, type: c, status: d, depth: x, isCollapsed: b, hasChildren: h } = t, v = e.spans.get(l), A = e.selectedId != null && e.selectedId === l, m = A && v != null ? e.renderSpanDetail?.(v) ?? null : null, g = e.renderSpanDetail != null ? `${e.idBase}-span-${l}` : void 0, k = e.onSelect ? () => e.onSelect?.(A ? null : l) : void 0, { left: y, width: _ } = Ne(t, n, a), L = t.endedAt ?? a ?? n.max, P = t.startedAt < n.min && L > n.min, E = L > n.max && t.startedAt < n.max, S = L <= n.min, I = S || t.startedAt >= n.max, R = S ? "before" : "after", p = hn(y, _), f = Yt(t, a), w = f == null ? null : Y(f), C = [t.service, c].filter(Boolean).join(", "), ee = b ? t.descendants : 0, D = b ? t.descendantErrors : 0, z = pn[d], W = d === "failed", K = Xt(t.attributes), te = Ht(t.attributes), V = b && t.kind === "client" && t.serverChildId != null ? r.get(t.serverChildId) : void 0, ae = V != null ? V.service ?? V.name : !h && (t.kind === "client" || t.kind === "producer") ? Zt(t.attributes) : null, T = V ? Ne(V, n, a) : null, $ = o?.has(l) ?? !1, H = e.activeMatchId === l, pe = (u) => u === "after" ? {
829
+ left: `calc(${B(y + _)} + 0.375rem)`,
830
+ maxWidth: `calc(${B(1 - y - _)} - 0.375rem)`
940
831
  } : {
941
- right: `calc(${K(1 - y)} + 0.375rem)`,
942
- maxWidth: `calc(${K(y)} - 0.375rem)`
832
+ right: `calc(${B(1 - y)} + 0.375rem)`,
833
+ maxWidth: `calc(${B(y)} - 0.375rem)`
943
834
  };
944
835
  return /* @__PURE__ */ N("li", {
945
836
  className: "m-0",
946
- style: { "--trace-indent": pn(x) },
947
- children: [/* @__PURE__ */ N(H.Root, {
837
+ style: { "--trace-indent": rn(x) },
838
+ children: [/* @__PURE__ */ N(X.Root, {
948
839
  "data-trace-row": "",
949
- "data-selected": M || void 0,
950
- "data-active-match": Z || void 0,
951
- className: S(Ke, "relative min-h-9 items-center transition-colors", "has-[[data-trace-select]:focus-visible]:outline-pho-brand has-[[data-trace-select]:focus-visible]:outline-2 has-[[data-trace-select]:focus-visible]:-outline-offset-2", k != null && "hover:bg-pho-primary-hover", P && "bg-pho-brand-secondary", Z && "ring-pho-brand ring-1 ring-inset", M && "bg-pho-primary-hover"),
952
- children: [/* @__PURE__ */ N(H.Indent, {
953
- baseIndent: Be,
840
+ "data-selected": A || void 0,
841
+ "data-active-match": H || void 0,
842
+ className: M(Be, "relative min-h-9 items-center transition-colors", "has-[[data-trace-select]:focus-visible]:outline-pho-brand has-[[data-trace-select]:focus-visible]:outline-2 has-[[data-trace-select]:focus-visible]:-outline-offset-2", k != null && "hover:bg-pho-primary-hover", $ && "bg-pho-brand-secondary", H && "ring-pho-brand ring-1 ring-inset", A && "bg-pho-primary-hover"),
843
+ children: [/* @__PURE__ */ N(X.Indent, {
844
+ baseIndent: We,
954
845
  indentPerLevel: Ve,
955
846
  className: "flex min-w-0 items-center gap-1.5 py-1.5 pr-5",
956
847
  children: [
957
- h ? /* @__PURE__ */ s(H.CollapseToggle, {
958
- "aria-expanded": !v,
959
- "aria-label": `${v ? "Expand" : "Collapse"} ${i}`,
848
+ h ? /* @__PURE__ */ s(X.CollapseToggle, {
849
+ "aria-expanded": !b,
850
+ "aria-label": `${b ? "Expand" : "Collapse"} ${i}`,
960
851
  className: "text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover relative z-10 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-[color,background-color,transform] duration-100 ease-linear focus-visible:outline-2",
961
- children: /* @__PURE__ */ s(He, {
852
+ children: /* @__PURE__ */ s(qe, {
962
853
  "aria-hidden": !0,
963
- className: S("size-4 transition-transform duration-150 ease-out", !v && "rotate-90")
854
+ className: M("size-4 transition-transform duration-150 ease-out", !b && "rotate-90")
964
855
  })
965
856
  }) : /* @__PURE__ */ s("span", {
966
857
  "aria-hidden": !0,
967
858
  className: "size-5 shrink-0"
968
859
  }),
969
- /* @__PURE__ */ s(H.StatusIndicator, {
860
+ /* @__PURE__ */ s(X.StatusIndicator, {
970
861
  "aria-hidden": !0,
971
- className: S("size-1.5 shrink-0 rounded-full", B ? Ae.failed : D > 0 ? bn : Ae[d])
862
+ className: M("size-1.5 shrink-0 rounded-full", W ? Ce.failed : D > 0 ? un : Ce[d])
972
863
  }),
973
- W ? /* @__PURE__ */ s(W.icon, {
864
+ K ? /* @__PURE__ */ s(K.icon, {
974
865
  "data-trace-icon": "",
975
- role: W.label ? "img" : void 0,
976
- "aria-label": W.label,
977
- "aria-hidden": W.label ? void 0 : !0,
866
+ role: K.label ? "img" : void 0,
867
+ "aria-label": K.label,
868
+ "aria-hidden": K.label ? void 0 : !0,
978
869
  className: "text-pho-description size-3.5 shrink-0"
979
870
  }) : null,
980
- /* @__PURE__ */ N(kn, {
981
- selected: M,
871
+ /* @__PURE__ */ N(bn, {
872
+ selected: A,
982
873
  expanded: e.renderSpanDetail != null ? m != null : void 0,
983
- controls: m != null ? b : void 0,
874
+ controls: m != null ? g : void 0,
984
875
  onSelect: k,
985
876
  children: [
986
- /* @__PURE__ */ s(H.Name, { className: "text-pho-primary truncate text-base" }),
987
- re ? /* @__PURE__ */ N("span", {
877
+ /* @__PURE__ */ s(X.Name, { className: "text-pho-primary truncate text-base" }),
878
+ ae ? /* @__PURE__ */ N("span", {
988
879
  "data-trace-callee": "",
989
880
  className: "text-pho-description flex shrink-0 items-center gap-0.5 text-xs",
990
881
  children: [
991
- /* @__PURE__ */ s(st, {
882
+ /* @__PURE__ */ s(tt, {
992
883
  "aria-hidden": !0,
993
884
  className: "size-3"
994
885
  }),
@@ -996,14 +887,14 @@ function Nn() {
996
887
  className: "sr-only",
997
888
  children: "calls "
998
889
  }),
999
- re
890
+ ae
1000
891
  ]
1001
892
  }) : null,
1002
- A ? /* @__PURE__ */ s("span", {
893
+ C ? /* @__PURE__ */ s("span", {
1003
894
  className: "text-pho-description shrink-[3] truncate text-xs",
1004
- children: A
895
+ children: C
1005
896
  }) : null,
1006
- ne.map((u) => /* @__PURE__ */ s(nt, {
897
+ te.map((u) => /* @__PURE__ */ s(ct, {
1007
898
  size: "xs",
1008
899
  contrast: "low",
1009
900
  color: u.error ? "error" : "gray",
@@ -1014,60 +905,60 @@ function Nn() {
1014
905
  className: "max-w-32 shrink-0 truncate",
1015
906
  children: u.value
1016
907
  }, u.label)),
1017
- te > 0 ? /* @__PURE__ */ N("span", {
908
+ ee > 0 ? /* @__PURE__ */ N("span", {
1018
909
  className: "text-pho-description shrink-0 text-xs tabular-nums",
1019
910
  children: [
1020
911
  "(",
1021
- te,
1022
- D > 0 ? `, ${ce(D, "error")}` : "",
912
+ ee,
913
+ D > 0 ? `, ${le(D, "error")}` : "",
1023
914
  ")"
1024
915
  ]
1025
916
  }) : null,
1026
- R ? /* @__PURE__ */ s("span", {
917
+ z ? /* @__PURE__ */ s("span", {
1027
918
  className: "sr-only",
1028
- children: R
919
+ children: z
1029
920
  }) : null,
1030
921
  D > 0 ? /* @__PURE__ */ N("span", {
1031
922
  className: "sr-only",
1032
- children: [ce(D, "error"), " hidden."]
923
+ children: [le(D, "error"), " hidden."]
1033
924
  }) : null
1034
925
  ]
1035
926
  })
1036
927
  ]
1037
928
  }), /* @__PURE__ */ N(Ue, {
1038
929
  className: "h-9",
1039
- clippedStart: $,
930
+ clippedStart: P,
1040
931
  clippedEnd: E,
1041
932
  children: [
1042
- /* @__PURE__ */ s(H.TimelineBar, {
933
+ /* @__PURE__ */ s(X.TimelineBar, {
1043
934
  "aria-hidden": !0,
1044
935
  "data-trace-bar": "",
1045
- className: S("top-1/2 h-4 -translate-y-1/2 rounded-sm transition-[inset-inline-start,inline-size] duration-200 ease-out motion-reduce:transition-none", gn[d], $ && "-ml-5 box-content rounded-l-none pl-5", E && "box-content rounded-r-none pr-5", _ && "invisible"),
936
+ className: M("top-1/2 h-4 -translate-y-1/2 rounded-sm transition-[inset-inline-start,inline-size] duration-200 ease-out motion-reduce:transition-none", dn[d], P && "-ml-5 box-content rounded-l-none pl-5", E && "box-content rounded-r-none pr-5", I && "invisible"),
1046
937
  style: { "--span-timeline-min-width": "2px" },
1047
938
  children: p === "inside" && w ? /* @__PURE__ */ s("span", {
1048
939
  "data-trace-label": "short",
1049
- className: S("absolute inset-y-0 flex items-center text-xs whitespace-nowrap tabular-nums", E ? "right-[1.625rem]" : "right-1.5", B ? "text-pho-on-brand" : "text-pho-primary"),
940
+ className: M("absolute inset-y-0 flex items-center text-xs whitespace-nowrap tabular-nums", E ? "right-[1.625rem]" : "right-1.5", W ? "text-pho-on-brand" : "text-pho-primary"),
1050
941
  children: w
1051
942
  }) : null
1052
943
  }),
1053
- V && I ? /* @__PURE__ */ s("span", {
944
+ V && T ? /* @__PURE__ */ s("span", {
1054
945
  "aria-hidden": !0,
1055
946
  "data-trace-rpc": "",
1056
947
  className: "bg-pho-inverse/45 absolute top-1/2 h-2 -translate-y-1/2 rounded-sm",
1057
948
  style: {
1058
- left: K(I.left),
1059
- width: K(I.width),
949
+ left: B(T.left),
950
+ width: B(T.width),
1060
951
  minWidth: "2px"
1061
952
  }
1062
953
  }) : null,
1063
- _ && w ? /* @__PURE__ */ s("span", {
954
+ I && w ? /* @__PURE__ */ s("span", {
1064
955
  "aria-hidden": !0,
1065
956
  "data-trace-label": "outside",
1066
- "data-side": L,
1067
- className: S("text-pho-description absolute top-1/2 -translate-y-1/2 text-xs whitespace-nowrap tabular-nums opacity-60", L === "before" ? "left-0" : "right-0"),
1068
- children: L === "before" ? `‹ ${w}` : `${w} ›`
957
+ "data-side": R,
958
+ className: M("text-pho-description absolute top-1/2 -translate-y-1/2 text-xs whitespace-nowrap tabular-nums opacity-60", R === "before" ? "left-0" : "right-0"),
959
+ children: R === "before" ? `‹ ${w}` : `${w} ›`
1069
960
  }) : null,
1070
- !_ && p !== "inside" && w ? /* @__PURE__ */ s("span", {
961
+ !I && p !== "inside" && w ? /* @__PURE__ */ s("span", {
1071
962
  "aria-hidden": !0,
1072
963
  "data-trace-label": "short",
1073
964
  className: "text-pho-description absolute top-1/2 -translate-y-1/2 truncate text-xs tabular-nums",
@@ -1080,12 +971,12 @@ function Nn() {
1080
971
  }) : null
1081
972
  ]
1082
973
  })]
1083
- }), m != null ? /* @__PURE__ */ s(ge.Root, {
974
+ }), m != null ? /* @__PURE__ */ s(ve.Root, {
1084
975
  open: !0,
1085
- children: /* @__PURE__ */ s(ge.Panel, {
976
+ children: /* @__PURE__ */ s(ve.Panel, {
1086
977
  className: "motion-reduce:transition-none",
1087
978
  children: /* @__PURE__ */ s("section", {
1088
- id: b,
979
+ id: g,
1089
980
  "data-trace-detail": "",
1090
981
  className: "border-pho-secondary bg-pho-page border-t py-3 pr-5",
1091
982
  style: { paddingLeft: "var(--trace-indent)" },
@@ -1095,7 +986,7 @@ function Nn() {
1095
986
  }) : null]
1096
987
  });
1097
988
  }
1098
- function kn({ selected: e, expanded: t, controls: n, onSelect: a, children: r }) {
989
+ function bn({ selected: e, expanded: t, controls: n, onSelect: a, children: r }) {
1099
990
  const o = "flex min-w-0 flex-1 items-baseline gap-2 text-left";
1100
991
  return a == null ? /* @__PURE__ */ s("span", {
1101
992
  className: o,
@@ -1107,183 +998,183 @@ function kn({ selected: e, expanded: t, controls: n, onSelect: a, children: r })
1107
998
  "aria-expanded": t,
1108
999
  "aria-controls": n,
1109
1000
  onClick: a,
1110
- className: S(o, "cursor-pointer outline-none after:absolute after:inset-0 after:content-['']"),
1001
+ className: M(o, "cursor-pointer outline-none after:absolute after:inset-0 after:content-['']"),
1111
1002
  children: r
1112
1003
  });
1113
1004
  }
1114
- function Mn(e) {
1115
- const [t, n] = Y(void 0);
1116
- return ae(() => {
1005
+ function vn(e) {
1006
+ const [t, n] = J(void 0);
1007
+ return ne(() => {
1117
1008
  if (!e) return;
1118
1009
  n(Date.now());
1119
- const a = setInterval(() => n(Date.now()), hn);
1010
+ const a = setInterval(() => n(Date.now()), sn);
1120
1011
  return () => clearInterval(a);
1121
1012
  }, [e]), e ? t : void 0;
1122
1013
  }
1123
- function An({ spans: e, now: t, selectedId: n, onSelect: a, renderSpanDetail: r, defaultCollapsed: o, collapsed: l, onCollapsedChange: i, foldControls: c = !0, search: d, query: x, onQueryChange: v, defaultView: h, view: g, onViewChange: M, shortcuts: m = "focus", footer: b, className: k, ...y }) {
1124
- const T = O(() => an(e), [e]), z = O(() => new Map(e.map((w) => [w.id, w])), [e]), $ = Mn(T.some((w) => w.endedAt == null) && t === void 0), E = t ?? $, [C, _] = Y(""), L = x ?? C, p = F((w) => {
1125
- x == null && _(w), v?.(w);
1126
- }, [x, v]), f = O(() => T.filter((w) => w.status === "failed").length, [T]);
1127
- return /* @__PURE__ */ s(H.Provider, {
1128
- spans: T,
1014
+ function gn({ spans: e, now: t, selectedId: n, onSelect: a, renderSpanDetail: r, defaultCollapsed: o, collapsed: l, onCollapsedChange: i, foldControls: c = !0, search: d, query: x, onQueryChange: b, defaultView: h, view: v, onViewChange: A, shortcuts: m = "focus", footer: g, className: k, ...y }) {
1015
+ const _ = O(() => Jt(e), [e]), L = O(() => new Map(e.map((w) => [w.id, w])), [e]), P = vn(_.some((w) => w.endedAt == null) && t === void 0), E = t ?? P, [S, I] = J(""), R = x ?? S, p = F((w) => {
1016
+ x == null && I(w), b?.(w);
1017
+ }, [x, b]), f = O(() => _.filter((w) => w.status === "failed").length, [_]);
1018
+ return /* @__PURE__ */ s(X.Provider, {
1019
+ spans: _,
1129
1020
  now: E,
1130
1021
  defaultCollapsed: o,
1131
1022
  collapsed: l,
1132
1023
  onCollapsedChange: i,
1133
- query: L,
1024
+ query: R,
1134
1025
  defaultView: h,
1135
- view: g,
1136
- onViewChange: M,
1137
- children: /* @__PURE__ */ s(Cn, {
1138
- sources: z,
1139
- spanCount: T.length,
1026
+ view: v,
1027
+ onViewChange: A,
1028
+ children: /* @__PURE__ */ s(xn, {
1029
+ sources: L,
1030
+ spanCount: _.length,
1140
1031
  errorCount: f,
1141
1032
  selectedId: n,
1142
1033
  onSelect: a,
1143
1034
  renderSpanDetail: r,
1144
1035
  foldControls: c,
1145
1036
  search: d,
1146
- query: L,
1037
+ query: R,
1147
1038
  setQuery: p,
1148
1039
  shortcuts: m,
1149
- footer: b,
1040
+ footer: g,
1150
1041
  className: k,
1151
1042
  ...y
1152
1043
  })
1153
1044
  });
1154
1045
  }
1155
- function Cn({ sources: e, spanCount: t, errorCount: n, selectedId: a, onSelect: r, renderSpanDetail: o, foldControls: l, search: i, query: c, setQuery: d, shortcuts: x, footer: v, className: h, ref: g, ...M }) {
1156
- const { all: m, matches: b, zoomed: k, zoom: y, pan: T, resetView: z, expandAll: $, collapseAll: E, expandOne: C, collapseOne: _ } = G(), L = at(), p = fe(null), f = fe(null), w = F((u) => {
1157
- p.current = u, typeof g == "function" ? g(u) : g != null && (g.current = u);
1158
- }, [g]), A = O(() => b == null ? [] : m.filter((u) => b.has(u.id)).map((u) => u.id), [m, b]), [te, D] = Y(0);
1159
- ae(() => D(0), [c]);
1160
- const R = A.length > 0 ? A[te % A.length] ?? null : null, B = F((u) => {
1161
- A.length !== 0 && D((U) => (U + u + A.length) % A.length);
1162
- }, [A.length]);
1163
- ae(() => {
1164
- if (R == null) return;
1165
- const u = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(R) : R.replace(/"/g, '\\"');
1046
+ function xn({ sources: e, spanCount: t, errorCount: n, selectedId: a, onSelect: r, renderSpanDetail: o, foldControls: l, search: i, query: c, setQuery: d, shortcuts: x, footer: b, className: h, ref: v, ...A }) {
1047
+ const { all: m, matches: g, zoomed: k, zoom: y, pan: _, resetView: L, expandAll: P, collapseAll: E, expandOne: S, collapseOne: I } = j(), R = dt(), p = fe(null), f = fe(null), w = F((u) => {
1048
+ p.current = u, typeof v == "function" ? v(u) : v != null && (v.current = u);
1049
+ }, [v]), C = O(() => g == null ? [] : m.filter((u) => g.has(u.id)).map((u) => u.id), [m, g]), [ee, D] = J(0);
1050
+ ne(() => D(0), [c]);
1051
+ const z = C.length > 0 ? C[ee % C.length] ?? null : null, W = F((u) => {
1052
+ C.length !== 0 && D((U) => (U + u + C.length) % C.length);
1053
+ }, [C.length]);
1054
+ ne(() => {
1055
+ if (z == null) return;
1056
+ const u = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(z) : z.replace(/"/g, '\\"');
1166
1057
  p.current?.querySelector(`[data-trace-row][data-span-id="${u}"]`)?.scrollIntoView?.({ block: "nearest" });
1167
- }, [R]);
1168
- const W = c !== "", ne = a != null && r != null;
1169
- ae(() => {
1170
- if (!W && !k && !ne || x === !1) return;
1058
+ }, [z]);
1059
+ const K = c !== "", te = a != null && r != null;
1060
+ ne(() => {
1061
+ if (!K && !k && !te || x === !1) return;
1171
1062
  const u = (U) => {
1172
- U.key === "Escape" && (x === "focus" && !(U.target instanceof Node && p.current?.contains(U.target)) || (U.preventDefault(), U.stopPropagation(), W ? d("") : k ? z() : r?.(null)));
1063
+ U.key === "Escape" && (x === "focus" && !(U.target instanceof Node && p.current?.contains(U.target)) || (U.preventDefault(), U.stopPropagation(), K ? d("") : k ? L() : r?.(null)));
1173
1064
  };
1174
1065
  return document.addEventListener("keydown", u, !0), () => document.removeEventListener("keydown", u, !0);
1175
1066
  }, [
1176
- W,
1067
+ K,
1177
1068
  k,
1178
- ne,
1069
+ te,
1179
1070
  x,
1180
1071
  d,
1181
- z,
1072
+ L,
1182
1073
  r
1183
1074
  ]);
1184
1075
  const V = F((u) => {
1185
- if (u.metaKey || u.ctrlKey || u.altKey || wn(u.target)) return !1;
1076
+ if (u.metaKey || u.ctrlKey || u.altKey || mn(u.target)) return !1;
1186
1077
  switch (u.key) {
1187
1078
  case "[":
1188
- return $(), !0;
1079
+ return P(), !0;
1189
1080
  case "]":
1190
1081
  return E(), !0;
1191
1082
  case "o":
1192
- return C(), !0;
1083
+ return S(), !0;
1193
1084
  case "p":
1194
- return _(), !0;
1085
+ return I(), !0;
1195
1086
  case "ArrowUp":
1196
- return y(u.shiftKey ? Me : ke), !0;
1087
+ return y(u.shiftKey ? Ae : ke), !0;
1197
1088
  case "ArrowDown":
1198
- return k ? (y(u.shiftKey ? 1 / Me : 1 / ke), !0) : !1;
1089
+ return k ? (y(u.shiftKey ? 1 / Ae : 1 / ke), !0) : !1;
1199
1090
  case "ArrowLeft":
1200
- return k ? (T(u.shiftKey ? -0.3 : -0.1), !0) : !1;
1091
+ return k ? (_(u.shiftKey ? -0.3 : -0.1), !0) : !1;
1201
1092
  case "ArrowRight":
1202
- return k ? (T(u.shiftKey ? fn : mn), !0) : !1;
1093
+ return k ? (_(u.shiftKey ? ln : on), !0) : !1;
1203
1094
  case "/":
1204
1095
  return f.current == null ? !1 : (f.current.focus(), !0);
1205
1096
  case "f":
1206
- return A.length === 0 ? !1 : (B(1), !0);
1097
+ return C.length === 0 ? !1 : (W(1), !0);
1207
1098
  case "b":
1208
- return A.length === 0 ? !1 : (B(-1), !0);
1099
+ return C.length === 0 ? !1 : (W(-1), !0);
1209
1100
  default:
1210
1101
  return !1;
1211
1102
  }
1212
1103
  }, [
1213
- $,
1104
+ P,
1214
1105
  E,
1215
- C,
1216
- _,
1106
+ S,
1107
+ I,
1217
1108
  y,
1218
- T,
1109
+ _,
1219
1110
  k,
1220
- A.length,
1221
- B
1111
+ C.length,
1112
+ W
1222
1113
  ]);
1223
- ae(() => {
1114
+ ne(() => {
1224
1115
  if (x === !1) return;
1225
1116
  const u = (U) => {
1226
1117
  x === "focus" && !(U.target instanceof Node && p.current?.contains(U.target)) || V(U) && U.preventDefault();
1227
1118
  };
1228
1119
  return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
1229
1120
  }, [x, V]);
1230
- const re = O(() => ({
1121
+ const ae = O(() => ({
1231
1122
  spans: e,
1232
1123
  selectedId: a,
1233
1124
  onSelect: r,
1234
1125
  renderSpanDetail: o,
1235
- idBase: L,
1126
+ idBase: R,
1236
1127
  spanCount: t,
1237
1128
  errorCount: n,
1238
- activeMatchId: R
1129
+ activeMatchId: z
1239
1130
  }), [
1240
1131
  e,
1241
1132
  a,
1242
1133
  r,
1243
1134
  o,
1244
- L,
1135
+ R,
1245
1136
  t,
1246
1137
  n,
1247
- R
1248
- ]), I = m.some((u) => u.hasChildren), P = i === !0 || typeof i == "string", Z = typeof i == "string" ? i : "Search spans", pe = v === void 0 ? t > 0 ? /* @__PURE__ */ s(Xe, {}) : null : v;
1138
+ z
1139
+ ]), T = m.some((u) => u.hasChildren), $ = i === !0 || typeof i == "string", H = typeof i == "string" ? i : "Search spans", pe = b === void 0 ? t > 0 ? /* @__PURE__ */ s(Xe, {}) : null : b;
1249
1140
  return /* @__PURE__ */ s(je.Provider, {
1250
- value: re,
1141
+ value: ae,
1251
1142
  children: /* @__PURE__ */ N("section", {
1252
1143
  ref: w,
1253
1144
  "data-trace": "",
1254
1145
  "data-zoomed": k || void 0,
1255
1146
  "aria-label": "Trace",
1256
1147
  tabIndex: x === "focus" ? -1 : void 0,
1257
- className: S(We, "min-w-0 outline-none", h),
1258
- ...M,
1148
+ className: M(Ke, "min-w-0 outline-none", h),
1149
+ ...A,
1259
1150
  children: [
1260
- P ? /* @__PURE__ */ N("div", {
1151
+ $ ? /* @__PURE__ */ N("div", {
1261
1152
  "data-trace-toolbar": "",
1262
1153
  className: "border-pho-secondary flex min-h-10 items-center gap-3 border-b px-5",
1263
- children: [/* @__PURE__ */ s(et, {
1154
+ children: [/* @__PURE__ */ s(it, {
1264
1155
  ref: f,
1265
1156
  value: c,
1266
1157
  onChange: d,
1267
1158
  onClear: () => d(""),
1268
- placeholder: Z,
1269
- "aria-label": Z,
1159
+ placeholder: H,
1160
+ "aria-label": H,
1270
1161
  onKeyDown: (u) => {
1271
- u.key === "Enter" ? (u.preventDefault(), B(u.shiftKey ? -1 : 1)) : u.key === "Escape" && c !== "" && (u.preventDefault(), d(""));
1162
+ u.key === "Enter" ? (u.preventDefault(), W(u.shiftKey ? -1 : 1)) : u.key === "Escape" && c !== "" && (u.preventDefault(), d(""));
1272
1163
  }
1273
- }), W ? /* @__PURE__ */ N(Ee, { children: [/* @__PURE__ */ s("span", {
1164
+ }), K ? /* @__PURE__ */ N(Ee, { children: [/* @__PURE__ */ s("span", {
1274
1165
  "data-trace-match-count": "",
1275
1166
  "aria-live": "polite",
1276
1167
  className: "text-pho-description shrink-0 text-xs tabular-nums",
1277
- children: A.length === 0 ? "No matches" : `${te % A.length + 1} of ${A.length}`
1168
+ children: C.length === 0 ? "No matches" : `${ee % C.length + 1} of ${C.length}`
1278
1169
  }), /* @__PURE__ */ N("span", {
1279
1170
  className: "flex shrink-0 items-center",
1280
1171
  children: [/* @__PURE__ */ s("button", {
1281
1172
  type: "button",
1282
1173
  "aria-label": "Previous match",
1283
1174
  title: "Previous match (b)",
1284
- disabled: A.length === 0,
1285
- onClick: () => B(-1),
1286
- className: se,
1175
+ disabled: C.length === 0,
1176
+ onClick: () => W(-1),
1177
+ className: re,
1287
1178
  children: /* @__PURE__ */ s(Te, {
1288
1179
  "aria-hidden": !0,
1289
1180
  className: "size-4"
@@ -1292,10 +1183,10 @@ function Cn({ sources: e, spanCount: t, errorCount: n, selectedId: a, onSelect:
1292
1183
  type: "button",
1293
1184
  "aria-label": "Next match",
1294
1185
  title: "Next match (f)",
1295
- disabled: A.length === 0,
1296
- onClick: () => B(1),
1297
- className: se,
1298
- children: /* @__PURE__ */ s(Ie, {
1186
+ disabled: C.length === 0,
1187
+ onClick: () => W(1),
1188
+ className: re,
1189
+ children: /* @__PURE__ */ s(_e, {
1299
1190
  "aria-hidden": !0,
1300
1191
  className: "size-4"
1301
1192
  })
@@ -1304,33 +1195,33 @@ function Cn({ sources: e, spanCount: t, errorCount: n, selectedId: a, onSelect:
1304
1195
  }) : null,
1305
1196
  /* @__PURE__ */ N("div", {
1306
1197
  "data-trace-axis": "",
1307
- className: S(Ke, "border-pho-secondary h-10 border-b"),
1198
+ className: M(Be, "border-pho-secondary h-10 border-b"),
1308
1199
  children: [/* @__PURE__ */ N("div", {
1309
1200
  className: "flex h-10 min-w-0 items-center gap-2 px-5",
1310
- children: [k ? /* @__PURE__ */ s(Sn, {}) : null, l && I ? /* @__PURE__ */ s(_n, {}) : null]
1311
- }), /* @__PURE__ */ s(In, {})]
1201
+ children: [k ? /* @__PURE__ */ s(yn, {}) : null, l && T ? /* @__PURE__ */ s(wn, {}) : null]
1202
+ }), /* @__PURE__ */ s(Nn, {})]
1312
1203
  }),
1313
- /* @__PURE__ */ s(H.Timeline, {
1204
+ /* @__PURE__ */ s(X.Timeline, {
1314
1205
  render: /* @__PURE__ */ s("ol", {
1315
1206
  "aria-label": "Spans",
1316
1207
  className: "m-0 list-none p-0"
1317
1208
  }),
1318
- children: /* @__PURE__ */ s(H.Children, { children: () => /* @__PURE__ */ s(Nn, {}) })
1209
+ children: /* @__PURE__ */ s(X.Children, { children: () => /* @__PURE__ */ s(fn, {}) })
1319
1210
  }),
1320
1211
  pe
1321
1212
  ]
1322
1213
  })
1323
1214
  });
1324
1215
  }
1325
- function Sn() {
1326
- const { range: e, viewRange: t, resetView: n } = G(), a = `${Q(t.min - e.min)} – ${Q(t.max - e.min)}`;
1216
+ function yn() {
1217
+ const { range: e, viewRange: t, resetView: n } = j(), a = `${Y(t.min - e.min)} – ${Y(t.max - e.min)}`;
1327
1218
  return /* @__PURE__ */ N("button", {
1328
1219
  type: "button",
1329
1220
  "data-trace-zoom-chip": "",
1330
1221
  onClick: n,
1331
1222
  title: "Reset zoom (Esc)",
1332
1223
  "aria-label": `Zoomed to ${a}. Reset zoom`,
1333
- className: S(tt({
1224
+ className: M(lt({
1334
1225
  size: "xs",
1335
1226
  contrast: "low",
1336
1227
  color: "brand"
@@ -1338,14 +1229,14 @@ function Sn() {
1338
1229
  children: [/* @__PURE__ */ s("span", {
1339
1230
  "aria-hidden": !0,
1340
1231
  children: a
1341
- }), /* @__PURE__ */ s(Ze, {
1232
+ }), /* @__PURE__ */ s(Ye, {
1342
1233
  "aria-hidden": !0,
1343
1234
  className: "size-3"
1344
1235
  })]
1345
1236
  });
1346
1237
  }
1347
- function _n() {
1348
- const { canExpand: e, canCollapse: t, expandAll: n, collapseAll: a, expandOne: r, collapseOne: o } = G();
1238
+ function wn() {
1239
+ const { canExpand: e, canCollapse: t, expandAll: n, collapseAll: a, expandOne: r, collapseOne: o } = j();
1349
1240
  return /* @__PURE__ */ N("fieldset", {
1350
1241
  "data-trace-fold-controls": "",
1351
1242
  className: "m-0 ml-auto flex min-w-0 shrink-0 items-center border-0 p-0",
@@ -1360,8 +1251,8 @@ function _n() {
1360
1251
  title: "Expand one level (o)",
1361
1252
  disabled: !e,
1362
1253
  onClick: r,
1363
- className: se,
1364
- children: /* @__PURE__ */ s(Ie, {
1254
+ className: re,
1255
+ children: /* @__PURE__ */ s(_e, {
1365
1256
  "aria-hidden": !0,
1366
1257
  className: "size-4"
1367
1258
  })
@@ -1372,7 +1263,7 @@ function _n() {
1372
1263
  title: "Collapse one level (p)",
1373
1264
  disabled: !t,
1374
1265
  onClick: o,
1375
- className: se,
1266
+ className: re,
1376
1267
  children: /* @__PURE__ */ s(Te, {
1377
1268
  "aria-hidden": !0,
1378
1269
  className: "size-4"
@@ -1384,8 +1275,8 @@ function _n() {
1384
1275
  title: "Expand all ([)",
1385
1276
  disabled: !e,
1386
1277
  onClick: n,
1387
- className: se,
1388
- children: /* @__PURE__ */ s(ct, {
1278
+ className: re,
1279
+ children: /* @__PURE__ */ s(pt, {
1389
1280
  "aria-hidden": !0,
1390
1281
  className: "size-4"
1391
1282
  })
@@ -1396,8 +1287,8 @@ function _n() {
1396
1287
  title: "Collapse all (])",
1397
1288
  disabled: !t,
1398
1289
  onClick: a,
1399
- className: se,
1400
- children: /* @__PURE__ */ s(ut, {
1290
+ className: re,
1291
+ children: /* @__PURE__ */ s(mt, {
1401
1292
  "aria-hidden": !0,
1402
1293
  className: "size-4"
1403
1294
  })
@@ -1405,70 +1296,70 @@ function _n() {
1405
1296
  ]
1406
1297
  });
1407
1298
  }
1408
- function In() {
1409
- const { range: e, view: t, zoomed: n, setView: a, resetView: r } = G(), o = e.max - e.min, l = O(() => on(0, o), [o]), [i, c] = Y(280), d = fe(null);
1410
- ae(() => {
1299
+ function Nn() {
1300
+ const { range: e, view: t, zoomed: n, setView: a, resetView: r } = j(), o = e.max - e.min, l = O(() => qt(0, o), [o]), [i, c] = J(280), d = fe(null);
1301
+ ne(() => {
1411
1302
  const p = d.current;
1412
1303
  if (p == null) return;
1413
1304
  const f = () => {
1414
- const A = p.clientWidth;
1415
- A > 0 && c(A);
1305
+ const C = p.clientWidth;
1306
+ C > 0 && c(C);
1416
1307
  };
1417
1308
  f();
1418
1309
  const w = new ResizeObserver(f);
1419
1310
  return w.observe(p), () => w.disconnect();
1420
1311
  }, []);
1421
- const x = new Map(Fe(l, i).map((p) => [p.ms, p.align])), [v, h] = Y(null), [g, M] = Y(null), m = (p) => {
1312
+ const x = new Map(Fe(l, i).map((p) => [p.ms, p.align])), [b, h] = J(null), [v, A] = J(null), m = (p) => {
1422
1313
  const f = d.current?.getBoundingClientRect();
1423
1314
  return f == null || f.width <= 0 ? 0 : Math.min(1, Math.max(0, (p.clientX - f.left) / f.width));
1424
- }, b = (p, f) => {
1425
- d.current?.setPointerCapture?.(p.pointerId), M(f);
1315
+ }, g = (p, f) => {
1316
+ d.current?.setPointerCapture?.(p.pointerId), A(f);
1426
1317
  }, k = (p) => {
1427
1318
  if (p.button !== 0) return;
1428
1319
  const f = m(p);
1429
- b(p, {
1320
+ g(p, {
1430
1321
  kind: "select",
1431
1322
  from: f,
1432
1323
  to: f
1433
1324
  });
1434
1325
  }, y = (p) => (f) => {
1435
- f.button === 0 && (f.stopPropagation(), b(f, {
1326
+ f.button === 0 && (f.stopPropagation(), g(f, {
1436
1327
  kind: "resize",
1437
1328
  edge: p
1438
1329
  }));
1439
- }, T = (p) => {
1330
+ }, _ = (p) => {
1440
1331
  const f = m(p);
1441
- if (g == null) {
1332
+ if (v == null) {
1442
1333
  h(f);
1443
1334
  return;
1444
1335
  }
1445
- g.kind === "select" ? M({
1446
- ...g,
1336
+ v.kind === "select" ? A({
1337
+ ...v,
1447
1338
  to: f
1448
- }) : a(g.edge === "start" ? [Math.min(f, t[1] - J), t[1]] : [t[0], Math.max(f, t[0] + J)]);
1449
- }, z = (p) => {
1450
- if (g == null) return;
1339
+ }) : a(v.edge === "start" ? [Math.min(f, t[1] - Z), t[1]] : [t[0], Math.max(f, t[0] + Z)]);
1340
+ }, L = (p) => {
1341
+ if (v == null) return;
1451
1342
  const f = m(p);
1452
- if (M(null), g.kind !== "select") {
1453
- a(g.edge === "start" ? [Math.min(f, t[1] - J), t[1]] : [t[0], Math.max(f, t[0] + J)]);
1343
+ if (A(null), v.kind !== "select") {
1344
+ a(v.edge === "start" ? [Math.min(f, t[1] - Z), t[1]] : [t[0], Math.max(f, t[0] + Z)]);
1454
1345
  return;
1455
1346
  }
1456
- const [w, A] = g.from < f ? [g.from, f] : [f, g.from];
1457
- A - w < vn || a([w, A]);
1458
- }, $ = () => {
1459
- h(null), M(null);
1347
+ const [w, C] = v.from < f ? [v.from, f] : [f, v.from];
1348
+ C - w < cn || a([w, C]);
1349
+ }, P = () => {
1350
+ h(null), A(null);
1460
1351
  }, E = () => {
1461
- h(null), g?.kind === "select" && M(null);
1462
- }, C = g?.kind === "select" ? g : null, _ = C != null ? C.from < C.to ? {
1463
- left: C.from,
1464
- width: C.to - C.from
1352
+ h(null), v?.kind === "select" && A(null);
1353
+ }, S = v?.kind === "select" ? v : null, I = S != null ? S.from < S.to ? {
1354
+ left: S.from,
1355
+ width: S.to - S.from
1465
1356
  } : {
1466
- left: C.to,
1467
- width: C.from - C.to
1357
+ left: S.to,
1358
+ width: S.from - S.to
1468
1359
  } : n ? {
1469
1360
  left: t[0],
1470
1361
  width: t[1] - t[0]
1471
- } : null, L = (p) => p * o;
1362
+ } : null, R = (p) => p * o;
1472
1363
  return /* @__PURE__ */ s(Ue, {
1473
1364
  className: "h-10",
1474
1365
  children: /* @__PURE__ */ N("div", {
@@ -1479,9 +1370,9 @@ function In() {
1479
1370
  title: "Drag to zoom, double-click to reset",
1480
1371
  className: "absolute inset-0 cursor-crosshair touch-none select-none",
1481
1372
  onPointerDown: k,
1482
- onPointerMove: T,
1483
- onPointerUp: z,
1484
- onPointerCancel: $,
1373
+ onPointerMove: _,
1374
+ onPointerUp: L,
1375
+ onPointerCancel: P,
1485
1376
  onPointerLeave: E,
1486
1377
  onDoubleClick: r,
1487
1378
  children: [
@@ -1491,83 +1382,83 @@ function In() {
1491
1382
  "data-trace-tick": "",
1492
1383
  "data-labeled": f != null || void 0,
1493
1384
  className: "text-pho-description absolute inset-y-0 text-xs tabular-nums",
1494
- style: { left: K(p.at) },
1385
+ style: { left: B(p.at) },
1495
1386
  children: [/* @__PURE__ */ s("span", { className: "bg-pho-secondary absolute bottom-0 left-0 h-1.5 w-px" }), f != null ? /* @__PURE__ */ s("span", {
1496
- className: S("absolute inset-y-0 flex items-center whitespace-nowrap", f === "end" ? "right-1" : "left-1"),
1387
+ className: M("absolute inset-y-0 flex items-center whitespace-nowrap", f === "end" ? "right-1" : "left-1"),
1497
1388
  children: Oe(p.ms)
1498
1389
  }) : null]
1499
1390
  }, p.ms);
1500
1391
  }),
1501
- v != null && g == null ? /* @__PURE__ */ s("span", {
1392
+ b != null && v == null ? /* @__PURE__ */ s("span", {
1502
1393
  "data-trace-cursor": "",
1503
1394
  className: "bg-pho-inverse/40 pointer-events-none absolute inset-y-0 w-px",
1504
- style: { left: K(v) },
1395
+ style: { left: B(b) },
1505
1396
  children: /* @__PURE__ */ s("span", {
1506
- className: S("bg-pho-primary text-pho-secondary absolute top-1/2 z-10 -translate-y-1/2 rounded-sm px-1 text-[10px] whitespace-nowrap tabular-nums", v > 0.8 ? "right-1" : "left-1"),
1507
- children: Q(L(v))
1397
+ className: M("bg-pho-primary text-pho-secondary absolute top-1/2 z-10 -translate-y-1/2 rounded-sm px-1 text-[10px] whitespace-nowrap tabular-nums", b > 0.8 ? "right-1" : "left-1"),
1398
+ children: Y(R(b))
1508
1399
  })
1509
1400
  }) : null,
1510
- _ ? /* @__PURE__ */ N(Ee, { children: [
1401
+ I ? /* @__PURE__ */ N(Ee, { children: [
1511
1402
  /* @__PURE__ */ s("span", {
1512
1403
  "data-trace-selection-shade": "start",
1513
1404
  className: "bg-pho-inverse/10 pointer-events-none absolute inset-y-0 left-0",
1514
- style: { width: K(_.left) }
1405
+ style: { width: B(I.left) }
1515
1406
  }),
1516
1407
  /* @__PURE__ */ s("span", {
1517
1408
  "data-trace-selection-shade": "end",
1518
1409
  className: "bg-pho-inverse/10 pointer-events-none absolute inset-y-0 right-0",
1519
- style: { width: K(1 - _.left - _.width) }
1410
+ style: { width: B(1 - I.left - I.width) }
1520
1411
  }),
1521
1412
  /* @__PURE__ */ s("span", {
1522
1413
  "data-trace-selection": "",
1523
- "data-selecting": C != null || void 0,
1414
+ "data-selecting": S != null || void 0,
1524
1415
  className: "border-pho-ink bg-pho-primary pointer-events-none absolute inset-y-0 flex items-center justify-center border-x-2",
1525
1416
  style: {
1526
- left: K(_.left),
1527
- width: K(_.width)
1417
+ left: B(I.left),
1418
+ width: B(I.width)
1528
1419
  },
1529
1420
  children: /* @__PURE__ */ N("span", {
1530
1421
  className: "bg-pho-primary text-pho-primary z-10 rounded-sm px-1 text-[10px] whitespace-nowrap tabular-nums",
1531
1422
  children: [
1532
- Q(L(_.left)),
1423
+ Y(R(I.left)),
1533
1424
  " –",
1534
1425
  " ",
1535
- Q(L(_.left + _.width))
1426
+ Y(R(I.left + I.width))
1536
1427
  ]
1537
1428
  })
1538
1429
  }),
1539
- /* @__PURE__ */ s(Se, {
1540
- at: _.left,
1430
+ /* @__PURE__ */ s(Me, {
1431
+ at: I.left,
1541
1432
  "data-trace-selection-handle": "start",
1542
- className: S(C == null && "cursor-ew-resize"),
1543
- onPointerDown: C == null ? y("start") : void 0
1433
+ className: M(S == null && "cursor-ew-resize"),
1434
+ onPointerDown: S == null ? y("start") : void 0
1544
1435
  }),
1545
- /* @__PURE__ */ s(Se, {
1546
- at: _.left + _.width,
1436
+ /* @__PURE__ */ s(Me, {
1437
+ at: I.left + I.width,
1547
1438
  "data-trace-selection-handle": "end",
1548
- className: S(C == null && "cursor-ew-resize"),
1549
- onPointerDown: C == null ? y("end") : void 0
1439
+ className: M(S == null && "cursor-ew-resize"),
1440
+ onPointerDown: S == null ? y("end") : void 0
1550
1441
  })
1551
1442
  ] }) : null
1552
1443
  ]
1553
1444
  })
1554
1445
  });
1555
1446
  }
1556
- function Se({ at: e, className: t, ...n }) {
1447
+ function Me({ at: e, className: t, ...n }) {
1557
1448
  return /* @__PURE__ */ N("span", {
1558
1449
  "aria-hidden": !0,
1559
- className: S("border-pho-ink bg-pho-primary absolute top-1/2 z-10 flex h-5 w-2.5 -translate-x-1/2 -translate-y-1/2 items-center justify-center gap-0.5 rounded-sm border shadow-sm", t),
1560
- style: { left: K(e) },
1450
+ className: M("border-pho-ink bg-pho-primary absolute top-1/2 z-10 flex h-5 w-2.5 -translate-x-1/2 -translate-y-1/2 items-center justify-center gap-0.5 rounded-sm border shadow-sm", t),
1451
+ style: { left: B(e) },
1561
1452
  ...n,
1562
1453
  children: [/* @__PURE__ */ s("span", { className: "bg-pho-inverse h-2.5 w-px" }), /* @__PURE__ */ s("span", { className: "bg-pho-inverse h-2.5 w-px" })]
1563
1454
  });
1564
1455
  }
1565
- function Tn({ spanCount: e, errorCount: t, orphanCount: n = 0, durationMs: a }) {
1566
- const r = [ce(e, "span")];
1567
- return t > 0 && r.push(ce(t, "error")), n > 0 && r.push(`${n} missing ${n === 1 ? "parent" : "parents"}`), r.push(`${Q(a)} total`), r;
1456
+ function kn({ spanCount: e, errorCount: t, orphanCount: n = 0, durationMs: a }) {
1457
+ const r = [le(e, "span")];
1458
+ return t > 0 && r.push(le(t, "error")), n > 0 && r.push(`${n} missing ${n === 1 ? "parent" : "parents"}`), r.push(`${Y(a)} total`), r;
1568
1459
  }
1569
1460
  function Xe({ className: e, ...t }) {
1570
- const { spanCount: n, errorCount: a } = Ge(), { range: r, orphans: o } = G(), l = Tn({
1461
+ const { spanCount: n, errorCount: a } = Ge(), { range: r, orphans: o } = j(), l = kn({
1571
1462
  spanCount: n,
1572
1463
  errorCount: a,
1573
1464
  orphanCount: o,
@@ -1575,15 +1466,15 @@ function Xe({ className: e, ...t }) {
1575
1466
  });
1576
1467
  return /* @__PURE__ */ N("div", {
1577
1468
  "data-trace-footer": "",
1578
- className: S("border-pho-secondary text-pho-description @container flex h-10 items-center justify-between gap-3 border-t px-5 text-xs", e),
1469
+ className: M("border-pho-secondary text-pho-description @container flex h-10 items-center justify-between gap-3 border-t px-5 text-xs", e),
1579
1470
  ...t,
1580
1471
  children: [/* @__PURE__ */ N("ul", {
1581
1472
  "data-trace-legend": "",
1582
1473
  className: "hidden shrink-0 items-center gap-3 @2xl:flex",
1583
- children: [/* @__PURE__ */ s(_e, {
1474
+ children: [/* @__PURE__ */ s(Ie, {
1584
1475
  className: "bg-pho-inverse/25",
1585
1476
  label: "Span"
1586
- }), /* @__PURE__ */ s(_e, {
1477
+ }), /* @__PURE__ */ s(Ie, {
1587
1478
  className: "bg-pho-error-ink",
1588
1479
  label: "Error"
1589
1480
  })]
@@ -1596,28 +1487,28 @@ function Xe({ className: e, ...t }) {
1596
1487
  })]
1597
1488
  });
1598
1489
  }
1599
- function _e({ className: e, label: t }) {
1490
+ function Ie({ className: e, label: t }) {
1600
1491
  return /* @__PURE__ */ N("li", {
1601
1492
  className: "flex items-center gap-1.5",
1602
1493
  children: [/* @__PURE__ */ s("span", {
1603
1494
  "aria-hidden": !0,
1604
- className: S("size-2.5 shrink-0 rounded-sm", e)
1495
+ className: M("size-2.5 shrink-0 rounded-sm", e)
1605
1496
  }), t]
1606
1497
  });
1607
1498
  }
1608
- var En = {
1499
+ var An = {
1609
1500
  debug: "text-pho-description",
1610
1501
  info: "text-pho-secondary",
1611
1502
  warn: "text-pho-warning",
1612
1503
  error: "text-pho-error"
1613
- }, me = "grid grid-cols-[5rem_3.5rem_minmax(0,1fr)] gap-3 px-5", $n = 5;
1614
- function Pn({ logs: e, spans: t, loading: n, title: a, className: r, ...o }) {
1615
- const l = O(() => new Map((t ?? []).map((c) => [c.id, c.name])), [t]), i = n ? Array.from({ length: n === !0 ? $n : n }) : [];
1504
+ }, me = "grid grid-cols-[5rem_3.5rem_minmax(0,1fr)] gap-3 px-5", Cn = 5;
1505
+ function Sn({ logs: e, spans: t, loading: n, title: a, className: r, ...o }) {
1506
+ const l = O(() => new Map((t ?? []).map((c) => [c.id, c.name])), [t]), i = n ? Array.from({ length: n === !0 ? Cn : n }) : [];
1616
1507
  return i.length === 0 && (e == null || e.length === 0) ? null : /* @__PURE__ */ N("section", {
1617
1508
  ...o,
1618
1509
  "data-trace-logs": "",
1619
1510
  "aria-busy": i.length > 0 ? !0 : void 0,
1620
- className: S(We, "min-w-0", Je.sm, r),
1511
+ className: M(Ke, "min-w-0", at.sm, r),
1621
1512
  children: [
1622
1513
  a ? /* @__PURE__ */ s("span", {
1623
1514
  className: "sr-only",
@@ -1625,7 +1516,7 @@ function Pn({ logs: e, spans: t, loading: n, title: a, className: r, ...o }) {
1625
1516
  }) : null,
1626
1517
  /* @__PURE__ */ N("div", {
1627
1518
  "data-trace-logs-header": "",
1628
- className: S(me, Ye, "items-center"),
1519
+ className: M(me, rt, "items-center"),
1629
1520
  children: [
1630
1521
  /* @__PURE__ */ s("span", { children: "Offset" }),
1631
1522
  /* @__PURE__ */ s("span", { children: "Level" }),
@@ -1633,32 +1524,32 @@ function Pn({ logs: e, spans: t, loading: n, title: a, className: r, ...o }) {
1633
1524
  ]
1634
1525
  }),
1635
1526
  /* @__PURE__ */ s("ol", {
1636
- className: S(qe, "m-0 list-none p-0 font-mono"),
1527
+ className: M(ot, "m-0 list-none p-0 font-mono"),
1637
1528
  children: i.length > 0 ? i.map((c, d) => /* @__PURE__ */ N("li", {
1638
- className: S(me, "h-10 items-center"),
1529
+ className: M(me, "h-10 items-center"),
1639
1530
  children: [
1640
1531
  /* @__PURE__ */ s(he, { className: "h-3.5 w-14" }),
1641
1532
  /* @__PURE__ */ s(he, { className: "h-3.5 w-9" }),
1642
1533
  /* @__PURE__ */ s(he, { className: "h-3.5 w-64 max-w-full" })
1643
1534
  ]
1644
1535
  }, d)) : e.map((c, d) => {
1645
- const x = c.level ?? "info", v = c.spanId ? l.get(c.spanId) : void 0;
1536
+ const x = c.level ?? "info", b = c.spanId ? l.get(c.spanId) : void 0;
1646
1537
  return /* @__PURE__ */ N("li", {
1647
- className: S(me, "items-baseline py-1.5"),
1538
+ className: M(me, "items-baseline py-1.5"),
1648
1539
  children: [
1649
1540
  /* @__PURE__ */ N("span", {
1650
1541
  className: "text-pho-description tabular-nums",
1651
- children: ["+", Q(c.offsetMs)]
1542
+ children: ["+", Y(c.offsetMs)]
1652
1543
  }),
1653
1544
  /* @__PURE__ */ s("span", {
1654
- className: S("truncate", En[x]),
1545
+ className: M("truncate", An[x]),
1655
1546
  children: x.charAt(0).toUpperCase() + x.slice(1)
1656
1547
  }),
1657
1548
  /* @__PURE__ */ N("span", {
1658
1549
  className: "text-pho-primary [overflow-wrap:anywhere] whitespace-pre-wrap",
1659
- children: [c.message, v ? /* @__PURE__ */ N("span", {
1550
+ children: [c.message, b ? /* @__PURE__ */ N("span", {
1660
1551
  className: "text-pho-description",
1661
- children: [" ", v]
1552
+ children: [" ", b]
1662
1553
  }) : null]
1663
1554
  })
1664
1555
  ]
@@ -1668,52 +1559,52 @@ function Pn({ logs: e, spans: t, loading: n, title: a, className: r, ...o }) {
1668
1559
  ]
1669
1560
  });
1670
1561
  }
1671
- var Dn = Object.assign(An, { Footer: Xe }), Qn = {
1672
- Waterfall: Dn,
1673
- Logs: Pn
1562
+ var Mn = Object.assign(gn, { Footer: Xe }), Wn = {
1563
+ Waterfall: Mn,
1564
+ Logs: Sn
1674
1565
  };
1675
1566
  export {
1676
- It as A,
1677
- Pe as B,
1567
+ Nt as A,
1568
+ $e as B,
1678
1569
  xe as C,
1679
- Zn as D,
1680
- Ct as E,
1681
- Dt as F,
1682
- zt as I,
1683
- Et as L,
1684
- Tt as M,
1685
- Ot as N,
1686
- ie as O,
1687
- Rt as P,
1688
- Jn as R,
1689
- G as S,
1690
- _t as T,
1691
- Pt as V,
1692
- nn as _,
1570
+ Fn as D,
1571
+ xt as E,
1572
+ Mt as F,
1573
+ Tt as I,
1574
+ At as L,
1575
+ kt as M,
1576
+ Et as N,
1577
+ oe as O,
1578
+ It as P,
1579
+ Kn as R,
1580
+ j as S,
1581
+ wt as T,
1582
+ St as V,
1583
+ Zt as _,
1693
1584
  Ne as a,
1694
- H as b,
1695
- Yn as c,
1696
- an as d,
1697
- rn as f,
1698
- qt as g,
1699
- Qt as h,
1700
- on as i,
1701
- $e as j,
1702
- St as k,
1585
+ X as b,
1586
+ Bn as c,
1587
+ Jt as d,
1588
+ Yt as f,
1589
+ Gt as g,
1590
+ jt as h,
1591
+ qt as i,
1592
+ Pe as j,
1593
+ yt as k,
1703
1594
  Fe as l,
1704
- ve as m,
1705
- Tn as n,
1706
- Q as o,
1707
- Jt as p,
1708
- pn as r,
1595
+ be as m,
1596
+ kn as n,
1597
+ Y as o,
1598
+ Vt as p,
1599
+ rn as r,
1709
1600
  Oe as s,
1710
- Qn as t,
1711
- sn as u,
1712
- en as v,
1713
- J as w,
1714
- ee as x,
1715
- tn as y,
1716
- $t as z
1601
+ Wn as t,
1602
+ Qt as u,
1603
+ Xt as v,
1604
+ Z as w,
1605
+ q as x,
1606
+ Ht as y,
1607
+ Ct as z
1717
1608
  };
1718
1609
 
1719
- //# sourceMappingURL=trace-ClMpG82z.js.map
1610
+ //# sourceMappingURL=trace-CKYAff2U.js.map