@voltro/devtools 0.89.2 → 0.91.0

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.
@@ -1,6 +1,6 @@
1
- import { Plug as e } from "../components/icons.js";
2
- import { useDevtoolsStrings as t } from "../strings.js";
3
- import { Badge as n, Button as r, Card as i, Empty as a, KeyValue as o, SectionTitle as s } from "../components/primitives.js";
1
+ import { Badge as e, Button as t, Card as n, Empty as r, KeyValue as i, SectionTitle as a } from "../components/primitives.js";
2
+ import { Plug as o } from "../components/icons.js";
3
+ import { useDevtoolsStrings as s } from "../strings.js";
4
4
  import { useCallback as c, useEffect as l, useState as u } from "react";
5
5
  import { useAppUpdate as d, useInstallPrompt as f, useOfflineStatus as p } from "@voltro/web";
6
6
  import { usePlatform as m } from "@voltro/client";
@@ -41,7 +41,7 @@ var v = (e, t) => ({
41
41
  pushEndpointHost: c
42
42
  };
43
43
  }, S = (e) => e === "activated" ? "success" : e === null ? "neutral" : "warning", C = () => {
44
- let v = t().pwa, y = d(), b = f(), C = p(), w = m(), [T, E] = u(null), D = c(() => {
44
+ let v = s().pwa, y = d(), b = f(), C = p(), w = m(), [T, E] = u(null), D = c(() => {
45
45
  x().then(E);
46
46
  }, []);
47
47
  if (l(() => {
@@ -50,21 +50,21 @@ var v = (e, t) => ({
50
50
  return e?.serviceWorker?.addEventListener?.("controllerchange", D), () => {
51
51
  e?.serviceWorker?.removeEventListener?.("controllerchange", D);
52
52
  };
53
- }, [D]), T === null) return /* @__PURE__ */ g(a, { children: v.loading });
54
- if (!T.worker.supported) return /* @__PURE__ */ g(a, { children: v.unsupported });
53
+ }, [D]), T === null) return /* @__PURE__ */ g(r, { children: v.loading });
54
+ if (!T.worker.supported) return /* @__PURE__ */ g(r, { children: v.unsupported });
55
55
  let O = T.worker;
56
56
  return /* @__PURE__ */ _("div", {
57
57
  className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
58
58
  children: [
59
- /* @__PURE__ */ _(i, { children: [/* @__PURE__ */ g(s, {
60
- Icon: e,
61
- right: /* @__PURE__ */ g(r, {
59
+ /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
60
+ Icon: o,
61
+ right: /* @__PURE__ */ g(t, {
62
62
  size: "sm",
63
63
  onClick: D,
64
64
  children: v.refresh
65
65
  }),
66
66
  children: v.worker
67
- }), /* @__PURE__ */ g(o, { entries: [
67
+ }), /* @__PURE__ */ g(i, { entries: [
68
68
  {
69
69
  key: v.scope,
70
70
  value: O.scope ?? v.none
@@ -75,21 +75,21 @@ var v = (e, t) => ({
75
75
  },
76
76
  {
77
77
  key: "installing",
78
- value: /* @__PURE__ */ g(n, {
78
+ value: /* @__PURE__ */ g(e, {
79
79
  tone: S(O.installing),
80
80
  children: O.installing ?? v.none
81
81
  })
82
82
  },
83
83
  {
84
84
  key: "waiting",
85
- value: /* @__PURE__ */ g(n, {
85
+ value: /* @__PURE__ */ g(e, {
86
86
  tone: S(O.waiting),
87
87
  children: O.waiting ?? v.none
88
88
  })
89
89
  },
90
90
  {
91
91
  key: "active",
92
- value: /* @__PURE__ */ g(n, {
92
+ value: /* @__PURE__ */ g(e, {
93
93
  tone: S(O.active),
94
94
  children: O.active ?? v.none
95
95
  })
@@ -99,14 +99,14 @@ var v = (e, t) => ({
99
99
  value: O.backgroundSync ? v.yes : v.no
100
100
  }
101
101
  ] })] }),
102
- /* @__PURE__ */ _(i, { children: [/* @__PURE__ */ g(s, {
103
- right: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(r, {
102
+ /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
103
+ right: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(t, {
104
104
  size: "sm",
105
105
  onClick: () => {
106
106
  y.check();
107
107
  },
108
108
  children: v.checkNow
109
- }), /* @__PURE__ */ g(r, {
109
+ }), /* @__PURE__ */ g(t, {
110
110
  size: "sm",
111
111
  variant: "accent",
112
112
  disabled: !y.updateAvailable,
@@ -116,7 +116,7 @@ var v = (e, t) => ({
116
116
  children: v.forceUpdate
117
117
  })] }),
118
118
  children: v.update
119
- }), /* @__PURE__ */ g(o, { entries: [
119
+ }), /* @__PURE__ */ g(i, { entries: [
120
120
  {
121
121
  key: v.currentBuild,
122
122
  value: w.platform.appVersion ?? v.unknown
@@ -130,15 +130,15 @@ var v = (e, t) => ({
130
130
  value: C.online ? v.yes : v.no
131
131
  }
132
132
  ] })] }),
133
- /* @__PURE__ */ _(i, { children: [/* @__PURE__ */ g(s, { children: v.precache }), T.caches.length === 0 ? /* @__PURE__ */ g("div", {
133
+ /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, { children: v.precache }), T.caches.length === 0 ? /* @__PURE__ */ g("div", {
134
134
  className: "vdt:px-3 vdt:py-2 vdt:text-xs vdt:text-foreground-subtle",
135
135
  children: v.noCaches
136
- }) : /* @__PURE__ */ g(o, { entries: T.caches.map((e) => ({
136
+ }) : /* @__PURE__ */ g(i, { entries: T.caches.map((e) => ({
137
137
  key: e.name,
138
138
  value: v.entries(e.entries)
139
139
  })) })] }),
140
- /* @__PURE__ */ _(i, { children: [/* @__PURE__ */ g(s, {
141
- right: b.canInstall ? /* @__PURE__ */ g(r, {
140
+ /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
141
+ right: b.canInstall ? /* @__PURE__ */ g(t, {
142
142
  size: "sm",
143
143
  onClick: () => {
144
144
  b.install();
@@ -146,7 +146,7 @@ var v = (e, t) => ({
146
146
  children: v.install
147
147
  }) : void 0,
148
148
  children: v.installAndPush
149
- }), /* @__PURE__ */ g(o, { entries: [
149
+ }), /* @__PURE__ */ g(i, { entries: [
150
150
  {
151
151
  key: v.installed,
152
152
  value: b.installed ? v.yes : v.no
@@ -1,6 +1,6 @@
1
- import { Compass as e } from "../components/icons.js";
2
- import { useDevtoolsStrings as t } from "../strings.js";
3
- import { Card as n, Empty as r, KeyValue as i, SectionTitle as a } from "../components/primitives.js";
1
+ import { Card as e, Empty as t, KeyValue as n, SectionTitle as r } from "../components/primitives.js";
2
+ import { Compass as i } from "../components/icons.js";
3
+ import { useDevtoolsStrings as a } from "../strings.js";
4
4
  import { useEffect as o, useState as s, useSyncExternalStore as c } from "react";
5
5
  import { getRouteSnapshot as l, subscribeRouteSnapshot as u } from "@voltro/web";
6
6
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -23,18 +23,18 @@ var p = (e) => {
23
23
  };
24
24
  }, []), e;
25
25
  }, g = () => {
26
- let o = m(), c = h(), l = t().routes, [u, g] = s(!0), _ = o.pathname === "/" && Object.keys(o.params).length === 0 && o.loaderData === void 0 && c !== "/" ? c : o.pathname, v = Object.entries(o.params).map(([e, t]) => ({
26
+ let o = m(), c = h(), l = a().routes, [u, g] = s(!0), _ = o.pathname === "/" && Object.keys(o.params).length === 0 && o.loaderData === void 0 && c !== "/" ? c : o.pathname, v = Object.entries(o.params).map(([e, t]) => ({
27
27
  key: e,
28
28
  value: String(t)
29
29
  }));
30
30
  return /* @__PURE__ */ f("div", {
31
31
  className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
32
- children: [/* @__PURE__ */ f(n, { children: [
33
- /* @__PURE__ */ d(a, {
34
- Icon: e,
32
+ children: [/* @__PURE__ */ f(e, { children: [
33
+ /* @__PURE__ */ d(r, {
34
+ Icon: i,
35
35
  children: l.currentRoute
36
36
  }),
37
- /* @__PURE__ */ d(i, { entries: [{
37
+ /* @__PURE__ */ d(n, { entries: [{
38
38
  key: "pathname",
39
39
  value: _
40
40
  }, {
@@ -43,11 +43,11 @@ var p = (e) => {
43
43
  }] }),
44
44
  v.length > 0 ? /* @__PURE__ */ d("div", {
45
45
  className: "vdt:px-3 vdt:pb-3",
46
- children: /* @__PURE__ */ d(i, { entries: v })
46
+ children: /* @__PURE__ */ d(n, { entries: v })
47
47
  }) : null
48
- ] }), /* @__PURE__ */ f(n, { children: [
49
- /* @__PURE__ */ d(a, {
50
- Icon: e,
48
+ ] }), /* @__PURE__ */ f(e, { children: [
49
+ /* @__PURE__ */ d(r, {
50
+ Icon: i,
51
51
  children: l.loaderData
52
52
  }),
53
53
  /* @__PURE__ */ d("button", {
@@ -55,7 +55,7 @@ var p = (e) => {
55
55
  className: "vdt:px-3 vdt:py-1.5 vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:text-foreground-muted vdt:hover:text-foreground",
56
56
  children: u ? l.collapse : l.expand
57
57
  }),
58
- u ? o.loaderData === void 0 ? /* @__PURE__ */ f(r, { children: [l.noLoaderTitle, /* @__PURE__ */ d("div", {
58
+ u ? o.loaderData === void 0 ? /* @__PURE__ */ f(t, { children: [l.noLoaderTitle, /* @__PURE__ */ d("div", {
59
59
  className: "vdt:mt-1 vdt:text-foreground-subtle",
60
60
  children: l.noLoaderHint(/* @__PURE__ */ d("code", { children: "<Router>" }))
61
61
  })] }) : /* @__PURE__ */ d("pre", {
@@ -1,6 +1,6 @@
1
- import { Plug as e } from "../components/icons.js";
2
- import { useDevtoolsStrings as t } from "../strings.js";
3
- import { Badge as n, Card as r, Empty as i, KeyValue as a, SectionTitle as o } from "../components/primitives.js";
1
+ import { Badge as e, Card as t, Empty as n, KeyValue as r, SectionTitle as i } from "../components/primitives.js";
2
+ import { Plug as a } from "../components/icons.js";
3
+ import { useDevtoolsStrings as o } from "../strings.js";
4
4
  import { useFrameworkRuntimes as s } from "@voltro/client";
5
5
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  // src/panels/runtimes.tsx
@@ -15,22 +15,22 @@ var u = (e) => {
15
15
  workflows: a
16
16
  };
17
17
  }, d = () => {
18
- let d = s(), f = t().runtimes, p = d.names;
19
- return p.length === 0 ? /* @__PURE__ */ l(i, { children: [f.emptyTitle, /* @__PURE__ */ c("div", {
18
+ let d = s(), f = o().runtimes, p = d.names;
19
+ return p.length === 0 ? /* @__PURE__ */ l(n, { children: [f.emptyTitle, /* @__PURE__ */ c("div", {
20
20
  className: "vdt:mt-1 vdt:text-foreground-subtle",
21
21
  children: f.emptyHint
22
22
  })] }) : /* @__PURE__ */ c("div", {
23
23
  className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
24
- children: p.map((t) => {
25
- let i = d.get(t), s = u(i.descriptors);
26
- return /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
27
- Icon: e,
28
- right: /* @__PURE__ */ c(n, {
24
+ children: p.map((n) => {
25
+ let o = d.get(n), s = u(o.descriptors);
26
+ return /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
27
+ Icon: a,
28
+ right: /* @__PURE__ */ c(e, {
29
29
  tone: "success",
30
30
  children: f.live
31
31
  }),
32
- children: t
33
- }), /* @__PURE__ */ c(a, { entries: [
32
+ children: n
33
+ }), /* @__PURE__ */ c(r, { entries: [
34
34
  {
35
35
  key: "queries",
36
36
  value: String(s.queries)
@@ -53,13 +53,13 @@ var u = (e) => {
53
53
  },
54
54
  {
55
55
  key: "cacheSize",
56
- value: String(i.cache.size())
56
+ value: String(o.cache.size())
57
57
  },
58
58
  {
59
59
  key: "descriptors",
60
- value: String(Object.keys(i.descriptors).length)
60
+ value: String(Object.keys(o.descriptors).length)
61
61
  }
62
- ] })] }, t);
62
+ ] })] }, n);
63
63
  })
64
64
  });
65
65
  };
@@ -1,5 +1,5 @@
1
- import { ArrowUpDown as e, Database as t, Trash as n } from "../components/icons.js";
2
- import { Badge as r, Button as i, Card as a, Empty as o, KeyValue as s, SectionTitle as c } from "../components/primitives.js";
1
+ import { Badge as e, Button as t, Card as n, Empty as r, KeyValue as i, SectionTitle as a } from "../components/primitives.js";
2
+ import { ArrowUpDown as o, Database as s, Trash as c } from "../components/icons.js";
3
3
  import { useState as l, useSyncExternalStore as u } from "react";
4
4
  import { clearStoreHistory as d, definedStores as f, storeHistory as p, subscribeStoreHistory as m, travelToStoreState as h } from "@voltro/client";
5
5
  import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
@@ -12,22 +12,22 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
12
12
  n = String(e);
13
13
  }
14
14
  return n.length > t ? `${n.slice(0, t)}…` : n;
15
- }, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label: e, state: t }) => {
16
- let [n, i] = l(!1);
15
+ }, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label: t, state: n }) => {
16
+ let [r, a] = l(!1);
17
17
  return /* @__PURE__ */ v("div", {
18
18
  className: "vdt:border-t vdt:border-border",
19
19
  children: [/* @__PURE__ */ v("button", {
20
20
  type: "button",
21
21
  className: "vdt:flex vdt:w-full vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2 vdt:text-left vdt:hover:bg-muted",
22
- onClick: () => i((e) => !e),
23
- children: [/* @__PURE__ */ _(r, {
22
+ onClick: () => a((e) => !e),
23
+ children: [/* @__PURE__ */ _(e, {
24
24
  tone: "neutral",
25
- children: e
25
+ children: t
26
26
  }), /* @__PURE__ */ _("span", {
27
27
  className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
28
- children: b(t)
28
+ children: b(n)
29
29
  })]
30
- }), n ? /* @__PURE__ */ _(s, { entries: Object.entries(t).map(([e, t]) => ({
30
+ }), r ? /* @__PURE__ */ _(i, { entries: Object.entries(n).map(([e, t]) => ({
31
31
  key: e,
32
32
  value: b(t, 200)
33
33
  })) }) : null]
@@ -35,13 +35,13 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
35
35
  }, C = () => {
36
36
  let u = y(), [p, m] = l(null), C = f(), w = p ?? u.length;
37
37
  return /* @__PURE__ */ v(g, { children: [
38
- /* @__PURE__ */ v(c, {
39
- Icon: t,
40
- right: /* @__PURE__ */ v(i, {
38
+ /* @__PURE__ */ v(a, {
39
+ Icon: s,
40
+ right: /* @__PURE__ */ v(t, {
41
41
  onClick: () => {
42
42
  d(), m(null);
43
43
  },
44
- children: [/* @__PURE__ */ _(n, {}), "Clear"]
44
+ children: [/* @__PURE__ */ _(c, {}), "Clear"]
45
45
  }),
46
46
  children: [
47
47
  "Stores (",
@@ -49,8 +49,8 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
49
49
  ")"
50
50
  ]
51
51
  }),
52
- C.length === 0 ? /* @__PURE__ */ _(o, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : C.map((e) => /* @__PURE__ */ v(a, { children: [
53
- /* @__PURE__ */ _(c, { children: e.name }),
52
+ C.length === 0 ? /* @__PURE__ */ _(r, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : C.map((e) => /* @__PURE__ */ v(n, { children: [
53
+ /* @__PURE__ */ _(a, { children: e.name }),
54
54
  /* @__PURE__ */ _(S, {
55
55
  label: "global",
56
56
  state: e.get()
@@ -60,15 +60,15 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
60
60
  state: e.get(t)
61
61
  }, t))
62
62
  ] }, e.name)),
63
- /* @__PURE__ */ v(c, {
64
- Icon: e,
65
- right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(i, {
63
+ /* @__PURE__ */ v(a, {
64
+ Icon: o,
65
+ right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(t, {
66
66
  onClick: () => {
67
67
  w <= 0 || h(w - 1, "before") && m(w - 1);
68
68
  },
69
69
  disabled: w <= 0,
70
70
  children: "◀ Back"
71
- }), /* @__PURE__ */ _(i, {
71
+ }), /* @__PURE__ */ _(t, {
72
72
  onClick: () => {
73
73
  p === null || w >= u.length || h(w, "after") && m(w + 1);
74
74
  },
@@ -82,42 +82,42 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
82
82
  p === null ? "" : ` — travelled to ${w}/${u.length}`
83
83
  ]
84
84
  }),
85
- u.length === 0 ? /* @__PURE__ */ _(o, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...u].reverse().map((e, t) => {
86
- let n = u.length - 1 - t, i = x(e.prev, e.next);
87
- return /* @__PURE__ */ v(a, { children: [/* @__PURE__ */ v("div", {
85
+ u.length === 0 ? /* @__PURE__ */ _(r, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...u].reverse().map((t, r) => {
86
+ let a = u.length - 1 - r, o = x(t.prev, t.next);
87
+ return /* @__PURE__ */ v(n, { children: [/* @__PURE__ */ v("div", {
88
88
  className: "vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2",
89
89
  children: [
90
- /* @__PURE__ */ _(r, {
91
- tone: e.isUndo === !0 ? "warning" : "neutral",
92
- children: e.store
90
+ /* @__PURE__ */ _(e, {
91
+ tone: t.isUndo === !0 ? "warning" : "neutral",
92
+ children: t.store
93
93
  }),
94
- e.key === void 0 ? null : /* @__PURE__ */ _(r, {
94
+ t.key === void 0 ? null : /* @__PURE__ */ _(e, {
95
95
  tone: "neutral",
96
- children: e.key
96
+ children: t.key
97
97
  }),
98
- e.label === void 0 ? null : /* @__PURE__ */ _("span", {
98
+ t.label === void 0 ? null : /* @__PURE__ */ _("span", {
99
99
  className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
100
- children: e.label
100
+ children: t.label
101
101
  }),
102
- p !== null && n === w ? /* @__PURE__ */ _(r, {
102
+ p !== null && a === w ? /* @__PURE__ */ _(e, {
103
103
  tone: "info",
104
104
  children: "here"
105
105
  }) : null
106
106
  ]
107
- }), /* @__PURE__ */ _(s, { entries: [
107
+ }), /* @__PURE__ */ _(i, { entries: [
108
108
  {
109
109
  key: "changed",
110
- value: i.length > 0 ? i.join(", ") : "(no field diff)"
110
+ value: o.length > 0 ? o.join(", ") : "(no field diff)"
111
111
  },
112
112
  {
113
113
  key: "before",
114
- value: b(e.prev)
114
+ value: b(t.prev)
115
115
  },
116
116
  {
117
117
  key: "after",
118
- value: b(e.next)
118
+ value: b(t.next)
119
119
  }
120
- ] })] }, `${e.at}-${n}`);
120
+ ] })] }, `${t.at}-${a}`);
121
121
  })
122
122
  ] });
123
123
  };
@@ -1,8 +1,8 @@
1
- import { ChevronDown as e } from "../components/icons.js";
2
- import { useDevtoolsStrings as t } from "../strings.js";
1
+ import { useDocumentVisible as e } from "../useDocumentVisible.js";
2
+ import { ChevronDown as t } from "../components/icons.js";
3
3
  import { useInspectToken as n } from "../inspectAuth.js";
4
4
  import { fetchInspect as r } from "../inspectFetch.js";
5
- import { useDocumentVisible as i } from "../useDocumentVisible.js";
5
+ import { useDevtoolsStrings as i } from "../strings.js";
6
6
  import { useEffect as a, useState as o } from "react";
7
7
  import { useFrameworkRuntimes as s } from "@voltro/client";
8
8
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -11,8 +11,8 @@ var d = 4e3, f = async (e, t, n = !1) => {
11
11
  if (e === "") return null;
12
12
  let i = await r(`${e}/_voltro/inspect/traces${n ? "?includeBackground=1" : ""}`, t);
13
13
  return i !== null && Array.isArray(i.traces) ? i : null;
14
- }, p = [], m = (e, t = !1) => {
15
- let r = s(), c = i(), l = n(), u = r.names.join(","), [m, h] = o(p), g = e && c;
14
+ }, p = [], m = (t, r = !1) => {
15
+ let i = s(), c = e(), l = n(), u = i.names.join(","), [m, h] = o(p), g = t && c;
16
16
  return a(() => {
17
17
  if (!g) {
18
18
  h(p);
@@ -20,34 +20,34 @@ var d = 4e3, f = async (e, t, n = !1) => {
20
20
  }
21
21
  let e = u === "" ? [] : u.split(",").map((e) => ({
22
22
  name: e,
23
- baseUrl: r.get(e).inspectBaseUrl
23
+ baseUrl: i.get(e).inspectBaseUrl
24
24
  })).filter((e) => e.baseUrl !== "");
25
25
  if (e.length === 0) {
26
26
  h(p);
27
27
  return;
28
28
  }
29
- let n = !1, i = async () => {
30
- let r = await Promise.all(e.map((e) => f(e.baseUrl, l, t)));
31
- if (n) return;
29
+ let t = !1, n = async () => {
30
+ let n = await Promise.all(e.map((e) => f(e.baseUrl, l, r)));
31
+ if (t) return;
32
32
  let i = [];
33
- r.forEach((t, n) => {
33
+ n.forEach((t, n) => {
34
34
  if (t !== null) for (let r of t.traces) i.push({
35
35
  apiName: e[n].name,
36
36
  trace: r
37
37
  });
38
38
  }), h(i);
39
39
  };
40
- i();
41
- let a = setInterval(i, d);
40
+ n();
41
+ let a = setInterval(n, d);
42
42
  return () => {
43
- n = !0, clearInterval(a);
43
+ t = !0, clearInterval(a);
44
44
  };
45
45
  }, [
46
- r,
46
+ i,
47
47
  u,
48
48
  g,
49
49
  l,
50
- t
50
+ r
51
51
  ]), m;
52
52
  }, h = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, g = (e) => {
53
53
  let t = new Map(e.map((e) => [e.spanId, e])), n = /* @__PURE__ */ new Map(), r = (e, i) => {
@@ -65,55 +65,55 @@ var d = 4e3, f = async (e, t, n = !1) => {
65
65
  } catch {
66
66
  return String(e);
67
67
  }
68
- }, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace: n }) => {
69
- let r = t().traces, i = g(n.spans), a = new Set(n.spans.map((e) => e.spanId)), o = n.spans.some((e) => e.parentSpanId !== null && !a.has(e.parentSpanId)), s = n.spans.length > 0 && n.spans.every(v), d = n.durationMs > 0 ? n.durationMs : 1;
68
+ }, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace: e }) => {
69
+ let n = i().traces, r = g(e.spans), a = new Set(e.spans.map((e) => e.spanId)), o = e.spans.some((e) => e.parentSpanId !== null && !a.has(e.parentSpanId)), s = e.spans.length > 0 && e.spans.every(v), d = e.durationMs > 0 ? e.durationMs : 1;
70
70
  return /* @__PURE__ */ u("div", {
71
71
  className: "vdt-trace-detail",
72
72
  children: [
73
73
  /* @__PURE__ */ u("div", {
74
74
  className: "vdt-trace-summary",
75
- children: [/* @__PURE__ */ l("span", { children: r.spans(n.spanCount) }), n.kind === "subscription" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("span", { children: [
76
- n.deliveryCount ?? 0,
75
+ children: [/* @__PURE__ */ l("span", { children: n.spans(e.spanCount) }), e.kind === "subscription" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("span", { children: [
76
+ e.deliveryCount ?? 0,
77
77
  " ",
78
- r.delivery(n.deliveryCount ?? 0)
79
- ] }), n.lastDeliveryMs === void 0 ? null : /* @__PURE__ */ u("span", { children: [
80
- r.lastDelivery,
78
+ n.delivery(e.deliveryCount ?? 0)
79
+ ] }), e.lastDeliveryMs === void 0 ? null : /* @__PURE__ */ u("span", { children: [
80
+ n.lastDelivery,
81
81
  ": ",
82
- /* @__PURE__ */ l("strong", { children: h(n.lastDeliveryMs) })
82
+ /* @__PURE__ */ l("strong", { children: h(e.lastDeliveryMs) })
83
83
  ] })] }) : /* @__PURE__ */ u("span", { children: [
84
- r.duration,
84
+ n.duration,
85
85
  ": ",
86
- /* @__PURE__ */ l("strong", { children: h(n.durationMs) })
86
+ /* @__PURE__ */ l("strong", { children: h(e.durationMs) })
87
87
  ] })]
88
88
  }),
89
89
  /* @__PURE__ */ u("code", {
90
90
  className: "vdt-trace-id",
91
- children: ["trace ", n.traceId]
91
+ children: ["trace ", e.traceId]
92
92
  }),
93
93
  o || s ? /* @__PURE__ */ l("p", {
94
94
  className: "vdt-trace-context",
95
- children: o ? r.missingParents : r.sqlWithoutCaller
95
+ children: o ? n.missingParents : n.sqlWithoutCaller
96
96
  }) : null,
97
- n.spans.map((t) => {
98
- let a = Math.min(i.get(t.spanId) ?? 0, 8), o = Math.max(0, Math.min(100, (t.startMs - n.startMs) / d * 100)), s = Math.max(0, Math.min(100 - o, Math.max(1.5, t.durationMs / d * 100))), f = Object.entries(t.attributes);
97
+ e.spans.map((i) => {
98
+ let a = Math.min(r.get(i.spanId) ?? 0, 8), o = Math.max(0, Math.min(100, (i.startMs - e.startMs) / d * 100)), s = Math.max(0, Math.min(100 - o, Math.max(1.5, i.durationMs / d * 100))), f = Object.entries(i.attributes);
99
99
  return /* @__PURE__ */ u("details", {
100
100
  className: "vdt-trace-span",
101
- open: t.status === "error",
102
- "data-status": t.status,
101
+ open: i.status === "error",
102
+ "data-status": i.status,
103
103
  children: [/* @__PURE__ */ u("summary", {
104
104
  className: "vdt-trace-span-head",
105
105
  style: { paddingLeft: 8 + a * 8 },
106
106
  children: [
107
107
  /* @__PURE__ */ u("span", {
108
108
  className: "vdt-trace-span-label",
109
- children: [/* @__PURE__ */ l(e, { className: "vdt-trace-chevron" }), /* @__PURE__ */ l("code", {
109
+ children: [/* @__PURE__ */ l(t, { className: "vdt-trace-chevron" }), /* @__PURE__ */ l("code", {
110
110
  className: "vdt-trace-span-name",
111
- children: t.name
111
+ children: i.name
112
112
  })]
113
113
  }),
114
114
  /* @__PURE__ */ l("span", {
115
115
  className: "vdt-trace-span-duration",
116
- children: h(t.durationMs)
116
+ children: h(i.durationMs)
117
117
  }),
118
118
  /* @__PURE__ */ l("span", {
119
119
  className: "vdt-trace-span-bar",
@@ -130,28 +130,28 @@ var d = 4e3, f = async (e, t, n = !1) => {
130
130
  /* @__PURE__ */ u("div", {
131
131
  className: "vdt-trace-span-meta",
132
132
  children: [
133
- /* @__PURE__ */ l("span", { children: t.kind }),
134
- /* @__PURE__ */ l("span", { children: t.status }),
135
- /* @__PURE__ */ l("code", { children: t.spanId })
133
+ /* @__PURE__ */ l("span", { children: i.kind }),
134
+ /* @__PURE__ */ l("span", { children: i.status }),
135
+ /* @__PURE__ */ l("code", { children: i.spanId })
136
136
  ]
137
137
  }),
138
- t.statusMessage ? /* @__PURE__ */ l("p", {
138
+ i.statusMessage ? /* @__PURE__ */ l("p", {
139
139
  className: "vdt-trace-span-message",
140
- children: t.statusMessage
140
+ children: i.statusMessage
141
141
  }) : null,
142
142
  f.length > 0 ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
143
143
  className: "vdt-trace-attributes-label",
144
- children: r.attributes
144
+ children: n.attributes
145
145
  }), /* @__PURE__ */ l("dl", {
146
146
  className: "vdt-trace-attributes",
147
147
  children: f.map(([e, t]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("dt", { children: e }), /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l("pre", { children: _(t) }) })] }, e))
148
148
  })] }) : /* @__PURE__ */ l("p", {
149
149
  className: "vdt-trace-no-attributes",
150
- children: r.noAttributes
150
+ children: n.noAttributes
151
151
  })
152
152
  ]
153
153
  })]
154
- }, t.spanId);
154
+ }, i.spanId);
155
155
  })
156
156
  ]
157
157
  });