batchkit-devtools 0.2.0-beta.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,711 +1,10 @@
1
- import { createRoot as Se, createSignal as q, createMemo as Z, For as G, Show as D } from "solid-js";
2
- import { delegateEvents as P, template as w, style as t, insert as g, createComponent as S, effect as E, memo as we, setAttribute as N, setStyleProperty as W, addEventListener as _e, className as ee, render as $e } from "solid-js/web";
3
- function Ce() {
4
- const [l, n] = q({
5
- batchers: /* @__PURE__ */ new Map(),
6
- events: [],
7
- batches: /* @__PURE__ */ new Map(),
8
- selectedBatcher: null,
9
- isOpen: !1
10
- }), s = /* @__PURE__ */ new Set();
11
- function c() {
12
- const u = l();
13
- for (const h of s)
14
- h(u);
15
- }
16
- function e(u) {
17
- n((h) => {
18
- const i = new Map(h.batchers);
19
- return i.set(u.name, u), { ...h, batchers: i };
20
- }), c();
21
- }
22
- function r(u) {
23
- n((h) => {
24
- const i = new Map(h.batchers);
25
- return i.delete(u), { ...h, batchers: i };
26
- }), c();
27
- }
28
- function a(u, h) {
29
- const i = { ...h, batcherName: u };
30
- n((d) => {
31
- const y = [...d.events, i], b = new Map(d.batches);
32
- if (i.type === "schedule") {
33
- const p = {
34
- batchId: i.batchId,
35
- batcherName: u,
36
- keys: [],
37
- status: "scheduled",
38
- scheduledAt: i.timestamp
39
- };
40
- b.set(i.batchId, p);
41
- }
42
- if (i.type === "dispatch") {
43
- const p = b.get(i.batchId);
44
- p && b.set(i.batchId, {
45
- ...p,
46
- keys: i.keys,
47
- status: "dispatching",
48
- dispatchedAt: i.timestamp
49
- });
50
- }
51
- if (i.type === "resolve") {
52
- const p = b.get(i.batchId);
53
- p && b.set(i.batchId, {
54
- ...p,
55
- status: "resolved",
56
- completedAt: i.timestamp,
57
- duration: i.duration
58
- });
59
- }
60
- if (i.type === "error") {
61
- const p = b.get(i.batchId);
62
- p && b.set(i.batchId, {
63
- ...p,
64
- status: "error",
65
- completedAt: i.timestamp,
66
- error: i.error
67
- });
68
- }
69
- if (i.type === "abort") {
70
- const p = b.get(i.batchId);
71
- p && b.set(i.batchId, {
72
- ...p,
73
- status: "aborted",
74
- completedAt: i.timestamp
75
- });
76
- }
77
- return { ...d, events: y, batches: b };
78
- }), c();
79
- }
80
- function v(u) {
81
- return s.add(u), u(l()), () => s.delete(u);
82
- }
83
- function f() {
84
- return l();
85
- }
86
- function x() {
87
- n((u) => ({
88
- ...u,
89
- events: [],
90
- batches: /* @__PURE__ */ new Map()
91
- })), c();
92
- }
93
- return {
94
- register: e,
95
- unregister: r,
96
- emit: a,
97
- subscribe: v,
98
- getStore: f,
99
- clear: x,
100
- _setStore: n,
101
- _store: l
102
- };
103
- }
104
- function J() {
105
- if (typeof window > "u")
106
- throw new Error("DevTools can only be used in browser environment");
107
- return window.__BATCHKIT_DEVTOOLS__ || (window.__BATCHKIT_DEVTOOLS__ = Se(() => Ce())), window.__BATCHKIT_DEVTOOLS__;
108
- }
109
- function ke() {
110
- const l = J();
111
- if (l._store)
112
- return l._store;
113
- const [n, s] = q(l.getStore());
114
- return l.subscribe(s), n;
115
- }
116
- function Be(l) {
117
- var n;
118
- if (typeof window < "u" && window.__BATCHKIT_DEVTOOLS__) {
119
- const s = window.__BATCHKIT_DEVTOOLS__;
120
- (n = s._setStore) == null || n.call(s, (c) => ({ ...c, isOpen: l }));
121
- }
122
- }
123
- function Te(l) {
124
- var n;
125
- if (typeof window < "u" && window.__BATCHKIT_DEVTOOLS__) {
126
- const s = window.__BATCHKIT_DEVTOOLS__;
127
- (n = s._setStore) == null || n.call(s, (c) => ({ ...c, selectedBatcher: l }));
128
- }
129
- }
130
- var ze = /* @__PURE__ */ w("<div>"), Ae = /* @__PURE__ */ w("<div><div></div><div><span> gets</span><span> batches"), Ie = /* @__PURE__ */ w("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No batchers</div><div style=font-size:11px;color:#57534e>Create a batcher with a name");
131
- const Oe = {
132
- flex: "1",
133
- "overflow-y": "auto"
134
- }, te = {
135
- padding: "8px 12px",
136
- cursor: "pointer",
137
- "border-bottom": "1px solid #292524",
138
- "border-left": "2px solid transparent"
139
- }, De = {
140
- ...te,
141
- background: "#1c1917",
142
- "border-left-color": "#a8a29e"
143
- }, Ee = {
144
- "font-size": "13px",
145
- color: "#d6d3d1",
146
- "margin-bottom": "2px"
147
- }, Ke = {
148
- "font-size": "11px",
149
- color: "#78716c"
150
- }, X = {
151
- display: "inline-flex",
152
- "align-items": "center",
153
- gap: "4px",
154
- "margin-right": "8px"
155
- }, Le = {
156
- display: "flex",
157
- "flex-direction": "column",
158
- "align-items": "center",
159
- "justify-content": "center",
160
- height: "100%",
161
- color: "#57534e",
162
- "text-align": "center",
163
- padding: "24px 12px"
164
- }, Me = (l) => {
165
- const n = Z(() => Array.from(l.batchers.values())), s = (e) => {
166
- const r = l.events.filter((f) => f.batcherName === e), a = r.filter((f) => f.type === "get").length, v = r.filter((f) => f.type === "resolve").length;
167
- return {
168
- gets: a,
169
- batches: v
170
- };
171
- }, c = (e) => {
172
- l.selectedBatcher === e ? l.onSelect(null) : l.onSelect(e);
173
- };
174
- return (() => {
175
- var e = ze();
176
- return t(e, Oe), g(e, S(G, {
177
- get each() {
178
- return n();
179
- },
180
- children: (r) => {
181
- const a = () => s(r.name), v = () => l.selectedBatcher === r.name;
182
- return (() => {
183
- var f = Ae(), x = f.firstChild, u = x.nextSibling, h = u.firstChild, i = h.firstChild, d = h.nextSibling, y = d.firstChild;
184
- return f.$$click = () => c(r.name), t(x, Ee), g(x, () => r.name), t(u, Ke), g(h, () => a().gets, i), g(d, () => a().batches, y), E((b) => {
185
- var p = v() ? De : te, _ = X, $ = X;
186
- return b.e = t(f, p, b.e), b.t = t(h, _, b.t), b.a = t(d, $, b.a), b;
187
- }, {
188
- e: void 0,
189
- t: void 0,
190
- a: void 0
191
- }), f;
192
- })();
193
- }
194
- }), null), g(e, (() => {
195
- var r = we(() => n().length === 0);
196
- return () => r() && (() => {
197
- var a = Ie(), v = a.firstChild;
198
- return v.nextSibling, t(a, Le), a;
199
- })();
200
- })(), null), e;
201
- })();
202
- };
203
- P(["click"]);
204
- var je = /* @__PURE__ */ w("<div>"), He = /* @__PURE__ */ w("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No batches yet</div><div style=font-size:11px;color:#57534e>Batches appear as requests are processed"), Fe = /* @__PURE__ */ w("<div><div></div><div></div><div></div><div>");
205
- const Re = {
206
- display: "flex",
207
- "flex-direction": "column",
208
- gap: "1px"
209
- }, Ve = {
210
- display: "flex",
211
- "align-items": "center",
212
- gap: "12px",
213
- padding: "6px 8px",
214
- background: "#1c1917",
215
- "font-size": "11px"
216
- }, Ne = {
217
- "font-size": "11px",
218
- color: "#78716c",
219
- "min-width": "80px"
220
- }, O = {
221
- padding: "2px 6px",
222
- "font-size": "10px",
223
- "font-weight": "500",
224
- "text-transform": "uppercase",
225
- "letter-spacing": "0.3px"
226
- }, qe = {
227
- scheduled: {
228
- ...O,
229
- background: "#422006",
230
- color: "#fbbf24"
231
- },
232
- dispatching: {
233
- ...O,
234
- background: "#1e3a5f",
235
- color: "#60a5fa"
236
- },
237
- resolved: {
238
- ...O,
239
- background: "#14532d",
240
- color: "#4ade80"
241
- },
242
- error: {
243
- ...O,
244
- background: "#450a0a",
245
- color: "#f87171"
246
- },
247
- aborted: {
248
- ...O,
249
- background: "#292524",
250
- color: "#a8a29e"
251
- }
252
- }, Ge = {
253
- flex: "1",
254
- "font-size": "11px",
255
- color: "#a8a29e",
256
- "white-space": "nowrap",
257
- overflow: "hidden",
258
- "text-overflow": "ellipsis"
259
- }, Pe = {
260
- "font-size": "11px",
261
- color: "#57534e",
262
- "min-width": "50px",
263
- "text-align": "right"
264
- }, Je = {
265
- display: "flex",
266
- "flex-direction": "column",
267
- "align-items": "center",
268
- "justify-content": "center",
269
- height: "100%",
270
- color: "#57534e",
271
- "text-align": "center",
272
- padding: "32px"
273
- }, Qe = (l) => {
274
- const n = (e) => e === void 0 ? "-" : e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, s = (e) => {
275
- if (e.length === 0) return "-";
276
- const r = e.slice(0, 3).map((a) => String(a)).join(", ");
277
- return e.length > 3 ? `${r} +${e.length - 3}` : r;
278
- }, c = () => [...l.batches].sort((e, r) => r.scheduledAt - e.scheduledAt);
279
- return (() => {
280
- var e = je();
281
- return t(e, Re), g(e, S(D, {
282
- get when() {
283
- return c().length > 0;
284
- },
285
- get fallback() {
286
- return (() => {
287
- var r = He(), a = r.firstChild;
288
- return a.nextSibling, t(r, Je), r;
289
- })();
290
- },
291
- get children() {
292
- return S(G, {
293
- get each() {
294
- return c();
295
- },
296
- children: (r) => (() => {
297
- var a = Fe(), v = a.firstChild, f = v.nextSibling, x = f.nextSibling, u = x.nextSibling;
298
- return t(a, Ve), t(v, Ne), g(v, () => r.batchId), g(f, () => r.status), t(x, Ge), g(x, () => s(r.keys)), t(u, Pe), g(u, () => n(r.duration)), E((h) => {
299
- var i = qe[r.status] || O, d = r.keys.map(String).join(", ");
300
- return h.e = t(f, i, h.e), d !== h.t && N(x, "title", h.t = d), h;
301
- }, {
302
- e: void 0,
303
- t: void 0
304
- }), a;
305
- })()
306
- });
307
- }
308
- })), e;
309
- })();
310
- };
311
- var Ue = /* @__PURE__ */ w("<div>"), We = /* @__PURE__ */ w("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No events</div><div style=font-size:11px;color:#57534e>Events appear as batchers process requests"), Xe = /* @__PURE__ */ w("<div><span></span><span></span><span>");
312
- const Ye = {
313
- display: "flex",
314
- "flex-direction": "column",
315
- gap: "1px",
316
- "font-size": "11px"
317
- }, Ze = {
318
- display: "flex",
319
- gap: "12px",
320
- padding: "4px 8px",
321
- background: "#1c1917"
322
- }, et = {
323
- color: "#57534e",
324
- "min-width": "60px"
325
- }, tt = {
326
- "min-width": "60px",
327
- "font-weight": "500"
328
- }, nt = {
329
- get: "#60a5fa",
330
- dedup: "#c084fc",
331
- schedule: "#fbbf24",
332
- dispatch: "#22d3ee",
333
- resolve: "#4ade80",
334
- error: "#f87171",
335
- abort: "#a8a29e"
336
- }, it = {
337
- color: "#78716c",
338
- flex: "1",
339
- "white-space": "nowrap",
340
- overflow: "hidden",
341
- "text-overflow": "ellipsis"
342
- }, rt = {
343
- display: "flex",
344
- "flex-direction": "column",
345
- "align-items": "center",
346
- "justify-content": "center",
347
- height: "100%",
348
- color: "#57534e",
349
- "text-align": "center",
350
- padding: "32px"
351
- }, ot = (l) => {
352
- const n = (e) => (e / 1e3).toFixed(3) + "s", s = (e) => {
353
- switch (e.type) {
354
- case "get":
355
- return `key: ${String(e.key)}`;
356
- case "dedup":
357
- return `key: ${String(e.key)} (dedup)`;
358
- case "schedule":
359
- return `batch: ${e.batchId}, size: ${e.size}`;
360
- case "dispatch":
361
- return `batch: ${e.batchId}, keys: [${e.keys.map(String).join(", ")}]`;
362
- case "resolve":
363
- return `batch: ${e.batchId}, ${e.duration.toFixed(1)}ms`;
364
- case "error":
365
- return `batch: ${e.batchId}, ${e.error.message}`;
366
- case "abort":
367
- return `batch: ${e.batchId}`;
368
- default:
369
- return "";
370
- }
371
- }, c = () => [...l.events].reverse();
372
- return (() => {
373
- var e = Ue();
374
- return t(e, Ye), g(e, S(D, {
375
- get when() {
376
- return c().length > 0;
377
- },
378
- get fallback() {
379
- return (() => {
380
- var r = We(), a = r.firstChild;
381
- return a.nextSibling, t(r, rt), r;
382
- })();
383
- },
384
- get children() {
385
- return S(G, {
386
- get each() {
387
- return c();
388
- },
389
- children: (r) => (() => {
390
- var a = Xe(), v = a.firstChild, f = v.nextSibling, x = f.nextSibling;
391
- return t(a, Ze), t(v, et), g(v, () => n(r.timestamp)), g(f, () => r.type), t(x, it), g(x, () => s(r)), E((u) => t(f, {
392
- ...tt,
393
- color: nt[r.type]
394
- }, u)), a;
395
- })()
396
- });
397
- }
398
- })), e;
399
- })();
400
- };
401
- var st = /* @__PURE__ */ w("<div><div><div>Gets</div><div></div></div><div><div>Batches</div><div></div></div><div><div>Deduped</div><div><span>(<!>%)</span></div></div><div><div>Avg Size</div><div></div></div><div><div>Avg Time</div><div><span>ms</span></div></div><div><div>Err / Abort</div><div><span></span><span style=color:#57534e> / </span><span>");
402
- const lt = {
403
- display: "grid",
404
- "grid-template-columns": "repeat(auto-fit, minmax(120px, 1fr))",
405
- gap: "1px",
406
- background: "#292524"
407
- }, z = {
408
- padding: "12px",
409
- background: "#1c1917"
410
- }, A = {
411
- "font-size": "11px",
412
- "text-transform": "uppercase",
413
- "letter-spacing": "0.5px",
414
- color: "#78716c",
415
- "margin-bottom": "4px"
416
- }, I = {
417
- "font-size": "20px",
418
- "font-weight": "500",
419
- color: "#f5f5f4"
420
- }, Y = {
421
- "font-size": "11px",
422
- color: "#57534e",
423
- "margin-left": "2px"
424
- }, ct = (l) => {
425
- const n = Z(() => {
426
- const s = l.events, c = l.batches, e = s.filter((d) => d.type === "get").length, r = s.filter((d) => d.type === "dedup").length, a = c.filter((d) => d.status === "resolved"), v = a.length, f = v > 0 ? a.reduce((d, y) => d + y.keys.length, 0) / v : 0, x = v > 0 ? a.reduce((d, y) => d + (y.duration || 0), 0) / v : 0, u = c.filter((d) => d.status === "error").length, h = c.filter((d) => d.status === "aborted").length, i = e > 0 ? r / e * 100 : 0;
427
- return {
428
- totalGets: e,
429
- totalBatches: v,
430
- dedupedKeys: r,
431
- avgBatchSize: f,
432
- avgDuration: x,
433
- errors: u,
434
- aborts: h,
435
- dedupRate: i
436
- };
437
- });
438
- return (() => {
439
- var s = st(), c = s.firstChild, e = c.firstChild, r = e.nextSibling, a = c.nextSibling, v = a.firstChild, f = v.nextSibling, x = a.nextSibling, u = x.firstChild, h = u.nextSibling, i = h.firstChild, d = i.firstChild, y = d.nextSibling;
440
- y.nextSibling;
441
- var b = x.nextSibling, p = b.firstChild, _ = p.nextSibling, $ = b.nextSibling, K = $.firstChild, C = K.nextSibling, B = C.firstChild, T = $.nextSibling, L = T.firstChild, k = L.nextSibling, m = k.firstChild, M = m.nextSibling, j = M.nextSibling;
442
- return t(s, lt), g(r, () => n().totalGets), g(f, () => n().totalBatches), g(h, () => n().dedupedKeys, i), g(i, () => n().dedupRate.toFixed(0), y), g(_, () => n().avgBatchSize.toFixed(1)), g(C, () => n().avgDuration.toFixed(0), B), g(m, () => n().errors), g(j, () => n().aborts), E((o) => {
443
- var F = z, R = A, ie = I, re = z, oe = A, se = I, le = z, ce = A, ae = I, de = Y, ue = z, ve = A, fe = I, he = z, ge = A, be = I, xe = Y, pe = z, me = A, ye = I, Q = n().errors > 0 ? "#f87171" : "#f5f5f4", U = n().aborts > 0 ? "#fbbf24" : "#f5f5f4";
444
- return o.e = t(c, F, o.e), o.t = t(e, R, o.t), o.a = t(r, ie, o.a), o.o = t(a, re, o.o), o.i = t(v, oe, o.i), o.n = t(f, se, o.n), o.s = t(x, le, o.s), o.h = t(u, ce, o.h), o.r = t(h, ae, o.r), o.d = t(i, de, o.d), o.l = t(b, ue, o.l), o.u = t(p, ve, o.u), o.c = t(_, fe, o.c), o.w = t($, he, o.w), o.m = t(K, ge, o.m), o.f = t(C, be, o.f), o.y = t(B, xe, o.y), o.g = t(T, pe, o.g), o.p = t(L, me, o.p), o.b = t(k, ye, o.b), Q !== o.T && W(m, "color", o.T = Q), U !== o.A && W(j, "color", o.A = U), o;
445
- }, {
446
- e: void 0,
447
- t: void 0,
448
- a: void 0,
449
- o: void 0,
450
- i: void 0,
451
- n: void 0,
452
- s: void 0,
453
- h: void 0,
454
- r: void 0,
455
- d: void 0,
456
- l: void 0,
457
- u: void 0,
458
- c: void 0,
459
- w: void 0,
460
- m: void 0,
461
- f: void 0,
462
- y: void 0,
463
- g: void 0,
464
- p: void 0,
465
- b: void 0,
466
- T: void 0,
467
- A: void 0
468
- }), s;
469
- })();
470
- };
471
- var at = /* @__PURE__ */ w('<button><svg width=20 height=20 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M4 6h16M4 12h16M4 18h10"stroke=currentColor stroke-width=2 stroke-linecap=square></path><circle cx=19 cy=18 r=2.5 fill=currentColor>');
472
- const ne = {
473
- position: "fixed",
474
- bottom: "16px",
475
- right: "16px",
476
- width: "40px",
477
- height: "40px",
478
- border: "1px solid #44403c",
479
- background: "#1c1917",
480
- color: "#a8a29e",
481
- cursor: "pointer",
482
- display: "flex",
483
- "align-items": "center",
484
- "justify-content": "center",
485
- "z-index": "99999",
486
- "font-family": "ui-monospace, monospace"
487
- }, dt = {
488
- ...ne,
489
- background: "#292524",
490
- color: "#f5f5f4",
491
- "border-color": "#57534e"
492
- }, ut = (l) => {
493
- const n = () => ({
494
- ...l.isOpen ? dt : ne,
495
- ...l.style
496
- });
497
- return (() => {
498
- var s = at();
499
- return _e(s, "click", l.onClick, !0), E((c) => {
500
- var e = l.class, r = n(), a = l.isOpen ? "Close BatchKit DevTools" : "Open BatchKit DevTools", v = l.isOpen ? "Close BatchKit DevTools" : "Open BatchKit DevTools";
501
- return e !== c.e && ee(s, c.e = e), c.t = t(s, r, c.t), a !== c.a && N(s, "title", c.a = a), v !== c.o && N(s, "aria-label", c.o = v), c;
502
- }, {
503
- e: void 0,
504
- t: void 0,
505
- a: void 0,
506
- o: void 0
507
- }), s;
508
- })();
509
- };
510
- P(["click"]);
511
- var vt = /* @__PURE__ */ w("<div><div><div><span style=color:#78716c>[=]</span>Devtools</div><button>Clear</button></div><div><div><div>Batchers</div></div><div><div><button>Timeline</button><button>Events</button><button>Stats</button></div><div>");
512
- const ft = {
513
- position: "fixed",
514
- bottom: "72px",
515
- right: "16px",
516
- width: "640px",
517
- "max-width": "calc(100vw - 32px)",
518
- height: "420px",
519
- "max-height": "calc(100vh - 120px)",
520
- background: "#0c0a09",
521
- border: "1px solid #44403c",
522
- display: "flex",
523
- "flex-direction": "column",
524
- overflow: "hidden",
525
- "z-index": "99998",
526
- "font-family": "ui-monospace, monospace",
527
- color: "#d6d3d1"
528
- }, ht = {
529
- display: "flex",
530
- "align-items": "center",
531
- "justify-content": "space-between",
532
- padding: "8px 12px",
533
- background: "#1c1917",
534
- "border-bottom": "1px solid #44403c"
535
- }, gt = {
536
- "font-size": "11px",
537
- "font-weight": "500",
538
- color: "#a8a29e",
539
- display: "flex",
540
- "align-items": "center",
541
- gap: "8px",
542
- "text-transform": "uppercase",
543
- "letter-spacing": "0.5px"
544
- }, bt = {
545
- padding: "4px 8px",
546
- border: "1px solid #44403c",
547
- background: "#1c1917",
548
- color: "#78716c",
549
- "font-size": "11px",
550
- "font-family": "ui-monospace, monospace",
551
- cursor: "pointer"
552
- }, xt = {
553
- display: "flex",
554
- flex: "1",
555
- "min-height": "0"
556
- }, pt = {
557
- width: "180px",
558
- "border-right": "1px solid #44403c",
559
- display: "flex",
560
- "flex-direction": "column",
561
- background: "#0c0a09"
562
- }, mt = {
563
- padding: "8px 12px",
564
- "font-size": "11px",
565
- "font-weight": "500",
566
- "text-transform": "uppercase",
567
- "letter-spacing": "0.5px",
568
- color: "#78716c",
569
- "border-bottom": "1px solid #292524"
570
- }, yt = {
571
- flex: "1",
572
- display: "flex",
573
- "flex-direction": "column",
574
- "min-width": "0"
575
- }, St = {
576
- display: "flex",
577
- "border-bottom": "1px solid #44403c",
578
- background: "#1c1917"
579
- }, H = {
580
- padding: "8px 12px",
581
- "font-size": "11px",
582
- "font-weight": "500",
583
- color: "#78716c",
584
- cursor: "pointer",
585
- "border-bottom": "1px solid transparent",
586
- "margin-bottom": "-1px",
587
- background: "transparent",
588
- border: "none",
589
- "font-family": "ui-monospace, monospace"
590
- }, V = {
591
- ...H,
592
- color: "#f5f5f4",
593
- "border-bottom": "1px solid #f5f5f4"
594
- }, wt = {
595
- flex: "1",
596
- overflow: "auto",
597
- padding: "12px",
598
- background: "#0c0a09"
599
- }, _t = (l) => {
600
- const n = ke(), [s, c] = q("timeline"), e = () => {
601
- Be(!n().isOpen);
602
- }, r = () => {
603
- J().clear();
604
- }, a = () => n().selectedBatcher, v = () => n().batchers, f = () => n().events, x = () => n().batches, u = () => {
605
- const i = a();
606
- return i ? f().filter((d) => d.batcherName === i) : f();
607
- }, h = () => {
608
- const i = a();
609
- return i ? Array.from(x().values()).filter((d) => d.batcherName === i) : Array.from(x().values());
610
- };
611
- return [S(ut, {
612
- get isOpen() {
613
- return n().isOpen;
614
- },
615
- onClick: e,
616
- get style() {
617
- return l.buttonStyle;
618
- },
619
- get class() {
620
- return l.buttonClass;
621
- }
622
- }), S(D, {
623
- get when() {
624
- return n().isOpen;
625
- },
626
- get children() {
627
- var i = vt(), d = i.firstChild, y = d.firstChild;
628
- y.firstChild;
629
- var b = y.nextSibling, p = d.nextSibling, _ = p.firstChild, $ = _.firstChild, K = _.nextSibling, C = K.firstChild, B = C.firstChild, T = B.nextSibling, L = T.nextSibling, k = C.nextSibling;
630
- return t(d, ht), t(y, gt), b.$$click = r, t(b, bt), t(p, xt), t(_, pt), t($, mt), g(_, S(Me, {
631
- get batchers() {
632
- return v();
633
- },
634
- get events() {
635
- return f();
636
- },
637
- get selectedBatcher() {
638
- return a();
639
- },
640
- onSelect: Te
641
- }), null), t(K, yt), t(C, St), B.$$click = () => c("timeline"), T.$$click = () => c("events"), L.$$click = () => c("stats"), t(k, wt), g(k, S(D, {
642
- get when() {
643
- return s() === "timeline";
644
- },
645
- get children() {
646
- return S(Qe, {
647
- get batches() {
648
- return h();
649
- }
650
- });
651
- }
652
- }), null), g(k, S(D, {
653
- get when() {
654
- return s() === "events";
655
- },
656
- get children() {
657
- return S(ot, {
658
- get events() {
659
- return u();
660
- }
661
- });
662
- }
663
- }), null), g(k, S(D, {
664
- get when() {
665
- return s() === "stats";
666
- },
667
- get children() {
668
- return S(ct, {
669
- get events() {
670
- return u();
671
- },
672
- get batches() {
673
- return h();
674
- }
675
- });
676
- }
677
- }), null), E((m) => {
678
- var M = l.panelClass, j = {
679
- ...ft,
680
- ...l.panelStyle
681
- }, o = s() === "timeline" ? V : H, F = s() === "events" ? V : H, R = s() === "stats" ? V : H;
682
- return M !== m.e && ee(i, m.e = M), m.t = t(i, j, m.t), m.a = t(B, o, m.a), m.o = t(T, F, m.o), m.i = t(L, R, m.i), m;
683
- }, {
684
- e: void 0,
685
- t: void 0,
686
- a: void 0,
687
- o: void 0,
688
- i: void 0
689
- }), i;
690
- }
691
- })];
692
- };
693
- P(["click"]);
694
- function kt(l, n) {
695
- if (typeof window > "u")
696
- return () => {
697
- };
698
- J();
699
- const s = {
700
- buttonStyle: n == null ? void 0 : n.buttonStyle,
701
- buttonClass: n == null ? void 0 : n.buttonClass,
702
- panelStyle: n == null ? void 0 : n.panelStyle,
703
- panelClass: n == null ? void 0 : n.panelClass
704
- };
705
- return $e(() => _t(s), l);
706
- }
1
+ import { m as e } from "./mount-DTowB9fq.js";
2
+ import { g as m, i, u as n } from "./mount-DTowB9fq.js";
3
+ const o = process.env.NODE_ENV !== "development" ? () => () => {
4
+ } : e;
707
5
  export {
708
- J as getRegistry,
709
- kt as mount,
710
- ke as useStore
6
+ m as getRegistry,
7
+ i as initRegistry,
8
+ o as mount,
9
+ n as useStore
711
10
  };