batchkit-devtools 0.3.6 → 0.3.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../src/components/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,GAAG,EAAE,MAAM,UAAU,CAAC;AAUjE,KAAK,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAwOD,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,UAAU,CAqLvC,CAAC"}
1
+ {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../src/components/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,GAAG,EAAE,MAAM,UAAU,CAAC;AAUjE,KAAK,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA6OD,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,UAAU,CAqLvC,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { m as e } from "./mount-CKKkXlex.js";
2
- import { c as i, g as m, i as n, u as a } from "./mount-CKKkXlex.js";
1
+ import { m as e } from "./mount-Cl_oAy4R.js";
2
+ import { c as i, g as m, i as n, u as a } from "./mount-Cl_oAy4R.js";
3
3
  const t = process.env.NODE_ENV !== "development" ? () => () => {
4
4
  } : e;
5
5
  export {
@@ -1,8 +1,8 @@
1
- import { delegateEvents as ne, template as _, style as o, insert as g, createComponent as k, effect as B, memo as N, setAttribute as te, setStyleProperty as he, addEventListener as De, className as we, render as je } from "solid-js/web";
2
- import { createRoot as Me, createSignal as J, createMemo as _e, For as de, Show as L, onMount as Le } from "solid-js";
1
+ import { delegateEvents as ne, template as _, style as o, insert as g, createComponent as k, effect as B, memo as L, setAttribute as te, setStyleProperty as ge, addEventListener as Re, className as _e, render as De } from "solid-js/web";
2
+ import { createRoot as je, createSignal as Z, createMemo as ke, For as de, Show as N, onMount as Me } from "solid-js";
3
3
  import { __setDevtoolsHook as Ne } from "batchkit";
4
- let Fe = 0;
5
- function Ue(i) {
4
+ let Le = 0;
5
+ function Fe(i) {
6
6
  if (!i) return;
7
7
  const e = i.split(`
8
8
  `);
@@ -17,8 +17,8 @@ function Ue(i) {
17
17
  if (r) return r[1];
18
18
  }
19
19
  }
20
- function Ke() {
21
- const [i, e] = J({
20
+ function Ue() {
21
+ const [i, e] = Z({
22
22
  batchers: /* @__PURE__ */ new Map(),
23
23
  events: [],
24
24
  batches: /* @__PURE__ */ new Map(),
@@ -42,46 +42,46 @@ function Ke() {
42
42
  e((C) => {
43
43
  const T = [...C.events, d], $ = new Map(C.batches);
44
44
  if (d.type === "schedule") {
45
- const S = {
45
+ const y = {
46
46
  batchId: d.batchId,
47
47
  batcherName: a,
48
48
  keys: [],
49
49
  status: "scheduled",
50
50
  scheduledAt: d.timestamp
51
51
  };
52
- $.set(d.batchId, S);
52
+ $.set(d.batchId, y);
53
53
  }
54
54
  if (d.type === "dispatch") {
55
- const S = $.get(d.batchId);
56
- S && $.set(d.batchId, {
57
- ...S,
55
+ const y = $.get(d.batchId);
56
+ y && $.set(d.batchId, {
57
+ ...y,
58
58
  keys: d.keys,
59
59
  status: "dispatching",
60
60
  dispatchedAt: d.timestamp
61
61
  });
62
62
  }
63
63
  if (d.type === "resolve") {
64
- const S = $.get(d.batchId);
65
- S && $.set(d.batchId, {
66
- ...S,
64
+ const y = $.get(d.batchId);
65
+ y && $.set(d.batchId, {
66
+ ...y,
67
67
  status: "resolved",
68
68
  completedAt: d.timestamp,
69
69
  duration: d.duration
70
70
  });
71
71
  }
72
72
  if (d.type === "error") {
73
- const S = $.get(d.batchId);
74
- S && $.set(d.batchId, {
75
- ...S,
73
+ const y = $.get(d.batchId);
74
+ y && $.set(d.batchId, {
75
+ ...y,
76
76
  status: "error",
77
77
  completedAt: d.timestamp,
78
78
  error: d.error
79
79
  });
80
80
  }
81
81
  if (d.type === "abort") {
82
- const S = $.get(d.batchId);
83
- S && $.set(d.batchId, {
84
- ...S,
82
+ const y = $.get(d.batchId);
83
+ y && $.set(d.batchId, {
84
+ ...y,
85
85
  status: "aborted",
86
86
  completedAt: d.timestamp
87
87
  });
@@ -95,14 +95,14 @@ function Ke() {
95
95
  function u() {
96
96
  return i();
97
97
  }
98
- function v() {
98
+ function f() {
99
99
  e((a) => ({
100
100
  ...a,
101
101
  events: [],
102
102
  batches: /* @__PURE__ */ new Map()
103
103
  })), r();
104
104
  }
105
- function f() {
105
+ function v() {
106
106
  e((a) => ({ ...a, isOpen: !0 })), r();
107
107
  }
108
108
  function h() {
@@ -113,22 +113,22 @@ function Ke() {
113
113
  }
114
114
  return Ne({
115
115
  onBatcherCreated({ fn: a, name: p, stack: d }) {
116
- const C = !p, T = p ?? `unnamed-${++Fe}`, $ = a.toString().slice(0, 500), S = Ue(d);
116
+ const C = !p, T = p ?? `unnamed-${++Le}`, $ = a.toString().slice(0, 500), y = Fe(d);
117
117
  return t({
118
118
  name: T,
119
119
  registeredAt: performance.now(),
120
120
  isUnnamed: C,
121
121
  fnSource: $,
122
- location: S
123
- }), (O) => {
124
- n(T, O);
122
+ location: y
123
+ }), (E) => {
124
+ n(T, E);
125
125
  };
126
126
  }
127
127
  }), {
128
128
  subscribe: l,
129
129
  getStore: u,
130
- clear: v,
131
- open: f,
130
+ clear: f,
131
+ open: v,
132
132
  close: h,
133
133
  toggle: b,
134
134
  _setStore: e,
@@ -139,7 +139,7 @@ let z = null;
139
139
  function He() {
140
140
  if (typeof window > "u")
141
141
  throw new Error("DevTools can only be used in browser environment");
142
- return z || (z = Me(() => Ke())), z;
142
+ return z || (z = je(() => Ue())), z;
143
143
  }
144
144
  function Y() {
145
145
  if (!z)
@@ -148,57 +148,57 @@ function Y() {
148
148
  );
149
149
  return z;
150
150
  }
151
- function ke() {
151
+ function Ce() {
152
152
  const i = Y();
153
153
  if (i._store)
154
154
  return i._store;
155
- const [e, s] = J(i.getStore());
155
+ const [e, s] = Z(i.getStore());
156
156
  return i.subscribe(s), e;
157
157
  }
158
- function Pe(i) {
158
+ function Ke(i) {
159
159
  var e;
160
160
  z && ((e = z._setStore) == null || e.call(z, (s) => ({
161
161
  ...s,
162
162
  selectedBatcher: i
163
163
  })));
164
164
  }
165
- function Ge(i) {
165
+ function Pe(i) {
166
166
  var e;
167
167
  z && ((e = z._setStore) == null || e.call(z, (s) => ({
168
168
  ...s,
169
169
  config: { ...s.config, ...i }
170
170
  })));
171
171
  }
172
- var Xe = /* @__PURE__ */ _("<div>"), We = /* @__PURE__ */ _("<div><div></div><div><span> gets</span><span> batches"), Ye = /* @__PURE__ */ _("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No batchers yet</div><div style=font-size:11px;color:#57534e>Call batch() to see it here");
173
- const qe = {
172
+ var Xe = /* @__PURE__ */ _("<div>"), Ge = /* @__PURE__ */ _("<div><div></div><div><span> gets</span><span> batches"), We = /* @__PURE__ */ _("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No batchers yet</div><div style=font-size:11px;color:#57534e>Call batch() to see it here");
173
+ const Ye = {
174
174
  flex: "1",
175
175
  "overflow-y": "auto"
176
- }, Ce = {
176
+ }, ze = {
177
177
  padding: "8px 12px",
178
178
  cursor: "pointer",
179
179
  "border-bottom": "1px solid #292524",
180
180
  "border-left": "2px solid transparent"
181
- }, Je = {
182
- ...Ce,
181
+ }, qe = {
182
+ ...ze,
183
183
  background: "#1c1917",
184
184
  "border-left-color": "#a8a29e"
185
- }, ze = {
185
+ }, Te = {
186
186
  "font-size": "13px",
187
187
  color: "#d6d3d1",
188
188
  "margin-bottom": "2px"
189
189
  }, Ze = {
190
- ...ze,
190
+ ...Te,
191
191
  color: "#78716c",
192
192
  "font-style": "italic"
193
- }, Qe = {
193
+ }, Je = {
194
194
  "font-size": "11px",
195
195
  color: "#78716c"
196
- }, ge = {
196
+ }, me = {
197
197
  display: "inline-flex",
198
198
  "align-items": "center",
199
199
  gap: "4px",
200
200
  "margin-right": "8px"
201
- }, Ve = {
201
+ }, Qe = {
202
202
  display: "flex",
203
203
  "flex-direction": "column",
204
204
  "align-items": "center",
@@ -207,9 +207,9 @@ const qe = {
207
207
  color: "#57534e",
208
208
  "text-align": "center",
209
209
  padding: "24px 12px"
210
- }, et = (i) => {
211
- const e = _e(() => Array.from(i.batchers.values())), s = (t) => {
212
- const n = i.events.filter((v) => v.batcherName === t), l = n.filter((v) => v.type === "get").length, u = n.filter((v) => v.type === "resolve").length;
210
+ }, Ve = (i) => {
211
+ const e = ke(() => Array.from(i.batchers.values())), s = (t) => {
212
+ const n = i.events.filter((f) => f.batcherName === t), l = n.filter((f) => f.type === "get").length, u = n.filter((f) => f.type === "resolve").length;
213
213
  return {
214
214
  gets: l,
215
215
  batches: u
@@ -219,96 +219,96 @@ const qe = {
219
219
  };
220
220
  return (() => {
221
221
  var t = Xe();
222
- return o(t, qe), g(t, k(de, {
222
+ return o(t, Ye), g(t, k(de, {
223
223
  get each() {
224
224
  return e();
225
225
  },
226
226
  children: (n) => {
227
227
  const l = () => s(n.name), u = () => i.selectedBatcher === n.name;
228
228
  return (() => {
229
- var v = We(), f = v.firstChild, h = f.nextSibling, b = h.firstChild, y = b.firstChild, a = b.nextSibling, p = a.firstChild;
230
- return v.$$click = () => r(n.name), g(f, () => n.name), o(h, Qe), g(b, () => l().gets, y), g(a, () => l().batches, p), B((d) => {
231
- var C = u() ? Je : Ce, T = n.isUnnamed ? Ze : ze, $ = ge, S = ge;
232
- return d.e = o(v, C, d.e), d.t = o(f, T, d.t), d.a = o(b, $, d.a), d.o = o(a, S, d.o), d;
229
+ var f = Ge(), v = f.firstChild, h = v.nextSibling, b = h.firstChild, x = b.firstChild, a = b.nextSibling, p = a.firstChild;
230
+ return f.$$click = () => r(n.name), g(v, () => n.name), o(h, Je), g(b, () => l().gets, x), g(a, () => l().batches, p), B((d) => {
231
+ var C = u() ? qe : ze, T = n.isUnnamed ? Ze : Te, $ = me, y = me;
232
+ return d.e = o(f, C, d.e), d.t = o(v, T, d.t), d.a = o(b, $, d.a), d.o = o(a, y, d.o), d;
233
233
  }, {
234
234
  e: void 0,
235
235
  t: void 0,
236
236
  a: void 0,
237
237
  o: void 0
238
- }), v;
238
+ }), f;
239
239
  })();
240
240
  }
241
241
  }), null), g(t, (() => {
242
- var n = N(() => e().length === 0);
242
+ var n = L(() => e().length === 0);
243
243
  return () => n() && (() => {
244
- var l = Ye(), u = l.firstChild;
245
- return u.nextSibling, o(l, Ve), l;
244
+ var l = We(), u = l.firstChild;
245
+ return u.nextSibling, o(l, Qe), l;
246
246
  })();
247
247
  })(), null), t;
248
248
  })();
249
249
  };
250
250
  ne(["click"]);
251
- var tt = /* @__PURE__ */ _("<div>"), nt = /* @__PURE__ */ _("<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"), rt = /* @__PURE__ */ _("<div><div></div><div></div><div></div><div>");
252
- const ot = {
251
+ var et = /* @__PURE__ */ _("<div>"), tt = /* @__PURE__ */ _("<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"), nt = /* @__PURE__ */ _("<div><div></div><div></div><div></div><div>");
252
+ const rt = {
253
253
  display: "flex",
254
254
  "flex-direction": "column",
255
255
  gap: "1px"
256
- }, it = {
256
+ }, ot = {
257
257
  display: "flex",
258
258
  "align-items": "center",
259
259
  gap: "12px",
260
260
  padding: "6px 8px",
261
261
  background: "#1c1917",
262
262
  "font-size": "11px"
263
- }, st = {
263
+ }, it = {
264
264
  "font-size": "11px",
265
265
  color: "#78716c",
266
266
  "min-width": "80px"
267
- }, H = {
267
+ }, K = {
268
268
  padding: "2px 6px",
269
269
  "font-size": "10px",
270
270
  "font-weight": "500",
271
271
  "text-transform": "uppercase",
272
272
  "letter-spacing": "0.3px"
273
- }, lt = {
273
+ }, st = {
274
274
  scheduled: {
275
- ...H,
275
+ ...K,
276
276
  background: "#422006",
277
277
  color: "#fbbf24"
278
278
  },
279
279
  dispatching: {
280
- ...H,
280
+ ...K,
281
281
  background: "#1e3a5f",
282
282
  color: "#60a5fa"
283
283
  },
284
284
  resolved: {
285
- ...H,
285
+ ...K,
286
286
  background: "#14532d",
287
287
  color: "#4ade80"
288
288
  },
289
289
  error: {
290
- ...H,
290
+ ...K,
291
291
  background: "#450a0a",
292
292
  color: "#f87171"
293
293
  },
294
294
  aborted: {
295
- ...H,
295
+ ...K,
296
296
  background: "#292524",
297
297
  color: "#a8a29e"
298
298
  }
299
- }, ct = {
299
+ }, lt = {
300
300
  flex: "1",
301
301
  "font-size": "11px",
302
302
  color: "#a8a29e",
303
303
  "white-space": "nowrap",
304
304
  overflow: "hidden",
305
305
  "text-overflow": "ellipsis"
306
- }, at = {
306
+ }, ct = {
307
307
  "font-size": "11px",
308
308
  color: "#57534e",
309
309
  "min-width": "50px",
310
310
  "text-align": "right"
311
- }, dt = {
311
+ }, at = {
312
312
  display: "flex",
313
313
  "flex-direction": "column",
314
314
  "align-items": "center",
@@ -317,22 +317,22 @@ const ot = {
317
317
  color: "#57534e",
318
318
  "text-align": "center",
319
319
  padding: "32px"
320
- }, ut = (i) => {
320
+ }, dt = (i) => {
321
321
  const e = (t) => t === void 0 ? "-" : t < 1 ? "<1ms" : t < 1e3 ? `${Math.round(t)}ms` : `${(t / 1e3).toFixed(2)}s`, s = (t) => {
322
322
  if (t.length === 0) return "-";
323
323
  const n = t.slice(0, 3).map((l) => String(l)).join(", ");
324
324
  return t.length > 3 ? `${n} +${t.length - 3}` : n;
325
325
  }, r = () => [...i.batches].sort((t, n) => n.scheduledAt - t.scheduledAt);
326
326
  return (() => {
327
- var t = tt();
328
- return o(t, ot), g(t, k(L, {
327
+ var t = et();
328
+ return o(t, rt), g(t, k(N, {
329
329
  get when() {
330
330
  return r().length > 0;
331
331
  },
332
332
  get fallback() {
333
333
  return (() => {
334
- var n = nt(), l = n.firstChild;
335
- return l.nextSibling, o(n, dt), n;
334
+ var n = tt(), l = n.firstChild;
335
+ return l.nextSibling, o(n, at), n;
336
336
  })();
337
337
  },
338
338
  get children() {
@@ -341,10 +341,10 @@ const ot = {
341
341
  return r();
342
342
  },
343
343
  children: (n) => (() => {
344
- var l = rt(), u = l.firstChild, v = u.nextSibling, f = v.nextSibling, h = f.nextSibling;
345
- return o(l, it), o(u, st), g(u, () => n.batchId), g(v, () => n.status), o(f, ct), g(f, () => s(n.keys)), o(h, at), g(h, () => e(n.duration)), B((b) => {
346
- var y = lt[n.status] || H, a = n.keys.map(String).join(", ");
347
- return b.e = o(v, y, b.e), a !== b.t && te(f, "title", b.t = a), b;
344
+ var l = nt(), u = l.firstChild, f = u.nextSibling, v = f.nextSibling, h = v.nextSibling;
345
+ return o(l, ot), o(u, it), g(u, () => n.batchId), g(f, () => n.status), o(v, lt), g(v, () => s(n.keys)), o(h, ct), g(h, () => e(n.duration)), B((b) => {
346
+ var x = st[n.status] || K, a = n.keys.map(String).join(", ");
347
+ return b.e = o(f, x, b.e), a !== b.t && te(v, "title", b.t = a), b;
348
348
  }, {
349
349
  e: void 0,
350
350
  t: void 0
@@ -355,24 +355,24 @@ const ot = {
355
355
  })), t;
356
356
  })();
357
357
  };
358
- var ft = /* @__PURE__ */ _("<div>"), vt = /* @__PURE__ */ _("<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"), ht = /* @__PURE__ */ _("<div><span></span><span></span><span>");
359
- const gt = {
358
+ var ut = /* @__PURE__ */ _("<div>"), ft = /* @__PURE__ */ _("<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"), vt = /* @__PURE__ */ _("<div><span></span><span></span><span>");
359
+ const ht = {
360
360
  display: "flex",
361
361
  "flex-direction": "column",
362
362
  gap: "1px",
363
363
  "font-size": "11px"
364
- }, mt = {
364
+ }, gt = {
365
365
  display: "flex",
366
366
  gap: "12px",
367
367
  padding: "4px 8px",
368
368
  background: "#1c1917"
369
- }, bt = {
369
+ }, mt = {
370
370
  color: "#57534e",
371
371
  "min-width": "60px"
372
- }, pt = {
372
+ }, bt = {
373
373
  "min-width": "60px",
374
374
  "font-weight": "500"
375
- }, xt = {
375
+ }, pt = {
376
376
  get: "#60a5fa",
377
377
  dedup: "#c084fc",
378
378
  schedule: "#fbbf24",
@@ -380,13 +380,13 @@ const gt = {
380
380
  resolve: "#4ade80",
381
381
  error: "#f87171",
382
382
  abort: "#a8a29e"
383
- }, yt = {
383
+ }, xt = {
384
384
  color: "#78716c",
385
385
  flex: "1",
386
386
  "white-space": "nowrap",
387
387
  overflow: "hidden",
388
388
  "text-overflow": "ellipsis"
389
- }, St = {
389
+ }, yt = {
390
390
  display: "flex",
391
391
  "flex-direction": "column",
392
392
  "align-items": "center",
@@ -395,7 +395,7 @@ const gt = {
395
395
  color: "#57534e",
396
396
  "text-align": "center",
397
397
  padding: "32px"
398
- }, $t = (i) => {
398
+ }, St = (i) => {
399
399
  const e = (t) => (t / 1e3).toFixed(3) + "s", s = (t) => {
400
400
  switch (t.type) {
401
401
  case "get":
@@ -417,15 +417,15 @@ const gt = {
417
417
  }
418
418
  }, r = () => [...i.events].reverse();
419
419
  return (() => {
420
- var t = ft();
421
- return o(t, gt), g(t, k(L, {
420
+ var t = ut();
421
+ return o(t, ht), g(t, k(N, {
422
422
  get when() {
423
423
  return r().length > 0;
424
424
  },
425
425
  get fallback() {
426
426
  return (() => {
427
- var n = vt(), l = n.firstChild;
428
- return l.nextSibling, o(n, St), n;
427
+ var n = ft(), l = n.firstChild;
428
+ return l.nextSibling, o(n, yt), n;
429
429
  })();
430
430
  },
431
431
  get children() {
@@ -434,10 +434,10 @@ const gt = {
434
434
  return r();
435
435
  },
436
436
  children: (n) => (() => {
437
- var l = ht(), u = l.firstChild, v = u.nextSibling, f = v.nextSibling;
438
- return o(l, mt), o(u, bt), g(u, () => e(n.timestamp)), g(v, () => n.type), o(f, yt), g(f, () => s(n)), B((h) => o(v, {
439
- ...pt,
440
- color: xt[n.type]
437
+ var l = vt(), u = l.firstChild, f = u.nextSibling, v = f.nextSibling;
438
+ return o(l, gt), o(u, mt), g(u, () => e(n.timestamp)), g(f, () => n.type), o(v, xt), g(v, () => s(n)), B((h) => o(f, {
439
+ ...bt,
440
+ color: pt[n.type]
441
441
  }, h)), l;
442
442
  })()
443
443
  });
@@ -445,8 +445,8 @@ const gt = {
445
445
  })), t;
446
446
  })();
447
447
  };
448
- var wt = /* @__PURE__ */ _("<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>");
449
- const _t = {
448
+ var $t = /* @__PURE__ */ _("<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>");
449
+ const wt = {
450
450
  display: "grid",
451
451
  "grid-template-columns": "repeat(auto-fit, minmax(120px, 1fr))",
452
452
  gap: "1px",
@@ -460,35 +460,35 @@ const _t = {
460
460
  "letter-spacing": "0.5px",
461
461
  color: "#78716c",
462
462
  "margin-bottom": "4px"
463
- }, K = {
463
+ }, H = {
464
464
  "font-size": "20px",
465
465
  "font-weight": "500",
466
466
  color: "#f5f5f4"
467
- }, me = {
467
+ }, be = {
468
468
  "font-size": "11px",
469
469
  color: "#57534e",
470
470
  "margin-left": "2px"
471
- }, kt = (i) => {
472
- const e = _e(() => {
473
- const s = i.events, r = i.batches, t = s.filter((a) => a.type === "get").length, n = s.filter((a) => a.type === "dedup").length, l = r.filter((a) => a.status === "resolved"), u = l.length, v = u > 0 ? l.reduce((a, p) => a + p.keys.length, 0) / u : 0, f = u > 0 ? l.reduce((a, p) => a + (p.duration || 0), 0) / u : 0, h = r.filter((a) => a.status === "error").length, b = r.filter((a) => a.status === "aborted").length, y = t > 0 ? n / t * 100 : 0;
471
+ }, _t = (i) => {
472
+ const e = ke(() => {
473
+ const s = i.events, r = i.batches, t = s.filter((a) => a.type === "get").length, n = s.filter((a) => a.type === "dedup").length, l = r.filter((a) => a.status === "resolved"), u = l.length, f = u > 0 ? l.reduce((a, p) => a + p.keys.length, 0) / u : 0, v = u > 0 ? l.reduce((a, p) => a + (p.duration || 0), 0) / u : 0, h = r.filter((a) => a.status === "error").length, b = r.filter((a) => a.status === "aborted").length, x = t > 0 ? n / t * 100 : 0;
474
474
  return {
475
475
  totalGets: t,
476
476
  totalBatches: u,
477
477
  dedupedKeys: n,
478
- avgBatchSize: v,
479
- avgDuration: f,
478
+ avgBatchSize: f,
479
+ avgDuration: v,
480
480
  errors: h,
481
481
  aborts: b,
482
- dedupRate: y
482
+ dedupRate: x
483
483
  };
484
484
  });
485
485
  return (() => {
486
- var s = wt(), r = s.firstChild, t = r.firstChild, n = t.nextSibling, l = r.nextSibling, u = l.firstChild, v = u.nextSibling, f = l.nextSibling, h = f.firstChild, b = h.nextSibling, y = b.firstChild, a = y.firstChild, p = a.nextSibling;
486
+ var s = $t(), r = s.firstChild, t = r.firstChild, n = t.nextSibling, l = r.nextSibling, u = l.firstChild, f = u.nextSibling, v = l.nextSibling, h = v.firstChild, b = h.nextSibling, x = b.firstChild, a = x.firstChild, p = a.nextSibling;
487
487
  p.nextSibling;
488
- var d = f.nextSibling, C = d.firstChild, T = C.nextSibling, $ = d.nextSibling, S = $.firstChild, O = S.nextSibling, Z = O.firstChild, x = $.nextSibling, w = x.firstChild, E = w.nextSibling, I = E.firstChild, D = I.nextSibling, R = D.nextSibling;
489
- return o(s, _t), g(n, () => e().totalGets), g(v, () => e().totalBatches), g(b, () => e().dedupedKeys, y), g(y, () => e().dedupRate.toFixed(0), p), g(T, () => e().avgBatchSize.toFixed(1)), g(O, () => e().avgDuration.toFixed(0), Z), g(I, () => e().errors), g(R, () => e().aborts), B((c) => {
490
- var P = F, A = U, j = K, G = F, X = U, W = K, Q = F, M = U, m = K, V = me, re = F, oe = U, ie = K, se = F, le = U, ce = K, Ae = me, Oe = F, Ee = U, Re = K, fe = e().errors > 0 ? "#f87171" : "#f5f5f4", ve = e().aborts > 0 ? "#fbbf24" : "#f5f5f4";
491
- return c.e = o(r, P, c.e), c.t = o(t, A, c.t), c.a = o(n, j, c.a), c.o = o(l, G, c.o), c.i = o(u, X, c.i), c.n = o(v, W, c.n), c.s = o(f, Q, c.s), c.h = o(h, M, c.h), c.r = o(b, m, c.r), c.d = o(y, V, c.d), c.l = o(d, re, c.l), c.u = o(C, oe, c.u), c.c = o(T, ie, c.c), c.w = o($, se, c.w), c.m = o(S, le, c.m), c.f = o(O, ce, c.f), c.y = o(Z, Ae, c.y), c.g = o(x, Oe, c.g), c.p = o(w, Ee, c.p), c.b = o(E, Re, c.b), fe !== c.T && he(I, "color", c.T = fe), ve !== c.A && he(R, "color", c.A = ve), c;
488
+ var d = v.nextSibling, C = d.firstChild, T = C.nextSibling, $ = d.nextSibling, y = $.firstChild, E = y.nextSibling, J = E.firstChild, S = $.nextSibling, w = S.firstChild, O = w.nextSibling, I = O.firstChild, D = I.nextSibling, R = D.nextSibling;
489
+ return o(s, wt), g(n, () => e().totalGets), g(f, () => e().totalBatches), g(b, () => e().dedupedKeys, x), g(x, () => e().dedupRate.toFixed(0), p), g(T, () => e().avgBatchSize.toFixed(1)), g(E, () => e().avgDuration.toFixed(0), J), g(I, () => e().errors), g(R, () => e().aborts), B((c) => {
490
+ var P = F, A = U, j = H, X = F, G = U, W = H, Q = F, M = U, m = H, V = be, re = F, oe = U, ie = H, se = F, le = U, ce = H, Ie = be, Ae = F, Ee = U, Oe = H, ve = e().errors > 0 ? "#f87171" : "#f5f5f4", he = e().aborts > 0 ? "#fbbf24" : "#f5f5f4";
491
+ return c.e = o(r, P, c.e), c.t = o(t, A, c.t), c.a = o(n, j, c.a), c.o = o(l, X, c.o), c.i = o(u, G, c.i), c.n = o(f, W, c.n), c.s = o(v, Q, c.s), c.h = o(h, M, c.h), c.r = o(b, m, c.r), c.d = o(x, V, c.d), c.l = o(d, re, c.l), c.u = o(C, oe, c.u), c.c = o(T, ie, c.c), c.w = o($, se, c.w), c.m = o(y, le, c.m), c.f = o(E, ce, c.f), c.y = o(J, Ie, c.y), c.g = o(S, Ae, c.g), c.p = o(w, Ee, c.p), c.b = o(O, Oe, c.b), ve !== c.T && ge(I, "color", c.T = ve), he !== c.A && ge(R, "color", c.A = he), c;
492
492
  }, {
493
493
  e: void 0,
494
494
  t: void 0,
@@ -515,8 +515,8 @@ const _t = {
515
515
  }), s;
516
516
  })();
517
517
  };
518
- var ae = /* @__PURE__ */ _("<div>"), Ct = /* @__PURE__ */ _("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No batcher selected</div><div style=font-size:11px;color:#57534e>Click a batcher to see its trace info"), zt = /* @__PURE__ */ _("<div><div>Function</div><div>"), Tt = /* @__PURE__ */ _('<div style="height:auto;padding:24px 0"><div style=font-size:11px;color:#57534e>No trace metadata available'), Bt = /* @__PURE__ */ _("<span style=color:#78716c;font-weight:normal;font-style:italic> (unnamed)"), It = /* @__PURE__ */ _("<div><div>Location"), At = /* @__PURE__ */ _("<a> ↗");
519
- function Ot(i) {
518
+ var ae = /* @__PURE__ */ _("<div>"), kt = /* @__PURE__ */ _("<div><div style=font-size:11px;color:#78716c;margin-bottom:4px>No batcher selected</div><div style=font-size:11px;color:#57534e>Click a batcher to see its trace info"), Ct = /* @__PURE__ */ _("<div><div>Function</div><div>"), zt = /* @__PURE__ */ _('<div style="height:auto;padding:24px 0"><div style=font-size:11px;color:#57534e>No trace metadata available'), Tt = /* @__PURE__ */ _("<span style=color:#78716c;font-weight:normal;font-style:italic> (unnamed)"), Bt = /* @__PURE__ */ _("<div><div>Location"), It = /* @__PURE__ */ _("<a> ↗");
519
+ function At(i) {
520
520
  let e = i;
521
521
  const s = i.match(/^https?:\/\/[^/]+(.*)$/);
522
522
  s && (e = s[1]), e = e.split("?")[0];
@@ -530,7 +530,7 @@ function Ot(i) {
530
530
  };
531
531
  }
532
532
  function Et(i, e) {
533
- const s = Ot(i);
533
+ const s = At(i);
534
534
  if (!s) return null;
535
535
  let {
536
536
  path: r,
@@ -544,25 +544,25 @@ function Et(i, e) {
544
544
  r = e.projectRoot + "/" + r;
545
545
  else
546
546
  return null;
547
- const l = e.editor ?? "vscode", v = {
547
+ const l = e.editor ?? "vscode", f = {
548
548
  vscode: "vscode://file",
549
549
  cursor: "cursor://file",
550
550
  webstorm: "webstorm://open?file=",
551
551
  idea: "idea://open?file="
552
552
  }[l];
553
- if (!v) return null;
553
+ if (!f) return null;
554
554
  if (l === "webstorm" || l === "idea") {
555
- let h = `${v}${encodeURIComponent(r)}`;
555
+ let h = `${f}${encodeURIComponent(r)}`;
556
556
  return t !== void 0 && (h += `&line=${t}`, n !== void 0 && (h += `&column=${n}`)), h;
557
557
  }
558
- let f = `${v}${r}`;
559
- return t !== void 0 && (f += `:${t}`, n !== void 0 && (f += `:${n}`)), f;
558
+ let v = `${f}${r}`;
559
+ return t !== void 0 && (v += `:${t}`, n !== void 0 && (v += `:${n}`)), v;
560
560
  }
561
- const Rt = {
561
+ const Ot = {
562
562
  padding: "12px",
563
563
  height: "100%",
564
564
  "overflow-y": "auto"
565
- }, be = {
565
+ }, pe = {
566
566
  display: "flex",
567
567
  "flex-direction": "column",
568
568
  "align-items": "center",
@@ -570,9 +570,9 @@ const Rt = {
570
570
  height: "100%",
571
571
  color: "#57534e",
572
572
  "text-align": "center"
573
- }, pe = {
574
- "margin-bottom": "16px"
575
573
  }, xe = {
574
+ "margin-bottom": "16px"
575
+ }, ye = {
576
576
  color: "#78716c",
577
577
  "margin-bottom": "6px",
578
578
  "font-size": "10px",
@@ -584,106 +584,106 @@ const Rt = {
584
584
  "font-size": "11px",
585
585
  color: "#d6d3d1",
586
586
  border: "1px solid #292524"
587
- }, Dt = {
587
+ }, Rt = {
588
588
  ...ue,
589
589
  display: "block",
590
590
  color: "#93c5fd",
591
591
  "text-decoration": "none",
592
592
  cursor: "pointer"
593
- }, jt = {
593
+ }, Dt = {
594
594
  "text-decoration": "underline"
595
- }, Mt = {
595
+ }, jt = {
596
596
  ...ue,
597
597
  "white-space": "pre-wrap",
598
598
  "word-break": "break-all",
599
599
  "max-height": "300px",
600
600
  "overflow-y": "auto",
601
601
  "font-family": "ui-monospace, monospace"
602
- }, Lt = {
602
+ }, Mt = {
603
603
  "font-size": "14px",
604
604
  "font-weight": "600",
605
605
  color: "#f5f5f4",
606
606
  "margin-bottom": "16px"
607
607
  }, Nt = (i) => {
608
- const e = ke(), s = () => e().config;
608
+ const e = Ce(), s = () => e().config;
609
609
  return (() => {
610
610
  var r = ae();
611
- return o(r, Rt), g(r, k(L, {
611
+ return o(r, Ot), g(r, k(N, {
612
612
  get when() {
613
613
  return i.batcher;
614
614
  },
615
615
  get fallback() {
616
616
  return (() => {
617
- var t = Ct(), n = t.firstChild;
618
- return n.nextSibling, B((l) => o(t, be, l)), t;
617
+ var t = kt(), n = t.firstChild;
618
+ return n.nextSibling, B((l) => o(t, pe, l)), t;
619
619
  })();
620
620
  },
621
621
  children: (t) => [(() => {
622
622
  var n = ae();
623
- return o(n, Lt), g(n, () => t().name, null), g(n, (() => {
624
- var l = N(() => !!t().isUnnamed);
625
- return () => l() && Bt();
623
+ return o(n, Mt), g(n, () => t().name, null), g(n, (() => {
624
+ var l = L(() => !!t().isUnnamed);
625
+ return () => l() && Tt();
626
626
  })(), null), n;
627
- })(), k(L, {
627
+ })(), k(N, {
628
628
  get when() {
629
629
  return t().location;
630
630
  },
631
631
  children: (n) => {
632
632
  const l = () => Et(n(), s());
633
633
  return (() => {
634
- var u = It(), v = u.firstChild;
635
- return g(u, k(L, {
634
+ var u = Bt(), f = u.firstChild;
635
+ return g(u, k(N, {
636
636
  get when() {
637
637
  return l();
638
638
  },
639
639
  get fallback() {
640
640
  return (() => {
641
- var f = ae();
642
- return g(f, n), B((h) => o(f, ue, h)), f;
641
+ var v = ae();
642
+ return g(v, n), B((h) => o(v, ue, h)), v;
643
643
  })();
644
644
  },
645
- children: (f) => (() => {
646
- var h = At(), b = h.firstChild;
647
- return h.$$mouseout = (y) => y.currentTarget.style.textDecoration = "none", h.$$mouseover = (y) => Object.assign(y.currentTarget.style, jt), g(h, n, b), B((y) => {
648
- var a = f(), p = Dt;
649
- return a !== y.e && te(h, "href", y.e = a), y.t = o(h, p, y.t), y;
645
+ children: (v) => (() => {
646
+ var h = It(), b = h.firstChild;
647
+ return h.$$mouseout = (x) => x.currentTarget.style.textDecoration = "none", h.$$mouseover = (x) => Object.assign(x.currentTarget.style, Dt), g(h, n, b), B((x) => {
648
+ var a = v(), p = Rt;
649
+ return a !== x.e && te(h, "href", x.e = a), x.t = o(h, p, x.t), x;
650
650
  }, {
651
651
  e: void 0,
652
652
  t: void 0
653
653
  }), h;
654
654
  })()
655
- }), null), B((f) => {
656
- var h = pe, b = xe;
657
- return f.e = o(u, h, f.e), f.t = o(v, b, f.t), f;
655
+ }), null), B((v) => {
656
+ var h = xe, b = ye;
657
+ return v.e = o(u, h, v.e), v.t = o(f, b, v.t), v;
658
658
  }, {
659
659
  e: void 0,
660
660
  t: void 0
661
661
  }), u;
662
662
  })();
663
663
  }
664
- }), k(L, {
664
+ }), k(N, {
665
665
  get when() {
666
666
  return t().fnSource;
667
667
  },
668
668
  get children() {
669
- var n = zt(), l = n.firstChild, u = l.nextSibling;
670
- return g(u, () => t().fnSource), B((v) => {
671
- var f = pe, h = xe, b = Mt;
672
- return v.e = o(n, f, v.e), v.t = o(l, h, v.t), v.a = o(u, b, v.a), v;
669
+ var n = Ct(), l = n.firstChild, u = l.nextSibling;
670
+ return g(u, () => t().fnSource), B((f) => {
671
+ var v = xe, h = ye, b = jt;
672
+ return f.e = o(n, v, f.e), f.t = o(l, h, f.t), f.a = o(u, b, f.a), f;
673
673
  }, {
674
674
  e: void 0,
675
675
  t: void 0,
676
676
  a: void 0
677
677
  }), n;
678
678
  }
679
- }), k(L, {
679
+ }), k(N, {
680
680
  get when() {
681
- return N(() => !t().location)() && !t().fnSource;
681
+ return L(() => !t().location)() && !t().fnSource;
682
682
  },
683
683
  get children() {
684
- var n = Tt();
684
+ var n = zt();
685
685
  return n.firstChild, B((l) => o(n, {
686
- ...be
686
+ ...pe
687
687
  }, l)), n;
688
688
  }
689
689
  })]
@@ -691,8 +691,8 @@ const Rt = {
691
691
  })();
692
692
  };
693
693
  ne(["mouseover", "mouseout"]);
694
- var Ft = /* @__PURE__ */ _("<button>");
695
- const Te = {
694
+ var Lt = /* @__PURE__ */ _("<button>");
695
+ const Be = {
696
696
  position: "fixed",
697
697
  bottom: "16px",
698
698
  right: "16px",
@@ -707,21 +707,21 @@ const Te = {
707
707
  "justify-content": "center",
708
708
  "z-index": "99999",
709
709
  "font-family": "ui-monospace, monospace"
710
- }, Ut = {
711
- ...Te,
710
+ }, Ft = {
711
+ ...Be,
712
712
  background: "#292524",
713
713
  color: "#f5f5f4",
714
714
  "border-color": "#57534e"
715
- }, Kt = (i) => {
715
+ }, Ut = (i) => {
716
716
  const e = () => ({
717
- ...i.isOpen ? Ut : Te,
717
+ ...i.isOpen ? Ft : Be,
718
718
  ...i.style
719
719
  });
720
720
  return (() => {
721
- var s = Ft();
722
- return De(s, "click", i.onClick, !0), g(s, () => i.isOpen ? "[×]" : "[=]"), B((r) => {
721
+ var s = Lt();
722
+ return Re(s, "click", i.onClick, !0), g(s, () => i.isOpen ? "[×]" : "[=]"), B((r) => {
723
723
  var t = i.class, n = e(), l = i.isOpen ? "Close BatchKit DevTools" : "Open BatchKit DevTools", u = i.isOpen ? "Close BatchKit DevTools" : "Open BatchKit DevTools";
724
- return t !== r.e && we(s, r.e = t), r.t = o(s, n, r.t), l !== r.a && te(s, "title", r.a = l), u !== r.o && te(s, "aria-label", r.o = u), r;
724
+ return t !== r.e && _e(s, r.e = t), r.t = o(s, n, r.t), l !== r.a && te(s, "title", r.a = l), u !== r.o && te(s, "aria-label", r.o = u), r;
725
725
  }, {
726
726
  e: void 0,
727
727
  t: void 0,
@@ -732,26 +732,32 @@ const Te = {
732
732
  };
733
733
  ne(["click"]);
734
734
  var Ht = /* @__PURE__ */ _("<div><div></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><button>Trace</button></div><div>");
735
- const Be = "batchkit-devtools", Pt = 650, Gt = 350, ye = 200, Se = 1200, Xt = "0.2s";
736
- function Ie() {
735
+ const fe = "__batchkit_devtools_", Kt = 650, Pt = 350, Se = 200, $e = 1200, Xt = "0.2s";
736
+ function Gt(i) {
737
+ try {
738
+ const e = localStorage.getItem(fe + i);
739
+ return e === null ? void 0 : e === "true";
740
+ } catch {
741
+ return;
742
+ }
743
+ }
744
+ function Wt(i) {
737
745
  try {
738
- const i = localStorage.getItem(Be);
739
- return i ? JSON.parse(i) : {};
746
+ const e = localStorage.getItem(fe + i);
747
+ if (e === null) return;
748
+ const s = parseInt(e, 10);
749
+ return isNaN(s) ? void 0 : s;
740
750
  } catch {
741
- return {};
751
+ return;
742
752
  }
743
753
  }
744
- function $e(i) {
754
+ function we(i, e) {
745
755
  try {
746
- const e = Ie();
747
- localStorage.setItem(Be, JSON.stringify({
748
- ...e,
749
- ...i
750
- }));
756
+ localStorage.setItem(fe + i, String(e));
751
757
  } catch {
752
758
  }
753
759
  }
754
- function Wt(i, e, s) {
760
+ function Yt(i, e, s) {
755
761
  const r = {
756
762
  position: "fixed",
757
763
  background: "#0c0a09",
@@ -798,7 +804,7 @@ function Wt(i, e, s) {
798
804
  };
799
805
  }
800
806
  }
801
- function Yt(i) {
807
+ function qt(i) {
802
808
  const e = {
803
809
  position: "absolute",
804
810
  background: "transparent",
@@ -834,7 +840,7 @@ function Yt(i) {
834
840
  };
835
841
  }
836
842
  }
837
- function qt(i, e) {
843
+ function Zt(i, e) {
838
844
  if (e) return "translate(0, 0)";
839
845
  switch (i) {
840
846
  case "right":
@@ -854,7 +860,7 @@ const Jt = {
854
860
  "border-bottom": "1px solid #44403c",
855
861
  "flex-shrink": "0",
856
862
  "user-select": "none"
857
- }, Zt = {
863
+ }, Qt = {
858
864
  "font-size": "11px",
859
865
  "font-weight": "500",
860
866
  color: "#a8a29e",
@@ -863,7 +869,7 @@ const Jt = {
863
869
  gap: "8px",
864
870
  "text-transform": "uppercase",
865
871
  "letter-spacing": "0.5px"
866
- }, Qt = {
872
+ }, Vt = {
867
873
  padding: "4px 8px",
868
874
  border: "1px solid #44403c",
869
875
  background: "#1c1917",
@@ -871,11 +877,11 @@ const Jt = {
871
877
  "font-size": "11px",
872
878
  "font-family": "ui-monospace, monospace",
873
879
  cursor: "pointer"
874
- }, Vt = {
880
+ }, en = {
875
881
  display: "flex",
876
882
  flex: "1",
877
883
  "min-height": "0"
878
- }, en = {
884
+ }, tn = {
879
885
  width: "160px",
880
886
  "border-right": "1px solid #44403c",
881
887
  display: "flex",
@@ -883,7 +889,7 @@ const Jt = {
883
889
  background: "#0c0a09",
884
890
  "flex-shrink": "0",
885
891
  "user-select": "none"
886
- }, tn = {
892
+ }, nn = {
887
893
  padding: "8px 12px",
888
894
  "font-size": "11px",
889
895
  "font-weight": "500",
@@ -891,12 +897,12 @@ const Jt = {
891
897
  "letter-spacing": "0.5px",
892
898
  color: "#78716c",
893
899
  "border-bottom": "1px solid #292524"
894
- }, nn = {
900
+ }, rn = {
895
901
  flex: "1",
896
902
  display: "flex",
897
903
  "flex-direction": "column",
898
904
  "min-width": "0"
899
- }, rn = {
905
+ }, on = {
900
906
  display: "flex",
901
907
  "border-bottom": "1px solid #44403c",
902
908
  background: "#1c1917",
@@ -917,56 +923,50 @@ const Jt = {
917
923
  ...q,
918
924
  color: "#f5f5f4",
919
925
  "border-bottom": "1px solid #f5f5f4"
920
- }, on = {
926
+ }, sn = {
921
927
  flex: "1",
922
928
  overflow: "auto",
923
929
  padding: "12px",
924
930
  background: "#0c0a09"
925
- }, sn = (i) => {
926
- const e = ke(), [s, r] = J("timeline"), [t, n] = J(!1), l = () => i.position ?? "right", u = () => l() === "bottom", v = () => u() ? Gt : Pt, [f, h] = J(v());
927
- Le(() => {
928
- const x = Ie();
929
- x.isOpen !== void 0 ? x.isOpen && Y().open() : i.defaultOpen && Y().open();
930
- const w = u() ? x.height : x.width;
931
- w && w >= ye && w <= Se && h(w);
931
+ }, ln = (i) => {
932
+ const e = Ce(), [s, r] = Z("timeline"), [t, n] = Z(!1), l = () => i.position ?? "right", u = () => l() === "bottom", f = () => u() ? Pt : Kt, [v, h] = Z(f());
933
+ Me(() => {
934
+ const S = Gt("isOpen");
935
+ S !== void 0 ? S && Y().open() : i.defaultOpen && Y().open();
936
+ const w = Wt("panelSize");
937
+ w && w >= Se && w <= $e && h(w);
932
938
  });
933
939
  const b = () => {
934
- Y().toggle(), $e({
935
- isOpen: !e().isOpen
936
- });
937
- }, y = (x) => {
938
- x.preventDefault(), n(!0);
939
- const w = u() ? x.clientY : x.clientX, E = f(), I = l(), D = (c) => {
940
+ Y().toggle(), we("isOpen", e().isOpen);
941
+ }, x = (S) => {
942
+ S.preventDefault(), n(!0);
943
+ const w = u() ? S.clientY : S.clientX, O = v(), I = l(), D = (c) => {
940
944
  const P = u() ? c.clientY : c.clientX;
941
945
  let A = w - P;
942
946
  I === "left" && (A = -A), I === "bottom" && (A = A);
943
- const j = Math.min(Se, Math.max(ye, E + A));
947
+ const j = Math.min($e, Math.max(Se, O + A));
944
948
  h(j);
945
949
  }, R = () => {
946
- n(!1), document.removeEventListener("mousemove", D), document.removeEventListener("mouseup", R), document.body.style.cursor = "", document.body.style.userSelect = "", $e(u() ? {
947
- height: f()
948
- } : {
949
- width: f()
950
- });
950
+ n(!1), document.removeEventListener("mousemove", D), document.removeEventListener("mouseup", R), document.body.style.cursor = "", document.body.style.userSelect = "", we("panelSize", v());
951
951
  };
952
952
  document.addEventListener("mousemove", D), document.addEventListener("mouseup", R), document.body.style.cursor = u() ? "ns-resize" : "ew-resize", document.body.style.userSelect = "none";
953
953
  }, a = () => {
954
954
  Y().clear();
955
955
  }, p = () => e().selectedBatcher, d = () => e().batchers, C = () => e().events, T = () => e().batches, $ = () => {
956
- const x = p();
957
- return x ? d().get(x) ?? null : null;
958
- }, S = () => {
959
- const x = p();
960
- return x ? C().filter((w) => w.batcherName === x) : C();
961
- }, O = () => {
962
- const x = p();
963
- return x ? Array.from(T().values()).filter((w) => w.batcherName === x) : Array.from(T().values());
964
- }, Z = () => ({
965
- ...Wt(l(), f(), t()),
966
- transform: qt(l(), e().isOpen),
956
+ const S = p();
957
+ return S ? d().get(S) ?? null : null;
958
+ }, y = () => {
959
+ const S = p();
960
+ return S ? C().filter((w) => w.batcherName === S) : C();
961
+ }, E = () => {
962
+ const S = p();
963
+ return S ? Array.from(T().values()).filter((w) => w.batcherName === S) : Array.from(T().values());
964
+ }, J = () => ({
965
+ ...Yt(l(), v(), t()),
966
+ transform: Zt(l(), e().isOpen),
967
967
  ...i.panelStyle
968
968
  });
969
- return [k(Kt, {
969
+ return [k(Ut, {
970
970
  get isOpen() {
971
971
  return e().isOpen;
972
972
  },
@@ -978,10 +978,10 @@ const Jt = {
978
978
  return i.buttonClass;
979
979
  }
980
980
  }), (() => {
981
- var x = Ht(), w = x.firstChild, E = w.nextSibling, I = E.firstChild;
981
+ var S = Ht(), w = S.firstChild, O = w.nextSibling, I = O.firstChild;
982
982
  I.firstChild;
983
- var D = I.nextSibling, R = E.nextSibling, c = R.firstChild, P = c.firstChild, A = c.nextSibling, j = A.firstChild, G = j.firstChild, X = G.nextSibling, W = X.nextSibling, Q = W.nextSibling, M = j.nextSibling;
984
- return w.$$mouseout = (m) => m.currentTarget.style.background = "transparent", w.$$mouseover = (m) => m.currentTarget.style.background = "#44403c", w.$$mousedown = y, o(E, Jt), o(I, Zt), D.$$click = a, o(D, Qt), o(R, Vt), o(c, en), o(P, tn), g(c, k(et, {
983
+ var D = I.nextSibling, R = O.nextSibling, c = R.firstChild, P = c.firstChild, A = c.nextSibling, j = A.firstChild, X = j.firstChild, G = X.nextSibling, W = G.nextSibling, Q = W.nextSibling, M = j.nextSibling;
984
+ return w.$$mouseout = (m) => m.currentTarget.style.background = "transparent", w.$$mouseover = (m) => m.currentTarget.style.background = "#44403c", w.$$mousedown = x, o(O, Jt), o(I, Qt), D.$$click = a, o(D, Vt), o(R, en), o(c, tn), o(P, nn), g(c, k(Ve, {
985
985
  get batchers() {
986
986
  return d();
987
987
  },
@@ -991,41 +991,41 @@ const Jt = {
991
991
  get selectedBatcher() {
992
992
  return p();
993
993
  },
994
- onSelect: Pe
995
- }), null), o(A, nn), o(j, rn), G.$$click = () => r("timeline"), X.$$click = () => r("events"), W.$$click = () => r("stats"), Q.$$click = () => r("trace"), o(M, on), g(M, (() => {
996
- var m = N(() => s() === "timeline");
997
- return () => m() && k(ut, {
994
+ onSelect: Ke
995
+ }), null), o(A, rn), o(j, on), X.$$click = () => r("timeline"), G.$$click = () => r("events"), W.$$click = () => r("stats"), Q.$$click = () => r("trace"), o(M, sn), g(M, (() => {
996
+ var m = L(() => s() === "timeline");
997
+ return () => m() && k(dt, {
998
998
  get batches() {
999
- return O();
999
+ return E();
1000
1000
  }
1001
1001
  });
1002
1002
  })(), null), g(M, (() => {
1003
- var m = N(() => s() === "events");
1004
- return () => m() && k($t, {
1003
+ var m = L(() => s() === "events");
1004
+ return () => m() && k(St, {
1005
1005
  get events() {
1006
- return S();
1006
+ return y();
1007
1007
  }
1008
1008
  });
1009
1009
  })(), null), g(M, (() => {
1010
- var m = N(() => s() === "stats");
1011
- return () => m() && k(kt, {
1010
+ var m = L(() => s() === "stats");
1011
+ return () => m() && k(_t, {
1012
1012
  get events() {
1013
- return S();
1013
+ return y();
1014
1014
  },
1015
1015
  get batches() {
1016
- return O();
1016
+ return E();
1017
1017
  }
1018
1018
  });
1019
1019
  })(), null), g(M, (() => {
1020
- var m = N(() => s() === "trace");
1020
+ var m = L(() => s() === "trace");
1021
1021
  return () => m() && k(Nt, {
1022
1022
  get batcher() {
1023
1023
  return $();
1024
1024
  }
1025
1025
  });
1026
1026
  })(), null), B((m) => {
1027
- var V = i.panelClass, re = Z(), oe = Yt(l()), ie = s() === "timeline" ? ee : q, se = s() === "events" ? ee : q, le = s() === "stats" ? ee : q, ce = s() === "trace" ? ee : q;
1028
- return V !== m.e && we(x, m.e = V), m.t = o(x, re, m.t), m.a = o(w, oe, m.a), m.o = o(G, ie, m.o), m.i = o(X, se, m.i), m.n = o(W, le, m.n), m.s = o(Q, ce, m.s), m;
1027
+ var V = i.panelClass, re = J(), oe = qt(l()), ie = s() === "timeline" ? ee : q, se = s() === "events" ? ee : q, le = s() === "stats" ? ee : q, ce = s() === "trace" ? ee : q;
1028
+ return V !== m.e && _e(S, m.e = V), m.t = o(S, re, m.t), m.a = o(w, oe, m.a), m.o = o(X, ie, m.o), m.i = o(G, se, m.i), m.n = o(W, le, m.n), m.s = o(Q, ce, m.s), m;
1029
1029
  }, {
1030
1030
  e: void 0,
1031
1031
  t: void 0,
@@ -1034,15 +1034,15 @@ const Jt = {
1034
1034
  i: void 0,
1035
1035
  n: void 0,
1036
1036
  s: void 0
1037
- }), x;
1037
+ }), S;
1038
1038
  })()];
1039
1039
  };
1040
1040
  ne(["mousedown", "mouseover", "mouseout", "click"]);
1041
- function dn(i, e) {
1041
+ function un(i, e) {
1042
1042
  if (typeof window > "u")
1043
1043
  return () => {
1044
1044
  };
1045
- He(), (e != null && e.projectRoot || e != null && e.editor) && Ge({
1045
+ He(), (e != null && e.projectRoot || e != null && e.editor) && Pe({
1046
1046
  projectRoot: e.projectRoot,
1047
1047
  editor: e.editor
1048
1048
  });
@@ -1054,12 +1054,12 @@ function dn(i, e) {
1054
1054
  panelStyle: e == null ? void 0 : e.panelStyle,
1055
1055
  panelClass: e == null ? void 0 : e.panelClass
1056
1056
  };
1057
- return je(() => sn(s), i);
1057
+ return De(() => ln(s), i);
1058
1058
  }
1059
1059
  export {
1060
- Ge as c,
1060
+ Pe as c,
1061
1061
  Y as g,
1062
1062
  He as i,
1063
- dn as m,
1064
- ke as u
1063
+ un as m,
1064
+ Ce as u
1065
1065
  };
package/dist/mount.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "solid-js/web";
2
- import { m as t } from "./mount-CKKkXlex.js";
2
+ import { m as t } from "./mount-Cl_oAy4R.js";
3
3
  export {
4
4
  t as mount
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "batchkit-devtools",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "DevTools panel for BatchKit - visualize batchers, batches, and invocations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "directory": "packages/devtools"
38
38
  },
39
39
  "peerDependencies": {
40
- "batchkit": ">=0.3.6"
40
+ "batchkit": ">=0.3.7"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "batchkit": {