@motiadev/plugin-observability 0.13.0-beta.162-158257 → 0.13.0-beta.162-687645
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/dist/index.js +426 -1479
- package/dist/index.js.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +4 -6
package/dist/index.js
CHANGED
|
@@ -11,72 +11,7 @@ import "react18-json-view/src/style.css";
|
|
|
11
11
|
import { formatDistanceToNow } from "date-fns";
|
|
12
12
|
|
|
13
13
|
import './index.css';
|
|
14
|
-
//#region rolldown:runtime
|
|
15
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
-
var __commonJS = (cb, mod) => function() {
|
|
17
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
-
};
|
|
19
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
20
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
21
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region ../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-compiler-runtime.production.js
|
|
26
|
-
/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-compiler-runtime.production.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/
|
|
35
|
-
var require_react_compiler_runtime_production = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-compiler-runtime.production.js": ((exports) => {
|
|
36
|
-
var ReactSharedInternals = __require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
37
|
-
exports.c = function(size) {
|
|
38
|
-
return ReactSharedInternals.H.useMemoCache(size);
|
|
39
|
-
};
|
|
40
|
-
}) });
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region ../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-compiler-runtime.development.js
|
|
44
|
-
/**
|
|
45
|
-
* @license React
|
|
46
|
-
* react-compiler-runtime.development.js
|
|
47
|
-
*
|
|
48
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the MIT license found in the
|
|
51
|
-
* LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/
|
|
53
|
-
var require_react_compiler_runtime_development = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-compiler-runtime.development.js": ((exports) => {
|
|
54
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
55
|
-
var ReactSharedInternals$1 = __require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
56
|
-
exports.c = function(size) {
|
|
57
|
-
var dispatcher = ReactSharedInternals$1.H;
|
|
58
|
-
null === dispatcher && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
59
|
-
return dispatcher.useMemoCache(size);
|
|
60
|
-
};
|
|
61
|
-
}();
|
|
62
|
-
}) });
|
|
63
|
-
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region ../../node_modules/.pnpm/react@19.2.0/node_modules/react/compiler-runtime.js
|
|
66
|
-
/**
|
|
67
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the MIT license found in the
|
|
70
|
-
* LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/
|
|
72
|
-
var require_compiler_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/compiler-runtime.js": ((exports, module) => {
|
|
73
|
-
if (process.env.NODE_ENV === "production") module.exports = require_react_compiler_runtime_production();
|
|
74
|
-
else module.exports = require_react_compiler_runtime_development();
|
|
75
|
-
}) });
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
14
|
//#region src/stores/use-observability-store.ts
|
|
79
|
-
var import_compiler_runtime$24 = require_compiler_runtime();
|
|
80
15
|
const useObservabilityStore = create()((set) => ({
|
|
81
16
|
selectedTraceGroupId: "",
|
|
82
17
|
selectedTraceId: void 0,
|
|
@@ -92,170 +27,64 @@ const useObservabilityStore = create()((set) => ({
|
|
|
92
27
|
//#endregion
|
|
93
28
|
//#region src/components/search-bar.tsx
|
|
94
29
|
const SearchBar = memo(() => {
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
$[0] = setSearch;
|
|
103
|
-
$[1] = t0;
|
|
104
|
-
} else t0 = $[1];
|
|
105
|
-
let t1;
|
|
106
|
-
if ($[2] !== search || $[3] !== t0) {
|
|
107
|
-
t1 = /* @__PURE__ */ jsx(Input, {
|
|
108
|
-
variant: "shade",
|
|
109
|
-
value: search,
|
|
110
|
-
onChange: t0,
|
|
111
|
-
className: "px-9! font-medium",
|
|
112
|
-
placeholder: "Search by Trace ID or Step Name"
|
|
113
|
-
});
|
|
114
|
-
$[2] = search;
|
|
115
|
-
$[3] = t0;
|
|
116
|
-
$[4] = t1;
|
|
117
|
-
} else t1 = $[4];
|
|
118
|
-
let t2;
|
|
119
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
-
t2 = /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" });
|
|
121
|
-
$[5] = t2;
|
|
122
|
-
} else t2 = $[5];
|
|
123
|
-
const t3 = search !== "";
|
|
124
|
-
const t4 = search === "";
|
|
125
|
-
let t5;
|
|
126
|
-
if ($[6] !== t3 || $[7] !== t4) {
|
|
127
|
-
t5 = cn("cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground", {
|
|
128
|
-
visible: t3,
|
|
129
|
-
invisible: t4
|
|
130
|
-
});
|
|
131
|
-
$[6] = t3;
|
|
132
|
-
$[7] = t4;
|
|
133
|
-
$[8] = t5;
|
|
134
|
-
} else t5 = $[8];
|
|
135
|
-
let t6;
|
|
136
|
-
if ($[9] !== setSearch) {
|
|
137
|
-
t6 = () => setSearch("");
|
|
138
|
-
$[9] = setSearch;
|
|
139
|
-
$[10] = t6;
|
|
140
|
-
} else t6 = $[10];
|
|
141
|
-
let t7;
|
|
142
|
-
if ($[11] !== t5 || $[12] !== t6) {
|
|
143
|
-
t7 = /* @__PURE__ */ jsx(X, {
|
|
144
|
-
className: t5,
|
|
145
|
-
onClick: t6
|
|
146
|
-
});
|
|
147
|
-
$[11] = t5;
|
|
148
|
-
$[12] = t6;
|
|
149
|
-
$[13] = t7;
|
|
150
|
-
} else t7 = $[13];
|
|
151
|
-
let t8;
|
|
152
|
-
if ($[14] !== t1 || $[15] !== t7) {
|
|
153
|
-
t8 = /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
const search = useObservabilityStore((state) => state.search);
|
|
31
|
+
const setSearch = useObservabilityStore((state) => state.setSearch);
|
|
32
|
+
const clearTraces = useObservabilityStore((state) => state.clearTraces);
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "flex p-2 border-b gap-2",
|
|
35
|
+
"data-testid": "logs-search-container",
|
|
36
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
154
37
|
className: "flex-1 relative",
|
|
155
38
|
children: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
39
|
+
/* @__PURE__ */ jsx(Input, {
|
|
40
|
+
variant: "shade",
|
|
41
|
+
value: search,
|
|
42
|
+
onChange: (e) => setSearch(e.target.value),
|
|
43
|
+
className: "px-9! font-medium",
|
|
44
|
+
placeholder: "Search by Trace ID or Step Name"
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
|
|
47
|
+
/* @__PURE__ */ jsx(X, {
|
|
48
|
+
className: cn("cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground", {
|
|
49
|
+
visible: search !== "",
|
|
50
|
+
invisible: search === ""
|
|
51
|
+
}),
|
|
52
|
+
onClick: () => setSearch("")
|
|
53
|
+
})
|
|
159
54
|
]
|
|
160
|
-
})
|
|
161
|
-
$[14] = t1;
|
|
162
|
-
$[15] = t7;
|
|
163
|
-
$[16] = t8;
|
|
164
|
-
} else t8 = $[16];
|
|
165
|
-
let t9;
|
|
166
|
-
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
167
|
-
t9 = /* @__PURE__ */ jsx(Trash, {});
|
|
168
|
-
$[17] = t9;
|
|
169
|
-
} else t9 = $[17];
|
|
170
|
-
let t10;
|
|
171
|
-
if ($[18] !== clearTraces) {
|
|
172
|
-
t10 = /* @__PURE__ */ jsxs(Button, {
|
|
55
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
173
56
|
variant: "default",
|
|
174
57
|
onClick: clearTraces,
|
|
175
58
|
className: "h-[34px]",
|
|
176
|
-
children: [
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
$[19] = t10;
|
|
180
|
-
} else t10 = $[19];
|
|
181
|
-
let t11;
|
|
182
|
-
if ($[20] !== t10 || $[21] !== t8) {
|
|
183
|
-
t11 = /* @__PURE__ */ jsxs("div", {
|
|
184
|
-
className: "flex p-2 border-b gap-2",
|
|
185
|
-
"data-testid": "logs-search-container",
|
|
186
|
-
children: [t8, t10]
|
|
187
|
-
});
|
|
188
|
-
$[20] = t10;
|
|
189
|
-
$[21] = t8;
|
|
190
|
-
$[22] = t11;
|
|
191
|
-
} else t11 = $[22];
|
|
192
|
-
return t11;
|
|
59
|
+
children: [/* @__PURE__ */ jsx(Trash, {}), " Clear"]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
193
62
|
});
|
|
194
63
|
SearchBar.displayName = "SearchBar";
|
|
195
|
-
function _temp$6(state) {
|
|
196
|
-
return state.search;
|
|
197
|
-
}
|
|
198
|
-
function _temp2$2(state_0) {
|
|
199
|
-
return state_0.setSearch;
|
|
200
|
-
}
|
|
201
|
-
function _temp3(state_1) {
|
|
202
|
-
return state_1.clearTraces;
|
|
203
|
-
}
|
|
204
64
|
|
|
205
65
|
//#endregion
|
|
206
66
|
//#region src/components/trace-empty-state.tsx
|
|
207
|
-
var import_compiler_runtime$23 = require_compiler_runtime();
|
|
208
67
|
const TraceEmptyState = memo(() => {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
className: "flex items-center justify-center h-full text-muted-foreground",
|
|
215
|
-
children: "Select a trace or trace group to view the timeline"
|
|
216
|
-
});
|
|
217
|
-
$[0] = t0;
|
|
218
|
-
} else t0 = $[0];
|
|
219
|
-
return t0;
|
|
68
|
+
if (useObservabilityStore((state) => state.selectedTraceGroupId)) return null;
|
|
69
|
+
return /* @__PURE__ */ jsx("div", {
|
|
70
|
+
className: "flex items-center justify-center h-full text-muted-foreground",
|
|
71
|
+
children: "Select a trace or trace group to view the timeline"
|
|
72
|
+
});
|
|
220
73
|
});
|
|
221
74
|
TraceEmptyState.displayName = "TraceEmptyState";
|
|
222
|
-
function _temp$5(state) {
|
|
223
|
-
return state.selectedTraceGroupId;
|
|
224
|
-
}
|
|
225
75
|
|
|
226
76
|
//#endregion
|
|
227
77
|
//#region src/hooks/use-get-endtime.ts
|
|
228
|
-
var import_compiler_runtime$22 = require_compiler_runtime();
|
|
229
78
|
const useGetEndTime = (group) => {
|
|
230
|
-
const $ = (0, import_compiler_runtime$22.c)(6);
|
|
231
79
|
const groupEndTime = group?.endTime;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
let t2;
|
|
241
|
-
if ($[2] !== endTime || $[3] !== groupEndTime) {
|
|
242
|
-
t1 = () => {
|
|
243
|
-
let interval;
|
|
244
|
-
if (groupEndTime) {
|
|
245
|
-
if (groupEndTime !== endTime) setEndTime(groupEndTime);
|
|
246
|
-
} else interval = setInterval(() => setEndTime(Date.now()), 100);
|
|
247
|
-
return () => clearInterval(interval);
|
|
248
|
-
};
|
|
249
|
-
t2 = [groupEndTime, endTime];
|
|
250
|
-
$[2] = endTime;
|
|
251
|
-
$[3] = groupEndTime;
|
|
252
|
-
$[4] = t1;
|
|
253
|
-
$[5] = t2;
|
|
254
|
-
} else {
|
|
255
|
-
t1 = $[4];
|
|
256
|
-
t2 = $[5];
|
|
257
|
-
}
|
|
258
|
-
useEffect(t1, t2);
|
|
80
|
+
const [endTime, setEndTime] = useState(() => groupEndTime || Date.now());
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
let interval;
|
|
83
|
+
if (groupEndTime) {
|
|
84
|
+
if (groupEndTime !== endTime) setEndTime(groupEndTime);
|
|
85
|
+
} else interval = setInterval(() => setEndTime(Date.now()), 100);
|
|
86
|
+
return () => clearInterval(interval);
|
|
87
|
+
}, [groupEndTime, endTime]);
|
|
259
88
|
return endTime;
|
|
260
89
|
};
|
|
261
90
|
|
|
@@ -271,58 +100,33 @@ const formatDuration = (duration) => {
|
|
|
271
100
|
|
|
272
101
|
//#endregion
|
|
273
102
|
//#region src/components/trace-item/trace-item.tsx
|
|
274
|
-
var import_compiler_runtime$21 = require_compiler_runtime();
|
|
275
103
|
const GRADIENT_CLASSES = {
|
|
276
104
|
running: "bg-[repeating-linear-gradient(140deg,#BEFE29,#BEFE29_8px,#ABE625_8px,#ABE625_16px)]",
|
|
277
105
|
completed: "bg-[repeating-linear-gradient(140deg,#2862FE,#2862FE_8px,#2358E5_8px,#2358E5_16px)]",
|
|
278
106
|
failed: "bg-[repeating-linear-gradient(140deg,#EA2069,#EA2069_8px,#D41E60_8px,#D41E60_16px)]"
|
|
279
107
|
};
|
|
280
|
-
const TraceItem = memo((
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
} else t3 = $[4];
|
|
300
|
-
const barClassName = t3;
|
|
301
|
-
const t4 = `${(traceStartTime - groupStartTime) / (groupEndTime - groupStartTime) * 100}%`;
|
|
302
|
-
const t5 = traceEndTime ? `${(traceEndTime - traceStartTime) / (groupEndTime - groupStartTime) * 100}%` : `${(Date.now() - traceStartTime) / (groupEndTime - groupStartTime) * 100}%`;
|
|
303
|
-
let t6;
|
|
304
|
-
if ($[5] !== t4 || $[6] !== t5) {
|
|
305
|
-
t6 = {
|
|
306
|
-
marginLeft: t4,
|
|
307
|
-
width: t5
|
|
308
|
-
};
|
|
309
|
-
$[5] = t4;
|
|
310
|
-
$[6] = t5;
|
|
311
|
-
$[7] = t6;
|
|
312
|
-
} else t6 = $[7];
|
|
313
|
-
const barStyle = t6;
|
|
314
|
-
let t7;
|
|
315
|
-
if ($[8] !== traceName) {
|
|
316
|
-
t7 = /* @__PURE__ */ jsx("div", {
|
|
108
|
+
const TraceItem = memo(({ traceId, traceName, traceStatus, traceStartTime, traceEndTime, groupStartTime, groupEndTime, onExpand }) => {
|
|
109
|
+
const handleClick = useCallback(() => {
|
|
110
|
+
onExpand(traceId);
|
|
111
|
+
}, [onExpand, traceId]);
|
|
112
|
+
const barClassName = useMemo(() => cn("h-[24px] rounded-[4px] hover:opacity-80 transition-all duration-200", GRADIENT_CLASSES[traceStatus]), [traceStatus]);
|
|
113
|
+
const barStyle = useMemo(() => ({
|
|
114
|
+
marginLeft: `${(traceStartTime - groupStartTime) / (groupEndTime - groupStartTime) * 100}%`,
|
|
115
|
+
width: traceEndTime ? `${(traceEndTime - traceStartTime) / (groupEndTime - groupStartTime) * 100}%` : `${(Date.now() - traceStartTime) / (groupEndTime - groupStartTime) * 100}%`
|
|
116
|
+
}), [
|
|
117
|
+
traceStartTime,
|
|
118
|
+
traceEndTime,
|
|
119
|
+
groupStartTime,
|
|
120
|
+
groupEndTime
|
|
121
|
+
]);
|
|
122
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
123
|
+
className: "flex hover:bg-muted-foreground/10 relative cursor-pointer",
|
|
124
|
+
onClick: handleClick,
|
|
125
|
+
"data-testid": "trace-timeline-item",
|
|
126
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
317
127
|
className: "flex items-center min-w-[200px] max-w-[200px] h-[32px] max-h-[32px] py-4 px-2 text-sm font-semibold text-foreground truncate sticky left-0 bg-card z-9",
|
|
318
128
|
children: traceName
|
|
319
|
-
})
|
|
320
|
-
$[8] = traceName;
|
|
321
|
-
$[9] = t7;
|
|
322
|
-
} else t7 = $[9];
|
|
323
|
-
let t8;
|
|
324
|
-
if ($[10] !== barClassName || $[11] !== barStyle) {
|
|
325
|
-
t8 = /* @__PURE__ */ jsx("div", {
|
|
129
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
326
130
|
className: "flex w-full flex-row items-center hover:bg-muted/50 rounded-md",
|
|
327
131
|
children: /* @__PURE__ */ jsx("div", {
|
|
328
132
|
className: "relative w-full h-[32px] flex items-center",
|
|
@@ -331,204 +135,64 @@ const TraceItem = memo((t0) => {
|
|
|
331
135
|
style: barStyle
|
|
332
136
|
})
|
|
333
137
|
})
|
|
334
|
-
})
|
|
335
|
-
|
|
336
|
-
$[11] = barStyle;
|
|
337
|
-
$[12] = t8;
|
|
338
|
-
} else t8 = $[12];
|
|
339
|
-
let t9;
|
|
340
|
-
if ($[13] !== handleClick || $[14] !== t7 || $[15] !== t8) {
|
|
341
|
-
t9 = /* @__PURE__ */ jsxs("div", {
|
|
342
|
-
className: "flex hover:bg-muted-foreground/10 relative cursor-pointer",
|
|
343
|
-
onClick: handleClick,
|
|
344
|
-
"data-testid": "trace-timeline-item",
|
|
345
|
-
children: [t7, t8]
|
|
346
|
-
});
|
|
347
|
-
$[13] = handleClick;
|
|
348
|
-
$[14] = t7;
|
|
349
|
-
$[15] = t8;
|
|
350
|
-
$[16] = t9;
|
|
351
|
-
} else t9 = $[16];
|
|
352
|
-
return t9;
|
|
138
|
+
})]
|
|
139
|
+
});
|
|
353
140
|
});
|
|
354
141
|
TraceItem.displayName = "TraceItem";
|
|
355
142
|
|
|
356
143
|
//#endregion
|
|
357
144
|
//#region src/components/events/event-icon.tsx
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
if (event.type === "
|
|
363
|
-
let t1;
|
|
364
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
365
|
-
t1 = /* @__PURE__ */ jsx(ScrollText, { className: "w-4 h-4 text-muted-foreground" });
|
|
366
|
-
$[0] = t1;
|
|
367
|
-
} else t1 = $[0];
|
|
368
|
-
return t1;
|
|
369
|
-
} else if (event.type === "emit") {
|
|
370
|
-
let t1;
|
|
371
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
372
|
-
t1 = /* @__PURE__ */ jsx(MessageCircle, { className: "w-4 h-4 text-muted-foreground" });
|
|
373
|
-
$[1] = t1;
|
|
374
|
-
} else t1 = $[1];
|
|
375
|
-
return t1;
|
|
376
|
-
} else if (event.type === "state") {
|
|
377
|
-
let t1;
|
|
378
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
379
|
-
t1 = /* @__PURE__ */ jsx(Package, { className: "w-4 h-4 text-muted-foreground" });
|
|
380
|
-
$[2] = t1;
|
|
381
|
-
} else t1 = $[2];
|
|
382
|
-
return t1;
|
|
383
|
-
} else if (event.type === "stream") {
|
|
384
|
-
let t1;
|
|
385
|
-
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
386
|
-
t1 = /* @__PURE__ */ jsx(Radio, { className: "w-4 h-4 text-muted-foreground" });
|
|
387
|
-
$[3] = t1;
|
|
388
|
-
} else t1 = $[3];
|
|
389
|
-
return t1;
|
|
390
|
-
}
|
|
145
|
+
const EventIcon = ({ event }) => {
|
|
146
|
+
if (event.type === "log") return /* @__PURE__ */ jsx(ScrollText, { className: "w-4 h-4 text-muted-foreground" });
|
|
147
|
+
else if (event.type === "emit") return /* @__PURE__ */ jsx(MessageCircle, { className: "w-4 h-4 text-muted-foreground" });
|
|
148
|
+
else if (event.type === "state") return /* @__PURE__ */ jsx(Package, { className: "w-4 h-4 text-muted-foreground" });
|
|
149
|
+
else if (event.type === "stream") return /* @__PURE__ */ jsx(Radio, { className: "w-4 h-4 text-muted-foreground" });
|
|
391
150
|
};
|
|
392
151
|
|
|
393
152
|
//#endregion
|
|
394
153
|
//#region src/components/ui/copy-button.tsx
|
|
395
|
-
|
|
396
|
-
const CopyButton = (t0) => {
|
|
397
|
-
const $ = (0, import_compiler_runtime$19.c)(11);
|
|
398
|
-
const { textToCopy, className, title } = t0;
|
|
154
|
+
const CopyButton = ({ textToCopy, className, title }) => {
|
|
399
155
|
const [copied, setCopied] = useState(false);
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
156
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
157
|
+
variant: "icon",
|
|
158
|
+
size: "icon",
|
|
159
|
+
onClick: useCallback(async () => {
|
|
403
160
|
try {
|
|
404
161
|
await navigator.clipboard.writeText(textToCopy);
|
|
405
162
|
setCopied(true);
|
|
406
163
|
setTimeout(() => setCopied(false), 2e3);
|
|
407
|
-
} catch (
|
|
408
|
-
const error = t2$1;
|
|
164
|
+
} catch (error) {
|
|
409
165
|
console.error("Failed to copy:", error);
|
|
410
166
|
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
let t2;
|
|
417
|
-
if ($[2] !== className) {
|
|
418
|
-
t2 = cn("cursor-pointer p-3 rounded-full", className);
|
|
419
|
-
$[2] = className;
|
|
420
|
-
$[3] = t2;
|
|
421
|
-
} else t2 = $[3];
|
|
422
|
-
const t3 = title ?? (copied ? "Copied!" : "Copy");
|
|
423
|
-
let t4;
|
|
424
|
-
if ($[4] !== copied) {
|
|
425
|
-
t4 = copied ? /* @__PURE__ */ jsx(Check, { className: "w-4 h-4 text-green-500" }) : /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4 text-gray-400" });
|
|
426
|
-
$[4] = copied;
|
|
427
|
-
$[5] = t4;
|
|
428
|
-
} else t4 = $[5];
|
|
429
|
-
let t5;
|
|
430
|
-
if ($[6] !== handleCopy || $[7] !== t2 || $[8] !== t3 || $[9] !== t4) {
|
|
431
|
-
t5 = /* @__PURE__ */ jsx(Button, {
|
|
432
|
-
variant: "icon",
|
|
433
|
-
size: "icon",
|
|
434
|
-
onClick: handleCopy,
|
|
435
|
-
className: t2,
|
|
436
|
-
title: t3,
|
|
437
|
-
children: t4
|
|
438
|
-
});
|
|
439
|
-
$[6] = handleCopy;
|
|
440
|
-
$[7] = t2;
|
|
441
|
-
$[8] = t3;
|
|
442
|
-
$[9] = t4;
|
|
443
|
-
$[10] = t5;
|
|
444
|
-
} else t5 = $[10];
|
|
445
|
-
return t5;
|
|
167
|
+
}, [textToCopy]),
|
|
168
|
+
className: cn("cursor-pointer p-3 rounded-full", className),
|
|
169
|
+
title: title ?? (copied ? "Copied!" : "Copy"),
|
|
170
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "w-4 h-4 text-green-500" }) : /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4 text-gray-400" })
|
|
171
|
+
});
|
|
446
172
|
};
|
|
447
173
|
|
|
448
174
|
//#endregion
|
|
449
175
|
//#region src/components/ui/popover.tsx
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
({...props} = t0);
|
|
456
|
-
$[0] = t0;
|
|
457
|
-
$[1] = props;
|
|
458
|
-
} else props = $[1];
|
|
459
|
-
let t1;
|
|
460
|
-
if ($[2] !== props) {
|
|
461
|
-
t1 = /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
|
|
462
|
-
"data-slot": "popover",
|
|
463
|
-
...props
|
|
464
|
-
});
|
|
465
|
-
$[2] = props;
|
|
466
|
-
$[3] = t1;
|
|
467
|
-
} else t1 = $[3];
|
|
468
|
-
return t1;
|
|
176
|
+
const Popover = ({ ...props }) => {
|
|
177
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
|
|
178
|
+
"data-slot": "popover",
|
|
179
|
+
...props
|
|
180
|
+
});
|
|
469
181
|
};
|
|
470
|
-
const PopoverTrigger = (
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
$[0] = t0;
|
|
476
|
-
$[1] = props;
|
|
477
|
-
} else props = $[1];
|
|
478
|
-
let t1;
|
|
479
|
-
if ($[2] !== props) {
|
|
480
|
-
t1 = /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
481
|
-
"data-slot": "popover-trigger",
|
|
482
|
-
...props
|
|
483
|
-
});
|
|
484
|
-
$[2] = props;
|
|
485
|
-
$[3] = t1;
|
|
486
|
-
} else t1 = $[3];
|
|
487
|
-
return t1;
|
|
182
|
+
const PopoverTrigger = ({ ...props }) => {
|
|
183
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
184
|
+
"data-slot": "popover-trigger",
|
|
185
|
+
...props
|
|
186
|
+
});
|
|
488
187
|
};
|
|
489
|
-
const PopoverContent = (
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
$[0] = t0;
|
|
498
|
-
$[1] = className;
|
|
499
|
-
$[2] = props;
|
|
500
|
-
$[3] = t1;
|
|
501
|
-
$[4] = t2;
|
|
502
|
-
} else {
|
|
503
|
-
className = $[1];
|
|
504
|
-
props = $[2];
|
|
505
|
-
t1 = $[3];
|
|
506
|
-
t2 = $[4];
|
|
507
|
-
}
|
|
508
|
-
const align = t1 === void 0 ? "center" : t1;
|
|
509
|
-
const sideOffset = t2 === void 0 ? 4 : t2;
|
|
510
|
-
let t3;
|
|
511
|
-
if ($[5] !== className) {
|
|
512
|
-
t3 = cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className);
|
|
513
|
-
$[5] = className;
|
|
514
|
-
$[6] = t3;
|
|
515
|
-
} else t3 = $[6];
|
|
516
|
-
let t4;
|
|
517
|
-
if ($[7] !== align || $[8] !== props || $[9] !== sideOffset || $[10] !== t3) {
|
|
518
|
-
t4 = /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
519
|
-
"data-slot": "popover-content",
|
|
520
|
-
align,
|
|
521
|
-
sideOffset,
|
|
522
|
-
className: t3,
|
|
523
|
-
...props
|
|
524
|
-
}) });
|
|
525
|
-
$[7] = align;
|
|
526
|
-
$[8] = props;
|
|
527
|
-
$[9] = sideOffset;
|
|
528
|
-
$[10] = t3;
|
|
529
|
-
$[11] = t4;
|
|
530
|
-
} else t4 = $[11];
|
|
531
|
-
return t4;
|
|
188
|
+
const PopoverContent = ({ className, align = "center", sideOffset = 4, ...props }) => {
|
|
189
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
190
|
+
"data-slot": "popover-content",
|
|
191
|
+
align,
|
|
192
|
+
sideOffset,
|
|
193
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className),
|
|
194
|
+
...props
|
|
195
|
+
}) });
|
|
532
196
|
};
|
|
533
197
|
|
|
534
198
|
//#endregion
|
|
@@ -541,762 +205,297 @@ const formatArgumentValue = (arg) => {
|
|
|
541
205
|
|
|
542
206
|
//#endregion
|
|
543
207
|
//#region src/components/events/code/argument.tsx
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
$[6] = value;
|
|
579
|
-
$[7] = t4$1;
|
|
580
|
-
} else t4$1 = $[7];
|
|
581
|
-
return t4$1;
|
|
582
|
-
}
|
|
583
|
-
let t4;
|
|
584
|
-
if ($[8] !== value) {
|
|
585
|
-
t4 = /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
586
|
-
asChild: true,
|
|
587
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
588
|
-
className: "truncate font-mono text-blue-500 cursor-pointer inline-block",
|
|
589
|
-
children: value
|
|
590
|
-
})
|
|
591
|
-
});
|
|
592
|
-
$[8] = value;
|
|
593
|
-
$[9] = t4;
|
|
594
|
-
} else t4 = $[9];
|
|
595
|
-
let t5;
|
|
596
|
-
if ($[10] !== arg || $[11] !== isObject || $[12] !== textToCopy || $[13] !== value) {
|
|
597
|
-
t5 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
598
|
-
className: "backdrop-blur-md w-auto max-w-2xl relative max-h-[50vh] overflow-y-auto",
|
|
599
|
-
hideWhenDetached: true,
|
|
600
|
-
children: isObject ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(CopyButton, {
|
|
208
|
+
const Argument = memo(({ arg, popover = true }) => {
|
|
209
|
+
const isObject = useMemo(() => typeof arg === "object" && arg !== null, [arg]);
|
|
210
|
+
const value = useMemo(() => formatArgumentValue(arg), [arg]);
|
|
211
|
+
const textToCopy = useMemo(() => JSON.stringify(arg, null, 2), [arg]);
|
|
212
|
+
if (!popover) return /* @__PURE__ */ jsx(Fragment$1, { children: isObject ? /* @__PURE__ */ jsx(ReactJson, {
|
|
213
|
+
src: arg,
|
|
214
|
+
theme: "default",
|
|
215
|
+
enableClipboard: false,
|
|
216
|
+
style: { padding: 0 }
|
|
217
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
218
|
+
className: "font-mono text-blue-500",
|
|
219
|
+
children: value
|
|
220
|
+
}) });
|
|
221
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
222
|
+
asChild: true,
|
|
223
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
224
|
+
className: "truncate font-mono text-blue-500 cursor-pointer inline-block",
|
|
225
|
+
children: value
|
|
226
|
+
})
|
|
227
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
228
|
+
className: "backdrop-blur-md w-auto max-w-2xl relative max-h-[50vh] overflow-y-auto",
|
|
229
|
+
hideWhenDetached: true,
|
|
230
|
+
children: isObject ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(CopyButton, {
|
|
231
|
+
textToCopy,
|
|
232
|
+
className: "absolute top-4 right-4",
|
|
233
|
+
title: "Copy JSON"
|
|
234
|
+
}), /* @__PURE__ */ jsx(ReactJson, {
|
|
235
|
+
src: arg,
|
|
236
|
+
theme: "default",
|
|
237
|
+
enableClipboard: false,
|
|
238
|
+
style: { padding: 0 }
|
|
239
|
+
})] }) : /* @__PURE__ */ jsxs("div", {
|
|
240
|
+
className: "flex items-center justify-between",
|
|
241
|
+
children: [/* @__PURE__ */ jsx("span", { children: value }), /* @__PURE__ */ jsx(CopyButton, {
|
|
601
242
|
textToCopy,
|
|
602
|
-
className: "
|
|
243
|
+
className: "ml-2",
|
|
603
244
|
title: "Copy JSON"
|
|
604
|
-
})
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
enableClipboard: false,
|
|
608
|
-
style: { padding: 0 }
|
|
609
|
-
})] }) : /* @__PURE__ */ jsxs("div", {
|
|
610
|
-
className: "flex items-center justify-between",
|
|
611
|
-
children: [/* @__PURE__ */ jsx("span", { children: value }), /* @__PURE__ */ jsx(CopyButton, {
|
|
612
|
-
textToCopy,
|
|
613
|
-
className: "ml-2",
|
|
614
|
-
title: "Copy JSON"
|
|
615
|
-
})]
|
|
616
|
-
})
|
|
617
|
-
});
|
|
618
|
-
$[10] = arg;
|
|
619
|
-
$[11] = isObject;
|
|
620
|
-
$[12] = textToCopy;
|
|
621
|
-
$[13] = value;
|
|
622
|
-
$[14] = t5;
|
|
623
|
-
} else t5 = $[14];
|
|
624
|
-
let t6;
|
|
625
|
-
if ($[15] !== t4 || $[16] !== t5) {
|
|
626
|
-
t6 = /* @__PURE__ */ jsxs(Popover, { children: [t4, t5] });
|
|
627
|
-
$[15] = t4;
|
|
628
|
-
$[16] = t5;
|
|
629
|
-
$[17] = t6;
|
|
630
|
-
} else t6 = $[17];
|
|
631
|
-
return t6;
|
|
245
|
+
})]
|
|
246
|
+
})
|
|
247
|
+
})] });
|
|
632
248
|
});
|
|
633
249
|
Argument.displayName = "Argument";
|
|
634
250
|
|
|
635
251
|
//#endregion
|
|
636
252
|
//#region src/components/events/code/closing-parenthesis.tsx
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
const noQuantity = t1 === void 0 ? false : t1;
|
|
642
|
-
const hasCalls = callsQuantity && callsQuantity > 1;
|
|
643
|
-
let t2;
|
|
644
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
645
|
-
t2 = /* @__PURE__ */ jsx("span", {
|
|
253
|
+
const ClosingParenthesis = memo(({ callsQuantity, noQuantity = false }) => {
|
|
254
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
255
|
+
className: "flex items-center",
|
|
256
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
646
257
|
className: "font-mono text-emerald-500",
|
|
647
258
|
children: ")"
|
|
648
|
-
})
|
|
649
|
-
$[0] = t2;
|
|
650
|
-
} else t2 = $[0];
|
|
651
|
-
let t3;
|
|
652
|
-
if ($[1] !== callsQuantity || $[2] !== hasCalls || $[3] !== noQuantity) {
|
|
653
|
-
t3 = !noQuantity && hasCalls && /* @__PURE__ */ jsxs("span", {
|
|
259
|
+
}), !noQuantity && callsQuantity && callsQuantity > 1 && /* @__PURE__ */ jsxs("span", {
|
|
654
260
|
className: "font-mono text-muted-foreground",
|
|
655
261
|
children: [" x", callsQuantity]
|
|
656
|
-
})
|
|
657
|
-
|
|
658
|
-
$[2] = hasCalls;
|
|
659
|
-
$[3] = noQuantity;
|
|
660
|
-
$[4] = t3;
|
|
661
|
-
} else t3 = $[4];
|
|
662
|
-
let t4;
|
|
663
|
-
if ($[5] !== t3) {
|
|
664
|
-
t4 = /* @__PURE__ */ jsxs("div", {
|
|
665
|
-
className: "flex items-center",
|
|
666
|
-
children: [t2, t3]
|
|
667
|
-
});
|
|
668
|
-
$[5] = t3;
|
|
669
|
-
$[6] = t4;
|
|
670
|
-
} else t4 = $[6];
|
|
671
|
-
return t4;
|
|
262
|
+
})]
|
|
263
|
+
});
|
|
672
264
|
});
|
|
673
265
|
ClosingParenthesis.displayName = "ClosingParenthesis";
|
|
674
266
|
|
|
675
267
|
//#endregion
|
|
676
268
|
//#region src/components/events/code/function-call-content.tsx
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
if ($[6] !== className) {
|
|
702
|
-
t1 = cn("flex items-center", className);
|
|
703
|
-
$[6] = className;
|
|
704
|
-
$[7] = t1;
|
|
705
|
-
} else t1 = $[7];
|
|
706
|
-
let t2;
|
|
707
|
-
if ($[8] !== topLevelClassName) {
|
|
708
|
-
t2 = topLevelClassName && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
709
|
-
className: "font-mono text-pink-500",
|
|
710
|
-
children: topLevelClassName
|
|
711
|
-
}), /* @__PURE__ */ jsx("span", { children: "." })] });
|
|
712
|
-
$[8] = topLevelClassName;
|
|
713
|
-
$[9] = t2;
|
|
714
|
-
} else t2 = $[9];
|
|
715
|
-
let t3;
|
|
716
|
-
if ($[10] !== objectName) {
|
|
717
|
-
t3 = objectName && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
718
|
-
className: "font-mono text-pink-500",
|
|
719
|
-
children: objectName
|
|
720
|
-
}), /* @__PURE__ */ jsx("span", { children: "." })] });
|
|
721
|
-
$[10] = objectName;
|
|
722
|
-
$[11] = t3;
|
|
723
|
-
} else t3 = $[11];
|
|
724
|
-
let t4;
|
|
725
|
-
if ($[12] !== functionName) {
|
|
726
|
-
t4 = /* @__PURE__ */ jsx("span", {
|
|
727
|
-
className: "font-mono text-pink-500",
|
|
728
|
-
children: functionName
|
|
729
|
-
});
|
|
730
|
-
$[12] = functionName;
|
|
731
|
-
$[13] = t4;
|
|
732
|
-
} else t4 = $[13];
|
|
733
|
-
let t5;
|
|
734
|
-
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
735
|
-
t5 = /* @__PURE__ */ jsx("span", {
|
|
736
|
-
className: "font-mono text-emerald-500",
|
|
737
|
-
children: "("
|
|
738
|
-
});
|
|
739
|
-
$[14] = t5;
|
|
740
|
-
} else t5 = $[14];
|
|
741
|
-
let t6;
|
|
742
|
-
if ($[15] !== props || $[16] !== ref || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4) {
|
|
743
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
744
|
-
ref,
|
|
745
|
-
className: t1,
|
|
746
|
-
...props,
|
|
747
|
-
children: [
|
|
748
|
-
t2,
|
|
749
|
-
t3,
|
|
750
|
-
t4,
|
|
751
|
-
t5
|
|
752
|
-
]
|
|
753
|
-
});
|
|
754
|
-
$[15] = props;
|
|
755
|
-
$[16] = ref;
|
|
756
|
-
$[17] = t1;
|
|
757
|
-
$[18] = t2;
|
|
758
|
-
$[19] = t3;
|
|
759
|
-
$[20] = t4;
|
|
760
|
-
$[21] = t6;
|
|
761
|
-
} else t6 = $[21];
|
|
762
|
-
return t6;
|
|
269
|
+
const FunctionCallContent = forwardRef(({ topLevelClassName, objectName, functionName, className, ...props }, ref) => {
|
|
270
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
271
|
+
ref,
|
|
272
|
+
className: cn("flex items-center", className),
|
|
273
|
+
...props,
|
|
274
|
+
children: [
|
|
275
|
+
topLevelClassName && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
276
|
+
className: "font-mono text-pink-500",
|
|
277
|
+
children: topLevelClassName
|
|
278
|
+
}), /* @__PURE__ */ jsx("span", { children: "." })] }),
|
|
279
|
+
objectName && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
280
|
+
className: "font-mono text-pink-500",
|
|
281
|
+
children: objectName
|
|
282
|
+
}), /* @__PURE__ */ jsx("span", { children: "." })] }),
|
|
283
|
+
/* @__PURE__ */ jsx("span", {
|
|
284
|
+
className: "font-mono text-pink-500",
|
|
285
|
+
children: functionName
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ jsx("span", {
|
|
288
|
+
className: "font-mono text-emerald-500",
|
|
289
|
+
children: "("
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
});
|
|
763
293
|
});
|
|
764
294
|
FunctionCallContent.displayName = "FunctionCallContent";
|
|
765
295
|
|
|
766
296
|
//#endregion
|
|
767
297
|
//#region src/components/events/code/function-call.tsx
|
|
768
|
-
var import_compiler_runtime$14 = require_compiler_runtime();
|
|
769
298
|
const GRID_LAYOUT_STYLE = { gridTemplateColumns: "max-content 1fr max-content" };
|
|
770
|
-
const FunctionCall = memo((
|
|
771
|
-
const
|
|
772
|
-
const {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
let t8;
|
|
833
|
-
if ($[17] !== functionCallText) {
|
|
834
|
-
t8 = /* @__PURE__ */ jsx(CopyButton, { textToCopy: functionCallText });
|
|
835
|
-
$[17] = functionCallText;
|
|
836
|
-
$[18] = t8;
|
|
837
|
-
} else t8 = $[18];
|
|
838
|
-
let t9;
|
|
839
|
-
if ($[19] !== t7 || $[20] !== t8) {
|
|
840
|
-
t9 = /* @__PURE__ */ jsxs("div", {
|
|
841
|
-
className: "flex items-center justify-between gap-2",
|
|
842
|
-
children: [t7, t8]
|
|
843
|
-
});
|
|
844
|
-
$[19] = t7;
|
|
845
|
-
$[20] = t8;
|
|
846
|
-
$[21] = t9;
|
|
847
|
-
} else t9 = $[21];
|
|
848
|
-
let t10;
|
|
849
|
-
if ($[22] !== filteredArgs) {
|
|
850
|
-
let t11$1;
|
|
851
|
-
if ($[24] !== filteredArgs.length) {
|
|
852
|
-
t11$1 = (arg_1, index) => /* @__PURE__ */ jsxs("div", {
|
|
853
|
-
className: "grid grid-cols-[auto_1fr] items-center pl-4",
|
|
854
|
-
children: [/* @__PURE__ */ jsx(Argument, {
|
|
855
|
-
arg: arg_1,
|
|
856
|
-
popover: false
|
|
857
|
-
}), index < filteredArgs.length - 1 && /* @__PURE__ */ jsx("span", { children: ", " })]
|
|
858
|
-
}, index);
|
|
859
|
-
$[24] = filteredArgs.length;
|
|
860
|
-
$[25] = t11$1;
|
|
861
|
-
} else t11$1 = $[25];
|
|
862
|
-
t10 = filteredArgs.map(t11$1);
|
|
863
|
-
$[22] = filteredArgs;
|
|
864
|
-
$[23] = t10;
|
|
865
|
-
} else t10 = $[23];
|
|
866
|
-
let t11;
|
|
867
|
-
if ($[26] !== callsQuantity) {
|
|
868
|
-
t11 = /* @__PURE__ */ jsx(ClosingParenthesis, {
|
|
869
|
-
callsQuantity,
|
|
870
|
-
noQuantity: true
|
|
871
|
-
});
|
|
872
|
-
$[26] = callsQuantity;
|
|
873
|
-
$[27] = t11;
|
|
874
|
-
} else t11 = $[27];
|
|
875
|
-
let t12;
|
|
876
|
-
if ($[28] !== t10 || $[29] !== t11 || $[30] !== t9) {
|
|
877
|
-
t12 = /* @__PURE__ */ jsxs(PopoverContent, {
|
|
878
|
-
className: "grid grid-rows-auto backdrop-blur-md w-auto max-w-2xl max-h-[50vh] overflow-y-auto",
|
|
879
|
-
hideWhenDetached: true,
|
|
880
|
-
children: [
|
|
881
|
-
t9,
|
|
882
|
-
t10,
|
|
883
|
-
t11
|
|
884
|
-
]
|
|
885
|
-
});
|
|
886
|
-
$[28] = t10;
|
|
887
|
-
$[29] = t11;
|
|
888
|
-
$[30] = t9;
|
|
889
|
-
$[31] = t12;
|
|
890
|
-
} else t12 = $[31];
|
|
891
|
-
let t13;
|
|
892
|
-
if ($[32] !== t12 || $[33] !== t6) {
|
|
893
|
-
t13 = /* @__PURE__ */ jsxs(Popover, { children: [t6, t12] });
|
|
894
|
-
$[32] = t12;
|
|
895
|
-
$[33] = t6;
|
|
896
|
-
$[34] = t13;
|
|
897
|
-
} else t13 = $[34];
|
|
898
|
-
let t14;
|
|
899
|
-
if ($[35] !== filteredArgs) {
|
|
900
|
-
let t15$1;
|
|
901
|
-
if ($[37] !== filteredArgs.length) {
|
|
902
|
-
t15$1 = (arg_2, index_0) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Argument, { arg: arg_2 }), index_0 < filteredArgs.length - 1 && /* @__PURE__ */ jsx("span", { children: ", " })] }, index_0);
|
|
903
|
-
$[37] = filteredArgs.length;
|
|
904
|
-
$[38] = t15$1;
|
|
905
|
-
} else t15$1 = $[38];
|
|
906
|
-
t14 = filteredArgs.map(t15$1);
|
|
907
|
-
$[35] = filteredArgs;
|
|
908
|
-
$[36] = t14;
|
|
909
|
-
} else t14 = $[36];
|
|
910
|
-
let t15;
|
|
911
|
-
if ($[39] !== argsGridStyle || $[40] !== t14) {
|
|
912
|
-
t15 = /* @__PURE__ */ jsx("div", {
|
|
913
|
-
className: "grid items-center min-w-0",
|
|
914
|
-
style: argsGridStyle,
|
|
915
|
-
children: t14
|
|
916
|
-
});
|
|
917
|
-
$[39] = argsGridStyle;
|
|
918
|
-
$[40] = t14;
|
|
919
|
-
$[41] = t15;
|
|
920
|
-
} else t15 = $[41];
|
|
921
|
-
let t16;
|
|
922
|
-
if ($[42] !== callsQuantity) {
|
|
923
|
-
t16 = /* @__PURE__ */ jsx(ClosingParenthesis, { callsQuantity });
|
|
924
|
-
$[42] = callsQuantity;
|
|
925
|
-
$[43] = t16;
|
|
926
|
-
} else t16 = $[43];
|
|
927
|
-
let t17;
|
|
928
|
-
if ($[44] !== t13 || $[45] !== t15 || $[46] !== t16) {
|
|
929
|
-
t17 = /* @__PURE__ */ jsxs("div", {
|
|
930
|
-
className: "grid overflow-hidden items-center",
|
|
931
|
-
style: GRID_LAYOUT_STYLE,
|
|
932
|
-
children: [
|
|
933
|
-
t13,
|
|
934
|
-
t15,
|
|
935
|
-
t16
|
|
936
|
-
]
|
|
937
|
-
});
|
|
938
|
-
$[44] = t13;
|
|
939
|
-
$[45] = t15;
|
|
940
|
-
$[46] = t16;
|
|
941
|
-
$[47] = t17;
|
|
942
|
-
} else t17 = $[47];
|
|
943
|
-
return t17;
|
|
299
|
+
const FunctionCall = memo(({ topLevelClassName, objectName, functionName, args, callsQuantity }) => {
|
|
300
|
+
const filteredArgs = useMemo(() => args.filter((arg) => arg !== void 0), [args]);
|
|
301
|
+
const argsGridStyle = useMemo(() => ({ gridTemplateColumns: `repeat(${filteredArgs.length * 2}, minmax(0, auto))` }), [filteredArgs.length]);
|
|
302
|
+
const functionCallText = useMemo(() => {
|
|
303
|
+
const prefix = [topLevelClassName, objectName].filter(Boolean).join(".");
|
|
304
|
+
return `${prefix ? `${prefix}.` : ""}${functionName}(${filteredArgs.map((arg) => {
|
|
305
|
+
if (typeof arg === "object" && arg !== null) return JSON.stringify(arg, null, 2);
|
|
306
|
+
if (arg === null) return "null";
|
|
307
|
+
if (typeof arg === "string") return `'${arg}'`;
|
|
308
|
+
return String(arg);
|
|
309
|
+
}).join(", ")})`;
|
|
310
|
+
}, [
|
|
311
|
+
topLevelClassName,
|
|
312
|
+
objectName,
|
|
313
|
+
functionName,
|
|
314
|
+
filteredArgs
|
|
315
|
+
]);
|
|
316
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
317
|
+
className: "grid overflow-hidden items-center",
|
|
318
|
+
style: GRID_LAYOUT_STYLE,
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
321
|
+
asChild: true,
|
|
322
|
+
children: /* @__PURE__ */ jsx(FunctionCallContent, {
|
|
323
|
+
className: "cursor-pointer",
|
|
324
|
+
functionName,
|
|
325
|
+
topLevelClassName,
|
|
326
|
+
objectName
|
|
327
|
+
})
|
|
328
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
329
|
+
className: "grid grid-rows-auto backdrop-blur-md w-auto max-w-2xl max-h-[50vh] overflow-y-auto",
|
|
330
|
+
hideWhenDetached: true,
|
|
331
|
+
children: [
|
|
332
|
+
/* @__PURE__ */ jsxs("div", {
|
|
333
|
+
className: "flex items-center justify-between gap-2",
|
|
334
|
+
children: [/* @__PURE__ */ jsx(FunctionCallContent, {
|
|
335
|
+
functionName,
|
|
336
|
+
topLevelClassName,
|
|
337
|
+
objectName
|
|
338
|
+
}), /* @__PURE__ */ jsx(CopyButton, { textToCopy: functionCallText })]
|
|
339
|
+
}),
|
|
340
|
+
filteredArgs.map((arg, index) => /* @__PURE__ */ jsxs("div", {
|
|
341
|
+
className: "grid grid-cols-[auto_1fr] items-center pl-4",
|
|
342
|
+
children: [/* @__PURE__ */ jsx(Argument, {
|
|
343
|
+
arg,
|
|
344
|
+
popover: false
|
|
345
|
+
}), index < filteredArgs.length - 1 && /* @__PURE__ */ jsx("span", { children: ", " })]
|
|
346
|
+
}, index)),
|
|
347
|
+
/* @__PURE__ */ jsx(ClosingParenthesis, {
|
|
348
|
+
callsQuantity,
|
|
349
|
+
noQuantity: true
|
|
350
|
+
})
|
|
351
|
+
]
|
|
352
|
+
})] }),
|
|
353
|
+
/* @__PURE__ */ jsx("div", {
|
|
354
|
+
className: "grid items-center min-w-0",
|
|
355
|
+
style: argsGridStyle,
|
|
356
|
+
children: filteredArgs.map((arg, index) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Argument, { arg }), index < filteredArgs.length - 1 && /* @__PURE__ */ jsx("span", { children: ", " })] }, index))
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ jsx(ClosingParenthesis, { callsQuantity })
|
|
359
|
+
]
|
|
360
|
+
});
|
|
944
361
|
});
|
|
945
362
|
FunctionCall.displayName = "FunctionCall";
|
|
946
|
-
function _temp$4(arg) {
|
|
947
|
-
return arg !== void 0;
|
|
948
|
-
}
|
|
949
|
-
function _temp2$1(arg_0) {
|
|
950
|
-
if (typeof arg_0 === "object" && arg_0 !== null) return JSON.stringify(arg_0, null, 2);
|
|
951
|
-
if (arg_0 === null) return "null";
|
|
952
|
-
if (typeof arg_0 === "string") return `'${arg_0}'`;
|
|
953
|
-
return String(arg_0);
|
|
954
|
-
}
|
|
955
363
|
|
|
956
364
|
//#endregion
|
|
957
365
|
//#region src/components/events/trace-emit-event.tsx
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
let t1;
|
|
963
|
-
if ($[0] !== event.data || $[1] !== event.topic) {
|
|
964
|
-
t1 = [{
|
|
366
|
+
const TraceEmitEvent = memo(({ event }) => {
|
|
367
|
+
return /* @__PURE__ */ jsx(FunctionCall, {
|
|
368
|
+
functionName: "emit",
|
|
369
|
+
args: useMemo(() => [{
|
|
965
370
|
topic: event.topic,
|
|
966
371
|
data: event.data
|
|
967
|
-
}]
|
|
968
|
-
|
|
969
|
-
$[1] = event.topic;
|
|
970
|
-
$[2] = t1;
|
|
971
|
-
} else t1 = $[2];
|
|
972
|
-
const args = t1;
|
|
973
|
-
let t2;
|
|
974
|
-
if ($[3] !== args) {
|
|
975
|
-
t2 = /* @__PURE__ */ jsx(FunctionCall, {
|
|
976
|
-
functionName: "emit",
|
|
977
|
-
args
|
|
978
|
-
});
|
|
979
|
-
$[3] = args;
|
|
980
|
-
$[4] = t2;
|
|
981
|
-
} else t2 = $[4];
|
|
982
|
-
return t2;
|
|
372
|
+
}], [event])
|
|
373
|
+
});
|
|
983
374
|
});
|
|
984
375
|
TraceEmitEvent.displayName = "TraceEmitEvent";
|
|
985
376
|
|
|
986
377
|
//#endregion
|
|
987
378
|
//#region src/components/events/trace-log-event.tsx
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
} else t1 = $[1];
|
|
998
|
-
let t2;
|
|
999
|
-
if ($[2] !== event.message || $[3] !== t1) {
|
|
1000
|
-
t2 = /* @__PURE__ */ jsxs("div", {
|
|
1001
|
-
className: "flex items-center gap-2",
|
|
1002
|
-
children: [
|
|
1003
|
-
t1,
|
|
1004
|
-
" ",
|
|
1005
|
-
event.message
|
|
1006
|
-
]
|
|
1007
|
-
});
|
|
1008
|
-
$[2] = event.message;
|
|
1009
|
-
$[3] = t1;
|
|
1010
|
-
$[4] = t2;
|
|
1011
|
-
} else t2 = $[4];
|
|
1012
|
-
return t2;
|
|
379
|
+
const TraceLogEvent = memo(({ event }) => {
|
|
380
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
381
|
+
className: "flex items-center gap-2",
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ jsx(LevelDot, { level: event.level }),
|
|
384
|
+
" ",
|
|
385
|
+
event.message
|
|
386
|
+
]
|
|
387
|
+
});
|
|
1013
388
|
});
|
|
1014
389
|
TraceLogEvent.displayName = "TraceLogEvent";
|
|
1015
390
|
|
|
1016
391
|
//#endregion
|
|
1017
392
|
//#region src/components/events/trace-state-event.tsx
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
$[0] = event.data.key;
|
|
1030
|
-
$[1] = event.data.traceId;
|
|
1031
|
-
$[2] = event.data.value;
|
|
1032
|
-
$[3] = t1;
|
|
1033
|
-
} else t1 = $[3];
|
|
1034
|
-
const args = t1;
|
|
1035
|
-
let t2;
|
|
1036
|
-
if ($[4] !== args || $[5] !== event.operation) {
|
|
1037
|
-
t2 = /* @__PURE__ */ jsx(FunctionCall, {
|
|
1038
|
-
objectName: "state",
|
|
1039
|
-
functionName: event.operation,
|
|
1040
|
-
args
|
|
1041
|
-
});
|
|
1042
|
-
$[4] = args;
|
|
1043
|
-
$[5] = event.operation;
|
|
1044
|
-
$[6] = t2;
|
|
1045
|
-
} else t2 = $[6];
|
|
1046
|
-
return t2;
|
|
393
|
+
const TraceStateEvent = memo(({ event }) => {
|
|
394
|
+
const args = useMemo(() => [
|
|
395
|
+
event.data.traceId,
|
|
396
|
+
event.data.key,
|
|
397
|
+
event.data.value
|
|
398
|
+
], [event]);
|
|
399
|
+
return /* @__PURE__ */ jsx(FunctionCall, {
|
|
400
|
+
objectName: "state",
|
|
401
|
+
functionName: event.operation,
|
|
402
|
+
args
|
|
403
|
+
});
|
|
1047
404
|
});
|
|
1048
405
|
TraceStateEvent.displayName = "TraceStateEvent";
|
|
1049
406
|
|
|
1050
407
|
//#endregion
|
|
1051
408
|
//#region src/components/events/trace-stream-event.tsx
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
$[1] = event.data.id;
|
|
1066
|
-
$[2] = t1;
|
|
1067
|
-
$[3] = t2;
|
|
1068
|
-
} else t2 = $[3];
|
|
1069
|
-
const args = t2;
|
|
1070
|
-
let t3;
|
|
1071
|
-
if ($[4] !== args || $[5] !== event.calls || $[6] !== event.operation || $[7] !== event.streamName) {
|
|
1072
|
-
t3 = /* @__PURE__ */ jsx(FunctionCall, {
|
|
1073
|
-
topLevelClassName: "streams",
|
|
1074
|
-
objectName: event.streamName,
|
|
1075
|
-
functionName: event.operation,
|
|
1076
|
-
args,
|
|
1077
|
-
callsQuantity: event.calls
|
|
1078
|
-
});
|
|
1079
|
-
$[4] = args;
|
|
1080
|
-
$[5] = event.calls;
|
|
1081
|
-
$[6] = event.operation;
|
|
1082
|
-
$[7] = event.streamName;
|
|
1083
|
-
$[8] = t3;
|
|
1084
|
-
} else t3 = $[8];
|
|
1085
|
-
return t3;
|
|
409
|
+
const TraceStreamEvent = memo(({ event }) => {
|
|
410
|
+
const args = useMemo(() => [
|
|
411
|
+
event.data.groupId,
|
|
412
|
+
event.data.id,
|
|
413
|
+
event.data.data
|
|
414
|
+
], [event]);
|
|
415
|
+
return /* @__PURE__ */ jsx(FunctionCall, {
|
|
416
|
+
topLevelClassName: "streams",
|
|
417
|
+
objectName: event.streamName,
|
|
418
|
+
functionName: event.operation,
|
|
419
|
+
args,
|
|
420
|
+
callsQuantity: event.calls
|
|
421
|
+
});
|
|
1086
422
|
});
|
|
1087
423
|
TraceStreamEvent.displayName = "TraceStreamEvent";
|
|
1088
424
|
|
|
1089
425
|
//#endregion
|
|
1090
426
|
//#region src/components/events/trace-event.tsx
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
if (event.type === "
|
|
1096
|
-
let t1;
|
|
1097
|
-
if ($[0] !== event) {
|
|
1098
|
-
t1 = /* @__PURE__ */ jsx(TraceLogEvent, { event });
|
|
1099
|
-
$[0] = event;
|
|
1100
|
-
$[1] = t1;
|
|
1101
|
-
} else t1 = $[1];
|
|
1102
|
-
return t1;
|
|
1103
|
-
} else if (event.type === "emit") {
|
|
1104
|
-
let t1;
|
|
1105
|
-
if ($[2] !== event) {
|
|
1106
|
-
t1 = /* @__PURE__ */ jsx(TraceEmitEvent, { event });
|
|
1107
|
-
$[2] = event;
|
|
1108
|
-
$[3] = t1;
|
|
1109
|
-
} else t1 = $[3];
|
|
1110
|
-
return t1;
|
|
1111
|
-
} else if (event.type === "state") {
|
|
1112
|
-
let t1;
|
|
1113
|
-
if ($[4] !== event) {
|
|
1114
|
-
t1 = /* @__PURE__ */ jsx(TraceStateEvent, { event });
|
|
1115
|
-
$[4] = event;
|
|
1116
|
-
$[5] = t1;
|
|
1117
|
-
} else t1 = $[5];
|
|
1118
|
-
return t1;
|
|
1119
|
-
} else if (event.type === "stream") {
|
|
1120
|
-
let t1;
|
|
1121
|
-
if ($[6] !== event) {
|
|
1122
|
-
t1 = /* @__PURE__ */ jsx(TraceStreamEvent, { event });
|
|
1123
|
-
$[6] = event;
|
|
1124
|
-
$[7] = t1;
|
|
1125
|
-
} else t1 = $[7];
|
|
1126
|
-
return t1;
|
|
1127
|
-
}
|
|
427
|
+
const TraceEvent = memo(({ event }) => {
|
|
428
|
+
if (event.type === "log") return /* @__PURE__ */ jsx(TraceLogEvent, { event });
|
|
429
|
+
else if (event.type === "emit") return /* @__PURE__ */ jsx(TraceEmitEvent, { event });
|
|
430
|
+
else if (event.type === "state") return /* @__PURE__ */ jsx(TraceStateEvent, { event });
|
|
431
|
+
else if (event.type === "stream") return /* @__PURE__ */ jsx(TraceStreamEvent, { event });
|
|
1128
432
|
});
|
|
1129
433
|
TraceEvent.displayName = "TraceEvent";
|
|
1130
434
|
|
|
1131
435
|
//#endregion
|
|
1132
436
|
//#region src/components/trace-item/trace-event-item.tsx
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
const { event, traceStartTime } = t0;
|
|
1137
|
-
let t1;
|
|
1138
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1139
|
-
t1 = /* @__PURE__ */ jsx("div", {
|
|
437
|
+
const TraceEventItem = memo(({ event, traceStartTime }) => {
|
|
438
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
439
|
+
/* @__PURE__ */ jsx("div", {
|
|
1140
440
|
className: "grid place-items-center",
|
|
1141
441
|
children: /* @__PURE__ */ jsx("div", { className: "w-1 h-1 rounded-full bg-emerald-500 outline outline-2 outline-emerald-500/50 -ml-[26px]" })
|
|
1142
|
-
})
|
|
1143
|
-
|
|
1144
|
-
} else t1 = $[0];
|
|
1145
|
-
let t2;
|
|
1146
|
-
if ($[1] !== event) {
|
|
1147
|
-
t2 = /* @__PURE__ */ jsx("div", {
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ jsx("div", {
|
|
1148
444
|
className: "grid place-items-center",
|
|
1149
445
|
children: /* @__PURE__ */ jsx(EventIcon, { event })
|
|
1150
|
-
})
|
|
1151
|
-
|
|
1152
|
-
$[2] = t2;
|
|
1153
|
-
} else t2 = $[2];
|
|
1154
|
-
const t3 = Math.floor(event.timestamp - traceStartTime);
|
|
1155
|
-
let t4;
|
|
1156
|
-
if ($[3] !== t3) {
|
|
1157
|
-
t4 = formatDuration(t3);
|
|
1158
|
-
$[3] = t3;
|
|
1159
|
-
$[4] = t4;
|
|
1160
|
-
} else t4 = $[4];
|
|
1161
|
-
let t5;
|
|
1162
|
-
if ($[5] !== t4) {
|
|
1163
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
446
|
+
}),
|
|
447
|
+
/* @__PURE__ */ jsx("div", {
|
|
1164
448
|
className: "grid place-items-center",
|
|
1165
449
|
children: /* @__PURE__ */ jsxs("span", {
|
|
1166
450
|
className: "text-sm font-mono text-muted-foreground",
|
|
1167
|
-
children: ["+",
|
|
451
|
+
children: ["+", formatDuration(Math.floor(event.timestamp - traceStartTime))]
|
|
1168
452
|
})
|
|
1169
|
-
})
|
|
1170
|
-
|
|
1171
|
-
$[6] = t5;
|
|
1172
|
-
} else t5 = $[6];
|
|
1173
|
-
let t6;
|
|
1174
|
-
if ($[7] !== event) {
|
|
1175
|
-
t6 = /* @__PURE__ */ jsx("div", {
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ jsx("div", {
|
|
1176
455
|
className: "grid place-items-start",
|
|
1177
456
|
children: /* @__PURE__ */ jsx(TraceEvent, { event })
|
|
1178
|
-
})
|
|
1179
|
-
|
|
1180
|
-
$[8] = t6;
|
|
1181
|
-
} else t6 = $[8];
|
|
1182
|
-
let t7;
|
|
1183
|
-
if ($[9] !== t2 || $[10] !== t5 || $[11] !== t6) {
|
|
1184
|
-
t7 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1185
|
-
t1,
|
|
1186
|
-
t2,
|
|
1187
|
-
t5,
|
|
1188
|
-
t6
|
|
1189
|
-
] });
|
|
1190
|
-
$[9] = t2;
|
|
1191
|
-
$[10] = t5;
|
|
1192
|
-
$[11] = t6;
|
|
1193
|
-
$[12] = t7;
|
|
1194
|
-
} else t7 = $[12];
|
|
1195
|
-
return t7;
|
|
457
|
+
})
|
|
458
|
+
] });
|
|
1196
459
|
});
|
|
1197
460
|
TraceEventItem.displayName = "TraceEventItem";
|
|
1198
461
|
|
|
1199
462
|
//#endregion
|
|
1200
463
|
//#region src/components/trace-item/trace-item-detail.tsx
|
|
1201
|
-
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
onClick: onClose,
|
|
1215
|
-
label: "Close"
|
|
1216
|
-
}];
|
|
1217
|
-
$[1] = onClose;
|
|
1218
|
-
$[2] = t2;
|
|
1219
|
-
} else t2 = $[2];
|
|
1220
|
-
const actions = t2;
|
|
1221
|
-
const t3 = `Viewing details from step ${trace.name}`;
|
|
1222
|
-
let t4;
|
|
1223
|
-
if ($[3] !== trace.endTime || $[4] !== trace.startTime) {
|
|
1224
|
-
t4 = trace.endTime && /* @__PURE__ */ jsxs("span", { children: ["Duration: ", formatDuration(trace.endTime - trace.startTime)] });
|
|
1225
|
-
$[3] = trace.endTime;
|
|
1226
|
-
$[4] = trace.startTime;
|
|
1227
|
-
$[5] = t4;
|
|
1228
|
-
} else t4 = $[5];
|
|
1229
|
-
let t5;
|
|
1230
|
-
if ($[6] !== trace.entryPoint.type) {
|
|
1231
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
1232
|
-
className: "bg-blue-500 font-bold text-xs px-[4px] py-[2px] rounded-sm text-blue-100",
|
|
1233
|
-
children: trace.entryPoint.type
|
|
1234
|
-
});
|
|
1235
|
-
$[6] = trace.entryPoint.type;
|
|
1236
|
-
$[7] = t5;
|
|
1237
|
-
} else t5 = $[7];
|
|
1238
|
-
let t6;
|
|
1239
|
-
if ($[8] !== trace.correlationId) {
|
|
1240
|
-
t6 = trace.correlationId && /* @__PURE__ */ jsxs(Badge, {
|
|
1241
|
-
variant: "outline",
|
|
1242
|
-
children: ["Correlated: ", trace.correlationId]
|
|
1243
|
-
});
|
|
1244
|
-
$[8] = trace.correlationId;
|
|
1245
|
-
$[9] = t6;
|
|
1246
|
-
} else t6 = $[9];
|
|
1247
|
-
let t7;
|
|
1248
|
-
if ($[10] !== t4 || $[11] !== t5 || $[12] !== t6) {
|
|
1249
|
-
t7 = /* @__PURE__ */ jsxs("div", {
|
|
1250
|
-
className: "flex items-center gap-4 text-sm text-muted-foreground mb-4",
|
|
1251
|
-
children: [
|
|
1252
|
-
t4,
|
|
1253
|
-
t5,
|
|
1254
|
-
t6
|
|
1255
|
-
]
|
|
1256
|
-
});
|
|
1257
|
-
$[10] = t4;
|
|
1258
|
-
$[11] = t5;
|
|
1259
|
-
$[12] = t6;
|
|
1260
|
-
$[13] = t7;
|
|
1261
|
-
} else t7 = $[13];
|
|
1262
|
-
let t8;
|
|
1263
|
-
if ($[14] !== trace.events || $[15] !== trace.startTime) {
|
|
1264
|
-
let t9$1;
|
|
1265
|
-
if ($[17] !== trace.startTime) {
|
|
1266
|
-
t9$1 = (event, index) => /* @__PURE__ */ jsx(TraceEventItem, {
|
|
1267
|
-
event,
|
|
1268
|
-
traceStartTime: trace.startTime
|
|
1269
|
-
}, index);
|
|
1270
|
-
$[17] = trace.startTime;
|
|
1271
|
-
$[18] = t9$1;
|
|
1272
|
-
} else t9$1 = $[18];
|
|
1273
|
-
t8 = trace.events.map(t9$1);
|
|
1274
|
-
$[14] = trace.events;
|
|
1275
|
-
$[15] = trace.startTime;
|
|
1276
|
-
$[16] = t8;
|
|
1277
|
-
} else t8 = $[16];
|
|
1278
|
-
let t9;
|
|
1279
|
-
if ($[19] !== t8) {
|
|
1280
|
-
t9 = /* @__PURE__ */ jsx("div", {
|
|
1281
|
-
className: "grid grid-cols-[auto_auto_auto_1fr] gap-x-2 gap-y-3 font-mono text-xs border-l-1 border-gray-500/40 pl-6",
|
|
1282
|
-
children: t8
|
|
1283
|
-
});
|
|
1284
|
-
$[19] = t8;
|
|
1285
|
-
$[20] = t9;
|
|
1286
|
-
} else t9 = $[20];
|
|
1287
|
-
let t10;
|
|
1288
|
-
if ($[21] !== t7 || $[22] !== t9) {
|
|
1289
|
-
t10 = /* @__PURE__ */ jsxs("div", {
|
|
464
|
+
const TraceItemDetail = memo(({ trace, onClose }) => {
|
|
465
|
+
const actions = useMemo(() => [{
|
|
466
|
+
icon: /* @__PURE__ */ jsx(X, {}),
|
|
467
|
+
onClick: onClose,
|
|
468
|
+
label: "Close"
|
|
469
|
+
}], [onClose]);
|
|
470
|
+
return /* @__PURE__ */ jsxs(Sidebar, {
|
|
471
|
+
onClose,
|
|
472
|
+
initialWidth: 600,
|
|
473
|
+
title: "Trace Details",
|
|
474
|
+
subtitle: `Viewing details from step ${trace.name}`,
|
|
475
|
+
actions,
|
|
476
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1290
477
|
className: "px-2 overflow-auto",
|
|
1291
|
-
children: [
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
478
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
479
|
+
className: "flex items-center gap-4 text-sm text-muted-foreground mb-4",
|
|
480
|
+
children: [
|
|
481
|
+
trace.endTime && /* @__PURE__ */ jsxs("span", { children: ["Duration: ", formatDuration(trace.endTime - trace.startTime)] }),
|
|
482
|
+
/* @__PURE__ */ jsx("div", {
|
|
483
|
+
className: "bg-blue-500 font-bold text-xs px-[4px] py-[2px] rounded-sm text-blue-100",
|
|
484
|
+
children: trace.entryPoint.type
|
|
485
|
+
}),
|
|
486
|
+
trace.correlationId && /* @__PURE__ */ jsxs(Badge, {
|
|
487
|
+
variant: "outline",
|
|
488
|
+
children: ["Correlated: ", trace.correlationId]
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
492
|
+
className: "grid grid-cols-[auto_auto_auto_1fr] gap-x-2 gap-y-3 font-mono text-xs border-l-1 border-gray-500/40 pl-6",
|
|
493
|
+
children: trace.events.map((event, index) => /* @__PURE__ */ jsx(TraceEventItem, {
|
|
494
|
+
event,
|
|
495
|
+
traceStartTime: trace.startTime
|
|
496
|
+
}, index))
|
|
497
|
+
})]
|
|
498
|
+
}), trace.error && /* @__PURE__ */ jsxs("div", {
|
|
1300
499
|
className: "p-4 bg-red-800/10",
|
|
1301
500
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1302
501
|
className: "text-sm text-red-800 dark:text-red-400 font-semibold",
|
|
@@ -1305,45 +504,17 @@ const TraceItemDetail = memo((t0) => {
|
|
|
1305
504
|
className: "text-sm text-red-800 dark:text-red-400 pl-4",
|
|
1306
505
|
children: trace.error.stack
|
|
1307
506
|
})]
|
|
1308
|
-
})
|
|
1309
|
-
|
|
1310
|
-
$[25] = t11;
|
|
1311
|
-
} else t11 = $[25];
|
|
1312
|
-
let t12;
|
|
1313
|
-
if ($[26] !== actions || $[27] !== onClose || $[28] !== t10 || $[29] !== t11 || $[30] !== t3) {
|
|
1314
|
-
t12 = /* @__PURE__ */ jsxs(Sidebar, {
|
|
1315
|
-
onClose,
|
|
1316
|
-
initialWidth: 600,
|
|
1317
|
-
title: "Trace Details",
|
|
1318
|
-
subtitle: t3,
|
|
1319
|
-
actions,
|
|
1320
|
-
children: [t10, t11]
|
|
1321
|
-
});
|
|
1322
|
-
$[26] = actions;
|
|
1323
|
-
$[27] = onClose;
|
|
1324
|
-
$[28] = t10;
|
|
1325
|
-
$[29] = t11;
|
|
1326
|
-
$[30] = t3;
|
|
1327
|
-
$[31] = t12;
|
|
1328
|
-
} else t12 = $[31];
|
|
1329
|
-
return t12;
|
|
507
|
+
})]
|
|
508
|
+
});
|
|
1330
509
|
});
|
|
1331
510
|
TraceItemDetail.displayName = "TraceItemDetail";
|
|
1332
511
|
|
|
1333
512
|
//#endregion
|
|
1334
513
|
//#region src/components/trace-timeline.tsx
|
|
1335
|
-
var import_compiler_runtime$6 = require_compiler_runtime();
|
|
1336
514
|
const TraceTimeline = memo(() => {
|
|
1337
|
-
const
|
|
1338
|
-
const groupId = useObservabilityStore(_temp$3);
|
|
515
|
+
const groupId = useObservabilityStore((state) => state.selectedTraceGroupId);
|
|
1339
516
|
if (!groupId) return null;
|
|
1340
|
-
|
|
1341
|
-
if ($[0] !== groupId) {
|
|
1342
|
-
t0 = /* @__PURE__ */ jsx(TraceTimelineComponent, { groupId });
|
|
1343
|
-
$[0] = groupId;
|
|
1344
|
-
$[1] = t0;
|
|
1345
|
-
} else t0 = $[1];
|
|
1346
|
-
return t0;
|
|
517
|
+
return /* @__PURE__ */ jsx(TraceTimelineComponent, { groupId });
|
|
1347
518
|
});
|
|
1348
519
|
TraceTimeline.displayName = "TraceTimeline";
|
|
1349
520
|
const TraceTimelineComponent = memo(({ groupId }) => {
|
|
@@ -1359,13 +530,13 @@ const TraceTimelineComponent = memo(({ groupId }) => {
|
|
|
1359
530
|
const endTime = useGetEndTime(group);
|
|
1360
531
|
const [zoom, setZoom] = useState(1);
|
|
1361
532
|
const selectedTraceId = useObservabilityStore((state) => state.selectedTraceId);
|
|
1362
|
-
const selectTraceId = useObservabilityStore((
|
|
533
|
+
const selectTraceId = useObservabilityStore((state) => state.selectTraceId);
|
|
1363
534
|
const selectedTrace = useMemo(() => data?.find((trace) => trace.id === selectedTraceId), [data, selectedTraceId]);
|
|
1364
535
|
const zoomMinus = useCallback(() => {
|
|
1365
536
|
if (zoom > .5) setZoom((prev) => prev - .1);
|
|
1366
537
|
}, []);
|
|
1367
538
|
const zoomPlus = useCallback(() => {
|
|
1368
|
-
setZoom((
|
|
539
|
+
setZoom((prev) => prev + .1);
|
|
1369
540
|
}, []);
|
|
1370
541
|
if (!group) return null;
|
|
1371
542
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -1419,16 +590,16 @@ const TraceTimelineComponent = memo(({ groupId }) => {
|
|
|
1419
590
|
})]
|
|
1420
591
|
}), /* @__PURE__ */ jsx("div", {
|
|
1421
592
|
className: "flex flex-col w-full h-full",
|
|
1422
|
-
children: data?.map((
|
|
1423
|
-
traceId:
|
|
1424
|
-
traceName:
|
|
1425
|
-
traceStatus:
|
|
1426
|
-
traceStartTime:
|
|
1427
|
-
traceEndTime:
|
|
593
|
+
children: data?.map((trace) => /* @__PURE__ */ jsx(TraceItem, {
|
|
594
|
+
traceId: trace.id,
|
|
595
|
+
traceName: trace.name,
|
|
596
|
+
traceStatus: trace.status,
|
|
597
|
+
traceStartTime: trace.startTime,
|
|
598
|
+
traceEndTime: trace.endTime,
|
|
1428
599
|
groupStartTime: group.startTime,
|
|
1429
600
|
groupEndTime: endTime,
|
|
1430
601
|
onExpand: selectTraceId
|
|
1431
|
-
},
|
|
602
|
+
}, trace.id))
|
|
1432
603
|
})]
|
|
1433
604
|
})
|
|
1434
605
|
}), selectedTrace && /* @__PURE__ */ jsx(TraceItemDetail, {
|
|
@@ -1437,367 +608,143 @@ const TraceTimelineComponent = memo(({ groupId }) => {
|
|
|
1437
608
|
})] });
|
|
1438
609
|
});
|
|
1439
610
|
TraceTimelineComponent.displayName = "TraceTimelineComponent";
|
|
1440
|
-
function _temp$3(state) {
|
|
1441
|
-
return state.selectedTraceGroupId;
|
|
1442
|
-
}
|
|
1443
611
|
|
|
1444
612
|
//#endregion
|
|
1445
613
|
//#region src/hooks/use-filtered-trace-groups.ts
|
|
1446
|
-
var import_compiler_runtime$5 = require_compiler_runtime();
|
|
1447
614
|
const useFilteredTraceGroups = () => {
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
};
|
|
1455
|
-
$[0] = t0;
|
|
1456
|
-
} else t0 = $[0];
|
|
1457
|
-
const { data } = useStreamGroup(t0);
|
|
1458
|
-
const search = useObservabilityStore(_temp$2);
|
|
1459
|
-
let t1;
|
|
1460
|
-
if ($[1] !== data || $[2] !== search) {
|
|
1461
|
-
t1 = data?.filter((group) => group.name.toLowerCase().includes(search.toLowerCase()) || group.id.toLowerCase().includes(search.toLowerCase()));
|
|
1462
|
-
$[1] = data;
|
|
1463
|
-
$[2] = search;
|
|
1464
|
-
$[3] = t1;
|
|
1465
|
-
} else t1 = $[3];
|
|
1466
|
-
return t1;
|
|
615
|
+
const { data } = useStreamGroup(useMemo(() => ({
|
|
616
|
+
streamName: "motia-trace-group",
|
|
617
|
+
groupId: "default"
|
|
618
|
+
}), []));
|
|
619
|
+
const search = useObservabilityStore((state) => state.search);
|
|
620
|
+
return useMemo(() => data?.filter((group) => group.name.toLowerCase().includes(search.toLowerCase()) || group.id.toLowerCase().includes(search.toLowerCase())), [data, search]);
|
|
1467
621
|
};
|
|
1468
|
-
function _temp$2(state) {
|
|
1469
|
-
return state.search;
|
|
1470
|
-
}
|
|
1471
622
|
|
|
1472
623
|
//#endregion
|
|
1473
624
|
//#region src/components/trace-status.tsx
|
|
1474
|
-
var import_compiler_runtime$4 = require_compiler_runtime();
|
|
1475
625
|
const variantMap = {
|
|
1476
626
|
running: "info",
|
|
1477
627
|
completed: "success",
|
|
1478
628
|
failed: "error",
|
|
1479
629
|
default: "default"
|
|
1480
630
|
};
|
|
1481
|
-
const TraceStatusBadge = memo((
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
const t2 = duration && status !== "failed" ? duration : status;
|
|
1486
|
-
let t3;
|
|
1487
|
-
if ($[0] !== t1 || $[1] !== t2) {
|
|
1488
|
-
t3 = /* @__PURE__ */ jsx(Badge, {
|
|
1489
|
-
variant: t1,
|
|
1490
|
-
children: t2
|
|
1491
|
-
});
|
|
1492
|
-
$[0] = t1;
|
|
1493
|
-
$[1] = t2;
|
|
1494
|
-
$[2] = t3;
|
|
1495
|
-
} else t3 = $[2];
|
|
1496
|
-
return t3;
|
|
1497
|
-
});
|
|
631
|
+
const TraceStatusBadge = memo(({ status, duration }) => /* @__PURE__ */ jsx(Badge, {
|
|
632
|
+
variant: variantMap[status],
|
|
633
|
+
children: duration && status !== "failed" ? duration : status
|
|
634
|
+
}));
|
|
1498
635
|
TraceStatusBadge.displayName = "TraceStatusBadge";
|
|
1499
636
|
|
|
1500
637
|
//#endregion
|
|
1501
638
|
//#region src/components/trace-group-item.tsx
|
|
1502
|
-
|
|
1503
|
-
const
|
|
1504
|
-
const
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
const duration = t1;
|
|
1515
|
-
let t2;
|
|
1516
|
-
if ($[3] !== groupId || $[4] !== selectTraceGroupId) {
|
|
1517
|
-
t2 = () => {
|
|
1518
|
-
selectTraceGroupId(groupId);
|
|
1519
|
-
};
|
|
1520
|
-
$[3] = groupId;
|
|
1521
|
-
$[4] = selectTraceGroupId;
|
|
1522
|
-
$[5] = t2;
|
|
1523
|
-
} else t2 = $[5];
|
|
1524
|
-
const onSelect = t2;
|
|
1525
|
-
const t3 = `trace-${groupId}`;
|
|
1526
|
-
const t4 = isSelected ? "bg-muted-foreground/10" : "hover:bg-muted/70";
|
|
1527
|
-
let t5;
|
|
1528
|
-
if ($[6] !== t4) {
|
|
1529
|
-
t5 = cn("motia-trace-group cursor-pointer transition-colors w-full text-left", t4);
|
|
1530
|
-
$[6] = t4;
|
|
1531
|
-
$[7] = t5;
|
|
1532
|
-
} else t5 = $[7];
|
|
1533
|
-
let t6;
|
|
1534
|
-
if ($[8] !== groupName) {
|
|
1535
|
-
t6 = /* @__PURE__ */ jsx("span", {
|
|
1536
|
-
className: "font-semibold text-lg",
|
|
1537
|
-
children: groupName
|
|
1538
|
-
});
|
|
1539
|
-
$[8] = groupName;
|
|
1540
|
-
$[9] = t6;
|
|
1541
|
-
} else t6 = $[9];
|
|
1542
|
-
let t7;
|
|
1543
|
-
if ($[10] !== duration || $[11] !== groupStatus) {
|
|
1544
|
-
t7 = /* @__PURE__ */ jsx(TraceStatusBadge, {
|
|
1545
|
-
status: groupStatus,
|
|
1546
|
-
duration
|
|
1547
|
-
});
|
|
1548
|
-
$[10] = duration;
|
|
1549
|
-
$[11] = groupStatus;
|
|
1550
|
-
$[12] = t7;
|
|
1551
|
-
} else t7 = $[12];
|
|
1552
|
-
let t8;
|
|
1553
|
-
if ($[13] !== t6 || $[14] !== t7) {
|
|
1554
|
-
t8 = /* @__PURE__ */ jsxs("div", {
|
|
1555
|
-
className: "flex flex-row justify-between items-center gap-2",
|
|
1556
|
-
children: [t6, t7]
|
|
1557
|
-
});
|
|
1558
|
-
$[13] = t6;
|
|
1559
|
-
$[14] = t7;
|
|
1560
|
-
$[15] = t8;
|
|
1561
|
-
} else t8 = $[15];
|
|
1562
|
-
let t9;
|
|
1563
|
-
if ($[16] !== groupId) {
|
|
1564
|
-
t9 = /* @__PURE__ */ jsx("div", {
|
|
1565
|
-
"data-testid": "trace-id",
|
|
1566
|
-
className: "text-xs text-muted-foreground font-mono tracking-[1px]",
|
|
1567
|
-
children: groupId
|
|
1568
|
-
});
|
|
1569
|
-
$[16] = groupId;
|
|
1570
|
-
$[17] = t9;
|
|
1571
|
-
} else t9 = $[17];
|
|
1572
|
-
let t10;
|
|
1573
|
-
if ($[18] !== totalSteps) {
|
|
1574
|
-
t10 = /* @__PURE__ */ jsxs("span", { children: [totalSteps, " steps"] });
|
|
1575
|
-
$[18] = totalSteps;
|
|
1576
|
-
$[19] = t10;
|
|
1577
|
-
} else t10 = $[19];
|
|
1578
|
-
let t11;
|
|
1579
|
-
if ($[20] !== t10 || $[21] !== t9) {
|
|
1580
|
-
t11 = /* @__PURE__ */ jsxs("div", {
|
|
1581
|
-
className: "flex justify-between",
|
|
1582
|
-
children: [t9, t10]
|
|
1583
|
-
});
|
|
1584
|
-
$[20] = t10;
|
|
1585
|
-
$[21] = t9;
|
|
1586
|
-
$[22] = t11;
|
|
1587
|
-
} else t11 = $[22];
|
|
1588
|
-
let t12;
|
|
1589
|
-
if ($[23] !== groupStartTime) {
|
|
1590
|
-
t12 = formatDistanceToNow(groupStartTime);
|
|
1591
|
-
$[23] = groupStartTime;
|
|
1592
|
-
$[24] = t12;
|
|
1593
|
-
} else t12 = $[24];
|
|
1594
|
-
let t13;
|
|
1595
|
-
if ($[25] !== t12) {
|
|
1596
|
-
t13 = /* @__PURE__ */ jsxs("div", {
|
|
1597
|
-
className: "flex justify-between",
|
|
1598
|
-
children: [t12, " ago"]
|
|
1599
|
-
});
|
|
1600
|
-
$[25] = t12;
|
|
1601
|
-
$[26] = t13;
|
|
1602
|
-
} else t13 = $[26];
|
|
1603
|
-
let t14;
|
|
1604
|
-
if ($[27] !== activeSteps) {
|
|
1605
|
-
t14 = activeSteps > 0 && /* @__PURE__ */ jsxs("div", {
|
|
1606
|
-
className: "text-blue-600",
|
|
1607
|
-
children: [activeSteps, " active"]
|
|
1608
|
-
});
|
|
1609
|
-
$[27] = activeSteps;
|
|
1610
|
-
$[28] = t14;
|
|
1611
|
-
} else t14 = $[28];
|
|
1612
|
-
let t15;
|
|
1613
|
-
if ($[29] !== t11 || $[30] !== t13 || $[31] !== t14) {
|
|
1614
|
-
t15 = /* @__PURE__ */ jsxs("div", {
|
|
1615
|
-
className: "text-xs text-muted-foreground space-y-1",
|
|
1616
|
-
children: [
|
|
1617
|
-
t11,
|
|
1618
|
-
t13,
|
|
1619
|
-
t14
|
|
1620
|
-
]
|
|
1621
|
-
});
|
|
1622
|
-
$[29] = t11;
|
|
1623
|
-
$[30] = t13;
|
|
1624
|
-
$[31] = t14;
|
|
1625
|
-
$[32] = t15;
|
|
1626
|
-
} else t15 = $[32];
|
|
1627
|
-
let t16;
|
|
1628
|
-
if ($[33] !== t15 || $[34] !== t8) {
|
|
1629
|
-
t16 = /* @__PURE__ */ jsxs("div", {
|
|
639
|
+
const TraceGroupItem = memo(({ groupId, groupName, groupStatus, groupStartTime, groupEndTime, totalSteps, activeSteps, isSelected }) => {
|
|
640
|
+
const selectTraceGroupId = useObservabilityStore((state) => state.selectTraceGroupId);
|
|
641
|
+
const duration = useMemo(() => groupEndTime ? formatDuration(groupEndTime - groupStartTime) : void 0, [groupEndTime, groupStartTime]);
|
|
642
|
+
const onSelect = useCallback(() => {
|
|
643
|
+
selectTraceGroupId(groupId);
|
|
644
|
+
}, [groupId, selectTraceGroupId]);
|
|
645
|
+
return /* @__PURE__ */ jsx("button", {
|
|
646
|
+
type: "button",
|
|
647
|
+
"data-testid": `trace-${groupId}`,
|
|
648
|
+
className: cn("motia-trace-group cursor-pointer transition-colors w-full text-left", isSelected ? "bg-muted-foreground/10" : "hover:bg-muted/70"),
|
|
649
|
+
onClick: onSelect,
|
|
650
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1630
651
|
className: "p-3 flex flex-col gap-1",
|
|
1631
|
-
children: [
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
652
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
653
|
+
className: "flex flex-row justify-between items-center gap-2",
|
|
654
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
655
|
+
className: "font-semibold text-lg",
|
|
656
|
+
children: groupName
|
|
657
|
+
}), /* @__PURE__ */ jsx(TraceStatusBadge, {
|
|
658
|
+
status: groupStatus,
|
|
659
|
+
duration
|
|
660
|
+
})]
|
|
661
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
662
|
+
className: "text-xs text-muted-foreground space-y-1",
|
|
663
|
+
children: [
|
|
664
|
+
/* @__PURE__ */ jsxs("div", {
|
|
665
|
+
className: "flex justify-between",
|
|
666
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
667
|
+
"data-testid": "trace-id",
|
|
668
|
+
className: "text-xs text-muted-foreground font-mono tracking-[1px]",
|
|
669
|
+
children: groupId
|
|
670
|
+
}), /* @__PURE__ */ jsxs("span", { children: [totalSteps, " steps"] })]
|
|
671
|
+
}),
|
|
672
|
+
/* @__PURE__ */ jsxs("div", {
|
|
673
|
+
className: "flex justify-between",
|
|
674
|
+
children: [formatDistanceToNow(groupStartTime), " ago"]
|
|
675
|
+
}),
|
|
676
|
+
activeSteps > 0 && /* @__PURE__ */ jsxs("div", {
|
|
677
|
+
className: "text-blue-600",
|
|
678
|
+
children: [activeSteps, " active"]
|
|
679
|
+
})
|
|
680
|
+
]
|
|
681
|
+
})]
|
|
682
|
+
})
|
|
683
|
+
}, groupId);
|
|
1654
684
|
});
|
|
1655
685
|
TraceGroupItem.displayName = "TraceGroupItem";
|
|
1656
|
-
function _temp$1(state) {
|
|
1657
|
-
return state.selectTraceGroupId;
|
|
1658
|
-
}
|
|
1659
686
|
|
|
1660
687
|
//#endregion
|
|
1661
688
|
//#region src/components/traces-groups.tsx
|
|
1662
|
-
var import_compiler_runtime$2 = require_compiler_runtime();
|
|
1663
689
|
const TracesGroups = memo(() => {
|
|
1664
|
-
const $ = (0, import_compiler_runtime$2.c)(17);
|
|
1665
690
|
const groups = useFilteredTraceGroups();
|
|
1666
|
-
const selectedGroupId = useObservabilityStore(
|
|
1667
|
-
const selectTraceGroupId = useObservabilityStore(
|
|
1668
|
-
const groupsLength = groups?.length || 0;
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
if (!groups || groups.length === 0) {
|
|
1672
|
-
t0 = "";
|
|
1673
|
-
break bb0;
|
|
1674
|
-
}
|
|
691
|
+
const selectedGroupId = useObservabilityStore((state) => state.selectedTraceGroupId);
|
|
692
|
+
const selectTraceGroupId = useObservabilityStore((state) => state.selectTraceGroupId);
|
|
693
|
+
const groupsLength = useMemo(() => groups?.length || 0, [groups]);
|
|
694
|
+
const lastRunningGroupId = useMemo(() => {
|
|
695
|
+
if (!groups || groups.length === 0) return "";
|
|
1675
696
|
const lastGroup = groups[groups.length - 1];
|
|
1676
|
-
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
else if (!lastRunningGroupId && !groupsLength && selectedGroupId) selectTraceGroupId("");
|
|
1684
|
-
};
|
|
1685
|
-
$[0] = groupsLength;
|
|
1686
|
-
$[1] = lastRunningGroupId;
|
|
1687
|
-
$[2] = selectTraceGroupId;
|
|
1688
|
-
$[3] = selectedGroupId;
|
|
1689
|
-
$[4] = t1;
|
|
1690
|
-
} else t1 = $[4];
|
|
1691
|
-
let t2;
|
|
1692
|
-
if ($[5] !== groupsLength || $[6] !== lastRunningGroupId) {
|
|
1693
|
-
t2 = [lastRunningGroupId, groupsLength];
|
|
1694
|
-
$[5] = groupsLength;
|
|
1695
|
-
$[6] = lastRunningGroupId;
|
|
1696
|
-
$[7] = t2;
|
|
1697
|
-
} else t2 = $[7];
|
|
1698
|
-
useEffect(t1, t2);
|
|
1699
|
-
let t3;
|
|
1700
|
-
if ($[8] !== groups) {
|
|
1701
|
-
t3 = [...groups].reverse();
|
|
1702
|
-
$[8] = groups;
|
|
1703
|
-
$[9] = t3;
|
|
1704
|
-
} else t3 = $[9];
|
|
1705
|
-
const reversedGroups = t3;
|
|
697
|
+
return lastGroup?.status === "running" ? lastGroup.id : "";
|
|
698
|
+
}, [groups]);
|
|
699
|
+
useEffect(() => {
|
|
700
|
+
if (lastRunningGroupId && lastRunningGroupId !== selectedGroupId) selectTraceGroupId(lastRunningGroupId);
|
|
701
|
+
else if (!lastRunningGroupId && !groupsLength && selectedGroupId) selectTraceGroupId("");
|
|
702
|
+
}, [lastRunningGroupId, groupsLength]);
|
|
703
|
+
const reversedGroups = useMemo(() => [...groups].reverse(), [groups]);
|
|
1706
704
|
if (!groups || groups.length === 0) return null;
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}, group.id);
|
|
1721
|
-
$[13] = selectedGroupId;
|
|
1722
|
-
$[14] = t5$1;
|
|
1723
|
-
} else t5$1 = $[14];
|
|
1724
|
-
t4 = reversedGroups.map(t5$1);
|
|
1725
|
-
$[10] = reversedGroups;
|
|
1726
|
-
$[11] = selectedGroupId;
|
|
1727
|
-
$[12] = t4;
|
|
1728
|
-
} else t4 = $[12];
|
|
1729
|
-
let t5;
|
|
1730
|
-
if ($[15] !== t4) {
|
|
1731
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
1732
|
-
className: "overflow-auto",
|
|
1733
|
-
children: t4
|
|
1734
|
-
});
|
|
1735
|
-
$[15] = t4;
|
|
1736
|
-
$[16] = t5;
|
|
1737
|
-
} else t5 = $[16];
|
|
1738
|
-
return t5;
|
|
705
|
+
return /* @__PURE__ */ jsx("div", {
|
|
706
|
+
className: "overflow-auto",
|
|
707
|
+
children: reversedGroups.map((group) => /* @__PURE__ */ jsx(TraceGroupItem, {
|
|
708
|
+
groupId: group.id,
|
|
709
|
+
groupName: group.name,
|
|
710
|
+
groupStatus: group.status,
|
|
711
|
+
groupStartTime: group.startTime,
|
|
712
|
+
groupEndTime: group.endTime,
|
|
713
|
+
totalSteps: group.metadata.totalSteps,
|
|
714
|
+
activeSteps: group.metadata.activeSteps,
|
|
715
|
+
isSelected: selectedGroupId === group.id
|
|
716
|
+
}, group.id))
|
|
717
|
+
});
|
|
1739
718
|
});
|
|
1740
719
|
TracesGroups.displayName = "TracesGroups";
|
|
1741
|
-
function _temp(state) {
|
|
1742
|
-
return state.selectedTraceGroupId;
|
|
1743
|
-
}
|
|
1744
|
-
function _temp2(state_0) {
|
|
1745
|
-
return state_0.selectTraceGroupId;
|
|
1746
|
-
}
|
|
1747
720
|
|
|
1748
721
|
//#endregion
|
|
1749
722
|
//#region src/components/observability-page.tsx
|
|
1750
|
-
var import_compiler_runtime$1 = require_compiler_runtime();
|
|
1751
723
|
const ObservabilityPage = memo(() => {
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
});
|
|
1765
|
-
$[1] = t1;
|
|
1766
|
-
} else t1 = $[1];
|
|
1767
|
-
let t2;
|
|
1768
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1769
|
-
t2 = /* @__PURE__ */ jsxs("div", {
|
|
1770
|
-
className: "grid grid-rows-[auto_1fr] h-full",
|
|
1771
|
-
children: [t0, /* @__PURE__ */ jsxs("div", {
|
|
1772
|
-
className: "grid grid-cols-[300px_1fr] overflow-hidden",
|
|
1773
|
-
children: [t1, /* @__PURE__ */ jsxs("div", {
|
|
1774
|
-
className: "overflow-auto",
|
|
1775
|
-
"data-testid": "trace-details",
|
|
1776
|
-
children: [/* @__PURE__ */ jsx(TraceTimeline, {}), /* @__PURE__ */ jsx(TraceEmptyState, {})]
|
|
1777
|
-
})]
|
|
724
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
725
|
+
className: "grid grid-rows-[auto_1fr] h-full",
|
|
726
|
+
children: [/* @__PURE__ */ jsx(SearchBar, {}), /* @__PURE__ */ jsxs("div", {
|
|
727
|
+
className: "grid grid-cols-[300px_1fr] overflow-hidden",
|
|
728
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
729
|
+
className: "w-[300px] border-r border-border overflow-auto h-full",
|
|
730
|
+
"data-testid": "traces-container",
|
|
731
|
+
children: /* @__PURE__ */ jsx(TracesGroups, {})
|
|
732
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
733
|
+
className: "overflow-auto",
|
|
734
|
+
"data-testid": "trace-details",
|
|
735
|
+
children: [/* @__PURE__ */ jsx(TraceTimeline, {}), /* @__PURE__ */ jsx(TraceEmptyState, {})]
|
|
1778
736
|
})]
|
|
1779
|
-
})
|
|
1780
|
-
|
|
1781
|
-
} else t2 = $[2];
|
|
1782
|
-
return t2;
|
|
737
|
+
})]
|
|
738
|
+
});
|
|
1783
739
|
});
|
|
1784
740
|
ObservabilityPage.displayName = "ObservabilityPage";
|
|
1785
741
|
|
|
1786
742
|
//#endregion
|
|
1787
743
|
//#region src/components/observability-tab-label.tsx
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1793
|
-
t0 = /* @__PURE__ */ jsxs("div", {
|
|
1794
|
-
"data-testid": "observability-link",
|
|
1795
|
-
children: [/* @__PURE__ */ jsx(GanttChartSquare, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: "Tracing" })]
|
|
1796
|
-
});
|
|
1797
|
-
$[0] = t0;
|
|
1798
|
-
} else t0 = $[0];
|
|
1799
|
-
return t0;
|
|
1800
|
-
});
|
|
744
|
+
const ObservabilityTabLabel = memo(() => /* @__PURE__ */ jsxs("div", {
|
|
745
|
+
"data-testid": "observability-link",
|
|
746
|
+
children: [/* @__PURE__ */ jsx(GanttChartSquare, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: "Tracing" })]
|
|
747
|
+
}));
|
|
1801
748
|
ObservabilityTabLabel.displayName = "ObservabilityTabLabel";
|
|
1802
749
|
|
|
1803
750
|
//#endregion
|