@voltro/devtools 0.62.0 → 0.62.2
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.
- package/CHANGELOG.md +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +327 -257
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createContext as e, useCallback as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s, useSyncExternalStore as c } from "react";
|
|
2
2
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
-
import { clearMutations as f, clearStoreHistory as p,
|
|
4
|
-
import { getRouteSnapshot as
|
|
5
|
-
import { addSink as
|
|
3
|
+
import { clearMutations as f, clearStoreHistory as p, clientDiagnosticsSnapshot as m, definedStores as ee, getMutations as h, storeHistory as g, subscribeClientDiagnostics as te, subscribeMutations as _, subscribeStoreHistory as v, travelToStoreState as y, useFrameworkRuntimes as b } from "@voltro/client";
|
|
4
|
+
import { getRouteSnapshot as ne, getStatuses as re, subscribeRouteSnapshot as ie, subscribeStatuses as ae } from "@voltro/web";
|
|
5
|
+
import { addSink as oe } from "@voltro/logger";
|
|
6
6
|
//#region src/usePosition.ts
|
|
7
|
-
var
|
|
7
|
+
var se = [
|
|
8
8
|
"topLeft",
|
|
9
9
|
"topMid",
|
|
10
10
|
"topRight",
|
|
@@ -13,29 +13,29 @@ var ae = [
|
|
|
13
13
|
"bottomLeft",
|
|
14
14
|
"bottomMid",
|
|
15
15
|
"bottomRight"
|
|
16
|
-
], x = "voltro:devtools:anchor",
|
|
16
|
+
], x = "voltro:devtools:anchor", ce = (e) => {
|
|
17
17
|
if (typeof window > "u") return e;
|
|
18
18
|
try {
|
|
19
19
|
let e = window.localStorage.getItem(x);
|
|
20
|
-
if (e &&
|
|
20
|
+
if (e && se.includes(e)) return e;
|
|
21
21
|
} catch {}
|
|
22
22
|
return e;
|
|
23
|
-
},
|
|
23
|
+
}, le = (e) => {
|
|
24
24
|
if (!(typeof window > "u")) try {
|
|
25
25
|
window.localStorage.setItem(x, e);
|
|
26
26
|
} catch {}
|
|
27
|
-
},
|
|
28
|
-
let [n, i] = s(() =>
|
|
27
|
+
}, ue = (e = "bottomLeft") => {
|
|
28
|
+
let [n, i] = s(() => ce(e));
|
|
29
29
|
return r(() => {
|
|
30
30
|
if (typeof window > "u") return;
|
|
31
31
|
let e = (e) => {
|
|
32
|
-
e.key !== x || !e.newValue ||
|
|
32
|
+
e.key !== x || !e.newValue || se.includes(e.newValue) && i(e.newValue);
|
|
33
33
|
};
|
|
34
34
|
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
35
35
|
}, []), [n, t((e) => {
|
|
36
|
-
i(e),
|
|
36
|
+
i(e), le(e);
|
|
37
37
|
}, [])];
|
|
38
|
-
},
|
|
38
|
+
}, de = (e) => {
|
|
39
39
|
switch (e) {
|
|
40
40
|
case "topLeft": return {
|
|
41
41
|
top: 24,
|
|
@@ -74,13 +74,13 @@ var ae = [
|
|
|
74
74
|
right: 24
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, fe = {
|
|
78
78
|
default: "vdt:bg-muted vdt:text-foreground hover:vdt:bg-muted/80",
|
|
79
79
|
ghost: "vdt:bg-transparent vdt:text-foreground hover:vdt:bg-muted/50",
|
|
80
80
|
outline: "vdt:bg-transparent vdt:text-foreground vdt:border vdt:border-border hover:vdt:border-border-strong",
|
|
81
81
|
accent: "vdt:bg-accent vdt:text-accent-foreground hover:vdt:bg-accent-dim",
|
|
82
82
|
danger: "vdt:bg-danger/15 vdt:text-danger hover:vdt:bg-danger/25"
|
|
83
|
-
},
|
|
83
|
+
}, pe = {
|
|
84
84
|
sm: "vdt:text-xs vdt:px-2 vdt:py-1 vdt:rounded-sm",
|
|
85
85
|
md: "vdt:text-sm vdt:px-3 vdt:py-1.5 vdt:rounded-md"
|
|
86
86
|
}, S = ({ variant: e = "default", size: t = "md", onClick: n, disabled: r, children: i, className: a, title: o }) => /* @__PURE__ */ u("button", {
|
|
@@ -90,12 +90,12 @@ var ae = [
|
|
|
90
90
|
className: [
|
|
91
91
|
"vdt:inline-flex vdt:items-center vdt:gap-1.5 vdt:font-medium vdt:transition-colors",
|
|
92
92
|
"disabled:vdt:opacity-40 disabled:vdt:cursor-not-allowed",
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
fe[e],
|
|
94
|
+
pe[t],
|
|
95
95
|
a ?? ""
|
|
96
96
|
].join(" "),
|
|
97
97
|
children: i
|
|
98
|
-
}),
|
|
98
|
+
}), me = ({ onClick: e, title: t, active: n, children: r, className: i }) => /* @__PURE__ */ u("button", {
|
|
99
99
|
onClick: e,
|
|
100
100
|
title: t,
|
|
101
101
|
className: [
|
|
@@ -105,7 +105,7 @@ var ae = [
|
|
|
105
105
|
i ?? ""
|
|
106
106
|
].join(" "),
|
|
107
107
|
children: r
|
|
108
|
-
}),
|
|
108
|
+
}), he = ({ children: e, className: t }) => {
|
|
109
109
|
let n = o(null);
|
|
110
110
|
return r(() => {
|
|
111
111
|
let e = n.current;
|
|
@@ -147,7 +147,7 @@ var ae = [
|
|
|
147
147
|
].join(" "),
|
|
148
148
|
children: n
|
|
149
149
|
}) : null]
|
|
150
|
-
}),
|
|
150
|
+
}), ge = {
|
|
151
151
|
neutral: "vdt:bg-muted vdt:text-foreground-muted vdt:border vdt:border-border",
|
|
152
152
|
success: "vdt:bg-success/15 vdt:text-success vdt:border vdt:border-success/30",
|
|
153
153
|
warning: "vdt:bg-warning/15 vdt:text-warning vdt:border vdt:border-warning/30",
|
|
@@ -158,7 +158,7 @@ var ae = [
|
|
|
158
158
|
className: [
|
|
159
159
|
"vdt:inline-flex vdt:items-center vdt:gap-1 vdt:px-1.5 vdt:py-0.5",
|
|
160
160
|
"vdt:rounded-sm vdt:text-[10px] vdt:font-medium vdt:uppercase vdt:tracking-wider",
|
|
161
|
-
|
|
161
|
+
ge[e],
|
|
162
162
|
n ?? ""
|
|
163
163
|
].join(" "),
|
|
164
164
|
children: t
|
|
@@ -243,7 +243,7 @@ var ae = [
|
|
|
243
243
|
})
|
|
244
244
|
]
|
|
245
245
|
});
|
|
246
|
-
},
|
|
246
|
+
}, _e = k(/* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("line", {
|
|
247
247
|
x1: "18",
|
|
248
248
|
y1: "6",
|
|
249
249
|
x2: "6",
|
|
@@ -253,7 +253,7 @@ var ae = [
|
|
|
253
253
|
y1: "6",
|
|
254
254
|
x2: "18",
|
|
255
255
|
y2: "18"
|
|
256
|
-
})] })), j = k(/* @__PURE__ */ u("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })),
|
|
256
|
+
})] })), j = k(/* @__PURE__ */ u("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })), ve = k(/* @__PURE__ */ d(l, { children: [
|
|
257
257
|
/* @__PURE__ */ u("ellipse", {
|
|
258
258
|
cx: "12",
|
|
259
259
|
cy: "5",
|
|
@@ -266,21 +266,21 @@ var ae = [
|
|
|
266
266
|
cx: "12",
|
|
267
267
|
cy: "12",
|
|
268
268
|
r: "10"
|
|
269
|
-
}), /* @__PURE__ */ u("polygon", { points: "16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76" })] })),
|
|
269
|
+
}), /* @__PURE__ */ u("polygon", { points: "16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76" })] })), ye = k(/* @__PURE__ */ d(l, { children: [
|
|
270
270
|
/* @__PURE__ */ u("path", { d: "M12 22 v-5" }),
|
|
271
271
|
/* @__PURE__ */ u("path", { d: "M9 8 V2" }),
|
|
272
272
|
/* @__PURE__ */ u("path", { d: "M15 8 V2" }),
|
|
273
273
|
/* @__PURE__ */ u("path", { d: "M18 8 v4 a6 6 0 0 1 -12 0 V8 z" })
|
|
274
|
-
] })),
|
|
274
|
+
] })), N = k(/* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("polyline", { points: "17 11 12 6 7 11" }), /* @__PURE__ */ u("polyline", { points: "17 17 12 22 7 17" })] })), be = k(/* @__PURE__ */ u("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" })), P = k(/* @__PURE__ */ d(l, { children: [
|
|
275
275
|
/* @__PURE__ */ u("polyline", { points: "3 6 5 6 21 6" }),
|
|
276
276
|
/* @__PURE__ */ u("path", { d: "M19 6 l-1 14 c-.05 1.1 -.96 2 -2 2 H8 c-1.04 0 -1.95 -.9 -2 -2 L5 6" }),
|
|
277
277
|
/* @__PURE__ */ u("path", { d: "M10 11 v6" }),
|
|
278
278
|
/* @__PURE__ */ u("path", { d: "M14 11 v6" })
|
|
279
|
-
] })),
|
|
279
|
+
] })), xe = k(/* @__PURE__ */ d(l, { children: [
|
|
280
280
|
/* @__PURE__ */ u("path", { d: "M18 16.98 h-5.99 c-1.1 0 -1.95 .94 -2.48 1.9 A4 4 0 0 1 2 17 c0 -1.42 .76 -2.66 1.9 -3.34" }),
|
|
281
281
|
/* @__PURE__ */ u("path", { d: "M6 17 l3.13 -5.78 c.53 -.97 .43 -2.22 -.26 -3.07 A4 4 0 1 1 17 7" }),
|
|
282
282
|
/* @__PURE__ */ u("path", { d: "M16 6.78 a4 4 0 1 1 5 6.31 c-.84 .6 -1.36 1.59 -1.36 2.61" })
|
|
283
|
-
] })),
|
|
283
|
+
] })), Se = k(/* @__PURE__ */ d(l, { children: [
|
|
284
284
|
/* @__PURE__ */ u("line", {
|
|
285
285
|
x1: "6",
|
|
286
286
|
y1: "3",
|
|
@@ -298,7 +298,7 @@ var ae = [
|
|
|
298
298
|
r: "3"
|
|
299
299
|
}),
|
|
300
300
|
/* @__PURE__ */ u("path", { d: "M18 9 a9 9 0 0 1 -9 9" })
|
|
301
|
-
] })),
|
|
301
|
+
] })), Ce = ({ className: e }) => /* @__PURE__ */ d("svg", {
|
|
302
302
|
viewBox: "0 0 24 24",
|
|
303
303
|
fill: "none",
|
|
304
304
|
className: e,
|
|
@@ -316,7 +316,7 @@ var ae = [
|
|
|
316
316
|
strokeWidth: "2.5",
|
|
317
317
|
strokeLinecap: "round"
|
|
318
318
|
})]
|
|
319
|
-
}),
|
|
319
|
+
}), we = [
|
|
320
320
|
"topLeft",
|
|
321
321
|
"topMid",
|
|
322
322
|
"topRight",
|
|
@@ -326,11 +326,11 @@ var ae = [
|
|
|
326
326
|
"bottomLeft",
|
|
327
327
|
"bottomMid",
|
|
328
328
|
"bottomRight"
|
|
329
|
-
],
|
|
329
|
+
], Te = ({ anchor: e, onChange: t }) => /* @__PURE__ */ u("div", {
|
|
330
330
|
role: "radiogroup",
|
|
331
331
|
"aria-label": "Devtools position",
|
|
332
332
|
className: "vdt:grid vdt:grid-cols-3 vdt:gap-0.5 vdt:p-1 vdt:bg-muted vdt:rounded-md",
|
|
333
|
-
children:
|
|
333
|
+
children: we.map((n, r) => {
|
|
334
334
|
if (n === null) return /* @__PURE__ */ u("div", {
|
|
335
335
|
"aria-hidden": "true",
|
|
336
336
|
className: "vdt:w-3 vdt:h-3 vdt:rounded-sm vdt:bg-transparent"
|
|
@@ -345,21 +345,21 @@ var ae = [
|
|
|
345
345
|
className: ["vdt:w-3 vdt:h-3 vdt:rounded-sm vdt:transition-colors", i ? "vdt:bg-accent" : "vdt:bg-border hover:vdt:bg-border-strong"].join(" ")
|
|
346
346
|
}, n);
|
|
347
347
|
})
|
|
348
|
-
}),
|
|
348
|
+
}), Ee = 500, F = (e) => {
|
|
349
349
|
let t = "";
|
|
350
350
|
for (let n of e) t += `${n.key}|${n.subscriberCount}|${n.snapshot.revision}|${n.snapshot.pendingPatches}|${n.snapshot.error ? "1" : "0"}|${n.hasFiber ? "1" : "0"}|${n.evicting ? "1" : "0"};`;
|
|
351
351
|
return t;
|
|
352
352
|
}, De = (e) => {
|
|
353
|
-
let [t, n] = s(() => e ? e.peekAll() : []), i = o(
|
|
353
|
+
let [t, n] = s(() => e ? e.peekAll() : []), i = o(F(t));
|
|
354
354
|
return r(() => {
|
|
355
355
|
if (!e) return;
|
|
356
356
|
let t = () => {
|
|
357
|
-
let t = e.peekAll(), r =
|
|
357
|
+
let t = e.peekAll(), r = F(t);
|
|
358
358
|
r !== i.current && (i.current = r, n(t));
|
|
359
|
-
}, r = setInterval(t,
|
|
359
|
+
}, r = setInterval(t, Ee);
|
|
360
360
|
return t(), () => clearInterval(r);
|
|
361
361
|
}, [e]), t;
|
|
362
|
-
},
|
|
362
|
+
}, I = {
|
|
363
363
|
shell: {
|
|
364
364
|
brand: "Voltro Devtools",
|
|
365
365
|
brandWord: "Voltro",
|
|
@@ -381,7 +381,8 @@ var ae = [
|
|
|
381
381
|
},
|
|
382
382
|
subscriptions: {
|
|
383
383
|
emptyTitle: "No active subscriptions.",
|
|
384
|
-
emptyHint: "Mount a `useSubscription` hook to see live cache state here."
|
|
384
|
+
emptyHint: "Mount a `useSubscription` hook to see live cache state here.",
|
|
385
|
+
timelineTitle: "Client recovery timeline"
|
|
385
386
|
},
|
|
386
387
|
indexes: {
|
|
387
388
|
noApis: "No APIs mounted in this app.",
|
|
@@ -459,7 +460,7 @@ var ae = [
|
|
|
459
460
|
delivery: (e) => e === 1 ? "delivery" : "deliveries",
|
|
460
461
|
spans: (e) => `${e} spans`
|
|
461
462
|
}
|
|
462
|
-
},
|
|
463
|
+
}, L = e(I), R = (e, t) => ({
|
|
463
464
|
shell: {
|
|
464
465
|
...e.shell,
|
|
465
466
|
...t.shell
|
|
@@ -501,32 +502,37 @@ var ae = [
|
|
|
501
502
|
...t.traces
|
|
502
503
|
}
|
|
503
504
|
});
|
|
504
|
-
function
|
|
505
|
-
let t = n(
|
|
506
|
-
return /* @__PURE__ */ u(
|
|
505
|
+
function z(e) {
|
|
506
|
+
let t = n(L), r = a(() => R(t, e.strings), [t, e.strings]);
|
|
507
|
+
return /* @__PURE__ */ u(L.Provider, {
|
|
507
508
|
value: r,
|
|
508
509
|
children: e.children
|
|
509
510
|
});
|
|
510
511
|
}
|
|
511
|
-
var
|
|
512
|
-
let t = n(
|
|
513
|
-
return a(() => e ?
|
|
514
|
-
},
|
|
515
|
-
let e =
|
|
512
|
+
var B = (e) => {
|
|
513
|
+
let t = n(L);
|
|
514
|
+
return a(() => e ? R(t, e) : t, [t, e]);
|
|
515
|
+
}, Oe = () => {
|
|
516
|
+
let e = b();
|
|
516
517
|
return e.names.map((t) => ({
|
|
517
518
|
name: t,
|
|
518
519
|
entries: e.get(t).cache.peekAll()
|
|
519
520
|
}));
|
|
520
|
-
},
|
|
521
|
-
let e =
|
|
522
|
-
return De((e.names[0] ? e.get(e.names[0]) : null)?.cache ?? null),
|
|
523
|
-
},
|
|
521
|
+
}, V = () => {
|
|
522
|
+
let e = b();
|
|
523
|
+
return De((e.names[0] ? e.get(e.names[0]) : null)?.cache ?? null), Oe();
|
|
524
|
+
}, ke = () => {
|
|
525
|
+
let [e, t] = s(() => m().events);
|
|
526
|
+
return r(() => te(() => {
|
|
527
|
+
t(m().events);
|
|
528
|
+
}), []), e.slice(-80).reverse();
|
|
529
|
+
}, Ae = (e) => {
|
|
524
530
|
let { snapshot: t, hasFiber: n, evicting: r } = e;
|
|
525
|
-
return t.error ? "danger" : t.pendingPatches > 0 ? "warning" : t.revision >= 0 ? "success" : r ? "neutral" : n ? "info" : "neutral";
|
|
526
|
-
},
|
|
531
|
+
return e.recovery.phase === "stuck" ? "danger" : e.recovery.phase === "steady" ? t.error ? "danger" : t.pendingPatches > 0 ? "warning" : t.revision >= 0 ? "success" : r ? "neutral" : n ? "info" : "neutral" : "warning";
|
|
532
|
+
}, je = ({ tone: e }) => /* @__PURE__ */ u("span", {
|
|
527
533
|
"aria-hidden": "true",
|
|
528
534
|
className: ["vdt:inline-block vdt:w-2 vdt:h-2 vdt:rounded-full", e === "success" ? "vdt:bg-success" : e === "info" ? "vdt:bg-info" : e === "danger" ? "vdt:bg-danger" : e === "warning" ? "vdt:bg-warning" : "vdt:bg-foreground-subtle"].join(" ")
|
|
529
|
-
}),
|
|
535
|
+
}), Me = (e) => {
|
|
530
536
|
try {
|
|
531
537
|
let t = JSON.parse(e);
|
|
532
538
|
if (Array.isArray(t)) {
|
|
@@ -535,23 +541,27 @@ var F = (e) => {
|
|
|
535
541
|
}
|
|
536
542
|
} catch {}
|
|
537
543
|
return e;
|
|
538
|
-
},
|
|
539
|
-
let r =
|
|
544
|
+
}, Ne = ({ entry: e, expanded: t, onToggle: n }) => {
|
|
545
|
+
let r = Ae(e);
|
|
540
546
|
return /* @__PURE__ */ d("div", {
|
|
541
547
|
className: "vdt:border-b last:vdt:border-b-0 vdt:border-border",
|
|
542
548
|
children: [/* @__PURE__ */ d("button", {
|
|
543
549
|
onClick: n,
|
|
544
550
|
className: "vdt:w-full vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-1.5 hover:vdt:bg-muted/40 vdt:transition-colors",
|
|
545
551
|
children: [
|
|
546
|
-
/* @__PURE__ */ u(
|
|
552
|
+
/* @__PURE__ */ u(je, { tone: r }),
|
|
547
553
|
/* @__PURE__ */ u("span", {
|
|
548
554
|
className: "vdt:flex-1 vdt:text-xs vdt:font-mono vdt:truncate vdt:text-left vdt:text-foreground",
|
|
549
|
-
children:
|
|
555
|
+
children: Me(e.key)
|
|
550
556
|
}),
|
|
551
557
|
e.snapshot.pendingPatches > 0 ? /* @__PURE__ */ d(w, {
|
|
552
558
|
tone: "warning",
|
|
553
559
|
children: ["+", e.snapshot.pendingPatches]
|
|
554
560
|
}) : null,
|
|
561
|
+
e.recovery.phase === "steady" ? null : /* @__PURE__ */ u(w, {
|
|
562
|
+
tone: e.recovery.phase === "stuck" ? "danger" : "warning",
|
|
563
|
+
children: e.recovery.phase
|
|
564
|
+
}),
|
|
555
565
|
e.subscriberCount > 0 ? /* @__PURE__ */ u(w, {
|
|
556
566
|
tone: "neutral",
|
|
557
567
|
children: e.subscriberCount
|
|
@@ -580,6 +590,30 @@ var F = (e) => {
|
|
|
580
590
|
key: "fiber",
|
|
581
591
|
value: e.hasFiber ? "running" : e.evicting ? "evicting" : "idle"
|
|
582
592
|
},
|
|
593
|
+
{
|
|
594
|
+
key: "recovery",
|
|
595
|
+
value: e.recovery.phase
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
key: "recoveryAttempt",
|
|
599
|
+
value: String(e.recovery.attempt)
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
key: "basePreserved",
|
|
603
|
+
value: String(e.recovery.basePreserved)
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
key: "lastTransportFailureAt",
|
|
607
|
+
value: e.recovery.lastTransportFailureAt ? new Date(e.recovery.lastTransportFailureAt).toISOString() : "—"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
key: "lastReissueAt",
|
|
611
|
+
value: e.recovery.lastReissueAt ? new Date(e.recovery.lastReissueAt).toISOString() : "—"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
key: "lastDeliveryAt",
|
|
615
|
+
value: e.recovery.lastDeliveryAt ? new Date(e.recovery.lastDeliveryAt).toISOString() : "—"
|
|
616
|
+
},
|
|
583
617
|
{
|
|
584
618
|
key: "revision",
|
|
585
619
|
value: e.snapshot.revision >= 0 ? String(e.snapshot.revision) : "—"
|
|
@@ -614,33 +648,69 @@ var F = (e) => {
|
|
|
614
648
|
})]
|
|
615
649
|
}) : null]
|
|
616
650
|
});
|
|
617
|
-
},
|
|
618
|
-
let e =
|
|
619
|
-
return e.reduce((e, t) => e + t.entries.length, 0) === 0 ? /* @__PURE__ */ d(O, { children: [
|
|
651
|
+
}, Pe = () => {
|
|
652
|
+
let e = V(), t = ke(), n = B().subscriptions, [r, i] = s(null);
|
|
653
|
+
return e.reduce((e, t) => e + t.entries.length, 0) === 0 && t.length === 0 ? /* @__PURE__ */ d(O, { children: [n.emptyTitle, /* @__PURE__ */ u("div", {
|
|
620
654
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
621
|
-
children:
|
|
622
|
-
})] }) : /* @__PURE__ */
|
|
655
|
+
children: n.emptyHint
|
|
656
|
+
})] }) : /* @__PURE__ */ d("div", {
|
|
623
657
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
624
|
-
children: e.map((e) => e.entries.length === 0 ? null : /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ u(E, {
|
|
658
|
+
children: [e.map((e) => e.entries.length === 0 ? null : /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ u(E, {
|
|
625
659
|
Icon: j,
|
|
626
660
|
right: /* @__PURE__ */ u(w, {
|
|
627
661
|
tone: "accent",
|
|
628
662
|
children: e.entries.length
|
|
629
663
|
}),
|
|
630
664
|
children: e.name
|
|
631
|
-
}), e.entries.map((t) => /* @__PURE__ */ u(
|
|
665
|
+
}), e.entries.map((t) => /* @__PURE__ */ u(Ne, {
|
|
632
666
|
entry: t,
|
|
633
|
-
expanded:
|
|
634
|
-
onToggle: () =>
|
|
635
|
-
}, t.key))] }, e.name))
|
|
667
|
+
expanded: r === `${e.name}:${t.key}`,
|
|
668
|
+
onToggle: () => i((n) => n === `${e.name}:${t.key}` ? null : `${e.name}:${t.key}`)
|
|
669
|
+
}, t.key))] }, e.name)), t.length > 0 ? /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ u(E, {
|
|
670
|
+
Icon: j,
|
|
671
|
+
right: /* @__PURE__ */ u(w, {
|
|
672
|
+
tone: "neutral",
|
|
673
|
+
children: t.length
|
|
674
|
+
}),
|
|
675
|
+
children: n.timelineTitle
|
|
676
|
+
}), /* @__PURE__ */ u("div", {
|
|
677
|
+
className: "vdt:max-h-72 vdt:overflow-auto",
|
|
678
|
+
children: t.map((e) => /* @__PURE__ */ d("div", {
|
|
679
|
+
className: "vdt:border-b last:vdt:border-b-0 vdt:border-border vdt:px-3 vdt:py-1.5",
|
|
680
|
+
children: [/* @__PURE__ */ d("div", {
|
|
681
|
+
className: "vdt:flex vdt:gap-2 vdt:text-[11px] vdt:font-mono",
|
|
682
|
+
children: [
|
|
683
|
+
/* @__PURE__ */ d("span", {
|
|
684
|
+
className: "vdt:text-foreground-subtle",
|
|
685
|
+
children: [
|
|
686
|
+
"+",
|
|
687
|
+
e.elapsedMs,
|
|
688
|
+
"ms"
|
|
689
|
+
]
|
|
690
|
+
}),
|
|
691
|
+
/* @__PURE__ */ u("span", {
|
|
692
|
+
className: "vdt:text-foreground-muted",
|
|
693
|
+
children: e.api
|
|
694
|
+
}),
|
|
695
|
+
/* @__PURE__ */ u("span", {
|
|
696
|
+
className: "vdt:text-foreground",
|
|
697
|
+
children: e.kind
|
|
698
|
+
})
|
|
699
|
+
]
|
|
700
|
+
}), Object.keys(e.fields).length > 0 ? /* @__PURE__ */ u("div", {
|
|
701
|
+
className: "vdt:mt-0.5 vdt:text-[10px] vdt:text-foreground-subtle vdt:font-mono vdt:break-all",
|
|
702
|
+
children: JSON.stringify(e.fields)
|
|
703
|
+
}) : null]
|
|
704
|
+
}, e.sequence))
|
|
705
|
+
})] }) : null]
|
|
636
706
|
});
|
|
637
|
-
},
|
|
707
|
+
}, Fe = () => V().reduce((e, t) => e + t.entries.length, 0), Ie = (e) => {
|
|
638
708
|
try {
|
|
639
709
|
return JSON.stringify(e, null, 2);
|
|
640
710
|
} catch {
|
|
641
711
|
return String(e);
|
|
642
712
|
}
|
|
643
|
-
},
|
|
713
|
+
}, Le = () => c(ie, ne, ne), Re = () => {
|
|
644
714
|
let [e, t] = s(() => typeof window > "u" ? "/" : window.location.pathname);
|
|
645
715
|
return r(() => {
|
|
646
716
|
if (typeof window > "u") return;
|
|
@@ -651,8 +721,8 @@ var F = (e) => {
|
|
|
651
721
|
window.removeEventListener("popstate", e), clearInterval(n);
|
|
652
722
|
};
|
|
653
723
|
}, []), e;
|
|
654
|
-
},
|
|
655
|
-
let e =
|
|
724
|
+
}, ze = () => {
|
|
725
|
+
let e = Le(), t = Re(), n = B().routes, [r, i] = s(!0), a = e.pathname === "/" && Object.keys(e.params).length === 0 && e.loaderData === void 0 && t !== "/" ? t : e.pathname, o = Object.entries(e.params).map(([e, t]) => ({
|
|
656
726
|
key: e,
|
|
657
727
|
value: String(t)
|
|
658
728
|
}));
|
|
@@ -689,11 +759,11 @@ var F = (e) => {
|
|
|
689
759
|
children: n.noLoaderHint(/* @__PURE__ */ u("code", { children: "<Router>" }))
|
|
690
760
|
})] }) : /* @__PURE__ */ u("pre", {
|
|
691
761
|
className: "vdt:px-3 vdt:pb-3 vdt:text-[11px] vdt:max-h-80 vdt:overflow-auto vdt:font-mono vdt:text-foreground",
|
|
692
|
-
children:
|
|
762
|
+
children: Ie(e.loaderData)
|
|
693
763
|
}) : null
|
|
694
764
|
] })]
|
|
695
765
|
});
|
|
696
|
-
},
|
|
766
|
+
}, Be = (e) => {
|
|
697
767
|
let t = 0, n = 0, r = 0, i = 0, a = 0;
|
|
698
768
|
for (let o of Object.values(e)) o.kind === "query" && (t += 1), o.kind === "mutation" && (n += 1), o.kind === "action" && (r += 1), o.kind === "stream" && (i += 1), o.kind === "workflow" && (a += 1);
|
|
699
769
|
return {
|
|
@@ -703,17 +773,17 @@ var F = (e) => {
|
|
|
703
773
|
streams: i,
|
|
704
774
|
workflows: a
|
|
705
775
|
};
|
|
706
|
-
},
|
|
707
|
-
let e =
|
|
776
|
+
}, Ve = () => {
|
|
777
|
+
let e = b(), t = B().runtimes, n = e.names;
|
|
708
778
|
return n.length === 0 ? /* @__PURE__ */ d(O, { children: [t.emptyTitle, /* @__PURE__ */ u("div", {
|
|
709
779
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
710
780
|
children: t.emptyHint
|
|
711
781
|
})] }) : /* @__PURE__ */ u("div", {
|
|
712
782
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
713
783
|
children: n.map((n) => {
|
|
714
|
-
let r = e.get(n), i =
|
|
784
|
+
let r = e.get(n), i = Be(r.descriptors);
|
|
715
785
|
return /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ u(E, {
|
|
716
|
-
Icon:
|
|
786
|
+
Icon: ye,
|
|
717
787
|
right: /* @__PURE__ */ u(w, {
|
|
718
788
|
tone: "success",
|
|
719
789
|
children: t.live
|
|
@@ -751,24 +821,24 @@ var F = (e) => {
|
|
|
751
821
|
] })] }, n);
|
|
752
822
|
})
|
|
753
823
|
});
|
|
754
|
-
},
|
|
824
|
+
}, H = () => c(_, h, h), He = (e) => typeof e == "number" ? e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1)}s` : "—", U = (e) => {
|
|
755
825
|
try {
|
|
756
826
|
return JSON.stringify(e, null, 2);
|
|
757
827
|
} catch {
|
|
758
828
|
return String(e);
|
|
759
829
|
}
|
|
760
|
-
},
|
|
830
|
+
}, Ue = (e) => e === "pending" ? "info" : e === "success" ? "success" : "danger", We = ({ tone: e }) => /* @__PURE__ */ u("span", {
|
|
761
831
|
"aria-hidden": "true",
|
|
762
832
|
className: ["vdt:inline-block vdt:w-2 vdt:h-2 vdt:rounded-full", e === "success" ? "vdt:bg-success" : e === "danger" ? "vdt:bg-danger" : "vdt:bg-info"].join(" ")
|
|
763
|
-
}),
|
|
764
|
-
let r =
|
|
833
|
+
}), Ge = ({ mutation: e, expanded: t, onToggle: n }) => {
|
|
834
|
+
let r = Ue(e.status), i = new Date(e.startedAt).toISOString().slice(11, 23);
|
|
765
835
|
return /* @__PURE__ */ d("div", {
|
|
766
836
|
className: "vdt:border-b last:vdt:border-b-0 vdt:border-border",
|
|
767
837
|
children: [/* @__PURE__ */ d("button", {
|
|
768
838
|
onClick: n,
|
|
769
839
|
className: "vdt:w-full vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-1.5 hover:vdt:bg-muted/40 vdt:transition-colors",
|
|
770
840
|
children: [
|
|
771
|
-
/* @__PURE__ */ u(
|
|
841
|
+
/* @__PURE__ */ u(We, { tone: r }),
|
|
772
842
|
/* @__PURE__ */ u("span", {
|
|
773
843
|
className: "vdt:text-[10px] vdt:text-foreground-subtle vdt:font-mono vdt:tabular-nums",
|
|
774
844
|
children: i
|
|
@@ -785,7 +855,7 @@ var F = (e) => {
|
|
|
785
855
|
}),
|
|
786
856
|
/* @__PURE__ */ u("span", {
|
|
787
857
|
className: "vdt:text-[10px] vdt:font-mono vdt:text-foreground-muted vdt:tabular-nums",
|
|
788
|
-
children:
|
|
858
|
+
children: He(e.durationMs)
|
|
789
859
|
})
|
|
790
860
|
]
|
|
791
861
|
}), t ? /* @__PURE__ */ d("div", {
|
|
@@ -818,7 +888,7 @@ var F = (e) => {
|
|
|
818
888
|
},
|
|
819
889
|
{
|
|
820
890
|
key: "duration",
|
|
821
|
-
value:
|
|
891
|
+
value: He(e.durationMs)
|
|
822
892
|
}
|
|
823
893
|
] }),
|
|
824
894
|
/* @__PURE__ */ d("details", {
|
|
@@ -828,7 +898,7 @@ var F = (e) => {
|
|
|
828
898
|
children: "Input"
|
|
829
899
|
}), /* @__PURE__ */ u("pre", {
|
|
830
900
|
className: "vdt:mt-2 vdt:text-[11px] vdt:max-h-48 vdt:overflow-auto vdt:font-mono vdt:text-foreground",
|
|
831
|
-
children:
|
|
901
|
+
children: U(e.input)
|
|
832
902
|
})]
|
|
833
903
|
}),
|
|
834
904
|
e.status === "success" ? /* @__PURE__ */ d("details", {
|
|
@@ -838,7 +908,7 @@ var F = (e) => {
|
|
|
838
908
|
children: "Output"
|
|
839
909
|
}), /* @__PURE__ */ u("pre", {
|
|
840
910
|
className: "vdt:mt-2 vdt:text-[11px] vdt:max-h-48 vdt:overflow-auto vdt:font-mono vdt:text-foreground",
|
|
841
|
-
children:
|
|
911
|
+
children: U(e.output)
|
|
842
912
|
})]
|
|
843
913
|
}) : null,
|
|
844
914
|
e.status === "error" ? /* @__PURE__ */ d("details", {
|
|
@@ -849,85 +919,85 @@ var F = (e) => {
|
|
|
849
919
|
children: "Error"
|
|
850
920
|
}), /* @__PURE__ */ u("pre", {
|
|
851
921
|
className: "vdt:mt-2 vdt:text-[11px] vdt:max-h-48 vdt:overflow-auto vdt:font-mono vdt:text-danger",
|
|
852
|
-
children: e.error instanceof Error ? `${e.error.name}: ${e.error.message}\n\n${e.error.stack ?? ""}` :
|
|
922
|
+
children: e.error instanceof Error ? `${e.error.name}: ${e.error.message}\n\n${e.error.stack ?? ""}` : U(e.error)
|
|
853
923
|
})]
|
|
854
924
|
}) : null
|
|
855
925
|
]
|
|
856
926
|
}) : null]
|
|
857
927
|
});
|
|
858
|
-
},
|
|
859
|
-
let e =
|
|
928
|
+
}, Ke = () => {
|
|
929
|
+
let e = H(), t = B().mutations, [n, r] = s(null);
|
|
860
930
|
return e.length === 0 ? /* @__PURE__ */ d(O, { children: [t.emptyTitle, /* @__PURE__ */ u("div", {
|
|
861
931
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
862
932
|
children: t.emptyHint
|
|
863
933
|
})] }) : /* @__PURE__ */ u("div", {
|
|
864
934
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
865
935
|
children: /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ u(E, {
|
|
866
|
-
Icon:
|
|
936
|
+
Icon: N,
|
|
867
937
|
right: /* @__PURE__ */ d("button", {
|
|
868
938
|
onClick: () => {
|
|
869
939
|
f(), r(null);
|
|
870
940
|
},
|
|
871
941
|
title: t.clearTitle,
|
|
872
942
|
className: "vdt:inline-flex vdt:items-center vdt:gap-1 vdt:px-1.5 vdt:py-0.5 vdt:rounded-sm vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:text-foreground-muted hover:vdt:text-foreground hover:vdt:bg-muted/40 vdt:transition-colors",
|
|
873
|
-
children: [/* @__PURE__ */ u(
|
|
943
|
+
children: [/* @__PURE__ */ u(P, { className: "vdt:w-3 vdt:h-3" }), t.clear]
|
|
874
944
|
}),
|
|
875
945
|
children: t.recent(e.length)
|
|
876
|
-
}), e.map((e) => /* @__PURE__ */ u(
|
|
946
|
+
}), e.map((e) => /* @__PURE__ */ u(Ge, {
|
|
877
947
|
mutation: e,
|
|
878
948
|
expanded: n === e.id,
|
|
879
949
|
onToggle: () => r(n === e.id ? null : e.id)
|
|
880
950
|
}, e.id))] })
|
|
881
951
|
});
|
|
882
|
-
},
|
|
883
|
-
|
|
884
|
-
},
|
|
885
|
-
|
|
886
|
-
for (let e of
|
|
952
|
+
}, qe = () => H().length, Je = 500, W = [], G = /* @__PURE__ */ new Set(), Ye = [], Xe = () => {
|
|
953
|
+
Ye = W.slice();
|
|
954
|
+
}, Ze = () => {
|
|
955
|
+
Xe();
|
|
956
|
+
for (let e of G) try {
|
|
887
957
|
e();
|
|
888
958
|
} catch {}
|
|
889
959
|
};
|
|
890
|
-
|
|
960
|
+
oe(Qe);
|
|
891
961
|
function Qe(e) {
|
|
892
|
-
|
|
962
|
+
W.unshift(e), W.length > Je && (W.length = Je), Ze();
|
|
893
963
|
}
|
|
894
|
-
var
|
|
895
|
-
|
|
896
|
-
}),
|
|
897
|
-
|
|
898
|
-
},
|
|
964
|
+
var $e = () => Ye, et = (e) => (G.add(e), () => {
|
|
965
|
+
G.delete(e);
|
|
966
|
+
}), tt = () => {
|
|
967
|
+
W.length !== 0 && (W.length = 0, Ze());
|
|
968
|
+
}, nt = () => c(et, $e, $e), rt = [
|
|
899
969
|
"trace",
|
|
900
970
|
"debug",
|
|
901
971
|
"info",
|
|
902
972
|
"warn",
|
|
903
973
|
"error",
|
|
904
974
|
"fatal"
|
|
905
|
-
],
|
|
975
|
+
], it = {
|
|
906
976
|
trace: "vdt:text-foreground-subtle",
|
|
907
977
|
debug: "vdt:text-info",
|
|
908
978
|
info: "vdt:text-foreground",
|
|
909
979
|
warn: "vdt:text-warning",
|
|
910
980
|
error: "vdt:text-danger",
|
|
911
981
|
fatal: "vdt:text-danger vdt:font-bold"
|
|
912
|
-
},
|
|
982
|
+
}, at = {
|
|
913
983
|
trace: "vdt:bg-foreground-subtle",
|
|
914
984
|
debug: "vdt:bg-info",
|
|
915
985
|
info: "vdt:bg-accent",
|
|
916
986
|
warn: "vdt:bg-warning",
|
|
917
987
|
error: "vdt:bg-danger",
|
|
918
988
|
fatal: "vdt:bg-danger"
|
|
919
|
-
},
|
|
989
|
+
}, ot = (e) => {
|
|
920
990
|
if (Object.keys(e).length === 0) return "";
|
|
921
991
|
try {
|
|
922
992
|
return JSON.stringify(e, null, 2);
|
|
923
993
|
} catch {
|
|
924
994
|
return String(e);
|
|
925
995
|
}
|
|
926
|
-
},
|
|
996
|
+
}, st = (e) => {
|
|
927
997
|
let t = (e) => e < 10 ? `0${e}` : String(e);
|
|
928
998
|
return `${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}.${((e) => e < 100 ? e < 10 ? `00${e}` : `0${e}` : String(e))(e.getMilliseconds())}`;
|
|
929
|
-
},
|
|
930
|
-
let r = Object.keys(e.fields).length > 0 || e.cause !== void 0 || e.fiberId !== void 0, i = t ?
|
|
999
|
+
}, ct = ({ record: e, expanded: t, onToggle: n }) => {
|
|
1000
|
+
let r = Object.keys(e.fields).length > 0 || e.cause !== void 0 || e.fiberId !== void 0, i = t ? ot(e.fields) : "";
|
|
931
1001
|
return /* @__PURE__ */ d("div", {
|
|
932
1002
|
className: "vdt:border-b last:vdt:border-b-0 vdt:border-border",
|
|
933
1003
|
children: [/* @__PURE__ */ d("button", {
|
|
@@ -941,18 +1011,18 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
941
1011
|
children: [
|
|
942
1012
|
/* @__PURE__ */ u("span", {
|
|
943
1013
|
"aria-hidden": "true",
|
|
944
|
-
className: ["vdt:inline-block vdt:w-1 vdt:h-3.5 vdt:rounded-sm vdt:mt-1 vdt:flex-shrink-0",
|
|
1014
|
+
className: ["vdt:inline-block vdt:w-1 vdt:h-3.5 vdt:rounded-sm vdt:mt-1 vdt:flex-shrink-0", at[e.level]].join(" ")
|
|
945
1015
|
}),
|
|
946
1016
|
/* @__PURE__ */ u("span", {
|
|
947
1017
|
className: "vdt:text-[10px] vdt:font-mono vdt:tabular-nums vdt:text-foreground-subtle vdt:flex-shrink-0 vdt:mt-0.5",
|
|
948
|
-
children:
|
|
1018
|
+
children: st(e.ts)
|
|
949
1019
|
}),
|
|
950
1020
|
e.scope ? /* @__PURE__ */ u("span", {
|
|
951
1021
|
className: "vdt:text-[10px] vdt:font-mono vdt:text-foreground-muted vdt:flex-shrink-0 vdt:mt-0.5 vdt:truncate vdt:max-w-32",
|
|
952
1022
|
children: e.scope
|
|
953
1023
|
}) : null,
|
|
954
1024
|
/* @__PURE__ */ u("span", {
|
|
955
|
-
className: ["vdt:flex-1 vdt:text-xs vdt:break-words",
|
|
1025
|
+
className: ["vdt:flex-1 vdt:text-xs vdt:break-words", it[e.level]].join(" "),
|
|
956
1026
|
children: e.message
|
|
957
1027
|
})
|
|
958
1028
|
]
|
|
@@ -974,8 +1044,8 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
974
1044
|
]
|
|
975
1045
|
}) : null]
|
|
976
1046
|
});
|
|
977
|
-
},
|
|
978
|
-
let e =
|
|
1047
|
+
}, lt = () => {
|
|
1048
|
+
let e = nt(), t = B().logs, [n, r] = s(() => new Set(rt)), [i, o] = s(""), [c, l] = s(null), f = (e) => {
|
|
979
1049
|
r((t) => {
|
|
980
1050
|
let n = new Set(t);
|
|
981
1051
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
@@ -985,7 +1055,7 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
985
1055
|
return e.filter((e) => n.has(e.level) ? t === "" || [
|
|
986
1056
|
e.message,
|
|
987
1057
|
e.scope ?? "",
|
|
988
|
-
|
|
1058
|
+
ot(e.fields)
|
|
989
1059
|
].join(" ").toLowerCase().includes(t) : !1);
|
|
990
1060
|
}, [
|
|
991
1061
|
e,
|
|
@@ -996,20 +1066,20 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
996
1066
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
997
1067
|
children: [/* @__PURE__ */ d(T, { children: [
|
|
998
1068
|
/* @__PURE__ */ u(E, {
|
|
999
|
-
Icon:
|
|
1069
|
+
Icon: be,
|
|
1000
1070
|
right: /* @__PURE__ */ d("button", {
|
|
1001
1071
|
onClick: () => {
|
|
1002
|
-
|
|
1072
|
+
tt(), l(null);
|
|
1003
1073
|
},
|
|
1004
1074
|
title: t.clearTitle,
|
|
1005
1075
|
className: "vdt:inline-flex vdt:items-center vdt:gap-1 vdt:px-1.5 vdt:py-0.5 vdt:rounded-sm vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:text-foreground-muted hover:vdt:text-foreground hover:vdt:bg-muted/40 vdt:transition-colors",
|
|
1006
|
-
children: [/* @__PURE__ */ u(
|
|
1076
|
+
children: [/* @__PURE__ */ u(P, { className: "vdt:w-3 vdt:h-3" }), t.clear]
|
|
1007
1077
|
}),
|
|
1008
1078
|
children: t.filters
|
|
1009
1079
|
}),
|
|
1010
1080
|
/* @__PURE__ */ u("div", {
|
|
1011
1081
|
className: "vdt:flex vdt:flex-wrap vdt:gap-1.5 vdt:px-3 vdt:py-2 vdt:border-b vdt:border-border",
|
|
1012
|
-
children:
|
|
1082
|
+
children: rt.map((e) => {
|
|
1013
1083
|
let t = n.has(e);
|
|
1014
1084
|
return /* @__PURE__ */ d("button", {
|
|
1015
1085
|
onClick: () => f(e),
|
|
@@ -1024,7 +1094,7 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1024
1094
|
"aria-hidden": "true",
|
|
1025
1095
|
className: [
|
|
1026
1096
|
"vdt:inline-block vdt:w-1.5 vdt:h-1.5 vdt:rounded-full",
|
|
1027
|
-
|
|
1097
|
+
at[e],
|
|
1028
1098
|
t ? "" : "vdt:opacity-40"
|
|
1029
1099
|
].join(" ")
|
|
1030
1100
|
}), e]
|
|
@@ -1056,14 +1126,14 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1056
1126
|
children: t.tail
|
|
1057
1127
|
}), p.map((e, t) => {
|
|
1058
1128
|
let n = `${e.ts.getTime()}:${t}`;
|
|
1059
|
-
return /* @__PURE__ */ u(
|
|
1129
|
+
return /* @__PURE__ */ u(ct, {
|
|
1060
1130
|
record: e,
|
|
1061
1131
|
expanded: c === n,
|
|
1062
1132
|
onToggle: () => l(c === n ? null : n)
|
|
1063
1133
|
}, n);
|
|
1064
1134
|
})] })]
|
|
1065
1135
|
});
|
|
1066
|
-
},
|
|
1136
|
+
}, ut = () => nt().length, dt = () => c(v, g, g), K = (e, t = 90) => {
|
|
1067
1137
|
let n;
|
|
1068
1138
|
try {
|
|
1069
1139
|
n = JSON.stringify(e) ?? String(e);
|
|
@@ -1071,7 +1141,7 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1071
1141
|
n = String(e);
|
|
1072
1142
|
}
|
|
1073
1143
|
return n.length > t ? `${n.slice(0, t)}…` : n;
|
|
1074
|
-
},
|
|
1144
|
+
}, ft = (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])), pt = ({ label: e, state: t }) => {
|
|
1075
1145
|
let [n, r] = s(!1);
|
|
1076
1146
|
return /* @__PURE__ */ d("div", {
|
|
1077
1147
|
className: "voltro-dt-row",
|
|
@@ -1084,23 +1154,23 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1084
1154
|
children: e
|
|
1085
1155
|
}), /* @__PURE__ */ u("span", {
|
|
1086
1156
|
className: "voltro-dt-mono",
|
|
1087
|
-
children:
|
|
1157
|
+
children: K(t)
|
|
1088
1158
|
})]
|
|
1089
1159
|
}), n ? /* @__PURE__ */ u(D, { entries: Object.entries(t).map(([e, t]) => ({
|
|
1090
1160
|
key: e,
|
|
1091
|
-
value:
|
|
1161
|
+
value: K(t, 200)
|
|
1092
1162
|
})) }) : null]
|
|
1093
1163
|
});
|
|
1094
|
-
},
|
|
1095
|
-
let e =
|
|
1164
|
+
}, mt = () => {
|
|
1165
|
+
let e = dt(), [t, n] = s(null), r = ee(), i = t ?? e.length;
|
|
1096
1166
|
return /* @__PURE__ */ d(l, { children: [
|
|
1097
1167
|
/* @__PURE__ */ d(E, {
|
|
1098
|
-
Icon:
|
|
1168
|
+
Icon: ve,
|
|
1099
1169
|
right: /* @__PURE__ */ d(S, {
|
|
1100
1170
|
onClick: () => {
|
|
1101
1171
|
p(), n(null);
|
|
1102
1172
|
},
|
|
1103
|
-
children: [/* @__PURE__ */ u(
|
|
1173
|
+
children: [/* @__PURE__ */ u(P, {}), "Clear"]
|
|
1104
1174
|
}),
|
|
1105
1175
|
children: [
|
|
1106
1176
|
"Stores (",
|
|
@@ -1110,26 +1180,26 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1110
1180
|
}),
|
|
1111
1181
|
r.length === 0 ? /* @__PURE__ */ u(O, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : r.map((e) => /* @__PURE__ */ d(T, { children: [
|
|
1112
1182
|
/* @__PURE__ */ u(E, { children: e.name }),
|
|
1113
|
-
/* @__PURE__ */ u(
|
|
1183
|
+
/* @__PURE__ */ u(pt, {
|
|
1114
1184
|
label: "global",
|
|
1115
1185
|
state: e.get()
|
|
1116
1186
|
}),
|
|
1117
|
-
e.keys().map((t) => /* @__PURE__ */ u(
|
|
1187
|
+
e.keys().map((t) => /* @__PURE__ */ u(pt, {
|
|
1118
1188
|
label: t,
|
|
1119
1189
|
state: e.get(t)
|
|
1120
1190
|
}, t))
|
|
1121
1191
|
] }, e.name)),
|
|
1122
1192
|
/* @__PURE__ */ d(E, {
|
|
1123
|
-
Icon:
|
|
1193
|
+
Icon: N,
|
|
1124
1194
|
right: /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(S, {
|
|
1125
1195
|
onClick: () => {
|
|
1126
|
-
i <= 0 ||
|
|
1196
|
+
i <= 0 || y(i - 1, "before") && n(i - 1);
|
|
1127
1197
|
},
|
|
1128
1198
|
disabled: i <= 0,
|
|
1129
1199
|
children: "◀ Back"
|
|
1130
1200
|
}), /* @__PURE__ */ u(S, {
|
|
1131
1201
|
onClick: () => {
|
|
1132
|
-
t === null || i >= e.length ||
|
|
1202
|
+
t === null || i >= e.length || y(i, "after") && n(i + 1);
|
|
1133
1203
|
},
|
|
1134
1204
|
disabled: t === null || i >= e.length,
|
|
1135
1205
|
children: "Forward ▶"
|
|
@@ -1142,7 +1212,7 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1142
1212
|
]
|
|
1143
1213
|
}),
|
|
1144
1214
|
e.length === 0 ? /* @__PURE__ */ u(O, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...e].reverse().map((n, r) => {
|
|
1145
|
-
let a = e.length - 1 - r, o =
|
|
1215
|
+
let a = e.length - 1 - r, o = ft(n.prev, n.next);
|
|
1146
1216
|
return /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ d("div", {
|
|
1147
1217
|
className: "voltro-dt-rowhead",
|
|
1148
1218
|
children: [
|
|
@@ -1170,35 +1240,35 @@ var U = () => V, $e = (e) => (B.add(e), () => {
|
|
|
1170
1240
|
},
|
|
1171
1241
|
{
|
|
1172
1242
|
key: "before",
|
|
1173
|
-
value:
|
|
1243
|
+
value: K(n.prev)
|
|
1174
1244
|
},
|
|
1175
1245
|
{
|
|
1176
1246
|
key: "after",
|
|
1177
|
-
value:
|
|
1247
|
+
value: K(n.next)
|
|
1178
1248
|
}
|
|
1179
1249
|
] })] }, `${n.at}-${a}`);
|
|
1180
1250
|
})
|
|
1181
1251
|
] });
|
|
1182
|
-
},
|
|
1183
|
-
function
|
|
1184
|
-
return /* @__PURE__ */ u(
|
|
1252
|
+
}, ht = e(null);
|
|
1253
|
+
function gt(e) {
|
|
1254
|
+
return /* @__PURE__ */ u(ht.Provider, {
|
|
1185
1255
|
value: e.token,
|
|
1186
1256
|
children: e.children
|
|
1187
1257
|
});
|
|
1188
1258
|
}
|
|
1189
|
-
var
|
|
1259
|
+
var q = () => n(ht), J = (e, t) => {
|
|
1190
1260
|
let n = { ...t ?? {} };
|
|
1191
1261
|
return e !== null && e !== "" && (n.authorization = `Bearer ${e}`), n;
|
|
1192
|
-
},
|
|
1262
|
+
}, _t = (e) => e !== void 0 && e !== "" ? e : null, vt = (e) => typeof document > "u" ? () => {} : (document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e)), yt = () => typeof document > "u" || !document.hidden, bt = () => !0, Y = () => c(vt, yt, bt), xt = 5e3, St = async (e, t) => {
|
|
1193
1263
|
if (e === "") return null;
|
|
1194
1264
|
try {
|
|
1195
|
-
let n = await fetch(`${e}/_voltro/inspect/subscriptions`, { headers:
|
|
1265
|
+
let n = await fetch(`${e}/_voltro/inspect/subscriptions`, { headers: J(t, { accept: "application/json" }) });
|
|
1196
1266
|
return n.ok ? await n.json() : null;
|
|
1197
1267
|
} catch {
|
|
1198
1268
|
return null;
|
|
1199
1269
|
}
|
|
1200
|
-
},
|
|
1201
|
-
let t =
|
|
1270
|
+
}, Ct = (e) => {
|
|
1271
|
+
let t = b(), n = Y(), i = q(), a = t.names, o = e && n, [c, l] = s(() => a.map((e) => ({
|
|
1202
1272
|
name: e,
|
|
1203
1273
|
response: null,
|
|
1204
1274
|
live: !1
|
|
@@ -1218,7 +1288,7 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1218
1288
|
}, c = () => {
|
|
1219
1289
|
if (o !== null) return;
|
|
1220
1290
|
let t = async () => {
|
|
1221
|
-
let t = await
|
|
1291
|
+
let t = await St(r, i);
|
|
1222
1292
|
t !== null && n(e, {
|
|
1223
1293
|
response: t,
|
|
1224
1294
|
live: !1
|
|
@@ -1226,9 +1296,9 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1226
1296
|
};
|
|
1227
1297
|
t(), o = setInterval(() => {
|
|
1228
1298
|
t();
|
|
1229
|
-
},
|
|
1299
|
+
}, xt);
|
|
1230
1300
|
};
|
|
1231
|
-
|
|
1301
|
+
St(r, i).then((t) => {
|
|
1232
1302
|
t !== null && n(e, { response: t });
|
|
1233
1303
|
});
|
|
1234
1304
|
try {
|
|
@@ -1262,21 +1332,21 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1262
1332
|
a,
|
|
1263
1333
|
i
|
|
1264
1334
|
]), c;
|
|
1265
|
-
},
|
|
1335
|
+
}, X = (e) => {
|
|
1266
1336
|
if (typeof e != "object" || !e) return !1;
|
|
1267
1337
|
let t = e;
|
|
1268
|
-
if (Array.isArray(t.and)) return t.and.some(
|
|
1269
|
-
if (Array.isArray(t.or)) return t.or.some(
|
|
1338
|
+
if (Array.isArray(t.and)) return t.and.some(X);
|
|
1339
|
+
if (Array.isArray(t.or)) return t.or.some(X);
|
|
1270
1340
|
let n = t.op;
|
|
1271
1341
|
return n === "gt" || n === "gte" || n === "lt" || n === "lte";
|
|
1272
|
-
},
|
|
1342
|
+
}, Z = (e) => {
|
|
1273
1343
|
if (typeof e != "object" || !e) return !1;
|
|
1274
1344
|
let t = e;
|
|
1275
|
-
if (Array.isArray(t.and)) return t.and.some(
|
|
1276
|
-
if (Array.isArray(t.or)) return t.or.some(
|
|
1345
|
+
if (Array.isArray(t.and)) return t.and.some(Z);
|
|
1346
|
+
if (Array.isArray(t.or)) return t.or.some(Z);
|
|
1277
1347
|
let n = t.op;
|
|
1278
1348
|
return n === "eq" || n === "in";
|
|
1279
|
-
},
|
|
1349
|
+
}, wt = (e) => e.usingIndex !== void 0 && e.usingIndex.fields.every((t) => e.conjunctiveColumns.includes(t)) ? "tuple" : Z(e.predicate) ? "column" : X(e.predicate) ? "range" : "unindexed", Tt = (e) => e === "tuple" ? "success" : e === "column" ? "info" : e === "range" ? "neutral" : "warning", Et = (e) => e === "tuple" ? "tuple" : e === "column" ? "column" : e === "range" ? "range" : "UNINDEXED", Dt = (e) => e == null ? "null" : typeof e == "string" ? `'${e}'` : Array.isArray(e) ? `[${e.map(Dt).join(", ")}]` : String(e), Ot = (e) => e.op === "isNull" ? `${e.column} IS NULL` : e.op === "isNotNull" ? `${e.column} IS NOT NULL` : `${e.column} ${e.op} ${Dt(e.value)}`, Q = (e, t = 0) => {
|
|
1280
1350
|
if (typeof e != "object" || !e) return String(e);
|
|
1281
1351
|
let n = e;
|
|
1282
1352
|
if (Array.isArray(n.and)) return n.and.map((e) => Q(e, t + 1)).join(" AND ");
|
|
@@ -1284,9 +1354,9 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1284
1354
|
let e = n.or.map((e) => Q(e, t + 1)).join(" OR ");
|
|
1285
1355
|
return t > 0 ? `(${e})` : e;
|
|
1286
1356
|
}
|
|
1287
|
-
return typeof n.column == "string" && typeof n.op == "string" ?
|
|
1288
|
-
},
|
|
1289
|
-
let e =
|
|
1357
|
+
return typeof n.column == "string" && typeof n.op == "string" ? Ot(n) : JSON.stringify(e);
|
|
1358
|
+
}, kt = () => {
|
|
1359
|
+
let e = Ct(!0), t = B().indexes, n = e.filter((e) => e.response !== null).length;
|
|
1290
1360
|
return e.length === 0 ? /* @__PURE__ */ u(O, { children: t.noApis }) : n === 0 ? /* @__PURE__ */ d(O, { children: [t.unreachableTitle, /* @__PURE__ */ u("div", {
|
|
1291
1361
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
1292
1362
|
children: t.unreachableHint
|
|
@@ -1298,14 +1368,14 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1298
1368
|
}), /* @__PURE__ */ u("div", {
|
|
1299
1369
|
className: "vdt:text-xs vdt:text-foreground-subtle",
|
|
1300
1370
|
children: t.offline
|
|
1301
|
-
})] }, e) : /* @__PURE__ */ u(
|
|
1371
|
+
})] }, e) : /* @__PURE__ */ u(At, {
|
|
1302
1372
|
apiName: e,
|
|
1303
1373
|
response: n,
|
|
1304
1374
|
live: r
|
|
1305
1375
|
}, e))
|
|
1306
1376
|
});
|
|
1307
|
-
},
|
|
1308
|
-
let r =
|
|
1377
|
+
}, At = ({ apiName: e, response: t, live: n }) => {
|
|
1378
|
+
let r = B().indexes, i = [...t.subscriptions].sort((e, t) => t.subscriberCount - e.subscriberCount);
|
|
1309
1379
|
return /* @__PURE__ */ d(T, { children: [
|
|
1310
1380
|
/* @__PURE__ */ u(E, {
|
|
1311
1381
|
Icon: j,
|
|
@@ -1365,11 +1435,11 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1365
1435
|
children: r.subscriptionsSection
|
|
1366
1436
|
}), /* @__PURE__ */ u("div", {
|
|
1367
1437
|
className: "vdt:flex vdt:flex-col vdt:gap-2",
|
|
1368
|
-
children: i.map((e) => /* @__PURE__ */ u(
|
|
1438
|
+
children: i.map((e) => /* @__PURE__ */ u(jt, { sub: e }, e.fingerprint))
|
|
1369
1439
|
})] })
|
|
1370
1440
|
] });
|
|
1371
|
-
},
|
|
1372
|
-
let t =
|
|
1441
|
+
}, jt = ({ sub: e }) => {
|
|
1442
|
+
let t = B().indexes, n = wt(e);
|
|
1373
1443
|
return /* @__PURE__ */ d("div", {
|
|
1374
1444
|
className: "vdt:flex vdt:flex-col vdt:gap-0.5 vdt:px-2 vdt:py-1 vdt:rounded-sm vdt:bg-muted/40",
|
|
1375
1445
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -1380,8 +1450,8 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1380
1450
|
children: e.table
|
|
1381
1451
|
}),
|
|
1382
1452
|
/* @__PURE__ */ u(w, {
|
|
1383
|
-
tone:
|
|
1384
|
-
children:
|
|
1453
|
+
tone: Tt(n),
|
|
1454
|
+
children: Et(n)
|
|
1385
1455
|
}),
|
|
1386
1456
|
e.usingIndex && /* @__PURE__ */ d("span", {
|
|
1387
1457
|
className: "vdt:text-foreground-subtle",
|
|
@@ -1408,33 +1478,33 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1408
1478
|
children: Q(e.predicate)
|
|
1409
1479
|
})]
|
|
1410
1480
|
});
|
|
1411
|
-
},
|
|
1412
|
-
let t =
|
|
1481
|
+
}, Mt = (e) => {
|
|
1482
|
+
let t = Ct(e), n = 0;
|
|
1413
1483
|
for (let e of t) n += e.response?.subscriptions.length ?? 0;
|
|
1414
1484
|
return n;
|
|
1415
|
-
},
|
|
1485
|
+
}, Nt = {
|
|
1416
1486
|
outgoing: [],
|
|
1417
1487
|
incoming: [],
|
|
1418
1488
|
targets: [],
|
|
1419
1489
|
deliveries: []
|
|
1420
|
-
},
|
|
1490
|
+
}, Pt = 4e3, Ft = async (e, t) => {
|
|
1421
1491
|
if (e === "") return null;
|
|
1422
1492
|
try {
|
|
1423
|
-
let n = await fetch(`${e}/_voltro/inspect/webhooks`, { headers:
|
|
1493
|
+
let n = await fetch(`${e}/_voltro/inspect/webhooks`, { headers: J(t, { accept: "application/json" }) });
|
|
1424
1494
|
return n.ok ? await n.json() : null;
|
|
1425
1495
|
} catch {
|
|
1426
1496
|
return null;
|
|
1427
1497
|
}
|
|
1428
|
-
},
|
|
1429
|
-
let n =
|
|
1498
|
+
}, It = (e, t = !0) => {
|
|
1499
|
+
let n = Y(), i = q(), a = t && n && e !== "", [o, c] = s(Nt);
|
|
1430
1500
|
return r(() => {
|
|
1431
1501
|
if (!a) return;
|
|
1432
1502
|
let t = !1, n = async () => {
|
|
1433
|
-
let n = await
|
|
1503
|
+
let n = await Ft(e, i);
|
|
1434
1504
|
t || n === null || c(n);
|
|
1435
1505
|
};
|
|
1436
1506
|
n();
|
|
1437
|
-
let r = setInterval(n,
|
|
1507
|
+
let r = setInterval(n, Pt);
|
|
1438
1508
|
return () => {
|
|
1439
1509
|
t = !0, clearInterval(r);
|
|
1440
1510
|
};
|
|
@@ -1443,17 +1513,17 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1443
1513
|
a,
|
|
1444
1514
|
i
|
|
1445
1515
|
]), o;
|
|
1446
|
-
},
|
|
1516
|
+
}, Lt = {
|
|
1447
1517
|
pending: "neutral",
|
|
1448
1518
|
inFlight: "info",
|
|
1449
1519
|
succeeded: "success",
|
|
1450
1520
|
failed: "danger",
|
|
1451
1521
|
retryScheduled: "warning"
|
|
1452
|
-
},
|
|
1522
|
+
}, Rt = (e) => {
|
|
1453
1523
|
let t = new Date(e), n = (e) => e < 10 ? `0${e}` : String(e);
|
|
1454
1524
|
return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
|
|
1455
|
-
},
|
|
1456
|
-
let t =
|
|
1525
|
+
}, zt = (e) => {
|
|
1526
|
+
let t = b(), n = Y(), i = q(), a = t.names.join(","), [o, c] = s(0), l = e && n;
|
|
1457
1527
|
return r(() => {
|
|
1458
1528
|
if (!l) {
|
|
1459
1529
|
c(0);
|
|
@@ -1465,11 +1535,11 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1465
1535
|
return;
|
|
1466
1536
|
}
|
|
1467
1537
|
let n = !1, r = async () => {
|
|
1468
|
-
let t = await Promise.all(e.map((e) =>
|
|
1538
|
+
let t = await Promise.all(e.map((e) => Ft(e, i)));
|
|
1469
1539
|
n || c(t.reduce((e, t) => e + (t === null ? 0 : t.outgoing.length + t.incoming.length + t.targets.length), 0));
|
|
1470
1540
|
};
|
|
1471
1541
|
r();
|
|
1472
|
-
let o = setInterval(r,
|
|
1542
|
+
let o = setInterval(r, Pt);
|
|
1473
1543
|
return () => {
|
|
1474
1544
|
n = !0, clearInterval(o);
|
|
1475
1545
|
};
|
|
@@ -1479,14 +1549,14 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1479
1549
|
l,
|
|
1480
1550
|
i
|
|
1481
1551
|
]), o;
|
|
1482
|
-
},
|
|
1483
|
-
let n =
|
|
1552
|
+
}, Bt = ({ apiName: e, baseUrl: t }) => {
|
|
1553
|
+
let n = It(t), r = B().webhooks;
|
|
1484
1554
|
return n.outgoing.length + n.incoming.length + n.targets.length + n.deliveries.length > 0 ? /* @__PURE__ */ u("div", {
|
|
1485
1555
|
className: "vdt:space-y-4",
|
|
1486
1556
|
children: /* @__PURE__ */ d(T, { children: [
|
|
1487
1557
|
/* @__PURE__ */ d("div", {
|
|
1488
1558
|
className: "vdt:flex vdt:items-center vdt:gap-2 vdt:mb-3",
|
|
1489
|
-
children: [/* @__PURE__ */ u(
|
|
1559
|
+
children: [/* @__PURE__ */ u(xe, { className: "vdt:w-4 vdt:h-4 vdt:text-accent" }), /* @__PURE__ */ u(E, { children: e })]
|
|
1490
1560
|
}),
|
|
1491
1561
|
n.outgoing.length > 0 ? /* @__PURE__ */ d("div", {
|
|
1492
1562
|
className: "vdt:mb-4",
|
|
@@ -1609,14 +1679,14 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1609
1679
|
children: [
|
|
1610
1680
|
/* @__PURE__ */ u("span", {
|
|
1611
1681
|
className: "vdt:text-foreground-subtle",
|
|
1612
|
-
children:
|
|
1682
|
+
children: Rt(e.scheduledAt)
|
|
1613
1683
|
}),
|
|
1614
1684
|
/* @__PURE__ */ u("span", {
|
|
1615
1685
|
className: "vdt:text-foreground vdt:min-w-32 vdt:truncate",
|
|
1616
1686
|
children: e.event
|
|
1617
1687
|
}),
|
|
1618
1688
|
/* @__PURE__ */ u(w, {
|
|
1619
|
-
tone:
|
|
1689
|
+
tone: Lt[e.status],
|
|
1620
1690
|
children: e.status
|
|
1621
1691
|
}),
|
|
1622
1692
|
e.responseStatus === null ? null : /* @__PURE__ */ u("span", {
|
|
@@ -1640,36 +1710,36 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1640
1710
|
})] }) : null
|
|
1641
1711
|
] })
|
|
1642
1712
|
}) : null;
|
|
1643
|
-
},
|
|
1644
|
-
let e =
|
|
1713
|
+
}, Vt = () => {
|
|
1714
|
+
let e = b(), t = B().webhooks;
|
|
1645
1715
|
return e.names.length === 0 ? /* @__PURE__ */ u(O, { children: t.empty }) : /* @__PURE__ */ u("div", {
|
|
1646
1716
|
className: "vdt:space-y-4 vdt:p-3",
|
|
1647
1717
|
children: e.names.map((t) => {
|
|
1648
1718
|
let n = e.get(t);
|
|
1649
|
-
return /* @__PURE__ */ u(
|
|
1719
|
+
return /* @__PURE__ */ u(Bt, {
|
|
1650
1720
|
apiName: t,
|
|
1651
1721
|
baseUrl: n.inspectBaseUrl
|
|
1652
1722
|
}, t);
|
|
1653
1723
|
})
|
|
1654
1724
|
});
|
|
1655
|
-
},
|
|
1725
|
+
}, Ht = { traces: [] }, Ut = 4e3, Wt = async (e, t) => {
|
|
1656
1726
|
if (e === "") return null;
|
|
1657
1727
|
try {
|
|
1658
|
-
let n = await fetch(`${e}/_voltro/inspect/traces`, { headers:
|
|
1728
|
+
let n = await fetch(`${e}/_voltro/inspect/traces`, { headers: J(t, { accept: "application/json" }) });
|
|
1659
1729
|
return n.ok ? await n.json() : null;
|
|
1660
1730
|
} catch {
|
|
1661
1731
|
return null;
|
|
1662
1732
|
}
|
|
1663
|
-
},
|
|
1664
|
-
let n =
|
|
1733
|
+
}, Gt = (e, t = !0) => {
|
|
1734
|
+
let n = Y(), i = q(), a = t && n && e !== "", [o, c] = s(Ht);
|
|
1665
1735
|
return r(() => {
|
|
1666
1736
|
if (!a) return;
|
|
1667
1737
|
let t = !1, n = async () => {
|
|
1668
|
-
let n = await
|
|
1738
|
+
let n = await Wt(e, i);
|
|
1669
1739
|
t || n === null || c(n);
|
|
1670
1740
|
};
|
|
1671
1741
|
n();
|
|
1672
|
-
let r = setInterval(n,
|
|
1742
|
+
let r = setInterval(n, Ut);
|
|
1673
1743
|
return () => {
|
|
1674
1744
|
t = !0, clearInterval(r);
|
|
1675
1745
|
};
|
|
@@ -1678,8 +1748,8 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1678
1748
|
a,
|
|
1679
1749
|
i
|
|
1680
1750
|
]), o;
|
|
1681
|
-
},
|
|
1682
|
-
let t =
|
|
1751
|
+
}, Kt = (e) => {
|
|
1752
|
+
let t = b(), n = Y(), i = q(), a = t.names.join(","), [o, c] = s(0), l = e && n;
|
|
1683
1753
|
return r(() => {
|
|
1684
1754
|
if (!l) {
|
|
1685
1755
|
c(0);
|
|
@@ -1691,11 +1761,11 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1691
1761
|
return;
|
|
1692
1762
|
}
|
|
1693
1763
|
let n = !1, r = async () => {
|
|
1694
|
-
let t = await Promise.all(e.map((e) =>
|
|
1764
|
+
let t = await Promise.all(e.map((e) => Wt(e, i)));
|
|
1695
1765
|
n || c(t.reduce((e, t) => e + (t === null ? 0 : t.traces.filter((e) => e.hasError).length), 0));
|
|
1696
1766
|
};
|
|
1697
1767
|
r();
|
|
1698
|
-
let o = setInterval(r,
|
|
1768
|
+
let o = setInterval(r, Ut);
|
|
1699
1769
|
return () => {
|
|
1700
1770
|
n = !0, clearInterval(o);
|
|
1701
1771
|
};
|
|
@@ -1705,10 +1775,10 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1705
1775
|
l,
|
|
1706
1776
|
i
|
|
1707
1777
|
]), o;
|
|
1708
|
-
}, $ = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`,
|
|
1778
|
+
}, $ = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, qt = (e) => {
|
|
1709
1779
|
let t = new Date(e), n = (e) => e < 10 ? `0${e}` : String(e);
|
|
1710
1780
|
return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
|
|
1711
|
-
},
|
|
1781
|
+
}, Jt = (e) => {
|
|
1712
1782
|
let t = new Map(e.map((e) => [e.spanId, e])), n = /* @__PURE__ */ new Map(), r = (e, i) => {
|
|
1713
1783
|
if (n.has(e.spanId)) return n.get(e.spanId);
|
|
1714
1784
|
if (i > 64 || e.parentSpanId === null) return n.set(e.spanId, 0), 0;
|
|
@@ -1717,8 +1787,8 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1717
1787
|
};
|
|
1718
1788
|
for (let t of e) r(t, 0);
|
|
1719
1789
|
return n;
|
|
1720
|
-
},
|
|
1721
|
-
let [t, n] = s(e.hasError), r =
|
|
1790
|
+
}, Yt = ({ trace: e }) => {
|
|
1791
|
+
let [t, n] = s(e.hasError), r = B().traces, i = Jt(e.spans), a = e.startMs, o = e.durationMs > 0 ? e.durationMs : 1;
|
|
1722
1792
|
return /* @__PURE__ */ d("div", {
|
|
1723
1793
|
className: "vdt:border vdt:border-border vdt:rounded-md vdt:overflow-hidden",
|
|
1724
1794
|
children: [/* @__PURE__ */ d("button", {
|
|
@@ -1764,7 +1834,7 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1764
1834
|
})] }),
|
|
1765
1835
|
/* @__PURE__ */ u("span", {
|
|
1766
1836
|
className: "vdt:text-foreground-subtle vdt:text-xs",
|
|
1767
|
-
children:
|
|
1837
|
+
children: qt(e.startMs)
|
|
1768
1838
|
})
|
|
1769
1839
|
]
|
|
1770
1840
|
}), t ? /* @__PURE__ */ d("div", {
|
|
@@ -1818,15 +1888,15 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1818
1888
|
]
|
|
1819
1889
|
}) : null]
|
|
1820
1890
|
});
|
|
1821
|
-
},
|
|
1822
|
-
let n =
|
|
1891
|
+
}, Xt = ({ apiName: e, baseUrl: t }) => {
|
|
1892
|
+
let n = Gt(t), r = B().traces;
|
|
1823
1893
|
return n.traces.length === 0 ? /* @__PURE__ */ u("div", {
|
|
1824
1894
|
className: "vdt:text-foreground-muted vdt:text-sm vdt:px-1",
|
|
1825
1895
|
children: r.noneCaptured(e)
|
|
1826
1896
|
}) : /* @__PURE__ */ d(T, { children: [/* @__PURE__ */ d("div", {
|
|
1827
1897
|
className: "vdt:flex vdt:items-center vdt:gap-2 vdt:mb-3",
|
|
1828
1898
|
children: [
|
|
1829
|
-
/* @__PURE__ */ u(
|
|
1899
|
+
/* @__PURE__ */ u(Se, { className: "vdt:w-4 vdt:h-4 vdt:text-accent" }),
|
|
1830
1900
|
/* @__PURE__ */ u(E, { children: e }),
|
|
1831
1901
|
/* @__PURE__ */ u(w, {
|
|
1832
1902
|
tone: "neutral",
|
|
@@ -1835,10 +1905,10 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1835
1905
|
]
|
|
1836
1906
|
}), /* @__PURE__ */ u("div", {
|
|
1837
1907
|
className: "vdt:space-y-2",
|
|
1838
|
-
children: n.traces.map((e) => /* @__PURE__ */ u(
|
|
1908
|
+
children: n.traces.map((e) => /* @__PURE__ */ u(Yt, { trace: e }, e.traceId))
|
|
1839
1909
|
})] });
|
|
1840
|
-
},
|
|
1841
|
-
let e =
|
|
1910
|
+
}, Zt = () => {
|
|
1911
|
+
let e = b(), t = B().traces, n = e.names, r = n.map((t) => ({
|
|
1842
1912
|
name: t,
|
|
1843
1913
|
handle: e.get(t)
|
|
1844
1914
|
})).filter((e) => e.handle !== null && e.handle.inspectBaseUrl !== "");
|
|
@@ -1853,39 +1923,39 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1853
1923
|
})) })]
|
|
1854
1924
|
}) : /* @__PURE__ */ u("div", {
|
|
1855
1925
|
className: "vdt:space-y-4",
|
|
1856
|
-
children: r.map(({ name: e, handle: t }) => /* @__PURE__ */ u(
|
|
1926
|
+
children: r.map(({ name: e, handle: t }) => /* @__PURE__ */ u(Xt, {
|
|
1857
1927
|
apiName: e,
|
|
1858
1928
|
baseUrl: t.inspectBaseUrl
|
|
1859
1929
|
}, e))
|
|
1860
1930
|
});
|
|
1861
|
-
},
|
|
1931
|
+
}, Qt = () => c(ae, re, re), $t = "voltro:devtools:open", en = (e) => {
|
|
1862
1932
|
if (typeof window > "u") return e;
|
|
1863
1933
|
try {
|
|
1864
|
-
let t = window.localStorage.getItem(
|
|
1934
|
+
let t = window.localStorage.getItem($t);
|
|
1865
1935
|
return t === null ? e : t === "1";
|
|
1866
1936
|
} catch {
|
|
1867
1937
|
return e;
|
|
1868
1938
|
}
|
|
1869
|
-
},
|
|
1939
|
+
}, tn = (e) => {
|
|
1870
1940
|
if (!(typeof window > "u")) try {
|
|
1871
|
-
window.localStorage.setItem(
|
|
1941
|
+
window.localStorage.setItem($t, e ? "1" : "0");
|
|
1872
1942
|
} catch {}
|
|
1873
|
-
},
|
|
1874
|
-
let i =
|
|
1875
|
-
return /* @__PURE__ */ u(
|
|
1943
|
+
}, nn = ({ initialIsOpen: e = !1, initialAnchor: t = "bottomLeft", strings: n, inspectToken: r } = {}) => {
|
|
1944
|
+
let i = _t(r);
|
|
1945
|
+
return /* @__PURE__ */ u(gt, {
|
|
1876
1946
|
token: i,
|
|
1877
|
-
children: /* @__PURE__ */ u(
|
|
1947
|
+
children: /* @__PURE__ */ u(z, {
|
|
1878
1948
|
strings: n ?? {},
|
|
1879
|
-
children: /* @__PURE__ */ u(
|
|
1949
|
+
children: /* @__PURE__ */ u(rn, {
|
|
1880
1950
|
initialIsOpen: e,
|
|
1881
1951
|
initialAnchor: t
|
|
1882
1952
|
})
|
|
1883
1953
|
})
|
|
1884
1954
|
});
|
|
1885
|
-
},
|
|
1886
|
-
let n =
|
|
1955
|
+
}, rn = ({ initialIsOpen: e, initialAnchor: t }) => {
|
|
1956
|
+
let n = B().shell, [i, a] = ue(t), [o, c] = s(() => en(e)), [l, f] = s("subscriptions"), p = Fe(), m = qe(), ee = ut(), h = Mt(o), g = zt(o), te = Kt(o), _ = Qt(), v = _.length > 0 ? _[_.length - 1] : null, y = v !== null;
|
|
1887
1957
|
return r(() => {
|
|
1888
|
-
|
|
1958
|
+
tn(o);
|
|
1889
1959
|
}, [o]), r(() => {
|
|
1890
1960
|
if (typeof window > "u") return;
|
|
1891
1961
|
let e = (e) => {
|
|
@@ -1894,23 +1964,23 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1894
1964
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1895
1965
|
}, []), /* @__PURE__ */ u("div", {
|
|
1896
1966
|
className: "vdt-host",
|
|
1897
|
-
style:
|
|
1967
|
+
style: de(i),
|
|
1898
1968
|
children: /* @__PURE__ */ u("div", {
|
|
1899
1969
|
className: "vdt-scope",
|
|
1900
1970
|
children: /* @__PURE__ */ d("div", {
|
|
1901
1971
|
className: "vdt-surface vdt-pulse vdt-anim-pop",
|
|
1902
1972
|
"data-open": o ? "true" : "false",
|
|
1903
|
-
"data-busy":
|
|
1904
|
-
"data-kind":
|
|
1973
|
+
"data-busy": y ? "true" : "false",
|
|
1974
|
+
"data-kind": v?.kind ?? "idle",
|
|
1905
1975
|
role: o ? "dialog" : void 0,
|
|
1906
1976
|
"aria-label": o ? n.brand : void 0,
|
|
1907
|
-
children: [/* @__PURE__ */ u(
|
|
1977
|
+
children: [/* @__PURE__ */ u(on, {
|
|
1908
1978
|
open: o,
|
|
1909
|
-
busy:
|
|
1910
|
-
label:
|
|
1911
|
-
kind:
|
|
1979
|
+
busy: y,
|
|
1980
|
+
label: v?.label ?? "",
|
|
1981
|
+
kind: v?.kind ?? "idle",
|
|
1912
1982
|
onOpen: () => c(!0)
|
|
1913
|
-
}), /* @__PURE__ */ u(
|
|
1983
|
+
}), /* @__PURE__ */ u(sn, {
|
|
1914
1984
|
open: o,
|
|
1915
1985
|
anchor: i,
|
|
1916
1986
|
onAnchor: a,
|
|
@@ -1919,16 +1989,16 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1919
1989
|
onTab: f,
|
|
1920
1990
|
subsCount: p,
|
|
1921
1991
|
mutationsCount: m,
|
|
1922
|
-
logsCount:
|
|
1923
|
-
indexesCount:
|
|
1924
|
-
webhooksCount:
|
|
1925
|
-
tracesCount:
|
|
1992
|
+
logsCount: ee,
|
|
1993
|
+
indexesCount: h,
|
|
1994
|
+
webhooksCount: g,
|
|
1995
|
+
tracesCount: te
|
|
1926
1996
|
})]
|
|
1927
1997
|
})
|
|
1928
1998
|
})
|
|
1929
1999
|
});
|
|
1930
|
-
},
|
|
1931
|
-
let a =
|
|
2000
|
+
}, an = (e) => e === "compiling" || e === "loading" || e === "reconnecting", on = ({ open: e, busy: t, label: n, kind: r, onOpen: i }) => {
|
|
2001
|
+
let a = B().shell, o = an(r), s = o ? n.replace(/[…\.\s]+$/, "") : n;
|
|
1932
2002
|
return /* @__PURE__ */ d("button", {
|
|
1933
2003
|
type: "button",
|
|
1934
2004
|
className: "vdt-fab-layer",
|
|
@@ -1937,7 +2007,7 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1937
2007
|
"aria-hidden": e ? "true" : "false",
|
|
1938
2008
|
title: e ? void 0 : a.openTitle,
|
|
1939
2009
|
"aria-label": e ? void 0 : a.openLabel,
|
|
1940
|
-
children: [t ? /* @__PURE__ */ u(
|
|
2010
|
+
children: [t ? /* @__PURE__ */ u(Ce, { className: "vdt:w-5 vdt:h-5 vdt-spinner" }) : /* @__PURE__ */ u(A, { className: "vdt:w-6 vdt:h-6" }), /* @__PURE__ */ d("span", {
|
|
1941
2011
|
className: "vdt-fab-label",
|
|
1942
2012
|
children: [s, o ? /* @__PURE__ */ d("span", {
|
|
1943
2013
|
className: "vdt-dots",
|
|
@@ -1950,18 +2020,18 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
1950
2020
|
}) : null]
|
|
1951
2021
|
})]
|
|
1952
2022
|
});
|
|
1953
|
-
},
|
|
1954
|
-
let m =
|
|
2023
|
+
}, sn = ({ open: e, anchor: t, onAnchor: n, onClose: r, tab: i, onTab: a, subsCount: o, mutationsCount: s, logsCount: c, indexesCount: l, webhooksCount: f, tracesCount: p }) => {
|
|
2024
|
+
let m = B().tabs;
|
|
1955
2025
|
return /* @__PURE__ */ d("div", {
|
|
1956
2026
|
className: "vdt-panel-layer",
|
|
1957
2027
|
"aria-hidden": e ? "false" : "true",
|
|
1958
2028
|
children: [
|
|
1959
|
-
/* @__PURE__ */ u(
|
|
2029
|
+
/* @__PURE__ */ u(cn, {
|
|
1960
2030
|
anchor: t,
|
|
1961
2031
|
onAnchor: n,
|
|
1962
2032
|
onClose: r
|
|
1963
2033
|
}),
|
|
1964
|
-
/* @__PURE__ */ d(
|
|
2034
|
+
/* @__PURE__ */ d(he, { children: [
|
|
1965
2035
|
/* @__PURE__ */ u(C, {
|
|
1966
2036
|
active: i === "subscriptions",
|
|
1967
2037
|
onClick: () => a("subscriptions"),
|
|
@@ -2017,21 +2087,21 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
2017
2087
|
/* @__PURE__ */ d("div", {
|
|
2018
2088
|
className: "vdt:flex-1 vdt:overflow-auto vdt:bg-background",
|
|
2019
2089
|
children: [
|
|
2020
|
-
e && i === "subscriptions" ? /* @__PURE__ */ u(
|
|
2021
|
-
e && i === "mutations" ? /* @__PURE__ */ u(
|
|
2022
|
-
e && i === "indexes" ? /* @__PURE__ */ u(
|
|
2023
|
-
e && i === "webhooks" ? /* @__PURE__ */ u(
|
|
2024
|
-
e && i === "traces" ? /* @__PURE__ */ u(
|
|
2025
|
-
e && i === "routes" ? /* @__PURE__ */ u(
|
|
2026
|
-
e && i === "runtimes" ? /* @__PURE__ */ u(
|
|
2027
|
-
e && i === "stores" ? /* @__PURE__ */ u(
|
|
2028
|
-
e && i === "logs" ? /* @__PURE__ */ u(
|
|
2090
|
+
e && i === "subscriptions" ? /* @__PURE__ */ u(Pe, {}) : null,
|
|
2091
|
+
e && i === "mutations" ? /* @__PURE__ */ u(Ke, {}) : null,
|
|
2092
|
+
e && i === "indexes" ? /* @__PURE__ */ u(kt, {}) : null,
|
|
2093
|
+
e && i === "webhooks" ? /* @__PURE__ */ u(Vt, {}) : null,
|
|
2094
|
+
e && i === "traces" ? /* @__PURE__ */ u(Zt, {}) : null,
|
|
2095
|
+
e && i === "routes" ? /* @__PURE__ */ u(ze, {}) : null,
|
|
2096
|
+
e && i === "runtimes" ? /* @__PURE__ */ u(Ve, {}) : null,
|
|
2097
|
+
e && i === "stores" ? /* @__PURE__ */ u(mt, {}) : null,
|
|
2098
|
+
e && i === "logs" ? /* @__PURE__ */ u(lt, {}) : null
|
|
2029
2099
|
]
|
|
2030
2100
|
})
|
|
2031
2101
|
]
|
|
2032
2102
|
});
|
|
2033
|
-
},
|
|
2034
|
-
let r =
|
|
2103
|
+
}, cn = ({ anchor: e, onAnchor: t, onClose: n }) => {
|
|
2104
|
+
let r = B().shell;
|
|
2035
2105
|
return /* @__PURE__ */ d("div", {
|
|
2036
2106
|
className: "vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2 vdt:border-b vdt:border-border vdt:bg-background-elevated",
|
|
2037
2107
|
children: [
|
|
@@ -2046,17 +2116,17 @@ var K = () => n(pt), q = (e, t) => {
|
|
|
2046
2116
|
children: r.kicker
|
|
2047
2117
|
})]
|
|
2048
2118
|
}),
|
|
2049
|
-
/* @__PURE__ */ u(
|
|
2119
|
+
/* @__PURE__ */ u(Te, {
|
|
2050
2120
|
anchor: e,
|
|
2051
2121
|
onChange: t
|
|
2052
2122
|
}),
|
|
2053
|
-
/* @__PURE__ */ u(
|
|
2123
|
+
/* @__PURE__ */ u(me, {
|
|
2054
2124
|
onClick: n,
|
|
2055
2125
|
title: r.closeTitle,
|
|
2056
|
-
children: /* @__PURE__ */ u(
|
|
2126
|
+
children: /* @__PURE__ */ u(_e, { className: "vdt:w-4 vdt:h-4" })
|
|
2057
2127
|
})
|
|
2058
2128
|
]
|
|
2059
2129
|
});
|
|
2060
2130
|
};
|
|
2061
2131
|
//#endregion
|
|
2062
|
-
export {
|
|
2132
|
+
export { z as DevtoolsStringsProvider, nn as VoltroDevtools, I as defaultDevtoolsStrings, B as useDevtoolsStrings };
|