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