@devqubit/ui 0.1.10-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +31 -0
  2. package/dist/api/client.d.ts +72 -0
  3. package/dist/api/client.d.ts.map +1 -0
  4. package/dist/api/index.d.ts +8 -0
  5. package/dist/api/index.d.ts.map +1 -0
  6. package/dist/components/GroupsTable/GroupsTable.d.ts +6 -0
  7. package/dist/components/GroupsTable/GroupsTable.d.ts.map +1 -0
  8. package/dist/components/GroupsTable/index.d.ts +3 -0
  9. package/dist/components/GroupsTable/index.d.ts.map +1 -0
  10. package/dist/components/Layout/Layout.d.ts +18 -0
  11. package/dist/components/Layout/Layout.d.ts.map +1 -0
  12. package/dist/components/Layout/index.d.ts +3 -0
  13. package/dist/components/Layout/index.d.ts.map +1 -0
  14. package/dist/components/ProjectsTable/ProjectsTable.d.ts +7 -0
  15. package/dist/components/ProjectsTable/ProjectsTable.d.ts.map +1 -0
  16. package/dist/components/ProjectsTable/index.d.ts +3 -0
  17. package/dist/components/ProjectsTable/index.d.ts.map +1 -0
  18. package/dist/components/RunsTable/RunsTable.d.ts +14 -0
  19. package/dist/components/RunsTable/RunsTable.d.ts.map +1 -0
  20. package/dist/components/RunsTable/index.d.ts +3 -0
  21. package/dist/components/RunsTable/index.d.ts.map +1 -0
  22. package/dist/components/Table/Table.d.ts +16 -0
  23. package/dist/components/Table/Table.d.ts.map +1 -0
  24. package/dist/components/Table/index.d.ts +3 -0
  25. package/dist/components/Table/index.d.ts.map +1 -0
  26. package/dist/components/index.d.ts +16 -0
  27. package/dist/components/index.d.ts.map +1 -0
  28. package/dist/components/ui/forms.d.ts +18 -0
  29. package/dist/components/ui/forms.d.ts.map +1 -0
  30. package/dist/components/ui/index.d.ts +5 -0
  31. package/dist/components/ui/index.d.ts.map +1 -0
  32. package/dist/components/ui/primitives.d.ts +66 -0
  33. package/dist/components/ui/primitives.d.ts.map +1 -0
  34. package/dist/hooks/index.d.ts +109 -0
  35. package/dist/hooks/index.d.ts.map +1 -0
  36. package/dist/index.cjs +14 -0
  37. package/dist/index.d.ts +24 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +2160 -0
  40. package/dist/pages/ArtifactPage.d.ts +5 -0
  41. package/dist/pages/ArtifactPage.d.ts.map +1 -0
  42. package/dist/pages/DiffPage.d.ts +5 -0
  43. package/dist/pages/DiffPage.d.ts.map +1 -0
  44. package/dist/pages/GroupDetailPage.d.ts +5 -0
  45. package/dist/pages/GroupDetailPage.d.ts.map +1 -0
  46. package/dist/pages/GroupsPage.d.ts +5 -0
  47. package/dist/pages/GroupsPage.d.ts.map +1 -0
  48. package/dist/pages/ProjectsPage.d.ts +5 -0
  49. package/dist/pages/ProjectsPage.d.ts.map +1 -0
  50. package/dist/pages/RunDetailPage.d.ts +5 -0
  51. package/dist/pages/RunDetailPage.d.ts.map +1 -0
  52. package/dist/pages/RunsPage.d.ts +5 -0
  53. package/dist/pages/RunsPage.d.ts.map +1 -0
  54. package/dist/pages/SearchPage.d.ts +5 -0
  55. package/dist/pages/SearchPage.d.ts.map +1 -0
  56. package/dist/pages/index.d.ts +9 -0
  57. package/dist/pages/index.d.ts.map +1 -0
  58. package/dist/router/index.d.ts +5 -0
  59. package/dist/router/index.d.ts.map +1 -0
  60. package/dist/style.css +1 -0
  61. package/dist/types/index.d.ts +171 -0
  62. package/dist/types/index.d.ts.map +1 -0
  63. package/dist/utils/index.d.ts +138 -0
  64. package/dist/utils/index.d.ts.map +1 -0
  65. package/package.json +55 -0
package/dist/index.js ADDED
@@ -0,0 +1,2160 @@
1
+ import Rr, { useState as O, useEffect as xe, useContext as wr, useCallback as be, createContext as Er, useRef as br, forwardRef as He } from "react";
2
+ import { useLocation as ls, Link as q, useSearchParams as Oe, useParams as Xe, useNavigate as os, Navigate as ds, createBrowserRouter as us, RouterProvider as hs } from "react-router-dom";
3
+ var ke = { exports: {} }, pe = {};
4
+ var Nr;
5
+ function xs() {
6
+ if (Nr) return pe;
7
+ Nr = 1;
8
+ var s = Rr, n = /* @__PURE__ */ Symbol.for("react.element"), t = /* @__PURE__ */ Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
9
+ function m(a, u, x) {
10
+ var g, f = {}, R = null, K = null;
11
+ x !== void 0 && (R = "" + x), u.key !== void 0 && (R = "" + u.key), u.ref !== void 0 && (K = u.ref);
12
+ for (g in u) i.call(u, g) && !o.hasOwnProperty(g) && (f[g] = u[g]);
13
+ if (a && a.defaultProps) for (g in u = a.defaultProps, u) f[g] === void 0 && (f[g] = u[g]);
14
+ return { $$typeof: n, type: a, key: R, ref: K, props: f, _owner: d.current };
15
+ }
16
+ return pe.Fragment = t, pe.jsx = m, pe.jsxs = m, pe;
17
+ }
18
+ var ge = {};
19
+ var yr;
20
+ function ms() {
21
+ return yr || (yr = 1, process.env.NODE_ENV !== "production" && (function() {
22
+ var s = Rr, n = /* @__PURE__ */ Symbol.for("react.element"), t = /* @__PURE__ */ Symbol.for("react.portal"), i = /* @__PURE__ */ Symbol.for("react.fragment"), d = /* @__PURE__ */ Symbol.for("react.strict_mode"), o = /* @__PURE__ */ Symbol.for("react.profiler"), m = /* @__PURE__ */ Symbol.for("react.provider"), a = /* @__PURE__ */ Symbol.for("react.context"), u = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), g = /* @__PURE__ */ Symbol.for("react.suspense_list"), f = /* @__PURE__ */ Symbol.for("react.memo"), R = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.offscreen"), w = Symbol.iterator, Q = "@@iterator";
23
+ function J(r) {
24
+ if (r === null || typeof r != "object")
25
+ return null;
26
+ var l = w && r[w] || r[Q];
27
+ return typeof l == "function" ? l : null;
28
+ }
29
+ var H = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
30
+ function P(r) {
31
+ {
32
+ for (var l = arguments.length, h = new Array(l > 1 ? l - 1 : 0), p = 1; p < l; p++)
33
+ h[p - 1] = arguments[p];
34
+ le("error", r, h);
35
+ }
36
+ }
37
+ function le(r, l, h) {
38
+ {
39
+ var p = H.ReactDebugCurrentFrame, E = p.getStackAddendum();
40
+ E !== "" && (l += "%s", h = h.concat([E]));
41
+ var T = h.map(function(_) {
42
+ return String(_);
43
+ });
44
+ T.unshift("Warning: " + l), Function.prototype.apply.call(console[r], console, T);
45
+ }
46
+ }
47
+ var oe = !1, Z = !1, Re = !1, we = !1, de = !1, me;
48
+ me = /* @__PURE__ */ Symbol.for("react.module.reference");
49
+ function Le(r) {
50
+ return !!(typeof r == "string" || typeof r == "function" || r === i || r === o || de || r === d || r === x || r === g || we || r === K || oe || Z || Re || typeof r == "object" && r !== null && (r.$$typeof === R || r.$$typeof === f || r.$$typeof === m || r.$$typeof === a || r.$$typeof === u || // This needs to include all possible module reference object
51
+ // types supported by any Flight configuration anywhere since
52
+ // we don't know which Flight build this will end up being used
53
+ // with.
54
+ r.$$typeof === me || r.getModuleId !== void 0));
55
+ }
56
+ function Ie(r, l, h) {
57
+ var p = r.displayName;
58
+ if (p)
59
+ return p;
60
+ var E = l.displayName || l.name || "";
61
+ return E !== "" ? h + "(" + E + ")" : h;
62
+ }
63
+ function Ee(r) {
64
+ return r.displayName || "Context";
65
+ }
66
+ function b(r) {
67
+ if (r == null)
68
+ return null;
69
+ if (typeof r.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
70
+ return r.displayName || r.name || null;
71
+ if (typeof r == "string")
72
+ return r;
73
+ switch (r) {
74
+ case i:
75
+ return "Fragment";
76
+ case t:
77
+ return "Portal";
78
+ case o:
79
+ return "Profiler";
80
+ case d:
81
+ return "StrictMode";
82
+ case x:
83
+ return "Suspense";
84
+ case g:
85
+ return "SuspenseList";
86
+ }
87
+ if (typeof r == "object")
88
+ switch (r.$$typeof) {
89
+ case a:
90
+ var l = r;
91
+ return Ee(l) + ".Consumer";
92
+ case m:
93
+ var h = r;
94
+ return Ee(h._context) + ".Provider";
95
+ case u:
96
+ return Ie(r, r.render, "ForwardRef");
97
+ case f:
98
+ var p = r.displayName || null;
99
+ return p !== null ? p : b(r.type) || "Memo";
100
+ case R: {
101
+ var E = r, T = E._payload, _ = E._init;
102
+ try {
103
+ return b(_(T));
104
+ } catch {
105
+ return null;
106
+ }
107
+ }
108
+ }
109
+ return null;
110
+ }
111
+ var C = Object.assign, se = 0, je, Te, ne, er, rr, sr, nr;
112
+ function tr() {
113
+ }
114
+ tr.__reactDisabledLog = !0;
115
+ function Or() {
116
+ {
117
+ if (se === 0) {
118
+ je = console.log, Te = console.info, ne = console.warn, er = console.error, rr = console.group, sr = console.groupCollapsed, nr = console.groupEnd;
119
+ var r = {
120
+ configurable: !0,
121
+ enumerable: !0,
122
+ value: tr,
123
+ writable: !0
124
+ };
125
+ Object.defineProperties(console, {
126
+ info: r,
127
+ log: r,
128
+ warn: r,
129
+ error: r,
130
+ group: r,
131
+ groupCollapsed: r,
132
+ groupEnd: r
133
+ });
134
+ }
135
+ se++;
136
+ }
137
+ }
138
+ function $r() {
139
+ {
140
+ if (se--, se === 0) {
141
+ var r = {
142
+ configurable: !0,
143
+ enumerable: !0,
144
+ writable: !0
145
+ };
146
+ Object.defineProperties(console, {
147
+ log: C({}, r, {
148
+ value: je
149
+ }),
150
+ info: C({}, r, {
151
+ value: Te
152
+ }),
153
+ warn: C({}, r, {
154
+ value: ne
155
+ }),
156
+ error: C({}, r, {
157
+ value: er
158
+ }),
159
+ group: C({}, r, {
160
+ value: rr
161
+ }),
162
+ groupCollapsed: C({}, r, {
163
+ value: sr
164
+ }),
165
+ groupEnd: C({}, r, {
166
+ value: nr
167
+ })
168
+ });
169
+ }
170
+ se < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
171
+ }
172
+ }
173
+ var Ue = H.ReactCurrentDispatcher, Me;
174
+ function Ce(r, l, h) {
175
+ {
176
+ if (Me === void 0)
177
+ try {
178
+ throw Error();
179
+ } catch (E) {
180
+ var p = E.stack.trim().match(/\n( *(at )?)/);
181
+ Me = p && p[1] || "";
182
+ }
183
+ return `
184
+ ` + Me + r;
185
+ }
186
+ }
187
+ var qe = !1, Pe;
188
+ {
189
+ var Br = typeof WeakMap == "function" ? WeakMap : Map;
190
+ Pe = new Br();
191
+ }
192
+ function ar(r, l) {
193
+ if (!r || qe)
194
+ return "";
195
+ {
196
+ var h = Pe.get(r);
197
+ if (h !== void 0)
198
+ return h;
199
+ }
200
+ var p;
201
+ qe = !0;
202
+ var E = Error.prepareStackTrace;
203
+ Error.prepareStackTrace = void 0;
204
+ var T;
205
+ T = Ue.current, Ue.current = null, Or();
206
+ try {
207
+ if (l) {
208
+ var _ = function() {
209
+ throw Error();
210
+ };
211
+ if (Object.defineProperty(_.prototype, "props", {
212
+ set: function() {
213
+ throw Error();
214
+ }
215
+ }), typeof Reflect == "object" && Reflect.construct) {
216
+ try {
217
+ Reflect.construct(_, []);
218
+ } catch (M) {
219
+ p = M;
220
+ }
221
+ Reflect.construct(r, [], _);
222
+ } else {
223
+ try {
224
+ _.call();
225
+ } catch (M) {
226
+ p = M;
227
+ }
228
+ r.call(_.prototype);
229
+ }
230
+ } else {
231
+ try {
232
+ throw Error();
233
+ } catch (M) {
234
+ p = M;
235
+ }
236
+ r();
237
+ }
238
+ } catch (M) {
239
+ if (M && p && typeof M.stack == "string") {
240
+ for (var v = M.stack.split(`
241
+ `), U = p.stack.split(`
242
+ `), S = v.length - 1, A = U.length - 1; S >= 1 && A >= 0 && v[S] !== U[A]; )
243
+ A--;
244
+ for (; S >= 1 && A >= 0; S--, A--)
245
+ if (v[S] !== U[A]) {
246
+ if (S !== 1 || A !== 1)
247
+ do
248
+ if (S--, A--, A < 0 || v[S] !== U[A]) {
249
+ var Y = `
250
+ ` + v[S].replace(" at new ", " at ");
251
+ return r.displayName && Y.includes("<anonymous>") && (Y = Y.replace("<anonymous>", r.displayName)), typeof r == "function" && Pe.set(r, Y), Y;
252
+ }
253
+ while (S >= 1 && A >= 0);
254
+ break;
255
+ }
256
+ }
257
+ } finally {
258
+ qe = !1, Ue.current = T, $r(), Error.prepareStackTrace = E;
259
+ }
260
+ var he = r ? r.displayName || r.name : "", te = he ? Ce(he) : "";
261
+ return typeof r == "function" && Pe.set(r, te), te;
262
+ }
263
+ function Lr(r, l, h) {
264
+ return ar(r, !1);
265
+ }
266
+ function Ir(r) {
267
+ var l = r.prototype;
268
+ return !!(l && l.isReactComponent);
269
+ }
270
+ function Se(r, l, h) {
271
+ if (r == null)
272
+ return "";
273
+ if (typeof r == "function")
274
+ return ar(r, Ir(r));
275
+ if (typeof r == "string")
276
+ return Ce(r);
277
+ switch (r) {
278
+ case x:
279
+ return Ce("Suspense");
280
+ case g:
281
+ return Ce("SuspenseList");
282
+ }
283
+ if (typeof r == "object")
284
+ switch (r.$$typeof) {
285
+ case u:
286
+ return Lr(r.render);
287
+ case f:
288
+ return Se(r.type, l, h);
289
+ case R: {
290
+ var p = r, E = p._payload, T = p._init;
291
+ try {
292
+ return Se(T(E), l, h);
293
+ } catch {
294
+ }
295
+ }
296
+ }
297
+ return "";
298
+ }
299
+ var fe = Object.prototype.hasOwnProperty, ir = {}, cr = H.ReactDebugCurrentFrame;
300
+ function De(r) {
301
+ if (r) {
302
+ var l = r._owner, h = Se(r.type, r._source, l ? l.type : null);
303
+ cr.setExtraStackFrame(h);
304
+ } else
305
+ cr.setExtraStackFrame(null);
306
+ }
307
+ function Ur(r, l, h, p, E) {
308
+ {
309
+ var T = Function.call.bind(fe);
310
+ for (var _ in r)
311
+ if (T(r, _)) {
312
+ var v = void 0;
313
+ try {
314
+ if (typeof r[_] != "function") {
315
+ var U = Error((p || "React class") + ": " + h + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
316
+ throw U.name = "Invariant Violation", U;
317
+ }
318
+ v = r[_](l, _, p, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
319
+ } catch (S) {
320
+ v = S;
321
+ }
322
+ v && !(v instanceof Error) && (De(E), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", h, _, typeof v), De(null)), v instanceof Error && !(v.message in ir) && (ir[v.message] = !0, De(E), P("Failed %s type: %s", h, v.message), De(null));
323
+ }
324
+ }
325
+ }
326
+ var Mr = Array.isArray;
327
+ function Ge(r) {
328
+ return Mr(r);
329
+ }
330
+ function qr(r) {
331
+ {
332
+ var l = typeof Symbol == "function" && Symbol.toStringTag, h = l && r[Symbol.toStringTag] || r.constructor.name || "Object";
333
+ return h;
334
+ }
335
+ }
336
+ function Gr(r) {
337
+ try {
338
+ return lr(r), !1;
339
+ } catch {
340
+ return !0;
341
+ }
342
+ }
343
+ function lr(r) {
344
+ return "" + r;
345
+ }
346
+ function or(r) {
347
+ if (Gr(r))
348
+ return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qr(r)), lr(r);
349
+ }
350
+ var dr = H.ReactCurrentOwner, Vr = {
351
+ key: !0,
352
+ ref: !0,
353
+ __self: !0,
354
+ __source: !0
355
+ }, ur, hr;
356
+ function Wr(r) {
357
+ if (fe.call(r, "ref")) {
358
+ var l = Object.getOwnPropertyDescriptor(r, "ref").get;
359
+ if (l && l.isReactWarning)
360
+ return !1;
361
+ }
362
+ return r.ref !== void 0;
363
+ }
364
+ function Yr(r) {
365
+ if (fe.call(r, "key")) {
366
+ var l = Object.getOwnPropertyDescriptor(r, "key").get;
367
+ if (l && l.isReactWarning)
368
+ return !1;
369
+ }
370
+ return r.key !== void 0;
371
+ }
372
+ function zr(r, l) {
373
+ typeof r.ref == "string" && dr.current;
374
+ }
375
+ function Kr(r, l) {
376
+ {
377
+ var h = function() {
378
+ ur || (ur = !0, P("%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://reactjs.org/link/special-props)", l));
379
+ };
380
+ h.isReactWarning = !0, Object.defineProperty(r, "key", {
381
+ get: h,
382
+ configurable: !0
383
+ });
384
+ }
385
+ }
386
+ function Jr(r, l) {
387
+ {
388
+ var h = function() {
389
+ hr || (hr = !0, P("%s: `ref` 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://reactjs.org/link/special-props)", l));
390
+ };
391
+ h.isReactWarning = !0, Object.defineProperty(r, "ref", {
392
+ get: h,
393
+ configurable: !0
394
+ });
395
+ }
396
+ }
397
+ var Hr = function(r, l, h, p, E, T, _) {
398
+ var v = {
399
+ // This tag allows us to uniquely identify this as a React Element
400
+ $$typeof: n,
401
+ // Built-in properties that belong on the element
402
+ type: r,
403
+ key: l,
404
+ ref: h,
405
+ props: _,
406
+ // Record the component responsible for creating this element.
407
+ _owner: T
408
+ };
409
+ return v._store = {}, Object.defineProperty(v._store, "validated", {
410
+ configurable: !1,
411
+ enumerable: !1,
412
+ writable: !0,
413
+ value: !1
414
+ }), Object.defineProperty(v, "_self", {
415
+ configurable: !1,
416
+ enumerable: !1,
417
+ writable: !1,
418
+ value: p
419
+ }), Object.defineProperty(v, "_source", {
420
+ configurable: !1,
421
+ enumerable: !1,
422
+ writable: !1,
423
+ value: E
424
+ }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
425
+ };
426
+ function Xr(r, l, h, p, E) {
427
+ {
428
+ var T, _ = {}, v = null, U = null;
429
+ h !== void 0 && (or(h), v = "" + h), Yr(l) && (or(l.key), v = "" + l.key), Wr(l) && (U = l.ref, zr(l, E));
430
+ for (T in l)
431
+ fe.call(l, T) && !Vr.hasOwnProperty(T) && (_[T] = l[T]);
432
+ if (r && r.defaultProps) {
433
+ var S = r.defaultProps;
434
+ for (T in S)
435
+ _[T] === void 0 && (_[T] = S[T]);
436
+ }
437
+ if (v || U) {
438
+ var A = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
439
+ v && Kr(_, A), U && Jr(_, A);
440
+ }
441
+ return Hr(r, v, U, E, p, dr.current, _);
442
+ }
443
+ }
444
+ var Ve = H.ReactCurrentOwner, xr = H.ReactDebugCurrentFrame;
445
+ function ue(r) {
446
+ if (r) {
447
+ var l = r._owner, h = Se(r.type, r._source, l ? l.type : null);
448
+ xr.setExtraStackFrame(h);
449
+ } else
450
+ xr.setExtraStackFrame(null);
451
+ }
452
+ var We;
453
+ We = !1;
454
+ function Ye(r) {
455
+ return typeof r == "object" && r !== null && r.$$typeof === n;
456
+ }
457
+ function mr() {
458
+ {
459
+ if (Ve.current) {
460
+ var r = b(Ve.current.type);
461
+ if (r)
462
+ return `
463
+
464
+ Check the render method of \`` + r + "`.";
465
+ }
466
+ return "";
467
+ }
468
+ }
469
+ function Qr(r) {
470
+ return "";
471
+ }
472
+ var jr = {};
473
+ function Zr(r) {
474
+ {
475
+ var l = mr();
476
+ if (!l) {
477
+ var h = typeof r == "string" ? r : r.displayName || r.name;
478
+ h && (l = `
479
+
480
+ Check the top-level render call using <` + h + ">.");
481
+ }
482
+ return l;
483
+ }
484
+ }
485
+ function fr(r, l) {
486
+ {
487
+ if (!r._store || r._store.validated || r.key != null)
488
+ return;
489
+ r._store.validated = !0;
490
+ var h = Zr(l);
491
+ if (jr[h])
492
+ return;
493
+ jr[h] = !0;
494
+ var p = "";
495
+ r && r._owner && r._owner !== Ve.current && (p = " It was passed a child from " + b(r._owner.type) + "."), ue(r), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', h, p), ue(null);
496
+ }
497
+ }
498
+ function pr(r, l) {
499
+ {
500
+ if (typeof r != "object")
501
+ return;
502
+ if (Ge(r))
503
+ for (var h = 0; h < r.length; h++) {
504
+ var p = r[h];
505
+ Ye(p) && fr(p, l);
506
+ }
507
+ else if (Ye(r))
508
+ r._store && (r._store.validated = !0);
509
+ else if (r) {
510
+ var E = J(r);
511
+ if (typeof E == "function" && E !== r.entries)
512
+ for (var T = E.call(r), _; !(_ = T.next()).done; )
513
+ Ye(_.value) && fr(_.value, l);
514
+ }
515
+ }
516
+ }
517
+ function es(r) {
518
+ {
519
+ var l = r.type;
520
+ if (l == null || typeof l == "string")
521
+ return;
522
+ var h;
523
+ if (typeof l == "function")
524
+ h = l.propTypes;
525
+ else if (typeof l == "object" && (l.$$typeof === u || // Note: Memo only checks outer props here.
526
+ // Inner props are checked in the reconciler.
527
+ l.$$typeof === f))
528
+ h = l.propTypes;
529
+ else
530
+ return;
531
+ if (h) {
532
+ var p = b(l);
533
+ Ur(h, r.props, "prop", p, r);
534
+ } else if (l.PropTypes !== void 0 && !We) {
535
+ We = !0;
536
+ var E = b(l);
537
+ P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
538
+ }
539
+ typeof l.getDefaultProps == "function" && !l.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
540
+ }
541
+ }
542
+ function rs(r) {
543
+ {
544
+ for (var l = Object.keys(r.props), h = 0; h < l.length; h++) {
545
+ var p = l[h];
546
+ if (p !== "children" && p !== "key") {
547
+ ue(r), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), ue(null);
548
+ break;
549
+ }
550
+ }
551
+ r.ref !== null && (ue(r), P("Invalid attribute `ref` supplied to `React.Fragment`."), ue(null));
552
+ }
553
+ }
554
+ var gr = {};
555
+ function vr(r, l, h, p, E, T) {
556
+ {
557
+ var _ = Le(r);
558
+ if (!_) {
559
+ var v = "";
560
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
561
+ var U = Qr();
562
+ U ? v += U : v += mr();
563
+ var S;
564
+ r === null ? S = "null" : Ge(r) ? S = "array" : r !== void 0 && r.$$typeof === n ? (S = "<" + (b(r.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : S = typeof r, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, v);
565
+ }
566
+ var A = Xr(r, l, h, E, T);
567
+ if (A == null)
568
+ return A;
569
+ if (_) {
570
+ var Y = l.children;
571
+ if (Y !== void 0)
572
+ if (p)
573
+ if (Ge(Y)) {
574
+ for (var he = 0; he < Y.length; he++)
575
+ pr(Y[he], r);
576
+ Object.freeze && Object.freeze(Y);
577
+ } else
578
+ P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
579
+ else
580
+ pr(Y, r);
581
+ }
582
+ if (fe.call(l, "key")) {
583
+ var te = b(r), M = Object.keys(l).filter(function(cs) {
584
+ return cs !== "key";
585
+ }), ze = M.length > 0 ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}";
586
+ if (!gr[te + ze]) {
587
+ var is = M.length > 0 ? "{" + M.join(": ..., ") + ": ...}" : "{}";
588
+ P(`A props object containing a "key" prop is being spread into JSX:
589
+ let props = %s;
590
+ <%s {...props} />
591
+ React keys must be passed directly to JSX without using spread:
592
+ let props = %s;
593
+ <%s key={someKey} {...props} />`, ze, te, is, te), gr[te + ze] = !0;
594
+ }
595
+ }
596
+ return r === i ? rs(A) : es(A), A;
597
+ }
598
+ }
599
+ function ss(r, l, h) {
600
+ return vr(r, l, h, !0);
601
+ }
602
+ function ns(r, l, h) {
603
+ return vr(r, l, h, !1);
604
+ }
605
+ var ts = ns, as = ss;
606
+ ge.Fragment = i, ge.jsx = ts, ge.jsxs = as;
607
+ })()), ge;
608
+ }
609
+ var _r;
610
+ function js() {
611
+ return _r || (_r = 1, process.env.NODE_ENV === "production" ? ke.exports = xs() : ke.exports = ms()), ke.exports;
612
+ }
613
+ var e = js();
614
+ class Ne extends Error {
615
+ constructor(n, t) {
616
+ super(t), this.status = n, this.name = "ApiError";
617
+ }
618
+ }
619
+ class fs {
620
+ baseUrl;
621
+ headers;
622
+ constructor(n = {}) {
623
+ this.baseUrl = n.baseUrl ?? "", this.headers = {
624
+ "Content-Type": "application/json",
625
+ ...n.headers
626
+ };
627
+ }
628
+ async request(n, t, i = {}) {
629
+ let d = `${this.baseUrl}${t}`;
630
+ if (i.params) {
631
+ const m = new URLSearchParams();
632
+ Object.entries(i.params).forEach(([u, x]) => {
633
+ x != null && x !== "" && m.set(u, String(x));
634
+ });
635
+ const a = m.toString();
636
+ a && (d += `?${a}`);
637
+ }
638
+ const o = await fetch(d, {
639
+ method: n,
640
+ headers: this.headers,
641
+ body: i.body ? JSON.stringify(i.body) : void 0
642
+ });
643
+ if (!o.ok) {
644
+ const m = await o.json().catch(() => ({ detail: "Unknown error" }));
645
+ throw new Ne(o.status, m.detail || o.statusText);
646
+ }
647
+ if (!(o.status === 204 || o.headers.get("content-length") === "0"))
648
+ return o.json();
649
+ }
650
+ async getCapabilities() {
651
+ return this.request("GET", "/api/v1/capabilities");
652
+ }
653
+ async listRuns(n) {
654
+ return this.request("GET", "/api/runs", { params: n });
655
+ }
656
+ async getRun(n) {
657
+ return this.request("GET", `/api/runs/${n}`);
658
+ }
659
+ async deleteRun(n) {
660
+ await this.request("DELETE", `/api/runs/${n}`);
661
+ }
662
+ async setBaseline(n, t) {
663
+ return this.request("POST", `/api/projects/${n}/baseline/${t}`, {
664
+ params: { redirect: "false" }
665
+ });
666
+ }
667
+ async listProjects(n) {
668
+ return this.request("GET", "/api/projects", { params: n });
669
+ }
670
+ async listGroups(n) {
671
+ return this.request("GET", "/api/groups", { params: n });
672
+ }
673
+ async getGroup(n) {
674
+ return this.request("GET", `/api/groups/${n}`);
675
+ }
676
+ async getDiff(n, t) {
677
+ return this.request("GET", "/api/diff", {
678
+ params: { a: n, b: t }
679
+ });
680
+ }
681
+ async getArtifact(n, t) {
682
+ return this.request("GET", `/api/runs/${n}/artifacts/${t}`);
683
+ }
684
+ getArtifactDownloadUrl(n, t) {
685
+ return `${this.baseUrl}/api/runs/${n}/artifacts/${t}/raw`;
686
+ }
687
+ }
688
+ const ps = new fs(), Tr = Er(null);
689
+ function gs({
690
+ children: s,
691
+ api: n = ps,
692
+ initialWorkspace: t = null
693
+ }) {
694
+ const [i, d] = O(null), [o, m] = O(t);
695
+ return xe(() => {
696
+ n.getCapabilities().then(d).catch(console.error);
697
+ }, [n]), /* @__PURE__ */ e.jsx(Tr.Provider, { value: { api: n, capabilities: i, currentWorkspace: o, setCurrentWorkspace: m }, children: s });
698
+ }
699
+ function W() {
700
+ const s = wr(Tr);
701
+ if (!s) throw new Error("useApp must be used within AppProvider");
702
+ return s;
703
+ }
704
+ function ie(s, n = []) {
705
+ const [t, i] = O({
706
+ data: null,
707
+ loading: !0,
708
+ error: null
709
+ }), d = br(!0), o = br(s);
710
+ o.current = s;
711
+ const m = be(async () => {
712
+ i((a) => ({ ...a, loading: !0, error: null }));
713
+ try {
714
+ const a = await o.current();
715
+ d.current && i({ data: a, loading: !1, error: null });
716
+ } catch (a) {
717
+ d.current && i({
718
+ data: null,
719
+ loading: !1,
720
+ error: a instanceof Ne ? a : new Ne(500, String(a))
721
+ });
722
+ }
723
+ }, []);
724
+ return xe(() => (d.current = !0, m(), () => {
725
+ d.current = !1;
726
+ }), n), { ...t, refetch: m };
727
+ }
728
+ function Cr(s) {
729
+ const { api: n, currentWorkspace: t } = W();
730
+ return ie(
731
+ () => n.listRuns({ ...s, workspace: t?.id }),
732
+ [n, t?.id, s?.project, s?.status, s?.q, s?.limit]
733
+ );
734
+ }
735
+ function Pr(s) {
736
+ const { api: n } = W();
737
+ return ie(
738
+ async () => {
739
+ const { run: t } = await n.getRun(s);
740
+ return t;
741
+ },
742
+ [n, s]
743
+ );
744
+ }
745
+ function $e() {
746
+ const { api: s, currentWorkspace: n } = W();
747
+ return ie(
748
+ async () => {
749
+ const { projects: t } = await s.listProjects({ workspace: n?.id });
750
+ return t;
751
+ },
752
+ [s, n?.id]
753
+ );
754
+ }
755
+ function vs(s) {
756
+ const { api: n, currentWorkspace: t } = W();
757
+ return ie(
758
+ async () => {
759
+ const { groups: i } = await n.listGroups({ ...s, workspace: t?.id });
760
+ return i;
761
+ },
762
+ [n, t?.id, s?.project]
763
+ );
764
+ }
765
+ function bs(s) {
766
+ const { api: n } = W();
767
+ return ie(
768
+ () => n.getGroup(s),
769
+ [n, s]
770
+ );
771
+ }
772
+ function Ns(s, n) {
773
+ const { api: t } = W();
774
+ return ie(
775
+ () => t.getDiff(s, n),
776
+ [t, s, n]
777
+ );
778
+ }
779
+ function ys(s, n) {
780
+ const { api: t } = W();
781
+ return ie(
782
+ () => t.getArtifact(s, n),
783
+ [t, s, n]
784
+ );
785
+ }
786
+ function ye(s) {
787
+ const [n, t] = O(!1), [i, d] = O(null);
788
+ return { mutate: be(async (...m) => {
789
+ t(!0), d(null);
790
+ try {
791
+ return await s(...m);
792
+ } catch (a) {
793
+ const u = a instanceof Ne ? a : new Ne(500, String(a));
794
+ throw d(u), u;
795
+ } finally {
796
+ t(!1);
797
+ }
798
+ }, [s]), loading: n, error: i };
799
+ }
800
+ function z(s) {
801
+ return s?.slice(0, 8) ?? "";
802
+ }
803
+ function Ke(s) {
804
+ return s?.slice(0, 12) ?? "N/A";
805
+ }
806
+ function Fe(s) {
807
+ const n = new Date(s), i = Math.floor(((/* @__PURE__ */ new Date()).getTime() - n.getTime()) / 1e3);
808
+ if (i < 60) return "just now";
809
+ if (i < 3600) {
810
+ const o = Math.floor(i / 60);
811
+ return `${o} minute${o !== 1 ? "s" : ""} ago`;
812
+ }
813
+ if (i < 86400) {
814
+ const o = Math.floor(i / 3600);
815
+ return `${o} hour${o !== 1 ? "s" : ""} ago`;
816
+ }
817
+ if (i < 2592e3) {
818
+ const o = Math.floor(i / 86400);
819
+ return `${o} day${o !== 1 ? "s" : ""} ago`;
820
+ }
821
+ if (i < 31536e3) {
822
+ const o = Math.floor(i / 2592e3);
823
+ return `${o} month${o !== 1 ? "s" : ""} ago`;
824
+ }
825
+ const d = Math.floor(i / 31536e3);
826
+ return `${d} year${d !== 1 ? "s" : ""} ago`;
827
+ }
828
+ function _s(s, n = 6) {
829
+ return typeof s != "number" || isNaN(s) ? String(s) : Number(s.toPrecision(n)).toString();
830
+ }
831
+ function Ae(s) {
832
+ return s < 1024 ? `${s} bytes` : s < 1048576 ? `${(s / 1024).toFixed(1)} KB` : `${(s / 1048576).toFixed(1)} MB`;
833
+ }
834
+ function Rs(s) {
835
+ return JSON.stringify(s, null, 2);
836
+ }
837
+ function ws(s, n = 60) {
838
+ return s ? s.length <= n ? s : s.slice(0, n - 3) + "..." : "";
839
+ }
840
+ function Vs(s, n) {
841
+ const t = new URLSearchParams();
842
+ Object.entries(n).forEach(([d, o]) => {
843
+ o != null && o !== "" && t.set(d, String(o));
844
+ });
845
+ const i = t.toString();
846
+ return i ? `${s}?${i}` : s;
847
+ }
848
+ function $(...s) {
849
+ return s.filter(Boolean).join(" ");
850
+ }
851
+ const Es = [
852
+ { href: "/runs", label: "Runs", matchPaths: ["/runs"] },
853
+ { href: "/projects", label: "Projects", matchPaths: ["/projects"] },
854
+ { href: "/groups", label: "Groups", matchPaths: ["/groups"] },
855
+ { href: "/diff", label: "Compare", matchPaths: ["/diff"] },
856
+ { href: "/search", label: "Search", matchPaths: ["/search"] }
857
+ ], Sr = Er(null);
858
+ function Ws({
859
+ config: s,
860
+ children: n
861
+ }) {
862
+ return /* @__PURE__ */ e.jsx(Sr.Provider, { value: s, children: n });
863
+ }
864
+ function Ts() {
865
+ return wr(Sr);
866
+ }
867
+ function G({ children: s, config: n }) {
868
+ const t = ls(), d = { ...Ts(), ...n }, o = d?.navLinks ?? Es, m = [
869
+ ...d?.prependNavLinks ?? [],
870
+ ...o,
871
+ ...d?.appendNavLinks ?? []
872
+ ], a = d?.logo ?? { text: "devqubit", icon: "⚛" }, u = (x) => x.matchPaths ? x.matchPaths.some((g) => t.pathname.startsWith(g)) : t.pathname === x.href;
873
+ return /* @__PURE__ */ e.jsxs("div", { className: "min-h-screen bg-gray-50", children: [
874
+ /* @__PURE__ */ e.jsx("header", { className: "bg-gray-900 h-14 sticky top-0 z-50 border-b border-gray-800", children: /* @__PURE__ */ e.jsxs("div", { className: "max-w-container mx-auto px-6 h-full flex items-center justify-between", children: [
875
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-8", children: [
876
+ /* @__PURE__ */ e.jsxs(q, { to: "/", className: "text-lg font-semibold text-primary hover:text-primary-light flex items-center gap-2 transition-colors hover:no-underline", children: [
877
+ a.icon && /* @__PURE__ */ e.jsx("span", { className: "text-xl", children: a.icon }),
878
+ a.text
879
+ ] }),
880
+ /* @__PURE__ */ e.jsx("nav", { className: "flex gap-1", children: m.map((x) => /* @__PURE__ */ e.jsx(
881
+ q,
882
+ {
883
+ to: x.href,
884
+ className: $(
885
+ "px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-150 hover:no-underline",
886
+ u(x) ? "text-white bg-white/10" : "text-gray-400 hover:text-white hover:bg-white/5"
887
+ ),
888
+ children: x.label
889
+ },
890
+ x.href
891
+ )) })
892
+ ] }),
893
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-4", children: d?.headerRight })
894
+ ] }) }),
895
+ /* @__PURE__ */ e.jsx("main", { className: "max-w-container mx-auto p-6 fade-in", children: s })
896
+ ] });
897
+ }
898
+ function _e({ title: s, subtitle: n, actions: t }) {
899
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between mb-6 gap-4 flex-wrap", children: [
900
+ /* @__PURE__ */ e.jsxs("div", { children: [
901
+ /* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-semibold text-gray-900 flex items-center gap-2 flex-wrap", children: s }),
902
+ n && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted mt-1", children: n })
903
+ ] }),
904
+ t && /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: t })
905
+ ] });
906
+ }
907
+ function B({ variant: s = "gray", className: n, children: t, ...i }) {
908
+ return /* @__PURE__ */ e.jsx("span", { className: $("badge", `badge-${s}`, n), ...i, children: t });
909
+ }
910
+ const F = He(
911
+ ({ variant: s = "secondary", size: n = "default", loading: t, className: i, children: d, disabled: o, ...m }, a) => /* @__PURE__ */ e.jsxs(
912
+ "button",
913
+ {
914
+ ref: a,
915
+ className: $(
916
+ "btn",
917
+ s === "ghost-danger" ? "btn-ghost-danger" : `btn-${s}`,
918
+ n === "sm" && "btn-sm",
919
+ i
920
+ ),
921
+ disabled: o || t,
922
+ ...m,
923
+ children: [
924
+ t && /* @__PURE__ */ e.jsx(V, {}),
925
+ d
926
+ ]
927
+ }
928
+ )
929
+ );
930
+ F.displayName = "Button";
931
+ function N({ className: s, children: n, ...t }) {
932
+ return /* @__PURE__ */ e.jsx("div", { className: $("card", s), ...t, children: n });
933
+ }
934
+ function D({ className: s, children: n, ...t }) {
935
+ return /* @__PURE__ */ e.jsx("div", { className: $("card-header", s), ...t, children: n });
936
+ }
937
+ function k({ className: s, children: n, ...t }) {
938
+ return /* @__PURE__ */ e.jsx("h3", { className: $("card-title", s), ...t, children: n });
939
+ }
940
+ function Ys({ variant: s = "info", className: n, children: t, ...i }) {
941
+ return /* @__PURE__ */ e.jsx("div", { className: $("alert", `alert-${s}`, n), ...i, children: t });
942
+ }
943
+ function V({ className: s, ...n }) {
944
+ return /* @__PURE__ */ e.jsx("span", { className: $("spinner", s), ...n });
945
+ }
946
+ function ce({ message: s, hint: n, className: t, ...i }) {
947
+ return /* @__PURE__ */ e.jsxs("div", { className: $("empty-state", t), ...i, children: [
948
+ /* @__PURE__ */ e.jsx("p", { children: s }),
949
+ n && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted mt-2", children: n })
950
+ ] });
951
+ }
952
+ function Je({ items: s, className: n, ...t }) {
953
+ return /* @__PURE__ */ e.jsx("dl", { className: $("kv-list", n), ...t, children: s.map(({ label: i, value: d }) => /* @__PURE__ */ e.jsxs("div", { className: "contents", children: [
954
+ /* @__PURE__ */ e.jsx("dt", { children: i }),
955
+ /* @__PURE__ */ e.jsx("dd", { children: d })
956
+ ] }, i)) });
957
+ }
958
+ function Dr({ open: s, onClose: n, title: t, children: i, actions: d }) {
959
+ return s ? /* @__PURE__ */ e.jsx(
960
+ "div",
961
+ {
962
+ className: $("modal-backdrop", s && "active"),
963
+ onClick: (o) => o.target === o.currentTarget && n(),
964
+ children: /* @__PURE__ */ e.jsxs("div", { className: "modal", onClick: (o) => o.stopPropagation(), children: [
965
+ /* @__PURE__ */ e.jsx("h3", { className: "modal-title", children: t }),
966
+ /* @__PURE__ */ e.jsx("div", { className: "modal-body", children: i }),
967
+ d && /* @__PURE__ */ e.jsx("div", { className: "modal-actions", children: d })
968
+ ] })
969
+ }
970
+ ) : null;
971
+ }
972
+ function Be({ message: s, variant: n = "info", visible: t, onClose: i }) {
973
+ if (!t) return null;
974
+ const d = {
975
+ success: "✓",
976
+ error: "✕",
977
+ info: "i"
978
+ }[n], o = {
979
+ success: "text-[#059669]",
980
+ error: "text-[#DC4A4A]",
981
+ info: "text-[#2563EB]"
982
+ }[n];
983
+ return /* @__PURE__ */ e.jsxs("div", { className: "toast", onClick: i, children: [
984
+ /* @__PURE__ */ e.jsx("span", { className: $("mr-2 font-bold", o), children: d }),
985
+ s
986
+ ] });
987
+ }
988
+ function X({ children: s, className: n }) {
989
+ return /* @__PURE__ */ e.jsx("div", { className: $("form-group", n), children: s });
990
+ }
991
+ function re({ className: s, children: n, ...t }) {
992
+ return /* @__PURE__ */ e.jsx("label", { className: $("form-label", s), ...t, children: n });
993
+ }
994
+ const Qe = He(
995
+ ({ className: s, ...n }, t) => /* @__PURE__ */ e.jsx("input", { ref: t, className: $("form-input", s), ...n })
996
+ );
997
+ Qe.displayName = "Input";
998
+ const ae = He(
999
+ ({ className: s, children: n, ...t }, i) => /* @__PURE__ */ e.jsx("select", { ref: i, className: $("form-input", s), ...t, children: n })
1000
+ );
1001
+ ae.displayName = "Select";
1002
+ function kr({ children: s, className: n }) {
1003
+ return /* @__PURE__ */ e.jsx("div", { className: $("form-row", n), children: s });
1004
+ }
1005
+ function L({ className: s, children: n, ...t }) {
1006
+ return /* @__PURE__ */ e.jsx("table", { className: $("table", s), ...t, children: n });
1007
+ }
1008
+ function ee({ className: s, children: n, ...t }) {
1009
+ return /* @__PURE__ */ e.jsx("thead", { className: s, ...t, children: n });
1010
+ }
1011
+ function I({ className: s, children: n, ...t }) {
1012
+ return /* @__PURE__ */ e.jsx("tbody", { className: s, ...t, children: n });
1013
+ }
1014
+ function j({ className: s, children: n, ...t }) {
1015
+ return /* @__PURE__ */ e.jsx("tr", { className: s, ...t, children: n });
1016
+ }
1017
+ function y({ className: s, children: n, ...t }) {
1018
+ return /* @__PURE__ */ e.jsx("th", { className: s, ...t, children: n });
1019
+ }
1020
+ function c({ className: s, children: n, ...t }) {
1021
+ return /* @__PURE__ */ e.jsx("td", { className: s, ...t, children: n });
1022
+ }
1023
+ function Ar({ status: s }) {
1024
+ const n = {
1025
+ FINISHED: "success",
1026
+ FAILED: "danger",
1027
+ RUNNING: "warning",
1028
+ UNKNOWN: "gray"
1029
+ }[s];
1030
+ return /* @__PURE__ */ e.jsx(B, { variant: n, children: s });
1031
+ }
1032
+ function Ze({ runs: s, onDelete: n, loading: t, emptyHint: i, baselineRunId: d }) {
1033
+ const [o, m] = O(null), a = () => {
1034
+ o && n && (n(o.run_id), m(null));
1035
+ };
1036
+ return s.length ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1037
+ /* @__PURE__ */ e.jsxs(L, { children: [
1038
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1039
+ /* @__PURE__ */ e.jsx(y, { children: "Run ID" }),
1040
+ /* @__PURE__ */ e.jsx(y, { children: "Name" }),
1041
+ /* @__PURE__ */ e.jsx(y, { children: "Project" }),
1042
+ /* @__PURE__ */ e.jsx(y, { children: "Status" }),
1043
+ /* @__PURE__ */ e.jsx(y, { children: "Created" }),
1044
+ /* @__PURE__ */ e.jsx(y, { children: "Actions" })
1045
+ ] }) }),
1046
+ /* @__PURE__ */ e.jsx(I, { children: s.map((u) => /* @__PURE__ */ e.jsxs(j, { children: [
1047
+ /* @__PURE__ */ e.jsxs(c, { children: [
1048
+ /* @__PURE__ */ e.jsx(q, { to: `/runs/${u.run_id}`, className: "font-mono", children: z(u.run_id) }),
1049
+ u.run_id === d && /* @__PURE__ */ e.jsx(B, { variant: "info", className: "ml-2", children: "Baseline" })
1050
+ ] }),
1051
+ /* @__PURE__ */ e.jsx(c, { children: u.run_name || "—" }),
1052
+ /* @__PURE__ */ e.jsx(c, { children: u.project }),
1053
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(Ar, { status: u.status }) }),
1054
+ /* @__PURE__ */ e.jsx(c, { className: "text-muted", children: Fe(u.created_at) }),
1055
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
1056
+ /* @__PURE__ */ e.jsx(q, { to: `/runs/${u.run_id}`, children: /* @__PURE__ */ e.jsx(F, { variant: "secondary", size: "sm", children: "View" }) }),
1057
+ n && /* @__PURE__ */ e.jsx(
1058
+ F,
1059
+ {
1060
+ variant: "ghost-danger",
1061
+ size: "sm",
1062
+ onClick: () => m(u),
1063
+ disabled: t,
1064
+ children: "Delete"
1065
+ }
1066
+ )
1067
+ ] }) })
1068
+ ] }, u.run_id)) })
1069
+ ] }),
1070
+ /* @__PURE__ */ e.jsxs(
1071
+ Dr,
1072
+ {
1073
+ open: !!o,
1074
+ onClose: () => m(null),
1075
+ title: "Delete Run",
1076
+ actions: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1077
+ /* @__PURE__ */ e.jsx(F, { variant: "secondary", onClick: () => m(null), children: "Cancel" }),
1078
+ /* @__PURE__ */ e.jsxs(F, { variant: "danger", onClick: a, disabled: t, children: [
1079
+ t && /* @__PURE__ */ e.jsx(V, {}),
1080
+ "Delete"
1081
+ ] })
1082
+ ] }),
1083
+ children: [
1084
+ /* @__PURE__ */ e.jsx("p", { children: "Are you sure you want to delete this run?" }),
1085
+ o && /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm mt-2", children: z(o.run_id) }),
1086
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-danger mt-2", children: "This action cannot be undone." })
1087
+ ]
1088
+ }
1089
+ )
1090
+ ] }) : /* @__PURE__ */ e.jsx(
1091
+ ce,
1092
+ {
1093
+ message: "No runs found",
1094
+ hint: i ?? "Try adjusting your filters"
1095
+ }
1096
+ );
1097
+ }
1098
+ function Cs() {
1099
+ const [s, n] = Oe(), { api: t } = W(), { data: i } = $e(), [d, o] = O(null), [m, a] = O({
1100
+ project: s.get("project") || "",
1101
+ status: s.get("status") || "",
1102
+ q: s.get("q") || "",
1103
+ limit: parseInt(s.get("limit") || "25", 10)
1104
+ }), { data: u, loading: x, refetch: g } = Cr(m), f = ye((w) => t.deleteRun(w));
1105
+ xe(() => {
1106
+ if (d) {
1107
+ const w = setTimeout(() => o(null), 3e3);
1108
+ return () => clearTimeout(w);
1109
+ }
1110
+ }, [d]);
1111
+ const R = be((w, Q) => {
1112
+ a((H) => ({ ...H, [w]: Q }));
1113
+ const J = new URLSearchParams(s);
1114
+ Q ? J.set(w, String(Q)) : J.delete(w), n(J, { replace: !0 });
1115
+ }, [s, n]), K = be(async (w) => {
1116
+ try {
1117
+ await f.mutate(w), o({ message: "Run deleted", variant: "success" }), g();
1118
+ } catch {
1119
+ o({ message: "Failed to delete run", variant: "error" });
1120
+ }
1121
+ }, [f, g]);
1122
+ return /* @__PURE__ */ e.jsxs(G, { children: [
1123
+ /* @__PURE__ */ e.jsx(_e, { title: "Runs" }),
1124
+ /* @__PURE__ */ e.jsx(N, { className: "mb-4", children: /* @__PURE__ */ e.jsxs(kr, { children: [
1125
+ /* @__PURE__ */ e.jsxs(X, { children: [
1126
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "project", children: "Project" }),
1127
+ /* @__PURE__ */ e.jsxs(
1128
+ ae,
1129
+ {
1130
+ id: "project",
1131
+ value: m.project,
1132
+ onChange: (w) => R("project", w.target.value),
1133
+ children: [
1134
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "All projects" }),
1135
+ i?.map((w) => /* @__PURE__ */ e.jsx("option", { value: w.name, children: w.name }, w.name))
1136
+ ]
1137
+ }
1138
+ )
1139
+ ] }),
1140
+ /* @__PURE__ */ e.jsxs(X, { children: [
1141
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "status", children: "Status" }),
1142
+ /* @__PURE__ */ e.jsxs(
1143
+ ae,
1144
+ {
1145
+ id: "status",
1146
+ value: m.status,
1147
+ onChange: (w) => R("status", w.target.value),
1148
+ children: [
1149
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "All" }),
1150
+ /* @__PURE__ */ e.jsx("option", { value: "FINISHED", children: "Finished" }),
1151
+ /* @__PURE__ */ e.jsx("option", { value: "FAILED", children: "Failed" }),
1152
+ /* @__PURE__ */ e.jsx("option", { value: "RUNNING", children: "Running" })
1153
+ ]
1154
+ }
1155
+ )
1156
+ ] }),
1157
+ /* @__PURE__ */ e.jsxs(X, { children: [
1158
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "q", children: "Query" }),
1159
+ /* @__PURE__ */ e.jsx(
1160
+ Qe,
1161
+ {
1162
+ id: "q",
1163
+ value: m.q,
1164
+ onChange: (w) => R("q", w.target.value),
1165
+ placeholder: "metric.fidelity > 0.9"
1166
+ }
1167
+ )
1168
+ ] }),
1169
+ /* @__PURE__ */ e.jsxs(X, { children: [
1170
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "limit", children: "Limit" }),
1171
+ /* @__PURE__ */ e.jsxs(
1172
+ ae,
1173
+ {
1174
+ id: "limit",
1175
+ value: m.limit,
1176
+ onChange: (w) => R("limit", parseInt(w.target.value, 10)),
1177
+ children: [
1178
+ /* @__PURE__ */ e.jsx("option", { value: "25", children: "25" }),
1179
+ /* @__PURE__ */ e.jsx("option", { value: "50", children: "50" }),
1180
+ /* @__PURE__ */ e.jsx("option", { value: "100", children: "100" })
1181
+ ]
1182
+ }
1183
+ )
1184
+ ] }),
1185
+ /* @__PURE__ */ e.jsxs(X, { className: "flex items-end gap-2", children: [
1186
+ /* @__PURE__ */ e.jsx(F, { variant: "primary", onClick: () => g(), children: "Filter" }),
1187
+ x && /* @__PURE__ */ e.jsx(V, {})
1188
+ ] })
1189
+ ] }) }),
1190
+ /* @__PURE__ */ e.jsx(N, { children: x && !u ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e.jsx(V, {}) }) : /* @__PURE__ */ e.jsx(
1191
+ Ze,
1192
+ {
1193
+ runs: u?.runs ?? [],
1194
+ onDelete: K,
1195
+ loading: f.loading,
1196
+ baselineRunId: m.project ? i?.find((w) => w.name === m.project)?.baseline?.run_id : void 0
1197
+ }
1198
+ ) }),
1199
+ d && /* @__PURE__ */ e.jsx(
1200
+ Be,
1201
+ {
1202
+ message: d.message,
1203
+ variant: d.variant,
1204
+ visible: !!d,
1205
+ onClose: () => o(null)
1206
+ }
1207
+ )
1208
+ ] });
1209
+ }
1210
+ function Ps({ projects: s, currentWorkspace: n }) {
1211
+ if (!s.length)
1212
+ return /* @__PURE__ */ e.jsx(
1213
+ ce,
1214
+ {
1215
+ message: "No projects yet",
1216
+ hint: "Projects are created automatically when you log runs"
1217
+ }
1218
+ );
1219
+ const t = (i) => {
1220
+ const d = new URLSearchParams({ project: i });
1221
+ return n && d.set("workspace", n.id), `/runs?${d}`;
1222
+ };
1223
+ return /* @__PURE__ */ e.jsxs(L, { children: [
1224
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1225
+ /* @__PURE__ */ e.jsx(y, { children: "Project" }),
1226
+ /* @__PURE__ */ e.jsx(y, { children: "Runs" }),
1227
+ /* @__PURE__ */ e.jsx(y, { children: "Baseline" }),
1228
+ /* @__PURE__ */ e.jsx(y, {})
1229
+ ] }) }),
1230
+ /* @__PURE__ */ e.jsx(I, { children: s.map((i) => /* @__PURE__ */ e.jsxs(j, { children: [
1231
+ /* @__PURE__ */ e.jsxs(c, { children: [
1232
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium", children: i.name }),
1233
+ i.description && /* @__PURE__ */ e.jsx("p", { className: "text-muted text-sm", children: ws(i.description) })
1234
+ ] }),
1235
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(B, { variant: "gray", children: i.run_count ?? 0 }) }),
1236
+ /* @__PURE__ */ e.jsx(c, { children: i.baseline ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1237
+ /* @__PURE__ */ e.jsx(q, { to: `/runs/${i.baseline.run_id}`, className: "font-mono text-sm", children: z(i.baseline.run_id) }),
1238
+ i.baseline.run_name && /* @__PURE__ */ e.jsx("p", { className: "text-muted text-sm", children: i.baseline.run_name })
1239
+ ] }) : /* @__PURE__ */ e.jsx("span", { className: "text-muted", children: "—" }) }),
1240
+ /* @__PURE__ */ e.jsx(c, { className: "text-right", children: /* @__PURE__ */ e.jsx(q, { to: t(i.name), children: /* @__PURE__ */ e.jsx(F, { variant: "secondary", size: "sm", children: "View Runs" }) }) })
1241
+ ] }, i.name)) })
1242
+ ] });
1243
+ }
1244
+ function Ss({ groups: s }) {
1245
+ return s.length ? /* @__PURE__ */ e.jsxs(L, { children: [
1246
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1247
+ /* @__PURE__ */ e.jsx(y, { children: "Group ID" }),
1248
+ /* @__PURE__ */ e.jsx(y, { children: "Name" }),
1249
+ /* @__PURE__ */ e.jsx(y, { children: "Project" }),
1250
+ /* @__PURE__ */ e.jsx(y, { children: "Runs" }),
1251
+ /* @__PURE__ */ e.jsx(y, { children: "Actions" })
1252
+ ] }) }),
1253
+ /* @__PURE__ */ e.jsx(I, { children: s.map((n) => /* @__PURE__ */ e.jsxs(j, { children: [
1254
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: z(n.group_id) }),
1255
+ /* @__PURE__ */ e.jsx(c, { children: n.group_name || "—" }),
1256
+ /* @__PURE__ */ e.jsx(c, { children: n.project }),
1257
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(B, { variant: "gray", children: n.run_count }) }),
1258
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(q, { to: `/groups/${n.group_id}`, children: /* @__PURE__ */ e.jsx(F, { variant: "secondary", size: "sm", children: "View Runs" }) }) })
1259
+ ] }, n.group_id)) })
1260
+ ] }) : /* @__PURE__ */ e.jsx(
1261
+ ce,
1262
+ {
1263
+ message: "No groups found",
1264
+ hint: "Groups are created when runs have a group_id set"
1265
+ }
1266
+ );
1267
+ }
1268
+ function Ds() {
1269
+ const { runId: s } = Xe(), n = os(), { api: t } = W(), { data: i, loading: d, error: o, refetch: m } = Pr(s), { data: a, refetch: u } = $e(), [x, g] = O(!1), [f, R] = O(null), { mutate: K, loading: w } = ye(
1270
+ () => t.setBaseline(i.project, i.run_id)
1271
+ ), { mutate: Q, loading: J } = ye(
1272
+ () => t.deleteRun(s)
1273
+ ), P = a?.find((b) => b.name === i?.project)?.baseline?.run_id === s;
1274
+ if (xe(() => {
1275
+ if (f) {
1276
+ const b = setTimeout(() => R(null), 3e3);
1277
+ return () => clearTimeout(b);
1278
+ }
1279
+ }, [f]), d)
1280
+ return /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-12", children: /* @__PURE__ */ e.jsx(V, {}) }) });
1281
+ if (o || !i)
1282
+ return /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(
1283
+ ce,
1284
+ {
1285
+ message: "Run not found",
1286
+ hint: o?.message || `Run ${s} does not exist`
1287
+ }
1288
+ ) }) });
1289
+ const le = i.backend || {}, oe = i.fingerprints || {}, Z = i.data?.params || {}, Re = i.data?.metrics || {}, we = i.data?.tags || {}, de = i.artifacts || [], me = i.errors || [], Le = async () => {
1290
+ try {
1291
+ await K(), await u(), m(), R({ message: "Baseline updated", variant: "success" });
1292
+ } catch {
1293
+ R({ message: "Failed to set baseline", variant: "error" });
1294
+ }
1295
+ }, Ie = async () => {
1296
+ try {
1297
+ await Q(), g(!1), R({ message: "Run deleted", variant: "success" }), setTimeout(() => n("/runs"), 1e3);
1298
+ } catch {
1299
+ R({ message: "Failed to delete run", variant: "error" }), g(!1);
1300
+ }
1301
+ }, Ee = async (b) => {
1302
+ const C = de[b];
1303
+ try {
1304
+ const se = t.getArtifactDownloadUrl(i.run_id, b), je = await fetch(se);
1305
+ if (!je.ok) throw new Error("Download failed");
1306
+ const Te = await je.blob(), ne = document.createElement("a");
1307
+ ne.href = URL.createObjectURL(Te), ne.download = C?.kind || `artifact-${b}`, ne.click(), URL.revokeObjectURL(ne.href), R({ message: "Download started", variant: "success" });
1308
+ } catch {
1309
+ R({ message: "Download failed", variant: "error" });
1310
+ }
1311
+ };
1312
+ return /* @__PURE__ */ e.jsxs(G, { children: [
1313
+ P && /* @__PURE__ */ e.jsxs("div", { className: "alert alert-info mb-4", children: [
1314
+ 'This run is the current baseline for project "',
1315
+ i.project,
1316
+ '"'
1317
+ ] }),
1318
+ /* @__PURE__ */ e.jsxs("div", { className: "page-header", children: [
1319
+ /* @__PURE__ */ e.jsxs("div", { children: [
1320
+ /* @__PURE__ */ e.jsx("h1", { className: "page-title", children: i.run_name || "Unnamed Run" }),
1321
+ /* @__PURE__ */ e.jsx("p", { className: "text-muted text-sm font-mono", children: i.run_id })
1322
+ ] }),
1323
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
1324
+ !P && /* @__PURE__ */ e.jsxs(F, { variant: "secondary", size: "sm", onClick: Le, disabled: w, children: [
1325
+ w && /* @__PURE__ */ e.jsx(V, {}),
1326
+ "Set as Baseline"
1327
+ ] }),
1328
+ /* @__PURE__ */ e.jsx(F, { variant: "ghost-danger", size: "sm", onClick: () => g(!0), children: "Delete" })
1329
+ ] })
1330
+ ] }),
1331
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 mb-4", children: [
1332
+ /* @__PURE__ */ e.jsxs(N, { children: [
1333
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Overview" }) }),
1334
+ /* @__PURE__ */ e.jsx(Je, { items: [
1335
+ { label: "Project", value: /* @__PURE__ */ e.jsx(q, { to: `/runs?project=${i.project}`, children: i.project }) },
1336
+ { label: "Name", value: i.run_name || "—" },
1337
+ { label: "Adapter", value: i.adapter || "N/A" },
1338
+ { label: "Status", value: /* @__PURE__ */ e.jsx(Ar, { status: i.status }) },
1339
+ { label: "Created", value: `${i.created_at} (${Fe(i.created_at)})` },
1340
+ { label: "Backend", value: le.name || "N/A" },
1341
+ ...i.group_id ? [{
1342
+ label: "Group",
1343
+ value: /* @__PURE__ */ e.jsx(q, { to: `/groups/${i.group_id}`, children: i.group_name || z(i.group_id) })
1344
+ }] : []
1345
+ ] })
1346
+ ] }),
1347
+ /* @__PURE__ */ e.jsxs(N, { children: [
1348
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Fingerprints" }) }),
1349
+ /* @__PURE__ */ e.jsx(Je, { items: [
1350
+ { label: "Run", value: /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm truncate", children: oe.run || "N/A" }) },
1351
+ { label: "Program", value: /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm truncate", children: oe.program || "N/A" }) }
1352
+ ] })
1353
+ ] })
1354
+ ] }),
1355
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4 mb-4", children: [
1356
+ /* @__PURE__ */ e.jsxs(N, { children: [
1357
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Parameters" }) }),
1358
+ Object.keys(Z).length ? /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsx(I, { children: Object.entries(Z).map(([b, C]) => /* @__PURE__ */ e.jsxs(j, { children: [
1359
+ /* @__PURE__ */ e.jsx(c, { children: b }),
1360
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: String(C) })
1361
+ ] }, b)) }) }) : /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "No parameters" })
1362
+ ] }),
1363
+ /* @__PURE__ */ e.jsxs(N, { children: [
1364
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Metrics" }) }),
1365
+ Object.keys(Re).length ? /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsx(I, { children: Object.entries(Re).map(([b, C]) => /* @__PURE__ */ e.jsxs(j, { children: [
1366
+ /* @__PURE__ */ e.jsx(c, { children: b }),
1367
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: typeof C == "number" ? _s(C) : String(C) })
1368
+ ] }, b)) }) }) : /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "No metrics" })
1369
+ ] }),
1370
+ /* @__PURE__ */ e.jsxs(N, { children: [
1371
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Tags" }) }),
1372
+ Object.keys(we).length ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-2", children: Object.entries(we).map(([b, C]) => /* @__PURE__ */ e.jsxs(B, { variant: "gray", children: [
1373
+ b,
1374
+ ": ",
1375
+ String(C)
1376
+ ] }, b)) }) : /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "No tags" })
1377
+ ] })
1378
+ ] }),
1379
+ /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
1380
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1381
+ "Artifacts (",
1382
+ de.length,
1383
+ ")"
1384
+ ] }) }),
1385
+ de.length ? /* @__PURE__ */ e.jsxs(L, { children: [
1386
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1387
+ /* @__PURE__ */ e.jsx(y, { children: "#" }),
1388
+ /* @__PURE__ */ e.jsx(y, { children: "Kind" }),
1389
+ /* @__PURE__ */ e.jsx(y, { children: "Role" }),
1390
+ /* @__PURE__ */ e.jsx(y, { children: "Media Type" }),
1391
+ /* @__PURE__ */ e.jsx(y, { children: "Digest" }),
1392
+ /* @__PURE__ */ e.jsx(y, { children: "Actions" })
1393
+ ] }) }),
1394
+ /* @__PURE__ */ e.jsx(I, { children: de.map((b, C) => /* @__PURE__ */ e.jsxs(j, { children: [
1395
+ /* @__PURE__ */ e.jsx(c, { children: C }),
1396
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: b.kind }),
1397
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(B, { variant: "gray", children: b.role }) }),
1398
+ /* @__PURE__ */ e.jsx(c, { className: "text-muted text-sm", children: b.media_type }),
1399
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: Ke(b.digest) }),
1400
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
1401
+ /* @__PURE__ */ e.jsx(q, { to: `/runs/${i.run_id}/artifacts/${C}`, children: /* @__PURE__ */ e.jsx(F, { variant: "secondary", size: "sm", children: "View" }) }),
1402
+ /* @__PURE__ */ e.jsx(F, { variant: "secondary", size: "sm", onClick: () => Ee(C), children: "Download" })
1403
+ ] }) })
1404
+ ] }, C)) })
1405
+ ] }) : /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "No artifacts" })
1406
+ ] }),
1407
+ me.length > 0 && /* @__PURE__ */ e.jsxs(N, { children: [
1408
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { className: "text-danger", children: "Errors" }) }),
1409
+ me.map((b, C) => /* @__PURE__ */ e.jsxs("div", { className: "mb-2", children: [
1410
+ /* @__PURE__ */ e.jsx("strong", { children: b.type }),
1411
+ ": ",
1412
+ b.message,
1413
+ b.traceback && /* @__PURE__ */ e.jsx("pre", { className: "mt-2", children: b.traceback })
1414
+ ] }, C))
1415
+ ] }),
1416
+ /* @__PURE__ */ e.jsxs(
1417
+ Dr,
1418
+ {
1419
+ open: x,
1420
+ onClose: () => g(!1),
1421
+ title: "Delete Run",
1422
+ actions: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1423
+ /* @__PURE__ */ e.jsx(F, { variant: "secondary", onClick: () => g(!1), children: "Cancel" }),
1424
+ /* @__PURE__ */ e.jsxs(F, { variant: "danger", onClick: Ie, disabled: J, children: [
1425
+ J && /* @__PURE__ */ e.jsx(V, {}),
1426
+ "Delete"
1427
+ ] })
1428
+ ] }),
1429
+ children: [
1430
+ /* @__PURE__ */ e.jsx("p", { children: "Are you sure you want to delete this run?" }),
1431
+ /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm mt-2", children: z(i.run_id) }),
1432
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-danger mt-2", children: "This action cannot be undone." })
1433
+ ]
1434
+ }
1435
+ ),
1436
+ f && /* @__PURE__ */ e.jsx(
1437
+ Be,
1438
+ {
1439
+ message: f.message,
1440
+ variant: f.variant,
1441
+ visible: !!f,
1442
+ onClose: () => R(null)
1443
+ }
1444
+ )
1445
+ ] });
1446
+ }
1447
+ function ks() {
1448
+ const { currentWorkspace: s } = W(), { data: n, loading: t } = $e();
1449
+ return /* @__PURE__ */ e.jsxs(G, { children: [
1450
+ /* @__PURE__ */ e.jsx(_e, { title: "Projects" }),
1451
+ /* @__PURE__ */ e.jsx(N, { children: t ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e.jsx(V, {}) }) : /* @__PURE__ */ e.jsx(Ps, { projects: n ?? [], currentWorkspace: s }) })
1452
+ ] });
1453
+ }
1454
+ function As() {
1455
+ const [s, n] = Oe(), { data: t } = $e(), [i, d] = O(s.get("project") || ""), { data: o, loading: m, refetch: a } = vs({ project: i || void 0 }), u = be((x) => {
1456
+ d(x);
1457
+ const g = new URLSearchParams(s);
1458
+ x ? g.set("project", x) : g.delete("project"), n(g, { replace: !0 });
1459
+ }, [s, n]);
1460
+ return /* @__PURE__ */ e.jsxs(G, { children: [
1461
+ /* @__PURE__ */ e.jsx(_e, { title: "Run Groups" }),
1462
+ /* @__PURE__ */ e.jsx(N, { className: "mb-4", children: /* @__PURE__ */ e.jsxs(kr, { children: [
1463
+ /* @__PURE__ */ e.jsxs(X, { children: [
1464
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "project", children: "Project" }),
1465
+ /* @__PURE__ */ e.jsxs(
1466
+ ae,
1467
+ {
1468
+ id: "project",
1469
+ value: i,
1470
+ onChange: (x) => u(x.target.value),
1471
+ children: [
1472
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "All projects" }),
1473
+ t?.map((x) => /* @__PURE__ */ e.jsx("option", { value: x.name, children: x.name }, x.name))
1474
+ ]
1475
+ }
1476
+ )
1477
+ ] }),
1478
+ /* @__PURE__ */ e.jsxs(X, { className: "flex items-end gap-2", children: [
1479
+ /* @__PURE__ */ e.jsx(F, { variant: "primary", onClick: () => a(), children: "Filter" }),
1480
+ m && /* @__PURE__ */ e.jsx(V, {})
1481
+ ] })
1482
+ ] }) }),
1483
+ /* @__PURE__ */ e.jsx(N, { children: m && !o ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e.jsx(V, {}) }) : /* @__PURE__ */ e.jsx(Ss, { groups: o ?? [] }) })
1484
+ ] });
1485
+ }
1486
+ function Fs() {
1487
+ const { groupId: s } = Xe(), { api: n } = W(), { data: t, loading: i, error: d, refetch: o } = bs(s), [m, a] = O(null), u = ye((g) => n.deleteRun(g));
1488
+ xe(() => {
1489
+ if (m) {
1490
+ const g = setTimeout(() => a(null), 3e3);
1491
+ return () => clearTimeout(g);
1492
+ }
1493
+ }, [m]);
1494
+ const x = async (g) => {
1495
+ try {
1496
+ await u.mutate(g), a({ message: "Run deleted", variant: "success" }), o();
1497
+ } catch {
1498
+ a({ message: "Failed to delete run", variant: "error" });
1499
+ }
1500
+ };
1501
+ return i ? /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-12", children: /* @__PURE__ */ e.jsx(V, {}) }) }) : d || !t ? /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(ce, { message: "Group not found", hint: d?.message }) }) }) : /* @__PURE__ */ e.jsxs(G, { children: [
1502
+ /* @__PURE__ */ e.jsx(
1503
+ _e,
1504
+ {
1505
+ title: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1506
+ "Group ",
1507
+ /* @__PURE__ */ e.jsx("span", { className: "font-mono", children: z(s) })
1508
+ ] }),
1509
+ subtitle: /* @__PURE__ */ e.jsx("span", { className: "font-mono text-muted", children: s })
1510
+ }
1511
+ ),
1512
+ /* @__PURE__ */ e.jsxs(N, { children: [
1513
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1514
+ "Runs in Group (",
1515
+ t.runs.length,
1516
+ ")"
1517
+ ] }) }),
1518
+ /* @__PURE__ */ e.jsx(
1519
+ Ze,
1520
+ {
1521
+ runs: t.runs,
1522
+ onDelete: x,
1523
+ loading: u.loading
1524
+ }
1525
+ )
1526
+ ] }),
1527
+ m && /* @__PURE__ */ e.jsx(
1528
+ Be,
1529
+ {
1530
+ message: m.message,
1531
+ variant: m.variant,
1532
+ visible: !!m,
1533
+ onClose: () => a(null)
1534
+ }
1535
+ )
1536
+ ] });
1537
+ }
1538
+ function ve({ match: s, yesText: n = "✓ Match", noText: t = "✗ Different" }) {
1539
+ return /* @__PURE__ */ e.jsx("span", { className: s ? "diff-match" : "diff-mismatch", children: s ? n : t });
1540
+ }
1541
+ function Os() {
1542
+ const [s, n] = Oe(), { data: t } = Cr({ limit: 100 }), i = t?.runs ?? [], [d, o] = O(s.get("a") || ""), [m, a] = O(s.get("b") || ""), [u, x] = O(""), g = (f) => {
1543
+ if (f.preventDefault(), !d || !m) {
1544
+ x("Please select both runs to compare");
1545
+ return;
1546
+ }
1547
+ x(""), n({ a: d, b: m });
1548
+ };
1549
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1550
+ /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs("form", { onSubmit: g, children: [
1551
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 mb-4", children: [
1552
+ /* @__PURE__ */ e.jsxs(X, { children: [
1553
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "a", children: "Run A (Baseline)" }),
1554
+ /* @__PURE__ */ e.jsxs(ae, { id: "a", value: d, onChange: (f) => {
1555
+ o(f.target.value), x("");
1556
+ }, children: [
1557
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select run..." }),
1558
+ i.map((f) => /* @__PURE__ */ e.jsxs("option", { value: f.run_id, children: [
1559
+ f.run_name || "Unnamed",
1560
+ " (",
1561
+ z(f.run_id),
1562
+ ") — ",
1563
+ f.project
1564
+ ] }, f.run_id))
1565
+ ] })
1566
+ ] }),
1567
+ /* @__PURE__ */ e.jsxs(X, { children: [
1568
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "b", children: "Run B (Candidate)" }),
1569
+ /* @__PURE__ */ e.jsxs(ae, { id: "b", value: m, onChange: (f) => {
1570
+ a(f.target.value), x("");
1571
+ }, children: [
1572
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "Select run..." }),
1573
+ i.map((f) => /* @__PURE__ */ e.jsxs("option", { value: f.run_id, children: [
1574
+ f.run_name || "Unnamed",
1575
+ " (",
1576
+ z(f.run_id),
1577
+ ") — ",
1578
+ f.project
1579
+ ] }, f.run_id))
1580
+ ] })
1581
+ ] })
1582
+ ] }),
1583
+ u && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-danger mb-3", children: u }),
1584
+ /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(F, { type: "submit", variant: "primary", children: "Compare" }) })
1585
+ ] }) }),
1586
+ /* @__PURE__ */ e.jsxs(N, { className: "mt-4", children: [
1587
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Tips" }) }),
1588
+ /* @__PURE__ */ e.jsxs("ul", { className: "text-muted text-sm list-disc pl-6 space-y-1", children: [
1589
+ /* @__PURE__ */ e.jsx("li", { children: "Select two runs to compare their parameters, metrics, and artifacts" }),
1590
+ /* @__PURE__ */ e.jsx("li", { children: "The diff will show changed values and compute TVD for result distributions" }),
1591
+ /* @__PURE__ */ e.jsx("li", { children: "You can also compare from the run detail page" })
1592
+ ] })
1593
+ ] })
1594
+ ] });
1595
+ }
1596
+ function $s({ runIdA: s, runIdB: n }) {
1597
+ const { data: t, loading: i, error: d } = Ns(s, n);
1598
+ if (i) return /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-12", children: /* @__PURE__ */ e.jsx(V, {}) });
1599
+ if (d || !t) return /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(ce, { message: "Failed to load diff", hint: d?.message }) });
1600
+ const { run_a: o, run_b: m, report: a } = t;
1601
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1602
+ a.warnings && a.warnings.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "alert alert-warning mb-4", children: [
1603
+ /* @__PURE__ */ e.jsx("strong", { children: "Warnings:" }),
1604
+ /* @__PURE__ */ e.jsx("ul", { className: "list-disc pl-6 mt-1", children: a.warnings.map((u, x) => /* @__PURE__ */ e.jsx("li", { children: u }, x)) })
1605
+ ] }),
1606
+ /* @__PURE__ */ e.jsx(N, { className: "mb-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
1607
+ /* @__PURE__ */ e.jsxs("div", { children: [
1608
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm text-muted uppercase tracking-wider mb-1", children: "Run A (Baseline)" }),
1609
+ /* @__PURE__ */ e.jsx("p", { children: /* @__PURE__ */ e.jsx(q, { to: `/runs/${o.run_id}`, children: o.run_name || "Unnamed Run" }) }),
1610
+ /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm text-muted", children: z(o.run_id) }),
1611
+ /* @__PURE__ */ e.jsxs("p", { className: "text-muted text-sm", children: [
1612
+ o.project,
1613
+ " · ",
1614
+ Fe(o.created_at)
1615
+ ] })
1616
+ ] }),
1617
+ /* @__PURE__ */ e.jsxs("div", { children: [
1618
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm text-muted uppercase tracking-wider mb-1", children: "Run B (Candidate)" }),
1619
+ /* @__PURE__ */ e.jsx("p", { children: /* @__PURE__ */ e.jsx(q, { to: `/runs/${m.run_id}`, children: m.run_name || "Unnamed Run" }) }),
1620
+ /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm text-muted", children: z(m.run_id) }),
1621
+ /* @__PURE__ */ e.jsxs("p", { className: "text-muted text-sm", children: [
1622
+ m.project,
1623
+ " · ",
1624
+ Fe(m.created_at)
1625
+ ] })
1626
+ ] })
1627
+ ] }) }),
1628
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 mb-4", children: [
1629
+ /* @__PURE__ */ e.jsxs(N, { children: [
1630
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Metadata" }) }),
1631
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsxs(I, { children: [
1632
+ /* @__PURE__ */ e.jsxs(j, { children: [
1633
+ /* @__PURE__ */ e.jsx(c, { children: "Project" }),
1634
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(ve, { match: a.metadata.project_match }) })
1635
+ ] }),
1636
+ /* @__PURE__ */ e.jsxs(j, { children: [
1637
+ /* @__PURE__ */ e.jsx(c, { children: "Backend" }),
1638
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(ve, { match: a.metadata.backend_match }) })
1639
+ ] }),
1640
+ !a.metadata.project_match && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1641
+ /* @__PURE__ */ e.jsxs(j, { children: [
1642
+ /* @__PURE__ */ e.jsx(c, { className: "text-muted text-sm", children: "Project A" }),
1643
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: a.metadata.project_a || "N/A" })
1644
+ ] }),
1645
+ /* @__PURE__ */ e.jsxs(j, { children: [
1646
+ /* @__PURE__ */ e.jsx(c, { className: "text-muted text-sm", children: "Project B" }),
1647
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: a.metadata.project_b || "N/A" })
1648
+ ] })
1649
+ ] }),
1650
+ !a.metadata.backend_match && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1651
+ /* @__PURE__ */ e.jsxs(j, { children: [
1652
+ /* @__PURE__ */ e.jsx(c, { className: "text-muted text-sm", children: "Backend A" }),
1653
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: a.metadata.backend_a || "N/A" })
1654
+ ] }),
1655
+ /* @__PURE__ */ e.jsxs(j, { children: [
1656
+ /* @__PURE__ */ e.jsx(c, { className: "text-muted text-sm", children: "Backend B" }),
1657
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: a.metadata.backend_b || "N/A" })
1658
+ ] })
1659
+ ] })
1660
+ ] }) })
1661
+ ] }),
1662
+ /* @__PURE__ */ e.jsxs(N, { children: [
1663
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Fingerprints" }) }),
1664
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsxs(I, { children: [
1665
+ /* @__PURE__ */ e.jsxs(j, { children: [
1666
+ /* @__PURE__ */ e.jsx(c, { children: "Run A" }),
1667
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: Ke(a.fingerprints.a) })
1668
+ ] }),
1669
+ /* @__PURE__ */ e.jsxs(j, { children: [
1670
+ /* @__PURE__ */ e.jsx(c, { children: "Run B" }),
1671
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono text-sm", children: Ke(a.fingerprints.b) })
1672
+ ] }),
1673
+ /* @__PURE__ */ e.jsxs(j, { children: [
1674
+ /* @__PURE__ */ e.jsx(c, { children: "Match" }),
1675
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(ve, { match: a.fingerprints.a === a.fingerprints.b, yesText: "✓ Yes", noText: "✗ No" }) })
1676
+ ] })
1677
+ ] }) })
1678
+ ] })
1679
+ ] }),
1680
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 mb-4", children: [
1681
+ /* @__PURE__ */ e.jsxs(N, { children: [
1682
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1683
+ "Program",
1684
+ a.program.exact_match ? /* @__PURE__ */ e.jsx(B, { variant: "success", children: "Exact Match" }) : a.program.structural_match ? /* @__PURE__ */ e.jsx(B, { variant: "info", children: "Structural Match" }) : /* @__PURE__ */ e.jsx(B, { variant: "warning", children: "Different" })
1685
+ ] }) }),
1686
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsxs(I, { children: [
1687
+ /* @__PURE__ */ e.jsxs(j, { children: [
1688
+ /* @__PURE__ */ e.jsx(c, { children: "Exact Match" }),
1689
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(ve, { match: a.program.exact_match, yesText: "✓ Yes", noText: "✗ No" }) })
1690
+ ] }),
1691
+ /* @__PURE__ */ e.jsxs(j, { children: [
1692
+ /* @__PURE__ */ e.jsx(c, { children: "Structural Match" }),
1693
+ /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsx(ve, { match: a.program.structural_match, yesText: "✓ Yes", noText: "✗ No" }) })
1694
+ ] })
1695
+ ] }) })
1696
+ ] }),
1697
+ /* @__PURE__ */ e.jsxs(N, { children: [
1698
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1699
+ "Device Calibration",
1700
+ a.device_drift?.significant_drift ? /* @__PURE__ */ e.jsx(B, { variant: "warning", children: "Drifted" }) : a.device_drift?.has_calibration_data ? /* @__PURE__ */ e.jsx(B, { variant: "success", children: "Stable" }) : /* @__PURE__ */ e.jsx(B, { variant: "gray", children: "N/A" })
1701
+ ] }) }),
1702
+ a.device_drift?.significant_drift ? /* @__PURE__ */ e.jsx("p", { className: "text-sm text-warning", children: "⚠ Significant calibration drift detected" }) : a.device_drift?.has_calibration_data ? /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "Calibration within acceptable thresholds" }) : /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "No calibration data available" })
1703
+ ] })
1704
+ ] }),
1705
+ /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
1706
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1707
+ "Parameters ",
1708
+ /* @__PURE__ */ e.jsx(B, { variant: a.params.match ? "success" : "warning", children: a.params.match ? "Match" : "Different" })
1709
+ ] }) }),
1710
+ a.params.match ? /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "All parameters match" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: a.params.changed && Object.keys(a.params.changed).length > 0 && /* @__PURE__ */ e.jsxs(L, { children: [
1711
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1712
+ /* @__PURE__ */ e.jsx(y, { children: "Parameter" }),
1713
+ /* @__PURE__ */ e.jsx(y, { children: "Run A" }),
1714
+ /* @__PURE__ */ e.jsx(y, { children: "Run B" })
1715
+ ] }) }),
1716
+ /* @__PURE__ */ e.jsx(I, { children: Object.entries(a.params.changed).map(([u, x]) => /* @__PURE__ */ e.jsxs(j, { children: [
1717
+ /* @__PURE__ */ e.jsx(c, { children: u }),
1718
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: String(x.a) }),
1719
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: String(x.b) })
1720
+ ] }, u)) })
1721
+ ] }) })
1722
+ ] }),
1723
+ /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
1724
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1725
+ "Metrics ",
1726
+ /* @__PURE__ */ e.jsx(B, { variant: a.metrics.match ? "success" : "warning", children: a.metrics.match ? "Match" : "Different" })
1727
+ ] }) }),
1728
+ a.metrics.match ? /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "All metrics match" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: a.metrics.changed && Object.keys(a.metrics.changed).length > 0 && /* @__PURE__ */ e.jsxs(L, { children: [
1729
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1730
+ /* @__PURE__ */ e.jsx(y, { children: "Metric" }),
1731
+ /* @__PURE__ */ e.jsx(y, { children: "Run A" }),
1732
+ /* @__PURE__ */ e.jsx(y, { children: "Run B" })
1733
+ ] }) }),
1734
+ /* @__PURE__ */ e.jsx(I, { children: Object.entries(a.metrics.changed).map(([u, x]) => /* @__PURE__ */ e.jsxs(j, { children: [
1735
+ /* @__PURE__ */ e.jsx(c, { children: u }),
1736
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: x.a }),
1737
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: x.b })
1738
+ ] }, u)) })
1739
+ ] }) })
1740
+ ] }),
1741
+ a.circuit_diff && /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
1742
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsxs(k, { children: [
1743
+ "Circuit",
1744
+ /* @__PURE__ */ e.jsx(B, { variant: a.circuit_diff.match ? "success" : "warning", children: a.circuit_diff.match ? "Match" : "Different" })
1745
+ ] }) }),
1746
+ a.circuit_diff.match ? /* @__PURE__ */ e.jsx("p", { className: "text-muted", children: "Circuit structure matches" }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1747
+ a.circuit_diff.changed && Object.keys(a.circuit_diff.changed).length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1748
+ /* @__PURE__ */ e.jsx("h4", { className: "text-sm text-muted mb-2", children: "Changed" }),
1749
+ /* @__PURE__ */ e.jsxs(L, { children: [
1750
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1751
+ /* @__PURE__ */ e.jsx(y, { children: "Property" }),
1752
+ /* @__PURE__ */ e.jsx(y, { children: "Run A" }),
1753
+ /* @__PURE__ */ e.jsx(y, { children: "Run B" }),
1754
+ /* @__PURE__ */ e.jsx(y, { children: "Delta" })
1755
+ ] }) }),
1756
+ /* @__PURE__ */ e.jsx(I, { children: Object.entries(a.circuit_diff.changed).map(([u, x]) => /* @__PURE__ */ e.jsxs(j, { children: [
1757
+ /* @__PURE__ */ e.jsx(c, { children: x.label || u }),
1758
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: String(x.a) }),
1759
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: String(x.b) }),
1760
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: x.delta != null && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1761
+ x.delta > 0 ? "+" : "",
1762
+ x.delta,
1763
+ x.pct != null && ` (${x.pct > 0 ? "+" : ""}${x.pct.toFixed(1)}%)`
1764
+ ] }) })
1765
+ ] }, u)) })
1766
+ ] })
1767
+ ] }),
1768
+ a.circuit_diff.is_clifford_changed && /* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
1769
+ /* @__PURE__ */ e.jsx("h4", { className: "text-sm text-muted mb-2", children: "Clifford Status" }),
1770
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsxs(I, { children: [
1771
+ /* @__PURE__ */ e.jsxs(j, { children: [
1772
+ /* @__PURE__ */ e.jsx(c, { children: "Run A" }),
1773
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: a.circuit_diff.is_clifford_a != null ? String(a.circuit_diff.is_clifford_a) : "unknown" })
1774
+ ] }),
1775
+ /* @__PURE__ */ e.jsxs(j, { children: [
1776
+ /* @__PURE__ */ e.jsx(c, { children: "Run B" }),
1777
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: a.circuit_diff.is_clifford_b != null ? String(a.circuit_diff.is_clifford_b) : "unknown" })
1778
+ ] })
1779
+ ] }) })
1780
+ ] }),
1781
+ a.circuit_diff.added_gates && a.circuit_diff.added_gates.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
1782
+ /* @__PURE__ */ e.jsx("h4", { className: "text-sm text-muted mb-2", children: "New Gate Types (in B)" }),
1783
+ /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: a.circuit_diff.added_gates.join(", ") })
1784
+ ] }),
1785
+ a.circuit_diff.removed_gates && a.circuit_diff.removed_gates.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
1786
+ /* @__PURE__ */ e.jsx("h4", { className: "text-sm text-muted mb-2", children: "Removed Gate Types (from A)" }),
1787
+ /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: a.circuit_diff.removed_gates.join(", ") })
1788
+ ] })
1789
+ ] })
1790
+ ] }),
1791
+ a.tvd != null && /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
1792
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Results" }) }),
1793
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsxs(I, { children: [
1794
+ /* @__PURE__ */ e.jsxs(j, { children: [
1795
+ /* @__PURE__ */ e.jsx(c, { children: "Total Variation Distance (TVD)" }),
1796
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: a.tvd.toFixed(6) })
1797
+ ] }),
1798
+ a.shots && /* @__PURE__ */ e.jsxs(j, { children: [
1799
+ /* @__PURE__ */ e.jsx(c, { children: "Total Shots (A / B)" }),
1800
+ /* @__PURE__ */ e.jsxs(c, { className: "font-mono", children: [
1801
+ a.shots.a,
1802
+ " / ",
1803
+ a.shots.b
1804
+ ] })
1805
+ ] }),
1806
+ a.noise_context?.noise_p95 && /* @__PURE__ */ e.jsxs(j, { children: [
1807
+ /* @__PURE__ */ e.jsx(c, { children: "Noise Threshold (p95)" }),
1808
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: a.noise_context.noise_p95.toFixed(6) })
1809
+ ] }),
1810
+ a.noise_context?.p_value != null && /* @__PURE__ */ e.jsxs(j, { children: [
1811
+ /* @__PURE__ */ e.jsx(c, { children: "p-value" }),
1812
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: a.noise_context.p_value.toFixed(3) })
1813
+ ] })
1814
+ ] }) }),
1815
+ a.tvd > 0 && a.noise_context && /* @__PURE__ */ e.jsx("p", { className: "text-sm mt-4", children: a.noise_context.p_value != null ? a.noise_context.p_value >= 0.1 ? /* @__PURE__ */ e.jsx("span", { className: "text-success", children: "✓ Consistent with sampling noise — difference is not statistically significant." }) : a.noise_context.p_value >= 0.05 ? /* @__PURE__ */ e.jsxs("span", { className: "text-warning", children: [
1816
+ "⚠ Borderline (p=",
1817
+ a.noise_context.p_value.toFixed(2),
1818
+ "). Consider increasing shots."
1819
+ ] }) : /* @__PURE__ */ e.jsxs("span", { className: "text-danger", children: [
1820
+ "✗ Statistically significant difference (p=",
1821
+ a.noise_context.p_value.toFixed(2),
1822
+ ") — results show meaningful divergence."
1823
+ ] }) : a.noise_context.noise_ratio != null ? a.noise_context.noise_ratio < 1.5 ? /* @__PURE__ */ e.jsx("span", { className: "text-success", children: "✓ TVD is within expected shot noise range." }) : a.noise_context.noise_ratio < 3 ? /* @__PURE__ */ e.jsxs("span", { className: "text-warning", children: [
1824
+ "⚠ Ambiguous (",
1825
+ a.noise_context.noise_ratio.toFixed(1),
1826
+ "× expected noise). Consider increasing shots."
1827
+ ] }) : /* @__PURE__ */ e.jsxs("span", { className: "text-danger", children: [
1828
+ "✗ TVD exceeds expected noise (",
1829
+ a.noise_context.noise_ratio.toFixed(1),
1830
+ "×) — results show meaningful differences."
1831
+ ] }) : null })
1832
+ ] })
1833
+ ] });
1834
+ }
1835
+ function Bs() {
1836
+ const [s] = Oe(), n = s.get("a"), t = s.get("b"), i = n && t;
1837
+ return /* @__PURE__ */ e.jsxs(G, { children: [
1838
+ /* @__PURE__ */ e.jsx("div", { className: "page-header", children: /* @__PURE__ */ e.jsxs("div", { children: [
1839
+ /* @__PURE__ */ e.jsxs("h1", { className: "page-title", children: [
1840
+ "Compare Runs",
1841
+ i && /* @__PURE__ */ e.jsx(B, { variant: "info", children: "Comparing" })
1842
+ ] }),
1843
+ i && /* @__PURE__ */ e.jsx("p", { className: "text-muted text-sm", children: /* @__PURE__ */ e.jsx(q, { to: "/diff", children: "← Select different runs" }) })
1844
+ ] }) }),
1845
+ i ? /* @__PURE__ */ e.jsx($s, { runIdA: n, runIdB: t }) : /* @__PURE__ */ e.jsx(Os, {})
1846
+ ] });
1847
+ }
1848
+ function Ls() {
1849
+ const { api: s } = W(), [n, t] = O(""), [i, d] = O(null), [o, m] = O(!1), [a, u] = O(""), { mutate: x, loading: g } = ye(async () => {
1850
+ const R = await s.listRuns({ q: n, limit: 100 });
1851
+ return d(R.runs), m(!0), R;
1852
+ }), f = (R) => {
1853
+ if (R.preventDefault(), !n.trim()) {
1854
+ u("Please enter a search query");
1855
+ return;
1856
+ }
1857
+ u(""), x();
1858
+ };
1859
+ return /* @__PURE__ */ e.jsxs(G, { children: [
1860
+ /* @__PURE__ */ e.jsx("div", { className: "page-header", children: /* @__PURE__ */ e.jsx("h1", { className: "page-title", children: "Search Runs" }) }),
1861
+ /* @__PURE__ */ e.jsx(N, { className: "mb-4", children: /* @__PURE__ */ e.jsxs("form", { onSubmit: f, children: [
1862
+ /* @__PURE__ */ e.jsxs(X, { children: [
1863
+ /* @__PURE__ */ e.jsx(re, { htmlFor: "q", children: "Query" }),
1864
+ /* @__PURE__ */ e.jsx(
1865
+ Qe,
1866
+ {
1867
+ id: "q",
1868
+ type: "text",
1869
+ value: n,
1870
+ onChange: (R) => {
1871
+ t(R.target.value), u("");
1872
+ },
1873
+ placeholder: "metric.fidelity > 0.95 and params.shots = 1000",
1874
+ className: "font-mono"
1875
+ }
1876
+ )
1877
+ ] }),
1878
+ a && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-danger mb-3", children: a }),
1879
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-3 items-center pt-2", children: [
1880
+ /* @__PURE__ */ e.jsxs(F, { type: "submit", variant: "primary", disabled: g, children: [
1881
+ g && /* @__PURE__ */ e.jsx(V, {}),
1882
+ "Search"
1883
+ ] }),
1884
+ g && /* @__PURE__ */ e.jsx("span", { className: "text-muted text-sm", children: "Searching..." })
1885
+ ] })
1886
+ ] }) }),
1887
+ o && i && /* @__PURE__ */ e.jsx(N, { className: "mb-4", children: i.length > 0 ? /* @__PURE__ */ e.jsx(Ze, { runs: i }) : /* @__PURE__ */ e.jsx("p", { className: "text-muted text-center py-8", children: "No runs match your query" }) }),
1888
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
1889
+ /* @__PURE__ */ e.jsxs(N, { children: [
1890
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Query Syntax" }) }),
1891
+ /* @__PURE__ */ e.jsxs(L, { children: [
1892
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1893
+ /* @__PURE__ */ e.jsx(y, { children: "Field" }),
1894
+ /* @__PURE__ */ e.jsx(y, { children: "Description" })
1895
+ ] }) }),
1896
+ /* @__PURE__ */ e.jsxs(I, { children: [
1897
+ /* @__PURE__ */ e.jsxs(j, { children: [
1898
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "params.X" }),
1899
+ /* @__PURE__ */ e.jsx(c, { children: "Parameter value" })
1900
+ ] }),
1901
+ /* @__PURE__ */ e.jsxs(j, { children: [
1902
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "metric.X" }),
1903
+ /* @__PURE__ */ e.jsx(c, { children: "Metric value" })
1904
+ ] }),
1905
+ /* @__PURE__ */ e.jsxs(j, { children: [
1906
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "tags.X" }),
1907
+ /* @__PURE__ */ e.jsx(c, { children: "Tag value" })
1908
+ ] }),
1909
+ /* @__PURE__ */ e.jsxs(j, { children: [
1910
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "status" }),
1911
+ /* @__PURE__ */ e.jsx(c, { children: "Run status" })
1912
+ ] }),
1913
+ /* @__PURE__ */ e.jsxs(j, { children: [
1914
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "project" }),
1915
+ /* @__PURE__ */ e.jsx(c, { children: "Project name" })
1916
+ ] }),
1917
+ /* @__PURE__ */ e.jsxs(j, { children: [
1918
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "backend" }),
1919
+ /* @__PURE__ */ e.jsx(c, { children: "Backend name" })
1920
+ ] })
1921
+ ] })
1922
+ ] })
1923
+ ] }),
1924
+ /* @__PURE__ */ e.jsxs(N, { children: [
1925
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Operators" }) }),
1926
+ /* @__PURE__ */ e.jsxs(L, { children: [
1927
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(j, { children: [
1928
+ /* @__PURE__ */ e.jsx(y, { children: "Operator" }),
1929
+ /* @__PURE__ */ e.jsx(y, { children: "Description" })
1930
+ ] }) }),
1931
+ /* @__PURE__ */ e.jsxs(I, { children: [
1932
+ /* @__PURE__ */ e.jsxs(j, { children: [
1933
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "=" }),
1934
+ /* @__PURE__ */ e.jsx(c, { children: "Equals" })
1935
+ ] }),
1936
+ /* @__PURE__ */ e.jsxs(j, { children: [
1937
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "!=" }),
1938
+ /* @__PURE__ */ e.jsx(c, { children: "Not equals" })
1939
+ ] }),
1940
+ /* @__PURE__ */ e.jsxs(j, { children: [
1941
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: ">" }),
1942
+ /* @__PURE__ */ e.jsx(c, { children: "Greater than" })
1943
+ ] }),
1944
+ /* @__PURE__ */ e.jsxs(j, { children: [
1945
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: ">=" }),
1946
+ /* @__PURE__ */ e.jsx(c, { children: "Greater or equal" })
1947
+ ] }),
1948
+ /* @__PURE__ */ e.jsxs(j, { children: [
1949
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "<" }),
1950
+ /* @__PURE__ */ e.jsx(c, { children: "Less than" })
1951
+ ] }),
1952
+ /* @__PURE__ */ e.jsxs(j, { children: [
1953
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "<=" }),
1954
+ /* @__PURE__ */ e.jsx(c, { children: "Less or equal" })
1955
+ ] }),
1956
+ /* @__PURE__ */ e.jsxs(j, { children: [
1957
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "~" }),
1958
+ /* @__PURE__ */ e.jsx(c, { children: "Contains" })
1959
+ ] }),
1960
+ /* @__PURE__ */ e.jsxs(j, { children: [
1961
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "and" }),
1962
+ /* @__PURE__ */ e.jsx(c, { children: "Combine conditions" })
1963
+ ] })
1964
+ ] })
1965
+ ] })
1966
+ ] })
1967
+ ] }),
1968
+ /* @__PURE__ */ e.jsxs(N, { className: "mt-4", children: [
1969
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Examples" }) }),
1970
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsxs(I, { children: [
1971
+ /* @__PURE__ */ e.jsxs(j, { children: [
1972
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "metric.fidelity > 0.95" }),
1973
+ /* @__PURE__ */ e.jsx(c, { children: "High fidelity runs" })
1974
+ ] }),
1975
+ /* @__PURE__ */ e.jsxs(j, { children: [
1976
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "params.shots = 1000 and status = FINISHED" }),
1977
+ /* @__PURE__ */ e.jsx(c, { children: "Finished runs with 1000 shots" })
1978
+ ] }),
1979
+ /* @__PURE__ */ e.jsxs(j, { children: [
1980
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "tags.backend ~ ibm" }),
1981
+ /* @__PURE__ */ e.jsx(c, { children: "Runs with IBM backends" })
1982
+ ] }),
1983
+ /* @__PURE__ */ e.jsxs(j, { children: [
1984
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "metric.error < 0.01" }),
1985
+ /* @__PURE__ */ e.jsx(c, { children: "Low error runs" })
1986
+ ] }),
1987
+ /* @__PURE__ */ e.jsxs(j, { children: [
1988
+ /* @__PURE__ */ e.jsx(c, { className: "font-mono", children: "project = vqe and metric.energy < -2.0" }),
1989
+ /* @__PURE__ */ e.jsx(c, { children: "VQE runs with low energy" })
1990
+ ] })
1991
+ ] }) })
1992
+ ] })
1993
+ ] });
1994
+ }
1995
+ function Is() {
1996
+ const { runId: s, index: n } = Xe(), t = parseInt(n, 10), { api: i } = W(), { data: d } = Pr(s), { data: o, loading: m, error: a } = ys(s, t), [u, x] = O(null);
1997
+ xe(() => {
1998
+ if (u) {
1999
+ const P = setTimeout(() => x(null), 3e3);
2000
+ return () => clearTimeout(P);
2001
+ }
2002
+ }, [u]);
2003
+ const g = async () => {
2004
+ try {
2005
+ const P = i.getArtifactDownloadUrl(s, t), le = await fetch(P);
2006
+ if (!le.ok) throw new Error("Download failed");
2007
+ const oe = await le.blob(), Z = document.createElement("a");
2008
+ Z.href = URL.createObjectURL(oe), Z.download = f?.kind || `artifact-${t}`, Z.click(), URL.revokeObjectURL(Z.href), x({ message: "Download started", variant: "success" });
2009
+ } catch {
2010
+ x({ message: "Download failed", variant: "error" });
2011
+ }
2012
+ };
2013
+ if (m)
2014
+ return /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-12", children: /* @__PURE__ */ e.jsx(V, {}) }) });
2015
+ if (a || !o)
2016
+ return /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(ce, { message: "Artifact not found", hint: a?.message }) }) });
2017
+ const { artifact: f, size: R, content: K, content_json: w, preview_available: Q, error: J } = o, H = 10 * 1024 * 1024;
2018
+ return /* @__PURE__ */ e.jsxs(G, { children: [
2019
+ /* @__PURE__ */ e.jsx(
2020
+ _e,
2021
+ {
2022
+ title: f.kind,
2023
+ subtitle: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2024
+ "← Back to run ",
2025
+ /* @__PURE__ */ e.jsxs(q, { to: `/runs/${s}`, children: [
2026
+ z(s),
2027
+ d?.run_name && ` — ${d.run_name}`
2028
+ ] })
2029
+ ] }),
2030
+ actions: /* @__PURE__ */ e.jsx(F, { variant: "primary", onClick: g, children: "Download" })
2031
+ }
2032
+ ),
2033
+ /* @__PURE__ */ e.jsx(N, { className: "mb-4", children: /* @__PURE__ */ e.jsx(Je, { items: [
2034
+ { label: "Kind", value: /* @__PURE__ */ e.jsx("span", { className: "font-mono", children: f.kind }) },
2035
+ { label: "Role", value: /* @__PURE__ */ e.jsx(B, { variant: "gray", children: f.role }) },
2036
+ { label: "Media Type", value: f.media_type },
2037
+ { label: "Digest", value: /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: f.digest }) },
2038
+ { label: "Size", value: Ae(R) }
2039
+ ] }) }),
2040
+ /* @__PURE__ */ e.jsxs(N, { children: [
2041
+ /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(k, { children: "Content" }) }),
2042
+ J ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2043
+ /* @__PURE__ */ e.jsxs("p", { className: "text-sm text-danger", children: [
2044
+ "Error loading artifact: ",
2045
+ J
2046
+ ] }),
2047
+ /* @__PURE__ */ e.jsx("p", { className: "text-muted mt-2", children: /* @__PURE__ */ e.jsx(F, { variant: "primary", onClick: g, children: "Download to view" }) })
2048
+ ] }) : Q ? w ? /* @__PURE__ */ e.jsx("pre", { children: Rs(w) }) : K ? /* @__PURE__ */ e.jsx("pre", { children: K }) : /* @__PURE__ */ e.jsxs("p", { className: "text-muted", children: [
2049
+ "Binary content (",
2050
+ Ae(R),
2051
+ ") — download to view"
2052
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2053
+ /* @__PURE__ */ e.jsxs("p", { className: "text-muted", children: [
2054
+ /* @__PURE__ */ e.jsx("strong", { children: "Artifact too large for preview" }),
2055
+ " (",
2056
+ Ae(R),
2057
+ " exceeds ",
2058
+ Ae(H),
2059
+ " limit)"
2060
+ ] }),
2061
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted mt-2", children: "Download the artifact to view its contents." }),
2062
+ /* @__PURE__ */ e.jsx("p", { className: "mt-4", children: /* @__PURE__ */ e.jsx(F, { variant: "primary", onClick: g, children: "Download" }) })
2063
+ ] })
2064
+ ] }),
2065
+ u && /* @__PURE__ */ e.jsx(
2066
+ Be,
2067
+ {
2068
+ message: u.message,
2069
+ variant: u.variant,
2070
+ visible: !!u,
2071
+ onClose: () => x(null)
2072
+ }
2073
+ )
2074
+ ] });
2075
+ }
2076
+ const Us = [
2077
+ { path: "/", element: /* @__PURE__ */ e.jsx(ds, { to: "/runs", replace: !0 }) },
2078
+ { path: "/runs", element: /* @__PURE__ */ e.jsx(Cs, {}) },
2079
+ { path: "/runs/:runId", element: /* @__PURE__ */ e.jsx(Ds, {}) },
2080
+ { path: "/runs/:runId/artifacts/:index", element: /* @__PURE__ */ e.jsx(Is, {}) },
2081
+ { path: "/projects", element: /* @__PURE__ */ e.jsx(ks, {}) },
2082
+ { path: "/groups", element: /* @__PURE__ */ e.jsx(As, {}) },
2083
+ { path: "/groups/:groupId", element: /* @__PURE__ */ e.jsx(Fs, {}) },
2084
+ { path: "/diff", element: /* @__PURE__ */ e.jsx(Bs, {}) },
2085
+ { path: "/search", element: /* @__PURE__ */ e.jsx(Ls, {}) }
2086
+ ];
2087
+ function Fr(s = []) {
2088
+ return us([...Us, ...s]);
2089
+ }
2090
+ const Ms = Fr();
2091
+ function zs({ additionalRoutes: s, ...n }) {
2092
+ const t = s?.length ? Fr(s) : Ms;
2093
+ return /* @__PURE__ */ e.jsx(gs, { ...n, children: /* @__PURE__ */ e.jsx(hs, { router: t }) });
2094
+ }
2095
+ export {
2096
+ Ys as Alert,
2097
+ fs as ApiClient,
2098
+ Ne as ApiError,
2099
+ zs as App,
2100
+ gs as AppProvider,
2101
+ Is as ArtifactPage,
2102
+ B as Badge,
2103
+ F as Button,
2104
+ N as Card,
2105
+ D as CardHeader,
2106
+ k as CardTitle,
2107
+ Bs as DiffPage,
2108
+ ce as EmptyState,
2109
+ X as FormGroup,
2110
+ kr as FormRow,
2111
+ Fs as GroupDetailPage,
2112
+ As as GroupsPage,
2113
+ Ss as GroupsTable,
2114
+ Qe as Input,
2115
+ Je as KVList,
2116
+ re as Label,
2117
+ G as Layout,
2118
+ Ws as LayoutConfigProvider,
2119
+ Dr as Modal,
2120
+ _e as PageHeader,
2121
+ ks as ProjectsPage,
2122
+ Ps as ProjectsTable,
2123
+ Ds as RunDetailPage,
2124
+ Cs as RunsPage,
2125
+ Ze as RunsTable,
2126
+ Ls as SearchPage,
2127
+ ae as Select,
2128
+ V as Spinner,
2129
+ Ar as StatusBadge,
2130
+ L as Table,
2131
+ I as TableBody,
2132
+ c as TableCell,
2133
+ ee as TableHead,
2134
+ y as TableHeader,
2135
+ j as TableRow,
2136
+ Be as Toast,
2137
+ ps as api,
2138
+ Vs as buildUrl,
2139
+ $ as cn,
2140
+ Us as coreRoutes,
2141
+ Fr as createRouter,
2142
+ Ae as formatBytes,
2143
+ _s as formatNumber,
2144
+ Rs as jsonPretty,
2145
+ Ms as router,
2146
+ Ke as shortDigest,
2147
+ z as shortId,
2148
+ Fe as timeAgo,
2149
+ ws as truncate,
2150
+ W as useApp,
2151
+ ys as useArtifact,
2152
+ Ns as useDiff,
2153
+ bs as useGroup,
2154
+ vs as useGroups,
2155
+ Ts as useLayoutConfig,
2156
+ ye as useMutation,
2157
+ $e as useProjects,
2158
+ Pr as useRun,
2159
+ Cr as useRuns
2160
+ };