@motiadev/plugin-observability 0.8.2-beta.140-111855 → 0.8.2-beta.140-559269

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +74 -4
  2. package/dist/index.js +1139 -359
  3. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,10 +1,7 @@
1
- import xe, { useState as C, useEffect as Z, memo as N, useMemo as F } from "react";
2
- import { useStreamItem as pe, useStreamGroup as H } from "@motiadev/stream-client-react";
3
- import { cn as D, LevelDot as he, Sidebar as je, Badge as Q, Button as P, Input as be } from "@motiadev/ui";
4
- import { ScrollText as ve, MessageCircle as ge, Package as Te, Radio as Ne, X as K, Minus as Ee, Plus as we, Search as _e, Trash as ke, GanttChart as Re } from "lucide-react";
5
- import { create as ye } from "zustand";
6
- import { formatDistanceToNow as Se } from "date-fns";
7
- var w = { exports: {} }, g = {};
1
+ import C, { forwardRef as de, createElement as X, useState as G, useEffect as ue, memo as D, useMemo as J } from "react";
2
+ import { useStreamItem as Se, useStreamGroup as me } from "@motiadev/stream-client-react";
3
+ import { cn as U, LevelDot as Pe, Sidebar as Re, Badge as fe, Button as q, Input as Ce } from "@motiadev/ui";
4
+ var A = { exports: {} }, E = {};
8
5
  /**
9
6
  * @license React
10
7
  * react-jsx-runtime.production.js
@@ -14,29 +11,29 @@ var w = { exports: {} }, g = {};
14
11
  * This source code is licensed under the MIT license found in the
15
12
  * LICENSE file in the root directory of this source tree.
16
13
  */
17
- var J;
18
- function Oe() {
19
- if (J) return g;
20
- J = 1;
21
- var r = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
22
- function l(a, o, u) {
23
- var x = null;
24
- if (u !== void 0 && (x = "" + u), o.key !== void 0 && (x = "" + o.key), "key" in o) {
25
- u = {};
26
- for (var d in o)
27
- d !== "key" && (u[d] = o[d]);
28
- } else u = o;
29
- return o = u.ref, {
30
- $$typeof: r,
14
+ var re;
15
+ function De() {
16
+ if (re) return E;
17
+ re = 1;
18
+ var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
19
+ function r(a, o, c) {
20
+ var l = null;
21
+ if (c !== void 0 && (l = "" + c), o.key !== void 0 && (l = "" + o.key), "key" in o) {
22
+ c = {};
23
+ for (var i in o)
24
+ i !== "key" && (c[i] = o[i]);
25
+ } else c = o;
26
+ return o = c.ref, {
27
+ $$typeof: e,
31
28
  type: a,
32
- key: x,
29
+ key: l,
33
30
  ref: o !== void 0 ? o : null,
34
- props: u
31
+ props: c
35
32
  };
36
33
  }
37
- return g.Fragment = s, g.jsx = l, g.jsxs = l, g;
34
+ return E.Fragment = t, E.jsx = r, E.jsxs = r, E;
38
35
  }
39
- var T = {};
36
+ var S = {};
40
37
  /**
41
38
  * @license React
42
39
  * react-jsx-runtime.development.js
@@ -46,477 +43,1260 @@ var T = {};
46
43
  * This source code is licensed under the MIT license found in the
47
44
  * LICENSE file in the root directory of this source tree.
48
45
  */
49
- var V;
46
+ var ae;
50
47
  function Ae() {
51
- return V || (V = 1, process.env.NODE_ENV !== "production" && function() {
52
- function r(t) {
53
- if (t == null) return null;
54
- if (typeof t == "function")
55
- return t.$$typeof === ue ? null : t.displayName || t.name || null;
56
- if (typeof t == "string") return t;
57
- switch (t) {
58
- case R:
48
+ return ae || (ae = 1, process.env.NODE_ENV !== "production" && function() {
49
+ function e(s) {
50
+ if (s == null) return null;
51
+ if (typeof s == "function")
52
+ return s.$$typeof === Me ? null : s.displayName || s.name || null;
53
+ if (typeof s == "string") return s;
54
+ switch (s) {
55
+ case M:
59
56
  return "Fragment";
60
- case se:
57
+ case ge:
61
58
  return "Profiler";
62
- case te:
59
+ case be:
63
60
  return "StrictMode";
64
- case le:
61
+ case we:
65
62
  return "Suspense";
66
- case ie:
63
+ case Ne:
67
64
  return "SuspenseList";
68
- case de:
65
+ case ke:
69
66
  return "Activity";
70
67
  }
71
- if (typeof t == "object")
72
- switch (typeof t.tag == "number" && console.error(
68
+ if (typeof s == "object")
69
+ switch (typeof s.tag == "number" && console.error(
73
70
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
74
- ), t.$$typeof) {
75
- case re:
71
+ ), s.$$typeof) {
72
+ case j:
76
73
  return "Portal";
77
- case ne:
78
- return (t.displayName || "Context") + ".Provider";
79
- case ae:
80
- return (t._context.displayName || "Context") + ".Consumer";
81
- case oe:
82
- var n = t.render;
83
- return t = t.displayName, t || (t = n.displayName || n.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
84
- case ce:
85
- return n = t.displayName || null, n !== null ? n : r(t.type) || "Memo";
86
- case L:
87
- n = t._payload, t = t._init;
74
+ case ye:
75
+ return (s.displayName || "Context") + ".Provider";
76
+ case ve:
77
+ return (s._context.displayName || "Context") + ".Consumer";
78
+ case je:
79
+ var d = s.render;
80
+ return s = s.displayName, s || (s = d.displayName || d.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
81
+ case Te:
82
+ return d = s.displayName || null, d !== null ? d : e(s.type) || "Memo";
83
+ case H:
84
+ d = s._payload, s = s._init;
88
85
  try {
89
- return r(t(n));
86
+ return e(s(d));
90
87
  } catch {
91
88
  }
92
89
  }
93
90
  return null;
94
91
  }
95
- function s(t) {
96
- return "" + t;
92
+ function t(s) {
93
+ return "" + s;
97
94
  }
98
- function l(t) {
95
+ function r(s) {
99
96
  try {
100
- s(t);
101
- var n = !1;
97
+ t(s);
98
+ var d = !1;
102
99
  } catch {
103
- n = !0;
100
+ d = !0;
104
101
  }
105
- if (n) {
106
- n = console;
107
- var c = n.error, m = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
108
- return c.call(
109
- n,
102
+ if (d) {
103
+ d = console;
104
+ var f = d.error, b = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
105
+ return f.call(
106
+ d,
110
107
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
111
- m
112
- ), s(t);
108
+ b
109
+ ), t(s);
113
110
  }
114
111
  }
115
- function a(t) {
116
- if (t === R) return "<>";
117
- if (typeof t == "object" && t !== null && t.$$typeof === L)
112
+ function a(s) {
113
+ if (s === M) return "<>";
114
+ if (typeof s == "object" && s !== null && s.$$typeof === H)
118
115
  return "<...>";
119
116
  try {
120
- var n = r(t);
121
- return n ? "<" + n + ">" : "<...>";
117
+ var d = e(s);
118
+ return d ? "<" + d + ">" : "<...>";
122
119
  } catch {
123
120
  return "<...>";
124
121
  }
125
122
  }
126
123
  function o() {
127
- var t = y.A;
128
- return t === null ? null : t.getOwner();
124
+ var s = W.A;
125
+ return s === null ? null : s.getOwner();
129
126
  }
130
- function u() {
127
+ function c() {
131
128
  return Error("react-stack-top-frame");
132
129
  }
133
- function x(t) {
134
- if (Y.call(t, "key")) {
135
- var n = Object.getOwnPropertyDescriptor(t, "key").get;
136
- if (n && n.isReactWarning) return !1;
130
+ function l(s) {
131
+ if (Q.call(s, "key")) {
132
+ var d = Object.getOwnPropertyDescriptor(s, "key").get;
133
+ if (d && d.isReactWarning) return !1;
137
134
  }
138
- return t.key !== void 0;
135
+ return s.key !== void 0;
139
136
  }
140
- function d(t, n) {
141
- function c() {
142
- z || (z = !0, console.error(
137
+ function i(s, d) {
138
+ function f() {
139
+ Z || (Z = !0, console.error(
143
140
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
144
- n
141
+ d
145
142
  ));
146
143
  }
147
- c.isReactWarning = !0, Object.defineProperty(t, "key", {
148
- get: c,
144
+ f.isReactWarning = !0, Object.defineProperty(s, "key", {
145
+ get: f,
149
146
  configurable: !0
150
147
  });
151
148
  }
152
- function i() {
153
- var t = r(this.type);
154
- return W[t] || (W[t] = !0, console.error(
149
+ function u() {
150
+ var s = e(this.type);
151
+ return K[s] || (K[s] = !0, console.error(
155
152
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
156
- )), t = this.props.ref, t !== void 0 ? t : null;
153
+ )), s = this.props.ref, s !== void 0 ? s : null;
157
154
  }
158
- function k(t, n, c, m, j, h, O, A) {
159
- return c = h.ref, t = {
160
- $$typeof: G,
161
- type: t,
162
- key: n,
163
- props: h,
164
- _owner: j
165
- }, (c !== void 0 ? c : null) !== null ? Object.defineProperty(t, "ref", {
155
+ function m(s, d, f, b, T, w, L, Y) {
156
+ return f = w.ref, s = {
157
+ $$typeof: y,
158
+ type: s,
159
+ key: d,
160
+ props: w,
161
+ _owner: T
162
+ }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(s, "ref", {
166
163
  enumerable: !1,
167
- get: i
168
- }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
164
+ get: u
165
+ }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
169
166
  configurable: !1,
170
167
  enumerable: !1,
171
168
  writable: !0,
172
169
  value: 0
173
- }), Object.defineProperty(t, "_debugInfo", {
170
+ }), Object.defineProperty(s, "_debugInfo", {
174
171
  configurable: !1,
175
172
  enumerable: !1,
176
173
  writable: !0,
177
174
  value: null
178
- }), Object.defineProperty(t, "_debugStack", {
175
+ }), Object.defineProperty(s, "_debugStack", {
179
176
  configurable: !1,
180
177
  enumerable: !1,
181
178
  writable: !0,
182
- value: O
183
- }), Object.defineProperty(t, "_debugTask", {
179
+ value: L
180
+ }), Object.defineProperty(s, "_debugTask", {
184
181
  configurable: !1,
185
182
  enumerable: !1,
186
183
  writable: !0,
187
- value: A
188
- }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
184
+ value: Y
185
+ }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
189
186
  }
190
- function p(t, n, c, m, j, h, O, A) {
191
- var f = n.children;
192
- if (f !== void 0)
193
- if (m)
194
- if (me(f)) {
195
- for (m = 0; m < f.length; m++)
196
- M(f[m]);
197
- Object.freeze && Object.freeze(f);
187
+ function x(s, d, f, b, T, w, L, Y) {
188
+ var g = d.children;
189
+ if (g !== void 0)
190
+ if (b)
191
+ if (_e(g)) {
192
+ for (b = 0; b < g.length; b++)
193
+ v(g[b]);
194
+ Object.freeze && Object.freeze(g);
198
195
  } else
199
196
  console.error(
200
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
198
  );
202
- else M(f);
203
- if (Y.call(n, "key")) {
204
- f = r(t);
205
- var v = Object.keys(n).filter(function(fe) {
206
- return fe !== "key";
199
+ else v(g);
200
+ if (Q.call(d, "key")) {
201
+ g = e(s);
202
+ var _ = Object.keys(d).filter(function(Ee) {
203
+ return Ee !== "key";
207
204
  });
208
- m = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", q[f + m] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ b = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", ne[g + b] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
209
206
  `A props object containing a "key" prop is being spread into JSX:
210
207
  let props = %s;
211
208
  <%s {...props} />
212
209
  React keys must be passed directly to JSX without using spread:
213
210
  let props = %s;
214
211
  <%s key={someKey} {...props} />`,
215
- m,
216
- f,
217
- v,
218
- f
219
- ), q[f + m] = !0);
212
+ b,
213
+ g,
214
+ _,
215
+ g
216
+ ), ne[g + b] = !0);
220
217
  }
221
- if (f = null, c !== void 0 && (l(c), f = "" + c), x(n) && (l(n.key), f = "" + n.key), "key" in n) {
222
- c = {};
223
- for (var I in n)
224
- I !== "key" && (c[I] = n[I]);
225
- } else c = n;
226
- return f && d(
227
- c,
228
- typeof t == "function" ? t.displayName || t.name || "Unknown" : t
229
- ), k(
230
- t,
218
+ if (g = null, f !== void 0 && (r(f), g = "" + f), l(d) && (r(d.key), g = "" + d.key), "key" in d) {
219
+ f = {};
220
+ for (var V in d)
221
+ V !== "key" && (f[V] = d[V]);
222
+ } else f = d;
223
+ return g && i(
231
224
  f,
232
- h,
233
- j,
225
+ typeof s == "function" ? s.displayName || s.name || "Unknown" : s
226
+ ), m(
227
+ s,
228
+ g,
229
+ w,
230
+ T,
234
231
  o(),
235
- c,
236
- O,
237
- A
232
+ f,
233
+ L,
234
+ Y
238
235
  );
239
236
  }
240
- function M(t) {
241
- typeof t == "object" && t !== null && t.$$typeof === G && t._store && (t._store.validated = 1);
237
+ function v(s) {
238
+ typeof s == "object" && s !== null && s.$$typeof === y && s._store && (s._store.validated = 1);
242
239
  }
243
- var E = xe, G = Symbol.for("react.transitional.element"), re = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), te = Symbol.for("react.strict_mode"), se = Symbol.for("react.profiler"), ae = Symbol.for("react.consumer"), ne = Symbol.for("react.context"), oe = Symbol.for("react.forward_ref"), le = Symbol.for("react.suspense"), ie = Symbol.for("react.suspense_list"), ce = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), de = Symbol.for("react.activity"), ue = Symbol.for("react.client.reference"), y = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, me = Array.isArray, S = console.createTask ? console.createTask : function() {
240
+ var h = C, y = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), be = Symbol.for("react.strict_mode"), ge = Symbol.for("react.profiler"), ve = Symbol.for("react.consumer"), ye = Symbol.for("react.context"), je = Symbol.for("react.forward_ref"), we = Symbol.for("react.suspense"), Ne = Symbol.for("react.suspense_list"), Te = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), ke = Symbol.for("react.activity"), Me = Symbol.for("react.client.reference"), W = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, _e = Array.isArray, $ = console.createTask ? console.createTask : function() {
244
241
  return null;
245
242
  };
246
- E = {
247
- react_stack_bottom_frame: function(t) {
248
- return t();
243
+ h = {
244
+ react_stack_bottom_frame: function(s) {
245
+ return s();
249
246
  }
250
247
  };
251
- var z, W = {}, U = E.react_stack_bottom_frame.bind(
252
- E,
253
- u
254
- )(), B = S(a(u)), q = {};
255
- T.Fragment = R, T.jsx = function(t, n, c, m, j) {
256
- var h = 1e4 > y.recentlyCreatedOwnerStacks++;
257
- return p(
258
- t,
259
- n,
260
- c,
248
+ var Z, K = {}, ee = h.react_stack_bottom_frame.bind(
249
+ h,
250
+ c
251
+ )(), te = $(a(c)), ne = {};
252
+ S.Fragment = M, S.jsx = function(s, d, f, b, T) {
253
+ var w = 1e4 > W.recentlyCreatedOwnerStacks++;
254
+ return x(
255
+ s,
256
+ d,
257
+ f,
261
258
  !1,
262
- m,
263
- j,
264
- h ? Error("react-stack-top-frame") : U,
265
- h ? S(a(t)) : B
259
+ b,
260
+ T,
261
+ w ? Error("react-stack-top-frame") : ee,
262
+ w ? $(a(s)) : te
266
263
  );
267
- }, T.jsxs = function(t, n, c, m, j) {
268
- var h = 1e4 > y.recentlyCreatedOwnerStacks++;
269
- return p(
270
- t,
271
- n,
272
- c,
264
+ }, S.jsxs = function(s, d, f, b, T) {
265
+ var w = 1e4 > W.recentlyCreatedOwnerStacks++;
266
+ return x(
267
+ s,
268
+ d,
269
+ f,
273
270
  !0,
274
- m,
275
- j,
276
- h ? Error("react-stack-top-frame") : U,
277
- h ? S(a(t)) : B
271
+ b,
272
+ T,
273
+ w ? Error("react-stack-top-frame") : ee,
274
+ w ? $(a(s)) : te
278
275
  );
279
276
  };
280
- }()), T;
277
+ }()), S;
281
278
  }
282
- var X;
283
- function Ie() {
284
- return X || (X = 1, process.env.NODE_ENV === "production" ? w.exports = Oe() : w.exports = Ae()), w.exports;
279
+ var se;
280
+ function Oe() {
281
+ return se || (se = 1, process.env.NODE_ENV === "production" ? A.exports = De() : A.exports = Ae()), A.exports;
285
282
  }
286
- var e = Ie();
287
- const _ = ye()((r) => ({
283
+ var n = Oe();
284
+ /**
285
+ * @license lucide-react v0.545.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */
290
+ const Ie = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Fe = (e) => e.replace(
291
+ /^([A-Z])|[\s-_]+(\w)/g,
292
+ (t, r, a) => a ? a.toUpperCase() : r.toLowerCase()
293
+ ), oe = (e) => {
294
+ const t = Fe(e);
295
+ return t.charAt(0).toUpperCase() + t.slice(1);
296
+ }, he = (...e) => e.filter((t, r, a) => !!t && t.trim() !== "" && a.indexOf(t) === r).join(" ").trim(), We = (e) => {
297
+ for (const t in e)
298
+ if (t.startsWith("aria-") || t === "role" || t === "title")
299
+ return !0;
300
+ };
301
+ /**
302
+ * @license lucide-react v0.545.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */
307
+ var $e = {
308
+ xmlns: "http://www.w3.org/2000/svg",
309
+ width: 24,
310
+ height: 24,
311
+ viewBox: "0 0 24 24",
312
+ fill: "none",
313
+ stroke: "currentColor",
314
+ strokeWidth: 2,
315
+ strokeLinecap: "round",
316
+ strokeLinejoin: "round"
317
+ };
318
+ /**
319
+ * @license lucide-react v0.545.0 - ISC
320
+ *
321
+ * This source code is licensed under the ISC license.
322
+ * See the LICENSE file in the root directory of this source tree.
323
+ */
324
+ const Le = de(
325
+ ({
326
+ color: e = "currentColor",
327
+ size: t = 24,
328
+ strokeWidth: r = 2,
329
+ absoluteStrokeWidth: a,
330
+ className: o = "",
331
+ children: c,
332
+ iconNode: l,
333
+ ...i
334
+ }, u) => X(
335
+ "svg",
336
+ {
337
+ ref: u,
338
+ ...$e,
339
+ width: t,
340
+ height: t,
341
+ stroke: e,
342
+ strokeWidth: a ? Number(r) * 24 / Number(t) : r,
343
+ className: he("lucide", o),
344
+ ...!c && !We(i) && { "aria-hidden": "true" },
345
+ ...i
346
+ },
347
+ [
348
+ ...l.map(([m, x]) => X(m, x)),
349
+ ...Array.isArray(c) ? c : [c]
350
+ ]
351
+ )
352
+ );
353
+ /**
354
+ * @license lucide-react v0.545.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */
359
+ const N = (e, t) => {
360
+ const r = de(
361
+ ({ className: a, ...o }, c) => X(Le, {
362
+ ref: c,
363
+ iconNode: t,
364
+ className: he(
365
+ `lucide-${Ie(oe(e))}`,
366
+ `lucide-${e}`,
367
+ a
368
+ ),
369
+ ...o
370
+ })
371
+ );
372
+ return r.displayName = oe(e), r;
373
+ };
374
+ /**
375
+ * @license lucide-react v0.545.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */
380
+ const Ye = [
381
+ ["path", { d: "M6 5h12", key: "fvfigv" }],
382
+ ["path", { d: "M4 12h10", key: "oujl3d" }],
383
+ ["path", { d: "M12 19h8", key: "baeox8" }]
384
+ ], Ve = N("chart-no-axes-gantt", Ye);
385
+ /**
386
+ * @license lucide-react v0.545.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */
391
+ const ze = [
392
+ [
393
+ "path",
394
+ {
395
+ d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
396
+ key: "1sd12s"
397
+ }
398
+ ]
399
+ ], Xe = N("message-circle", ze);
400
+ /**
401
+ * @license lucide-react v0.545.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */
406
+ const qe = [["path", { d: "M5 12h14", key: "1ays0h" }]], Ge = N("minus", qe);
407
+ /**
408
+ * @license lucide-react v0.545.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */
413
+ const Je = [
414
+ [
415
+ "path",
416
+ {
417
+ d: "M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",
418
+ key: "1a0edw"
419
+ }
420
+ ],
421
+ ["path", { d: "M12 22V12", key: "d0xqtd" }],
422
+ ["polyline", { points: "3.29 7 12 12 20.71 7", key: "ousv84" }],
423
+ ["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }]
424
+ ], Ue = N("package", Je);
425
+ /**
426
+ * @license lucide-react v0.545.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */
431
+ const Be = [
432
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
433
+ ["path", { d: "M12 5v14", key: "s699le" }]
434
+ ], He = N("plus", Be);
435
+ /**
436
+ * @license lucide-react v0.545.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */
441
+ const Qe = [
442
+ ["path", { d: "M16.247 7.761a6 6 0 0 1 0 8.478", key: "1fwjs5" }],
443
+ ["path", { d: "M19.075 4.933a10 10 0 0 1 0 14.134", key: "ehdyv1" }],
444
+ ["path", { d: "M4.925 19.067a10 10 0 0 1 0-14.134", key: "1q22gi" }],
445
+ ["path", { d: "M7.753 16.239a6 6 0 0 1 0-8.478", key: "r2q7qm" }],
446
+ ["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }]
447
+ ], Ze = N("radio", Qe);
448
+ /**
449
+ * @license lucide-react v0.545.0 - ISC
450
+ *
451
+ * This source code is licensed under the ISC license.
452
+ * See the LICENSE file in the root directory of this source tree.
453
+ */
454
+ const Ke = [
455
+ ["path", { d: "M15 12h-5", key: "r7krc0" }],
456
+ ["path", { d: "M15 8h-5", key: "1khuty" }],
457
+ ["path", { d: "M19 17V5a2 2 0 0 0-2-2H4", key: "zz82l3" }],
458
+ [
459
+ "path",
460
+ {
461
+ d: "M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",
462
+ key: "1ph1d7"
463
+ }
464
+ ]
465
+ ], et = N("scroll-text", Ke);
466
+ /**
467
+ * @license lucide-react v0.545.0 - ISC
468
+ *
469
+ * This source code is licensed under the ISC license.
470
+ * See the LICENSE file in the root directory of this source tree.
471
+ */
472
+ const tt = [
473
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
474
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
475
+ ], nt = N("search", tt);
476
+ /**
477
+ * @license lucide-react v0.545.0 - ISC
478
+ *
479
+ * This source code is licensed under the ISC license.
480
+ * See the LICENSE file in the root directory of this source tree.
481
+ */
482
+ const rt = [
483
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
484
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
485
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
486
+ ], at = N("trash", rt);
487
+ /**
488
+ * @license lucide-react v0.545.0 - ISC
489
+ *
490
+ * This source code is licensed under the ISC license.
491
+ * See the LICENSE file in the root directory of this source tree.
492
+ */
493
+ const st = [
494
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
495
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
496
+ ], xe = N("x", st), ie = (e) => {
497
+ let t;
498
+ const r = /* @__PURE__ */ new Set(), a = (m, x) => {
499
+ const v = typeof m == "function" ? m(t) : m;
500
+ if (!Object.is(v, t)) {
501
+ const h = t;
502
+ t = x ?? (typeof v != "object" || v === null) ? v : Object.assign({}, t, v), r.forEach((y) => y(t, h));
503
+ }
504
+ }, o = () => t, i = { setState: a, getState: o, getInitialState: () => u, subscribe: (m) => (r.add(m), () => r.delete(m)) }, u = t = e(a, o, i);
505
+ return i;
506
+ }, ot = (e) => e ? ie(e) : ie, it = (e) => e;
507
+ function ct(e, t = it) {
508
+ const r = C.useSyncExternalStore(
509
+ e.subscribe,
510
+ C.useCallback(() => t(e.getState()), [e, t]),
511
+ C.useCallback(() => t(e.getInitialState()), [e, t])
512
+ );
513
+ return C.useDebugValue(r), r;
514
+ }
515
+ const lt = (e) => {
516
+ const t = ot(e), r = (a) => ct(t, a);
517
+ return Object.assign(r, t), r;
518
+ }, dt = (e) => lt, F = dt()((e) => ({
288
519
  selectedTraceGroupId: void 0,
289
520
  selectedTraceId: void 0,
290
- selectTraceGroupId: (s) => r({ selectedTraceGroupId: s }),
291
- selectTraceId: (s) => r({ selectedTraceId: s })
292
- })), Pe = (r) => {
293
- const s = r?.endTime, [l, a] = C(s || Date.now());
294
- return Z(() => {
295
- if (s)
296
- a(s);
521
+ selectTraceGroupId: (t) => e({ selectedTraceGroupId: t }),
522
+ selectTraceId: (t) => e({ selectedTraceId: t })
523
+ })), ut = (e) => {
524
+ const t = e?.endTime, [r, a] = G(t || Date.now());
525
+ return ue(() => {
526
+ if (t)
527
+ a(t);
297
528
  else {
298
529
  const o = setInterval(() => a(Date.now()), 50);
299
530
  return () => clearInterval(o);
300
531
  }
301
- }, [s]), l;
302
- }, b = (r) => r == null ? "N/A" : r < 1e3 ? `${r}ms` : r < 6e4 ? `${(r / 1e3).toFixed(1)}s` : r < 36e5 ? `${(r / 6e4).toFixed(1)}min` : `${(r / 36e5).toFixed(1)}h`, Ce = ({ trace: r, group: s, groupEndTime: l, onExpand: a }) => /* @__PURE__ */ e.jsxs(
532
+ }, [t]), r;
533
+ }, k = (e) => e == null ? "N/A" : e < 1e3 ? `${e}ms` : e < 6e4 ? `${(e / 1e3).toFixed(1)}s` : e < 36e5 ? `${(e / 6e4).toFixed(1)}min` : `${(e / 36e5).toFixed(1)}h`, mt = ({ trace: e, group: t, groupEndTime: r, onExpand: a }) => /* @__PURE__ */ n.jsxs(
303
534
  "div",
304
535
  {
305
536
  className: "flex hover:bg-muted-foreground/10 relative cursor-pointer",
306
- onClick: () => a(r.id),
537
+ onClick: () => a(e.id),
307
538
  "data-testid": "trace-timeline-item",
308
539
  children: [
309
- /* @__PURE__ */ e.jsx("div", { 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", children: r.name }),
310
- /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-row items-center hover:bg-muted/50 rounded-md", children: /* @__PURE__ */ e.jsx("div", { className: "relative w-full h-[32px] flex items-center", children: /* @__PURE__ */ e.jsx(
540
+ /* @__PURE__ */ n.jsx("div", { 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", children: e.name }),
541
+ /* @__PURE__ */ n.jsx("div", { className: "flex w-full flex-row items-center hover:bg-muted/50 rounded-md", children: /* @__PURE__ */ n.jsx("div", { className: "relative w-full h-[32px] flex items-center", children: /* @__PURE__ */ n.jsx(
311
542
  "div",
312
543
  {
313
- className: D("h-[24px] rounded-[4px] hover:opacity-80 transition-all duration-200", {
314
- "bg-[repeating-linear-gradient(140deg,#BEFE29,#BEFE29_8px,#ABE625_8px,#ABE625_16px)]": r.status === "running",
315
- "bg-[repeating-linear-gradient(140deg,#2862FE,#2862FE_8px,#2358E5_8px,#2358E5_16px)]": r.status === "completed",
316
- "bg-[repeating-linear-gradient(140deg,#EA2069,#EA2069_8px,#D41E60_8px,#D41E60_16px)]": r.status === "failed"
544
+ className: U("h-[24px] rounded-[4px] hover:opacity-80 transition-all duration-200", {
545
+ "bg-[repeating-linear-gradient(140deg,#BEFE29,#BEFE29_8px,#ABE625_8px,#ABE625_16px)]": e.status === "running",
546
+ "bg-[repeating-linear-gradient(140deg,#2862FE,#2862FE_8px,#2358E5_8px,#2358E5_16px)]": e.status === "completed",
547
+ "bg-[repeating-linear-gradient(140deg,#EA2069,#EA2069_8px,#D41E60_8px,#D41E60_16px)]": e.status === "failed"
317
548
  }),
318
549
  style: {
319
- marginLeft: `${(r.startTime - s.startTime) / (l - s.startTime) * 100}%`,
320
- width: r.endTime ? `${(r.endTime - r.startTime) / (l - s.startTime) * 100}%` : `${(Date.now() - r.startTime) / (l - s.startTime) * 100}%`
550
+ marginLeft: `${(e.startTime - t.startTime) / (r - t.startTime) * 100}%`,
551
+ width: e.endTime ? `${(e.endTime - e.startTime) / (r - t.startTime) * 100}%` : `${(Date.now() - e.startTime) / (r - t.startTime) * 100}%`
321
552
  }
322
553
  }
323
554
  ) }) })
324
555
  ]
325
556
  }
326
- ), Fe = ({ event: r }) => {
327
- if (r.type === "log")
328
- return /* @__PURE__ */ e.jsx(ve, { className: "w-4 h-4 text-muted-foreground" });
329
- if (r.type === "emit")
330
- return /* @__PURE__ */ e.jsx(ge, { className: "w-4 h-4 text-muted-foreground" });
331
- if (r.type === "state")
332
- return /* @__PURE__ */ e.jsx(Te, { className: "w-4 h-4 text-muted-foreground" });
333
- if (r.type === "stream")
334
- return /* @__PURE__ */ e.jsx(Ne, { className: "w-4 h-4 text-muted-foreground" });
335
- }, ee = ({ arg: r }) => {
336
- if (typeof r == "string")
337
- return /* @__PURE__ */ e.jsxs("span", { className: "font-mono text-blue-500", children: [
557
+ ), ft = ({ event: e }) => {
558
+ if (e.type === "log")
559
+ return /* @__PURE__ */ n.jsx(et, { className: "w-4 h-4 text-muted-foreground" });
560
+ if (e.type === "emit")
561
+ return /* @__PURE__ */ n.jsx(Xe, { className: "w-4 h-4 text-muted-foreground" });
562
+ if (e.type === "state")
563
+ return /* @__PURE__ */ n.jsx(Ue, { className: "w-4 h-4 text-muted-foreground" });
564
+ if (e.type === "stream")
565
+ return /* @__PURE__ */ n.jsx(Ze, { className: "w-4 h-4 text-muted-foreground" });
566
+ }, pe = ({ arg: e }) => {
567
+ if (typeof e == "string")
568
+ return /* @__PURE__ */ n.jsxs("span", { className: "font-mono text-blue-500", children: [
338
569
  "'",
339
- r,
570
+ e,
340
571
  "'"
341
572
  ] });
342
- if (r === !1)
343
- return /* @__PURE__ */ e.jsx("span", { className: "font-mono text-blue-100 font-bold bg-blue-500/50 px-2 rounded-md", children: "value" });
344
- const s = Object.entries(r);
345
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
346
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-green-500", children: "{ " }),
347
- s.map(([l, a], o) => /* @__PURE__ */ e.jsxs("span", { children: [
348
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-green-500", children: l }),
349
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-muted-foreground", children: ":" }),
573
+ if (e === !1)
574
+ return /* @__PURE__ */ n.jsx("span", { className: "font-mono text-blue-100 font-bold bg-blue-500/50 px-2 rounded-md", children: "value" });
575
+ const t = Object.entries(e);
576
+ return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
577
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-green-500", children: "{ " }),
578
+ t.map(([r, a], o) => /* @__PURE__ */ n.jsxs("span", { children: [
579
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-green-500", children: r }),
580
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-muted-foreground", children: ":" }),
350
581
  " ",
351
- /* @__PURE__ */ e.jsx(ee, { arg: a }),
352
- o < s.length - 1 && /* @__PURE__ */ e.jsx(e.Fragment, { children: ", " })
353
- ] }, l)),
354
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-green-500", children: " }" })
582
+ /* @__PURE__ */ n.jsx(pe, { arg: a }),
583
+ o < t.length - 1 && /* @__PURE__ */ n.jsx(n.Fragment, { children: ", " })
584
+ ] }, r)),
585
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-green-500", children: " }" })
355
586
  ] });
356
- }, $ = ({ topLevelClassName: r, objectName: s, functionName: l, args: a, callsQuantity: o }) => {
357
- const u = o && o > 1, x = a.filter((d) => d !== void 0);
358
- return /* @__PURE__ */ e.jsxs("div", { children: [
359
- r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
360
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-pink-500", children: r }),
587
+ }, B = ({ topLevelClassName: e, objectName: t, functionName: r, args: a, callsQuantity: o }) => {
588
+ const c = o && o > 1, l = a.filter((i) => i !== void 0);
589
+ return /* @__PURE__ */ n.jsxs("div", { children: [
590
+ e && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
591
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-pink-500", children: e }),
361
592
  "."
362
593
  ] }),
363
- s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
364
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-pink-500", children: s }),
594
+ t && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
595
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-pink-500", children: t }),
365
596
  "."
366
597
  ] }),
367
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-pink-500", children: l }),
368
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-emerald-500", children: "(" }),
369
- x.map((d, i) => /* @__PURE__ */ e.jsxs("span", { children: [
370
- /* @__PURE__ */ e.jsx(ee, { arg: d }),
371
- i < x.length - 1 && /* @__PURE__ */ e.jsx(e.Fragment, { children: ", " })
372
- ] }, i)),
373
- /* @__PURE__ */ e.jsx("span", { className: "font-mono text-emerald-500", children: ")" }),
374
- u && /* @__PURE__ */ e.jsxs("span", { className: "font-mono text-muted-foreground", children: [
598
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-pink-500", children: r }),
599
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-emerald-500", children: "(" }),
600
+ l.map((i, u) => /* @__PURE__ */ n.jsxs("span", { children: [
601
+ /* @__PURE__ */ n.jsx(pe, { arg: i }),
602
+ u < l.length - 1 && /* @__PURE__ */ n.jsx(n.Fragment, { children: ", " })
603
+ ] }, u)),
604
+ /* @__PURE__ */ n.jsx("span", { className: "font-mono text-emerald-500", children: ")" }),
605
+ c && /* @__PURE__ */ n.jsxs("span", { className: "font-mono text-muted-foreground", children: [
375
606
  " x",
376
607
  o
377
608
  ] })
378
609
  ] });
379
- }, De = ({ event: r }) => /* @__PURE__ */ e.jsx($, { functionName: "emit", args: [{ topic: r.topic, data: !1 }] }), $e = ({ event: r }) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
380
- /* @__PURE__ */ e.jsx(he, { level: r.level }),
610
+ }, ht = ({ event: e }) => /* @__PURE__ */ n.jsx(B, { functionName: "emit", args: [{ topic: e.topic, data: !1 }] }), xt = ({ event: e }) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
611
+ /* @__PURE__ */ n.jsx(Pe, { level: e.level }),
381
612
  " ",
382
- r.message
383
- ] }), Me = ({ event: r }) => /* @__PURE__ */ e.jsx(
384
- $,
613
+ e.message
614
+ ] }), pt = ({ event: e }) => /* @__PURE__ */ n.jsx(
615
+ B,
385
616
  {
386
617
  objectName: "state",
387
- functionName: r.operation,
388
- args: [r.data.traceId, r.data.key, r.data.value ? !1 : void 0]
618
+ functionName: e.operation,
619
+ args: [e.data.traceId, e.data.key, e.data.value ? !1 : void 0]
389
620
  }
390
- ), Ge = ({ event: r }) => /* @__PURE__ */ e.jsx(
391
- $,
621
+ ), bt = ({ event: e }) => /* @__PURE__ */ n.jsx(
622
+ B,
392
623
  {
393
624
  topLevelClassName: "streams",
394
- objectName: r.streamName,
395
- functionName: r.operation,
396
- args: [r.data.groupId, r.data.id, r.data.data ? !1 : void 0],
397
- callsQuantity: r.calls
625
+ objectName: e.streamName,
626
+ functionName: e.operation,
627
+ args: [e.data.groupId, e.data.id, e.data.data ? !1 : void 0],
628
+ callsQuantity: e.calls
398
629
  }
399
- ), Le = N(({ event: r }) => {
400
- if (r.type === "log")
401
- return /* @__PURE__ */ e.jsx($e, { event: r });
402
- if (r.type === "emit")
403
- return /* @__PURE__ */ e.jsx(De, { event: r });
404
- if (r.type === "state")
405
- return /* @__PURE__ */ e.jsx(Me, { event: r });
406
- if (r.type === "stream")
407
- return /* @__PURE__ */ e.jsx(Ge, { event: r });
408
- }), Ye = N(({ trace: r, onClose: s }) => /* @__PURE__ */ e.jsxs(
409
- je,
630
+ ), gt = D(({ event: e }) => {
631
+ if (e.type === "log")
632
+ return /* @__PURE__ */ n.jsx(xt, { event: e });
633
+ if (e.type === "emit")
634
+ return /* @__PURE__ */ n.jsx(ht, { event: e });
635
+ if (e.type === "state")
636
+ return /* @__PURE__ */ n.jsx(pt, { event: e });
637
+ if (e.type === "stream")
638
+ return /* @__PURE__ */ n.jsx(bt, { event: e });
639
+ }), vt = D(({ trace: e, onClose: t }) => /* @__PURE__ */ n.jsxs(
640
+ Re,
410
641
  {
411
- onClose: s,
642
+ onClose: t,
412
643
  title: "Trace Details",
413
- subtitle: `Viewing details from step ${r.name}`,
414
- actions: [{ icon: /* @__PURE__ */ e.jsx(K, {}), onClick: s, label: "Close" }],
644
+ subtitle: `Viewing details from step ${e.name}`,
645
+ actions: [{ icon: /* @__PURE__ */ n.jsx(xe, {}), onClick: t, label: "Close" }],
415
646
  children: [
416
- /* @__PURE__ */ e.jsxs("div", { className: "px-2 w-[800px] overflow-auto", children: [
417
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4 text-sm text-muted-foreground mb-4", children: [
418
- r.endTime && /* @__PURE__ */ e.jsxs("span", { children: [
647
+ /* @__PURE__ */ n.jsxs("div", { className: "px-2 w-[800px] overflow-auto", children: [
648
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-4 text-sm text-muted-foreground mb-4", children: [
649
+ e.endTime && /* @__PURE__ */ n.jsxs("span", { children: [
419
650
  "Duration: ",
420
- b(r.endTime - r.startTime)
651
+ k(e.endTime - e.startTime)
421
652
  ] }),
422
- /* @__PURE__ */ e.jsx("div", { className: "bg-blue-500 font-bold text-xs px-[4px] py-[2px] rounded-sm text-blue-100", children: r.entryPoint.type }),
423
- r.correlationId && /* @__PURE__ */ e.jsxs(Q, { variant: "outline", children: [
653
+ /* @__PURE__ */ n.jsx("div", { className: "bg-blue-500 font-bold text-xs px-[4px] py-[2px] rounded-sm text-blue-100", children: e.entryPoint.type }),
654
+ e.correlationId && /* @__PURE__ */ n.jsxs(fe, { variant: "outline", children: [
424
655
  "Correlated: ",
425
- r.correlationId
656
+ e.correlationId
426
657
  ] })
427
658
  ] }),
428
- /* @__PURE__ */ e.jsx("div", { className: "pl-6 border-l-1 border-gray-500/40 font-mono text-xs flex flex-col gap-3", children: r.events.map((l, a) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
429
- /* @__PURE__ */ e.jsx("div", { className: "absolute -left-[26px] top-[8px] w-1 h-1 rounded-full bg-emerald-500 outline outline-2 outline-emerald-500/50" }),
430
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
431
- /* @__PURE__ */ e.jsx(Fe, { event: l }),
432
- /* @__PURE__ */ e.jsxs("span", { className: "text-sm font-mono text-muted-foreground", children: [
659
+ /* @__PURE__ */ n.jsx("div", { className: "pl-6 border-l-1 border-gray-500/40 font-mono text-xs flex flex-col gap-3", children: e.events.map((r, a) => /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
660
+ /* @__PURE__ */ n.jsx("div", { className: "absolute -left-[26px] top-[8px] w-1 h-1 rounded-full bg-emerald-500 outline outline-2 outline-emerald-500/50" }),
661
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
662
+ /* @__PURE__ */ n.jsx(ft, { event: r }),
663
+ /* @__PURE__ */ n.jsxs("span", { className: "text-sm font-mono text-muted-foreground", children: [
433
664
  "+",
434
- b(Math.floor(l.timestamp - r.startTime))
665
+ k(Math.floor(r.timestamp - e.startTime))
435
666
  ] }),
436
- /* @__PURE__ */ e.jsx(Le, { event: l })
667
+ /* @__PURE__ */ n.jsx(gt, { event: r })
437
668
  ] })
438
669
  ] }, a)) })
439
670
  ] }),
440
- r.error && /* @__PURE__ */ e.jsxs("div", { className: "p-4 bg-red-800/10", children: [
441
- /* @__PURE__ */ e.jsx("div", { className: "text-sm text-red-800 dark:text-red-400 font-semibold", children: r.error.message }),
442
- /* @__PURE__ */ e.jsx("div", { className: "text-sm text-red-800 dark:text-red-400 pl-4", children: r.error.stack })
671
+ e.error && /* @__PURE__ */ n.jsxs("div", { className: "p-4 bg-red-800/10", children: [
672
+ /* @__PURE__ */ n.jsx("div", { className: "text-sm text-red-800 dark:text-red-400 font-semibold", children: e.error.message }),
673
+ /* @__PURE__ */ n.jsx("div", { className: "text-sm text-red-800 dark:text-red-400 pl-4", children: e.error.stack })
443
674
  ] })
444
675
  ]
445
676
  }
446
- )), ze = N(({ groupId: r }) => {
447
- const { data: s } = pe({
677
+ )), yt = D(({ groupId: e }) => {
678
+ const { data: t } = Se({
448
679
  streamName: "motia-trace-group",
449
680
  groupId: "default",
450
- id: r
451
- }), { data: l } = H({ streamName: "motia-trace", groupId: r }), a = Pe(s), [o, u] = C(1), x = _((p) => p.selectedTraceId), d = _((p) => p.selectTraceId), i = F(() => l?.find((p) => p.id === x), [l, x]), k = () => {
452
- o > 0.5 && u(o - 0.1);
681
+ id: e
682
+ }), { data: r } = me({ streamName: "motia-trace", groupId: e }), a = ut(t), [o, c] = G(1), l = F((x) => x.selectedTraceId), i = F((x) => x.selectTraceId), u = J(() => r?.find((x) => x.id === l), [r, l]), m = () => {
683
+ o > 0.5 && c(o - 0.1);
453
684
  };
454
- return s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
455
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col flex-1 overflow-x-auto h-full relative", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center min-w-full sticky top-0", style: { width: `${o * 1e3}px` }, children: [
456
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 w-full sticky top-0 bg-background z-10", children: [
457
- /* @__PURE__ */ e.jsxs("div", { className: "w-full min-h-[37px] h-[37px] min-w-[200px] max-w-[200px] flex items-center justify-center gap-2 sticky left-0 top-0 bg-card backdrop-blur-[4px] backdrop-filter", children: [
458
- /* @__PURE__ */ e.jsx(P, { variant: "icon", size: "sm", className: "px-2", onClick: k, children: /* @__PURE__ */ e.jsx(Ee, { className: "w-4 h-4 cursor-pointer" }) }),
459
- /* @__PURE__ */ e.jsxs("span", { className: "text-sm font-bold text-muted-foreground", children: [
685
+ return t ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
686
+ /* @__PURE__ */ n.jsx("div", { className: "flex flex-col flex-1 overflow-x-auto h-full relative", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center min-w-full sticky top-0", style: { width: `${o * 1e3}px` }, children: [
687
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-1 w-full sticky top-0 bg-background z-10", children: [
688
+ /* @__PURE__ */ n.jsxs("div", { className: "w-full min-h-[37px] h-[37px] min-w-[200px] max-w-[200px] flex items-center justify-center gap-2 sticky left-0 top-0 bg-card backdrop-blur-[4px] backdrop-filter", children: [
689
+ /* @__PURE__ */ n.jsx(q, { variant: "icon", size: "sm", className: "px-2", onClick: m, children: /* @__PURE__ */ n.jsx(Ge, { className: "w-4 h-4 cursor-pointer" }) }),
690
+ /* @__PURE__ */ n.jsxs("span", { className: "text-sm font-bold text-muted-foreground", children: [
460
691
  Math.floor(o * 100),
461
692
  "%"
462
693
  ] }),
463
- /* @__PURE__ */ e.jsx(P, { variant: "icon", size: "sm", className: "px-2", onClick: () => u(o + 0.1), children: /* @__PURE__ */ e.jsx(we, { className: "w-4 h-4 cursor-pointer" }) })
694
+ /* @__PURE__ */ n.jsx(q, { variant: "icon", size: "sm", className: "px-2", onClick: () => c(o + 0.1), children: /* @__PURE__ */ n.jsx(He, { className: "w-4 h-4 cursor-pointer" }) })
464
695
  ] }),
465
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between font-mono p-2 w-full text-xs text-muted-foreground bg-card", children: [
466
- /* @__PURE__ */ e.jsx("span", { children: b(0) }),
467
- /* @__PURE__ */ e.jsx("span", { children: b(Math.floor((a - s.startTime) * 0.25)) }),
468
- /* @__PURE__ */ e.jsx("span", { children: b(Math.floor((a - s.startTime) * 0.5)) }),
469
- /* @__PURE__ */ e.jsx("span", { children: b(Math.floor((a - s.startTime) * 0.75)) }),
470
- /* @__PURE__ */ e.jsx("span", { children: b(Math.floor(a - s.startTime)) }),
471
- /* @__PURE__ */ e.jsxs("div", { className: "absolute bottom-[-4px] w-full flex justify-between", children: [
472
- /* @__PURE__ */ e.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
473
- /* @__PURE__ */ e.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
474
- /* @__PURE__ */ e.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
475
- /* @__PURE__ */ e.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
476
- /* @__PURE__ */ e.jsx("span", { className: "w-[1px] h-full bg-blue-500" })
696
+ /* @__PURE__ */ n.jsxs("div", { className: "flex justify-between font-mono p-2 w-full text-xs text-muted-foreground bg-card", children: [
697
+ /* @__PURE__ */ n.jsx("span", { children: k(0) }),
698
+ /* @__PURE__ */ n.jsx("span", { children: k(Math.floor((a - t.startTime) * 0.25)) }),
699
+ /* @__PURE__ */ n.jsx("span", { children: k(Math.floor((a - t.startTime) * 0.5)) }),
700
+ /* @__PURE__ */ n.jsx("span", { children: k(Math.floor((a - t.startTime) * 0.75)) }),
701
+ /* @__PURE__ */ n.jsx("span", { children: k(Math.floor(a - t.startTime)) }),
702
+ /* @__PURE__ */ n.jsxs("div", { className: "absolute bottom-[-4px] w-full flex justify-between", children: [
703
+ /* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
704
+ /* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
705
+ /* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
706
+ /* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
707
+ /* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" })
477
708
  ] })
478
709
  ] })
479
710
  ] }),
480
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col w-full h-full", children: l?.map((p) => /* @__PURE__ */ e.jsx(Ce, { trace: p, group: s, groupEndTime: a, onExpand: d }, p.id)) })
711
+ /* @__PURE__ */ n.jsx("div", { className: "flex flex-col w-full h-full", children: r?.map((x) => /* @__PURE__ */ n.jsx(mt, { trace: x, group: t, groupEndTime: a, onExpand: i }, x.id)) })
481
712
  ] }) }),
482
- i && /* @__PURE__ */ e.jsx(Ye, { trace: i, onClose: () => d(void 0) })
713
+ u && /* @__PURE__ */ n.jsx(vt, { trace: u, onClose: () => i(void 0) })
483
714
  ] }) : null;
484
- }), We = ({ status: r, duration: s }) => {
485
- const l = F(() => r === "running" ? "info" : r === "completed" ? "success" : r === "failed" ? "error" : "default", [r]);
486
- return /* @__PURE__ */ e.jsx(Q, { variant: l, children: s && r !== "failed" ? s : r });
487
- }, Ue = N(({ groups: r, selectedGroupId: s, onGroupSelect: l }) => /* @__PURE__ */ e.jsx("div", { className: "overflow-auto", children: r.length > 0 && /* @__PURE__ */ e.jsx("div", { children: [...r].reverse().map((a) => /* @__PURE__ */ e.jsx(
715
+ });
716
+ function p(e) {
717
+ const t = Object.prototype.toString.call(e);
718
+ return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
719
+ }
720
+ function jt(e, t) {
721
+ return e instanceof Date ? new e.constructor(t) : new Date(t);
722
+ }
723
+ const O = 43200, ce = 1440;
724
+ let wt = {};
725
+ function Nt() {
726
+ return wt;
727
+ }
728
+ function le(e) {
729
+ const t = p(e), r = new Date(
730
+ Date.UTC(
731
+ t.getFullYear(),
732
+ t.getMonth(),
733
+ t.getDate(),
734
+ t.getHours(),
735
+ t.getMinutes(),
736
+ t.getSeconds(),
737
+ t.getMilliseconds()
738
+ )
739
+ );
740
+ return r.setUTCFullYear(t.getFullYear()), +e - +r;
741
+ }
742
+ function I(e, t) {
743
+ const r = p(e), a = p(t), o = r.getTime() - a.getTime();
744
+ return o < 0 ? -1 : o > 0 ? 1 : o;
745
+ }
746
+ function Tt(e) {
747
+ return jt(e, Date.now());
748
+ }
749
+ function kt(e, t) {
750
+ const r = p(e), a = p(t), o = r.getFullYear() - a.getFullYear(), c = r.getMonth() - a.getMonth();
751
+ return o * 12 + c;
752
+ }
753
+ function Mt(e) {
754
+ return (t) => {
755
+ const r = Math.trunc, a = r(t);
756
+ return a === 0 ? 0 : a;
757
+ };
758
+ }
759
+ function _t(e, t) {
760
+ return +p(e) - +p(t);
761
+ }
762
+ function Et(e) {
763
+ const t = p(e);
764
+ return t.setHours(23, 59, 59, 999), t;
765
+ }
766
+ function St(e) {
767
+ const t = p(e), r = t.getMonth();
768
+ return t.setFullYear(t.getFullYear(), r + 1, 0), t.setHours(23, 59, 59, 999), t;
769
+ }
770
+ function Pt(e) {
771
+ const t = p(e);
772
+ return +Et(t) == +St(t);
773
+ }
774
+ function Rt(e, t) {
775
+ const r = p(e), a = p(t), o = I(r, a), c = Math.abs(
776
+ kt(r, a)
777
+ );
778
+ let l;
779
+ if (c < 1)
780
+ l = 0;
781
+ else {
782
+ r.getMonth() === 1 && r.getDate() > 27 && r.setDate(30), r.setMonth(r.getMonth() - o * c);
783
+ let i = I(r, a) === -o;
784
+ Pt(p(e)) && c === 1 && I(e, a) === 1 && (i = !1), l = o * (c - Number(i));
785
+ }
786
+ return l === 0 ? 0 : l;
787
+ }
788
+ function Ct(e, t, r) {
789
+ const a = _t(e, t) / 1e3;
790
+ return Mt()(a);
791
+ }
792
+ const Dt = {
793
+ lessThanXSeconds: {
794
+ one: "less than a second",
795
+ other: "less than {{count}} seconds"
796
+ },
797
+ xSeconds: {
798
+ one: "1 second",
799
+ other: "{{count}} seconds"
800
+ },
801
+ halfAMinute: "half a minute",
802
+ lessThanXMinutes: {
803
+ one: "less than a minute",
804
+ other: "less than {{count}} minutes"
805
+ },
806
+ xMinutes: {
807
+ one: "1 minute",
808
+ other: "{{count}} minutes"
809
+ },
810
+ aboutXHours: {
811
+ one: "about 1 hour",
812
+ other: "about {{count}} hours"
813
+ },
814
+ xHours: {
815
+ one: "1 hour",
816
+ other: "{{count}} hours"
817
+ },
818
+ xDays: {
819
+ one: "1 day",
820
+ other: "{{count}} days"
821
+ },
822
+ aboutXWeeks: {
823
+ one: "about 1 week",
824
+ other: "about {{count}} weeks"
825
+ },
826
+ xWeeks: {
827
+ one: "1 week",
828
+ other: "{{count}} weeks"
829
+ },
830
+ aboutXMonths: {
831
+ one: "about 1 month",
832
+ other: "about {{count}} months"
833
+ },
834
+ xMonths: {
835
+ one: "1 month",
836
+ other: "{{count}} months"
837
+ },
838
+ aboutXYears: {
839
+ one: "about 1 year",
840
+ other: "about {{count}} years"
841
+ },
842
+ xYears: {
843
+ one: "1 year",
844
+ other: "{{count}} years"
845
+ },
846
+ overXYears: {
847
+ one: "over 1 year",
848
+ other: "over {{count}} years"
849
+ },
850
+ almostXYears: {
851
+ one: "almost 1 year",
852
+ other: "almost {{count}} years"
853
+ }
854
+ }, At = (e, t, r) => {
855
+ let a;
856
+ const o = Dt[e];
857
+ return typeof o == "string" ? a = o : t === 1 ? a = o.one : a = o.other.replace("{{count}}", t.toString()), r?.addSuffix ? r.comparison && r.comparison > 0 ? "in " + a : a + " ago" : a;
858
+ };
859
+ function z(e) {
860
+ return (t = {}) => {
861
+ const r = t.width ? String(t.width) : e.defaultWidth;
862
+ return e.formats[r] || e.formats[e.defaultWidth];
863
+ };
864
+ }
865
+ const Ot = {
866
+ full: "EEEE, MMMM do, y",
867
+ long: "MMMM do, y",
868
+ medium: "MMM d, y",
869
+ short: "MM/dd/yyyy"
870
+ }, It = {
871
+ full: "h:mm:ss a zzzz",
872
+ long: "h:mm:ss a z",
873
+ medium: "h:mm:ss a",
874
+ short: "h:mm a"
875
+ }, Ft = {
876
+ full: "{{date}} 'at' {{time}}",
877
+ long: "{{date}} 'at' {{time}}",
878
+ medium: "{{date}}, {{time}}",
879
+ short: "{{date}}, {{time}}"
880
+ }, Wt = {
881
+ date: z({
882
+ formats: Ot,
883
+ defaultWidth: "full"
884
+ }),
885
+ time: z({
886
+ formats: It,
887
+ defaultWidth: "full"
888
+ }),
889
+ dateTime: z({
890
+ formats: Ft,
891
+ defaultWidth: "full"
892
+ })
893
+ }, $t = {
894
+ lastWeek: "'last' eeee 'at' p",
895
+ yesterday: "'yesterday at' p",
896
+ today: "'today at' p",
897
+ tomorrow: "'tomorrow at' p",
898
+ nextWeek: "eeee 'at' p",
899
+ other: "P"
900
+ }, Lt = (e, t, r, a) => $t[e];
901
+ function P(e) {
902
+ return (t, r) => {
903
+ const a = r?.context ? String(r.context) : "standalone";
904
+ let o;
905
+ if (a === "formatting" && e.formattingValues) {
906
+ const l = e.defaultFormattingWidth || e.defaultWidth, i = r?.width ? String(r.width) : l;
907
+ o = e.formattingValues[i] || e.formattingValues[l];
908
+ } else {
909
+ const l = e.defaultWidth, i = r?.width ? String(r.width) : e.defaultWidth;
910
+ o = e.values[i] || e.values[l];
911
+ }
912
+ const c = e.argumentCallback ? e.argumentCallback(t) : t;
913
+ return o[c];
914
+ };
915
+ }
916
+ const Yt = {
917
+ narrow: ["B", "A"],
918
+ abbreviated: ["BC", "AD"],
919
+ wide: ["Before Christ", "Anno Domini"]
920
+ }, Vt = {
921
+ narrow: ["1", "2", "3", "4"],
922
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
923
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
924
+ }, zt = {
925
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
926
+ abbreviated: [
927
+ "Jan",
928
+ "Feb",
929
+ "Mar",
930
+ "Apr",
931
+ "May",
932
+ "Jun",
933
+ "Jul",
934
+ "Aug",
935
+ "Sep",
936
+ "Oct",
937
+ "Nov",
938
+ "Dec"
939
+ ],
940
+ wide: [
941
+ "January",
942
+ "February",
943
+ "March",
944
+ "April",
945
+ "May",
946
+ "June",
947
+ "July",
948
+ "August",
949
+ "September",
950
+ "October",
951
+ "November",
952
+ "December"
953
+ ]
954
+ }, Xt = {
955
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
956
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
957
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
958
+ wide: [
959
+ "Sunday",
960
+ "Monday",
961
+ "Tuesday",
962
+ "Wednesday",
963
+ "Thursday",
964
+ "Friday",
965
+ "Saturday"
966
+ ]
967
+ }, qt = {
968
+ narrow: {
969
+ am: "a",
970
+ pm: "p",
971
+ midnight: "mi",
972
+ noon: "n",
973
+ morning: "morning",
974
+ afternoon: "afternoon",
975
+ evening: "evening",
976
+ night: "night"
977
+ },
978
+ abbreviated: {
979
+ am: "AM",
980
+ pm: "PM",
981
+ midnight: "midnight",
982
+ noon: "noon",
983
+ morning: "morning",
984
+ afternoon: "afternoon",
985
+ evening: "evening",
986
+ night: "night"
987
+ },
988
+ wide: {
989
+ am: "a.m.",
990
+ pm: "p.m.",
991
+ midnight: "midnight",
992
+ noon: "noon",
993
+ morning: "morning",
994
+ afternoon: "afternoon",
995
+ evening: "evening",
996
+ night: "night"
997
+ }
998
+ }, Gt = {
999
+ narrow: {
1000
+ am: "a",
1001
+ pm: "p",
1002
+ midnight: "mi",
1003
+ noon: "n",
1004
+ morning: "in the morning",
1005
+ afternoon: "in the afternoon",
1006
+ evening: "in the evening",
1007
+ night: "at night"
1008
+ },
1009
+ abbreviated: {
1010
+ am: "AM",
1011
+ pm: "PM",
1012
+ midnight: "midnight",
1013
+ noon: "noon",
1014
+ morning: "in the morning",
1015
+ afternoon: "in the afternoon",
1016
+ evening: "in the evening",
1017
+ night: "at night"
1018
+ },
1019
+ wide: {
1020
+ am: "a.m.",
1021
+ pm: "p.m.",
1022
+ midnight: "midnight",
1023
+ noon: "noon",
1024
+ morning: "in the morning",
1025
+ afternoon: "in the afternoon",
1026
+ evening: "in the evening",
1027
+ night: "at night"
1028
+ }
1029
+ }, Jt = (e, t) => {
1030
+ const r = Number(e), a = r % 100;
1031
+ if (a > 20 || a < 10)
1032
+ switch (a % 10) {
1033
+ case 1:
1034
+ return r + "st";
1035
+ case 2:
1036
+ return r + "nd";
1037
+ case 3:
1038
+ return r + "rd";
1039
+ }
1040
+ return r + "th";
1041
+ }, Ut = {
1042
+ ordinalNumber: Jt,
1043
+ era: P({
1044
+ values: Yt,
1045
+ defaultWidth: "wide"
1046
+ }),
1047
+ quarter: P({
1048
+ values: Vt,
1049
+ defaultWidth: "wide",
1050
+ argumentCallback: (e) => e - 1
1051
+ }),
1052
+ month: P({
1053
+ values: zt,
1054
+ defaultWidth: "wide"
1055
+ }),
1056
+ day: P({
1057
+ values: Xt,
1058
+ defaultWidth: "wide"
1059
+ }),
1060
+ dayPeriod: P({
1061
+ values: qt,
1062
+ defaultWidth: "wide",
1063
+ formattingValues: Gt,
1064
+ defaultFormattingWidth: "wide"
1065
+ })
1066
+ };
1067
+ function R(e) {
1068
+ return (t, r = {}) => {
1069
+ const a = r.width, o = a && e.matchPatterns[a] || e.matchPatterns[e.defaultMatchWidth], c = t.match(o);
1070
+ if (!c)
1071
+ return null;
1072
+ const l = c[0], i = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(i) ? Ht(i, (v) => v.test(l)) : (
1073
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
1074
+ Bt(i, (v) => v.test(l))
1075
+ );
1076
+ let m;
1077
+ m = e.valueCallback ? e.valueCallback(u) : u, m = r.valueCallback ? (
1078
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
1079
+ r.valueCallback(m)
1080
+ ) : m;
1081
+ const x = t.slice(l.length);
1082
+ return { value: m, rest: x };
1083
+ };
1084
+ }
1085
+ function Bt(e, t) {
1086
+ for (const r in e)
1087
+ if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
1088
+ return r;
1089
+ }
1090
+ function Ht(e, t) {
1091
+ for (let r = 0; r < e.length; r++)
1092
+ if (t(e[r]))
1093
+ return r;
1094
+ }
1095
+ function Qt(e) {
1096
+ return (t, r = {}) => {
1097
+ const a = t.match(e.matchPattern);
1098
+ if (!a) return null;
1099
+ const o = a[0], c = t.match(e.parsePattern);
1100
+ if (!c) return null;
1101
+ let l = e.valueCallback ? e.valueCallback(c[0]) : c[0];
1102
+ l = r.valueCallback ? r.valueCallback(l) : l;
1103
+ const i = t.slice(o.length);
1104
+ return { value: l, rest: i };
1105
+ };
1106
+ }
1107
+ const Zt = /^(\d+)(th|st|nd|rd)?/i, Kt = /\d+/i, en = {
1108
+ narrow: /^(b|a)/i,
1109
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1110
+ wide: /^(before christ|before common era|anno domini|common era)/i
1111
+ }, tn = {
1112
+ any: [/^b/i, /^(a|c)/i]
1113
+ }, nn = {
1114
+ narrow: /^[1234]/i,
1115
+ abbreviated: /^q[1234]/i,
1116
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1117
+ }, rn = {
1118
+ any: [/1/i, /2/i, /3/i, /4/i]
1119
+ }, an = {
1120
+ narrow: /^[jfmasond]/i,
1121
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1122
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1123
+ }, sn = {
1124
+ narrow: [
1125
+ /^j/i,
1126
+ /^f/i,
1127
+ /^m/i,
1128
+ /^a/i,
1129
+ /^m/i,
1130
+ /^j/i,
1131
+ /^j/i,
1132
+ /^a/i,
1133
+ /^s/i,
1134
+ /^o/i,
1135
+ /^n/i,
1136
+ /^d/i
1137
+ ],
1138
+ any: [
1139
+ /^ja/i,
1140
+ /^f/i,
1141
+ /^mar/i,
1142
+ /^ap/i,
1143
+ /^may/i,
1144
+ /^jun/i,
1145
+ /^jul/i,
1146
+ /^au/i,
1147
+ /^s/i,
1148
+ /^o/i,
1149
+ /^n/i,
1150
+ /^d/i
1151
+ ]
1152
+ }, on = {
1153
+ narrow: /^[smtwf]/i,
1154
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1155
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1156
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1157
+ }, cn = {
1158
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1159
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1160
+ }, ln = {
1161
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1162
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1163
+ }, dn = {
1164
+ any: {
1165
+ am: /^a/i,
1166
+ pm: /^p/i,
1167
+ midnight: /^mi/i,
1168
+ noon: /^no/i,
1169
+ morning: /morning/i,
1170
+ afternoon: /afternoon/i,
1171
+ evening: /evening/i,
1172
+ night: /night/i
1173
+ }
1174
+ }, un = {
1175
+ ordinalNumber: Qt({
1176
+ matchPattern: Zt,
1177
+ parsePattern: Kt,
1178
+ valueCallback: (e) => parseInt(e, 10)
1179
+ }),
1180
+ era: R({
1181
+ matchPatterns: en,
1182
+ defaultMatchWidth: "wide",
1183
+ parsePatterns: tn,
1184
+ defaultParseWidth: "any"
1185
+ }),
1186
+ quarter: R({
1187
+ matchPatterns: nn,
1188
+ defaultMatchWidth: "wide",
1189
+ parsePatterns: rn,
1190
+ defaultParseWidth: "any",
1191
+ valueCallback: (e) => e + 1
1192
+ }),
1193
+ month: R({
1194
+ matchPatterns: an,
1195
+ defaultMatchWidth: "wide",
1196
+ parsePatterns: sn,
1197
+ defaultParseWidth: "any"
1198
+ }),
1199
+ day: R({
1200
+ matchPatterns: on,
1201
+ defaultMatchWidth: "wide",
1202
+ parsePatterns: cn,
1203
+ defaultParseWidth: "any"
1204
+ }),
1205
+ dayPeriod: R({
1206
+ matchPatterns: ln,
1207
+ defaultMatchWidth: "any",
1208
+ parsePatterns: dn,
1209
+ defaultParseWidth: "any"
1210
+ })
1211
+ }, mn = {
1212
+ code: "en-US",
1213
+ formatDistance: At,
1214
+ formatLong: Wt,
1215
+ formatRelative: Lt,
1216
+ localize: Ut,
1217
+ match: un,
1218
+ options: {
1219
+ weekStartsOn: 0,
1220
+ firstWeekContainsDate: 1
1221
+ }
1222
+ };
1223
+ function fn(e, t, r) {
1224
+ const a = Nt(), o = r?.locale ?? a.locale ?? mn, c = 2520, l = I(e, t);
1225
+ if (isNaN(l))
1226
+ throw new RangeError("Invalid time value");
1227
+ const i = Object.assign({}, r, {
1228
+ addSuffix: r?.addSuffix,
1229
+ comparison: l
1230
+ });
1231
+ let u, m;
1232
+ l > 0 ? (u = p(t), m = p(e)) : (u = p(e), m = p(t));
1233
+ const x = Ct(m, u), v = (le(m) - le(u)) / 1e3, h = Math.round((x - v) / 60);
1234
+ let y;
1235
+ if (h < 2)
1236
+ return h === 0 ? o.formatDistance("lessThanXMinutes", 1, i) : o.formatDistance("xMinutes", h, i);
1237
+ if (h < 45)
1238
+ return o.formatDistance("xMinutes", h, i);
1239
+ if (h < 90)
1240
+ return o.formatDistance("aboutXHours", 1, i);
1241
+ if (h < ce) {
1242
+ const j = Math.round(h / 60);
1243
+ return o.formatDistance("aboutXHours", j, i);
1244
+ } else {
1245
+ if (h < c)
1246
+ return o.formatDistance("xDays", 1, i);
1247
+ if (h < O) {
1248
+ const j = Math.round(h / ce);
1249
+ return o.formatDistance("xDays", j, i);
1250
+ } else if (h < O * 2)
1251
+ return y = Math.round(h / O), o.formatDistance("aboutXMonths", y, i);
1252
+ }
1253
+ if (y = Rt(m, u), y < 12) {
1254
+ const j = Math.round(h / O);
1255
+ return o.formatDistance("xMonths", j, i);
1256
+ } else {
1257
+ const j = y % 12, M = Math.trunc(y / 12);
1258
+ return j < 3 ? o.formatDistance("aboutXYears", M, i) : j < 9 ? o.formatDistance("overXYears", M, i) : o.formatDistance("almostXYears", M + 1, i);
1259
+ }
1260
+ }
1261
+ function hn(e, t) {
1262
+ return fn(e, Tt(e), t);
1263
+ }
1264
+ const xn = ({ status: e, duration: t }) => {
1265
+ const r = J(() => e === "running" ? "info" : e === "completed" ? "success" : e === "failed" ? "error" : "default", [e]);
1266
+ return /* @__PURE__ */ n.jsx(fe, { variant: r, children: t && e !== "failed" ? t : e });
1267
+ }, pn = D(({ groups: e, selectedGroupId: t, onGroupSelect: r }) => /* @__PURE__ */ n.jsx("div", { className: "overflow-auto", children: e.length > 0 && /* @__PURE__ */ n.jsx("div", { children: [...e].reverse().map((a) => /* @__PURE__ */ n.jsx(
488
1268
  "div",
489
1269
  {
490
1270
  "data-testid": `trace-${a.id}`,
491
- className: D(
1271
+ className: U(
492
1272
  "motia-trace-group cursor-pointer transition-colors",
493
- s === a.id ? "bg-muted-foreground/10" : "hover:bg-muted/70"
1273
+ t === a.id ? "bg-muted-foreground/10" : "hover:bg-muted/70"
494
1274
  ),
495
- onClick: () => l(a),
496
- children: /* @__PURE__ */ e.jsxs("div", { className: "p-3 flex flex-col gap-1", children: [
497
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row justify-between items-center gap-2", children: [
498
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold text-lg", children: a.name }),
499
- /* @__PURE__ */ e.jsx(
500
- We,
1275
+ onClick: () => r(a),
1276
+ children: /* @__PURE__ */ n.jsxs("div", { className: "p-3 flex flex-col gap-1", children: [
1277
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-row justify-between items-center gap-2", children: [
1278
+ /* @__PURE__ */ n.jsx("span", { className: "font-semibold text-lg", children: a.name }),
1279
+ /* @__PURE__ */ n.jsx(
1280
+ xn,
501
1281
  {
502
1282
  status: a.status,
503
- duration: a.endTime ? b(a.endTime - a.startTime) : void 0
1283
+ duration: a.endTime ? k(a.endTime - a.startTime) : void 0
504
1284
  }
505
1285
  )
506
1286
  ] }),
507
- /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-muted-foreground space-y-1", children: [
508
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between", children: [
509
- /* @__PURE__ */ e.jsx("div", { "data-testid": "trace-id", className: "text-xs text-muted-foreground font-mono tracking-[1px]", children: a.id }),
510
- /* @__PURE__ */ e.jsxs("span", { children: [
1287
+ /* @__PURE__ */ n.jsxs("div", { className: "text-xs text-muted-foreground space-y-1", children: [
1288
+ /* @__PURE__ */ n.jsxs("div", { className: "flex justify-between", children: [
1289
+ /* @__PURE__ */ n.jsx("div", { "data-testid": "trace-id", className: "text-xs text-muted-foreground font-mono tracking-[1px]", children: a.id }),
1290
+ /* @__PURE__ */ n.jsxs("span", { children: [
511
1291
  a.metadata.totalSteps,
512
1292
  " steps"
513
1293
  ] })
514
1294
  ] }),
515
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between", children: [
516
- Se(a.startTime),
1295
+ /* @__PURE__ */ n.jsxs("div", { className: "flex justify-between", children: [
1296
+ hn(a.startTime),
517
1297
  " ago"
518
1298
  ] }),
519
- a.metadata.activeSteps > 0 && /* @__PURE__ */ e.jsxs("div", { className: "text-blue-600", children: [
1299
+ a.metadata.activeSteps > 0 && /* @__PURE__ */ n.jsxs("div", { className: "text-blue-600", children: [
520
1300
  a.metadata.activeSteps,
521
1301
  " active"
522
1302
  ] })
@@ -524,65 +1304,65 @@ const _ = ye()((r) => ({
524
1304
  ] })
525
1305
  },
526
1306
  a.id
527
- )) }) })), Qe = () => {
528
- const r = _((i) => i.selectedTraceGroupId), s = _((i) => i.selectTraceGroupId), { data: l } = H({ streamName: "motia-trace-group", groupId: "default" }), a = (i) => s(i.id), [o, u] = C(""), x = () => fetch("/__motia/trace/clear", { method: "POST" }), d = F(
529
- () => l?.filter(
530
- (i) => i.name.toLowerCase().includes(o.toLowerCase()) || i.id.toLowerCase().includes(o.toLowerCase())
1307
+ )) }) })), jn = () => {
1308
+ const e = F((u) => u.selectedTraceGroupId), t = F((u) => u.selectTraceGroupId), { data: r } = me({ streamName: "motia-trace-group", groupId: "default" }), a = (u) => t(u.id), [o, c] = G(""), l = () => fetch("/__motia/trace/clear", { method: "POST" }), i = J(
1309
+ () => r?.filter(
1310
+ (u) => u.name.toLowerCase().includes(o.toLowerCase()) || u.id.toLowerCase().includes(o.toLowerCase())
531
1311
  ),
532
- [l, o]
1312
+ [r, o]
533
1313
  );
534
- return Z(() => {
535
- if (d && d.length > 0) {
536
- const i = d[d.length - 1];
537
- i && i.status === "running" && i.id !== r && s(i.id);
538
- } else r && s(void 0);
539
- }, [d]), /* @__PURE__ */ e.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full", children: [
540
- /* @__PURE__ */ e.jsxs("div", { className: "flex p-2 border-b gap-2", "data-testid": "logs-search-container", children: [
541
- /* @__PURE__ */ e.jsxs("div", { className: "flex-1 relative", children: [
542
- /* @__PURE__ */ e.jsx(
543
- be,
1314
+ return ue(() => {
1315
+ if (i && i.length > 0) {
1316
+ const u = i[i.length - 1];
1317
+ u && u.status === "running" && u.id !== e && t(u.id);
1318
+ } else e && t(void 0);
1319
+ }, [i]), /* @__PURE__ */ n.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full", children: [
1320
+ /* @__PURE__ */ n.jsxs("div", { className: "flex p-2 border-b gap-2", "data-testid": "logs-search-container", children: [
1321
+ /* @__PURE__ */ n.jsxs("div", { className: "flex-1 relative", children: [
1322
+ /* @__PURE__ */ n.jsx(
1323
+ Ce,
544
1324
  {
545
1325
  variant: "shade",
546
1326
  value: o,
547
- onChange: (i) => u(i.target.value),
1327
+ onChange: (u) => c(u.target.value),
548
1328
  className: "px-9 font-medium",
549
1329
  placeholder: "Search by Trace ID or Step Name"
550
1330
  }
551
1331
  ),
552
- /* @__PURE__ */ e.jsx(_e, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
553
- /* @__PURE__ */ e.jsx(
554
- K,
1332
+ /* @__PURE__ */ n.jsx(nt, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
1333
+ /* @__PURE__ */ n.jsx(
1334
+ xe,
555
1335
  {
556
- className: D(
1336
+ className: U(
557
1337
  "cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",
558
1338
  {
559
1339
  visible: o !== "",
560
1340
  invisible: o === ""
561
1341
  }
562
1342
  ),
563
- onClick: () => u("")
1343
+ onClick: () => c("")
564
1344
  }
565
1345
  )
566
1346
  ] }),
567
- /* @__PURE__ */ e.jsxs(P, { variant: "default", onClick: x, className: "h-[34px]", children: [
568
- /* @__PURE__ */ e.jsx(ke, {}),
1347
+ /* @__PURE__ */ n.jsxs(q, { variant: "default", onClick: l, className: "h-[34px]", children: [
1348
+ /* @__PURE__ */ n.jsx(at, {}),
569
1349
  " Clear"
570
1350
  ] })
571
1351
  ] }),
572
- /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[300px_1fr] overflow-hidden", children: [
573
- /* @__PURE__ */ e.jsx("div", { className: "w-[300px] border-r border-border overflow-auto h-full", "data-testid": "traces-container", children: /* @__PURE__ */ e.jsx(Ue, { groups: d, selectedGroupId: r, onGroupSelect: a }) }),
574
- /* @__PURE__ */ e.jsxs("div", { className: "overflow-auto", "data-testid": "trace-details", children: [
575
- r && /* @__PURE__ */ e.jsx(ze, { groupId: r }),
576
- !r && /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a trace or trace group to view the timeline" })
1352
+ /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-[300px_1fr] overflow-hidden", children: [
1353
+ /* @__PURE__ */ n.jsx("div", { className: "w-[300px] border-r border-border overflow-auto h-full", "data-testid": "traces-container", children: /* @__PURE__ */ n.jsx(pn, { groups: i, selectedGroupId: e, onGroupSelect: a }) }),
1354
+ /* @__PURE__ */ n.jsxs("div", { className: "overflow-auto", "data-testid": "trace-details", children: [
1355
+ e && /* @__PURE__ */ n.jsx(yt, { groupId: e }),
1356
+ !e && /* @__PURE__ */ n.jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a trace or trace group to view the timeline" })
577
1357
  ] })
578
1358
  ] })
579
1359
  ] });
580
- }, Be = N(() => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
581
- /* @__PURE__ */ e.jsx(Re, { "aria-hidden": "true" }),
582
- /* @__PURE__ */ e.jsx("span", { children: "Tracing" })
1360
+ }, bn = D(() => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1361
+ /* @__PURE__ */ n.jsx(Ve, { "aria-hidden": "true" }),
1362
+ /* @__PURE__ */ n.jsx("span", { children: "Tracing" })
583
1363
  ] }));
584
- Be.displayName = "ObservabilityTabLabel";
1364
+ bn.displayName = "ObservabilityTabLabel";
585
1365
  export {
586
- Qe as ObservabilityPage,
587
- Be as ObservabilityTabLabel
1366
+ jn as ObservabilityPage,
1367
+ bn as ObservabilityTabLabel
588
1368
  };