@pinia/colada-devtools 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +368 -252
- package/dist/index.js.map +1 -1
- package/dist-panel/{_queryId_-hQFnZzX2.js → _queryId_-dahx0N-a.js} +16 -16
- package/dist-panel/{_queryId_-hQFnZzX2.js.map → _queryId_-dahx0N-a.js.map} +1 -1
- package/dist-panel/{index-BVvWMadg.js → index-BkrEntNA.js} +3 -3
- package/dist-panel/{index-BVvWMadg.js.map → index-BkrEntNA.js.map} +1 -1
- package/dist-panel/{index-B2dJ1q6y.js → index-BoUh47CR.js} +2 -2
- package/dist-panel/{index-B2dJ1q6y.js.map → index-BoUh47CR.js.map} +1 -1
- package/dist-panel/{index-DfIXa7Jb.js → index-Covr4drg.js} +693 -713
- package/dist-panel/{index-DfIXa7Jb.js.map → index-Covr4drg.js.map} +1 -1
- package/dist-panel/index.js +1 -1
- package/dist-panel/{loader-B7hpsxwv.js → loader-CuAz6irK.js} +2 -2
- package/dist-panel/loader-CuAz6irK.js.map +1 -0
- package/dist-panel/{mouse-pointer-click-C8Q9Aulw.js → mouse-pointer-click-BRg0nGpd.js} +2 -2
- package/dist-panel/mouse-pointer-click-BRg0nGpd.js.map +1 -0
- package/dist-panel/{mutations-DqlFNONQ.js → mutations-ComK9mEg.js} +2 -2
- package/dist-panel/{mutations-DqlFNONQ.js.map → mutations-ComK9mEg.js.map} +1 -1
- package/dist-panel/{queries-DPJvb6qB.js → queries-C8H8bbDX.js} +85 -88
- package/dist-panel/{queries-DPJvb6qB.js.map → queries-C8H8bbDX.js.map} +1 -1
- package/dist-panel/{settings-DiWRvbPR.js → settings-DoijmHf7.js} +2 -2
- package/dist-panel/{settings-DiWRvbPR.js.map → settings-DoijmHf7.js.map} +1 -1
- package/dist-shared/index.d.ts +0 -15
- package/dist-shared/index.js +51 -152
- package/dist-shared/index.js.map +1 -1
- package/package.json +2 -2
- package/dist-panel/loader-B7hpsxwv.js.map +0 -1
- package/dist-panel/mouse-pointer-click-C8Q9Aulw.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,305 +1,421 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useQueryCache as
|
|
3
|
-
import {
|
|
4
|
-
const ve = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as $, ref as R, onMounted as L, renderSlot as ne, createCommentVNode as M, toValue as A, getCurrentScope as J, onScopeDispose as Q, useTemplateRef as oe, shallowRef as N, watch as P, onBeforeUnmount as ie, createBlock as W, openBlock as x, Teleport as se, createElementVNode as re, 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__ */ $({
|
|
5
5
|
__name: "ClientOnly",
|
|
6
6
|
setup(e) {
|
|
7
|
-
const t =
|
|
8
|
-
return
|
|
7
|
+
const t = R(!1);
|
|
8
|
+
return L(() => {
|
|
9
9
|
t.value = !0;
|
|
10
|
-
}), (
|
|
10
|
+
}), (o, l) => t.value ? ne(o.$slots, "default", { key: 0 }) : M("", !0);
|
|
11
11
|
}
|
|
12
|
-
}),
|
|
12
|
+
}), S = () => performance.timeOrigin + performance.now();
|
|
13
|
+
function me(e) {
|
|
14
|
+
var t;
|
|
15
|
+
if (!I.has(e)) {
|
|
16
|
+
I.set(e, !0);
|
|
17
|
+
for (const o of e.getEntries())
|
|
18
|
+
o[t = p] ?? (o[t] = {
|
|
19
|
+
count: {
|
|
20
|
+
total: 0,
|
|
21
|
+
succeed: 0,
|
|
22
|
+
errored: 0,
|
|
23
|
+
cancelled: 0
|
|
24
|
+
},
|
|
25
|
+
updatedAt: S(),
|
|
26
|
+
inactiveAt: 0,
|
|
27
|
+
simulate: null,
|
|
28
|
+
history: []
|
|
29
|
+
});
|
|
30
|
+
e.$onAction(({ name: o, args: l, after: s, onError: d }) => {
|
|
31
|
+
var h, f;
|
|
32
|
+
if (o === "create")
|
|
33
|
+
s((r) => {
|
|
34
|
+
r[p] = {
|
|
35
|
+
count: {
|
|
36
|
+
total: 0,
|
|
37
|
+
succeed: 0,
|
|
38
|
+
errored: 0,
|
|
39
|
+
cancelled: 0
|
|
40
|
+
},
|
|
41
|
+
updatedAt: S(),
|
|
42
|
+
inactiveAt: 0,
|
|
43
|
+
simulate: null,
|
|
44
|
+
history: []
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
else if (o === "fetch") {
|
|
48
|
+
const [r] = l;
|
|
49
|
+
r[p].count.total++, r[p].updatedAt = S();
|
|
50
|
+
const u = S(), v = {
|
|
51
|
+
id: (((h = r[p].history.at(0)) == null ? void 0 : h.id) ?? -1) + 1,
|
|
52
|
+
key: r.key,
|
|
53
|
+
state: r.state.value,
|
|
54
|
+
updatedAt: u,
|
|
55
|
+
createdAt: u,
|
|
56
|
+
fetchTime: null
|
|
57
|
+
}, n = A((f = r.options) == null ? void 0 : f.enabled) ?? !0;
|
|
58
|
+
n && (v.fetchTime = {
|
|
59
|
+
start: u,
|
|
60
|
+
end: null
|
|
61
|
+
}), r[p].history.unshift(v), r[p].history = r[p].history.slice(0, 10), s(() => {
|
|
62
|
+
n && (v.fetchTime.end = S(), r[p].count.succeed++, v.state = r.state.value, v.updatedAt = S());
|
|
63
|
+
}), d(() => {
|
|
64
|
+
n && (v.fetchTime.end = S(), r[p].count.errored++, v.state = r.state.value, v.updatedAt = S());
|
|
65
|
+
});
|
|
66
|
+
} else if (o === "cancel") {
|
|
67
|
+
const [r] = l;
|
|
68
|
+
r.pending && r[p].count.cancelled++;
|
|
69
|
+
} else if (o === "setEntryState") {
|
|
70
|
+
const [r] = l;
|
|
71
|
+
let u = r[p].history[0];
|
|
72
|
+
s(() => {
|
|
73
|
+
r[p].updatedAt = S(), u ?? (u = r[p].history[0]), u && (u.state = r.state.value, u.updatedAt = S());
|
|
74
|
+
});
|
|
75
|
+
} else if (o === "untrack") {
|
|
76
|
+
const [r] = l;
|
|
77
|
+
s(() => {
|
|
78
|
+
r.active || (r[p].inactiveAt = S());
|
|
79
|
+
});
|
|
80
|
+
} else if (o === "setQueryData") {
|
|
81
|
+
const [r] = l;
|
|
82
|
+
s(() => {
|
|
83
|
+
const u = e.getEntries({ key: r, exact: !0 })[0];
|
|
84
|
+
u && !u.active && (u[p].inactiveAt = S());
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function w(e) {
|
|
91
|
+
return {
|
|
92
|
+
id: e.key.join("\0"),
|
|
93
|
+
key: e.key,
|
|
94
|
+
state: e.state.value,
|
|
95
|
+
asyncStatus: e.asyncStatus.value,
|
|
96
|
+
active: e.active,
|
|
97
|
+
stale: e.stale,
|
|
98
|
+
when: e.when,
|
|
99
|
+
options: e.options && {
|
|
100
|
+
staleTime: e.options.staleTime,
|
|
101
|
+
gcTime: e.options.gcTime,
|
|
102
|
+
refetchOnMount: A(e.options.refetchOnMount),
|
|
103
|
+
refetchOnReconnect: A(e.options.refetchOnReconnect),
|
|
104
|
+
refetchOnWindowFocus: A(e.options.refetchOnWindowFocus),
|
|
105
|
+
enabled: A(e.options.enabled)
|
|
106
|
+
},
|
|
107
|
+
deps: Array.from(e.deps).map(
|
|
108
|
+
(t) => "uid" in t ? {
|
|
109
|
+
type: "component",
|
|
110
|
+
uid: t.uid,
|
|
111
|
+
name: t.type.displayName ?? t.type.name
|
|
112
|
+
} : {
|
|
113
|
+
type: "effect",
|
|
114
|
+
active: t.active,
|
|
115
|
+
detached: t.detached
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
gcTimeout: typeof e.gcTimeout == "number" ? e.gcTimeout : null,
|
|
119
|
+
devtools: e[p]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const I = /* @__PURE__ */ new WeakMap();
|
|
123
|
+
function ye(e, t, o, l) {
|
|
124
|
+
e.addEventListener(t, o, l), J() && Q(() => {
|
|
125
|
+
e.removeEventListener(t, o);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
13
129
|
__name: "PiniaColadaDevtools",
|
|
14
130
|
setup(e) {
|
|
15
|
-
const t =
|
|
16
|
-
|
|
131
|
+
const t = fe();
|
|
132
|
+
me(t), t.$onAction(({ name: n, after: i, onError: m, args: E }) => {
|
|
17
133
|
if (n === "remove") {
|
|
18
|
-
const [a] =
|
|
19
|
-
|
|
20
|
-
|
|
134
|
+
const [a] = E;
|
|
135
|
+
i(() => {
|
|
136
|
+
s.emit("queries:delete", w(a));
|
|
21
137
|
});
|
|
22
138
|
} else if (n === "track" || n === "untrack" || n === "cancel" || n === "invalidate" || n === "fetch" || n === "setEntryState") {
|
|
23
|
-
const [a] =
|
|
139
|
+
const [a] = E;
|
|
24
140
|
if (n === "fetch") {
|
|
25
|
-
const
|
|
26
|
-
|
|
141
|
+
const y = w(a);
|
|
142
|
+
y.asyncStatus = "loading", s.emit("queries:update", y);
|
|
27
143
|
}
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
a[
|
|
31
|
-
|
|
144
|
+
i(() => {
|
|
145
|
+
var y;
|
|
146
|
+
a[p].simulate = null, s.emit("queries:update", w(a)), n === "fetch" && ((y = a.options) == null ? void 0 : y.staleTime) != null && Number.isFinite(a.options.staleTime) && setTimeout(() => {
|
|
147
|
+
s.emit("queries:update", w(a));
|
|
32
148
|
}, a.options.staleTime);
|
|
33
|
-
}),
|
|
34
|
-
|
|
149
|
+
}), m(() => {
|
|
150
|
+
s.emit("queries:update", w(a));
|
|
35
151
|
});
|
|
36
152
|
} else if (n === "create")
|
|
37
|
-
|
|
38
|
-
|
|
153
|
+
i((a) => {
|
|
154
|
+
s.emit("queries:update", w(a));
|
|
39
155
|
});
|
|
40
156
|
else if (n === "setQueryData") {
|
|
41
|
-
const [a] =
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
157
|
+
const [a] = E;
|
|
158
|
+
i(() => {
|
|
159
|
+
const y = t.getEntries({ key: a, exact: !0 })[0];
|
|
160
|
+
y && s.emit("queries:update", w(y));
|
|
45
161
|
});
|
|
46
162
|
}
|
|
47
163
|
});
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
164
|
+
const o = oe("devtools"), l = N(new MessageChannel()), s = new pe(l.value.port1);
|
|
165
|
+
P(
|
|
166
|
+
l,
|
|
51
167
|
(n) => {
|
|
52
|
-
|
|
168
|
+
s.setPort(n.port1);
|
|
53
169
|
},
|
|
54
170
|
{ flush: "sync" }
|
|
55
|
-
),
|
|
56
|
-
console.log("[App] Received ping from devtools"),
|
|
57
|
-
}),
|
|
171
|
+
), s.on("ping", () => {
|
|
172
|
+
console.log("[App] Received ping from devtools"), s.emit("pong");
|
|
173
|
+
}), s.on("pong", () => {
|
|
58
174
|
console.log("[App] Received pong from devtools");
|
|
59
|
-
}),
|
|
175
|
+
}), s.on("queries:refetch", (n) => {
|
|
60
176
|
t.invalidateQueries({ key: n, exact: !0, active: null, stale: null });
|
|
61
|
-
}),
|
|
177
|
+
}), s.on("queries:invalidate", (n) => {
|
|
62
178
|
t.invalidateQueries({ key: n, exact: !0 });
|
|
63
|
-
}),
|
|
64
|
-
const
|
|
65
|
-
|
|
179
|
+
}), s.on("queries:reset", (n) => {
|
|
180
|
+
const i = t.getEntries({ key: n, exact: !0 })[0];
|
|
181
|
+
i && (t.cancel(i), t.setEntryState(i, {
|
|
66
182
|
status: "pending",
|
|
67
183
|
data: void 0,
|
|
68
184
|
error: null
|
|
69
185
|
}));
|
|
70
|
-
}),
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
}),
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
...
|
|
186
|
+
}), s.on("queries:set:state", (n, i) => {
|
|
187
|
+
const m = t.getEntries({ key: n, exact: !0 })[0];
|
|
188
|
+
m && (t.setEntryState(m, i), s.emit("queries:update", w(m)));
|
|
189
|
+
}), s.on("queries:simulate:loading", (n) => {
|
|
190
|
+
const i = t.getEntries({ key: n, exact: !0 })[0];
|
|
191
|
+
i && (i.asyncStatus.value = "loading", i[p].simulate = "loading", s.emit("queries:update", w(i)));
|
|
192
|
+
}), s.on("queries:simulate:loading:stop", (n) => {
|
|
193
|
+
const i = t.getEntries({ key: n, exact: !0 })[0];
|
|
194
|
+
i && i[p].simulate === "loading" && (i.asyncStatus.value = "idle", i[p].simulate = null, s.emit("queries:update", w(i)));
|
|
195
|
+
}), s.on("queries:simulate:error", (n) => {
|
|
196
|
+
const i = t.getEntries({ key: n, exact: !0 })[0];
|
|
197
|
+
i && (t.cancel(i), t.setEntryState(i, {
|
|
198
|
+
...i.state.value,
|
|
83
199
|
status: "error",
|
|
84
200
|
error: new Error("Simulated error")
|
|
85
|
-
}),
|
|
86
|
-
}),
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
...
|
|
90
|
-
status:
|
|
201
|
+
}), i[p].simulate = "error", s.emit("queries:update", w(i)));
|
|
202
|
+
}), s.on("queries:simulate:error:stop", (n) => {
|
|
203
|
+
const i = t.getEntries({ key: n, exact: !0 })[0];
|
|
204
|
+
i && i[p].simulate === "error" && (t.cancel(i), t.setEntryState(i, {
|
|
205
|
+
...i.state.value,
|
|
206
|
+
status: i.state.value.data !== void 0 ? "success" : "pending",
|
|
91
207
|
error: null
|
|
92
|
-
}),
|
|
208
|
+
}), i[p].simulate = null, s.emit("queries:update", w(i)));
|
|
93
209
|
});
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}),
|
|
210
|
+
const d = N(null);
|
|
211
|
+
P(d, () => {
|
|
212
|
+
l.value = new MessageChannel();
|
|
213
|
+
}), ye(
|
|
98
214
|
window,
|
|
99
215
|
"unload",
|
|
100
216
|
() => {
|
|
101
217
|
var n;
|
|
102
|
-
(n =
|
|
218
|
+
(n = d.value) == null || n.close();
|
|
103
219
|
},
|
|
104
220
|
{ passive: !0 }
|
|
105
|
-
),
|
|
221
|
+
), ie(() => {
|
|
106
222
|
var n;
|
|
107
|
-
(n =
|
|
223
|
+
(n = d.value) == null || n.close();
|
|
108
224
|
});
|
|
109
|
-
function
|
|
225
|
+
function h() {
|
|
110
226
|
var n;
|
|
111
|
-
(n =
|
|
227
|
+
(n = d.value) == null || n.close(), d.value = null;
|
|
112
228
|
}
|
|
113
|
-
function
|
|
114
|
-
const n =
|
|
229
|
+
function f() {
|
|
230
|
+
const n = o.value;
|
|
115
231
|
if (!n || !n.shadowRoot)
|
|
116
232
|
throw new Error("No devtools elemnt found for Pinia Colada devtools");
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
233
|
+
const i = n.shadowRoot.getElementById("root");
|
|
234
|
+
if (!i)
|
|
119
235
|
throw new Error("No devtools root element found for Pinia Colada devtools");
|
|
120
|
-
const
|
|
236
|
+
const m = Math.max(i.offsetWidth, 400), E = Math.max(i.offsetHeight, 400), a = window.open(
|
|
121
237
|
"",
|
|
122
238
|
"pinia-colada-devtools",
|
|
123
|
-
`popup,width=${
|
|
239
|
+
`popup,width=${m},height=${E}`
|
|
124
240
|
);
|
|
125
241
|
if (!a)
|
|
126
242
|
throw new Error("Failed to open PiP window for Pinia Colada devtools");
|
|
127
|
-
|
|
243
|
+
d.value = a, a.document.head.innerHTML = "", a.document.body.innerHTML = "", a.document.title = "🍹 Pinia Colada Devtools", a.document.body.style.margin = "0", r(n, a.document), a.addEventListener(
|
|
128
244
|
"unload",
|
|
129
245
|
() => {
|
|
130
|
-
|
|
246
|
+
d.value = null;
|
|
131
247
|
},
|
|
132
248
|
{ passive: !0 }
|
|
133
249
|
);
|
|
134
250
|
}
|
|
135
|
-
function
|
|
251
|
+
function r(n, i = document) {
|
|
136
252
|
if (!n || !n.shadowRoot)
|
|
137
253
|
throw new Error("No devtools element found for Pinia Colada devtools");
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
254
|
+
const m = i.getElementById("__pc-tw-properties") ?? i.createElement("style");
|
|
255
|
+
m.setAttribute("id", "__pc-tw-properties");
|
|
256
|
+
const E = [...n.shadowRoot.styleSheets].flatMap((a) => [...a.cssRules]).filter((a) => a instanceof CSSPropertyRule).map((a) => a.cssText).join("");
|
|
257
|
+
m.textContent = E, i.head.appendChild(m);
|
|
142
258
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
259
|
+
function u() {
|
|
260
|
+
d.value ? h() : f();
|
|
145
261
|
}
|
|
146
|
-
async function
|
|
147
|
-
|
|
262
|
+
async function v() {
|
|
263
|
+
r(o.value), s.emit("queries:all", t.getEntries({}).map(w)), s.emit(
|
|
148
264
|
"mutations:all",
|
|
149
265
|
// FIXME: mutations
|
|
150
|
-
t.getEntries({}).map(
|
|
266
|
+
t.getEntries({}).map(w)
|
|
151
267
|
);
|
|
152
268
|
}
|
|
153
|
-
return (n,
|
|
154
|
-
to:
|
|
269
|
+
return (n, i) => (x(), W(se, {
|
|
270
|
+
to: d.value ? d.value.document.body : "body"
|
|
155
271
|
}, [
|
|
156
|
-
|
|
272
|
+
re("pinia-colada-devtools-panel", {
|
|
157
273
|
ref: "devtools",
|
|
158
|
-
".isPip": !!
|
|
159
|
-
".port":
|
|
160
|
-
onTogglePip:
|
|
161
|
-
onReady:
|
|
162
|
-
}, null, 40,
|
|
274
|
+
".isPip": !!d.value,
|
|
275
|
+
".port": l.value.port2,
|
|
276
|
+
onTogglePip: i[0] || (i[0] = (m) => u()),
|
|
277
|
+
onReady: i[1] || (i[1] = (m) => v())
|
|
278
|
+
}, null, 40, he)
|
|
163
279
|
], 8, ["to"]));
|
|
164
280
|
}
|
|
165
281
|
});
|
|
166
|
-
function
|
|
167
|
-
return
|
|
282
|
+
function we(e) {
|
|
283
|
+
return J() ? (Q(e), !0) : !1;
|
|
168
284
|
}
|
|
169
|
-
const
|
|
285
|
+
const Ee = typeof window < "u" && typeof document < "u";
|
|
170
286
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
171
|
-
const
|
|
287
|
+
const Se = Object.prototype.toString, be = (e) => Se.call(e) === "[object Object]", Ae = () => {
|
|
172
288
|
};
|
|
173
|
-
function
|
|
289
|
+
function Te(...e) {
|
|
174
290
|
if (e.length !== 1)
|
|
175
|
-
return
|
|
291
|
+
return le(...e);
|
|
176
292
|
const t = e[0];
|
|
177
|
-
return typeof t == "function" ?
|
|
293
|
+
return typeof t == "function" ? K(ue(() => ({ get: t, set: Ae }))) : R(t);
|
|
178
294
|
}
|
|
179
295
|
function Ce(e, t) {
|
|
180
|
-
function
|
|
181
|
-
return new Promise((
|
|
182
|
-
Promise.resolve(e(() => t.apply(this,
|
|
296
|
+
function o(...l) {
|
|
297
|
+
return new Promise((s, d) => {
|
|
298
|
+
Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(s).catch(d);
|
|
183
299
|
});
|
|
184
300
|
}
|
|
185
|
-
return
|
|
301
|
+
return o;
|
|
186
302
|
}
|
|
187
|
-
const
|
|
188
|
-
function _e(e =
|
|
303
|
+
const Y = (e) => e();
|
|
304
|
+
function _e(e = Y, t = {}) {
|
|
189
305
|
const {
|
|
190
|
-
initialState:
|
|
191
|
-
} = t,
|
|
192
|
-
function
|
|
193
|
-
|
|
306
|
+
initialState: o = "active"
|
|
307
|
+
} = t, l = Te(o === "active");
|
|
308
|
+
function s() {
|
|
309
|
+
l.value = !1;
|
|
194
310
|
}
|
|
195
|
-
function
|
|
196
|
-
|
|
311
|
+
function d() {
|
|
312
|
+
l.value = !0;
|
|
197
313
|
}
|
|
198
|
-
const
|
|
199
|
-
|
|
314
|
+
const h = (...f) => {
|
|
315
|
+
l.value && e(...f);
|
|
200
316
|
};
|
|
201
|
-
return { isActive:
|
|
317
|
+
return { isActive: K(l), pause: s, resume: d, eventFilter: h };
|
|
202
318
|
}
|
|
203
|
-
function
|
|
319
|
+
function q(e) {
|
|
204
320
|
return Array.isArray(e) ? e : [e];
|
|
205
321
|
}
|
|
206
322
|
function Pe(e) {
|
|
207
|
-
return
|
|
323
|
+
return ae();
|
|
208
324
|
}
|
|
209
|
-
function
|
|
325
|
+
function Oe(e, t, o = {}) {
|
|
210
326
|
const {
|
|
211
|
-
eventFilter:
|
|
212
|
-
...
|
|
213
|
-
} =
|
|
214
|
-
return
|
|
327
|
+
eventFilter: l = Y,
|
|
328
|
+
...s
|
|
329
|
+
} = o;
|
|
330
|
+
return P(
|
|
215
331
|
e,
|
|
216
332
|
Ce(
|
|
217
|
-
|
|
333
|
+
l,
|
|
218
334
|
t
|
|
219
335
|
),
|
|
220
|
-
|
|
336
|
+
s
|
|
221
337
|
);
|
|
222
338
|
}
|
|
223
|
-
function
|
|
339
|
+
function ke(e, t, o = {}) {
|
|
224
340
|
const {
|
|
225
|
-
eventFilter:
|
|
226
|
-
initialState:
|
|
227
|
-
...
|
|
228
|
-
} =
|
|
229
|
-
return { stop:
|
|
341
|
+
eventFilter: l,
|
|
342
|
+
initialState: s = "active",
|
|
343
|
+
...d
|
|
344
|
+
} = o, { eventFilter: h, pause: f, resume: r, isActive: u } = _e(l, { initialState: s });
|
|
345
|
+
return { stop: Oe(
|
|
230
346
|
e,
|
|
231
347
|
t,
|
|
232
348
|
{
|
|
233
|
-
...
|
|
234
|
-
eventFilter:
|
|
349
|
+
...d,
|
|
350
|
+
eventFilter: h
|
|
235
351
|
}
|
|
236
|
-
), pause:
|
|
352
|
+
), pause: f, resume: r, isActive: u };
|
|
237
353
|
}
|
|
238
|
-
function
|
|
239
|
-
Pe() ?
|
|
354
|
+
function xe(e, t = !0, o) {
|
|
355
|
+
Pe() ? L(e, o) : t ? e() : G(e);
|
|
240
356
|
}
|
|
241
|
-
function
|
|
242
|
-
return
|
|
357
|
+
function De(e, t, o) {
|
|
358
|
+
return P(
|
|
243
359
|
e,
|
|
244
360
|
t,
|
|
245
361
|
{
|
|
246
|
-
...
|
|
362
|
+
...o,
|
|
247
363
|
immediate: !0
|
|
248
364
|
}
|
|
249
365
|
);
|
|
250
366
|
}
|
|
251
|
-
const
|
|
367
|
+
const D = Ee ? window : void 0;
|
|
252
368
|
function Re(e) {
|
|
253
369
|
var t;
|
|
254
|
-
const
|
|
255
|
-
return (t =
|
|
370
|
+
const o = A(e);
|
|
371
|
+
return (t = o == null ? void 0 : o.$el) != null ? t : o;
|
|
256
372
|
}
|
|
257
|
-
function
|
|
258
|
-
const t = [],
|
|
259
|
-
t.forEach((
|
|
260
|
-
},
|
|
261
|
-
const
|
|
262
|
-
return
|
|
263
|
-
}),
|
|
373
|
+
function z(...e) {
|
|
374
|
+
const t = [], o = () => {
|
|
375
|
+
t.forEach((f) => f()), t.length = 0;
|
|
376
|
+
}, l = (f, r, u, v) => (f.addEventListener(r, u, v), () => f.removeEventListener(r, u, v)), s = U(() => {
|
|
377
|
+
const f = q(A(e[0])).filter((r) => r != null);
|
|
378
|
+
return f.every((r) => typeof r != "string") ? f : void 0;
|
|
379
|
+
}), d = De(
|
|
264
380
|
() => {
|
|
265
|
-
var
|
|
381
|
+
var f, r;
|
|
266
382
|
return [
|
|
267
|
-
(
|
|
268
|
-
|
|
269
|
-
|
|
383
|
+
(r = (f = s.value) == null ? void 0 : f.map((u) => Re(u))) != null ? r : [D].filter((u) => u != null),
|
|
384
|
+
q(A(s.value ? e[1] : e[0])),
|
|
385
|
+
q(F(s.value ? e[2] : e[1])),
|
|
270
386
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
271
|
-
|
|
387
|
+
A(s.value ? e[3] : e[2])
|
|
272
388
|
];
|
|
273
389
|
},
|
|
274
|
-
([
|
|
275
|
-
if (
|
|
390
|
+
([f, r, u, v]) => {
|
|
391
|
+
if (o(), !(f != null && f.length) || !(r != null && r.length) || !(u != null && u.length))
|
|
276
392
|
return;
|
|
277
|
-
const n =
|
|
393
|
+
const n = be(v) ? { ...v } : v;
|
|
278
394
|
t.push(
|
|
279
|
-
...
|
|
280
|
-
(
|
|
281
|
-
(
|
|
395
|
+
...f.flatMap(
|
|
396
|
+
(i) => r.flatMap(
|
|
397
|
+
(m) => u.map((E) => l(i, m, E, n))
|
|
282
398
|
)
|
|
283
399
|
)
|
|
284
400
|
);
|
|
285
401
|
},
|
|
286
402
|
{ flush: "post" }
|
|
287
|
-
),
|
|
288
|
-
|
|
403
|
+
), h = () => {
|
|
404
|
+
d(), o();
|
|
289
405
|
};
|
|
290
|
-
return
|
|
406
|
+
return we(o), h;
|
|
291
407
|
}
|
|
292
|
-
const
|
|
293
|
-
function
|
|
294
|
-
return
|
|
408
|
+
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();
|
|
409
|
+
function Me() {
|
|
410
|
+
return k in O || (O[k] = O[k] || {}), O[k];
|
|
295
411
|
}
|
|
296
412
|
function Ne(e, t) {
|
|
297
|
-
return
|
|
413
|
+
return qe[e] || t;
|
|
298
414
|
}
|
|
299
|
-
function
|
|
415
|
+
function We(e) {
|
|
300
416
|
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";
|
|
301
417
|
}
|
|
302
|
-
const
|
|
418
|
+
const Fe = {
|
|
303
419
|
boolean: {
|
|
304
420
|
read: (e) => e === "true",
|
|
305
421
|
write: (e) => String(e)
|
|
@@ -332,135 +448,135 @@ const We = {
|
|
|
332
448
|
read: (e) => new Date(e),
|
|
333
449
|
write: (e) => e.toISOString()
|
|
334
450
|
}
|
|
335
|
-
},
|
|
336
|
-
function
|
|
337
|
-
var
|
|
451
|
+
}, B = "vueuse-storage";
|
|
452
|
+
function $e(e, t, o, l = {}) {
|
|
453
|
+
var s;
|
|
338
454
|
const {
|
|
339
|
-
flush:
|
|
340
|
-
deep:
|
|
341
|
-
listenToStorageChanges:
|
|
342
|
-
writeDefaults:
|
|
343
|
-
mergeDefaults:
|
|
344
|
-
shallow:
|
|
345
|
-
window: n =
|
|
346
|
-
eventFilter:
|
|
347
|
-
onError:
|
|
348
|
-
console.error(
|
|
455
|
+
flush: d = "pre",
|
|
456
|
+
deep: h = !0,
|
|
457
|
+
listenToStorageChanges: f = !0,
|
|
458
|
+
writeDefaults: r = !0,
|
|
459
|
+
mergeDefaults: u = !1,
|
|
460
|
+
shallow: v,
|
|
461
|
+
window: n = D,
|
|
462
|
+
eventFilter: i,
|
|
463
|
+
onError: m = (c) => {
|
|
464
|
+
console.error(c);
|
|
349
465
|
},
|
|
350
|
-
initOnMounted:
|
|
351
|
-
} =
|
|
352
|
-
if (!
|
|
466
|
+
initOnMounted: E
|
|
467
|
+
} = l, a = (v ? N : R)(t), y = U(() => A(e));
|
|
468
|
+
if (!o)
|
|
353
469
|
try {
|
|
354
|
-
|
|
355
|
-
var
|
|
356
|
-
return (
|
|
470
|
+
o = Ne("getDefaultStorage", () => {
|
|
471
|
+
var c;
|
|
472
|
+
return (c = D) == null ? void 0 : c.localStorage;
|
|
357
473
|
})();
|
|
358
|
-
} catch (
|
|
359
|
-
|
|
474
|
+
} catch (c) {
|
|
475
|
+
m(c);
|
|
360
476
|
}
|
|
361
|
-
if (!
|
|
477
|
+
if (!o)
|
|
362
478
|
return a;
|
|
363
|
-
const
|
|
479
|
+
const T = A(t), j = We(T), C = (s = l.serializer) != null ? s : Fe[j], { pause: X, resume: V } = ke(
|
|
364
480
|
a,
|
|
365
|
-
() =>
|
|
366
|
-
{ flush:
|
|
481
|
+
() => Z(a.value),
|
|
482
|
+
{ flush: d, deep: h, eventFilter: i }
|
|
367
483
|
);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}),
|
|
371
|
-
function
|
|
484
|
+
P(y, () => _(), { flush: d }), n && f && xe(() => {
|
|
485
|
+
o instanceof Storage ? z(n, "storage", _, { passive: !0 }) : z(n, B, te), E && _();
|
|
486
|
+
}), E || _();
|
|
487
|
+
function H(c, g) {
|
|
372
488
|
if (n) {
|
|
373
|
-
const
|
|
374
|
-
key:
|
|
375
|
-
oldValue:
|
|
376
|
-
newValue:
|
|
377
|
-
storageArea:
|
|
489
|
+
const b = {
|
|
490
|
+
key: y.value,
|
|
491
|
+
oldValue: c,
|
|
492
|
+
newValue: g,
|
|
493
|
+
storageArea: o
|
|
378
494
|
};
|
|
379
|
-
n.dispatchEvent(
|
|
380
|
-
detail:
|
|
495
|
+
n.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", b) : new CustomEvent(B, {
|
|
496
|
+
detail: b
|
|
381
497
|
}));
|
|
382
498
|
}
|
|
383
499
|
}
|
|
384
|
-
function
|
|
500
|
+
function Z(c) {
|
|
385
501
|
try {
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
|
|
502
|
+
const g = o.getItem(y.value);
|
|
503
|
+
if (c == null)
|
|
504
|
+
H(g, null), o.removeItem(y.value);
|
|
389
505
|
else {
|
|
390
|
-
const
|
|
391
|
-
|
|
506
|
+
const b = C.write(c);
|
|
507
|
+
g !== b && (o.setItem(y.value, b), H(g, b));
|
|
392
508
|
}
|
|
393
|
-
} catch (
|
|
394
|
-
|
|
509
|
+
} catch (g) {
|
|
510
|
+
m(g);
|
|
395
511
|
}
|
|
396
512
|
}
|
|
397
|
-
function
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
400
|
-
return
|
|
401
|
-
if (!
|
|
402
|
-
const
|
|
403
|
-
return typeof
|
|
404
|
-
} else return typeof
|
|
513
|
+
function ee(c) {
|
|
514
|
+
const g = c ? c.newValue : o.getItem(y.value);
|
|
515
|
+
if (g == null)
|
|
516
|
+
return r && T != null && o.setItem(y.value, C.write(T)), T;
|
|
517
|
+
if (!c && u) {
|
|
518
|
+
const b = C.read(g);
|
|
519
|
+
return typeof u == "function" ? u(b, T) : j === "object" && !Array.isArray(b) ? { ...T, ...b } : b;
|
|
520
|
+
} else return typeof g != "string" ? g : C.read(g);
|
|
405
521
|
}
|
|
406
|
-
function
|
|
407
|
-
if (!(
|
|
408
|
-
if (
|
|
409
|
-
a.value =
|
|
522
|
+
function _(c) {
|
|
523
|
+
if (!(c && c.storageArea !== o)) {
|
|
524
|
+
if (c && c.key == null) {
|
|
525
|
+
a.value = T;
|
|
410
526
|
return;
|
|
411
527
|
}
|
|
412
|
-
if (!(
|
|
413
|
-
|
|
528
|
+
if (!(c && c.key !== y.value)) {
|
|
529
|
+
X();
|
|
414
530
|
try {
|
|
415
|
-
(
|
|
416
|
-
} catch (
|
|
417
|
-
|
|
531
|
+
(c == null ? void 0 : c.newValue) !== C.write(a.value) && (a.value = ee(c));
|
|
532
|
+
} catch (g) {
|
|
533
|
+
m(g);
|
|
418
534
|
} finally {
|
|
419
|
-
|
|
535
|
+
c ? G(V) : V();
|
|
420
536
|
}
|
|
421
537
|
}
|
|
422
538
|
}
|
|
423
539
|
}
|
|
424
|
-
function
|
|
425
|
-
|
|
540
|
+
function te(c) {
|
|
541
|
+
_(c.detail);
|
|
426
542
|
}
|
|
427
543
|
return a;
|
|
428
544
|
}
|
|
429
|
-
function
|
|
430
|
-
const { window:
|
|
431
|
-
return
|
|
545
|
+
function Le(e, t, o = {}) {
|
|
546
|
+
const { window: l = D } = o;
|
|
547
|
+
return $e(e, t, l == null ? void 0 : l.localStorage, o);
|
|
432
548
|
}
|
|
433
|
-
const
|
|
549
|
+
const Ie = /* @__PURE__ */ $({
|
|
434
550
|
__name: "PCDevtoolsWrapper",
|
|
435
551
|
setup(e) {
|
|
436
|
-
const t =
|
|
437
|
-
async function
|
|
552
|
+
const t = R(!1), o = Le("pinia-colada-devtools-open", !1);
|
|
553
|
+
async function l() {
|
|
438
554
|
if (!t.value && (t.value = !0, !customElements.get("pinia-colada-devtools-panel"))) {
|
|
439
|
-
const { DevtoolsPanel:
|
|
440
|
-
customElements.define("pinia-colada-devtools-panel",
|
|
555
|
+
const { DevtoolsPanel: d } = await import("@pinia/colada-devtools/panel");
|
|
556
|
+
customElements.define("pinia-colada-devtools-panel", d);
|
|
441
557
|
}
|
|
442
558
|
}
|
|
443
|
-
async function
|
|
444
|
-
await
|
|
559
|
+
async function s() {
|
|
560
|
+
await l(), o.value = !0;
|
|
445
561
|
}
|
|
446
|
-
return
|
|
562
|
+
return L(() => {
|
|
447
563
|
requestIdleCallback(() => {
|
|
448
564
|
import("@pinia/colada-devtools/panel");
|
|
449
|
-
}),
|
|
450
|
-
}), (
|
|
451
|
-
default:
|
|
452
|
-
|
|
565
|
+
}), o.value && s();
|
|
566
|
+
}), (d, h) => (x(), W(ve, null, {
|
|
567
|
+
default: ce(() => [
|
|
568
|
+
F(o) ? M("", !0) : (x(), de("button", {
|
|
453
569
|
key: 0,
|
|
454
570
|
class: "fixed bottom-2 right-2 bg-primary-500 hover:cursor-pointer z-99999",
|
|
455
|
-
onClick:
|
|
571
|
+
onClick: h[0] || (h[0] = (f) => s())
|
|
456
572
|
}, " 🍹 Devtools ")),
|
|
457
|
-
t.value &&
|
|
573
|
+
t.value && F(o) ? (x(), W(ge, { key: 1 })) : M("", !0)
|
|
458
574
|
]),
|
|
459
575
|
_: 1
|
|
460
576
|
}));
|
|
461
577
|
}
|
|
462
578
|
});
|
|
463
579
|
export {
|
|
464
|
-
|
|
580
|
+
Ie as PiniaColadaDevtools
|
|
465
581
|
};
|
|
466
582
|
//# sourceMappingURL=index.js.map
|