@ametie/vue-muza-use 1.2.2 → 1.2.4

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