@pinia/colada-devtools 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/index.js +141 -134
  2. package/dist/index.js.map +1 -1
  3. package/dist-panel/{_queryId_-SBAeSmfh.js → _queryId_-BRk1BujP.js} +85 -78
  4. package/dist-panel/_queryId_-BRk1BujP.js.map +1 -0
  5. package/dist-panel/{index-CAv-3vCR.js → index-B_58xqr0.js} +2 -2
  6. package/dist-panel/{index-CAv-3vCR.js.map → index-B_58xqr0.js.map} +1 -1
  7. package/dist-panel/{index-DZwqU9e-.js → index-CIFb4FXj.js} +3 -3
  8. package/dist-panel/index-CIFb4FXj.js.map +1 -0
  9. package/dist-panel/index-dcKxSjOS.js +8113 -0
  10. package/dist-panel/index-dcKxSjOS.js.map +1 -0
  11. package/dist-panel/index.js +1 -1
  12. package/dist-panel/{loader-DHLcbUhz.js → loader-CDd8nw_A.js} +2 -2
  13. package/dist-panel/loader-CDd8nw_A.js.map +1 -0
  14. package/dist-panel/{mouse-pointer-click-BHnWXkC_.js → mouse-pointer-click-BisIGlPs.js} +2 -2
  15. package/dist-panel/mouse-pointer-click-BisIGlPs.js.map +1 -0
  16. package/dist-panel/mutations-DmPjJLlL.js +13 -0
  17. package/dist-panel/mutations-DmPjJLlL.js.map +1 -0
  18. package/dist-panel/{queries-CE8W5p_h.js → queries-B9YVJVQ4.js} +88 -89
  19. package/dist-panel/queries-B9YVJVQ4.js.map +1 -0
  20. package/dist-panel/{settings-DIqJoCBU.js → settings-s4xqlsIF.js} +2 -2
  21. package/dist-panel/{settings-DIqJoCBU.js.map → settings-s4xqlsIF.js.map} +1 -1
  22. package/dist-shared/index.d.ts +1 -1
  23. package/dist-shared/index.js.map +1 -1
  24. package/package.json +7 -7
  25. package/dist-panel/_queryId_-SBAeSmfh.js.map +0 -1
  26. package/dist-panel/index-BdIpA-g4.js +0 -8026
  27. package/dist-panel/index-BdIpA-g4.js.map +0 -1
  28. package/dist-panel/index-DZwqU9e-.js.map +0 -1
  29. package/dist-panel/loader-DHLcbUhz.js.map +0 -1
  30. package/dist-panel/mouse-pointer-click-BHnWXkC_.js.map +0 -1
  31. package/dist-panel/mutations-BfqfXeMY.js +0 -13
  32. package/dist-panel/mutations-BfqfXeMY.js.map +0 -1
  33. package/dist-panel/queries-CE8W5p_h.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { defineComponent as $, ref as R, onMounted as L, renderSlot as ne, createCommentVNode as M, toValue as T, getCurrentScope as J, onScopeDispose as Q, useTemplateRef as oe, shallowRef as N, watch as _, onBeforeUnmount as ie, createBlock as W, openBlock as x, Teleport as re, createElementVNode as se, nextTick as G, readonly as K, getCurrentInstance as ae, toRef as le, customRef as ue, computed as U, unref as F, withCtx as ce, createElementBlock as de } from "vue";
2
- import { useQueryCache as fe } from "@pinia/colada";
3
- import { DEVTOOLS_INFO_KEY as p, DuplexChannel as pe } from "@pinia/colada-devtools/shared";
4
- const ve = /* @__PURE__ */ $({
1
+ import { defineComponent as L, ref as R, onMounted as j, renderSlot as re, createCommentVNode as N, toValue as C, getCurrentScope as Q, onScopeDispose as G, useTemplateRef as se, shallowRef as W, watch as _, onBeforeUnmount as ae, createBlock as F, openBlock as x, Teleport as le, createElementVNode as ue, nextTick as K, readonly as U, getCurrentInstance as ce, toRef as de, customRef as fe, computed as Y, unref as $, withCtx as pe, createElementBlock as ve } from "vue";
2
+ import { useQueryCache as me } from "@pinia/colada";
3
+ import { DEVTOOLS_INFO_KEY as p, DuplexChannel as ye } from "@pinia/colada-devtools/shared";
4
+ const he = /* @__PURE__ */ L({
5
5
  __name: "ClientOnly",
6
6
  setup(e) {
7
7
  const t = R(!1);
8
- return L(() => {
8
+ return j(() => {
9
9
  t.value = !0;
10
- }), (n, l) => t.value ? ne(n.$slots, "default", { key: 0 }) : M("", !0);
10
+ }), (n, l) => t.value ? re(n.$slots, "default", { key: 0 }) : N("", !0);
11
11
  }
12
12
  }), b = () => performance.timeOrigin + performance.now();
13
- function me(e) {
13
+ function ge(e) {
14
14
  var t;
15
- if (!I.has(e)) {
16
- I.set(e, !0);
15
+ if (!z.has(e)) {
16
+ z.set(e, !0);
17
17
  for (const n of e.getEntries())
18
18
  n[t = p] ?? (n[t] = {
19
19
  count: {
@@ -47,16 +47,16 @@ function me(e) {
47
47
  else if (n === "fetch") {
48
48
  const [s] = l;
49
49
  s[p].count.total++, s[p].updatedAt = b();
50
- const u = b(), v = {
50
+ const c = b(), v = {
51
51
  id: (((h = s[p].history.at(0)) == null ? void 0 : h.id) ?? -1) + 1,
52
52
  key: s.key,
53
53
  state: s.state.value,
54
- updatedAt: u,
55
- createdAt: u,
54
+ updatedAt: c,
55
+ createdAt: c,
56
56
  fetchTime: null
57
- }, E = T((f = s.options) == null ? void 0 : f.enabled) ?? !0;
57
+ }, E = C((f = s.options) == null ? void 0 : f.enabled) ?? !0;
58
58
  E && (v.fetchTime = {
59
- start: u,
59
+ start: c,
60
60
  end: null
61
61
  }), s[p].history.unshift(v), s[p].history = s[p].history.slice(0, 10), r(() => {
62
62
  E && (v.fetchTime.end = b(), s[p].count.succeed++, v.state = s.state.value, v.updatedAt = b());
@@ -68,9 +68,9 @@ function me(e) {
68
68
  s.pending && s[p].count.cancelled++;
69
69
  } else if (n === "setEntryState") {
70
70
  const [s] = l;
71
- let u = s[p].history[0];
71
+ let c = s[p].history[0];
72
72
  r(() => {
73
- s[p].updatedAt = b(), u ?? (u = s[p].history[0]), u && (u.state = s.state.value, u.updatedAt = b());
73
+ s[p].updatedAt = b(), c ?? (c = s[p].history[0]), c && (c.state = s.state.value, c.updatedAt = b());
74
74
  });
75
75
  } else if (n === "untrack") {
76
76
  const [s] = l;
@@ -80,8 +80,8 @@ function me(e) {
80
80
  } else if (n === "setQueryData") {
81
81
  const [s] = l;
82
82
  r(() => {
83
- const u = e.getEntries({ key: s, exact: !0 })[0];
84
- u && !u.active && (u[p].inactiveAt = b());
83
+ const c = e.getEntries({ key: s, exact: !0 })[0];
84
+ c && !c.active && (c[p].inactiveAt = b());
85
85
  });
86
86
  }
87
87
  });
@@ -89,7 +89,7 @@ function me(e) {
89
89
  }
90
90
  function S(e) {
91
91
  return {
92
- id: e.key.join("\0"),
92
+ keyHash: e.keyHash,
93
93
  key: e.key,
94
94
  state: e.state.value,
95
95
  asyncStatus: e.asyncStatus.value,
@@ -99,10 +99,10 @@ function S(e) {
99
99
  options: e.options && {
100
100
  staleTime: e.options.staleTime,
101
101
  gcTime: e.options.gcTime,
102
- refetchOnMount: T(e.options.refetchOnMount),
103
- refetchOnReconnect: T(e.options.refetchOnReconnect),
104
- refetchOnWindowFocus: T(e.options.refetchOnWindowFocus),
105
- enabled: T(e.options.enabled)
102
+ refetchOnMount: C(e.options.refetchOnMount),
103
+ refetchOnReconnect: C(e.options.refetchOnReconnect),
104
+ refetchOnWindowFocus: C(e.options.refetchOnWindowFocus),
105
+ enabled: C(e.options.enabled)
106
106
  },
107
107
  deps: Array.from(e.deps).map(
108
108
  (t) => "uid" in t ? {
@@ -119,17 +119,17 @@ function S(e) {
119
119
  devtools: e[p]
120
120
  };
121
121
  }
122
- const I = /* @__PURE__ */ new WeakMap();
123
- function ye(e, t, n, l) {
124
- e.addEventListener(t, n, l), J() && Q(() => {
122
+ const z = /* @__PURE__ */ new WeakMap();
123
+ function we(e, t, n, l) {
124
+ e.addEventListener(t, n, l), Q() && G(() => {
125
125
  e.removeEventListener(t, n);
126
126
  });
127
127
  }
128
- const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
128
+ const Ee = [".isPip", ".port"], Se = /* @__PURE__ */ L({
129
129
  __name: "PiniaColadaDevtools",
130
130
  setup(e) {
131
- const t = fe();
132
- me(t), t.$onAction(({ name: i, after: o, onError: m, args: g }) => {
131
+ const t = me();
132
+ ge(t), t.$onAction(({ name: i, after: o, onError: m, args: g }) => {
133
133
  if (i === "remove") {
134
134
  const [a] = g;
135
135
  o(() => {
@@ -161,7 +161,7 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
161
161
  });
162
162
  }
163
163
  });
164
- const n = oe("devtools"), l = N(new MessageChannel()), r = new pe(l.value.port1);
164
+ const n = se("devtools"), l = W(new MessageChannel()), r = new ye(l.value.port1);
165
165
  _(
166
166
  l,
167
167
  (i) => {
@@ -207,10 +207,10 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
207
207
  error: null
208
208
  }), o[p].simulate = null, r.emit("queries:update", S(o)));
209
209
  });
210
- const d = N(null);
210
+ const d = W(null);
211
211
  _(d, () => {
212
212
  l.value = new MessageChannel();
213
- }), ye(
213
+ }), we(
214
214
  window,
215
215
  "unload",
216
216
  () => {
@@ -218,7 +218,7 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
218
218
  (i = d.value) == null || i.close();
219
219
  },
220
220
  { passive: !0 }
221
- ), ie(() => {
221
+ ), ae(() => {
222
222
  var i;
223
223
  (i = d.value) == null || i.close();
224
224
  });
@@ -256,7 +256,7 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
256
256
  const g = [...i.shadowRoot.styleSheets].flatMap((a) => [...a.cssRules]).filter((a) => a instanceof CSSPropertyRule).map((a) => a.cssText).join("");
257
257
  m.textContent = g, o.head.appendChild(m);
258
258
  }
259
- function u() {
259
+ function c() {
260
260
  d.value ? h() : f();
261
261
  }
262
262
  let v = 0;
@@ -275,33 +275,33 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
275
275
  t.getEntries({}).map(S)
276
276
  );
277
277
  }
278
- return (i, o) => (x(), W(re, {
278
+ return (i, o) => (x(), F(le, {
279
279
  to: d.value ? d.value.document.body : "body"
280
280
  }, [
281
- se("pinia-colada-devtools-panel", {
281
+ ue("pinia-colada-devtools-panel", {
282
282
  ref: "devtools",
283
283
  ".isPip": !!d.value,
284
284
  ".port": l.value.port2,
285
- onTogglePip: o[0] || (o[0] = (m) => u()),
285
+ onTogglePip: o[0] || (o[0] = (m) => c()),
286
286
  onReady: o[1] || (o[1] = (m) => E())
287
- }, null, 40, he)
287
+ }, null, 40, Ee)
288
288
  ], 8, ["to"]));
289
289
  }
290
290
  });
291
- function we(e) {
292
- return J() ? (Q(e), !0) : !1;
291
+ function be(e) {
292
+ return Q() ? (G(e), !0) : !1;
293
293
  }
294
- const Ee = typeof window < "u" && typeof document < "u";
294
+ const Ae = typeof window < "u" && typeof document < "u";
295
295
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
296
- const Se = Object.prototype.toString, be = (e) => Se.call(e) === "[object Object]", Ae = () => {
296
+ const Ce = Object.prototype.toString, Te = (e) => Ce.call(e) === "[object Object]", Pe = () => {
297
297
  };
298
- function Te(...e) {
298
+ function _e(...e) {
299
299
  if (e.length !== 1)
300
- return le(...e);
300
+ return de(...e);
301
301
  const t = e[0];
302
- return typeof t == "function" ? K(ue(() => ({ get: t, set: Ae }))) : R(t);
302
+ return typeof t == "function" ? U(fe(() => ({ get: t, set: Pe }))) : R(t);
303
303
  }
304
- function Ce(e, t) {
304
+ function Oe(e, t) {
305
305
  function n(...l) {
306
306
  return new Promise((r, d) => {
307
307
  Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(r).catch(d);
@@ -309,11 +309,11 @@ function Ce(e, t) {
309
309
  }
310
310
  return n;
311
311
  }
312
- const Y = (e) => e();
313
- function Pe(e = Y, t = {}) {
312
+ const X = (e) => e();
313
+ function ke(e = X, t = {}) {
314
314
  const {
315
315
  initialState: n = "active"
316
- } = t, l = Te(n === "active");
316
+ } = t, l = _e(n === "active");
317
317
  function r() {
318
318
  l.value = !1;
319
319
  }
@@ -323,47 +323,47 @@ function Pe(e = Y, t = {}) {
323
323
  const h = (...f) => {
324
324
  l.value && e(...f);
325
325
  };
326
- return { isActive: K(l), pause: r, resume: d, eventFilter: h };
326
+ return { isActive: U(l), pause: r, resume: d, eventFilter: h };
327
327
  }
328
328
  function q(e) {
329
329
  return Array.isArray(e) ? e : [e];
330
330
  }
331
- function _e(e) {
332
- return ae();
331
+ function xe(e) {
332
+ return ce();
333
333
  }
334
- function Oe(e, t, n = {}) {
334
+ function De(e, t, n = {}) {
335
335
  const {
336
- eventFilter: l = Y,
336
+ eventFilter: l = X,
337
337
  ...r
338
338
  } = n;
339
339
  return _(
340
340
  e,
341
- Ce(
341
+ Oe(
342
342
  l,
343
343
  t
344
344
  ),
345
345
  r
346
346
  );
347
347
  }
348
- function ke(e, t, n = {}) {
348
+ function Re(e, t, n = {}) {
349
349
  const {
350
350
  eventFilter: l,
351
351
  initialState: r = "active",
352
352
  ...d
353
- } = n, { eventFilter: h, pause: f, resume: s, isActive: u } = Pe(l, { initialState: r });
354
- return { stop: Oe(
353
+ } = n, { eventFilter: h, pause: f, resume: s, isActive: c } = ke(l, { initialState: r });
354
+ return { stop: De(
355
355
  e,
356
356
  t,
357
357
  {
358
358
  ...d,
359
359
  eventFilter: h
360
360
  }
361
- ), pause: f, resume: s, isActive: u };
361
+ ), pause: f, resume: s, isActive: c };
362
362
  }
363
- function xe(e, t = !0, n) {
364
- _e() ? L(e, n) : t ? e() : G(e);
363
+ function Me(e, t = !0, n) {
364
+ xe() ? j(e, n) : t ? e() : K(e);
365
365
  }
366
- function De(e, t, n) {
366
+ function qe(e, t, n) {
367
367
  return _(
368
368
  e,
369
369
  t,
@@ -373,37 +373,37 @@ function De(e, t, n) {
373
373
  }
374
374
  );
375
375
  }
376
- const D = Ee ? window : void 0;
377
- function Re(e) {
376
+ const D = Ae ? window : void 0;
377
+ function Ne(e) {
378
378
  var t;
379
- const n = T(e);
379
+ const n = C(e);
380
380
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
381
381
  }
382
- function z(...e) {
382
+ function B(...e) {
383
383
  const t = [], n = () => {
384
384
  t.forEach((f) => f()), t.length = 0;
385
- }, l = (f, s, u, v) => (f.addEventListener(s, u, v), () => f.removeEventListener(s, u, v)), r = U(() => {
386
- const f = q(T(e[0])).filter((s) => s != null);
385
+ }, l = (f, s, c, v) => (f.addEventListener(s, c, v), () => f.removeEventListener(s, c, v)), r = Y(() => {
386
+ const f = q(C(e[0])).filter((s) => s != null);
387
387
  return f.every((s) => typeof s != "string") ? f : void 0;
388
- }), d = De(
388
+ }), d = qe(
389
389
  () => {
390
390
  var f, s;
391
391
  return [
392
- (s = (f = r.value) == null ? void 0 : f.map((u) => Re(u))) != null ? s : [D].filter((u) => u != null),
393
- q(T(r.value ? e[1] : e[0])),
394
- q(F(r.value ? e[2] : e[1])),
392
+ (s = (f = r.value) == null ? void 0 : f.map((c) => Ne(c))) != null ? s : [D].filter((c) => c != null),
393
+ q(C(r.value ? e[1] : e[0])),
394
+ q($(r.value ? e[2] : e[1])),
395
395
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
396
- T(r.value ? e[3] : e[2])
396
+ C(r.value ? e[3] : e[2])
397
397
  ];
398
398
  },
399
- ([f, s, u, v]) => {
400
- if (n(), !(f != null && f.length) || !(s != null && s.length) || !(u != null && u.length))
399
+ ([f, s, c, v]) => {
400
+ if (n(), !(f != null && f.length) || !(s != null && s.length) || !(c != null && c.length))
401
401
  return;
402
- const E = be(v) ? { ...v } : v;
402
+ const E = Te(v) ? { ...v } : v;
403
403
  t.push(
404
404
  ...f.flatMap(
405
405
  (i) => s.flatMap(
406
- (o) => u.map((m) => l(i, o, m, E))
406
+ (o) => c.map((m) => l(i, o, m, E))
407
407
  )
408
408
  )
409
409
  );
@@ -412,19 +412,19 @@ function z(...e) {
412
412
  ), h = () => {
413
413
  d(), n();
414
414
  };
415
- return we(n), h;
415
+ return be(n), h;
416
416
  }
417
- const O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, k = "__vueuse_ssr_handlers__", qe = /* @__PURE__ */ Me();
418
- function Me() {
417
+ const O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, k = "__vueuse_ssr_handlers__", We = /* @__PURE__ */ Fe();
418
+ function Fe() {
419
419
  return k in O || (O[k] = O[k] || {}), O[k];
420
420
  }
421
- function Ne(e, t) {
422
- return qe[e] || t;
421
+ function $e(e, t) {
422
+ return We[e] || t;
423
423
  }
424
- function We(e) {
424
+ function Le(e) {
425
425
  return e == null ? "any" : e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof Date ? "date" : typeof e == "boolean" ? "boolean" : typeof e == "string" ? "string" : typeof e == "object" ? "object" : Number.isNaN(e) ? "any" : "number";
426
426
  }
427
- const Fe = {
427
+ const je = {
428
428
  boolean: {
429
429
  read: (e) => e === "true",
430
430
  write: (e) => String(e)
@@ -457,108 +457,115 @@ const Fe = {
457
457
  read: (e) => new Date(e),
458
458
  write: (e) => e.toISOString()
459
459
  }
460
- }, B = "vueuse-storage";
461
- function $e(e, t, n, l = {}) {
460
+ }, J = "vueuse-storage";
461
+ function He(e, t, n, l = {}) {
462
462
  var r;
463
463
  const {
464
464
  flush: d = "pre",
465
465
  deep: h = !0,
466
466
  listenToStorageChanges: f = !0,
467
467
  writeDefaults: s = !0,
468
- mergeDefaults: u = !1,
468
+ mergeDefaults: c = !1,
469
469
  shallow: v,
470
470
  window: E = D,
471
471
  eventFilter: i,
472
- onError: o = (c) => {
473
- console.error(c);
472
+ onError: o = (u) => {
473
+ console.error(u);
474
474
  },
475
475
  initOnMounted: m
476
- } = l, g = (v ? N : R)(t), a = U(() => T(e));
476
+ } = l, g = (v ? W : R)(t), a = Y(() => C(e));
477
477
  if (!n)
478
478
  try {
479
- n = Ne("getDefaultStorage", () => {
480
- var c;
481
- return (c = D) == null ? void 0 : c.localStorage;
479
+ n = $e("getDefaultStorage", () => {
480
+ var u;
481
+ return (u = D) == null ? void 0 : u.localStorage;
482
482
  })();
483
- } catch (c) {
484
- o(c);
483
+ } catch (u) {
484
+ o(u);
485
485
  }
486
486
  if (!n)
487
487
  return g;
488
- const y = T(t), j = We(y), C = (r = l.serializer) != null ? r : Fe[j], { pause: X, resume: V } = ke(
488
+ const y = C(t), H = Le(y), T = (r = l.serializer) != null ? r : je[H], { pause: Z, resume: V } = Re(
489
489
  g,
490
- () => Z(g.value),
490
+ () => ne(g.value),
491
491
  { flush: d, deep: h, eventFilter: i }
492
492
  );
493
- _(a, () => P(), { flush: d }), E && f && xe(() => {
494
- n instanceof Storage ? z(E, "storage", P, { passive: !0 }) : z(E, B, te), m && P();
495
- }), m || P();
496
- function H(c, w) {
493
+ _(a, () => P(), { flush: d });
494
+ let M = !1;
495
+ const ee = (u) => {
496
+ m && !M || P(u);
497
+ }, te = (u) => {
498
+ m && !M || ie(u);
499
+ };
500
+ E && f && (n instanceof Storage ? B(E, "storage", ee, { passive: !0 }) : B(E, J, te)), m ? Me(() => {
501
+ M = !0, P();
502
+ }) : P();
503
+ function I(u, w) {
497
504
  if (E) {
498
505
  const A = {
499
506
  key: a.value,
500
- oldValue: c,
507
+ oldValue: u,
501
508
  newValue: w,
502
509
  storageArea: n
503
510
  };
504
- E.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(B, {
511
+ E.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(J, {
505
512
  detail: A
506
513
  }));
507
514
  }
508
515
  }
509
- function Z(c) {
516
+ function ne(u) {
510
517
  try {
511
518
  const w = n.getItem(a.value);
512
- if (c == null)
513
- H(w, null), n.removeItem(a.value);
519
+ if (u == null)
520
+ I(w, null), n.removeItem(a.value);
514
521
  else {
515
- const A = C.write(c);
516
- w !== A && (n.setItem(a.value, A), H(w, A));
522
+ const A = T.write(u);
523
+ w !== A && (n.setItem(a.value, A), I(w, A));
517
524
  }
518
525
  } catch (w) {
519
526
  o(w);
520
527
  }
521
528
  }
522
- function ee(c) {
523
- const w = c ? c.newValue : n.getItem(a.value);
529
+ function oe(u) {
530
+ const w = u ? u.newValue : n.getItem(a.value);
524
531
  if (w == null)
525
- return s && y != null && n.setItem(a.value, C.write(y)), y;
526
- if (!c && u) {
527
- const A = C.read(w);
528
- return typeof u == "function" ? u(A, y) : j === "object" && !Array.isArray(A) ? { ...y, ...A } : A;
529
- } else return typeof w != "string" ? w : C.read(w);
532
+ return s && y != null && n.setItem(a.value, T.write(y)), y;
533
+ if (!u && c) {
534
+ const A = T.read(w);
535
+ return typeof c == "function" ? c(A, y) : H === "object" && !Array.isArray(A) ? { ...y, ...A } : A;
536
+ } else return typeof w != "string" ? w : T.read(w);
530
537
  }
531
- function P(c) {
532
- if (!(c && c.storageArea !== n)) {
533
- if (c && c.key == null) {
538
+ function P(u) {
539
+ if (!(u && u.storageArea !== n)) {
540
+ if (u && u.key == null) {
534
541
  g.value = y;
535
542
  return;
536
543
  }
537
- if (!(c && c.key !== a.value)) {
538
- X();
544
+ if (!(u && u.key !== a.value)) {
545
+ Z();
539
546
  try {
540
- (c == null ? void 0 : c.newValue) !== C.write(g.value) && (g.value = ee(c));
547
+ (u == null ? void 0 : u.newValue) !== T.write(g.value) && (g.value = oe(u));
541
548
  } catch (w) {
542
549
  o(w);
543
550
  } finally {
544
- c ? G(V) : V();
551
+ u ? K(V) : V();
545
552
  }
546
553
  }
547
554
  }
548
555
  }
549
- function te(c) {
550
- P(c.detail);
556
+ function ie(u) {
557
+ P(u.detail);
551
558
  }
552
559
  return g;
553
560
  }
554
- function Le(e, t, n = {}) {
561
+ function Ve(e, t, n = {}) {
555
562
  const { window: l = D } = n;
556
- return $e(e, t, l == null ? void 0 : l.localStorage, n);
563
+ return He(e, t, l == null ? void 0 : l.localStorage, n);
557
564
  }
558
- const Ie = /* @__PURE__ */ $({
565
+ const Je = /* @__PURE__ */ L({
559
566
  __name: "PCDevtoolsWrapper",
560
567
  setup(e) {
561
- const t = R(!1), n = Le("pinia-colada-devtools-open", !1);
568
+ const t = R(!1), n = Ve("pinia-colada-devtools-open", !1);
562
569
  async function l() {
563
570
  if (!t.value && (t.value = !0, !customElements.get("pinia-colada-devtools-panel"))) {
564
571
  const { DevtoolsPanel: d } = await import("@pinia/colada-devtools/panel");
@@ -568,24 +575,24 @@ const Ie = /* @__PURE__ */ $({
568
575
  async function r() {
569
576
  await l(), n.value = !0;
570
577
  }
571
- return L(() => {
578
+ return j(() => {
572
579
  requestIdleCallback(() => {
573
580
  import("@pinia/colada-devtools/panel");
574
581
  }), n.value && r();
575
- }), (d, h) => (x(), W(ve, null, {
576
- default: ce(() => [
577
- F(n) ? M("", !0) : (x(), de("button", {
582
+ }), (d, h) => (x(), F(he, null, {
583
+ default: pe(() => [
584
+ $(n) ? N("", !0) : (x(), ve("button", {
578
585
  key: 0,
579
586
  class: "fixed bottom-2 right-2 bg-primary-500 hover:cursor-pointer z-99999",
580
587
  onClick: h[0] || (h[0] = (f) => r())
581
588
  }, " 🍹 Devtools ")),
582
- t.value && F(n) ? (x(), W(ge, { key: 1 })) : M("", !0)
589
+ t.value && $(n) ? (x(), F(Se, { key: 1 })) : N("", !0)
583
590
  ]),
584
591
  _: 1
585
592
  }));
586
593
  }
587
594
  });
588
595
  export {
589
- Ie as PiniaColadaDevtools
596
+ Je as PiniaColadaDevtools
590
597
  };
591
598
  //# sourceMappingURL=index.js.map