@ametie/vue-muza-use 1.2.2 → 1.2.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.cjs +3847 -170
- package/dist/index.mjs +3641 -18
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,3634 @@
|
|
|
1
1
|
// src/plugin.ts
|
|
2
2
|
import { inject } from "vue";
|
|
3
3
|
|
|
4
|
+
// ../devtools/dist/index.mjs
|
|
5
|
+
import { reactive as rt, computed as O, markRaw as Ct, ref as q, onMounted as X, onScopeDispose as he, watch as ae, defineComponent as $, h as De, openBlock as h, createElementBlock as y, createElementVNode as f, createVNode as L, Fragment as N, renderList as W, normalizeClass as P, createBlock as F, unref as m, resolveDynamicComponent as Oe, createCommentVNode as M, toDisplayString as C, Transition as ze, withCtx as Ae, normalizeStyle as K, createApp as Ot, shallowRef as zt, triggerRef as Ve, createTextVNode as ce, resolveComponent as At, withDirectives as ge, isRef as Ne, vModelText as qt, vShow as We, Teleport as $t, withKeys as Lt } from "vue";
|
|
6
|
+
var A = rt({
|
|
7
|
+
instances: /* @__PURE__ */ new Map(),
|
|
8
|
+
requests: [],
|
|
9
|
+
config: { maxHistory: 300, maxPayloadSize: 2e5 }
|
|
10
|
+
});
|
|
11
|
+
function ke(e, i) {
|
|
12
|
+
try {
|
|
13
|
+
const t = JSON.stringify(e);
|
|
14
|
+
return !t || t.length <= i ? { value: e, truncated: false } : {
|
|
15
|
+
value: t.slice(0, i) + `
|
|
16
|
+
\u2026[+${t.length - i} bytes truncated]`,
|
|
17
|
+
truncated: true
|
|
18
|
+
};
|
|
19
|
+
} catch {
|
|
20
|
+
return { value: "[non-serializable]", truncated: true };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var at = O(
|
|
24
|
+
() => A.instances
|
|
25
|
+
);
|
|
26
|
+
var qe = O(
|
|
27
|
+
() => A.requests
|
|
28
|
+
);
|
|
29
|
+
function Ft(e) {
|
|
30
|
+
A.instances.clear(), A.requests.splice(0), A.config.maxHistory = e.maxHistory ?? 300, A.config.maxPayloadSize = e.maxPayloadSize ?? 2e5;
|
|
31
|
+
}
|
|
32
|
+
function Pt(e, i, t) {
|
|
33
|
+
A.instances.set(e, {
|
|
34
|
+
id: e,
|
|
35
|
+
url: i,
|
|
36
|
+
method: "GET",
|
|
37
|
+
createdAt: Date.now(),
|
|
38
|
+
state: { loading: false, error: null, statusCode: null, data: null },
|
|
39
|
+
options: t,
|
|
40
|
+
requestCount: 0,
|
|
41
|
+
lastRequestAt: null
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function Rt(e) {
|
|
45
|
+
A.instances.delete(e);
|
|
46
|
+
}
|
|
47
|
+
function jt(e, i) {
|
|
48
|
+
const t = A.instances.get(e);
|
|
49
|
+
t && (t.state = { ...t.state, ...i });
|
|
50
|
+
}
|
|
51
|
+
function Dt(e) {
|
|
52
|
+
const { value: i, truncated: t } = ke(e.payload, A.config.maxPayloadSize), { value: n, truncated: s } = ke(e.queryParams, A.config.maxPayloadSize), o = {
|
|
53
|
+
...e,
|
|
54
|
+
payload: i,
|
|
55
|
+
queryParams: n,
|
|
56
|
+
duration: null,
|
|
57
|
+
response: null,
|
|
58
|
+
error: null,
|
|
59
|
+
truncated: t || s
|
|
60
|
+
};
|
|
61
|
+
if (A.requests.length >= A.config.maxHistory && A.requests.shift(), A.requests.push(o), e.instanceId) {
|
|
62
|
+
const l = A.instances.get(e.instanceId);
|
|
63
|
+
l && (l.requestCount++, l.lastRequestAt = e.startedAt);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function Vt(e, i) {
|
|
67
|
+
const t = A.requests.findIndex((s) => s.id === e);
|
|
68
|
+
if (t === -1) return;
|
|
69
|
+
const n = A.requests[t];
|
|
70
|
+
if (i.status === "success") {
|
|
71
|
+
const { value: s, truncated: o } = ke(
|
|
72
|
+
i.response,
|
|
73
|
+
A.config.maxPayloadSize
|
|
74
|
+
);
|
|
75
|
+
A.requests[t] = {
|
|
76
|
+
...n,
|
|
77
|
+
status: "success",
|
|
78
|
+
statusCode: i.statusCode,
|
|
79
|
+
response: s,
|
|
80
|
+
duration: i.duration,
|
|
81
|
+
truncated: n.truncated || o
|
|
82
|
+
};
|
|
83
|
+
} else i.status === "error" ? A.requests[t] = {
|
|
84
|
+
...n,
|
|
85
|
+
status: "error",
|
|
86
|
+
statusCode: i.statusCode,
|
|
87
|
+
error: i.error,
|
|
88
|
+
duration: i.duration
|
|
89
|
+
} : A.requests[t] = { ...n, status: "aborted", duration: i.duration };
|
|
90
|
+
}
|
|
91
|
+
function He() {
|
|
92
|
+
A.requests.splice(0);
|
|
93
|
+
}
|
|
94
|
+
function Nt(e) {
|
|
95
|
+
return A.requests.filter((i) => i.instanceId === e);
|
|
96
|
+
}
|
|
97
|
+
var se = rt({ tabs: [] });
|
|
98
|
+
var Q = O(
|
|
99
|
+
() => [...se.tabs].sort((e, i) => e.order - i.order)
|
|
100
|
+
);
|
|
101
|
+
function Be(e) {
|
|
102
|
+
if (se.tabs.some((t) => t.id === e.id)) return;
|
|
103
|
+
const i = e.order ?? se.tabs.length + 10;
|
|
104
|
+
se.tabs.push({ ...e, order: i, component: Ct(e.component) });
|
|
105
|
+
}
|
|
106
|
+
function Wt(e, i, t) {
|
|
107
|
+
Pt(e, i, t);
|
|
108
|
+
}
|
|
109
|
+
function Ht(e) {
|
|
110
|
+
Rt(e);
|
|
111
|
+
}
|
|
112
|
+
function Bt(e, i) {
|
|
113
|
+
jt(e, i);
|
|
114
|
+
}
|
|
115
|
+
function Kt(e) {
|
|
116
|
+
Dt(e);
|
|
117
|
+
}
|
|
118
|
+
function Ut(e, i) {
|
|
119
|
+
Vt(e, i);
|
|
120
|
+
}
|
|
121
|
+
function $e(e) {
|
|
122
|
+
return new Promise((i, t) => {
|
|
123
|
+
e.oncomplete = e.onsuccess = () => i(e.result), e.onabort = e.onerror = () => t(e.error);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function Jt(e, i) {
|
|
127
|
+
let t;
|
|
128
|
+
const n = () => {
|
|
129
|
+
if (t)
|
|
130
|
+
return t;
|
|
131
|
+
const s = indexedDB.open(e);
|
|
132
|
+
return s.onupgradeneeded = () => s.result.createObjectStore(i), t = $e(s), t.then((o) => {
|
|
133
|
+
o.onclose = () => t = void 0;
|
|
134
|
+
}, () => {
|
|
135
|
+
}), t;
|
|
136
|
+
};
|
|
137
|
+
return (s, o) => n().then((l) => o(l.transaction(i, s).objectStore(i)));
|
|
138
|
+
}
|
|
139
|
+
var ye;
|
|
140
|
+
function ct() {
|
|
141
|
+
return ye || (ye = Jt("keyval-store", "keyval")), ye;
|
|
142
|
+
}
|
|
143
|
+
function H(e, i = ct()) {
|
|
144
|
+
return i("readonly", (t) => $e(t.get(e)));
|
|
145
|
+
}
|
|
146
|
+
function B(e, i, t = ct()) {
|
|
147
|
+
return t("readwrite", (n) => (n.put(i, e), $e(n.transaction)));
|
|
148
|
+
}
|
|
149
|
+
var R = {
|
|
150
|
+
panelHeight: "vmd:panel-height",
|
|
151
|
+
panelMode: "vmd:panel-mode",
|
|
152
|
+
panelSideWidth: "vmd:panel-side-width",
|
|
153
|
+
activeTab: "vmd:active-tab",
|
|
154
|
+
networkToolbarVisible: "vmd:network-toolbar-visible",
|
|
155
|
+
networkFilterVisible: "vmd:network-filter-visible",
|
|
156
|
+
splitPayloadWidth: "vmd:split-payload-width",
|
|
157
|
+
payloadFormat: "vmd:payload-format",
|
|
158
|
+
responseFormat: "vmd:response-format"
|
|
159
|
+
};
|
|
160
|
+
async function Xt() {
|
|
161
|
+
return H(R.activeTab);
|
|
162
|
+
}
|
|
163
|
+
async function Qt(e) {
|
|
164
|
+
return B(R.activeTab, e);
|
|
165
|
+
}
|
|
166
|
+
async function Gt() {
|
|
167
|
+
return H(R.panelHeight);
|
|
168
|
+
}
|
|
169
|
+
async function Yt(e) {
|
|
170
|
+
return B(R.panelHeight, e);
|
|
171
|
+
}
|
|
172
|
+
async function Zt() {
|
|
173
|
+
return await H(R.panelMode) ?? "side";
|
|
174
|
+
}
|
|
175
|
+
async function en(e) {
|
|
176
|
+
return B(R.panelMode, e);
|
|
177
|
+
}
|
|
178
|
+
async function tn() {
|
|
179
|
+
return H(R.panelSideWidth);
|
|
180
|
+
}
|
|
181
|
+
async function nn(e) {
|
|
182
|
+
return B(R.panelSideWidth, e);
|
|
183
|
+
}
|
|
184
|
+
async function sn() {
|
|
185
|
+
return await H(R.networkToolbarVisible) ?? true;
|
|
186
|
+
}
|
|
187
|
+
async function on(e) {
|
|
188
|
+
return B(R.networkToolbarVisible, e);
|
|
189
|
+
}
|
|
190
|
+
async function ln() {
|
|
191
|
+
return await H(R.networkFilterVisible) ?? true;
|
|
192
|
+
}
|
|
193
|
+
async function rn(e) {
|
|
194
|
+
return B(R.networkFilterVisible, e);
|
|
195
|
+
}
|
|
196
|
+
async function an() {
|
|
197
|
+
return H(R.splitPayloadWidth);
|
|
198
|
+
}
|
|
199
|
+
async function cn(e) {
|
|
200
|
+
return B(R.splitPayloadWidth, e);
|
|
201
|
+
}
|
|
202
|
+
async function un() {
|
|
203
|
+
return await H(R.payloadFormat) ?? "kv";
|
|
204
|
+
}
|
|
205
|
+
async function dn(e) {
|
|
206
|
+
return B(R.payloadFormat, e);
|
|
207
|
+
}
|
|
208
|
+
async function hn() {
|
|
209
|
+
return await H(R.responseFormat) ?? "json";
|
|
210
|
+
}
|
|
211
|
+
async function fn(e) {
|
|
212
|
+
return B(R.responseFormat, e);
|
|
213
|
+
}
|
|
214
|
+
var pn = 360;
|
|
215
|
+
var mn = 200;
|
|
216
|
+
var vn = 0.8;
|
|
217
|
+
var gn = 380;
|
|
218
|
+
var yn = 280;
|
|
219
|
+
var bn = 0.6;
|
|
220
|
+
var wn = q(false);
|
|
221
|
+
var te = q("side");
|
|
222
|
+
var be = false;
|
|
223
|
+
function fe() {
|
|
224
|
+
const e = q(pn), i = wn, t = te, n = q(gn);
|
|
225
|
+
X(async () => {
|
|
226
|
+
const [d, w, p] = await Promise.all([
|
|
227
|
+
Gt(),
|
|
228
|
+
be ? Promise.resolve(te.value) : Zt(),
|
|
229
|
+
tn()
|
|
230
|
+
]);
|
|
231
|
+
d !== void 0 && (e.value = d), be || (te.value = w, be = true), p !== void 0 && (n.value = p);
|
|
232
|
+
});
|
|
233
|
+
function s() {
|
|
234
|
+
i.value = !i.value;
|
|
235
|
+
}
|
|
236
|
+
function o() {
|
|
237
|
+
i.value = false;
|
|
238
|
+
}
|
|
239
|
+
function l(d) {
|
|
240
|
+
te.value = d, en(d);
|
|
241
|
+
}
|
|
242
|
+
let r = false, a = null, c = null;
|
|
243
|
+
function u(d) {
|
|
244
|
+
const w = d.clientY, p = e.value;
|
|
245
|
+
r = true;
|
|
246
|
+
function b(x) {
|
|
247
|
+
if (!r) return;
|
|
248
|
+
const T = Math.floor(window.innerHeight * vn);
|
|
249
|
+
e.value = Math.max(mn, Math.min(p + (w - x.clientY), T));
|
|
250
|
+
}
|
|
251
|
+
function v() {
|
|
252
|
+
r = false, a = null, Yt(e.value), window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", v);
|
|
253
|
+
}
|
|
254
|
+
a = () => {
|
|
255
|
+
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", v);
|
|
256
|
+
}, window.addEventListener("mousemove", b), window.addEventListener("mouseup", v), d.preventDefault();
|
|
257
|
+
}
|
|
258
|
+
function g(d) {
|
|
259
|
+
const w = d.clientX, p = n.value;
|
|
260
|
+
r = true;
|
|
261
|
+
function b(x) {
|
|
262
|
+
if (!r) return;
|
|
263
|
+
const T = Math.floor(window.innerWidth * bn);
|
|
264
|
+
n.value = Math.max(yn, Math.min(p + (w - x.clientX), T));
|
|
265
|
+
}
|
|
266
|
+
function v() {
|
|
267
|
+
r = false, c = null, nn(n.value), window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", v);
|
|
268
|
+
}
|
|
269
|
+
c = () => {
|
|
270
|
+
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", v);
|
|
271
|
+
}, window.addEventListener("mousemove", b), window.addEventListener("mouseup", v), d.preventDefault();
|
|
272
|
+
}
|
|
273
|
+
return he(() => {
|
|
274
|
+
a == null || a(), c == null || c();
|
|
275
|
+
}), { height: e, isOpen: i, panelMode: t, sideWidth: n, startResizeHeight: u, startResizeSideWidth: g, switchMode: l, toggle: s, close: o };
|
|
276
|
+
}
|
|
277
|
+
function ut() {
|
|
278
|
+
const e = q(null);
|
|
279
|
+
X(async () => {
|
|
280
|
+
const n = await Xt();
|
|
281
|
+
n ? e.value = n : Q.value.length > 0 && (e.value = Q.value[0].id);
|
|
282
|
+
}), ae(e, (n) => {
|
|
283
|
+
n && Qt(n);
|
|
284
|
+
});
|
|
285
|
+
const i = O(
|
|
286
|
+
() => Q.value.find((n) => n.id === e.value) ?? Q.value[0] ?? null
|
|
287
|
+
);
|
|
288
|
+
function t(n) {
|
|
289
|
+
e.value = n;
|
|
290
|
+
}
|
|
291
|
+
return { registeredTabs: Q, activeTabId: e, activeTab: i, setActiveTab: t };
|
|
292
|
+
}
|
|
293
|
+
var ne = q(false);
|
|
294
|
+
function Le() {
|
|
295
|
+
const e = q(true), i = q(true);
|
|
296
|
+
X(async () => {
|
|
297
|
+
const [l, r] = await Promise.all([
|
|
298
|
+
sn(),
|
|
299
|
+
ln()
|
|
300
|
+
]);
|
|
301
|
+
e.value = l, i.value = r;
|
|
302
|
+
});
|
|
303
|
+
function t() {
|
|
304
|
+
e.value = !e.value, on(e.value);
|
|
305
|
+
}
|
|
306
|
+
function n() {
|
|
307
|
+
i.value = !i.value, rn(i.value);
|
|
308
|
+
}
|
|
309
|
+
function s() {
|
|
310
|
+
ne.value = !ne.value;
|
|
311
|
+
}
|
|
312
|
+
function o() {
|
|
313
|
+
ne.value = false;
|
|
314
|
+
}
|
|
315
|
+
return { toolbarVisible: e, filterVisible: i, settingsOpen: ne, toggleToolbar: t, toggleFilter: n, toggleSettings: s, closeSettings: o };
|
|
316
|
+
}
|
|
317
|
+
var dt = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
318
|
+
var pe = (e, i, t, n = "") => {
|
|
319
|
+
const s = e.split(":");
|
|
320
|
+
if (e.slice(0, 1) === "@") {
|
|
321
|
+
if (s.length < 2 || s.length > 3)
|
|
322
|
+
return null;
|
|
323
|
+
n = s.shift().slice(1);
|
|
324
|
+
}
|
|
325
|
+
if (s.length > 3 || !s.length)
|
|
326
|
+
return null;
|
|
327
|
+
if (s.length > 1) {
|
|
328
|
+
const r = s.pop(), a = s.pop(), c = {
|
|
329
|
+
// Allow provider without '@': "provider:prefix:name"
|
|
330
|
+
provider: s.length > 0 ? s[0] : n,
|
|
331
|
+
prefix: a,
|
|
332
|
+
name: r
|
|
333
|
+
};
|
|
334
|
+
return i && !ie(c) ? null : c;
|
|
335
|
+
}
|
|
336
|
+
const o = s[0], l = o.split("-");
|
|
337
|
+
if (l.length > 1) {
|
|
338
|
+
const r = {
|
|
339
|
+
provider: n,
|
|
340
|
+
prefix: l.shift(),
|
|
341
|
+
name: l.join("-")
|
|
342
|
+
};
|
|
343
|
+
return i && !ie(r) ? null : r;
|
|
344
|
+
}
|
|
345
|
+
if (t && n === "") {
|
|
346
|
+
const r = {
|
|
347
|
+
provider: n,
|
|
348
|
+
prefix: "",
|
|
349
|
+
name: o
|
|
350
|
+
};
|
|
351
|
+
return i && !ie(r, t) ? null : r;
|
|
352
|
+
}
|
|
353
|
+
return null;
|
|
354
|
+
};
|
|
355
|
+
var ie = (e, i) => e ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
|
|
356
|
+
// Check name: cannot be empty
|
|
357
|
+
((i && e.prefix === "" || e.prefix) && e.name) : false;
|
|
358
|
+
var ht = Object.freeze(
|
|
359
|
+
{
|
|
360
|
+
left: 0,
|
|
361
|
+
top: 0,
|
|
362
|
+
width: 16,
|
|
363
|
+
height: 16
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
var ue = Object.freeze({
|
|
367
|
+
rotate: 0,
|
|
368
|
+
vFlip: false,
|
|
369
|
+
hFlip: false
|
|
370
|
+
});
|
|
371
|
+
var me = Object.freeze({
|
|
372
|
+
...ht,
|
|
373
|
+
...ue
|
|
374
|
+
});
|
|
375
|
+
var _e = Object.freeze({
|
|
376
|
+
...me,
|
|
377
|
+
body: "",
|
|
378
|
+
hidden: false
|
|
379
|
+
});
|
|
380
|
+
function Sn(e, i) {
|
|
381
|
+
const t = {};
|
|
382
|
+
!e.hFlip != !i.hFlip && (t.hFlip = true), !e.vFlip != !i.vFlip && (t.vFlip = true);
|
|
383
|
+
const n = ((e.rotate || 0) + (i.rotate || 0)) % 4;
|
|
384
|
+
return n && (t.rotate = n), t;
|
|
385
|
+
}
|
|
386
|
+
function Ke(e, i) {
|
|
387
|
+
const t = Sn(e, i);
|
|
388
|
+
for (const n in _e)
|
|
389
|
+
n in ue ? n in e && !(n in t) && (t[n] = ue[n]) : n in i ? t[n] = i[n] : n in e && (t[n] = e[n]);
|
|
390
|
+
return t;
|
|
391
|
+
}
|
|
392
|
+
function xn(e, i) {
|
|
393
|
+
const t = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null);
|
|
394
|
+
function o(l) {
|
|
395
|
+
if (t[l])
|
|
396
|
+
return s[l] = [];
|
|
397
|
+
if (!(l in s)) {
|
|
398
|
+
s[l] = null;
|
|
399
|
+
const r = n[l] && n[l].parent, a = r && o(r);
|
|
400
|
+
a && (s[l] = [r].concat(a));
|
|
401
|
+
}
|
|
402
|
+
return s[l];
|
|
403
|
+
}
|
|
404
|
+
return Object.keys(t).concat(Object.keys(n)).forEach(o), s;
|
|
405
|
+
}
|
|
406
|
+
function kn(e, i, t) {
|
|
407
|
+
const n = e.icons, s = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
408
|
+
let o = {};
|
|
409
|
+
function l(r) {
|
|
410
|
+
o = Ke(
|
|
411
|
+
n[r] || s[r],
|
|
412
|
+
o
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
return l(i), t.forEach(l), Ke(e, o);
|
|
416
|
+
}
|
|
417
|
+
function ft(e, i) {
|
|
418
|
+
const t = [];
|
|
419
|
+
if (typeof e != "object" || typeof e.icons != "object")
|
|
420
|
+
return t;
|
|
421
|
+
e.not_found instanceof Array && e.not_found.forEach((s) => {
|
|
422
|
+
i(s, null), t.push(s);
|
|
423
|
+
});
|
|
424
|
+
const n = xn(e);
|
|
425
|
+
for (const s in n) {
|
|
426
|
+
const o = n[s];
|
|
427
|
+
o && (i(s, kn(e, s, o)), t.push(s));
|
|
428
|
+
}
|
|
429
|
+
return t;
|
|
430
|
+
}
|
|
431
|
+
var _n = {
|
|
432
|
+
provider: "",
|
|
433
|
+
aliases: {},
|
|
434
|
+
not_found: {},
|
|
435
|
+
...ht
|
|
436
|
+
};
|
|
437
|
+
function we(e, i) {
|
|
438
|
+
for (const t in i)
|
|
439
|
+
if (t in e && typeof e[t] != typeof i[t])
|
|
440
|
+
return false;
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
function pt(e) {
|
|
444
|
+
if (typeof e != "object" || e === null)
|
|
445
|
+
return null;
|
|
446
|
+
const i = e;
|
|
447
|
+
if (typeof i.prefix != "string" || !e.icons || typeof e.icons != "object" || !we(e, _n))
|
|
448
|
+
return null;
|
|
449
|
+
const t = i.icons;
|
|
450
|
+
for (const s in t) {
|
|
451
|
+
const o = t[s];
|
|
452
|
+
if (
|
|
453
|
+
// Name cannot be empty
|
|
454
|
+
!s || // Must have body
|
|
455
|
+
typeof o.body != "string" || // Check other props
|
|
456
|
+
!we(
|
|
457
|
+
o,
|
|
458
|
+
_e
|
|
459
|
+
)
|
|
460
|
+
)
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
const n = i.aliases || /* @__PURE__ */ Object.create(null);
|
|
464
|
+
for (const s in n) {
|
|
465
|
+
const o = n[s], l = o.parent;
|
|
466
|
+
if (
|
|
467
|
+
// Name cannot be empty
|
|
468
|
+
!s || // Parent must be set and point to existing icon
|
|
469
|
+
typeof l != "string" || !t[l] && !n[l] || // Check other props
|
|
470
|
+
!we(
|
|
471
|
+
o,
|
|
472
|
+
_e
|
|
473
|
+
)
|
|
474
|
+
)
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
477
|
+
return i;
|
|
478
|
+
}
|
|
479
|
+
var Ue = /* @__PURE__ */ Object.create(null);
|
|
480
|
+
function In(e, i) {
|
|
481
|
+
return {
|
|
482
|
+
provider: e,
|
|
483
|
+
prefix: i,
|
|
484
|
+
icons: /* @__PURE__ */ Object.create(null),
|
|
485
|
+
missing: /* @__PURE__ */ new Set()
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function J(e, i) {
|
|
489
|
+
const t = Ue[e] || (Ue[e] = /* @__PURE__ */ Object.create(null));
|
|
490
|
+
return t[i] || (t[i] = In(e, i));
|
|
491
|
+
}
|
|
492
|
+
function mt(e, i) {
|
|
493
|
+
return pt(i) ? ft(i, (t, n) => {
|
|
494
|
+
n ? e.icons[t] = n : e.missing.add(t);
|
|
495
|
+
}) : [];
|
|
496
|
+
}
|
|
497
|
+
function En(e, i, t) {
|
|
498
|
+
try {
|
|
499
|
+
if (typeof t.body == "string")
|
|
500
|
+
return e.icons[i] = { ...t }, true;
|
|
501
|
+
} catch {
|
|
502
|
+
}
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
var ee = false;
|
|
506
|
+
function vt(e) {
|
|
507
|
+
return typeof e == "boolean" && (ee = e), ee;
|
|
508
|
+
}
|
|
509
|
+
function Tn(e) {
|
|
510
|
+
const i = typeof e == "string" ? pe(e, true, ee) : e;
|
|
511
|
+
if (i) {
|
|
512
|
+
const t = J(i.provider, i.prefix), n = i.name;
|
|
513
|
+
return t.icons[n] || (t.missing.has(n) ? null : void 0);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function Mn(e, i) {
|
|
517
|
+
const t = pe(e, true, ee);
|
|
518
|
+
if (!t)
|
|
519
|
+
return false;
|
|
520
|
+
const n = J(t.provider, t.prefix);
|
|
521
|
+
return i ? En(n, t.name, i) : (n.missing.add(t.name), true);
|
|
522
|
+
}
|
|
523
|
+
function Cn(e, i) {
|
|
524
|
+
if (typeof e != "object")
|
|
525
|
+
return false;
|
|
526
|
+
if (typeof i != "string" && (i = e.provider || ""), ee && !i && !e.prefix) {
|
|
527
|
+
let s = false;
|
|
528
|
+
return pt(e) && (e.prefix = "", ft(e, (o, l) => {
|
|
529
|
+
Mn(o, l) && (s = true);
|
|
530
|
+
})), s;
|
|
531
|
+
}
|
|
532
|
+
const t = e.prefix;
|
|
533
|
+
if (!ie({
|
|
534
|
+
prefix: t,
|
|
535
|
+
name: "a"
|
|
536
|
+
}))
|
|
537
|
+
return false;
|
|
538
|
+
const n = J(i, t);
|
|
539
|
+
return !!mt(n, e);
|
|
540
|
+
}
|
|
541
|
+
var gt = Object.freeze({
|
|
542
|
+
width: null,
|
|
543
|
+
height: null
|
|
544
|
+
});
|
|
545
|
+
var yt = Object.freeze({
|
|
546
|
+
// Dimensions
|
|
547
|
+
...gt,
|
|
548
|
+
// Transformations
|
|
549
|
+
...ue
|
|
550
|
+
});
|
|
551
|
+
var On = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
552
|
+
var zn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
553
|
+
function Je(e, i, t) {
|
|
554
|
+
if (i === 1)
|
|
555
|
+
return e;
|
|
556
|
+
if (t = t || 100, typeof e == "number")
|
|
557
|
+
return Math.ceil(e * i * t) / t;
|
|
558
|
+
if (typeof e != "string")
|
|
559
|
+
return e;
|
|
560
|
+
const n = e.split(On);
|
|
561
|
+
if (n === null || !n.length)
|
|
562
|
+
return e;
|
|
563
|
+
const s = [];
|
|
564
|
+
let o = n.shift(), l = zn.test(o);
|
|
565
|
+
for (; ; ) {
|
|
566
|
+
if (l) {
|
|
567
|
+
const r = parseFloat(o);
|
|
568
|
+
isNaN(r) ? s.push(o) : s.push(Math.ceil(r * i * t) / t);
|
|
569
|
+
} else
|
|
570
|
+
s.push(o);
|
|
571
|
+
if (o = n.shift(), o === void 0)
|
|
572
|
+
return s.join("");
|
|
573
|
+
l = !l;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
function An(e, i = "defs") {
|
|
577
|
+
let t = "";
|
|
578
|
+
const n = e.indexOf("<" + i);
|
|
579
|
+
for (; n >= 0; ) {
|
|
580
|
+
const s = e.indexOf(">", n), o = e.indexOf("</" + i);
|
|
581
|
+
if (s === -1 || o === -1)
|
|
582
|
+
break;
|
|
583
|
+
const l = e.indexOf(">", o);
|
|
584
|
+
if (l === -1)
|
|
585
|
+
break;
|
|
586
|
+
t += e.slice(s + 1, o).trim(), e = e.slice(0, n).trim() + e.slice(l + 1);
|
|
587
|
+
}
|
|
588
|
+
return {
|
|
589
|
+
defs: t,
|
|
590
|
+
content: e
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
function qn(e, i) {
|
|
594
|
+
return e ? "<defs>" + e + "</defs>" + i : i;
|
|
595
|
+
}
|
|
596
|
+
function $n(e, i, t) {
|
|
597
|
+
const n = An(e);
|
|
598
|
+
return qn(n.defs, i + n.content + t);
|
|
599
|
+
}
|
|
600
|
+
var Ln = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
601
|
+
function Fn(e, i) {
|
|
602
|
+
const t = {
|
|
603
|
+
...me,
|
|
604
|
+
...e
|
|
605
|
+
}, n = {
|
|
606
|
+
...yt,
|
|
607
|
+
...i
|
|
608
|
+
}, s = {
|
|
609
|
+
left: t.left,
|
|
610
|
+
top: t.top,
|
|
611
|
+
width: t.width,
|
|
612
|
+
height: t.height
|
|
613
|
+
};
|
|
614
|
+
let o = t.body;
|
|
615
|
+
[t, n].forEach((b) => {
|
|
616
|
+
const v = [], x = b.hFlip, T = b.vFlip;
|
|
617
|
+
let k = b.rotate;
|
|
618
|
+
x ? T ? k += 2 : (v.push(
|
|
619
|
+
"translate(" + (s.width + s.left).toString() + " " + (0 - s.top).toString() + ")"
|
|
620
|
+
), v.push("scale(-1 1)"), s.top = s.left = 0) : T && (v.push(
|
|
621
|
+
"translate(" + (0 - s.left).toString() + " " + (s.height + s.top).toString() + ")"
|
|
622
|
+
), v.push("scale(1 -1)"), s.top = s.left = 0);
|
|
623
|
+
let z;
|
|
624
|
+
switch (k < 0 && (k -= Math.floor(k / 4) * 4), k = k % 4, k) {
|
|
625
|
+
case 1:
|
|
626
|
+
z = s.height / 2 + s.top, v.unshift(
|
|
627
|
+
"rotate(90 " + z.toString() + " " + z.toString() + ")"
|
|
628
|
+
);
|
|
629
|
+
break;
|
|
630
|
+
case 2:
|
|
631
|
+
v.unshift(
|
|
632
|
+
"rotate(180 " + (s.width / 2 + s.left).toString() + " " + (s.height / 2 + s.top).toString() + ")"
|
|
633
|
+
);
|
|
634
|
+
break;
|
|
635
|
+
case 3:
|
|
636
|
+
z = s.width / 2 + s.left, v.unshift(
|
|
637
|
+
"rotate(-90 " + z.toString() + " " + z.toString() + ")"
|
|
638
|
+
);
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
k % 2 === 1 && (s.left !== s.top && (z = s.left, s.left = s.top, s.top = z), s.width !== s.height && (z = s.width, s.width = s.height, s.height = z)), v.length && (o = $n(
|
|
642
|
+
o,
|
|
643
|
+
'<g transform="' + v.join(" ") + '">',
|
|
644
|
+
"</g>"
|
|
645
|
+
));
|
|
646
|
+
});
|
|
647
|
+
const l = n.width, r = n.height, a = s.width, c = s.height;
|
|
648
|
+
let u, g;
|
|
649
|
+
l === null ? (g = r === null ? "1em" : r === "auto" ? c : r, u = Je(g, a / c)) : (u = l === "auto" ? a : l, g = r === null ? Je(u, c / a) : r === "auto" ? c : r);
|
|
650
|
+
const d = {}, w = (b, v) => {
|
|
651
|
+
Ln(v) || (d[b] = v.toString());
|
|
652
|
+
};
|
|
653
|
+
w("width", u), w("height", g);
|
|
654
|
+
const p = [s.left, s.top, a, c];
|
|
655
|
+
return d.viewBox = p.join(" "), {
|
|
656
|
+
attributes: d,
|
|
657
|
+
viewBox: p,
|
|
658
|
+
body: o
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
var Pn = /\sid="(\S+)"/g;
|
|
662
|
+
var Rn = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
663
|
+
var jn = 0;
|
|
664
|
+
function Dn(e, i = Rn) {
|
|
665
|
+
const t = [];
|
|
666
|
+
let n;
|
|
667
|
+
for (; n = Pn.exec(e); )
|
|
668
|
+
t.push(n[1]);
|
|
669
|
+
if (!t.length)
|
|
670
|
+
return e;
|
|
671
|
+
const s = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
672
|
+
return t.forEach((o) => {
|
|
673
|
+
const l = typeof i == "function" ? i(o) : i + (jn++).toString(), r = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
674
|
+
e = e.replace(
|
|
675
|
+
// Allowed characters before id: [#;"]
|
|
676
|
+
// Allowed characters after id: [)"], .[a-z]
|
|
677
|
+
new RegExp('([#;"])(' + r + ')([")]|\\.[a-z])', "g"),
|
|
678
|
+
"$1" + l + s + "$3"
|
|
679
|
+
);
|
|
680
|
+
}), e = e.replace(new RegExp(s, "g"), ""), e;
|
|
681
|
+
}
|
|
682
|
+
var Ie = /* @__PURE__ */ Object.create(null);
|
|
683
|
+
function Vn(e, i) {
|
|
684
|
+
Ie[e] = i;
|
|
685
|
+
}
|
|
686
|
+
function Ee(e) {
|
|
687
|
+
return Ie[e] || Ie[""];
|
|
688
|
+
}
|
|
689
|
+
function Fe(e) {
|
|
690
|
+
let i;
|
|
691
|
+
if (typeof e.resources == "string")
|
|
692
|
+
i = [e.resources];
|
|
693
|
+
else if (i = e.resources, !(i instanceof Array) || !i.length)
|
|
694
|
+
return null;
|
|
695
|
+
return {
|
|
696
|
+
// API hosts
|
|
697
|
+
resources: i,
|
|
698
|
+
// Root path
|
|
699
|
+
path: e.path || "/",
|
|
700
|
+
// URL length limit
|
|
701
|
+
maxURL: e.maxURL || 500,
|
|
702
|
+
// Timeout before next host is used.
|
|
703
|
+
rotate: e.rotate || 750,
|
|
704
|
+
// Timeout before failing query.
|
|
705
|
+
timeout: e.timeout || 5e3,
|
|
706
|
+
// Randomise default API end point.
|
|
707
|
+
random: e.random === true,
|
|
708
|
+
// Start index
|
|
709
|
+
index: e.index || 0,
|
|
710
|
+
// Receive data after time out (used if time out kicks in first, then API module sends data anyway).
|
|
711
|
+
dataAfterTimeout: e.dataAfterTimeout !== false
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
var Pe = /* @__PURE__ */ Object.create(null);
|
|
715
|
+
var G = [
|
|
716
|
+
"https://api.simplesvg.com",
|
|
717
|
+
"https://api.unisvg.com"
|
|
718
|
+
];
|
|
719
|
+
var oe = [];
|
|
720
|
+
for (; G.length > 0; )
|
|
721
|
+
G.length === 1 || Math.random() > 0.5 ? oe.push(G.shift()) : oe.push(G.pop());
|
|
722
|
+
Pe[""] = Fe({
|
|
723
|
+
resources: ["https://api.iconify.design"].concat(oe)
|
|
724
|
+
});
|
|
725
|
+
function Nn(e, i) {
|
|
726
|
+
const t = Fe(i);
|
|
727
|
+
return t === null ? false : (Pe[e] = t, true);
|
|
728
|
+
}
|
|
729
|
+
function Re(e) {
|
|
730
|
+
return Pe[e];
|
|
731
|
+
}
|
|
732
|
+
var Wn = () => {
|
|
733
|
+
let e;
|
|
734
|
+
try {
|
|
735
|
+
if (e = fetch, typeof e == "function")
|
|
736
|
+
return e;
|
|
737
|
+
} catch {
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
var Xe = Wn();
|
|
741
|
+
function Hn(e, i) {
|
|
742
|
+
const t = Re(e);
|
|
743
|
+
if (!t)
|
|
744
|
+
return 0;
|
|
745
|
+
let n;
|
|
746
|
+
if (!t.maxURL)
|
|
747
|
+
n = 0;
|
|
748
|
+
else {
|
|
749
|
+
let s = 0;
|
|
750
|
+
t.resources.forEach((l) => {
|
|
751
|
+
s = Math.max(s, l.length);
|
|
752
|
+
});
|
|
753
|
+
const o = i + ".json?icons=";
|
|
754
|
+
n = t.maxURL - s - t.path.length - o.length;
|
|
755
|
+
}
|
|
756
|
+
return n;
|
|
757
|
+
}
|
|
758
|
+
function Bn(e) {
|
|
759
|
+
return e === 404;
|
|
760
|
+
}
|
|
761
|
+
var Kn = (e, i, t) => {
|
|
762
|
+
const n = [], s = Hn(e, i), o = "icons";
|
|
763
|
+
let l = {
|
|
764
|
+
type: o,
|
|
765
|
+
provider: e,
|
|
766
|
+
prefix: i,
|
|
767
|
+
icons: []
|
|
768
|
+
}, r = 0;
|
|
769
|
+
return t.forEach((a, c) => {
|
|
770
|
+
r += a.length + 1, r >= s && c > 0 && (n.push(l), l = {
|
|
771
|
+
type: o,
|
|
772
|
+
provider: e,
|
|
773
|
+
prefix: i,
|
|
774
|
+
icons: []
|
|
775
|
+
}, r = a.length), l.icons.push(a);
|
|
776
|
+
}), n.push(l), n;
|
|
777
|
+
};
|
|
778
|
+
function Un(e) {
|
|
779
|
+
if (typeof e == "string") {
|
|
780
|
+
const i = Re(e);
|
|
781
|
+
if (i)
|
|
782
|
+
return i.path;
|
|
783
|
+
}
|
|
784
|
+
return "/";
|
|
785
|
+
}
|
|
786
|
+
var Jn = (e, i, t) => {
|
|
787
|
+
if (!Xe) {
|
|
788
|
+
t("abort", 424);
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
let n = Un(i.provider);
|
|
792
|
+
switch (i.type) {
|
|
793
|
+
case "icons": {
|
|
794
|
+
const o = i.prefix, r = i.icons.join(","), a = new URLSearchParams({
|
|
795
|
+
icons: r
|
|
796
|
+
});
|
|
797
|
+
n += o + ".json?" + a.toString();
|
|
798
|
+
break;
|
|
799
|
+
}
|
|
800
|
+
case "custom": {
|
|
801
|
+
const o = i.uri;
|
|
802
|
+
n += o.slice(0, 1) === "/" ? o.slice(1) : o;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
default:
|
|
806
|
+
t("abort", 400);
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
let s = 503;
|
|
810
|
+
Xe(e + n).then((o) => {
|
|
811
|
+
const l = o.status;
|
|
812
|
+
if (l !== 200) {
|
|
813
|
+
setTimeout(() => {
|
|
814
|
+
t(Bn(l) ? "abort" : "next", l);
|
|
815
|
+
});
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
return s = 501, o.json();
|
|
819
|
+
}).then((o) => {
|
|
820
|
+
if (typeof o != "object" || o === null) {
|
|
821
|
+
setTimeout(() => {
|
|
822
|
+
o === 404 ? t("abort", o) : t("next", s);
|
|
823
|
+
});
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
setTimeout(() => {
|
|
827
|
+
t("success", o);
|
|
828
|
+
});
|
|
829
|
+
}).catch(() => {
|
|
830
|
+
t("next", s);
|
|
831
|
+
});
|
|
832
|
+
};
|
|
833
|
+
var Xn = {
|
|
834
|
+
prepare: Kn,
|
|
835
|
+
send: Jn
|
|
836
|
+
};
|
|
837
|
+
function Qn(e) {
|
|
838
|
+
const i = {
|
|
839
|
+
loaded: [],
|
|
840
|
+
missing: [],
|
|
841
|
+
pending: []
|
|
842
|
+
}, t = /* @__PURE__ */ Object.create(null);
|
|
843
|
+
e.sort((s, o) => s.provider !== o.provider ? s.provider.localeCompare(o.provider) : s.prefix !== o.prefix ? s.prefix.localeCompare(o.prefix) : s.name.localeCompare(o.name));
|
|
844
|
+
let n = {
|
|
845
|
+
provider: "",
|
|
846
|
+
prefix: "",
|
|
847
|
+
name: ""
|
|
848
|
+
};
|
|
849
|
+
return e.forEach((s) => {
|
|
850
|
+
if (n.name === s.name && n.prefix === s.prefix && n.provider === s.provider)
|
|
851
|
+
return;
|
|
852
|
+
n = s;
|
|
853
|
+
const o = s.provider, l = s.prefix, r = s.name, a = t[o] || (t[o] = /* @__PURE__ */ Object.create(null)), c = a[l] || (a[l] = J(o, l));
|
|
854
|
+
let u;
|
|
855
|
+
r in c.icons ? u = i.loaded : l === "" || c.missing.has(r) ? u = i.missing : u = i.pending;
|
|
856
|
+
const g = {
|
|
857
|
+
provider: o,
|
|
858
|
+
prefix: l,
|
|
859
|
+
name: r
|
|
860
|
+
};
|
|
861
|
+
u.push(g);
|
|
862
|
+
}), i;
|
|
863
|
+
}
|
|
864
|
+
function bt(e, i) {
|
|
865
|
+
e.forEach((t) => {
|
|
866
|
+
const n = t.loaderCallbacks;
|
|
867
|
+
n && (t.loaderCallbacks = n.filter((s) => s.id !== i));
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
function Gn(e) {
|
|
871
|
+
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = true, setTimeout(() => {
|
|
872
|
+
e.pendingCallbacksFlag = false;
|
|
873
|
+
const i = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
874
|
+
if (!i.length)
|
|
875
|
+
return;
|
|
876
|
+
let t = false;
|
|
877
|
+
const n = e.provider, s = e.prefix;
|
|
878
|
+
i.forEach((o) => {
|
|
879
|
+
const l = o.icons, r = l.pending.length;
|
|
880
|
+
l.pending = l.pending.filter((a) => {
|
|
881
|
+
if (a.prefix !== s)
|
|
882
|
+
return true;
|
|
883
|
+
const c = a.name;
|
|
884
|
+
if (e.icons[c])
|
|
885
|
+
l.loaded.push({
|
|
886
|
+
provider: n,
|
|
887
|
+
prefix: s,
|
|
888
|
+
name: c
|
|
889
|
+
});
|
|
890
|
+
else if (e.missing.has(c))
|
|
891
|
+
l.missing.push({
|
|
892
|
+
provider: n,
|
|
893
|
+
prefix: s,
|
|
894
|
+
name: c
|
|
895
|
+
});
|
|
896
|
+
else
|
|
897
|
+
return t = true, true;
|
|
898
|
+
return false;
|
|
899
|
+
}), l.pending.length !== r && (t || bt([e], o.id), o.callback(
|
|
900
|
+
l.loaded.slice(0),
|
|
901
|
+
l.missing.slice(0),
|
|
902
|
+
l.pending.slice(0),
|
|
903
|
+
o.abort
|
|
904
|
+
));
|
|
905
|
+
});
|
|
906
|
+
}));
|
|
907
|
+
}
|
|
908
|
+
var Yn = 0;
|
|
909
|
+
function Zn(e, i, t) {
|
|
910
|
+
const n = Yn++, s = bt.bind(null, t, n);
|
|
911
|
+
if (!i.pending.length)
|
|
912
|
+
return s;
|
|
913
|
+
const o = {
|
|
914
|
+
id: n,
|
|
915
|
+
icons: i,
|
|
916
|
+
callback: e,
|
|
917
|
+
abort: s
|
|
918
|
+
};
|
|
919
|
+
return t.forEach((l) => {
|
|
920
|
+
(l.loaderCallbacks || (l.loaderCallbacks = [])).push(o);
|
|
921
|
+
}), s;
|
|
922
|
+
}
|
|
923
|
+
function es(e, i = true, t = false) {
|
|
924
|
+
const n = [];
|
|
925
|
+
return e.forEach((s) => {
|
|
926
|
+
const o = typeof s == "string" ? pe(s, i, t) : s;
|
|
927
|
+
o && n.push(o);
|
|
928
|
+
}), n;
|
|
929
|
+
}
|
|
930
|
+
var ts = {
|
|
931
|
+
resources: [],
|
|
932
|
+
index: 0,
|
|
933
|
+
timeout: 2e3,
|
|
934
|
+
rotate: 750,
|
|
935
|
+
random: false,
|
|
936
|
+
dataAfterTimeout: false
|
|
937
|
+
};
|
|
938
|
+
function ns(e, i, t, n) {
|
|
939
|
+
const s = e.resources.length, o = e.random ? Math.floor(Math.random() * s) : e.index;
|
|
940
|
+
let l;
|
|
941
|
+
if (e.random) {
|
|
942
|
+
let _ = e.resources.slice(0);
|
|
943
|
+
for (l = []; _.length > 1; ) {
|
|
944
|
+
const I = Math.floor(Math.random() * _.length);
|
|
945
|
+
l.push(_[I]), _ = _.slice(0, I).concat(_.slice(I + 1));
|
|
946
|
+
}
|
|
947
|
+
l = l.concat(_);
|
|
948
|
+
} else
|
|
949
|
+
l = e.resources.slice(o).concat(e.resources.slice(0, o));
|
|
950
|
+
const r = Date.now();
|
|
951
|
+
let a = "pending", c = 0, u, g = null, d = [], w = [];
|
|
952
|
+
typeof n == "function" && w.push(n);
|
|
953
|
+
function p() {
|
|
954
|
+
g && (clearTimeout(g), g = null);
|
|
955
|
+
}
|
|
956
|
+
function b() {
|
|
957
|
+
a === "pending" && (a = "aborted"), p(), d.forEach((_) => {
|
|
958
|
+
_.status === "pending" && (_.status = "aborted");
|
|
959
|
+
}), d = [];
|
|
960
|
+
}
|
|
961
|
+
function v(_, I) {
|
|
962
|
+
I && (w = []), typeof _ == "function" && w.push(_);
|
|
963
|
+
}
|
|
964
|
+
function x() {
|
|
965
|
+
return {
|
|
966
|
+
startTime: r,
|
|
967
|
+
payload: i,
|
|
968
|
+
status: a,
|
|
969
|
+
queriesSent: c,
|
|
970
|
+
queriesPending: d.length,
|
|
971
|
+
subscribe: v,
|
|
972
|
+
abort: b
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
function T() {
|
|
976
|
+
a = "failed", w.forEach((_) => {
|
|
977
|
+
_(void 0, u);
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
function k() {
|
|
981
|
+
d.forEach((_) => {
|
|
982
|
+
_.status === "pending" && (_.status = "aborted");
|
|
983
|
+
}), d = [];
|
|
984
|
+
}
|
|
985
|
+
function z(_, I, S) {
|
|
986
|
+
const E = I !== "success";
|
|
987
|
+
switch (d = d.filter((V) => V !== _), a) {
|
|
988
|
+
case "pending":
|
|
989
|
+
break;
|
|
990
|
+
case "failed":
|
|
991
|
+
if (E || !e.dataAfterTimeout)
|
|
992
|
+
return;
|
|
993
|
+
break;
|
|
994
|
+
default:
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
if (I === "abort") {
|
|
998
|
+
u = S, T();
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
if (E) {
|
|
1002
|
+
u = S, d.length || (l.length ? D() : T());
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
if (p(), k(), !e.random) {
|
|
1006
|
+
const V = e.resources.indexOf(_.resource);
|
|
1007
|
+
V !== -1 && V !== e.index && (e.index = V);
|
|
1008
|
+
}
|
|
1009
|
+
a = "completed", w.forEach((V) => {
|
|
1010
|
+
V(S);
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
function D() {
|
|
1014
|
+
if (a !== "pending")
|
|
1015
|
+
return;
|
|
1016
|
+
p();
|
|
1017
|
+
const _ = l.shift();
|
|
1018
|
+
if (_ === void 0) {
|
|
1019
|
+
if (d.length) {
|
|
1020
|
+
g = setTimeout(() => {
|
|
1021
|
+
p(), a === "pending" && (k(), T());
|
|
1022
|
+
}, e.timeout);
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
T();
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
const I = {
|
|
1029
|
+
status: "pending",
|
|
1030
|
+
resource: _,
|
|
1031
|
+
callback: (S, E) => {
|
|
1032
|
+
z(I, S, E);
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
d.push(I), c++, g = setTimeout(D, e.rotate), t(_, i, I.callback);
|
|
1036
|
+
}
|
|
1037
|
+
return setTimeout(D), x;
|
|
1038
|
+
}
|
|
1039
|
+
function wt(e) {
|
|
1040
|
+
const i = {
|
|
1041
|
+
...ts,
|
|
1042
|
+
...e
|
|
1043
|
+
};
|
|
1044
|
+
let t = [];
|
|
1045
|
+
function n() {
|
|
1046
|
+
t = t.filter((r) => r().status === "pending");
|
|
1047
|
+
}
|
|
1048
|
+
function s(r, a, c) {
|
|
1049
|
+
const u = ns(
|
|
1050
|
+
i,
|
|
1051
|
+
r,
|
|
1052
|
+
a,
|
|
1053
|
+
(g, d) => {
|
|
1054
|
+
n(), c && c(g, d);
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
1057
|
+
return t.push(u), u;
|
|
1058
|
+
}
|
|
1059
|
+
function o(r) {
|
|
1060
|
+
return t.find((a) => r(a)) || null;
|
|
1061
|
+
}
|
|
1062
|
+
return {
|
|
1063
|
+
query: s,
|
|
1064
|
+
find: o,
|
|
1065
|
+
setIndex: (r) => {
|
|
1066
|
+
i.index = r;
|
|
1067
|
+
},
|
|
1068
|
+
getIndex: () => i.index,
|
|
1069
|
+
cleanup: n
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
function Qe() {
|
|
1073
|
+
}
|
|
1074
|
+
var Se = /* @__PURE__ */ Object.create(null);
|
|
1075
|
+
function ss(e) {
|
|
1076
|
+
if (!Se[e]) {
|
|
1077
|
+
const i = Re(e);
|
|
1078
|
+
if (!i)
|
|
1079
|
+
return;
|
|
1080
|
+
const t = wt(i), n = {
|
|
1081
|
+
config: i,
|
|
1082
|
+
redundancy: t
|
|
1083
|
+
};
|
|
1084
|
+
Se[e] = n;
|
|
1085
|
+
}
|
|
1086
|
+
return Se[e];
|
|
1087
|
+
}
|
|
1088
|
+
function is(e, i, t) {
|
|
1089
|
+
let n, s;
|
|
1090
|
+
if (typeof e == "string") {
|
|
1091
|
+
const o = Ee(e);
|
|
1092
|
+
if (!o)
|
|
1093
|
+
return t(void 0, 424), Qe;
|
|
1094
|
+
s = o.send;
|
|
1095
|
+
const l = ss(e);
|
|
1096
|
+
l && (n = l.redundancy);
|
|
1097
|
+
} else {
|
|
1098
|
+
const o = Fe(e);
|
|
1099
|
+
if (o) {
|
|
1100
|
+
n = wt(o);
|
|
1101
|
+
const l = e.resources ? e.resources[0] : "", r = Ee(l);
|
|
1102
|
+
r && (s = r.send);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
return !n || !s ? (t(void 0, 424), Qe) : n.query(i, s, t)().abort;
|
|
1106
|
+
}
|
|
1107
|
+
function Ge() {
|
|
1108
|
+
}
|
|
1109
|
+
function os(e) {
|
|
1110
|
+
e.iconsLoaderFlag || (e.iconsLoaderFlag = true, setTimeout(() => {
|
|
1111
|
+
e.iconsLoaderFlag = false, Gn(e);
|
|
1112
|
+
}));
|
|
1113
|
+
}
|
|
1114
|
+
function ls(e) {
|
|
1115
|
+
const i = [], t = [];
|
|
1116
|
+
return e.forEach((n) => {
|
|
1117
|
+
(n.match(dt) ? i : t).push(n);
|
|
1118
|
+
}), {
|
|
1119
|
+
valid: i,
|
|
1120
|
+
invalid: t
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
function Y(e, i, t) {
|
|
1124
|
+
function n() {
|
|
1125
|
+
const s = e.pendingIcons;
|
|
1126
|
+
i.forEach((o) => {
|
|
1127
|
+
s && s.delete(o), e.icons[o] || e.missing.add(o);
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
if (t && typeof t == "object")
|
|
1131
|
+
try {
|
|
1132
|
+
if (!mt(e, t).length) {
|
|
1133
|
+
n();
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
} catch (s) {
|
|
1137
|
+
console.error(s);
|
|
1138
|
+
}
|
|
1139
|
+
n(), os(e);
|
|
1140
|
+
}
|
|
1141
|
+
function Ye(e, i) {
|
|
1142
|
+
e instanceof Promise ? e.then((t) => {
|
|
1143
|
+
i(t);
|
|
1144
|
+
}).catch(() => {
|
|
1145
|
+
i(null);
|
|
1146
|
+
}) : i(e);
|
|
1147
|
+
}
|
|
1148
|
+
function rs(e, i) {
|
|
1149
|
+
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(i).sort() : e.iconsToLoad = i, e.iconsQueueFlag || (e.iconsQueueFlag = true, setTimeout(() => {
|
|
1150
|
+
e.iconsQueueFlag = false;
|
|
1151
|
+
const { provider: t, prefix: n } = e, s = e.iconsToLoad;
|
|
1152
|
+
if (delete e.iconsToLoad, !s || !s.length)
|
|
1153
|
+
return;
|
|
1154
|
+
const o = e.loadIcon;
|
|
1155
|
+
if (e.loadIcons && (s.length > 1 || !o)) {
|
|
1156
|
+
Ye(
|
|
1157
|
+
e.loadIcons(s, n, t),
|
|
1158
|
+
(u) => {
|
|
1159
|
+
Y(e, s, u);
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
if (o) {
|
|
1165
|
+
s.forEach((u) => {
|
|
1166
|
+
const g = o(u, n, t);
|
|
1167
|
+
Ye(g, (d) => {
|
|
1168
|
+
const w = d ? {
|
|
1169
|
+
prefix: n,
|
|
1170
|
+
icons: {
|
|
1171
|
+
[u]: d
|
|
1172
|
+
}
|
|
1173
|
+
} : null;
|
|
1174
|
+
Y(e, [u], w);
|
|
1175
|
+
});
|
|
1176
|
+
});
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
const { valid: l, invalid: r } = ls(s);
|
|
1180
|
+
if (r.length && Y(e, r, null), !l.length)
|
|
1181
|
+
return;
|
|
1182
|
+
const a = n.match(dt) ? Ee(t) : null;
|
|
1183
|
+
if (!a) {
|
|
1184
|
+
Y(e, l, null);
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
a.prepare(t, n, l).forEach((u) => {
|
|
1188
|
+
is(t, u, (g) => {
|
|
1189
|
+
Y(e, u.icons, g);
|
|
1190
|
+
});
|
|
1191
|
+
});
|
|
1192
|
+
}));
|
|
1193
|
+
}
|
|
1194
|
+
var as = (e, i) => {
|
|
1195
|
+
const t = es(e, true, vt()), n = Qn(t);
|
|
1196
|
+
if (!n.pending.length) {
|
|
1197
|
+
let a = true;
|
|
1198
|
+
return i && setTimeout(() => {
|
|
1199
|
+
a && i(
|
|
1200
|
+
n.loaded,
|
|
1201
|
+
n.missing,
|
|
1202
|
+
n.pending,
|
|
1203
|
+
Ge
|
|
1204
|
+
);
|
|
1205
|
+
}), () => {
|
|
1206
|
+
a = false;
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
const s = /* @__PURE__ */ Object.create(null), o = [];
|
|
1210
|
+
let l, r;
|
|
1211
|
+
return n.pending.forEach((a) => {
|
|
1212
|
+
const { provider: c, prefix: u } = a;
|
|
1213
|
+
if (u === r && c === l)
|
|
1214
|
+
return;
|
|
1215
|
+
l = c, r = u, o.push(J(c, u));
|
|
1216
|
+
const g = s[c] || (s[c] = /* @__PURE__ */ Object.create(null));
|
|
1217
|
+
g[u] || (g[u] = []);
|
|
1218
|
+
}), n.pending.forEach((a) => {
|
|
1219
|
+
const { provider: c, prefix: u, name: g } = a, d = J(c, u), w = d.pendingIcons || (d.pendingIcons = /* @__PURE__ */ new Set());
|
|
1220
|
+
w.has(g) || (w.add(g), s[c][u].push(g));
|
|
1221
|
+
}), o.forEach((a) => {
|
|
1222
|
+
const c = s[a.provider][a.prefix];
|
|
1223
|
+
c.length && rs(a, c);
|
|
1224
|
+
}), i ? Zn(i, n, o) : Ge;
|
|
1225
|
+
};
|
|
1226
|
+
function cs(e, i) {
|
|
1227
|
+
const t = {
|
|
1228
|
+
...e
|
|
1229
|
+
};
|
|
1230
|
+
for (const n in i) {
|
|
1231
|
+
const s = i[n], o = typeof s;
|
|
1232
|
+
n in gt ? (s === null || s && (o === "string" || o === "number")) && (t[n] = s) : o === typeof t[n] && (t[n] = n === "rotate" ? s % 4 : s);
|
|
1233
|
+
}
|
|
1234
|
+
return t;
|
|
1235
|
+
}
|
|
1236
|
+
var us = /[\s,]+/;
|
|
1237
|
+
function ds(e, i) {
|
|
1238
|
+
i.split(us).forEach((t) => {
|
|
1239
|
+
switch (t.trim()) {
|
|
1240
|
+
case "horizontal":
|
|
1241
|
+
e.hFlip = true;
|
|
1242
|
+
break;
|
|
1243
|
+
case "vertical":
|
|
1244
|
+
e.vFlip = true;
|
|
1245
|
+
break;
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
function hs(e, i = 0) {
|
|
1250
|
+
const t = e.replace(/^-?[0-9.]*/, "");
|
|
1251
|
+
function n(s) {
|
|
1252
|
+
for (; s < 0; )
|
|
1253
|
+
s += 4;
|
|
1254
|
+
return s % 4;
|
|
1255
|
+
}
|
|
1256
|
+
if (t === "") {
|
|
1257
|
+
const s = parseInt(e);
|
|
1258
|
+
return isNaN(s) ? 0 : n(s);
|
|
1259
|
+
} else if (t !== e) {
|
|
1260
|
+
let s = 0;
|
|
1261
|
+
switch (t) {
|
|
1262
|
+
case "%":
|
|
1263
|
+
s = 25;
|
|
1264
|
+
break;
|
|
1265
|
+
case "deg":
|
|
1266
|
+
s = 90;
|
|
1267
|
+
}
|
|
1268
|
+
if (s) {
|
|
1269
|
+
let o = parseFloat(e.slice(0, e.length - t.length));
|
|
1270
|
+
return isNaN(o) ? 0 : (o = o / s, o % 1 === 0 ? n(o) : 0);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
return i;
|
|
1274
|
+
}
|
|
1275
|
+
function fs(e, i) {
|
|
1276
|
+
let t = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1277
|
+
for (const n in i)
|
|
1278
|
+
t += " " + n + '="' + i[n] + '"';
|
|
1279
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + t + ">" + e + "</svg>";
|
|
1280
|
+
}
|
|
1281
|
+
function ps(e) {
|
|
1282
|
+
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1283
|
+
}
|
|
1284
|
+
function ms(e) {
|
|
1285
|
+
return "data:image/svg+xml," + ps(e);
|
|
1286
|
+
}
|
|
1287
|
+
function vs(e) {
|
|
1288
|
+
return 'url("' + ms(e) + '")';
|
|
1289
|
+
}
|
|
1290
|
+
var Ze = {
|
|
1291
|
+
...yt,
|
|
1292
|
+
inline: false
|
|
1293
|
+
};
|
|
1294
|
+
var gs = {
|
|
1295
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1296
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
1297
|
+
"aria-hidden": true,
|
|
1298
|
+
role: "img"
|
|
1299
|
+
};
|
|
1300
|
+
var ys = {
|
|
1301
|
+
display: "inline-block"
|
|
1302
|
+
};
|
|
1303
|
+
var Te = {
|
|
1304
|
+
backgroundColor: "currentColor"
|
|
1305
|
+
};
|
|
1306
|
+
var St = {
|
|
1307
|
+
backgroundColor: "transparent"
|
|
1308
|
+
};
|
|
1309
|
+
var et = {
|
|
1310
|
+
Image: "var(--svg)",
|
|
1311
|
+
Repeat: "no-repeat",
|
|
1312
|
+
Size: "100% 100%"
|
|
1313
|
+
};
|
|
1314
|
+
var tt = {
|
|
1315
|
+
webkitMask: Te,
|
|
1316
|
+
mask: Te,
|
|
1317
|
+
background: St
|
|
1318
|
+
};
|
|
1319
|
+
for (const e in tt) {
|
|
1320
|
+
const i = tt[e];
|
|
1321
|
+
for (const t in et)
|
|
1322
|
+
i[e + t] = et[t];
|
|
1323
|
+
}
|
|
1324
|
+
var le = {};
|
|
1325
|
+
["horizontal", "vertical"].forEach((e) => {
|
|
1326
|
+
const i = e.slice(0, 1) + "Flip";
|
|
1327
|
+
le[e + "-flip"] = i, le[e.slice(0, 1) + "-flip"] = i, le[e + "Flip"] = i;
|
|
1328
|
+
});
|
|
1329
|
+
function nt(e) {
|
|
1330
|
+
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1331
|
+
}
|
|
1332
|
+
var st = (e, i) => {
|
|
1333
|
+
const t = cs(Ze, i), n = { ...gs }, s = i.mode || "svg", o = {}, l = i.style, r = typeof l == "object" && !(l instanceof Array) ? l : {};
|
|
1334
|
+
for (let b in i) {
|
|
1335
|
+
const v = i[b];
|
|
1336
|
+
if (v !== void 0)
|
|
1337
|
+
switch (b) {
|
|
1338
|
+
// Properties to ignore
|
|
1339
|
+
case "icon":
|
|
1340
|
+
case "style":
|
|
1341
|
+
case "onLoad":
|
|
1342
|
+
case "mode":
|
|
1343
|
+
case "ssr":
|
|
1344
|
+
break;
|
|
1345
|
+
// Boolean attributes
|
|
1346
|
+
case "inline":
|
|
1347
|
+
case "hFlip":
|
|
1348
|
+
case "vFlip":
|
|
1349
|
+
t[b] = v === true || v === "true" || v === 1;
|
|
1350
|
+
break;
|
|
1351
|
+
// Flip as string: 'horizontal,vertical'
|
|
1352
|
+
case "flip":
|
|
1353
|
+
typeof v == "string" && ds(t, v);
|
|
1354
|
+
break;
|
|
1355
|
+
// Color: override style
|
|
1356
|
+
case "color":
|
|
1357
|
+
o.color = v;
|
|
1358
|
+
break;
|
|
1359
|
+
// Rotation as string
|
|
1360
|
+
case "rotate":
|
|
1361
|
+
typeof v == "string" ? t[b] = hs(v) : typeof v == "number" && (t[b] = v);
|
|
1362
|
+
break;
|
|
1363
|
+
// Remove aria-hidden
|
|
1364
|
+
case "ariaHidden":
|
|
1365
|
+
case "aria-hidden":
|
|
1366
|
+
v !== true && v !== "true" && delete n["aria-hidden"];
|
|
1367
|
+
break;
|
|
1368
|
+
default: {
|
|
1369
|
+
const x = le[b];
|
|
1370
|
+
x ? (v === true || v === "true" || v === 1) && (t[x] = true) : Ze[b] === void 0 && (n[b] = v);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const a = Fn(e, t), c = a.attributes;
|
|
1375
|
+
if (t.inline && (o.verticalAlign = "-0.125em"), s === "svg") {
|
|
1376
|
+
n.style = {
|
|
1377
|
+
...o,
|
|
1378
|
+
...r
|
|
1379
|
+
}, Object.assign(n, c);
|
|
1380
|
+
let b = 0, v = i.id;
|
|
1381
|
+
return typeof v == "string" && (v = v.replace(/-/g, "_")), n.innerHTML = Dn(a.body, v ? () => v + "ID" + b++ : "iconifyVue"), De("svg", n);
|
|
1382
|
+
}
|
|
1383
|
+
const { body: u, width: g, height: d } = e, w = s === "mask" || (s === "bg" ? false : u.indexOf("currentColor") !== -1), p = fs(u, {
|
|
1384
|
+
...c,
|
|
1385
|
+
width: g + "",
|
|
1386
|
+
height: d + ""
|
|
1387
|
+
});
|
|
1388
|
+
return n.style = {
|
|
1389
|
+
...o,
|
|
1390
|
+
"--svg": vs(p),
|
|
1391
|
+
width: nt(c.width),
|
|
1392
|
+
height: nt(c.height),
|
|
1393
|
+
...ys,
|
|
1394
|
+
...w ? Te : St,
|
|
1395
|
+
...r
|
|
1396
|
+
}, De("span", n);
|
|
1397
|
+
};
|
|
1398
|
+
vt(true);
|
|
1399
|
+
Vn("", Xn);
|
|
1400
|
+
if (typeof document < "u" && typeof window < "u") {
|
|
1401
|
+
const e = window;
|
|
1402
|
+
if (e.IconifyPreload !== void 0) {
|
|
1403
|
+
const i = e.IconifyPreload, t = "Invalid IconifyPreload syntax.";
|
|
1404
|
+
typeof i == "object" && i !== null && (i instanceof Array ? i : [i]).forEach((n) => {
|
|
1405
|
+
try {
|
|
1406
|
+
(typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
|
|
1407
|
+
typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
|
|
1408
|
+
!Cn(n)) && console.error(t);
|
|
1409
|
+
} catch {
|
|
1410
|
+
console.error(t);
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
if (e.IconifyProviders !== void 0) {
|
|
1415
|
+
const i = e.IconifyProviders;
|
|
1416
|
+
if (typeof i == "object" && i !== null)
|
|
1417
|
+
for (let t in i) {
|
|
1418
|
+
const n = "IconifyProviders[" + t + "] is invalid.";
|
|
1419
|
+
try {
|
|
1420
|
+
const s = i[t];
|
|
1421
|
+
if (typeof s != "object" || !s || s.resources === void 0)
|
|
1422
|
+
continue;
|
|
1423
|
+
Nn(t, s) || console.error(n);
|
|
1424
|
+
} catch {
|
|
1425
|
+
console.error(n);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
var bs = {
|
|
1431
|
+
...me,
|
|
1432
|
+
body: ""
|
|
1433
|
+
};
|
|
1434
|
+
var re = $({
|
|
1435
|
+
// Do not inherit other attributes: it is handled by render()
|
|
1436
|
+
inheritAttrs: false,
|
|
1437
|
+
// Set initial data
|
|
1438
|
+
data() {
|
|
1439
|
+
return {
|
|
1440
|
+
// Current icon name
|
|
1441
|
+
_name: "",
|
|
1442
|
+
// Loading
|
|
1443
|
+
_loadingIcon: null,
|
|
1444
|
+
// Mounted status
|
|
1445
|
+
iconMounted: false,
|
|
1446
|
+
// Callback counter to trigger re-render
|
|
1447
|
+
counter: 0
|
|
1448
|
+
};
|
|
1449
|
+
},
|
|
1450
|
+
mounted() {
|
|
1451
|
+
this.iconMounted = true;
|
|
1452
|
+
},
|
|
1453
|
+
unmounted() {
|
|
1454
|
+
this.abortLoading();
|
|
1455
|
+
},
|
|
1456
|
+
methods: {
|
|
1457
|
+
abortLoading() {
|
|
1458
|
+
this._loadingIcon && (this._loadingIcon.abort(), this._loadingIcon = null);
|
|
1459
|
+
},
|
|
1460
|
+
// Get data for icon to render or null
|
|
1461
|
+
getIcon(e, i, t) {
|
|
1462
|
+
if (typeof e == "object" && e !== null && typeof e.body == "string")
|
|
1463
|
+
return this._name = "", this.abortLoading(), {
|
|
1464
|
+
data: e
|
|
1465
|
+
};
|
|
1466
|
+
let n;
|
|
1467
|
+
if (typeof e != "string" || (n = pe(e, false, true)) === null)
|
|
1468
|
+
return this.abortLoading(), null;
|
|
1469
|
+
let s = Tn(n);
|
|
1470
|
+
if (!s)
|
|
1471
|
+
return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "", s !== null && (this._loadingIcon = {
|
|
1472
|
+
name: e,
|
|
1473
|
+
abort: as([n], () => {
|
|
1474
|
+
this.counter++;
|
|
1475
|
+
})
|
|
1476
|
+
})), null;
|
|
1477
|
+
if (this.abortLoading(), this._name !== e && (this._name = e, i && i(e)), t) {
|
|
1478
|
+
s = Object.assign({}, s);
|
|
1479
|
+
const l = t(s.body, n.name, n.prefix, n.provider);
|
|
1480
|
+
typeof l == "string" && (s.body = l);
|
|
1481
|
+
}
|
|
1482
|
+
const o = ["iconify"];
|
|
1483
|
+
return n.prefix !== "" && o.push("iconify--" + n.prefix), n.provider !== "" && o.push("iconify--" + n.provider), { data: s, classes: o };
|
|
1484
|
+
}
|
|
1485
|
+
},
|
|
1486
|
+
// Render icon
|
|
1487
|
+
render() {
|
|
1488
|
+
this.counter;
|
|
1489
|
+
const e = this.$attrs, i = this.iconMounted || e.ssr ? this.getIcon(e.icon, e.onLoad, e.customise) : null;
|
|
1490
|
+
if (!i)
|
|
1491
|
+
return st(bs, e);
|
|
1492
|
+
let t = e;
|
|
1493
|
+
return i.classes && (t = {
|
|
1494
|
+
...e,
|
|
1495
|
+
class: (typeof e.class == "string" ? e.class + " " : "") + i.classes.join(" ")
|
|
1496
|
+
}), st({
|
|
1497
|
+
...me,
|
|
1498
|
+
...i.data
|
|
1499
|
+
}, t);
|
|
1500
|
+
}
|
|
1501
|
+
});
|
|
1502
|
+
var ws = ["width", "height"];
|
|
1503
|
+
var je = /* @__PURE__ */ $({
|
|
1504
|
+
__name: "MIcon",
|
|
1505
|
+
props: {
|
|
1506
|
+
width: {},
|
|
1507
|
+
height: {}
|
|
1508
|
+
},
|
|
1509
|
+
setup(e) {
|
|
1510
|
+
return (i, t) => (h(), y("svg", {
|
|
1511
|
+
width: e.width ?? 22,
|
|
1512
|
+
height: e.height ?? 10,
|
|
1513
|
+
viewBox: "0 0 80 36",
|
|
1514
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1515
|
+
"aria-hidden": "true"
|
|
1516
|
+
}, [...t[0] || (t[0] = [
|
|
1517
|
+
f("path", {
|
|
1518
|
+
d: "M0,36 L20,0 L40,36 Z",
|
|
1519
|
+
fill: "rgba(255,255,255,0.62)"
|
|
1520
|
+
}, null, -1),
|
|
1521
|
+
f("path", {
|
|
1522
|
+
d: "M8,36 L20,16 L32,36 Z",
|
|
1523
|
+
fill: "white"
|
|
1524
|
+
}, null, -1),
|
|
1525
|
+
f("path", {
|
|
1526
|
+
d: "M40,36 L60,0 L80,36 Z",
|
|
1527
|
+
fill: "rgba(255,255,255,0.62)"
|
|
1528
|
+
}, null, -1),
|
|
1529
|
+
f("path", {
|
|
1530
|
+
d: "M48,36 L60,16 L72,36 Z",
|
|
1531
|
+
fill: "white"
|
|
1532
|
+
}, null, -1)
|
|
1533
|
+
])], 8, ws));
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
var Ss = { class: "logo-badge" };
|
|
1537
|
+
var xs = /* @__PURE__ */ $({
|
|
1538
|
+
__name: "LogoBadge",
|
|
1539
|
+
setup(e) {
|
|
1540
|
+
return (i, t) => (h(), y("div", Ss, [
|
|
1541
|
+
L(je, {
|
|
1542
|
+
width: 20,
|
|
1543
|
+
height: 9
|
|
1544
|
+
}),
|
|
1545
|
+
t[0] || (t[0] = f("span", null, "vue-muza", -1))
|
|
1546
|
+
]));
|
|
1547
|
+
}
|
|
1548
|
+
});
|
|
1549
|
+
var j = (e, i) => {
|
|
1550
|
+
const t = e.__vccOpts || e;
|
|
1551
|
+
for (const [n, s] of i)
|
|
1552
|
+
t[n] = s;
|
|
1553
|
+
return t;
|
|
1554
|
+
};
|
|
1555
|
+
var ks = /* @__PURE__ */ j(xs, [["__scopeId", "data-v-f1971a55"]]);
|
|
1556
|
+
var _s = { class: "tab-bar" };
|
|
1557
|
+
var Is = { class: "logo-slot" };
|
|
1558
|
+
var Es = { class: "tab-list" };
|
|
1559
|
+
var Ts = ["onClick"];
|
|
1560
|
+
var Ms = { class: "mode-switcher" };
|
|
1561
|
+
var Cs = /* @__PURE__ */ $({
|
|
1562
|
+
__name: "TabBar",
|
|
1563
|
+
props: {
|
|
1564
|
+
tabs: {},
|
|
1565
|
+
activeTabId: {},
|
|
1566
|
+
selectTab: { type: Function },
|
|
1567
|
+
panelMode: {}
|
|
1568
|
+
},
|
|
1569
|
+
emits: ["close", "update:panelMode", "settings"],
|
|
1570
|
+
setup(e) {
|
|
1571
|
+
return (i, t) => (h(), y("div", _s, [
|
|
1572
|
+
f("div", Is, [
|
|
1573
|
+
L(ks)
|
|
1574
|
+
]),
|
|
1575
|
+
f("div", Es, [
|
|
1576
|
+
(h(true), y(N, null, W(e.tabs, (n) => (h(), y("button", {
|
|
1577
|
+
key: n.id,
|
|
1578
|
+
"data-vmd-tab": "",
|
|
1579
|
+
class: P(["tab-btn", n.id === e.activeTabId ? "tab-btn--active" : "tab-btn--inactive"]),
|
|
1580
|
+
onClick: (s) => e.selectTab(n.id)
|
|
1581
|
+
}, [
|
|
1582
|
+
typeof n.icon == "string" ? (h(), F(m(re), {
|
|
1583
|
+
key: 0,
|
|
1584
|
+
icon: n.icon,
|
|
1585
|
+
width: "13",
|
|
1586
|
+
height: "13"
|
|
1587
|
+
}, null, 8, ["icon"])) : n.icon ? (h(), F(Oe(n.icon), {
|
|
1588
|
+
key: 1,
|
|
1589
|
+
width: "13",
|
|
1590
|
+
height: "13"
|
|
1591
|
+
})) : M("", true),
|
|
1592
|
+
f("span", null, C(n.label), 1)
|
|
1593
|
+
], 10, Ts))), 128))
|
|
1594
|
+
]),
|
|
1595
|
+
f("div", Ms, [
|
|
1596
|
+
f("button", {
|
|
1597
|
+
class: P(["mode-btn", { "mode-btn--active": e.panelMode === "bottom" }]),
|
|
1598
|
+
title: "Bottom panel",
|
|
1599
|
+
onClick: t[0] || (t[0] = (n) => i.$emit("update:panelMode", "bottom"))
|
|
1600
|
+
}, [...t[4] || (t[4] = [
|
|
1601
|
+
f("svg", {
|
|
1602
|
+
width: "14",
|
|
1603
|
+
height: "14",
|
|
1604
|
+
viewBox: "0 0 14 14",
|
|
1605
|
+
fill: "none"
|
|
1606
|
+
}, [
|
|
1607
|
+
f("rect", {
|
|
1608
|
+
x: "1",
|
|
1609
|
+
y: "1",
|
|
1610
|
+
width: "12",
|
|
1611
|
+
height: "7",
|
|
1612
|
+
rx: "1.5",
|
|
1613
|
+
fill: "currentColor",
|
|
1614
|
+
opacity: "0.35"
|
|
1615
|
+
}),
|
|
1616
|
+
f("rect", {
|
|
1617
|
+
x: "1",
|
|
1618
|
+
y: "9.5",
|
|
1619
|
+
width: "12",
|
|
1620
|
+
height: "3.5",
|
|
1621
|
+
rx: "1.5",
|
|
1622
|
+
fill: "currentColor"
|
|
1623
|
+
})
|
|
1624
|
+
], -1)
|
|
1625
|
+
])], 2),
|
|
1626
|
+
f("button", {
|
|
1627
|
+
class: P(["mode-btn", { "mode-btn--active": e.panelMode === "side" }]),
|
|
1628
|
+
title: "Side panel",
|
|
1629
|
+
onClick: t[1] || (t[1] = (n) => i.$emit("update:panelMode", "side"))
|
|
1630
|
+
}, [...t[5] || (t[5] = [
|
|
1631
|
+
f("svg", {
|
|
1632
|
+
width: "14",
|
|
1633
|
+
height: "14",
|
|
1634
|
+
viewBox: "0 0 14 14",
|
|
1635
|
+
fill: "none"
|
|
1636
|
+
}, [
|
|
1637
|
+
f("rect", {
|
|
1638
|
+
x: "1",
|
|
1639
|
+
y: "1",
|
|
1640
|
+
width: "7",
|
|
1641
|
+
height: "12",
|
|
1642
|
+
rx: "1.5",
|
|
1643
|
+
fill: "currentColor",
|
|
1644
|
+
opacity: "0.35"
|
|
1645
|
+
}),
|
|
1646
|
+
f("rect", {
|
|
1647
|
+
x: "9.5",
|
|
1648
|
+
y: "1",
|
|
1649
|
+
width: "3.5",
|
|
1650
|
+
height: "12",
|
|
1651
|
+
rx: "1.5",
|
|
1652
|
+
fill: "currentColor"
|
|
1653
|
+
})
|
|
1654
|
+
], -1)
|
|
1655
|
+
])], 2)
|
|
1656
|
+
]),
|
|
1657
|
+
t[6] || (t[6] = f("div", { class: "mode-divider" }, null, -1)),
|
|
1658
|
+
f("button", {
|
|
1659
|
+
class: "settings-btn",
|
|
1660
|
+
title: "Layout settings",
|
|
1661
|
+
onClick: t[2] || (t[2] = (n) => i.$emit("settings"))
|
|
1662
|
+
}, [
|
|
1663
|
+
L(m(re), {
|
|
1664
|
+
icon: "lucide:settings-2",
|
|
1665
|
+
width: "14",
|
|
1666
|
+
height: "14"
|
|
1667
|
+
})
|
|
1668
|
+
]),
|
|
1669
|
+
f("button", {
|
|
1670
|
+
class: "close-btn",
|
|
1671
|
+
title: "Close devtools",
|
|
1672
|
+
onClick: t[3] || (t[3] = (n) => i.$emit("close"))
|
|
1673
|
+
}, [
|
|
1674
|
+
L(m(re), {
|
|
1675
|
+
icon: "lucide:x",
|
|
1676
|
+
width: "14",
|
|
1677
|
+
height: "14"
|
|
1678
|
+
})
|
|
1679
|
+
])
|
|
1680
|
+
]));
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
var xt = /* @__PURE__ */ j(Cs, [["__scopeId", "data-v-1b140f4a"]]);
|
|
1684
|
+
var Os = { class: "panel-content" };
|
|
1685
|
+
var zs = /* @__PURE__ */ $({
|
|
1686
|
+
__name: "FloatingPanel",
|
|
1687
|
+
setup(e) {
|
|
1688
|
+
const { height: i, isOpen: t, panelMode: n, startResizeHeight: s, switchMode: o, toggle: l, close: r } = fe(), { registeredTabs: a, activeTabId: c, activeTab: u, setActiveTab: g } = ut(), { toggleSettings: d } = Le();
|
|
1689
|
+
return (w, p) => (h(), y(N, null, [
|
|
1690
|
+
m(t) ? M("", true) : (h(), y("button", {
|
|
1691
|
+
key: 0,
|
|
1692
|
+
"data-vmd-launcher": "",
|
|
1693
|
+
class: "launcher-pill",
|
|
1694
|
+
title: "Open vue-muza devtools",
|
|
1695
|
+
onClick: p[0] || (p[0] = //@ts-ignore
|
|
1696
|
+
(...b) => m(l) && m(l)(...b))
|
|
1697
|
+
}, [
|
|
1698
|
+
L(je, {
|
|
1699
|
+
width: 22,
|
|
1700
|
+
height: 10
|
|
1701
|
+
}),
|
|
1702
|
+
p[2] || (p[2] = f("span", null, "vue-muza", -1))
|
|
1703
|
+
])),
|
|
1704
|
+
L(ze, { name: "panel" }, {
|
|
1705
|
+
default: Ae(() => {
|
|
1706
|
+
var b;
|
|
1707
|
+
return [
|
|
1708
|
+
m(t) ? (h(), y("div", {
|
|
1709
|
+
key: 0,
|
|
1710
|
+
"data-vmd-panel": "",
|
|
1711
|
+
class: "devtools-panel",
|
|
1712
|
+
style: K({ height: `${m(i)}px` })
|
|
1713
|
+
}, [
|
|
1714
|
+
f("div", {
|
|
1715
|
+
class: "resize-handle",
|
|
1716
|
+
onMousedown: p[1] || (p[1] = //@ts-ignore
|
|
1717
|
+
(...v) => m(s) && m(s)(...v))
|
|
1718
|
+
}, null, 32),
|
|
1719
|
+
L(xt, {
|
|
1720
|
+
tabs: m(a),
|
|
1721
|
+
"active-tab-id": m(c) ?? null,
|
|
1722
|
+
"select-tab": m(g),
|
|
1723
|
+
"panel-mode": m(n),
|
|
1724
|
+
onClose: m(r),
|
|
1725
|
+
"onUpdate:panelMode": m(o),
|
|
1726
|
+
onSettings: m(d)
|
|
1727
|
+
}, null, 8, ["tabs", "active-tab-id", "select-tab", "panel-mode", "onClose", "onUpdate:panelMode", "onSettings"]),
|
|
1728
|
+
f("div", Os, [
|
|
1729
|
+
m(u) ? (h(), F(Oe((b = m(u)) == null ? void 0 : b.component), { key: 0 })) : M("", true)
|
|
1730
|
+
])
|
|
1731
|
+
], 4)) : M("", true)
|
|
1732
|
+
];
|
|
1733
|
+
}),
|
|
1734
|
+
_: 1
|
|
1735
|
+
})
|
|
1736
|
+
], 64));
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
var As = /* @__PURE__ */ j(zs, [["__scopeId", "data-v-1b40fea8"]]);
|
|
1740
|
+
var qs = { class: "panel-body" };
|
|
1741
|
+
var $s = { class: "panel-content" };
|
|
1742
|
+
var Ls = /* @__PURE__ */ $({
|
|
1743
|
+
__name: "SidePanel",
|
|
1744
|
+
setup(e) {
|
|
1745
|
+
const { sideWidth: i, isOpen: t, panelMode: n, startResizeSideWidth: s, switchMode: o, toggle: l, close: r } = fe(), { registeredTabs: a, activeTabId: c, activeTab: u, setActiveTab: g } = ut(), { toggleSettings: d } = Le();
|
|
1746
|
+
return (w, p) => (h(), y(N, null, [
|
|
1747
|
+
m(t) ? M("", true) : (h(), y("button", {
|
|
1748
|
+
key: 0,
|
|
1749
|
+
"data-vmd-launcher": "",
|
|
1750
|
+
class: "launcher-pill",
|
|
1751
|
+
title: "Open vue-muza devtools",
|
|
1752
|
+
onClick: p[0] || (p[0] = //@ts-ignore
|
|
1753
|
+
(...b) => m(l) && m(l)(...b))
|
|
1754
|
+
}, [
|
|
1755
|
+
L(je, {
|
|
1756
|
+
width: 22,
|
|
1757
|
+
height: 10
|
|
1758
|
+
}),
|
|
1759
|
+
p[2] || (p[2] = f("span", null, "vue-muza", -1))
|
|
1760
|
+
])),
|
|
1761
|
+
L(ze, { name: "panel" }, {
|
|
1762
|
+
default: Ae(() => {
|
|
1763
|
+
var b;
|
|
1764
|
+
return [
|
|
1765
|
+
m(t) ? (h(), y("div", {
|
|
1766
|
+
key: 0,
|
|
1767
|
+
"data-vmd-panel": "",
|
|
1768
|
+
class: "side-panel",
|
|
1769
|
+
style: K({ width: `${m(i)}px` })
|
|
1770
|
+
}, [
|
|
1771
|
+
f("div", {
|
|
1772
|
+
class: "resize-handle",
|
|
1773
|
+
onMousedown: p[1] || (p[1] = //@ts-ignore
|
|
1774
|
+
(...v) => m(s) && m(s)(...v))
|
|
1775
|
+
}, null, 32),
|
|
1776
|
+
f("div", qs, [
|
|
1777
|
+
L(xt, {
|
|
1778
|
+
tabs: m(a),
|
|
1779
|
+
"active-tab-id": m(c) ?? null,
|
|
1780
|
+
"select-tab": m(g),
|
|
1781
|
+
"panel-mode": m(n),
|
|
1782
|
+
onClose: m(r),
|
|
1783
|
+
"onUpdate:panelMode": m(o),
|
|
1784
|
+
onSettings: m(d)
|
|
1785
|
+
}, null, 8, ["tabs", "active-tab-id", "select-tab", "panel-mode", "onClose", "onUpdate:panelMode", "onSettings"]),
|
|
1786
|
+
f("div", $s, [
|
|
1787
|
+
m(u) ? (h(), F(Oe((b = m(u)) == null ? void 0 : b.component), { key: 0 })) : M("", true)
|
|
1788
|
+
])
|
|
1789
|
+
])
|
|
1790
|
+
], 4)) : M("", true)
|
|
1791
|
+
];
|
|
1792
|
+
}),
|
|
1793
|
+
_: 1
|
|
1794
|
+
})
|
|
1795
|
+
], 64));
|
|
1796
|
+
}
|
|
1797
|
+
});
|
|
1798
|
+
var Fs = /* @__PURE__ */ j(Ls, [["__scopeId", "data-v-c45ea08a"]]);
|
|
1799
|
+
var Ps = /* @__PURE__ */ $({
|
|
1800
|
+
__name: "DevtoolsApp",
|
|
1801
|
+
setup(e) {
|
|
1802
|
+
const { panelMode: i } = fe();
|
|
1803
|
+
return (t, n) => m(i) === "bottom" ? (h(), F(As, { key: 0 })) : (h(), F(Fs, { key: 1 }));
|
|
1804
|
+
}
|
|
1805
|
+
});
|
|
1806
|
+
var it = "vue-muza-devtools-root";
|
|
1807
|
+
function Rs() {
|
|
1808
|
+
if (document.getElementById(it)) return;
|
|
1809
|
+
const e = document.createElement("div");
|
|
1810
|
+
e.id = it, Object.assign(e.style, {
|
|
1811
|
+
position: "fixed",
|
|
1812
|
+
top: "0",
|
|
1813
|
+
left: "0",
|
|
1814
|
+
width: "0",
|
|
1815
|
+
height: "0",
|
|
1816
|
+
overflow: "visible",
|
|
1817
|
+
zIndex: "9999",
|
|
1818
|
+
pointerEvents: "none"
|
|
1819
|
+
}), document.body.appendChild(e), Ot(Ps).mount(e);
|
|
1820
|
+
}
|
|
1821
|
+
function js() {
|
|
1822
|
+
const e = q(""), i = q("all"), t = q("all"), n = O(() => qe.value.filter((o) => !(e.value && !o.url.toLowerCase().includes(e.value.toLowerCase()) || i.value !== "all" && o.status !== i.value || t.value !== "all" && o.instanceId !== t.value)).reverse());
|
|
1823
|
+
function s() {
|
|
1824
|
+
e.value = "", i.value = "all", t.value = "all";
|
|
1825
|
+
}
|
|
1826
|
+
return { urlFilter: e, statusFilter: i, instanceFilter: t, filteredRequests: n, clearFilters: s };
|
|
1827
|
+
}
|
|
1828
|
+
function Ds() {
|
|
1829
|
+
const e = q(null), i = q("split"), t = q("json"), n = q("json"), s = O(
|
|
1830
|
+
() => e.value ? qe.value.find((c) => c.id === e.value) ?? null : null
|
|
1831
|
+
);
|
|
1832
|
+
function o(c) {
|
|
1833
|
+
e.value = c;
|
|
1834
|
+
}
|
|
1835
|
+
function l(c) {
|
|
1836
|
+
i.value = c;
|
|
1837
|
+
}
|
|
1838
|
+
function r() {
|
|
1839
|
+
t.value = t.value === "json" ? "kv" : "json";
|
|
1840
|
+
}
|
|
1841
|
+
function a() {
|
|
1842
|
+
n.value = n.value === "json" ? "kv" : "json";
|
|
1843
|
+
}
|
|
1844
|
+
return {
|
|
1845
|
+
selectedRequest: s,
|
|
1846
|
+
selectedRequestId: e,
|
|
1847
|
+
viewMode: i,
|
|
1848
|
+
payloadFormat: t,
|
|
1849
|
+
responseFormat: n,
|
|
1850
|
+
selectRequest: o,
|
|
1851
|
+
setViewMode: l,
|
|
1852
|
+
togglePayloadFormat: r,
|
|
1853
|
+
toggleResponseFormat: a
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
function Vs() {
|
|
1857
|
+
const e = js(), i = Ds();
|
|
1858
|
+
return { ...e, ...i, instances: at };
|
|
1859
|
+
}
|
|
1860
|
+
function Ns(e, i, t) {
|
|
1861
|
+
const n = new Array(e);
|
|
1862
|
+
return new Proxy(n, {
|
|
1863
|
+
get(s, o, l) {
|
|
1864
|
+
if (typeof o == "string") {
|
|
1865
|
+
const r = o.charCodeAt(0);
|
|
1866
|
+
if (r >= 48 && r <= 57) {
|
|
1867
|
+
const a = +o;
|
|
1868
|
+
if (Number.isInteger(a) && a >= 0 && a < e) {
|
|
1869
|
+
let c = s[a];
|
|
1870
|
+
if (!c) {
|
|
1871
|
+
const u = i[a * 2];
|
|
1872
|
+
c = s[a] = {
|
|
1873
|
+
index: a,
|
|
1874
|
+
key: t(a),
|
|
1875
|
+
start: u,
|
|
1876
|
+
size: i[a * 2 + 1],
|
|
1877
|
+
end: u + i[a * 2 + 1],
|
|
1878
|
+
lane: 0
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
return c;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
if (o === "length") return e;
|
|
1885
|
+
}
|
|
1886
|
+
return Reflect.get(s, o, l);
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
function U(e, i, t) {
|
|
1891
|
+
let n = t.initialDeps ?? [], s, o = true;
|
|
1892
|
+
function l() {
|
|
1893
|
+
var r;
|
|
1894
|
+
const a = process.env.NODE_ENV !== "production" && !!t.key && !!((r = t.debug) != null && r.call(t));
|
|
1895
|
+
let c = 0;
|
|
1896
|
+
a && (c = Date.now());
|
|
1897
|
+
const u = e();
|
|
1898
|
+
if (!(u.length !== n.length || u.some((w, p) => n[p] !== w)))
|
|
1899
|
+
return s;
|
|
1900
|
+
n = u;
|
|
1901
|
+
let d = 0;
|
|
1902
|
+
if (a && (d = Date.now()), s = i(...u), a) {
|
|
1903
|
+
const w = Math.round((Date.now() - c) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, b = p / 16, v = (x, T) => {
|
|
1904
|
+
for (x = String(x); x.length < T; )
|
|
1905
|
+
x = " " + x;
|
|
1906
|
+
return x;
|
|
1907
|
+
};
|
|
1908
|
+
console.info(
|
|
1909
|
+
`%c\u23F1 ${v(p, 5)} /${v(w, 5)} ms`,
|
|
1910
|
+
`
|
|
1911
|
+
font-size: .6rem;
|
|
1912
|
+
font-weight: bold;
|
|
1913
|
+
color: hsl(${Math.max(
|
|
1914
|
+
0,
|
|
1915
|
+
Math.min(120 - 120 * b, 120)
|
|
1916
|
+
)}deg 100% 31%);`,
|
|
1917
|
+
t == null ? void 0 : t.key
|
|
1918
|
+
);
|
|
1919
|
+
}
|
|
1920
|
+
return t != null && t.onChange && !(o && t.skipInitialOnChange) && t.onChange(s), o = false, s;
|
|
1921
|
+
}
|
|
1922
|
+
return l.updateDeps = (r) => {
|
|
1923
|
+
n = r;
|
|
1924
|
+
}, l;
|
|
1925
|
+
}
|
|
1926
|
+
function ot(e, i) {
|
|
1927
|
+
if (e === void 0)
|
|
1928
|
+
throw new Error("Unexpected undefined");
|
|
1929
|
+
return e;
|
|
1930
|
+
}
|
|
1931
|
+
var Ws = (e, i) => Math.abs(e - i) < 1.01;
|
|
1932
|
+
var Hs = (e, i, t) => {
|
|
1933
|
+
let n;
|
|
1934
|
+
return function(...s) {
|
|
1935
|
+
e.clearTimeout(n), n = e.setTimeout(() => i.apply(this, s), t);
|
|
1936
|
+
};
|
|
1937
|
+
};
|
|
1938
|
+
var Z;
|
|
1939
|
+
var xe = () => {
|
|
1940
|
+
if (Z !== void 0) return Z;
|
|
1941
|
+
if (typeof navigator > "u") return Z = false;
|
|
1942
|
+
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return Z = true;
|
|
1943
|
+
const e = navigator.maxTouchPoints;
|
|
1944
|
+
return Z = navigator.platform === "MacIntel" && e !== void 0 && e > 0;
|
|
1945
|
+
};
|
|
1946
|
+
var lt = (e) => {
|
|
1947
|
+
const { offsetWidth: i, offsetHeight: t } = e;
|
|
1948
|
+
return { width: i, height: t };
|
|
1949
|
+
};
|
|
1950
|
+
var Bs = (e) => e;
|
|
1951
|
+
var Ks = (e) => {
|
|
1952
|
+
const i = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1) - i + 1, s = new Array(n);
|
|
1953
|
+
for (let o = 0; o < n; o++)
|
|
1954
|
+
s[o] = i + o;
|
|
1955
|
+
return s;
|
|
1956
|
+
};
|
|
1957
|
+
var Us = (e, i) => {
|
|
1958
|
+
const t = e.scrollElement;
|
|
1959
|
+
if (!t)
|
|
1960
|
+
return;
|
|
1961
|
+
const n = e.targetWindow;
|
|
1962
|
+
if (!n)
|
|
1963
|
+
return;
|
|
1964
|
+
const s = (l) => {
|
|
1965
|
+
const { width: r, height: a } = l;
|
|
1966
|
+
i({ width: Math.round(r), height: Math.round(a) });
|
|
1967
|
+
};
|
|
1968
|
+
if (s(lt(t)), !n.ResizeObserver)
|
|
1969
|
+
return () => {
|
|
1970
|
+
};
|
|
1971
|
+
const o = new n.ResizeObserver((l) => {
|
|
1972
|
+
const r = () => {
|
|
1973
|
+
const a = l[0];
|
|
1974
|
+
if (a != null && a.borderBoxSize) {
|
|
1975
|
+
const c = a.borderBoxSize[0];
|
|
1976
|
+
if (c) {
|
|
1977
|
+
s({ width: c.inlineSize, height: c.blockSize });
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
s(lt(t));
|
|
1982
|
+
};
|
|
1983
|
+
e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
|
|
1984
|
+
});
|
|
1985
|
+
return o.observe(t, { box: "border-box" }), () => {
|
|
1986
|
+
o.unobserve(t);
|
|
1987
|
+
};
|
|
1988
|
+
};
|
|
1989
|
+
var de = {
|
|
1990
|
+
passive: true
|
|
1991
|
+
};
|
|
1992
|
+
var Js = typeof window > "u" ? true : "onscrollend" in window;
|
|
1993
|
+
var Xs = (e, i, t) => {
|
|
1994
|
+
const n = e.scrollElement;
|
|
1995
|
+
if (!n)
|
|
1996
|
+
return;
|
|
1997
|
+
const s = e.targetWindow;
|
|
1998
|
+
if (!s)
|
|
1999
|
+
return;
|
|
2000
|
+
const o = e.options.useScrollendEvent && Js;
|
|
2001
|
+
let l = 0;
|
|
2002
|
+
const r = o ? null : Hs(
|
|
2003
|
+
s,
|
|
2004
|
+
() => i(l, false),
|
|
2005
|
+
e.options.isScrollingResetDelay
|
|
2006
|
+
), a = (g) => () => {
|
|
2007
|
+
l = t(n), r == null || r(), i(l, g);
|
|
2008
|
+
}, c = a(true), u = a(false);
|
|
2009
|
+
return n.addEventListener("scroll", c, de), o && n.addEventListener("scrollend", u, de), () => {
|
|
2010
|
+
n.removeEventListener("scroll", c), o && n.removeEventListener("scrollend", u);
|
|
2011
|
+
};
|
|
2012
|
+
};
|
|
2013
|
+
var Qs = (e, i) => Xs(e, i, (t) => {
|
|
2014
|
+
const { horizontal: n, isRtl: s } = e.options;
|
|
2015
|
+
return n ? t.scrollLeft * (s && -1 || 1) : t.scrollTop;
|
|
2016
|
+
});
|
|
2017
|
+
var Gs = (e, i, t) => {
|
|
2018
|
+
if (t.options.useCachedMeasurements) {
|
|
2019
|
+
const n = t.indexFromElement(e), s = t.options.getItemKey(n);
|
|
2020
|
+
return t.itemSizeCache.get(s) ?? t.options.estimateSize(n);
|
|
2021
|
+
}
|
|
2022
|
+
if (i != null && i.borderBoxSize) {
|
|
2023
|
+
const n = i.borderBoxSize[0];
|
|
2024
|
+
if (n)
|
|
2025
|
+
return Math.round(
|
|
2026
|
+
n[t.options.horizontal ? "inlineSize" : "blockSize"]
|
|
2027
|
+
);
|
|
2028
|
+
}
|
|
2029
|
+
if (!i) {
|
|
2030
|
+
const n = t.indexFromElement(e), s = t.options.getItemKey(n), o = t.itemSizeCache.get(s);
|
|
2031
|
+
if (o !== void 0)
|
|
2032
|
+
return o;
|
|
2033
|
+
}
|
|
2034
|
+
return e[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
2035
|
+
};
|
|
2036
|
+
var Ys = (e, {
|
|
2037
|
+
adjustments: i = 0,
|
|
2038
|
+
behavior: t
|
|
2039
|
+
}, n) => {
|
|
2040
|
+
var s, o;
|
|
2041
|
+
(o = (s = n.scrollElement) == null ? void 0 : s.scrollTo) == null || o.call(s, {
|
|
2042
|
+
[n.options.horizontal ? "left" : "top"]: e + i,
|
|
2043
|
+
behavior: t
|
|
2044
|
+
});
|
|
2045
|
+
};
|
|
2046
|
+
var Zs = Ys;
|
|
2047
|
+
var ei = class {
|
|
2048
|
+
constructor(i) {
|
|
2049
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = false, this.scrollState = null, this.measurementsCache = [], this._flatMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = false, this.lanesSettling = false, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this._iosDeferredAdjustment = 0, this._iosTouching = false, this._iosJustTouchEnded = false, this._iosTouchEndTimerId = null, this._intendedScrollOffset = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
2050
|
+
var t, n, s;
|
|
2051
|
+
return ((s = (n = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : n.now) == null ? void 0 : s.call(n)) ?? Date.now();
|
|
2052
|
+
}, this.observer = /* @__PURE__ */ (() => {
|
|
2053
|
+
let t = null;
|
|
2054
|
+
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
|
|
2055
|
+
s.forEach((o) => {
|
|
2056
|
+
const l = () => {
|
|
2057
|
+
const r = o.target, a = this.indexFromElement(r);
|
|
2058
|
+
if (!r.isConnected) {
|
|
2059
|
+
this.observer.unobserve(r);
|
|
2060
|
+
for (const [c, u] of this.elementsCache)
|
|
2061
|
+
if (u === r) {
|
|
2062
|
+
this.elementsCache.delete(c);
|
|
2063
|
+
break;
|
|
2064
|
+
}
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
this.shouldMeasureDuringScroll(a) && this.resizeItem(
|
|
2068
|
+
a,
|
|
2069
|
+
this.options.measureElement(r, o, this)
|
|
2070
|
+
);
|
|
2071
|
+
};
|
|
2072
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
2073
|
+
});
|
|
2074
|
+
}));
|
|
2075
|
+
return {
|
|
2076
|
+
disconnect: () => {
|
|
2077
|
+
var s;
|
|
2078
|
+
(s = n()) == null || s.disconnect(), t = null;
|
|
2079
|
+
},
|
|
2080
|
+
observe: (s) => {
|
|
2081
|
+
var o;
|
|
2082
|
+
return (o = n()) == null ? void 0 : o.observe(s, { box: "border-box" });
|
|
2083
|
+
},
|
|
2084
|
+
unobserve: (s) => {
|
|
2085
|
+
var o;
|
|
2086
|
+
return (o = n()) == null ? void 0 : o.unobserve(s);
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
2090
|
+
var n, s;
|
|
2091
|
+
const o = {
|
|
2092
|
+
debug: false,
|
|
2093
|
+
initialOffset: 0,
|
|
2094
|
+
overscan: 1,
|
|
2095
|
+
paddingStart: 0,
|
|
2096
|
+
paddingEnd: 0,
|
|
2097
|
+
scrollPaddingStart: 0,
|
|
2098
|
+
scrollPaddingEnd: 0,
|
|
2099
|
+
horizontal: false,
|
|
2100
|
+
getItemKey: Bs,
|
|
2101
|
+
rangeExtractor: Ks,
|
|
2102
|
+
onChange: () => {
|
|
2103
|
+
},
|
|
2104
|
+
measureElement: Gs,
|
|
2105
|
+
initialRect: { width: 0, height: 0 },
|
|
2106
|
+
scrollMargin: 0,
|
|
2107
|
+
gap: 0,
|
|
2108
|
+
indexAttribute: "data-index",
|
|
2109
|
+
initialMeasurementsCache: [],
|
|
2110
|
+
lanes: 1,
|
|
2111
|
+
anchorTo: "start",
|
|
2112
|
+
followOnAppend: false,
|
|
2113
|
+
scrollEndThreshold: 1,
|
|
2114
|
+
isScrollingResetDelay: 150,
|
|
2115
|
+
enabled: true,
|
|
2116
|
+
isRtl: false,
|
|
2117
|
+
useScrollendEvent: false,
|
|
2118
|
+
useAnimationFrameWithResizeObserver: false,
|
|
2119
|
+
laneAssignmentMode: "estimate",
|
|
2120
|
+
useCachedMeasurements: false
|
|
2121
|
+
};
|
|
2122
|
+
for (const d in t) {
|
|
2123
|
+
const w = t[d];
|
|
2124
|
+
w !== void 0 && (o[d] = w);
|
|
2125
|
+
}
|
|
2126
|
+
const l = this.options;
|
|
2127
|
+
let r = null, a = null, c = false;
|
|
2128
|
+
if (l !== void 0 && l.enabled && o.enabled && o.anchorTo === "end" && this.scrollElement !== null) {
|
|
2129
|
+
const d = l.count, w = o.count, p = this.getMeasurements(), b = d > 0 ? ((n = p[0]) == null ? void 0 : n.key) ?? l.getItemKey(0) : null, v = d > 0 ? ((s = p[d - 1]) == null ? void 0 : s.key) ?? l.getItemKey(d - 1) : null;
|
|
2130
|
+
if (w !== d || d > 0 && w > 0 && (o.getItemKey(0) !== b || o.getItemKey(w - 1) !== v)) {
|
|
2131
|
+
c = true;
|
|
2132
|
+
const k = d > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? p[0] : null;
|
|
2133
|
+
k && (r = [k.key, this.getScrollOffset() - k.start]);
|
|
2134
|
+
const z = o.followOnAppend === true ? "auto" : o.followOnAppend || null;
|
|
2135
|
+
z && w > d && this.isAtEnd(l.scrollEndThreshold) && (d === 0 || o.getItemKey(w - 1) !== v) && (a = z);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
this.options = o, c && (this.pendingMin = 0, this.itemSizeCacheVersion++);
|
|
2139
|
+
let u = false, g = 0;
|
|
2140
|
+
if (r && this.scrollOffset !== null) {
|
|
2141
|
+
const [d, w] = r, p = this.getMeasurements(), { count: b, getItemKey: v } = this.options;
|
|
2142
|
+
let x = 0;
|
|
2143
|
+
for (; x < b && v(x) !== d; )
|
|
2144
|
+
x++;
|
|
2145
|
+
if (x < b) {
|
|
2146
|
+
const T = p[x];
|
|
2147
|
+
if (T) {
|
|
2148
|
+
const k = T.start + w;
|
|
2149
|
+
k !== this.scrollOffset && (g = k - this.scrollOffset, this.scrollOffset = k, u = true);
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
(u || a) && (this.pendingScrollAnchor = [
|
|
2154
|
+
u ? r[0] : null,
|
|
2155
|
+
u ? r[1] : 0,
|
|
2156
|
+
a,
|
|
2157
|
+
g
|
|
2158
|
+
]);
|
|
2159
|
+
}, this.notify = (t) => {
|
|
2160
|
+
var n, s;
|
|
2161
|
+
(s = (n = this.options).onChange) == null || s.call(n, this, t);
|
|
2162
|
+
}, this.maybeNotify = U(
|
|
2163
|
+
() => (this.calculateRange(), [
|
|
2164
|
+
this.isScrolling,
|
|
2165
|
+
this.range ? this.range.startIndex : null,
|
|
2166
|
+
this.range ? this.range.endIndex : null
|
|
2167
|
+
]),
|
|
2168
|
+
(t) => {
|
|
2169
|
+
this.notify(t);
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
2173
|
+
debug: () => this.options.debug,
|
|
2174
|
+
initialDeps: [
|
|
2175
|
+
this.isScrolling,
|
|
2176
|
+
this.range ? this.range.startIndex : null,
|
|
2177
|
+
this.range ? this.range.endIndex : null
|
|
2178
|
+
]
|
|
2179
|
+
}
|
|
2180
|
+
), this.cleanup = () => {
|
|
2181
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
2182
|
+
}, this._didMount = () => () => {
|
|
2183
|
+
this.cleanup();
|
|
2184
|
+
}, this._willUpdate = () => {
|
|
2185
|
+
var t;
|
|
2186
|
+
const n = this.options.enabled ? this.options.getScrollElement() : null;
|
|
2187
|
+
if (this.scrollElement !== n) {
|
|
2188
|
+
if (this.cleanup(), !n) {
|
|
2189
|
+
this.maybeNotify();
|
|
2190
|
+
return;
|
|
2191
|
+
}
|
|
2192
|
+
if (this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((o) => {
|
|
2193
|
+
this.observer.observe(o);
|
|
2194
|
+
}), this.unsubs.push(
|
|
2195
|
+
this.options.observeElementRect(this, (o) => {
|
|
2196
|
+
this.scrollRect = o, this.maybeNotify();
|
|
2197
|
+
})
|
|
2198
|
+
), this.unsubs.push(
|
|
2199
|
+
this.options.observeElementOffset(this, (o, l) => {
|
|
2200
|
+
this._intendedScrollOffset !== null && Math.abs(o - this._intendedScrollOffset) < 1.5 && (o = this._intendedScrollOffset), this._intendedScrollOffset = null, this.scrollAdjustments = 0, this.scrollDirection = l ? this.getScrollOffset() < o ? "forward" : "backward" : null, this.scrollOffset = o, this.isScrolling = l, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
2201
|
+
})
|
|
2202
|
+
), "addEventListener" in this.scrollElement) {
|
|
2203
|
+
const o = this.scrollElement, l = () => {
|
|
2204
|
+
this._iosTouching = true, this._iosJustTouchEnded = false, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
|
|
2205
|
+
}, r = () => {
|
|
2206
|
+
this._iosTouching = false, !(!xe() || this.targetWindow == null) && (this._iosJustTouchEnded = true, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
|
|
2207
|
+
this._iosJustTouchEnded = false, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
|
|
2208
|
+
}, 150));
|
|
2209
|
+
};
|
|
2210
|
+
o.addEventListener(
|
|
2211
|
+
"touchstart",
|
|
2212
|
+
l,
|
|
2213
|
+
de
|
|
2214
|
+
), o.addEventListener(
|
|
2215
|
+
"touchend",
|
|
2216
|
+
r,
|
|
2217
|
+
de
|
|
2218
|
+
), this.unsubs.push(() => {
|
|
2219
|
+
o.removeEventListener("touchstart", l), o.removeEventListener("touchend", r), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
2223
|
+
adjustments: void 0,
|
|
2224
|
+
behavior: void 0
|
|
2225
|
+
});
|
|
2226
|
+
}
|
|
2227
|
+
const s = this.pendingScrollAnchor;
|
|
2228
|
+
if (this.pendingScrollAnchor = null, s && this.scrollElement && this.options.enabled) {
|
|
2229
|
+
const [o, l, r, a] = s;
|
|
2230
|
+
o !== null && !r && (xe() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? a !== 0 && (this._iosDeferredAdjustment += a) : this._scrollToOffset(this.getScrollOffset(), {
|
|
2231
|
+
adjustments: void 0,
|
|
2232
|
+
behavior: void 0
|
|
2233
|
+
})), r && this.scrollToEnd({ behavior: r });
|
|
2234
|
+
}
|
|
2235
|
+
}, this._flushIosDeferredIfReady = () => {
|
|
2236
|
+
if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
|
|
2237
|
+
const t = this.getScrollOffset(), n = this.getMaxScrollOffset();
|
|
2238
|
+
if (t < 0 || t > n) return;
|
|
2239
|
+
const s = this._iosDeferredAdjustment;
|
|
2240
|
+
this._iosDeferredAdjustment = 0, this._scrollToOffset(t, {
|
|
2241
|
+
adjustments: this.scrollAdjustments += s,
|
|
2242
|
+
behavior: void 0
|
|
2243
|
+
});
|
|
2244
|
+
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
|
|
2245
|
+
const s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
2246
|
+
for (let l = n - 1; l >= 0; l--) {
|
|
2247
|
+
const r = t[l];
|
|
2248
|
+
if (s.has(r.lane))
|
|
2249
|
+
continue;
|
|
2250
|
+
const a = o.get(
|
|
2251
|
+
r.lane
|
|
2252
|
+
);
|
|
2253
|
+
if (a == null || r.end > a.end ? o.set(r.lane, r) : r.end < a.end && s.set(r.lane, true), s.size === this.options.lanes)
|
|
2254
|
+
break;
|
|
2255
|
+
}
|
|
2256
|
+
return o.size === this.options.lanes ? Array.from(o.values()).sort((l, r) => l.end === r.end ? l.index - r.index : l.end - r.end)[0] : void 0;
|
|
2257
|
+
}, this.getMeasurementOptions = U(
|
|
2258
|
+
() => [
|
|
2259
|
+
this.options.count,
|
|
2260
|
+
this.options.paddingStart,
|
|
2261
|
+
this.options.scrollMargin,
|
|
2262
|
+
this.options.getItemKey,
|
|
2263
|
+
this.options.enabled,
|
|
2264
|
+
this.options.lanes,
|
|
2265
|
+
this.options.laneAssignmentMode
|
|
2266
|
+
],
|
|
2267
|
+
(t, n, s, o, l, r, a) => (this.prevLanes !== void 0 && this.prevLanes !== r && (this.lanesChangedFlag = true), this.prevLanes = r, this.pendingMin = null, {
|
|
2268
|
+
count: t,
|
|
2269
|
+
paddingStart: n,
|
|
2270
|
+
scrollMargin: s,
|
|
2271
|
+
getItemKey: o,
|
|
2272
|
+
enabled: l,
|
|
2273
|
+
lanes: r,
|
|
2274
|
+
laneAssignmentMode: a
|
|
2275
|
+
}),
|
|
2276
|
+
{
|
|
2277
|
+
key: false
|
|
2278
|
+
}
|
|
2279
|
+
), this.getMeasurements = U(
|
|
2280
|
+
() => [this.getMeasurementOptions(), this.itemSizeCacheVersion],
|
|
2281
|
+
({
|
|
2282
|
+
count: t,
|
|
2283
|
+
paddingStart: n,
|
|
2284
|
+
scrollMargin: s,
|
|
2285
|
+
getItemKey: o,
|
|
2286
|
+
enabled: l,
|
|
2287
|
+
lanes: r,
|
|
2288
|
+
laneAssignmentMode: a
|
|
2289
|
+
}, c) => {
|
|
2290
|
+
const u = this.itemSizeCache;
|
|
2291
|
+
if (!l)
|
|
2292
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
2293
|
+
if (this.laneAssignments.size > t)
|
|
2294
|
+
for (const p of this.laneAssignments.keys())
|
|
2295
|
+
p >= t && this.laneAssignments.delete(p);
|
|
2296
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = false, this.lanesSettling = true, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((p) => {
|
|
2297
|
+
this.itemSizeCache.set(p.key, p.size);
|
|
2298
|
+
}));
|
|
2299
|
+
const g = this.lanesSettling ? 0 : this.pendingMin ?? 0;
|
|
2300
|
+
if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = false), r === 1) {
|
|
2301
|
+
const p = this.options.gap, b = t * 2;
|
|
2302
|
+
let v = this._flatMeasurements;
|
|
2303
|
+
if (!v || v.length < b) {
|
|
2304
|
+
const k = new Float64Array(b);
|
|
2305
|
+
v && g > 0 && k.set(v.subarray(0, g * 2)), v = k, this._flatMeasurements = v;
|
|
2306
|
+
}
|
|
2307
|
+
let x;
|
|
2308
|
+
if (g === 0)
|
|
2309
|
+
x = n + s;
|
|
2310
|
+
else {
|
|
2311
|
+
const k = g - 1;
|
|
2312
|
+
x = v[k * 2] + v[k * 2 + 1] + p;
|
|
2313
|
+
}
|
|
2314
|
+
for (let k = g; k < t; k++) {
|
|
2315
|
+
const z = o(k), D = u.get(z), _ = typeof D == "number" ? D : this.options.estimateSize(k);
|
|
2316
|
+
v[k * 2] = x, v[k * 2 + 1] = _, x += _ + p;
|
|
2317
|
+
}
|
|
2318
|
+
const T = Ns(t, v, o);
|
|
2319
|
+
return this.measurementsCache = T, T;
|
|
2320
|
+
}
|
|
2321
|
+
const d = this.measurementsCache.slice(0, g), w = new Array(r).fill(
|
|
2322
|
+
void 0
|
|
2323
|
+
);
|
|
2324
|
+
for (let p = 0; p < g; p++) {
|
|
2325
|
+
const b = d[p];
|
|
2326
|
+
b && (w[b.lane] = p);
|
|
2327
|
+
}
|
|
2328
|
+
for (let p = g; p < t; p++) {
|
|
2329
|
+
const b = o(p), v = this.laneAssignments.get(p);
|
|
2330
|
+
let x, T;
|
|
2331
|
+
const k = a === "estimate" || u.has(b);
|
|
2332
|
+
if (v !== void 0 && this.options.lanes > 1) {
|
|
2333
|
+
x = v;
|
|
2334
|
+
const I = w[x], S = I !== void 0 ? d[I] : void 0;
|
|
2335
|
+
T = S ? S.end + this.options.gap : n + s;
|
|
2336
|
+
} else {
|
|
2337
|
+
const I = this.options.lanes === 1 ? d[p - 1] : this.getFurthestMeasurement(d, p);
|
|
2338
|
+
T = I ? I.end + this.options.gap : n + s, x = I ? I.lane : p % this.options.lanes, this.options.lanes > 1 && k && this.laneAssignments.set(p, x);
|
|
2339
|
+
}
|
|
2340
|
+
const z = u.get(b), D = typeof z == "number" ? z : this.options.estimateSize(p), _ = T + D;
|
|
2341
|
+
d[p] = {
|
|
2342
|
+
index: p,
|
|
2343
|
+
start: T,
|
|
2344
|
+
size: D,
|
|
2345
|
+
end: _,
|
|
2346
|
+
key: b,
|
|
2347
|
+
lane: x
|
|
2348
|
+
}, w[x] = p;
|
|
2349
|
+
}
|
|
2350
|
+
return this.measurementsCache = d, d;
|
|
2351
|
+
},
|
|
2352
|
+
{
|
|
2353
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
2354
|
+
debug: () => this.options.debug
|
|
2355
|
+
}
|
|
2356
|
+
), this.calculateRange = U(
|
|
2357
|
+
() => [
|
|
2358
|
+
this.getMeasurements(),
|
|
2359
|
+
this.getSize(),
|
|
2360
|
+
this.getScrollOffset(),
|
|
2361
|
+
this.options.lanes
|
|
2362
|
+
],
|
|
2363
|
+
(t, n, s, o) => this.range = t.length > 0 && n > 0 ? ti({
|
|
2364
|
+
measurements: t,
|
|
2365
|
+
outerSize: n,
|
|
2366
|
+
scrollOffset: s,
|
|
2367
|
+
lanes: o,
|
|
2368
|
+
// Pass the typed array so binary search + forward-walk can
|
|
2369
|
+
// read start/end directly from Float64Array, skipping the
|
|
2370
|
+
// Proxy traps that materialize a full VirtualItem per probe.
|
|
2371
|
+
flat: o === 1 && this._flatMeasurements != null ? this._flatMeasurements : null
|
|
2372
|
+
}) : null,
|
|
2373
|
+
{
|
|
2374
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
2375
|
+
debug: () => this.options.debug
|
|
2376
|
+
}
|
|
2377
|
+
), this.getVirtualIndexes = U(
|
|
2378
|
+
() => {
|
|
2379
|
+
let t = null, n = null;
|
|
2380
|
+
const s = this.calculateRange();
|
|
2381
|
+
return s && (t = s.startIndex, n = s.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, n]), [
|
|
2382
|
+
this.options.rangeExtractor,
|
|
2383
|
+
this.options.overscan,
|
|
2384
|
+
this.options.count,
|
|
2385
|
+
t,
|
|
2386
|
+
n
|
|
2387
|
+
];
|
|
2388
|
+
},
|
|
2389
|
+
(t, n, s, o, l) => o === null || l === null ? [] : t({
|
|
2390
|
+
startIndex: o,
|
|
2391
|
+
endIndex: l,
|
|
2392
|
+
overscan: n,
|
|
2393
|
+
count: s
|
|
2394
|
+
}),
|
|
2395
|
+
{
|
|
2396
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
2397
|
+
debug: () => this.options.debug
|
|
2398
|
+
}
|
|
2399
|
+
), this.indexFromElement = (t) => {
|
|
2400
|
+
const n = this.options.indexAttribute, s = t.getAttribute(n);
|
|
2401
|
+
return s ? parseInt(s, 10) : (console.warn(
|
|
2402
|
+
`Missing attribute name '${n}={index}' on measured element.`
|
|
2403
|
+
), -1);
|
|
2404
|
+
}, this.shouldMeasureDuringScroll = (t) => {
|
|
2405
|
+
var n;
|
|
2406
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth")
|
|
2407
|
+
return true;
|
|
2408
|
+
const s = this.scrollState.index ?? ((n = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : n.index);
|
|
2409
|
+
if (s !== void 0 && this.range) {
|
|
2410
|
+
const o = Math.max(
|
|
2411
|
+
this.options.overscan,
|
|
2412
|
+
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
2413
|
+
), l = Math.max(0, s - o), r = Math.min(
|
|
2414
|
+
this.options.count - 1,
|
|
2415
|
+
s + o
|
|
2416
|
+
);
|
|
2417
|
+
return t >= l && t <= r;
|
|
2418
|
+
}
|
|
2419
|
+
return true;
|
|
2420
|
+
}, this.measureElement = (t) => {
|
|
2421
|
+
if (!t) {
|
|
2422
|
+
this.elementsCache.forEach((l, r) => {
|
|
2423
|
+
l.isConnected || (this.observer.unobserve(l), this.elementsCache.delete(r));
|
|
2424
|
+
});
|
|
2425
|
+
return;
|
|
2426
|
+
}
|
|
2427
|
+
const n = this.indexFromElement(t), s = this.options.getItemKey(n), o = this.elementsCache.get(s);
|
|
2428
|
+
o !== t && (o && this.observer.unobserve(o), this.observer.observe(t), this.elementsCache.set(s, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, void 0, this));
|
|
2429
|
+
}, this.resizeItem = (t, n) => {
|
|
2430
|
+
var s, o;
|
|
2431
|
+
if (t < 0 || t >= this.options.count) return;
|
|
2432
|
+
let l, r, a;
|
|
2433
|
+
const c = this._flatMeasurements;
|
|
2434
|
+
if (this.options.lanes === 1 && c !== null)
|
|
2435
|
+
a = this.options.getItemKey(t), r = c[t * 2], l = c[t * 2 + 1];
|
|
2436
|
+
else {
|
|
2437
|
+
const d = this.measurementsCache[t];
|
|
2438
|
+
if (!d) return;
|
|
2439
|
+
a = d.key, r = d.start, l = d.size;
|
|
2440
|
+
}
|
|
2441
|
+
const u = this.itemSizeCache.get(a) ?? l, g = n - u;
|
|
2442
|
+
if (g !== 0) {
|
|
2443
|
+
const d = this.options.anchorTo === "end" && ((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, w = d ? this.getTotalSize() : 0, p = ((o = this.scrollState) == null ? void 0 : o.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
|
|
2444
|
+
// The callback expects a VirtualItem; build one lazily only
|
|
2445
|
+
// when the consumer actually supplied a custom predicate.
|
|
2446
|
+
this.measurementsCache[t] ?? {
|
|
2447
|
+
index: t,
|
|
2448
|
+
key: a,
|
|
2449
|
+
start: r,
|
|
2450
|
+
size: l,
|
|
2451
|
+
end: r + l,
|
|
2452
|
+
lane: 0
|
|
2453
|
+
},
|
|
2454
|
+
g,
|
|
2455
|
+
this
|
|
2456
|
+
) : (
|
|
2457
|
+
// Default: adjust when the resize is an above-viewport item.
|
|
2458
|
+
// First measurement (!has(key)): always adjust — the item
|
|
2459
|
+
// has never been sized, so the estimate→actual delta must
|
|
2460
|
+
// be compensated regardless of scroll direction.
|
|
2461
|
+
// Re-measurement (has(key)): skip during backward scroll
|
|
2462
|
+
// to avoid the "items jump while scrolling up" cascade.
|
|
2463
|
+
r < this.getScrollOffset() + this.scrollAdjustments && (!this.itemSizeCache.has(a) || this.scrollDirection !== "backward")
|
|
2464
|
+
));
|
|
2465
|
+
(this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(a, n), this.itemSizeCacheVersion++, d ? this.applyScrollAdjustment(this.getTotalSize() - w) : p && this.applyScrollAdjustment(g), this.notify(false);
|
|
2466
|
+
}
|
|
2467
|
+
}, this.getVirtualItems = U(
|
|
2468
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
2469
|
+
(t, n) => {
|
|
2470
|
+
const s = [];
|
|
2471
|
+
for (let o = 0, l = t.length; o < l; o++) {
|
|
2472
|
+
const r = t[o], a = n[r];
|
|
2473
|
+
s.push(a);
|
|
2474
|
+
}
|
|
2475
|
+
return s;
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
2479
|
+
debug: () => this.options.debug
|
|
2480
|
+
}
|
|
2481
|
+
), this.getVirtualItemForOffset = (t) => {
|
|
2482
|
+
const n = this.getMeasurements();
|
|
2483
|
+
if (n.length === 0)
|
|
2484
|
+
return;
|
|
2485
|
+
const s = this._flatMeasurements, o = this.options.lanes === 1 && s != null, l = kt(
|
|
2486
|
+
0,
|
|
2487
|
+
n.length - 1,
|
|
2488
|
+
o ? (r) => s[r * 2] : (r) => ot(n[r]).start,
|
|
2489
|
+
t
|
|
2490
|
+
);
|
|
2491
|
+
return ot(n[l]);
|
|
2492
|
+
}, this.getMaxScrollOffset = () => {
|
|
2493
|
+
if (!this.scrollElement) return 0;
|
|
2494
|
+
if ("scrollHeight" in this.scrollElement)
|
|
2495
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
2496
|
+
{
|
|
2497
|
+
const t = this.scrollElement.document.documentElement;
|
|
2498
|
+
return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
|
|
2499
|
+
}
|
|
2500
|
+
}, this.getVirtualDistanceFromEnd = () => Math.max(
|
|
2501
|
+
this.getTotalSize() - this.getSize() - this.getScrollOffset(),
|
|
2502
|
+
0
|
|
2503
|
+
), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (t = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= t, this.getOffsetForAlignment = (t, n, s = 0) => {
|
|
2504
|
+
if (!this.scrollElement) return 0;
|
|
2505
|
+
const o = this.getSize(), l = this.getScrollOffset();
|
|
2506
|
+
n === "auto" && (n = t >= l + o ? "end" : "start"), n === "center" ? t += (s - o) / 2 : n === "end" && (t -= o);
|
|
2507
|
+
const r = this.getMaxScrollOffset();
|
|
2508
|
+
return Math.max(Math.min(r, t), 0);
|
|
2509
|
+
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
2510
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2511
|
+
const s = this.getSize(), o = this.getScrollOffset(), l = this.measurementsCache[t];
|
|
2512
|
+
if (!l) return;
|
|
2513
|
+
if (n === "auto")
|
|
2514
|
+
if (l.end >= o + s - this.options.scrollPaddingEnd)
|
|
2515
|
+
n = "end";
|
|
2516
|
+
else if (l.start <= o + this.options.scrollPaddingStart)
|
|
2517
|
+
n = "start";
|
|
2518
|
+
else
|
|
2519
|
+
return [o, n];
|
|
2520
|
+
if (n === "end" && t === this.options.count - 1)
|
|
2521
|
+
return [this.getMaxScrollOffset(), n];
|
|
2522
|
+
const r = n === "end" ? l.end + this.options.scrollPaddingEnd : l.start - this.options.scrollPaddingStart;
|
|
2523
|
+
return [
|
|
2524
|
+
this.getOffsetForAlignment(r, n, l.size),
|
|
2525
|
+
n
|
|
2526
|
+
];
|
|
2527
|
+
}, this.scrollToOffset = (t, { align: n = "start", behavior: s = "auto" } = {}) => {
|
|
2528
|
+
const o = this.getOffsetForAlignment(t, n), l = this.now();
|
|
2529
|
+
this.scrollState = {
|
|
2530
|
+
index: null,
|
|
2531
|
+
align: n,
|
|
2532
|
+
behavior: s,
|
|
2533
|
+
startedAt: l,
|
|
2534
|
+
lastTargetOffset: o,
|
|
2535
|
+
stableFrames: 0
|
|
2536
|
+
}, this._scrollToOffset(o, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
|
|
2537
|
+
}, this.scrollToIndex = (t, {
|
|
2538
|
+
align: n = "auto",
|
|
2539
|
+
behavior: s = "auto"
|
|
2540
|
+
} = {}) => {
|
|
2541
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2542
|
+
const o = this.getOffsetForIndex(t, n);
|
|
2543
|
+
if (!o)
|
|
2544
|
+
return;
|
|
2545
|
+
const [l, r] = o, a = this.now();
|
|
2546
|
+
this.scrollState = {
|
|
2547
|
+
index: t,
|
|
2548
|
+
align: r,
|
|
2549
|
+
behavior: s,
|
|
2550
|
+
startedAt: a,
|
|
2551
|
+
lastTargetOffset: l,
|
|
2552
|
+
stableFrames: 0
|
|
2553
|
+
}, this._scrollToOffset(l, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
|
|
2554
|
+
}, this.scrollBy = (t, { behavior: n = "auto" } = {}) => {
|
|
2555
|
+
const s = this.getScrollOffset() + t, o = this.now();
|
|
2556
|
+
this.scrollState = {
|
|
2557
|
+
index: null,
|
|
2558
|
+
align: "start",
|
|
2559
|
+
behavior: n,
|
|
2560
|
+
startedAt: o,
|
|
2561
|
+
lastTargetOffset: s,
|
|
2562
|
+
stableFrames: 0
|
|
2563
|
+
}, this._scrollToOffset(s, { adjustments: void 0, behavior: n }), this.scheduleScrollReconcile();
|
|
2564
|
+
}, this.scrollToEnd = ({ behavior: t = "auto" } = {}) => {
|
|
2565
|
+
if (this.options.count > 0) {
|
|
2566
|
+
this.scrollToIndex(this.options.count - 1, {
|
|
2567
|
+
align: "end",
|
|
2568
|
+
behavior: t
|
|
2569
|
+
});
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2572
|
+
this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {
|
|
2573
|
+
behavior: t
|
|
2574
|
+
});
|
|
2575
|
+
}, this.getTotalSize = () => {
|
|
2576
|
+
var t;
|
|
2577
|
+
const n = this.getMeasurements();
|
|
2578
|
+
let s;
|
|
2579
|
+
if (n.length === 0)
|
|
2580
|
+
s = this.options.paddingStart;
|
|
2581
|
+
else if (this.options.lanes === 1) {
|
|
2582
|
+
const o = n.length - 1, l = this._flatMeasurements;
|
|
2583
|
+
l != null ? s = l[o * 2] + l[o * 2 + 1] : s = ((t = n[o]) == null ? void 0 : t.end) ?? 0;
|
|
2584
|
+
} else {
|
|
2585
|
+
const o = Array(this.options.lanes).fill(null);
|
|
2586
|
+
let l = n.length - 1;
|
|
2587
|
+
for (; l >= 0 && o.some((r) => r === null); ) {
|
|
2588
|
+
const r = n[l];
|
|
2589
|
+
o[r.lane] === null && (o[r.lane] = r.end), l--;
|
|
2590
|
+
}
|
|
2591
|
+
s = Math.max(...o.filter((r) => r !== null));
|
|
2592
|
+
}
|
|
2593
|
+
return Math.max(
|
|
2594
|
+
s - this.options.scrollMargin + this.options.paddingEnd,
|
|
2595
|
+
0
|
|
2596
|
+
);
|
|
2597
|
+
}, this.takeSnapshot = () => {
|
|
2598
|
+
const t = [];
|
|
2599
|
+
if (this.itemSizeCache.size === 0) return t;
|
|
2600
|
+
const n = this.getMeasurements();
|
|
2601
|
+
for (const s of n)
|
|
2602
|
+
s && this.itemSizeCache.has(s.key) && t.push({
|
|
2603
|
+
index: s.index,
|
|
2604
|
+
key: s.key,
|
|
2605
|
+
start: s.start,
|
|
2606
|
+
size: s.size,
|
|
2607
|
+
end: s.end,
|
|
2608
|
+
lane: s.lane
|
|
2609
|
+
});
|
|
2610
|
+
return t;
|
|
2611
|
+
}, this._scrollToOffset = (t, {
|
|
2612
|
+
adjustments: n,
|
|
2613
|
+
behavior: s
|
|
2614
|
+
}) => {
|
|
2615
|
+
this._intendedScrollOffset = t + (n ?? 0), this.options.scrollToFn(t, { behavior: s, adjustments: n }, this);
|
|
2616
|
+
}, this.measure = () => {
|
|
2617
|
+
this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(false);
|
|
2618
|
+
}, this.setOptions(i);
|
|
2619
|
+
}
|
|
2620
|
+
applyScrollAdjustment(i, t) {
|
|
2621
|
+
i !== 0 && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", i), xe() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? this._iosDeferredAdjustment += i : this._scrollToOffset(this.getScrollOffset(), {
|
|
2622
|
+
adjustments: this.scrollAdjustments += i,
|
|
2623
|
+
behavior: t
|
|
2624
|
+
}));
|
|
2625
|
+
}
|
|
2626
|
+
scheduleScrollReconcile() {
|
|
2627
|
+
if (!this.targetWindow) {
|
|
2628
|
+
this.scrollState = null;
|
|
2629
|
+
return;
|
|
2630
|
+
}
|
|
2631
|
+
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
2632
|
+
this.rafId = null, this.reconcileScroll();
|
|
2633
|
+
}));
|
|
2634
|
+
}
|
|
2635
|
+
reconcileScroll() {
|
|
2636
|
+
if (!this.scrollState || !this.scrollElement) return;
|
|
2637
|
+
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
2638
|
+
this.scrollState = null;
|
|
2639
|
+
return;
|
|
2640
|
+
}
|
|
2641
|
+
const n = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, s = n ? n[0] : this.scrollState.lastTargetOffset, o = 1, l = s !== this.scrollState.lastTargetOffset;
|
|
2642
|
+
if (!l && Ws(s, this.getScrollOffset())) {
|
|
2643
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= o) {
|
|
2644
|
+
this.getScrollOffset() !== s && this._scrollToOffset(s, {
|
|
2645
|
+
adjustments: void 0,
|
|
2646
|
+
behavior: "auto"
|
|
2647
|
+
}), this.scrollState = null;
|
|
2648
|
+
return;
|
|
2649
|
+
}
|
|
2650
|
+
} else if (this.scrollState.stableFrames = 0, l) {
|
|
2651
|
+
const r = this.getSize() || 600, a = Math.abs(s - this.getScrollOffset()), c = this.scrollState.behavior === "smooth" && a > r;
|
|
2652
|
+
this.scrollState.lastTargetOffset = s, c || (this.scrollState.behavior = "auto"), this._scrollToOffset(s, {
|
|
2653
|
+
adjustments: void 0,
|
|
2654
|
+
behavior: c ? "smooth" : "auto"
|
|
2655
|
+
});
|
|
2656
|
+
}
|
|
2657
|
+
this.scheduleScrollReconcile();
|
|
2658
|
+
}
|
|
2659
|
+
};
|
|
2660
|
+
var kt = (e, i, t, n) => {
|
|
2661
|
+
for (; e <= i; ) {
|
|
2662
|
+
const s = (e + i) / 2 | 0, o = t(s);
|
|
2663
|
+
if (o < n)
|
|
2664
|
+
e = s + 1;
|
|
2665
|
+
else if (o > n)
|
|
2666
|
+
i = s - 1;
|
|
2667
|
+
else
|
|
2668
|
+
return s;
|
|
2669
|
+
}
|
|
2670
|
+
return e > 0 ? e - 1 : 0;
|
|
2671
|
+
};
|
|
2672
|
+
function ti({
|
|
2673
|
+
measurements: e,
|
|
2674
|
+
outerSize: i,
|
|
2675
|
+
scrollOffset: t,
|
|
2676
|
+
lanes: n,
|
|
2677
|
+
flat: s
|
|
2678
|
+
}) {
|
|
2679
|
+
const o = e.length - 1, l = s ? (u) => s[u * 2] : (u) => e[u].start, r = s ? (u) => s[u * 2] + s[u * 2 + 1] : (u) => e[u].end;
|
|
2680
|
+
if (e.length <= n)
|
|
2681
|
+
return {
|
|
2682
|
+
startIndex: 0,
|
|
2683
|
+
endIndex: o
|
|
2684
|
+
};
|
|
2685
|
+
let a = kt(0, o, l, t), c = a;
|
|
2686
|
+
if (n === 1)
|
|
2687
|
+
for (; c < o && r(c) < t + i; )
|
|
2688
|
+
c++;
|
|
2689
|
+
else if (n > 1) {
|
|
2690
|
+
const u = Array(n).fill(0);
|
|
2691
|
+
for (; c < o && u.some((d) => d < t + i); ) {
|
|
2692
|
+
const d = e[c];
|
|
2693
|
+
u[d.lane] = d.end, c++;
|
|
2694
|
+
}
|
|
2695
|
+
const g = Array(n).fill(t + i);
|
|
2696
|
+
for (; a >= 0 && g.some((d) => d >= t); ) {
|
|
2697
|
+
const d = e[a];
|
|
2698
|
+
g[d.lane] = d.start, a--;
|
|
2699
|
+
}
|
|
2700
|
+
a = Math.max(0, a - a % n), c = Math.min(o, c + (n - 1 - c % n));
|
|
2701
|
+
}
|
|
2702
|
+
return { startIndex: a, endIndex: c };
|
|
2703
|
+
}
|
|
2704
|
+
function ni(e) {
|
|
2705
|
+
const i = new ei(m(e)), t = zt(i), n = i._didMount();
|
|
2706
|
+
return ae(
|
|
2707
|
+
() => m(e).getScrollElement(),
|
|
2708
|
+
(s) => {
|
|
2709
|
+
s && i._willUpdate();
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
immediate: true
|
|
2713
|
+
}
|
|
2714
|
+
), ae(
|
|
2715
|
+
() => m(e),
|
|
2716
|
+
(s) => {
|
|
2717
|
+
i.setOptions({
|
|
2718
|
+
...s,
|
|
2719
|
+
onChange: (o, l) => {
|
|
2720
|
+
var r;
|
|
2721
|
+
Ve(t), (r = s.onChange) == null || r.call(s, o, l);
|
|
2722
|
+
}
|
|
2723
|
+
}), i._willUpdate(), Ve(t);
|
|
2724
|
+
},
|
|
2725
|
+
{
|
|
2726
|
+
immediate: true
|
|
2727
|
+
}
|
|
2728
|
+
), he(n), t;
|
|
2729
|
+
}
|
|
2730
|
+
function si(e) {
|
|
2731
|
+
return ni(
|
|
2732
|
+
O(() => ({
|
|
2733
|
+
observeElementRect: Us,
|
|
2734
|
+
observeElementOffset: Qs,
|
|
2735
|
+
scrollToFn: Zs,
|
|
2736
|
+
...m(e)
|
|
2737
|
+
}))
|
|
2738
|
+
);
|
|
2739
|
+
}
|
|
2740
|
+
function ii() {
|
|
2741
|
+
return {
|
|
2742
|
+
instances: at,
|
|
2743
|
+
requests: qe,
|
|
2744
|
+
getRequestsByInstance: Nt
|
|
2745
|
+
};
|
|
2746
|
+
}
|
|
2747
|
+
var oi = /* @__PURE__ */ $({
|
|
2748
|
+
__name: "Badge",
|
|
2749
|
+
props: {
|
|
2750
|
+
label: {},
|
|
2751
|
+
variant: {}
|
|
2752
|
+
},
|
|
2753
|
+
setup(e) {
|
|
2754
|
+
const i = {
|
|
2755
|
+
success: "bg-green-900 text-green-300",
|
|
2756
|
+
error: "bg-red-900 text-red-300",
|
|
2757
|
+
pending: "bg-yellow-900 text-yellow-300",
|
|
2758
|
+
aborted: "bg-neutral-700 text-neutral-400",
|
|
2759
|
+
neutral: "bg-neutral-800 text-neutral-300"
|
|
2760
|
+
};
|
|
2761
|
+
return (t, n) => (h(), y("span", {
|
|
2762
|
+
class: P([
|
|
2763
|
+
"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono",
|
|
2764
|
+
i[e.variant ?? "neutral"]
|
|
2765
|
+
])
|
|
2766
|
+
}, C(e.label), 3));
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
var li = /* @__PURE__ */ $({
|
|
2770
|
+
__name: "StatusBadge",
|
|
2771
|
+
props: {
|
|
2772
|
+
status: {},
|
|
2773
|
+
statusCode: {}
|
|
2774
|
+
},
|
|
2775
|
+
setup(e) {
|
|
2776
|
+
const i = {
|
|
2777
|
+
success: "success",
|
|
2778
|
+
error: "error",
|
|
2779
|
+
pending: "pending",
|
|
2780
|
+
aborted: "aborted"
|
|
2781
|
+
};
|
|
2782
|
+
return (t, n) => (h(), F(oi, {
|
|
2783
|
+
label: e.statusCode ? String(e.statusCode) : e.status,
|
|
2784
|
+
variant: i[e.status]
|
|
2785
|
+
}, null, 8, ["label", "variant"]));
|
|
2786
|
+
}
|
|
2787
|
+
});
|
|
2788
|
+
var ri = {
|
|
2789
|
+
key: 0,
|
|
2790
|
+
class: "feature-badges"
|
|
2791
|
+
};
|
|
2792
|
+
var ai = /* @__PURE__ */ $({
|
|
2793
|
+
__name: "FeatureBadges",
|
|
2794
|
+
props: {
|
|
2795
|
+
options: {}
|
|
2796
|
+
},
|
|
2797
|
+
setup(e) {
|
|
2798
|
+
const i = e, t = O(() => {
|
|
2799
|
+
const n = [], { cache: s, poll: o, retry: l, batch: r, debounce: a, immediate: c, lazy: u } = i.options;
|
|
2800
|
+
if (s) {
|
|
2801
|
+
const g = typeof s == "string" ? s : s.id;
|
|
2802
|
+
n.push({ key: "cache", label: "cache", sub: g, variant: "cache" }), typeof s == "object" && s.swr && n.push({ key: "swr", label: "swr", variant: "swr" });
|
|
2803
|
+
}
|
|
2804
|
+
return o && n.push({ key: "polling", label: "polling", variant: "polling" }), l && n.push({ key: "retry", label: "retry", variant: "retry" }), r && n.push({ key: "batch", label: "batch", variant: "batch" }), a && n.push({ key: "debounce", label: "debounce", variant: "debounce" }), (!c || u) && n.push({ key: "lazy", label: "lazy", variant: "lazy" }), n;
|
|
2805
|
+
});
|
|
2806
|
+
return (n, s) => t.value.length ? (h(), y("div", ri, [
|
|
2807
|
+
(h(true), y(N, null, W(t.value, (o) => (h(), y("span", {
|
|
2808
|
+
key: o.key,
|
|
2809
|
+
class: P(["badge", `badge--${o.variant}`])
|
|
2810
|
+
}, [
|
|
2811
|
+
ce(C(o.label), 1),
|
|
2812
|
+
o.sub ? (h(), y(N, { key: 0 }, [
|
|
2813
|
+
s[0] || (s[0] = f("span", { class: "sep" }, "\xB7", -1)),
|
|
2814
|
+
ce(C(o.sub), 1)
|
|
2815
|
+
], 64)) : M("", true)
|
|
2816
|
+
], 2))), 128))
|
|
2817
|
+
])) : M("", true);
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
var _t = /* @__PURE__ */ j(ai, [["__scopeId", "data-v-99118e1d"]]);
|
|
2821
|
+
var ci = { class: "row-body" };
|
|
2822
|
+
var ui = { class: "row-top" };
|
|
2823
|
+
var di = { class: "row-url" };
|
|
2824
|
+
var hi = { class: "row-meta" };
|
|
2825
|
+
var fi = { class: "meta-duration" };
|
|
2826
|
+
var pi = { class: "meta-time" };
|
|
2827
|
+
var mi = /* @__PURE__ */ $({
|
|
2828
|
+
__name: "RequestRow",
|
|
2829
|
+
props: {
|
|
2830
|
+
request: {},
|
|
2831
|
+
isActive: { type: Boolean },
|
|
2832
|
+
instanceOptions: {}
|
|
2833
|
+
},
|
|
2834
|
+
emits: ["select"],
|
|
2835
|
+
setup(e) {
|
|
2836
|
+
function i(n) {
|
|
2837
|
+
return n === null ? "\u2026" : n < 1e3 ? `${n}ms` : `${(n / 1e3).toFixed(2)}s`;
|
|
2838
|
+
}
|
|
2839
|
+
function t(n) {
|
|
2840
|
+
return new Date(n).toLocaleTimeString();
|
|
2841
|
+
}
|
|
2842
|
+
return (n, s) => (h(), y("div", {
|
|
2843
|
+
"data-vmd-request-row": "",
|
|
2844
|
+
class: P(["request-row", { "request-row--active": e.isActive }]),
|
|
2845
|
+
onClick: s[0] || (s[0] = (o) => n.$emit("select", e.request.id))
|
|
2846
|
+
}, [
|
|
2847
|
+
f("div", {
|
|
2848
|
+
class: P(["accent-bar", `accent-bar--${e.request.status}`])
|
|
2849
|
+
}, null, 2),
|
|
2850
|
+
f("div", ci, [
|
|
2851
|
+
f("div", ui, [
|
|
2852
|
+
f("span", {
|
|
2853
|
+
class: P(["method-badge", `method-${e.request.method.toLowerCase()}`])
|
|
2854
|
+
}, C(e.request.method), 3),
|
|
2855
|
+
f("span", di, C(e.request.url), 1),
|
|
2856
|
+
e.instanceOptions ? (h(), F(_t, {
|
|
2857
|
+
key: 0,
|
|
2858
|
+
options: e.instanceOptions
|
|
2859
|
+
}, null, 8, ["options"])) : M("", true)
|
|
2860
|
+
]),
|
|
2861
|
+
f("div", hi, [
|
|
2862
|
+
L(li, {
|
|
2863
|
+
status: e.request.status,
|
|
2864
|
+
"status-code": e.request.statusCode
|
|
2865
|
+
}, null, 8, ["status", "status-code"]),
|
|
2866
|
+
f("span", fi, C(i(e.request.duration)), 1),
|
|
2867
|
+
f("span", pi, C(t(e.request.startedAt)), 1)
|
|
2868
|
+
])
|
|
2869
|
+
])
|
|
2870
|
+
], 2));
|
|
2871
|
+
}
|
|
2872
|
+
});
|
|
2873
|
+
var vi = /* @__PURE__ */ j(mi, [["__scopeId", "data-v-e5492c3f"]]);
|
|
2874
|
+
var gi = /* @__PURE__ */ $({
|
|
2875
|
+
__name: "RequestList",
|
|
2876
|
+
props: {
|
|
2877
|
+
requests: {},
|
|
2878
|
+
activeRequestId: {}
|
|
2879
|
+
},
|
|
2880
|
+
emits: ["select"],
|
|
2881
|
+
setup(e) {
|
|
2882
|
+
const i = e, { instances: t } = ii();
|
|
2883
|
+
function n(l) {
|
|
2884
|
+
var r;
|
|
2885
|
+
if (l)
|
|
2886
|
+
return (r = t.value.get(l)) == null ? void 0 : r.options;
|
|
2887
|
+
}
|
|
2888
|
+
const s = q(null), o = si(
|
|
2889
|
+
O(() => ({
|
|
2890
|
+
count: i.requests.length,
|
|
2891
|
+
getScrollElement: () => s.value,
|
|
2892
|
+
estimateSize: () => 52,
|
|
2893
|
+
overscan: 10
|
|
2894
|
+
}))
|
|
2895
|
+
);
|
|
2896
|
+
return (l, r) => (h(), y("div", {
|
|
2897
|
+
ref_key: "parentRef",
|
|
2898
|
+
ref: s,
|
|
2899
|
+
style: { flex: "1", overflow: "auto", background: "var(--dt-background)" }
|
|
2900
|
+
}, [
|
|
2901
|
+
f("div", {
|
|
2902
|
+
style: K({ height: `${m(o).getTotalSize()}px`, position: "relative" })
|
|
2903
|
+
}, [
|
|
2904
|
+
(h(true), y(N, null, W(m(o).getVirtualItems(), (a) => (h(), y("div", {
|
|
2905
|
+
key: a.index,
|
|
2906
|
+
style: K({ position: "absolute", top: 0, left: 0, width: "100%", transform: `translateY(${a.start}px)` })
|
|
2907
|
+
}, [
|
|
2908
|
+
L(vi, {
|
|
2909
|
+
request: e.requests[a.index],
|
|
2910
|
+
"is-active": e.requests[a.index].id === e.activeRequestId,
|
|
2911
|
+
"instance-options": n(e.requests[a.index].instanceId),
|
|
2912
|
+
onSelect: r[0] || (r[0] = (c) => l.$emit("select", c))
|
|
2913
|
+
}, null, 8, ["request", "is-active", "instance-options"])
|
|
2914
|
+
], 4))), 128))
|
|
2915
|
+
], 4)
|
|
2916
|
+
], 512));
|
|
2917
|
+
}
|
|
2918
|
+
});
|
|
2919
|
+
var yi = { class: "detail-header" };
|
|
2920
|
+
var bi = { class: "req-method" };
|
|
2921
|
+
var wi = ["title"];
|
|
2922
|
+
var Si = { class: "req-meta" };
|
|
2923
|
+
var xi = { key: 0 };
|
|
2924
|
+
var ki = /* @__PURE__ */ $({
|
|
2925
|
+
__name: "DetailHeader",
|
|
2926
|
+
props: {
|
|
2927
|
+
request: {},
|
|
2928
|
+
instanceOptions: {}
|
|
2929
|
+
},
|
|
2930
|
+
emits: ["close"],
|
|
2931
|
+
setup(e) {
|
|
2932
|
+
function i(t) {
|
|
2933
|
+
return t ? t < 300 ? "s-2xx" : t < 400 ? "s-3xx" : t < 500 ? "s-4xx" : "s-5xx" : "s-pending";
|
|
2934
|
+
}
|
|
2935
|
+
return (t, n) => (h(), y("div", yi, [
|
|
2936
|
+
f("span", {
|
|
2937
|
+
class: P(["status-chip", i(e.request.statusCode)])
|
|
2938
|
+
}, C(e.request.statusCode ?? "\xB7\xB7\xB7"), 3),
|
|
2939
|
+
f("span", bi, C(e.request.method), 1),
|
|
2940
|
+
f("span", {
|
|
2941
|
+
class: "req-url",
|
|
2942
|
+
title: e.request.url
|
|
2943
|
+
}, C(e.request.url), 9, wi),
|
|
2944
|
+
e.instanceOptions ? (h(), F(_t, {
|
|
2945
|
+
key: 0,
|
|
2946
|
+
options: e.instanceOptions
|
|
2947
|
+
}, null, 8, ["options"])) : M("", true),
|
|
2948
|
+
f("div", Si, [
|
|
2949
|
+
e.request.duration !== null ? (h(), y("span", xi, C(e.request.duration) + "ms", 1)) : M("", true),
|
|
2950
|
+
f("span", null, C(new Date(e.request.startedAt).toLocaleTimeString()), 1)
|
|
2951
|
+
]),
|
|
2952
|
+
f("button", {
|
|
2953
|
+
class: "close-btn",
|
|
2954
|
+
"aria-label": "Close detail",
|
|
2955
|
+
onClick: n[0] || (n[0] = (s) => t.$emit("close"))
|
|
2956
|
+
}, [
|
|
2957
|
+
L(m(re), {
|
|
2958
|
+
icon: "lucide:x",
|
|
2959
|
+
width: "14",
|
|
2960
|
+
height: "14"
|
|
2961
|
+
})
|
|
2962
|
+
])
|
|
2963
|
+
]));
|
|
2964
|
+
}
|
|
2965
|
+
});
|
|
2966
|
+
var _i = /* @__PURE__ */ j(ki, [["__scopeId", "data-v-ee649b7a"]]);
|
|
2967
|
+
var Ii = { class: "detail-tabs" };
|
|
2968
|
+
var Ei = ["onClick"];
|
|
2969
|
+
var Ti = /* @__PURE__ */ $({
|
|
2970
|
+
__name: "DetailTabs",
|
|
2971
|
+
props: {
|
|
2972
|
+
activeTab: {}
|
|
2973
|
+
},
|
|
2974
|
+
emits: ["select"],
|
|
2975
|
+
setup(e) {
|
|
2976
|
+
const i = [
|
|
2977
|
+
{ id: "split", label: "Split" },
|
|
2978
|
+
{ id: "payload", label: "Payload" },
|
|
2979
|
+
{ id: "response", label: "Response" },
|
|
2980
|
+
{ id: "headers", label: "Headers" }
|
|
2981
|
+
];
|
|
2982
|
+
return (t, n) => (h(), y("div", Ii, [
|
|
2983
|
+
(h(), y(N, null, W(i, (s) => f("button", {
|
|
2984
|
+
key: s.id,
|
|
2985
|
+
class: P(["tab-btn", { "tab-btn--active": s.id === e.activeTab }]),
|
|
2986
|
+
onClick: (o) => t.$emit("select", s.id)
|
|
2987
|
+
}, C(s.label), 11, Ei)), 64))
|
|
2988
|
+
]));
|
|
2989
|
+
}
|
|
2990
|
+
});
|
|
2991
|
+
var Mi = /* @__PURE__ */ j(Ti, [["__scopeId", "data-v-c3c26245"]]);
|
|
2992
|
+
var Ci = ["innerHTML"];
|
|
2993
|
+
var Oi = /* @__PURE__ */ $({
|
|
2994
|
+
__name: "JsonViewer",
|
|
2995
|
+
props: {
|
|
2996
|
+
value: {}
|
|
2997
|
+
},
|
|
2998
|
+
setup(e) {
|
|
2999
|
+
const i = e;
|
|
3000
|
+
function t(s) {
|
|
3001
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3002
|
+
}
|
|
3003
|
+
const n = O(() => {
|
|
3004
|
+
try {
|
|
3005
|
+
return t(JSON.stringify(i.value, null, 2)).replace(
|
|
3006
|
+
/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
|
|
3007
|
+
(o) => /^"/.test(o) ? /:$/.test(o) ? `<span class="json-key">${o}</span>` : `<span class="json-string">${o}</span>` : /true|false|null/.test(o) ? `<span class="json-bool">${o}</span>` : `<span class="json-number">${o}</span>`
|
|
3008
|
+
);
|
|
3009
|
+
} catch {
|
|
3010
|
+
return String(i.value);
|
|
3011
|
+
}
|
|
3012
|
+
});
|
|
3013
|
+
return (s, o) => (h(), y("pre", {
|
|
3014
|
+
class: "json-root",
|
|
3015
|
+
innerHTML: n.value
|
|
3016
|
+
}, null, 8, Ci));
|
|
3017
|
+
}
|
|
3018
|
+
});
|
|
3019
|
+
var Me = /* @__PURE__ */ j(Oi, [["__scopeId", "data-v-4994acd4"]]);
|
|
3020
|
+
var zi = { class: "tree-node" };
|
|
3021
|
+
var Ai = {
|
|
3022
|
+
key: 0,
|
|
3023
|
+
class: "tree-key"
|
|
3024
|
+
};
|
|
3025
|
+
var qi = {
|
|
3026
|
+
key: 1,
|
|
3027
|
+
class: "tree-colon"
|
|
3028
|
+
};
|
|
3029
|
+
var $i = { name: "TreeNode" };
|
|
3030
|
+
var Li = /* @__PURE__ */ $({
|
|
3031
|
+
...$i,
|
|
3032
|
+
props: {
|
|
3033
|
+
nodeKey: {},
|
|
3034
|
+
value: {},
|
|
3035
|
+
depth: {}
|
|
3036
|
+
},
|
|
3037
|
+
setup(e) {
|
|
3038
|
+
const i = e, t = q(false), n = O(
|
|
3039
|
+
() => typeof i.value == "object" && i.value !== null
|
|
3040
|
+
), s = O(() => Array.isArray(i.value)), o = O(() => n.value ? s.value ? `Array [${i.value.length}]` : `Object {${Object.keys(i.value).length}}` : ""), l = O(() => !t.value || !n.value ? [] : s.value ? i.value.map((g, d) => [d, g]) : Object.entries(i.value)), r = O(() => i.value === null ? "null" : typeof i.value == "string" ? `"${i.value}"` : String(i.value)), a = O(() => i.value === null ? "tree-val tree-val--null" : typeof i.value == "string" ? "tree-val tree-val--string" : typeof i.value == "number" ? "tree-val tree-val--number" : typeof i.value == "boolean" ? "tree-val tree-val--boolean" : "tree-val"), c = O(() => i.depth * 14);
|
|
3041
|
+
function u() {
|
|
3042
|
+
n.value && (t.value = !t.value);
|
|
3043
|
+
}
|
|
3044
|
+
return (g, d) => {
|
|
3045
|
+
const w = At("TreeNode", true);
|
|
3046
|
+
return h(), y("div", zi, [
|
|
3047
|
+
f("div", {
|
|
3048
|
+
class: "tree-row",
|
|
3049
|
+
style: K({ paddingLeft: c.value + "px" })
|
|
3050
|
+
}, [
|
|
3051
|
+
f("span", {
|
|
3052
|
+
class: P(["tree-arrow", { "tree-arrow--open": t.value }]),
|
|
3053
|
+
style: K({ visibility: n.value ? "visible" : "hidden" }),
|
|
3054
|
+
onClick: u
|
|
3055
|
+
}, null, 6),
|
|
3056
|
+
e.nodeKey !== null ? (h(), y("span", Ai, C(e.nodeKey), 1)) : M("", true),
|
|
3057
|
+
e.nodeKey !== null ? (h(), y("span", qi, ":")) : M("", true),
|
|
3058
|
+
n.value ? (h(), y("span", {
|
|
3059
|
+
key: 2,
|
|
3060
|
+
class: "tree-badge",
|
|
3061
|
+
onClick: u
|
|
3062
|
+
}, C(o.value), 1)) : (h(), y("span", {
|
|
3063
|
+
key: 3,
|
|
3064
|
+
class: P(a.value)
|
|
3065
|
+
}, C(r.value), 3))
|
|
3066
|
+
], 4),
|
|
3067
|
+
(h(true), y(N, null, W(l.value, ([p, b]) => (h(), F(w, {
|
|
3068
|
+
key: p,
|
|
3069
|
+
"node-key": p,
|
|
3070
|
+
value: b,
|
|
3071
|
+
depth: e.depth + 1
|
|
3072
|
+
}, null, 8, ["node-key", "value", "depth"]))), 128))
|
|
3073
|
+
]);
|
|
3074
|
+
};
|
|
3075
|
+
}
|
|
3076
|
+
});
|
|
3077
|
+
var Fi = /* @__PURE__ */ j(Li, [["__scopeId", "data-v-e08fddee"]]);
|
|
3078
|
+
var Pi = { class: "tree-viewer" };
|
|
3079
|
+
var Ri = /* @__PURE__ */ $({
|
|
3080
|
+
__name: "TreeViewer",
|
|
3081
|
+
props: {
|
|
3082
|
+
value: {}
|
|
3083
|
+
},
|
|
3084
|
+
setup(e) {
|
|
3085
|
+
const i = e, t = O(() => i.value === null || i.value === void 0 ? [] : Array.isArray(i.value) ? i.value.map((n, s) => [s, n]) : typeof i.value == "object" ? Object.entries(i.value) : []);
|
|
3086
|
+
return (n, s) => (h(), y("div", Pi, [
|
|
3087
|
+
(h(true), y(N, null, W(t.value, ([o, l]) => (h(), F(Fi, {
|
|
3088
|
+
key: o,
|
|
3089
|
+
"node-key": o,
|
|
3090
|
+
value: l,
|
|
3091
|
+
depth: 0
|
|
3092
|
+
}, null, 8, ["node-key", "value"]))), 128))
|
|
3093
|
+
]));
|
|
3094
|
+
}
|
|
3095
|
+
});
|
|
3096
|
+
var Ce = /* @__PURE__ */ j(Ri, [["__scopeId", "data-v-f9bec403"]]);
|
|
3097
|
+
var ji = { class: "data-pane" };
|
|
3098
|
+
var Di = { class: "pane-header" };
|
|
3099
|
+
var Vi = { class: "pane-title" };
|
|
3100
|
+
var Ni = { class: "pane-body" };
|
|
3101
|
+
var Wi = {
|
|
3102
|
+
key: 0,
|
|
3103
|
+
class: "truncated-warning"
|
|
3104
|
+
};
|
|
3105
|
+
var Hi = /* @__PURE__ */ $({
|
|
3106
|
+
__name: "DataPane",
|
|
3107
|
+
props: {
|
|
3108
|
+
title: {},
|
|
3109
|
+
data: {},
|
|
3110
|
+
truncated: { type: Boolean }
|
|
3111
|
+
},
|
|
3112
|
+
setup(e) {
|
|
3113
|
+
const i = e, t = q("json");
|
|
3114
|
+
X(async () => {
|
|
3115
|
+
t.value = await hn();
|
|
3116
|
+
});
|
|
3117
|
+
async function n() {
|
|
3118
|
+
t.value = t.value === "kv" ? "json" : "kv", await fn(t.value);
|
|
3119
|
+
}
|
|
3120
|
+
async function s() {
|
|
3121
|
+
try {
|
|
3122
|
+
await navigator.clipboard.writeText(JSON.stringify(i.data, null, 2));
|
|
3123
|
+
} catch {
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
return (o, l) => (h(), y("div", ji, [
|
|
3127
|
+
f("div", Di, [
|
|
3128
|
+
f("span", Vi, C(e.title), 1),
|
|
3129
|
+
f("button", {
|
|
3130
|
+
class: P(["pane-action", { "pane-action--active": t.value === "kv" }]),
|
|
3131
|
+
onClick: n
|
|
3132
|
+
}, "KV", 2),
|
|
3133
|
+
f("button", {
|
|
3134
|
+
class: "pane-action",
|
|
3135
|
+
onClick: s
|
|
3136
|
+
}, "Copy")
|
|
3137
|
+
]),
|
|
3138
|
+
f("div", Ni, [
|
|
3139
|
+
e.truncated ? (h(), y("p", Wi, "[truncated]")) : M("", true),
|
|
3140
|
+
t.value === "json" ? (h(), F(Me, {
|
|
3141
|
+
key: 1,
|
|
3142
|
+
value: e.data
|
|
3143
|
+
}, null, 8, ["value"])) : (h(), F(Ce, {
|
|
3144
|
+
key: 2,
|
|
3145
|
+
value: e.data
|
|
3146
|
+
}, null, 8, ["value"]))
|
|
3147
|
+
])
|
|
3148
|
+
]));
|
|
3149
|
+
}
|
|
3150
|
+
});
|
|
3151
|
+
var It = /* @__PURE__ */ j(Hi, [["__scopeId", "data-v-fe53a363"]]);
|
|
3152
|
+
var Bi = { class: "payload-pane" };
|
|
3153
|
+
var Ki = { class: "pane-header" };
|
|
3154
|
+
var Ui = { class: "section-label" };
|
|
3155
|
+
var Ji = {
|
|
3156
|
+
key: 0,
|
|
3157
|
+
class: "section-count"
|
|
3158
|
+
};
|
|
3159
|
+
var Xi = {
|
|
3160
|
+
key: 0,
|
|
3161
|
+
class: "section-body"
|
|
3162
|
+
};
|
|
3163
|
+
var Qi = {
|
|
3164
|
+
key: 1,
|
|
3165
|
+
class: "section-empty"
|
|
3166
|
+
};
|
|
3167
|
+
var Gi = {
|
|
3168
|
+
key: 2,
|
|
3169
|
+
class: "section-body"
|
|
3170
|
+
};
|
|
3171
|
+
var Yi = {
|
|
3172
|
+
key: 0,
|
|
3173
|
+
class: "truncated-warning"
|
|
3174
|
+
};
|
|
3175
|
+
var Zi = {
|
|
3176
|
+
key: 3,
|
|
3177
|
+
class: "section-empty"
|
|
3178
|
+
};
|
|
3179
|
+
var eo = /* @__PURE__ */ $({
|
|
3180
|
+
__name: "PayloadPane",
|
|
3181
|
+
props: {
|
|
3182
|
+
queryParams: {},
|
|
3183
|
+
payload: {},
|
|
3184
|
+
truncated: { type: Boolean }
|
|
3185
|
+
},
|
|
3186
|
+
setup(e) {
|
|
3187
|
+
const i = e, t = q("kv"), n = O(() => i.queryParams === null || i.queryParams === void 0 || typeof i.queryParams != "object" ? [] : Object.keys(i.queryParams)), s = O(() => n.value.length > 0), o = O(() => n.value.length), l = O(() => i.payload !== null && i.payload !== void 0);
|
|
3188
|
+
X(async () => {
|
|
3189
|
+
t.value = await un();
|
|
3190
|
+
});
|
|
3191
|
+
async function r() {
|
|
3192
|
+
t.value = t.value === "kv" ? "json" : "kv", await dn(t.value);
|
|
3193
|
+
}
|
|
3194
|
+
async function a() {
|
|
3195
|
+
try {
|
|
3196
|
+
await navigator.clipboard.writeText(JSON.stringify(i.payload, null, 2));
|
|
3197
|
+
} catch {
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
return (c, u) => (h(), y("div", Bi, [
|
|
3201
|
+
f("div", Ki, [
|
|
3202
|
+
u[0] || (u[0] = f("span", { class: "pane-title" }, "PAYLOAD", -1)),
|
|
3203
|
+
f("button", {
|
|
3204
|
+
class: P(["pane-action", { "pane-action--active": t.value === "kv" }]),
|
|
3205
|
+
onClick: r
|
|
3206
|
+
}, "KV", 2),
|
|
3207
|
+
f("button", {
|
|
3208
|
+
class: "pane-action",
|
|
3209
|
+
onClick: a
|
|
3210
|
+
}, "Copy")
|
|
3211
|
+
]),
|
|
3212
|
+
f("div", Ui, [
|
|
3213
|
+
u[1] || (u[1] = f("span", null, "Query Params", -1)),
|
|
3214
|
+
s.value ? (h(), y("span", Ji, C(o.value), 1)) : M("", true)
|
|
3215
|
+
]),
|
|
3216
|
+
s.value ? (h(), y("div", Xi, [
|
|
3217
|
+
t.value === "kv" ? (h(), F(Ce, {
|
|
3218
|
+
key: 0,
|
|
3219
|
+
value: e.queryParams
|
|
3220
|
+
}, null, 8, ["value"])) : (h(), F(Me, {
|
|
3221
|
+
key: 1,
|
|
3222
|
+
value: e.queryParams
|
|
3223
|
+
}, null, 8, ["value"]))
|
|
3224
|
+
])) : (h(), y("p", Qi, "No params")),
|
|
3225
|
+
u[2] || (u[2] = f("div", { class: "section-divider" }, null, -1)),
|
|
3226
|
+
u[3] || (u[3] = f("div", { class: "section-label" }, [
|
|
3227
|
+
f("span", null, "Body")
|
|
3228
|
+
], -1)),
|
|
3229
|
+
l.value ? (h(), y("div", Gi, [
|
|
3230
|
+
e.truncated ? (h(), y("p", Yi, "[truncated]")) : M("", true),
|
|
3231
|
+
t.value === "kv" ? (h(), F(Ce, {
|
|
3232
|
+
key: 1,
|
|
3233
|
+
value: e.payload
|
|
3234
|
+
}, null, 8, ["value"])) : (h(), F(Me, {
|
|
3235
|
+
key: 2,
|
|
3236
|
+
value: e.payload
|
|
3237
|
+
}, null, 8, ["value"]))
|
|
3238
|
+
])) : (h(), y("p", Zi, "No body"))
|
|
3239
|
+
]));
|
|
3240
|
+
}
|
|
3241
|
+
});
|
|
3242
|
+
var Et = /* @__PURE__ */ j(eo, [["__scopeId", "data-v-052714ff"]]);
|
|
3243
|
+
var to = { class: "split-pane" };
|
|
3244
|
+
var no = /* @__PURE__ */ $({
|
|
3245
|
+
__name: "SplitView",
|
|
3246
|
+
props: {
|
|
3247
|
+
request: {}
|
|
3248
|
+
},
|
|
3249
|
+
setup(e) {
|
|
3250
|
+
const { panelMode: i } = fe(), t = O(() => i.value === "side"), n = q(null), s = q(null);
|
|
3251
|
+
let o = null;
|
|
3252
|
+
ae(t, () => {
|
|
3253
|
+
n.value = null;
|
|
3254
|
+
}), X(async () => {
|
|
3255
|
+
const r = await an();
|
|
3256
|
+
r !== void 0 && (n.value = r);
|
|
3257
|
+
});
|
|
3258
|
+
function l(r) {
|
|
3259
|
+
const a = s.value;
|
|
3260
|
+
if (a) {
|
|
3261
|
+
if (t.value) {
|
|
3262
|
+
let c = function(w) {
|
|
3263
|
+
const p = a.offsetHeight - 80 - 5;
|
|
3264
|
+
n.value = Math.max(80, Math.min(d + (w.clientY - g), p));
|
|
3265
|
+
}, u = function() {
|
|
3266
|
+
window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", u), o = null;
|
|
3267
|
+
};
|
|
3268
|
+
const g = r.clientY, d = n.value ?? a.offsetHeight / 2;
|
|
3269
|
+
window.addEventListener("mousemove", c), window.addEventListener("mouseup", u), o = () => {
|
|
3270
|
+
window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", u);
|
|
3271
|
+
};
|
|
3272
|
+
} else {
|
|
3273
|
+
let c = function(w) {
|
|
3274
|
+
const p = a.offsetWidth - 120 - 5;
|
|
3275
|
+
n.value = Math.max(120, Math.min(d + (w.clientX - g), p));
|
|
3276
|
+
}, u = function() {
|
|
3277
|
+
window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", u), o = null, cn(n.value);
|
|
3278
|
+
};
|
|
3279
|
+
const g = r.clientX, d = n.value ?? a.offsetWidth / 2;
|
|
3280
|
+
window.addEventListener("mousemove", c), window.addEventListener("mouseup", u), o = () => {
|
|
3281
|
+
window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", u);
|
|
3282
|
+
};
|
|
3283
|
+
}
|
|
3284
|
+
r.preventDefault();
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
return he(() => {
|
|
3288
|
+
o == null || o();
|
|
3289
|
+
}), (r, a) => (h(), y("div", {
|
|
3290
|
+
ref_key: "splitRef",
|
|
3291
|
+
ref: s,
|
|
3292
|
+
class: P(["split-view", t.value ? "split-view--stacked" : "split-view--row"])
|
|
3293
|
+
}, [
|
|
3294
|
+
f("div", {
|
|
3295
|
+
class: "split-pane",
|
|
3296
|
+
style: K(n.value !== null ? t.value ? { flex: "none", height: n.value + "px" } : { flex: "none", width: n.value + "px" } : {})
|
|
3297
|
+
}, [
|
|
3298
|
+
L(Et, {
|
|
3299
|
+
"query-params": e.request.queryParams,
|
|
3300
|
+
payload: e.request.payload,
|
|
3301
|
+
truncated: e.request.truncated
|
|
3302
|
+
}, null, 8, ["query-params", "payload", "truncated"])
|
|
3303
|
+
], 4),
|
|
3304
|
+
f("div", {
|
|
3305
|
+
class: P(["split-handle", t.value ? "split-handle--h" : "split-handle--v"]),
|
|
3306
|
+
onMousedown: l
|
|
3307
|
+
}, null, 34),
|
|
3308
|
+
f("div", to, [
|
|
3309
|
+
L(It, {
|
|
3310
|
+
title: "Response",
|
|
3311
|
+
data: e.request.response,
|
|
3312
|
+
truncated: e.request.truncated
|
|
3313
|
+
}, null, 8, ["data", "truncated"])
|
|
3314
|
+
])
|
|
3315
|
+
], 2));
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3318
|
+
var so = /* @__PURE__ */ j(no, [["__scopeId", "data-v-9d222cb1"]]);
|
|
3319
|
+
var io = { class: "request-detail" };
|
|
3320
|
+
var oo = { class: "detail-content" };
|
|
3321
|
+
var lo = {
|
|
3322
|
+
key: 3,
|
|
3323
|
+
class: "headers-view"
|
|
3324
|
+
};
|
|
3325
|
+
var ro = { class: "header-key" };
|
|
3326
|
+
var ao = { class: "header-val" };
|
|
3327
|
+
var co = {
|
|
3328
|
+
key: 0,
|
|
3329
|
+
class: "empty-msg"
|
|
3330
|
+
};
|
|
3331
|
+
var uo = /* @__PURE__ */ $({
|
|
3332
|
+
__name: "RequestDetail",
|
|
3333
|
+
props: {
|
|
3334
|
+
request: {},
|
|
3335
|
+
instanceOptions: {}
|
|
3336
|
+
},
|
|
3337
|
+
emits: ["close"],
|
|
3338
|
+
setup(e) {
|
|
3339
|
+
const i = q("split");
|
|
3340
|
+
return (t, n) => (h(), y("div", io, [
|
|
3341
|
+
L(_i, {
|
|
3342
|
+
request: e.request,
|
|
3343
|
+
"instance-options": e.instanceOptions,
|
|
3344
|
+
onClose: n[0] || (n[0] = (s) => t.$emit("close"))
|
|
3345
|
+
}, null, 8, ["request", "instance-options"]),
|
|
3346
|
+
L(Mi, {
|
|
3347
|
+
"active-tab": i.value,
|
|
3348
|
+
onSelect: n[1] || (n[1] = (s) => i.value = s)
|
|
3349
|
+
}, null, 8, ["active-tab"]),
|
|
3350
|
+
f("div", oo, [
|
|
3351
|
+
i.value === "split" ? (h(), F(so, {
|
|
3352
|
+
key: 0,
|
|
3353
|
+
request: e.request
|
|
3354
|
+
}, null, 8, ["request"])) : i.value === "payload" ? (h(), F(Et, {
|
|
3355
|
+
key: 1,
|
|
3356
|
+
"query-params": e.request.queryParams,
|
|
3357
|
+
payload: e.request.payload,
|
|
3358
|
+
truncated: e.request.truncated
|
|
3359
|
+
}, null, 8, ["query-params", "payload", "truncated"])) : i.value === "response" ? (h(), F(It, {
|
|
3360
|
+
key: 2,
|
|
3361
|
+
title: "Response",
|
|
3362
|
+
data: e.request.response,
|
|
3363
|
+
truncated: e.request.truncated
|
|
3364
|
+
}, null, 8, ["data", "truncated"])) : i.value === "headers" ? (h(), y("div", lo, [
|
|
3365
|
+
(h(true), y(N, null, W(e.request.requestHeaders, (s, o) => (h(), y("div", {
|
|
3366
|
+
key: o,
|
|
3367
|
+
class: "header-row"
|
|
3368
|
+
}, [
|
|
3369
|
+
f("span", ro, C(o), 1),
|
|
3370
|
+
f("span", ao, C(s), 1)
|
|
3371
|
+
]))), 128)),
|
|
3372
|
+
Object.keys(e.request.requestHeaders ?? {}).length ? M("", true) : (h(), y("p", co, " No request headers captured. "))
|
|
3373
|
+
])) : M("", true)
|
|
3374
|
+
])
|
|
3375
|
+
]));
|
|
3376
|
+
}
|
|
3377
|
+
});
|
|
3378
|
+
var ho = /* @__PURE__ */ j(uo, [["__scopeId", "data-v-0b284849"]]);
|
|
3379
|
+
var fo = ["value"];
|
|
3380
|
+
var po = {
|
|
3381
|
+
key: 0,
|
|
3382
|
+
value: "",
|
|
3383
|
+
disabled: ""
|
|
3384
|
+
};
|
|
3385
|
+
var mo = ["value"];
|
|
3386
|
+
var vo = /* @__PURE__ */ $({
|
|
3387
|
+
__name: "SelectInput",
|
|
3388
|
+
props: {
|
|
3389
|
+
modelValue: {},
|
|
3390
|
+
options: {},
|
|
3391
|
+
placeholder: {}
|
|
3392
|
+
},
|
|
3393
|
+
emits: ["update:modelValue"],
|
|
3394
|
+
setup(e) {
|
|
3395
|
+
return (i, t) => (h(), y("select", {
|
|
3396
|
+
class: "select-input",
|
|
3397
|
+
value: e.modelValue,
|
|
3398
|
+
onChange: t[0] || (t[0] = (n) => i.$emit("update:modelValue", n.target.value))
|
|
3399
|
+
}, [
|
|
3400
|
+
e.placeholder ? (h(), y("option", po, C(e.placeholder), 1)) : M("", true),
|
|
3401
|
+
(h(true), y(N, null, W(e.options, (n) => (h(), y("option", {
|
|
3402
|
+
key: n.value,
|
|
3403
|
+
value: n.value
|
|
3404
|
+
}, C(n.label), 9, mo))), 128))
|
|
3405
|
+
], 40, fo));
|
|
3406
|
+
}
|
|
3407
|
+
});
|
|
3408
|
+
var go = /* @__PURE__ */ j(vo, [["__scopeId", "data-v-e6ef5dc9"]]);
|
|
3409
|
+
var yo = { class: "network-tab" };
|
|
3410
|
+
var bo = { class: "toolbar" };
|
|
3411
|
+
var wo = { class: "filter-bar" };
|
|
3412
|
+
var So = ["onClick"];
|
|
3413
|
+
var xo = { class: "filter-count" };
|
|
3414
|
+
var ko = {
|
|
3415
|
+
key: 0,
|
|
3416
|
+
width: "10",
|
|
3417
|
+
height: "10",
|
|
3418
|
+
viewBox: "0 0 10 10",
|
|
3419
|
+
fill: "none"
|
|
3420
|
+
};
|
|
3421
|
+
var _o = {
|
|
3422
|
+
key: 0,
|
|
3423
|
+
width: "10",
|
|
3424
|
+
height: "10",
|
|
3425
|
+
viewBox: "0 0 10 10",
|
|
3426
|
+
fill: "none"
|
|
3427
|
+
};
|
|
3428
|
+
var Io = {
|
|
3429
|
+
key: 0,
|
|
3430
|
+
style: { "font-size": "12px", color: "var(--dt-foreground-subtle)", padding: "16px" }
|
|
3431
|
+
};
|
|
3432
|
+
var Eo = {
|
|
3433
|
+
key: 1,
|
|
3434
|
+
class: "detail-pane"
|
|
3435
|
+
};
|
|
3436
|
+
var To = 180;
|
|
3437
|
+
var Mo = /* @__PURE__ */ $({
|
|
3438
|
+
__name: "NetworkTab",
|
|
3439
|
+
setup(e) {
|
|
3440
|
+
const {
|
|
3441
|
+
urlFilter: i,
|
|
3442
|
+
statusFilter: t,
|
|
3443
|
+
instanceFilter: n,
|
|
3444
|
+
filteredRequests: s,
|
|
3445
|
+
clearFilters: o,
|
|
3446
|
+
selectedRequest: l,
|
|
3447
|
+
selectedRequestId: r,
|
|
3448
|
+
selectRequest: a,
|
|
3449
|
+
instances: c
|
|
3450
|
+
} = Vs(), { toolbarVisible: u, filterVisible: g, settingsOpen: d, toggleToolbar: w, toggleFilter: p, closeSettings: b } = Le(), v = O(() => [
|
|
3451
|
+
{ value: "all", label: "All instances" },
|
|
3452
|
+
...[...c.value.values()].map((I) => ({
|
|
3453
|
+
value: I.id,
|
|
3454
|
+
label: I.url ?? I.id
|
|
3455
|
+
}))
|
|
3456
|
+
]), x = O(
|
|
3457
|
+
() => {
|
|
3458
|
+
var I, S;
|
|
3459
|
+
return (I = l.value) != null && I.instanceId ? (S = c.value.get(l.value.instanceId)) == null ? void 0 : S.options : void 0;
|
|
3460
|
+
}
|
|
3461
|
+
), T = [
|
|
3462
|
+
{ value: "all", label: "All" },
|
|
3463
|
+
{ value: "success", label: "Success" },
|
|
3464
|
+
{ value: "error", label: "Error" },
|
|
3465
|
+
{ value: "pending", label: "Pending" },
|
|
3466
|
+
{ value: "aborted", label: "Aborted" }
|
|
3467
|
+
], k = q(320), z = q(null);
|
|
3468
|
+
let D = null;
|
|
3469
|
+
function _(I) {
|
|
3470
|
+
const S = I.clientX, E = k.value;
|
|
3471
|
+
function V(Tt) {
|
|
3472
|
+
const Mt = z.value ? z.value.offsetWidth * 0.7 : 800;
|
|
3473
|
+
k.value = Math.max(To, Math.min(E + (Tt.clientX - S), Mt));
|
|
3474
|
+
}
|
|
3475
|
+
function ve() {
|
|
3476
|
+
window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", ve), D = null;
|
|
3477
|
+
}
|
|
3478
|
+
window.addEventListener("mousemove", V), window.addEventListener("mouseup", ve), D = () => {
|
|
3479
|
+
window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", ve);
|
|
3480
|
+
}, I.preventDefault();
|
|
3481
|
+
}
|
|
3482
|
+
return he(() => {
|
|
3483
|
+
D == null || D();
|
|
3484
|
+
}), (I, S) => (h(), y("div", yo, [
|
|
3485
|
+
ge(f("div", bo, [
|
|
3486
|
+
ge(f("input", {
|
|
3487
|
+
"onUpdate:modelValue": S[0] || (S[0] = (E) => Ne(i) ? i.value = E : null),
|
|
3488
|
+
class: "toolbar-input",
|
|
3489
|
+
placeholder: "Filter URL\u2026"
|
|
3490
|
+
}, null, 512), [
|
|
3491
|
+
[qt, m(i)]
|
|
3492
|
+
]),
|
|
3493
|
+
L(go, {
|
|
3494
|
+
modelValue: m(n),
|
|
3495
|
+
"onUpdate:modelValue": S[1] || (S[1] = (E) => Ne(n) ? n.value = E : null),
|
|
3496
|
+
options: v.value
|
|
3497
|
+
}, null, 8, ["modelValue", "options"]),
|
|
3498
|
+
f("button", {
|
|
3499
|
+
class: "toolbar-btn",
|
|
3500
|
+
onClick: S[2] || (S[2] = //@ts-ignore
|
|
3501
|
+
(...E) => m(o) && m(o)(...E))
|
|
3502
|
+
}, "Reset filters"),
|
|
3503
|
+
f("button", {
|
|
3504
|
+
class: "toolbar-btn toolbar-btn--danger",
|
|
3505
|
+
onClick: S[3] || (S[3] = //@ts-ignore
|
|
3506
|
+
(...E) => m(He) && m(He)(...E))
|
|
3507
|
+
}, "Clear log")
|
|
3508
|
+
], 512), [
|
|
3509
|
+
[We, m(u)]
|
|
3510
|
+
]),
|
|
3511
|
+
ge(f("div", wo, [
|
|
3512
|
+
(h(), y(N, null, W(T, (E) => f("button", {
|
|
3513
|
+
key: E.value,
|
|
3514
|
+
class: P(["filter-pill", { "filter-pill--active": m(t) === E.value }]),
|
|
3515
|
+
onClick: (V) => t.value = E.value
|
|
3516
|
+
}, C(E.label), 11, So)), 64)),
|
|
3517
|
+
f("span", xo, C(m(s).length) + " request" + C(m(s).length === 1 ? "" : "s"), 1)
|
|
3518
|
+
], 512), [
|
|
3519
|
+
[We, m(g)]
|
|
3520
|
+
]),
|
|
3521
|
+
(h(), F($t, { to: "body" }, [
|
|
3522
|
+
m(d) ? (h(), y("div", {
|
|
3523
|
+
key: 0,
|
|
3524
|
+
style: { position: "fixed", inset: "0", "z-index": "99" },
|
|
3525
|
+
onClick: S[4] || (S[4] = //@ts-ignore
|
|
3526
|
+
(...E) => m(b) && m(b)(...E))
|
|
3527
|
+
})) : M("", true)
|
|
3528
|
+
])),
|
|
3529
|
+
L(ze, { name: "settings-menu" }, {
|
|
3530
|
+
default: Ae(() => [
|
|
3531
|
+
m(d) ? (h(), y("div", {
|
|
3532
|
+
key: 0,
|
|
3533
|
+
class: "settings-menu",
|
|
3534
|
+
onKeydown: S[7] || (S[7] = Lt(
|
|
3535
|
+
//@ts-ignore
|
|
3536
|
+
(...E) => m(b) && m(b)(...E),
|
|
3537
|
+
["escape"]
|
|
3538
|
+
))
|
|
3539
|
+
}, [
|
|
3540
|
+
f("button", {
|
|
3541
|
+
class: "settings-item",
|
|
3542
|
+
onClick: S[5] || (S[5] = //@ts-ignore
|
|
3543
|
+
(...E) => m(w) && m(w)(...E))
|
|
3544
|
+
}, [
|
|
3545
|
+
f("span", {
|
|
3546
|
+
class: P(["settings-check", { "settings-check--on": m(u) }])
|
|
3547
|
+
}, [
|
|
3548
|
+
m(u) ? (h(), y("svg", ko, [...S[9] || (S[9] = [
|
|
3549
|
+
f("path", {
|
|
3550
|
+
d: "M1.5 5L4 7.5L8.5 2.5",
|
|
3551
|
+
stroke: "currentColor",
|
|
3552
|
+
"stroke-width": "1.5",
|
|
3553
|
+
"stroke-linecap": "round"
|
|
3554
|
+
}, null, -1)
|
|
3555
|
+
])])) : M("", true)
|
|
3556
|
+
], 2),
|
|
3557
|
+
S[10] || (S[10] = ce(" Toolbar ", -1))
|
|
3558
|
+
]),
|
|
3559
|
+
f("button", {
|
|
3560
|
+
class: "settings-item",
|
|
3561
|
+
onClick: S[6] || (S[6] = //@ts-ignore
|
|
3562
|
+
(...E) => m(p) && m(p)(...E))
|
|
3563
|
+
}, [
|
|
3564
|
+
f("span", {
|
|
3565
|
+
class: P(["settings-check", { "settings-check--on": m(g) }])
|
|
3566
|
+
}, [
|
|
3567
|
+
m(g) ? (h(), y("svg", _o, [...S[11] || (S[11] = [
|
|
3568
|
+
f("path", {
|
|
3569
|
+
d: "M1.5 5L4 7.5L8.5 2.5",
|
|
3570
|
+
stroke: "currentColor",
|
|
3571
|
+
"stroke-width": "1.5",
|
|
3572
|
+
"stroke-linecap": "round"
|
|
3573
|
+
}, null, -1)
|
|
3574
|
+
])])) : M("", true)
|
|
3575
|
+
], 2),
|
|
3576
|
+
S[12] || (S[12] = ce(" Filter bar ", -1))
|
|
3577
|
+
])
|
|
3578
|
+
], 32)) : M("", true)
|
|
3579
|
+
]),
|
|
3580
|
+
_: 1
|
|
3581
|
+
}),
|
|
3582
|
+
f("div", {
|
|
3583
|
+
ref_key: "splitRef",
|
|
3584
|
+
ref: z,
|
|
3585
|
+
class: "main-split"
|
|
3586
|
+
}, [
|
|
3587
|
+
f("div", {
|
|
3588
|
+
class: "list-pane",
|
|
3589
|
+
style: K(m(l) ? { width: `${k.value}px` } : { flex: "1" })
|
|
3590
|
+
}, [
|
|
3591
|
+
L(gi, {
|
|
3592
|
+
requests: m(s),
|
|
3593
|
+
"active-request-id": m(r),
|
|
3594
|
+
onSelect: m(a)
|
|
3595
|
+
}, null, 8, ["requests", "active-request-id", "onSelect"]),
|
|
3596
|
+
m(s).length === 0 ? (h(), y("div", Io, " No requests. ")) : M("", true)
|
|
3597
|
+
], 4),
|
|
3598
|
+
m(l) ? (h(), y("div", {
|
|
3599
|
+
key: 0,
|
|
3600
|
+
class: "drag-handle",
|
|
3601
|
+
onMousedown: _
|
|
3602
|
+
}, null, 32)) : M("", true),
|
|
3603
|
+
m(l) ? (h(), y("div", Eo, [
|
|
3604
|
+
L(ho, {
|
|
3605
|
+
request: m(l),
|
|
3606
|
+
"instance-options": x.value,
|
|
3607
|
+
onClose: S[8] || (S[8] = (E) => m(a)(null))
|
|
3608
|
+
}, null, 8, ["request", "instance-options"])
|
|
3609
|
+
])) : M("", true)
|
|
3610
|
+
], 512)
|
|
3611
|
+
]));
|
|
3612
|
+
}
|
|
3613
|
+
});
|
|
3614
|
+
var Co = /* @__PURE__ */ j(Mo, [["__scopeId", "data-v-8c2a9bad"]]);
|
|
3615
|
+
var Oo = {
|
|
3616
|
+
id: "network",
|
|
3617
|
+
label: "Network",
|
|
3618
|
+
icon: "lucide:network",
|
|
3619
|
+
order: 1,
|
|
3620
|
+
component: Co
|
|
3621
|
+
};
|
|
3622
|
+
function Ao(e, i) {
|
|
3623
|
+
return Ft(e), Be(Oo), e.tabs && e.tabs.forEach((t) => Be(t)), Rs(), {
|
|
3624
|
+
onInstanceCreated: Wt,
|
|
3625
|
+
onInstanceDestroyed: Ht,
|
|
3626
|
+
onStateUpdate: Bt,
|
|
3627
|
+
onRequestStart: Kt,
|
|
3628
|
+
onRequestEnd: Ut
|
|
3629
|
+
};
|
|
3630
|
+
}
|
|
3631
|
+
|
|
4
3632
|
// src/devtools.ts
|
|
5
3633
|
var bridge = null;
|
|
6
3634
|
var requestCounter = 0;
|
|
@@ -10,14 +3638,9 @@ function nextRequestId() {
|
|
|
10
3638
|
}
|
|
11
3639
|
async function initDevtools(options, app) {
|
|
12
3640
|
if (!options.enabled) return;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
for (const fn of pendingCalls) fn();
|
|
17
|
-
pendingCalls.length = 0;
|
|
18
|
-
} catch {
|
|
19
|
-
console.warn("[vue-muza-use] devtools enabled but @ametie/vue-muza-devtools is not installed");
|
|
20
|
-
}
|
|
3641
|
+
bridge = Ao(options, app);
|
|
3642
|
+
for (const fn2 of pendingCalls) fn2();
|
|
3643
|
+
pendingCalls.length = 0;
|
|
21
3644
|
}
|
|
22
3645
|
var devtoolsBridge = {
|
|
23
3646
|
onInstanceCreated(id, url, options) {
|
|
@@ -76,7 +3699,7 @@ var DebounceCancelledError = class extends Error {
|
|
|
76
3699
|
this.name = "DebounceCancelledError";
|
|
77
3700
|
}
|
|
78
3701
|
};
|
|
79
|
-
function debounceFn(
|
|
3702
|
+
function debounceFn(fn2, delay) {
|
|
80
3703
|
let timeoutId = null;
|
|
81
3704
|
let pendingReject = null;
|
|
82
3705
|
return function(...args) {
|
|
@@ -93,7 +3716,7 @@ function debounceFn(fn, delay) {
|
|
|
93
3716
|
pendingReject = null;
|
|
94
3717
|
timeoutId = null;
|
|
95
3718
|
try {
|
|
96
|
-
resolve(await
|
|
3719
|
+
resolve(await fn2(...args));
|
|
97
3720
|
} catch (err) {
|
|
98
3721
|
reject(err);
|
|
99
3722
|
}
|
|
@@ -290,7 +3913,7 @@ function normalizeCacheOptions(cache) {
|
|
|
290
3913
|
}
|
|
291
3914
|
return { id: cache.id, staleTime: cache.staleTime ?? DEFAULT_STALE_TIME, swr: cache.swr ?? false };
|
|
292
3915
|
}
|
|
293
|
-
function cancellableSleep(
|
|
3916
|
+
function cancellableSleep(ms2, signal) {
|
|
294
3917
|
return new Promise((resolve) => {
|
|
295
3918
|
if (signal.aborted) {
|
|
296
3919
|
resolve(true);
|
|
@@ -299,7 +3922,7 @@ function cancellableSleep(ms, signal) {
|
|
|
299
3922
|
const timer = setTimeout(() => {
|
|
300
3923
|
cleanup();
|
|
301
3924
|
resolve(false);
|
|
302
|
-
},
|
|
3925
|
+
}, ms2);
|
|
303
3926
|
const onAbort = () => {
|
|
304
3927
|
clearTimeout(timer);
|
|
305
3928
|
cleanup();
|
|
@@ -415,13 +4038,13 @@ function useApi(url, options = {}) {
|
|
|
415
4038
|
let globalAbortHandler = null;
|
|
416
4039
|
let subscribedSignal = null;
|
|
417
4040
|
if (globalAbort) {
|
|
418
|
-
const
|
|
419
|
-
if (!
|
|
420
|
-
subscribedSignal =
|
|
4041
|
+
const gs2 = globalAbort.getSignal();
|
|
4042
|
+
if (!gs2.aborted) {
|
|
4043
|
+
subscribedSignal = gs2;
|
|
421
4044
|
globalAbortHandler = () => {
|
|
422
4045
|
controller.abort("Cancelled by global abort");
|
|
423
4046
|
};
|
|
424
|
-
|
|
4047
|
+
gs2.addEventListener("abort", globalAbortHandler);
|
|
425
4048
|
}
|
|
426
4049
|
}
|
|
427
4050
|
if (!isRevalidating) {
|
|
@@ -997,8 +4620,8 @@ var defaultMonitor = (type, payload) => {
|
|
|
997
4620
|
}
|
|
998
4621
|
};
|
|
999
4622
|
var currentMonitor = defaultMonitor;
|
|
1000
|
-
function setAuthMonitor(
|
|
1001
|
-
currentMonitor =
|
|
4623
|
+
function setAuthMonitor(fn2) {
|
|
4624
|
+
currentMonitor = fn2;
|
|
1002
4625
|
}
|
|
1003
4626
|
function trackAuthEvent(type, payload = {}) {
|
|
1004
4627
|
currentMonitor(type, { ...payload, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|