@shane_il/pulse 0.3.0 → 0.4.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/devtools.js CHANGED
@@ -1,18 +1,18 @@
1
- var rt = Object.defineProperty;
2
- var it = (t, e, n) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var S = (t, e, n) => it(t, typeof e != "symbol" ? e + "" : e, n);
4
- let A = !1;
1
+ var it = Object.defineProperty;
2
+ var ct = (t, e, n) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var S = (t, e, n) => ct(t, typeof e != "symbol" ? e + "" : e, n);
4
+ let M = !1;
5
5
  const R = /* @__PURE__ */ new Set();
6
- function ct(t) {
7
- R.add(t), A || (A = !0, queueMicrotask(lt));
6
+ function K(t) {
7
+ R.add(t), M || (M = !0, queueMicrotask(lt));
8
8
  }
9
9
  function lt() {
10
10
  const t = [...R];
11
- R.clear(), A = !1;
11
+ R.clear(), M = !1;
12
12
  for (const e of t)
13
13
  e();
14
14
  }
15
- const q = Symbol("PULSE_CONNECTED"), F = globalThis;
15
+ const J = Symbol("PULSE_CONNECTED"), F = globalThis;
16
16
  F.__PULSE_HOOKS__ || (F.__PULSE_HOOKS__ = { onMount: null, onUnmount: null });
17
17
  const T = F.__PULSE_HOOKS__;
18
18
  function at(t, e) {
@@ -22,14 +22,14 @@ function pt(t, e) {
22
22
  return function(o) {
23
23
  const s = t || {};
24
24
  function r(i) {
25
- const a = {};
26
- for (const p in s) {
27
- const { store: l, selector: h } = s[p];
28
- a[p] = h(l.getState());
25
+ const l = {};
26
+ for (const u in s) {
27
+ const { store: f, selector: h } = s[u];
28
+ l[u] = h(f.getState());
29
29
  }
30
- return o({ ...a, ...i });
30
+ return o({ ...l, ...i });
31
31
  }
32
- return r[q] = !0, r._bindings = s, r._innerComponent = o, r.displayName = `Connected(${o.displayName || o.name || "Anonymous"})`, r;
32
+ return r[J] = !0, r._bindings = s, r._innerComponent = o, r.displayName = `Connected(${o.displayName || o.name || "Anonymous"})`, r;
33
33
  };
34
34
  }
35
35
  class ut {
@@ -42,21 +42,51 @@ class ut {
42
42
  S(this, "parentDom");
43
43
  S(this, "_renderCallback");
44
44
  S(this, "_mountCleanup");
45
- this.connectedFn = e, this.props = n, this.prevSelected = {}, this.unsubscribers = [], this.lastVTree = null, this.parentDom = null, this._renderCallback = null, this._mountCleanup = null;
45
+ S(this, "_localState");
46
+ S(this, "_localActions");
47
+ this.connectedFn = e, this.props = n, this.prevSelected = {}, this.unsubscribers = [], this.lastVTree = null, this.parentDom = null, this._renderCallback = null, this._mountCleanup = null, this._localState = null, this._localActions = null;
48
+ const o = e._lifecycle;
49
+ o != null && o.store && this._initLocalStore(o.store);
50
+ }
51
+ _initLocalStore(e) {
52
+ this._localState = { ...e.state }, this._localActions = e.actions;
53
+ const n = this.connectedFn._bindings, o = this.connectedFn.displayName || "component", s = Object.keys(this._localState), r = Object.keys(this._localActions);
54
+ for (const i of s)
55
+ i in n && console.warn(
56
+ `[pulse] Local store state "${i}" shadows global binding in ${o}. Local value will be used.`
57
+ );
58
+ for (const i of r)
59
+ i in n && console.warn(
60
+ `[pulse] Local store action "${i}" shadows global binding in ${o}. Local value will be used.`
61
+ ), i in this._localState && console.warn(
62
+ `[pulse] Local store action "${i}" shadows state key with same name in ${o}.`
63
+ );
64
+ }
65
+ getLocalProps() {
66
+ if (!this._localState) return null;
67
+ const e = { ...this._localState };
68
+ for (const n in this._localActions) {
69
+ const o = this._localActions[n];
70
+ e[n] = (s) => {
71
+ const r = o(this._localState, s);
72
+ r !== this._localState && (this._localState = r, this._renderCallback && K(this._renderCallback));
73
+ };
74
+ }
75
+ return e;
46
76
  }
47
77
  mount(e, n) {
48
78
  var r;
49
79
  this.parentDom = e, this._renderCallback = n;
50
80
  const o = this.connectedFn._bindings;
51
81
  for (const i in o) {
52
- const { store: a, selector: p } = o[i];
53
- this.prevSelected[i] = p(a.getState());
82
+ const { store: l, selector: u } = o[i];
83
+ this.prevSelected[i] = u(l.getState());
54
84
  }
55
85
  for (const i in o) {
56
- const { store: a } = o[i], p = a.subscribe(() => {
86
+ const { store: l } = o[i], u = l.subscribe(() => {
57
87
  this._onStoreChange();
58
88
  });
59
- this.unsubscribers.push(p);
89
+ this.unsubscribers.push(u);
60
90
  }
61
91
  const s = this.connectedFn._lifecycle;
62
92
  if (s != null && s.onMount) {
@@ -78,7 +108,7 @@ class ut {
78
108
  break;
79
109
  }
80
110
  }
81
- n && ct(this._renderCallback);
111
+ n && K(this._renderCallback);
82
112
  }
83
113
  updateSelected() {
84
114
  const e = this.connectedFn._bindings;
@@ -106,64 +136,64 @@ function ft(t, e) {
106
136
  return !1;
107
137
  return !0;
108
138
  }
109
- function J(t) {
139
+ function Q(t) {
110
140
  let e = t.state;
111
141
  const n = t.actions, o = /* @__PURE__ */ new Set(), s = t.middleware;
112
142
  function r() {
113
143
  return e;
114
144
  }
115
145
  function i() {
116
- for (const f of o)
117
- f(e);
146
+ for (const p of o)
147
+ p(e);
118
148
  }
119
- function a(f, m) {
120
- const b = n[f];
121
- if (!b)
122
- throw new Error(`[pulse] Unknown action: "${f}"`);
123
- const _ = b(e, m);
124
- _ !== e && (e = _, i());
149
+ function l(p, b) {
150
+ const _ = n[p];
151
+ if (!_)
152
+ throw new Error(`[pulse] Unknown action: "${p}"`);
153
+ const m = _(e, b);
154
+ m !== e && (e = m, i());
125
155
  }
126
- function p(f, m) {
127
- if (f === "__devtools_replace__") {
128
- e = m, i();
156
+ function u(p, b) {
157
+ if (p === "__devtools_replace__") {
158
+ e = b, i();
129
159
  return;
130
160
  }
131
- const b = n[f];
132
- if (!b)
133
- throw new Error(`[pulse] Unknown action: "${f}"`);
134
- const _ = {
161
+ const _ = n[p];
162
+ if (!_)
163
+ throw new Error(`[pulse] Unknown action: "${p}"`);
164
+ const m = {
135
165
  store: c,
136
- actionName: f,
137
- payload: m,
166
+ actionName: p,
167
+ payload: b,
138
168
  prevState: e,
139
169
  nextState: void 0
140
170
  };
141
- let w = 0;
171
+ let k = 0;
142
172
  function z() {
143
- if (w < s.length) {
144
- const C = s[w++];
145
- C(_, z);
173
+ if (k < s.length) {
174
+ const C = s[k++];
175
+ C(m, z);
146
176
  } else {
147
- const C = b(_.prevState, _.payload);
148
- _.nextState = C, C !== e && (e = C, i());
177
+ const C = _(m.prevState, m.payload);
178
+ m.nextState = C, C !== e && (e = C, i());
149
179
  }
150
180
  }
151
181
  z();
152
182
  }
153
- const l = s && s.length > 0 ? p : a;
154
- function h(f) {
155
- return o.add(f), () => {
156
- o.delete(f);
183
+ const f = s && s.length > 0 ? u : l;
184
+ function h(p) {
185
+ return o.add(p), () => {
186
+ o.delete(p);
157
187
  };
158
188
  }
159
- function g(f) {
160
- return { store: c, selector: f };
189
+ function y(p) {
190
+ return { store: c, selector: p };
161
191
  }
162
192
  const c = {
163
193
  getState: r,
164
- dispatch: l,
194
+ dispatch: f,
165
195
  subscribe: h,
166
- select: g
196
+ select: y
167
197
  };
168
198
  return t.name && (c.name = t.name), c;
169
199
  }
@@ -179,7 +209,7 @@ function dt(t, e) {
179
209
  };
180
210
  }
181
211
  let ht = 1;
182
- class mt {
212
+ class yt {
183
213
  constructor() {
184
214
  S(this, "stores", /* @__PURE__ */ new Map());
185
215
  S(this, "components", /* @__PURE__ */ new Map());
@@ -238,13 +268,13 @@ class mt {
238
268
  }
239
269
  }
240
270
  function Qt(t, e) {
241
- const n = [], o = dt(n), s = J({
271
+ const n = [], o = dt(n), s = Q({
242
272
  ...e,
243
273
  middleware: [o, ...e.middleware || []]
244
274
  });
245
275
  return t.registerStore(s, n, e.name), { store: s, history: n };
246
276
  }
247
- const D = Symbol("TEXT_NODE"), yt = Symbol("FRAGMENT");
277
+ const D = Symbol("TEXT_NODE"), mt = Symbol("FRAGMENT");
248
278
  function B(t) {
249
279
  return {
250
280
  type: D,
@@ -256,25 +286,25 @@ function B(t) {
256
286
  function gt(t) {
257
287
  return t == null || typeof t == "boolean" ? null : typeof t == "string" || typeof t == "number" ? B(t) : t;
258
288
  }
259
- function Q(t) {
289
+ function Y(t) {
260
290
  const e = [];
261
291
  for (const n of t)
262
292
  if (Array.isArray(n))
263
- e.push(...Q(n));
293
+ e.push(...Y(n));
264
294
  else {
265
295
  const o = gt(n);
266
296
  o !== null && e.push(o);
267
297
  }
268
298
  return e;
269
299
  }
270
- function u(t, e, ...n) {
300
+ function a(t, e, ...n) {
271
301
  e = e || {};
272
302
  const o = e.key ?? null;
273
303
  e.key !== void 0 && (e = { ...e }, delete e.key);
274
- const s = Q(n);
304
+ const s = Y(n);
275
305
  return { type: t, props: e, children: s, key: o };
276
306
  }
277
- const y = {
307
+ const g = {
278
308
  CREATE: "CREATE",
279
309
  REMOVE: "REMOVE",
280
310
  REPLACE: "REPLACE",
@@ -285,16 +315,16 @@ const y = {
285
315
  };
286
316
  function x(t, e) {
287
317
  if (e == null && t == null) return [];
288
- if (e == null) return [{ type: y.REMOVE, target: t }];
289
- if (t == null) return [{ type: y.CREATE, newVNode: e }];
318
+ if (e == null) return [{ type: g.REMOVE, target: t }];
319
+ if (t == null) return [{ type: g.CREATE, newVNode: e }];
290
320
  if (t.type !== e.type)
291
- return [{ type: y.REPLACE, oldVNode: t, newVNode: e }];
321
+ return [{ type: g.REPLACE, oldVNode: t, newVNode: e }];
292
322
  if (e._dom = t._dom, t.type === D)
293
- return t.props.nodeValue !== e.props.nodeValue ? [{ type: y.TEXT, oldVNode: t, newVNode: e }] : [];
323
+ return t.props.nodeValue !== e.props.nodeValue ? [{ type: g.TEXT, oldVNode: t, newVNode: e }] : [];
294
324
  const n = [], o = St(t.props, e.props);
295
- o && n.push({ type: y.UPDATE, target: t, propPatches: o });
325
+ o && n.push({ type: g.UPDATE, target: t, propPatches: o });
296
326
  const s = bt(t.children, e.children);
297
- return s.length && n.push({ type: y.CHILDREN, parent: t, childPatches: s }), n;
327
+ return s.length && n.push({ type: g.CHILDREN, parent: t, childPatches: s }), n;
298
328
  }
299
329
  function St(t, e) {
300
330
  const n = {}, o = [];
@@ -305,7 +335,7 @@ function St(t, e) {
305
335
  r !== "children" && (r in e || (o.push(r), s = !0));
306
336
  return s ? { set: n, remove: o } : null;
307
337
  }
308
- function P(t, e) {
338
+ function v(t, e) {
309
339
  return t == null || e == null ? !1 : t.type === e.type && t.key === e.key;
310
340
  }
311
341
  function G(t, e) {
@@ -320,103 +350,103 @@ function G(t, e) {
320
350
  );
321
351
  }
322
352
  function bt(t, e) {
323
- var g;
353
+ var y;
324
354
  process.env.NODE_ENV !== "production" && (G(t, "old"), G(e, "new"));
325
355
  const n = [];
326
- let o = 0, s = t.length - 1, r = 0, i = e.length - 1, a = t[o], p = t[s], l = e[r], h = e[i];
356
+ let o = 0, s = t.length - 1, r = 0, i = e.length - 1, l = t[o], u = t[s], f = e[r], h = e[i];
327
357
  for (; o <= s && r <= i; ) {
328
- if (a == null) {
329
- a = t[++o];
358
+ if (l == null) {
359
+ l = t[++o];
330
360
  continue;
331
361
  }
332
- if (p == null) {
333
- p = t[--s];
362
+ if (u == null) {
363
+ u = t[--s];
334
364
  continue;
335
365
  }
336
- if (P(a, l))
337
- n.push(...x(a, l)), a = t[++o], l = e[++r];
338
- else if (P(p, h))
339
- n.push(...x(p, h)), p = t[--s], h = e[--i];
340
- else if (P(a, h))
366
+ if (v(l, f))
367
+ n.push(...x(l, f)), l = t[++o], f = e[++r];
368
+ else if (v(u, h))
369
+ n.push(...x(u, h)), u = t[--s], h = e[--i];
370
+ else if (v(l, h))
341
371
  n.push({
342
- type: y.MOVE,
343
- vnode: a,
372
+ type: g.MOVE,
373
+ vnode: l,
344
374
  anchor: t[s + 1] || null,
345
- childPatches: x(a, h)
346
- }), a = t[++o], h = e[--i];
347
- else if (P(p, l))
375
+ childPatches: x(l, h)
376
+ }), l = t[++o], h = e[--i];
377
+ else if (v(u, f))
348
378
  n.push({
349
- type: y.MOVE,
350
- vnode: p,
351
- anchor: a,
352
- childPatches: x(p, l)
353
- }), p = t[--s], l = e[++r];
379
+ type: g.MOVE,
380
+ vnode: u,
381
+ anchor: l,
382
+ childPatches: x(u, f)
383
+ }), u = t[--s], f = e[++r];
354
384
  else
355
385
  break;
356
386
  }
357
387
  if (o <= s && r <= i) {
358
388
  const c = /* @__PURE__ */ new Map();
359
- for (let f = o; f <= s; f++) {
360
- const m = (g = t[f]) == null ? void 0 : g.key;
361
- m != null && c.set(m, f);
389
+ for (let p = o; p <= s; p++) {
390
+ const b = (y = t[p]) == null ? void 0 : y.key;
391
+ b != null && c.set(b, p);
362
392
  }
363
393
  for (; r <= i; ) {
364
- l = e[r];
365
- const f = l.key != null ? c.get(l.key) : void 0;
366
- if (f !== void 0) {
367
- const m = t[f];
394
+ f = e[r];
395
+ const p = f.key != null ? c.get(f.key) : void 0;
396
+ if (p !== void 0) {
397
+ const b = t[p];
368
398
  n.push({
369
- type: y.MOVE,
370
- vnode: m,
399
+ type: g.MOVE,
400
+ vnode: b,
371
401
  anchor: t[o] || null,
372
- childPatches: x(m, l)
373
- }), t[f] = null, c.delete(l.key);
402
+ childPatches: x(b, f)
403
+ }), t[p] = null, c.delete(f.key);
374
404
  } else
375
405
  n.push({
376
- type: y.CREATE,
377
- newVNode: l,
406
+ type: g.CREATE,
407
+ newVNode: f,
378
408
  anchor: t[o] || null
379
409
  });
380
410
  r++;
381
411
  }
382
- for (let f = o; f <= s; f++)
383
- t[f] != null && n.push({ type: y.REMOVE, target: t[f] });
412
+ for (let p = o; p <= s; p++)
413
+ t[p] != null && n.push({ type: g.REMOVE, target: t[p] });
384
414
  }
385
415
  if (o > s) {
386
416
  const c = e[i + 1] || null;
387
- for (let f = r; f <= i; f++)
388
- n.push({ type: y.CREATE, newVNode: e[f], anchor: c });
417
+ for (let p = r; p <= i; p++)
418
+ n.push({ type: g.CREATE, newVNode: e[p], anchor: c });
389
419
  } else if (r > i)
390
420
  for (let c = o; c <= s; c++)
391
- t[c] != null && n.push({ type: y.REMOVE, target: t[c] });
421
+ t[c] != null && n.push({ type: g.REMOVE, target: t[c] });
392
422
  return n;
393
423
  }
394
- const Y = "http://www.w3.org/2000/svg";
395
- function V(t, e) {
424
+ const Z = "http://www.w3.org/2000/svg";
425
+ function P(t, e) {
396
426
  if (t.type === D) {
397
427
  const o = document.createTextNode(t.props.nodeValue);
398
428
  return t._dom = o, o;
399
429
  }
400
- if (t.type === yt) {
430
+ if (t.type === mt) {
401
431
  const o = document.createDocumentFragment();
402
432
  for (const s of t.children)
403
- o.appendChild(V(s, e));
433
+ o.appendChild(P(s, e));
404
434
  return t._dom = o, o;
405
435
  }
406
- t.type === "svg" ? e = Y : t.type === "foreignObject" && (e = void 0);
436
+ t.type === "svg" ? e = Z : t.type === "foreignObject" && (e = void 0);
407
437
  const n = e ? document.createElementNS(e, t.type) : document.createElement(t.type);
408
438
  _t(n, {}, t.props);
409
439
  for (const o of t.children)
410
- n.appendChild(V(o, e));
440
+ n.appendChild(P(o, e));
411
441
  return t._dom = n, n;
412
442
  }
413
443
  function _t(t, e, n) {
414
444
  for (const o in e)
415
- o === "children" || o === "key" || o in n || tt(t, o, e[o]);
445
+ o === "children" || o === "key" || o in n || et(t, o, e[o]);
416
446
  for (const o in n)
417
- o === "children" || o === "key" || e[o] !== n[o] && Z(t, o, n[o], e[o]);
447
+ o === "children" || o === "key" || e[o] !== n[o] && tt(t, o, n[o], e[o]);
418
448
  }
419
- function Z(t, e, n, o) {
449
+ function tt(t, e, n, o) {
420
450
  if (e.startsWith("on")) {
421
451
  const s = e.slice(2).toLowerCase();
422
452
  o && t.removeEventListener(s, o), n && t.addEventListener(s, n);
@@ -439,7 +469,7 @@ function Z(t, e, n, o) {
439
469
  }
440
470
  else n === !0 ? t.setAttribute(e, "") : n === !1 || n == null ? t.removeAttribute(e) : t.setAttribute(e, n);
441
471
  }
442
- function tt(t, e, n) {
472
+ function et(t, e, n) {
443
473
  if (e.startsWith("on"))
444
474
  t.removeEventListener(e.slice(2).toLowerCase(), n);
445
475
  else if (e === "dangerouslySetInnerHTML")
@@ -455,103 +485,103 @@ function tt(t, e, n) {
455
485
  else
456
486
  t.removeAttribute(e);
457
487
  }
458
- function K(t) {
459
- return t instanceof SVGElement ? Y : void 0;
488
+ function W(t) {
489
+ return t instanceof SVGElement ? Z : void 0;
460
490
  }
461
- function v(t, e) {
491
+ function V(t, e) {
462
492
  var n, o, s;
463
493
  for (const r of e)
464
494
  switch (r.type) {
465
- case y.CREATE: {
466
- const i = V(r.newVNode, K(t));
495
+ case g.CREATE: {
496
+ const i = P(r.newVNode, W(t));
467
497
  (n = r.anchor) != null && n._dom ? t.insertBefore(i, r.anchor._dom) : t.appendChild(i);
468
498
  break;
469
499
  }
470
- case y.REMOVE: {
500
+ case g.REMOVE: {
471
501
  const i = r.target._dom;
472
502
  i != null && i.parentNode && i.parentNode.removeChild(i);
473
503
  break;
474
504
  }
475
- case y.REPLACE: {
476
- const i = r.oldVNode._dom, a = i == null ? void 0 : i.parentNode, p = V(
505
+ case g.REPLACE: {
506
+ const i = r.oldVNode._dom, l = i == null ? void 0 : i.parentNode, u = P(
477
507
  r.newVNode,
478
- a ? K(a) : void 0
508
+ l ? W(l) : void 0
479
509
  );
480
- a && a.replaceChild(p, i);
510
+ l && l.replaceChild(u, i);
481
511
  break;
482
512
  }
483
- case y.UPDATE: {
484
- const i = r.target._dom, { set: a, remove: p } = r.propPatches;
485
- for (const l of p)
486
- tt(i, l, r.target.props[l]);
487
- for (const l in a)
488
- Z(i, l, a[l], r.target.props[l]);
513
+ case g.UPDATE: {
514
+ const i = r.target._dom, { set: l, remove: u } = r.propPatches;
515
+ for (const f of u)
516
+ et(i, f, r.target.props[f]);
517
+ for (const f in l)
518
+ tt(i, f, l[f], r.target.props[f]);
489
519
  break;
490
520
  }
491
- case y.TEXT: {
521
+ case g.TEXT: {
492
522
  const i = r.oldVNode._dom;
493
523
  i && (i.nodeValue = r.newVNode.props.nodeValue);
494
524
  break;
495
525
  }
496
- case y.MOVE: {
526
+ case g.MOVE: {
497
527
  const i = r.vnode._dom;
498
- i && ((o = r.anchor) != null && o._dom ? t.insertBefore(i, r.anchor._dom) : t.appendChild(i)), (s = r.childPatches) != null && s.length && i && v(i, r.childPatches);
528
+ i && ((o = r.anchor) != null && o._dom ? t.insertBefore(i, r.anchor._dom) : t.appendChild(i)), (s = r.childPatches) != null && s.length && i && V(i, r.childPatches);
499
529
  break;
500
530
  }
501
- case y.CHILDREN: {
531
+ case g.CHILDREN: {
502
532
  const i = r.parent._dom;
503
- i && r.childPatches.length && v(i, r.childPatches);
533
+ i && r.childPatches.length && V(i, r.childPatches);
504
534
  break;
505
535
  }
506
536
  }
507
537
  }
508
- const $ = /* @__PURE__ */ new WeakMap();
538
+ const A = /* @__PURE__ */ new WeakMap();
509
539
  function xt(t, e) {
510
- const n = $.get(e);
540
+ const n = A.get(e);
511
541
  if (n) {
512
542
  const o = E(t, e), s = [];
513
- I(n.vTree, s);
543
+ O(n.vTree, s);
514
544
  const r = x(n.vTree, o);
515
- v(e, r);
545
+ V(e, r);
516
546
  const i = [];
517
- o && I(o, i);
518
- const a = new Set(i);
519
- for (const l of s)
520
- a.has(l) || l.unmount();
521
- const p = new Set(s);
522
- for (const l of i)
523
- p.has(l) || l.mount(e, () => U(l, e));
524
- $.set(e, { vTree: o });
547
+ o && O(o, i);
548
+ const l = new Set(i);
549
+ for (const f of s)
550
+ l.has(f) || f.unmount();
551
+ const u = new Set(s);
552
+ for (const f of i)
553
+ u.has(f) || f.mount(e, () => U(f, e));
554
+ A.set(e, { vTree: o });
525
555
  } else {
526
556
  const o = E(t, e);
527
557
  if (!o) return;
528
- const s = V(o);
558
+ const s = P(o);
529
559
  e.appendChild(s);
530
560
  const r = [];
531
- I(o, r);
561
+ O(o, r);
532
562
  for (const i of r)
533
563
  i.mount(e, () => U(i, e));
534
- $.set(e, { vTree: o });
564
+ A.set(e, { vTree: o });
535
565
  }
536
566
  }
537
567
  function E(t, e) {
538
568
  var n;
539
569
  if (t == null) return null;
540
570
  if (typeof t.type == "function") {
541
- if (t.type[q]) {
571
+ if (t.type[J]) {
542
572
  const s = t.type._lifecycle;
543
573
  try {
544
- const r = new ut(t.type, t.props), i = t.type(t.props), p = E(i, e) ?? B("");
545
- if (p._instance) {
546
- const l = {
574
+ const r = new ut(t.type, t.props), i = r.getLocalProps(), l = i ? { ...t.props, ...i } : t.props, u = t.type(l), h = E(u, e) ?? B("");
575
+ if (h._instance) {
576
+ const y = {
547
577
  type: "div",
548
578
  props: { style: { display: "contents" } },
549
- children: [p],
579
+ children: [h],
550
580
  key: t.key
551
581
  };
552
- return l._instance = r, r.lastVTree = l, l;
582
+ return y._instance = r, r.lastVTree = y, y;
553
583
  }
554
- return p._instance = r, r.lastVTree = p, p;
584
+ return h._instance = r, r.lastVTree = h, h;
555
585
  } catch (r) {
556
586
  if (s != null && s.onError) {
557
587
  const i = s.onError({
@@ -573,67 +603,67 @@ function U(t, e) {
573
603
  if (!t._renderCallback) return;
574
604
  const n = t.connectedFn, o = n._lifecycle;
575
605
  try {
576
- const i = n(t.props), p = E(i, e) ?? B("");
577
- let l;
578
- if (p._instance && p._instance !== t ? (l = {
606
+ const i = t.getLocalProps(), l = i ? { ...t.props, ...i } : t.props, u = n(l), h = E(u, e) ?? B("");
607
+ let y;
608
+ if (h._instance && h._instance !== t ? (y = {
579
609
  type: "div",
580
610
  props: { style: { display: "contents" } },
581
- children: [p],
611
+ children: [h],
582
612
  key: null
583
- }, l._instance = t) : (p._instance = t, l = p), t.lastVTree) {
584
- H(t.lastVTree, t);
585
- const m = x(t.lastVTree, l), b = ((s = t.lastVTree._dom) == null ? void 0 : s.parentNode) || e;
586
- v(b, m), l._dom || (l._dom = t.lastVTree._dom);
613
+ }, y._instance = t) : (h._instance = t, y = h), t.lastVTree) {
614
+ j(t.lastVTree, t);
615
+ const m = x(t.lastVTree, y), k = ((s = t.lastVTree._dom) == null ? void 0 : s.parentNode) || e;
616
+ V(k, m), y._dom || (y._dom = t.lastVTree._dom);
587
617
  }
588
- const h = [];
589
- M(t.lastVTree, h, t);
590
- const g = [];
591
- M(l, g, t);
592
- const c = new Set(g);
593
- for (const m of h)
594
- c.has(m) || m.unmount();
595
- t.lastVTree = l;
596
- const f = new Set(h);
597
- for (const m of g)
598
- f.has(m) || m.mount(e, () => U(m, e));
618
+ const c = [];
619
+ I(t.lastVTree, c, t);
620
+ const p = [];
621
+ I(y, p, t);
622
+ const b = new Set(p);
623
+ for (const m of c)
624
+ b.has(m) || m.unmount();
625
+ t.lastVTree = y;
626
+ const _ = new Set(c);
627
+ for (const m of p)
628
+ _.has(m) || m.mount(e, () => U(m, e));
599
629
  o != null && o.onUpdate && o.onUpdate({
600
- dom: l == null ? void 0 : l._dom,
630
+ dom: y == null ? void 0 : y._dom,
601
631
  props: t.props
602
632
  }), t.updateSelected();
603
633
  } catch (i) {
604
634
  if (o != null && o.onError) {
605
- const a = o.onError({ error: i, props: t.props }), p = E(a, e);
606
- if (t.lastVTree && p) {
607
- H(t.lastVTree, t);
608
- const h = x(t.lastVTree, p), g = ((r = t.lastVTree._dom) == null ? void 0 : r.parentNode) || e;
609
- v(g, h), p._dom || (p._dom = t.lastVTree._dom);
635
+ const l = o.onError({ error: i, props: t.props }), u = E(l, e);
636
+ if (t.lastVTree && u) {
637
+ j(t.lastVTree, t);
638
+ const h = x(t.lastVTree, u), y = ((r = t.lastVTree._dom) == null ? void 0 : r.parentNode) || e;
639
+ V(y, h), u._dom || (u._dom = t.lastVTree._dom);
610
640
  }
611
- const l = [];
612
- M(t.lastVTree, l, t);
613
- for (const h of l) h.unmount();
614
- t.lastVTree = p, t.updateSelected();
641
+ const f = [];
642
+ I(t.lastVTree, f, t);
643
+ for (const h of f) h.unmount();
644
+ t.lastVTree = u, t.updateSelected();
615
645
  } else
616
646
  throw i;
617
647
  }
618
648
  }
619
- function H(t, e) {
649
+ function j(t, e) {
620
650
  if (!(!t || !t.children))
621
651
  for (let n = 0; n < t.children.length; n++) {
622
652
  const o = t.children[n];
623
- o._instance && o._instance !== e && o._instance.lastVTree && o._instance.lastVTree !== o && (t.children[n] = o._instance.lastVTree), H(t.children[n], e);
653
+ o._instance && o._instance !== e && o._instance.lastVTree && o._instance.lastVTree !== o && (t.children[n] = o._instance.lastVTree), j(t.children[n], e);
624
654
  }
625
655
  }
626
- function I(t, e) {
656
+ function O(t, e) {
627
657
  if (t && (t._instance && e.push(t._instance), t.children))
628
658
  for (const n of t.children)
629
- I(n, e);
659
+ O(n, e);
630
660
  }
631
- function M(t, e, n) {
661
+ function I(t, e, n) {
632
662
  if (t && (t._instance && t._instance !== n && e.push(t._instance), t.children))
633
663
  for (const o of t.children)
634
- M(o, e, n);
664
+ I(o, e, n);
635
665
  }
636
- function W(t, e, n) {
666
+ function X(t, e, n) {
637
667
  const o = t.getTrackedStore(e);
638
668
  if (!o)
639
669
  throw new Error(`[pulse-devtools] Unknown store: "${e}"`);
@@ -654,10 +684,10 @@ function Yt(t, e, n) {
654
684
  throw new Error(
655
685
  `[pulse-devtools] Index ${n} out of range (0..${r.length - 1})`
656
686
  );
657
- const i = r.slice(n), a = r[n].prevState;
658
- s.dispatch("__devtools_replace__", a);
659
- for (const p of i)
660
- s.dispatch(p.actionName, p.payload);
687
+ const i = r.slice(n), l = r[n].prevState;
688
+ s.dispatch("__devtools_replace__", l);
689
+ for (const u of i)
690
+ s.dispatch(u.actionName, u.payload);
661
691
  t.emit({
662
692
  type: "time-travel",
663
693
  storeName: e,
@@ -693,7 +723,7 @@ const d = {
693
723
  flexDirection: "column",
694
724
  borderTop: `2px solid ${d.mauve}`,
695
725
  overflow: "hidden"
696
- }, Tt = {
726
+ }, kt = {
697
727
  display: "flex",
698
728
  alignItems: "center",
699
729
  backgroundColor: d.surface0,
@@ -701,7 +731,7 @@ const d = {
701
731
  padding: "0 8px",
702
732
  height: "32px",
703
733
  flexShrink: "0"
704
- }, kt = (t) => ({
734
+ }, Tt = (t) => ({
705
735
  background: "none",
706
736
  border: "none",
707
737
  color: t ? d.mauve : d.subtext0,
@@ -728,33 +758,33 @@ const d = {
728
758
  display: "flex",
729
759
  height: "100%",
730
760
  gap: "1px"
731
- }, Vt = {
761
+ }, Pt = {
732
762
  width: "200px",
733
763
  flexShrink: "0",
734
764
  borderRight: `1px solid ${d.surface1}`,
735
765
  overflow: "auto",
736
766
  padding: "4px 0"
737
- }, vt = {
767
+ }, Vt = {
738
768
  flex: "1",
739
769
  overflow: "auto",
740
770
  padding: "8px"
741
- }, Pt = (t) => ({
771
+ }, vt = (t) => ({
742
772
  padding: "4px 12px",
743
773
  cursor: "pointer",
744
774
  backgroundColor: t ? d.surface1 : "transparent",
745
775
  color: t ? d.blue : d.text
746
- }), X = {
776
+ }), q = {
747
777
  color: d.mauve
748
- }, O = {
778
+ }, L = {
749
779
  color: d.green
750
- }, Ot = {
780
+ }, Lt = {
751
781
  color: d.yellow
752
- }, It = {
782
+ }, Ot = {
753
783
  color: d.peach
754
- }, k = {
784
+ }, w = {
755
785
  color: d.overlay0,
756
786
  fontStyle: "italic"
757
- }, Mt = (t) => ({
787
+ }, It = (t) => ({
758
788
  padding: "4px 8px",
759
789
  cursor: "pointer",
760
790
  backgroundColor: t ? d.surface1 : "transparent",
@@ -762,17 +792,17 @@ const d = {
762
792
  display: "flex",
763
793
  justifyContent: "space-between",
764
794
  alignItems: "center"
765
- }), et = {
795
+ }), nt = {
766
796
  color: d.blue,
767
797
  fontWeight: "bold"
768
- }, Lt = {
798
+ }, $t = {
769
799
  color: d.overlay0,
770
800
  fontSize: "10px"
771
- }, $t = {
801
+ }, At = {
772
802
  width: "100%",
773
803
  accentColor: d.mauve,
774
804
  margin: "4px 0 8px"
775
- }, At = {
805
+ }, Mt = {
776
806
  width: "100%",
777
807
  backgroundColor: d.surface0,
778
808
  border: `1px solid ${d.surface1}`,
@@ -794,7 +824,7 @@ const d = {
794
824
  color: d.overlay0,
795
825
  fontSize: "10px",
796
826
  marginLeft: "8px"
797
- }, nt = {
827
+ }, ot = {
798
828
  display: "inline-block",
799
829
  backgroundColor: d.surface1,
800
830
  color: d.subtext0,
@@ -802,92 +832,92 @@ const d = {
802
832
  borderRadius: "8px",
803
833
  fontSize: "10px",
804
834
  marginLeft: "4px"
805
- }, Ht = {
835
+ }, jt = {
806
836
  color: d.mauve,
807
837
  fontWeight: "bold",
808
838
  fontSize: "12px",
809
839
  marginRight: "8px"
810
840
  };
811
- function j(t, e) {
841
+ function H(t, e) {
812
842
  if (t === null)
813
- return u("span", { style: k }, "null");
843
+ return a("span", { style: w }, "null");
814
844
  if (t === void 0)
815
- return u("span", { style: k }, "undefined");
845
+ return a("span", { style: w }, "undefined");
816
846
  if (typeof t == "string")
817
- return u("span", { style: Ot }, `"${t}"`);
847
+ return a("span", { style: Lt }, `"${t}"`);
818
848
  if (typeof t == "boolean")
819
- return u("span", { style: It }, String(t));
849
+ return a("span", { style: Ot }, String(t));
820
850
  if (typeof t == "number")
821
- return u("span", { style: O }, String(t));
851
+ return a("span", { style: L }, String(t));
822
852
  if (Array.isArray(t))
823
- return t.length === 0 ? u("span", { style: O }, "[]") : e > 4 ? u("span", { style: k }, "[…]") : u(
853
+ return t.length === 0 ? a("span", { style: L }, "[]") : e > 4 ? a("span", { style: w }, "[…]") : a(
824
854
  "div",
825
855
  { style: { paddingLeft: "12px" } },
826
856
  ...t.map(
827
- (n, o) => u(
857
+ (n, o) => a(
828
858
  "div",
829
859
  { key: o },
830
- u("span", { style: X }, `${o}: `),
831
- j(n, e + 1)
860
+ a("span", { style: q }, `${o}: `),
861
+ H(n, e + 1)
832
862
  )
833
863
  )
834
864
  );
835
865
  if (typeof t == "object") {
836
866
  const n = Object.keys(t);
837
- return n.length === 0 ? u("span", { style: O }, "{}") : e > 4 ? u("span", { style: k }, "{…}") : u(
867
+ return n.length === 0 ? a("span", { style: L }, "{}") : e > 4 ? a("span", { style: w }, "{…}") : a(
838
868
  "div",
839
869
  { style: { paddingLeft: "12px" } },
840
870
  ...n.map(
841
- (o) => u(
871
+ (o) => a(
842
872
  "div",
843
873
  { key: o },
844
- u("span", { style: X }, `${o}: `),
845
- j(t[o], e + 1)
874
+ a("span", { style: q }, `${o}: `),
875
+ H(t[o], e + 1)
846
876
  )
847
877
  )
848
878
  );
849
879
  }
850
- return u("span", { style: O }, String(t));
880
+ return a("span", { style: L }, String(t));
851
881
  }
852
- function jt({
882
+ function Ht({
853
883
  storeNames: t,
854
884
  selectedStore: e,
855
885
  storeStates: n,
856
886
  onSelectStore: o
857
887
  }) {
858
888
  const s = e ? n[e] : null;
859
- return u(
889
+ return a(
860
890
  "div",
861
891
  { style: Nt },
862
- u(
892
+ a(
863
893
  "div",
864
- { style: Vt },
894
+ { style: Pt },
865
895
  ...t.map(
866
- (r) => u(
896
+ (r) => a(
867
897
  "div",
868
898
  {
869
899
  key: r,
870
- style: Pt(r === e),
900
+ style: vt(r === e),
871
901
  onClick: () => o(r)
872
902
  },
873
903
  r
874
904
  )
875
905
  )
876
906
  ),
877
- u(
907
+ a(
878
908
  "div",
879
- { style: vt },
880
- e ? u(
909
+ { style: Vt },
910
+ e ? a(
881
911
  "div",
882
912
  null,
883
- u(
913
+ a(
884
914
  "div",
885
915
  { style: { marginBottom: "8px", color: d.subtext0 } },
886
916
  "State of ",
887
- u("span", { style: et }, e)
917
+ a("span", { style: nt }, e)
888
918
  ),
889
- s != null ? j(s, 0) : u("span", { style: k }, "No state")
890
- ) : u("span", { style: k }, "Select a store")
919
+ s != null ? H(s, 0) : a("span", { style: w }, "No state")
920
+ ) : a("span", { style: w }, "Select a store")
891
921
  )
892
922
  );
893
923
  }
@@ -904,31 +934,31 @@ function Bt({
904
934
  onSliderChange: r
905
935
  }) {
906
936
  const i = n ? t.filter(
907
- (a) => a.actionName.toLowerCase().includes(n.toLowerCase())
937
+ (l) => l.actionName.toLowerCase().includes(n.toLowerCase())
908
938
  ) : t;
909
- return u(
939
+ return a(
910
940
  "div",
911
941
  { style: { height: "100%", display: "flex", flexDirection: "column" } },
912
942
  // Filter
913
- u("input", {
914
- style: At,
943
+ a("input", {
944
+ style: Mt,
915
945
  placeholder: "Filter actions…",
916
946
  value: n,
917
- onInput: (a) => o(a.target.value)
947
+ onInput: (l) => o(l.target.value)
918
948
  }),
919
949
  // Slider
920
- t.length > 0 ? u(
950
+ t.length > 0 ? a(
921
951
  "div",
922
952
  { style: { flexShrink: "0" } },
923
- u("input", {
953
+ a("input", {
924
954
  type: "range",
925
- style: $t,
955
+ style: At,
926
956
  min: "0",
927
957
  max: String(t.length - 1),
928
958
  value: String(e),
929
- onInput: (a) => r(Number(a.target.value))
959
+ onInput: (l) => r(Number(l.target.value))
930
960
  }),
931
- u(
961
+ a(
932
962
  "div",
933
963
  {
934
964
  style: {
@@ -941,32 +971,32 @@ function Bt({
941
971
  )
942
972
  ) : null,
943
973
  // Action list
944
- u(
974
+ a(
945
975
  "div",
946
976
  { style: { flex: "1", overflow: "auto" } },
947
- ...i.map((a) => {
948
- const p = t.indexOf(a);
949
- return u(
977
+ ...i.map((l) => {
978
+ const u = t.indexOf(l);
979
+ return a(
950
980
  "div",
951
981
  {
952
- key: p,
953
- style: Mt(p === e),
954
- onClick: () => s(p)
982
+ key: u,
983
+ style: It(u === e),
984
+ onClick: () => s(u)
955
985
  },
956
- u(
986
+ a(
957
987
  "span",
958
988
  null,
959
- u("span", { style: et }, a.actionName),
960
- a.payload !== void 0 ? u(
989
+ a("span", { style: nt }, l.actionName),
990
+ l.payload !== void 0 ? a(
961
991
  "span",
962
992
  { style: { color: d.subtext0, marginLeft: "8px" } },
963
- typeof a.payload == "object" ? JSON.stringify(a.payload) : String(a.payload)
993
+ typeof l.payload == "object" ? JSON.stringify(l.payload) : String(l.payload)
964
994
  ) : null
965
995
  ),
966
- u("span", { style: Lt }, Dt(a.timestamp))
996
+ a("span", { style: $t }, Dt(l.timestamp))
967
997
  );
968
998
  }),
969
- i.length === 0 ? u(
999
+ i.length === 0 ? a(
970
1000
  "div",
971
1001
  { style: { color: d.overlay0, padding: "8px" } },
972
1002
  t.length === 0 ? "No actions yet" : "No matching actions"
@@ -977,31 +1007,31 @@ function Bt({
977
1007
  function zt({
978
1008
  components: t
979
1009
  }) {
980
- return t.length === 0 ? u(
1010
+ return t.length === 0 ? a(
981
1011
  "div",
982
1012
  { style: { color: d.overlay0, padding: "8px" } },
983
1013
  "No connected components mounted"
984
- ) : u(
1014
+ ) : a(
985
1015
  "div",
986
1016
  null,
987
1017
  ...t.map(
988
- (e) => u(
1018
+ (e) => a(
989
1019
  "div",
990
1020
  { key: e.id, style: Rt },
991
- u("span", { style: Ft }, e.displayName),
992
- e.storeNames.length > 0 ? u(
1021
+ a("span", { style: Ft }, e.displayName),
1022
+ e.storeNames.length > 0 ? a(
993
1023
  "span",
994
1024
  { style: Ut },
995
1025
  e.storeNames.map(
996
- (n) => u("span", { key: n, style: nt }, n)
1026
+ (n) => a("span", { key: n, style: ot }, n)
997
1027
  )
998
1028
  ) : null
999
1029
  )
1000
1030
  )
1001
1031
  );
1002
1032
  }
1003
- function Gt() {
1004
- return J({
1033
+ function Kt() {
1034
+ return Q({
1005
1035
  state: {
1006
1036
  open: !1,
1007
1037
  activeTab: "stores",
@@ -1028,7 +1058,7 @@ function Gt() {
1028
1058
  }
1029
1059
  });
1030
1060
  }
1031
- function Kt({
1061
+ function Gt({
1032
1062
  open: t,
1033
1063
  activeTab: e,
1034
1064
  selectedStore: n,
@@ -1036,9 +1066,9 @@ function Kt({
1036
1066
  storeNames: s,
1037
1067
  storeStates: r,
1038
1068
  actionLog: i,
1039
- filter: a,
1040
- components: p,
1041
- panelActions: l
1069
+ filter: l,
1070
+ components: u,
1071
+ panelActions: f
1042
1072
  }) {
1043
1073
  if (!t) return null;
1044
1074
  const h = [
@@ -1046,75 +1076,75 @@ function Kt({
1046
1076
  { id: "actions", label: "Actions" },
1047
1077
  { id: "components", label: "Components" }
1048
1078
  ];
1049
- let g;
1050
- return e === "stores" ? g = jt({
1079
+ let y;
1080
+ return e === "stores" ? y = Ht({
1051
1081
  storeNames: s,
1052
1082
  selectedStore: n,
1053
1083
  storeStates: r,
1054
- onSelectStore: l.selectStore
1055
- }) : e === "actions" ? g = Bt({
1084
+ onSelectStore: f.selectStore
1085
+ }) : e === "actions" ? y = Bt({
1056
1086
  actionLog: i,
1057
1087
  timeTravelIndex: o,
1058
- filter: a,
1059
- onFilterChange: l.setFilter,
1060
- onTravelTo: l.travelTo,
1061
- onSliderChange: l.sliderChange
1062
- }) : g = zt({ components: p }), u(
1088
+ filter: l,
1089
+ onFilterChange: f.setFilter,
1090
+ onTravelTo: f.travelTo,
1091
+ onSliderChange: f.sliderChange
1092
+ }) : y = zt({ components: u }), a(
1063
1093
  "div",
1064
1094
  { style: Et },
1065
1095
  // Tab bar (all children keyed to avoid mixed key warnings)
1066
- u(
1096
+ a(
1067
1097
  "div",
1068
- { style: Tt },
1069
- u("span", { key: "title", style: Ht }, "Pulse"),
1098
+ { style: kt },
1099
+ a("span", { key: "title", style: jt }, "Pulse"),
1070
1100
  ...h.map(
1071
- (c) => u(
1101
+ (c) => a(
1072
1102
  "button",
1073
1103
  {
1074
1104
  key: c.id,
1075
- style: kt(c.id === e),
1076
- onClick: () => l.setTab(c.id)
1105
+ style: Tt(c.id === e),
1106
+ onClick: () => f.setTab(c.id)
1077
1107
  },
1078
1108
  c.label
1079
1109
  )
1080
1110
  ),
1081
- u(
1111
+ a(
1082
1112
  "span",
1083
- { key: "badge", style: nt },
1113
+ { key: "badge", style: ot },
1084
1114
  `${s.length} stores`
1085
1115
  ),
1086
- u(
1116
+ a(
1087
1117
  "button",
1088
1118
  {
1089
1119
  key: "close",
1090
1120
  style: wt,
1091
- onClick: l.close
1121
+ onClick: f.close
1092
1122
  },
1093
1123
  "×"
1094
1124
  )
1095
1125
  ),
1096
1126
  // Content
1097
- u("div", { style: Ct }, g)
1127
+ a("div", { style: Ct }, y)
1098
1128
  );
1099
1129
  }
1100
1130
  function Wt(t, e) {
1101
- const n = Gt();
1131
+ const n = Kt();
1102
1132
  e && e(n);
1103
1133
  let o = !1;
1104
1134
  function s() {
1105
1135
  if (!o) {
1106
1136
  o = !0;
1107
1137
  try {
1108
- const c = t.getStoreNames(), f = {};
1109
- for (const w of c)
1110
- f[w] = t.getStoreState(w);
1111
- const b = n.getState().selectedStore || c[0] || null, _ = b ? t.getHistory(b) : [];
1138
+ const c = t.getStoreNames(), p = {};
1139
+ for (const k of c)
1140
+ p[k] = t.getStoreState(k);
1141
+ const _ = n.getState().selectedStore || c[0] || null, m = _ ? t.getHistory(_) : [];
1112
1142
  n.dispatch("sync", {
1113
1143
  storeNames: c,
1114
- storeStates: f,
1115
- actionLog: _,
1116
- timeTravelIndex: _.length > 0 ? _.length - 1 : -1,
1117
- selectedStore: b,
1144
+ storeStates: p,
1145
+ actionLog: m,
1146
+ timeTravelIndex: m.length > 0 ? m.length - 1 : -1,
1147
+ selectedStore: _,
1118
1148
  components: t.getComponents()
1119
1149
  });
1120
1150
  } finally {
@@ -1128,22 +1158,22 @@ function Wt(t, e) {
1128
1158
  const r = {
1129
1159
  selectStore: (c) => {
1130
1160
  n.dispatch("selectStore", c);
1131
- const f = t.getHistory(c);
1161
+ const p = t.getHistory(c);
1132
1162
  n.dispatch("sync", {
1133
- actionLog: f,
1134
- timeTravelIndex: f.length > 0 ? f.length - 1 : -1
1163
+ actionLog: p,
1164
+ timeTravelIndex: p.length > 0 ? p.length - 1 : -1
1135
1165
  });
1136
1166
  },
1137
1167
  setTab: (c) => n.dispatch("setTab", c),
1138
1168
  setFilter: (c) => n.dispatch("setFilter", c),
1139
1169
  close: () => n.dispatch("close"),
1140
1170
  travelTo: (c) => {
1141
- const f = n.getState().selectedStore;
1142
- f && (W(t, f, c), n.dispatch("setTimeTravelIndex", c));
1171
+ const p = n.getState().selectedStore;
1172
+ p && (X(t, p, c), n.dispatch("setTimeTravelIndex", c));
1143
1173
  },
1144
1174
  sliderChange: (c) => {
1145
- const f = n.getState().selectedStore;
1146
- f && (W(t, f, c), n.dispatch("setTimeTravelIndex", c));
1175
+ const p = n.getState().selectedStore;
1176
+ p && (X(t, p, c), n.dispatch("setTimeTravelIndex", c));
1147
1177
  }
1148
1178
  }, i = pt({
1149
1179
  open: n.select((c) => c.open),
@@ -1155,64 +1185,64 @@ function Wt(t, e) {
1155
1185
  actionLog: n.select((c) => c.actionLog),
1156
1186
  filter: n.select((c) => c.filter),
1157
1187
  components: n.select((c) => c.components)
1158
- })((c) => Kt({ ...c, panelActions: r }));
1159
- let a = null;
1160
- function p() {
1161
- a || (a = document.createElement("div"), a.id = "pulse-devtools-root", document.body.appendChild(a), xt(u(i, null), a), s());
1188
+ })((c) => Gt({ ...c, panelActions: r }));
1189
+ let l = null;
1190
+ function u() {
1191
+ l || (l = document.createElement("div"), l.id = "pulse-devtools-root", document.body.appendChild(l), xt(a(i, null), l), s());
1162
1192
  }
1163
- function l() {
1164
- p(), n.dispatch("open");
1193
+ function f() {
1194
+ u(), n.dispatch("open");
1165
1195
  }
1166
1196
  function h() {
1167
1197
  n.dispatch("close");
1168
1198
  }
1169
- function g() {
1170
- p(), n.dispatch("toggle");
1199
+ function y() {
1200
+ u(), n.dispatch("toggle");
1171
1201
  }
1172
- return { openPanel: l, closePanel: h, togglePanel: g, panelStore: n };
1202
+ return { openPanel: f, closePanel: h, togglePanel: y, panelStore: n };
1173
1203
  }
1174
- const L = new mt(), ot = /* @__PURE__ */ new WeakSet();
1204
+ const $ = new yt(), st = /* @__PURE__ */ new WeakSet();
1175
1205
  function Xt(t) {
1176
- ot.add(t);
1206
+ st.add(t);
1177
1207
  }
1178
1208
  at(
1179
1209
  (t) => {
1180
1210
  const e = t.connectedFn._bindings || {}, n = Object.values(e).map((i) => i.store);
1181
- if (n.length > 0 && n.every((i) => ot.has(i)))
1211
+ if (n.length > 0 && n.every((i) => st.has(i)))
1182
1212
  return;
1183
- const o = n.map((i) => i.name || "unnamed"), s = t.connectedFn.displayName || "Unknown", r = L.trackComponent(s, o);
1213
+ const o = n.map((i) => i.name || "unnamed"), s = t.connectedFn.displayName || "Unknown", r = $.trackComponent(s, o);
1184
1214
  t._devtoolsId = r;
1185
1215
  },
1186
1216
  (t) => {
1187
1217
  const e = t._devtoolsId;
1188
- e != null && L.untrackComponent(e);
1218
+ e != null && $.untrackComponent(e);
1189
1219
  }
1190
1220
  );
1191
1221
  let N = null;
1192
- function st() {
1193
- return N || (N = Wt(L, Xt)), N;
1222
+ function rt() {
1223
+ return N || (N = Wt($, Xt)), N;
1194
1224
  }
1195
1225
  function Zt() {
1196
- st().openPanel();
1226
+ rt().openPanel();
1197
1227
  }
1198
1228
  function te() {
1199
1229
  N && N.closePanel();
1200
1230
  }
1201
1231
  function qt() {
1202
- st().togglePanel();
1232
+ rt().togglePanel();
1203
1233
  }
1204
1234
  typeof window < "u" && (window.addEventListener("keydown", (t) => {
1205
1235
  t.ctrlKey && t.shiftKey && t.key === "P" && (t.preventDefault(), qt());
1206
- }), window.__PULSE_DEVTOOLS__ = L);
1236
+ }), window.__PULSE_DEVTOOLS__ = $);
1207
1237
  export {
1208
- mt as PulseDevtools,
1238
+ yt as PulseDevtools,
1209
1239
  Xt as _markInternalStore,
1210
1240
  te as closePanel,
1211
- L as devtools,
1241
+ $ as devtools,
1212
1242
  Qt as instrumentStore,
1213
1243
  Zt as openPanel,
1214
1244
  Yt as replayFrom,
1215
1245
  qt as togglePanel,
1216
- W as travelTo
1246
+ X as travelTo
1217
1247
  };
1218
1248
  //# sourceMappingURL=devtools.js.map