@websublime/vite-plugin-open-api-devtools 0.4.0

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.
@@ -0,0 +1,40 @@
1
+ import { c as e } from "./main-AUiFaD93.js";
2
+ const n = e("chevron-down", [
3
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
4
+ ]);
5
+ const c = e("chevron-right", [
6
+ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
7
+ ]);
8
+ const o = e("chevron-up", [
9
+ ["path", { d: "m18 15-6-6-6 6", key: "153udz" }]
10
+ ]);
11
+ const h = e("funnel", [
12
+ [
13
+ "path",
14
+ {
15
+ d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
16
+ key: "sc7q7i"
17
+ }
18
+ ]
19
+ ]);
20
+ const r = e("search", [
21
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
22
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
23
+ ]);
24
+ const s = e("x", [
25
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
26
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
27
+ ]);
28
+ function p(t) {
29
+ return t.toUpperCase();
30
+ }
31
+ export {
32
+ n as C,
33
+ h as F,
34
+ r as S,
35
+ s as X,
36
+ c as a,
37
+ o as b,
38
+ p as g
39
+ };
40
+ //# sourceMappingURL=format-CE7KDbll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-CE7KDbll.js","sources":["../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/chevron-down.js","../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/chevron-right.js","../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/chevron-up.js","../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/funnel.js","../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/search.js","../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/x.js","../src/utils/format.ts"],"sourcesContent":["/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronDown = createLucideIcon(\"chevron-down\", [\n [\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]\n]);\n\nexport { ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronRight = createLucideIcon(\"chevron-right\", [\n [\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]\n]);\n\nexport { ChevronRight as default };\n//# sourceMappingURL=chevron-right.js.map\n","/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronUp = createLucideIcon(\"chevron-up\", [\n [\"path\", { d: \"m18 15-6-6-6 6\", key: \"153udz\" }]\n]);\n\nexport { ChevronUp as default };\n//# sourceMappingURL=chevron-up.js.map\n","/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Funnel = createLucideIcon(\"funnel\", [\n [\n \"path\",\n {\n d: \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\",\n key: \"sc7q7i\"\n }\n ]\n]);\n\nexport { Funnel as default };\n//# sourceMappingURL=funnel.js.map\n","/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Search = createLucideIcon(\"search\", [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }]\n]);\n\nexport { Search as default };\n//# sourceMappingURL=search.js.map\n","/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst X = createLucideIcon(\"x\", [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n]);\n\nexport { X as default };\n//# sourceMappingURL=x.js.map\n","/**\n * Format Utilities\n *\n * What: Shared formatting functions for display purposes\n * How: Provides consistent formatting across components\n * Why: Centralizes common formatting logic to avoid duplication (DRY)\n *\n * @module utils/format\n */\n\n/**\n * Get display label for HTTP method\n *\n * Converts an HTTP method to its uppercase display format.\n *\n * @param method - The HTTP method string (e.g., 'get', 'post')\n * @returns The uppercase method label (e.g., 'GET', 'POST')\n *\n * @example\n * getMethodLabel('get') // Returns 'GET'\n * getMethodLabel('post') // Returns 'POST'\n */\nexport function getMethodLabel(method: string): string {\n return method.toUpperCase();\n}\n"],"names":["ChevronDown","createLucideIcon","ChevronRight","ChevronUp","Funnel","Search","X","getMethodLabel","method"],"mappings":";AASK,MAACA,IAAcC,EAAiB,gBAAgB;AAAA,EACnD,CAAC,QAAQ,EAAE,GAAG,gBAAgB,KAAK,SAAQ,CAAE;AAC/C,CAAC;ACFI,MAACC,IAAeD,EAAiB,iBAAiB;AAAA,EACrD,CAAC,QAAQ,EAAE,GAAG,iBAAiB,KAAK,SAAQ,CAAE;AAChD,CAAC;ACFI,MAACE,IAAYF,EAAiB,cAAc;AAAA,EAC/C,CAAC,QAAQ,EAAE,GAAG,kBAAkB,KAAK,SAAQ,CAAE;AACjD,CAAC;ACFI,MAACG,IAASH,EAAiB,UAAU;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,CAAC;ACRI,MAACI,IAASJ,EAAiB,UAAU;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,oBAAoB,KAAK,SAAQ,CAAE;AAAA,EACjD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,CAAC;ACHI,MAACK,IAAIL,EAAiB,KAAK;AAAA,EAC9B,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,CAAC;ACUM,SAASM,EAAeC,GAAwB;AACrD,SAAOA,EAAO,YAAA;AAChB;","x_google_ignoreList":[0,1,2,3,4,5]}
@@ -0,0 +1,537 @@
1
+ import { createPinia as ce } from "pinia";
2
+ import { h as $, defineComponent as se, computed as l, resolveComponent as re, createElementBlock as x, openBlock as g, createElementVNode as d, createVNode as A, unref as O, Fragment as le, renderList as ie, normalizeClass as U, createBlock as W, resolveDynamicComponent as N, toDisplayString as F, withCtx as j, Transition as ue, ref as C, watch as de, onMounted as Y, onUnmounted as pe, getCurrentInstance as X, createApp as fe } from "vue";
3
+ import { createRouter as me, createWebHashHistory as he, useRoute as ve, useRouter as ke } from "vue-router";
4
+ const Z = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ye = (e) => e.replace(
5
+ /^([A-Z])|[\s-_]+(\w)/g,
6
+ (t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
7
+ ), _e = (e) => {
8
+ const t = ye(e);
9
+ return t.charAt(0).toUpperCase() + t.slice(1);
10
+ }, ge = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t) === n).join(" ").trim();
11
+ var T = {
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ width: 24,
14
+ height: 24,
15
+ viewBox: "0 0 24 24",
16
+ fill: "none",
17
+ stroke: "currentColor",
18
+ "stroke-width": 2,
19
+ "stroke-linecap": "round",
20
+ "stroke-linejoin": "round"
21
+ };
22
+ const we = ({ size: e, strokeWidth: t = 2, absoluteStrokeWidth: n, color: a, iconNode: s, name: i, class: v, ...k }, { slots: m }) => $(
23
+ "svg",
24
+ {
25
+ ...T,
26
+ width: e || T.width,
27
+ height: e || T.height,
28
+ stroke: a || T.stroke,
29
+ "stroke-width": n ? Number(t) * 24 / Number(e) : t,
30
+ class: ge(
31
+ "lucide",
32
+ ...i ? [`lucide-${Z(_e(i))}-icon`, `lucide-${Z(i)}`] : ["lucide-icon"]
33
+ ),
34
+ ...k
35
+ },
36
+ [...s.map((o) => $(...o)), ...m.default ? [m.default()] : []]
37
+ );
38
+ const b = (e, t) => (n, { slots: a }) => $(
39
+ we,
40
+ {
41
+ ...n,
42
+ iconNode: t,
43
+ name: e
44
+ },
45
+ a
46
+ );
47
+ const be = b("clock", [
48
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
49
+ ["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
50
+ ]);
51
+ const Se = b("database", [
52
+ ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
53
+ ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
54
+ ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
55
+ ]);
56
+ const G = b("route", [
57
+ ["circle", { cx: "6", cy: "19", r: "3", key: "1kj8tv" }],
58
+ ["path", { d: "M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15", key: "1d8sl" }],
59
+ ["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }]
60
+ ]);
61
+ const Ce = b("wifi-off", [
62
+ ["path", { d: "M12 20h.01", key: "zekei9" }],
63
+ ["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }],
64
+ ["path", { d: "M5 12.859a10 10 0 0 1 5.17-2.69", key: "1dl1wf" }],
65
+ ["path", { d: "M19 12.859a10 10 0 0 0-2.007-1.523", key: "4k23kn" }],
66
+ ["path", { d: "M2 8.82a15 15 0 0 1 4.177-2.643", key: "1grhjp" }],
67
+ ["path", { d: "M22 8.82a15 15 0 0 0-11.288-3.764", key: "z3jwby" }],
68
+ ["path", { d: "m2 2 20 20", key: "1ooewy" }]
69
+ ]);
70
+ const Te = b("wifi", [
71
+ ["path", { d: "M12 20h.01", key: "zekei9" }],
72
+ ["path", { d: "M2 8.82a15 15 0 0 1 20 0", key: "dnpr2z" }],
73
+ ["path", { d: "M5 12.859a10 10 0 0 1 14 0", key: "1x1e6c" }],
74
+ ["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }]
75
+ ]);
76
+ const Q = b("zap", [
77
+ [
78
+ "path",
79
+ {
80
+ d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
81
+ key: "1xq2db"
82
+ }
83
+ ]
84
+ ]), ee = [
85
+ {
86
+ path: "/",
87
+ redirect: "/routes"
88
+ },
89
+ {
90
+ path: "/routes",
91
+ name: "routes",
92
+ component: () => import("./RoutesPage-D7H_CupP.js"),
93
+ meta: {
94
+ title: "Routes",
95
+ icon: "route"
96
+ }
97
+ },
98
+ {
99
+ path: "/timeline",
100
+ name: "timeline",
101
+ component: () => import("./TimelinePage-CMchXIlE.js"),
102
+ meta: {
103
+ title: "Timeline",
104
+ icon: "clock"
105
+ }
106
+ },
107
+ {
108
+ path: "/models",
109
+ name: "models",
110
+ component: () => import("./ModelsPage-D-qLEz14.js"),
111
+ meta: {
112
+ title: "Models",
113
+ icon: "database"
114
+ }
115
+ },
116
+ {
117
+ path: "/simulator",
118
+ name: "simulator",
119
+ component: () => import("./SimulatorPage-9sBeAxQI.js"),
120
+ meta: {
121
+ title: "Simulator",
122
+ icon: "zap"
123
+ }
124
+ },
125
+ // Catch-all route for undefined paths - redirects to routes page
126
+ {
127
+ path: "/:pathMatch(.*)*",
128
+ name: "not-found",
129
+ redirect: "/routes"
130
+ }
131
+ ], Me = me({
132
+ history: he(),
133
+ routes: ee
134
+ }), De = { class: "app" }, Ee = { class: "app-header" }, Ie = { class: "app-header__brand" }, xe = {
135
+ class: "app-nav",
136
+ role: "tablist",
137
+ "aria-label": "DevTools navigation"
138
+ }, Ae = ["aria-selected", "aria-current", "aria-controls", "onClick"], Oe = { class: "app-nav__label" }, We = { class: "app-header__status" }, Ne = { class: "connection-status" }, ze = { class: "connection-status__text" }, $e = { class: "app-main" }, Le = /* @__PURE__ */ se({
139
+ __name: "App",
140
+ setup(e) {
141
+ const t = ve(), n = ke(), a = l(
142
+ () => ee.filter((o) => o.name && o.meta?.title).map((o) => ({
143
+ name: o.name,
144
+ path: o.path,
145
+ title: o.meta?.title,
146
+ icon: o.meta?.icon
147
+ }))
148
+ ), s = l(() => t.name);
149
+ function i(o) {
150
+ n.push(o);
151
+ }
152
+ const v = {
153
+ route: G,
154
+ clock: be,
155
+ database: Se,
156
+ zap: Q
157
+ };
158
+ function k(o) {
159
+ return v[o] ?? G;
160
+ }
161
+ const m = l(() => !1);
162
+ return (o, y) => {
163
+ const _ = re("router-view");
164
+ return g(), x("div", De, [
165
+ d("header", Ee, [
166
+ d("div", Ie, [
167
+ A(O(Q), {
168
+ class: "app-header__logo",
169
+ size: 20
170
+ }),
171
+ y[0] || (y[0] = d("span", { class: "app-header__title" }, "OpenAPI DevTools", -1))
172
+ ]),
173
+ d("nav", xe, [
174
+ (g(!0), x(le, null, ie(a.value, (u) => (g(), x("button", {
175
+ key: u.name,
176
+ role: "tab",
177
+ "aria-selected": s.value === u.name,
178
+ "aria-current": s.value === u.name ? "true" : void 0,
179
+ "aria-controls": `panel-${u.name}`,
180
+ tabindex: 0,
181
+ class: U([
182
+ "app-nav__tab",
183
+ { "app-nav__tab--active": s.value === u.name }
184
+ ]),
185
+ onClick: (et) => i(u.path)
186
+ }, [
187
+ (g(), W(N(k(u.icon)), {
188
+ size: 16,
189
+ class: "app-nav__icon"
190
+ })),
191
+ d("span", Oe, F(u.title), 1)
192
+ ], 10, Ae))), 128))
193
+ ]),
194
+ d("div", We, [
195
+ d("div", Ne, [
196
+ d("span", {
197
+ class: U([
198
+ "connection-status__dot",
199
+ m.value ? "connection-status__dot--connected" : "connection-status__dot--disconnected"
200
+ ])
201
+ }, null, 2),
202
+ d("span", ze, F(m.value ? "Connected" : "Disconnected"), 1),
203
+ (g(), W(N(m.value ? O(Te) : O(Ce)), {
204
+ size: 14,
205
+ class: "connection-status__icon"
206
+ }))
207
+ ])
208
+ ])
209
+ ]),
210
+ d("main", $e, [
211
+ A(_, null, {
212
+ default: j(({ Component: u }) => [
213
+ A(ue, {
214
+ name: "fade",
215
+ mode: "out-in"
216
+ }, {
217
+ default: j(() => [
218
+ (g(), W(N(u)))
219
+ ]),
220
+ _: 2
221
+ }, 1024)
222
+ ]),
223
+ _: 1
224
+ })
225
+ ])
226
+ ]);
227
+ };
228
+ }
229
+ }), Re = (e, t) => {
230
+ const n = e.__vccOpts || e;
231
+ for (const [a, s] of t)
232
+ n[a] = s;
233
+ return n;
234
+ }, He = /* @__PURE__ */ Re(Le, [["__scopeId", "data-v-513332df"]]), Pe = ["light", "dark", "system"];
235
+ function q(e) {
236
+ return typeof e == "string" && Pe.includes(e);
237
+ }
238
+ const z = "openapi-devtools-theme", f = C("system"), h = C(!1);
239
+ let M = null, D = null;
240
+ function E() {
241
+ return typeof window < "u" && typeof document < "u";
242
+ }
243
+ function Be() {
244
+ return X() !== null;
245
+ }
246
+ function at() {
247
+ const e = l(() => f.value === "system" ? h.value ? "dark" : "light" : f.value), t = l(() => e.value === "dark");
248
+ function n() {
249
+ if (!E()) return;
250
+ const o = document.documentElement;
251
+ e.value === "dark" ? (o.classList.add("dark"), o.classList.remove("light")) : (o.classList.add("light"), o.classList.remove("dark"));
252
+ }
253
+ function a(o) {
254
+ if (!q(o)) {
255
+ console.warn(`[DevTools] Invalid theme mode: ${o}`);
256
+ return;
257
+ }
258
+ if (f.value = o, E())
259
+ try {
260
+ localStorage.setItem(z, o);
261
+ } catch {
262
+ console.warn("[DevTools] Unable to persist theme preference");
263
+ }
264
+ }
265
+ function s() {
266
+ f.value === "system" ? a(h.value ? "light" : "dark") : a(f.value === "dark" ? "light" : "dark");
267
+ }
268
+ function i() {
269
+ a("system");
270
+ }
271
+ function v() {
272
+ M && D && (M.removeEventListener("change", D), M = null, D = null);
273
+ }
274
+ function k() {
275
+ if (!E()) return;
276
+ v();
277
+ const o = window.matchMedia("(prefers-color-scheme: dark)");
278
+ h.value = o.matches;
279
+ const y = (_) => {
280
+ h.value = _.matches;
281
+ };
282
+ o.addEventListener("change", y), M = o, D = y;
283
+ try {
284
+ const _ = localStorage.getItem(z);
285
+ q(_) && (f.value = _);
286
+ } catch {
287
+ }
288
+ n();
289
+ }
290
+ function m() {
291
+ if (v(), f.value = "system", h.value = !1, E()) {
292
+ document.documentElement.classList.remove("dark", "light");
293
+ try {
294
+ localStorage.removeItem(z);
295
+ } catch {
296
+ }
297
+ }
298
+ }
299
+ return de([f, h], () => {
300
+ n();
301
+ }), Be() && (Y(() => {
302
+ k();
303
+ }), pe(() => {
304
+ v();
305
+ })), {
306
+ /**
307
+ * Current theme mode setting ('light', 'dark', or 'system')
308
+ */
309
+ themeMode: l(() => f.value),
310
+ /**
311
+ * The effective theme after resolving 'system' mode
312
+ */
313
+ effectiveTheme: e,
314
+ /**
315
+ * Whether dark mode is currently active
316
+ */
317
+ isDark: t,
318
+ /**
319
+ * Whether the system prefers dark mode
320
+ */
321
+ systemPrefersDark: l(() => h.value),
322
+ /**
323
+ * Set the theme mode
324
+ */
325
+ setTheme: a,
326
+ /**
327
+ * Toggle between light and dark mode
328
+ */
329
+ toggleTheme: s,
330
+ /**
331
+ * Reset to system preference
332
+ */
333
+ resetToSystem: i,
334
+ /**
335
+ * Manually initialize theme (useful for SSR hydration)
336
+ */
337
+ initialize: k,
338
+ /**
339
+ * Reset theme state to defaults (useful for testing)
340
+ */
341
+ resetState: m
342
+ };
343
+ }
344
+ const H = {
345
+ path: "/_ws",
346
+ reconnectDelay: 2e3,
347
+ maxReconnectAttempts: Number.POSITIVE_INFINITY,
348
+ autoConnect: !0
349
+ }, r = C("disconnected"), P = C(null), S = C(0);
350
+ let c = null, I = null, w = { ...H }, L = !1;
351
+ const p = /* @__PURE__ */ new Map();
352
+ function te() {
353
+ return typeof window < "u" && typeof WebSocket < "u";
354
+ }
355
+ function Ve() {
356
+ return X() !== null;
357
+ }
358
+ function Ue(e) {
359
+ return te() ? `${window.location.protocol === "https:" ? "wss:" : "ws:"}//${window.location.host}${e}` : `ws://localhost${e}`;
360
+ }
361
+ function ne() {
362
+ I !== null && (clearTimeout(I), I = null);
363
+ }
364
+ function Fe(e, t) {
365
+ const n = p.get(e);
366
+ if (n)
367
+ for (const s of n)
368
+ try {
369
+ s(t);
370
+ } catch (i) {
371
+ console.error(`[DevTools WebSocket] Error in event handler for '${e}':`, i);
372
+ }
373
+ const a = p.get("*");
374
+ if (a)
375
+ for (const s of a)
376
+ try {
377
+ s({ type: e, data: t });
378
+ } catch (i) {
379
+ console.error("[DevTools WebSocket] Error in wildcard event handler:", i);
380
+ }
381
+ }
382
+ function je() {
383
+ r.value = "connected", S.value = 0, ne();
384
+ }
385
+ function Ze(e) {
386
+ try {
387
+ const t = JSON.parse(e.data);
388
+ if (t.type === "connected") {
389
+ const n = t.data;
390
+ P.value = n.serverVersion;
391
+ }
392
+ Fe(t.type, t.data);
393
+ } catch (t) {
394
+ console.error("[DevTools WebSocket] Failed to parse message:", t);
395
+ }
396
+ }
397
+ function Ge() {
398
+ r.value, r.value = "disconnected", c = null, S.value < w.maxReconnectAttempts && (r.value = "reconnecting", S.value++, I = setTimeout(() => {
399
+ R();
400
+ }, w.reconnectDelay));
401
+ }
402
+ function Qe(e) {
403
+ console.error("[DevTools WebSocket] Error:", e);
404
+ }
405
+ function R() {
406
+ if (!te() || r.value === "connecting" || r.value === "connected" || c && (c.readyState === WebSocket.CONNECTING || c.readyState === WebSocket.OPEN))
407
+ return;
408
+ oe(), r.value = "connecting";
409
+ const e = Ue(w.path);
410
+ try {
411
+ c = new WebSocket(e), c.onopen = je, c.onmessage = Ze, c.onclose = Ge, c.onerror = Qe;
412
+ } catch (t) {
413
+ console.error("[DevTools WebSocket] Failed to create WebSocket:", t), r.value = "disconnected";
414
+ }
415
+ }
416
+ function oe() {
417
+ c && (c.onopen = null, c.onmessage = null, c.onclose = null, c.onerror = null, (c.readyState === WebSocket.OPEN || c.readyState === WebSocket.CONNECTING) && c.close(), c = null);
418
+ }
419
+ function ae() {
420
+ ne(), oe(), r.value = "disconnected", S.value = 0;
421
+ }
422
+ function qe(e) {
423
+ if (!c || c.readyState !== WebSocket.OPEN)
424
+ return !1;
425
+ try {
426
+ return c.send(JSON.stringify(e)), !0;
427
+ } catch (t) {
428
+ return console.error("[DevTools WebSocket] Failed to send command:", t), !1;
429
+ }
430
+ }
431
+ function B(e, t) {
432
+ p.has(e) || p.set(e, /* @__PURE__ */ new Set());
433
+ const n = p.get(e);
434
+ return n && n.add(t), () => {
435
+ const a = p.get(e);
436
+ a && (a.delete(t), a.size === 0 && p.delete(e));
437
+ };
438
+ }
439
+ function V(e, t) {
440
+ const n = p.get(e);
441
+ n && (n.delete(t), n.size === 0 && p.delete(e));
442
+ }
443
+ function Je(e, t) {
444
+ const n = (a) => {
445
+ V(e, n), t(a);
446
+ };
447
+ return B(e, n);
448
+ }
449
+ function Ke(e, t) {
450
+ const n = (a) => {
451
+ t(a) === !0 && V(e, n);
452
+ };
453
+ return B(e, n);
454
+ }
455
+ function Ye() {
456
+ ae(), P.value = null, p.clear(), w = { ...H }, L = !1;
457
+ }
458
+ function ct(e = {}) {
459
+ (!L || r.value === "disconnected") && (w = { ...H, ...e }, L = !0);
460
+ const t = l(() => r.value === "connected"), n = l(() => r.value === "reconnecting");
461
+ return Ve() && Y(() => {
462
+ w.autoConnect && R();
463
+ }), {
464
+ /**
465
+ * Current connection state
466
+ */
467
+ connectionState: l(() => r.value),
468
+ /**
469
+ * Whether the WebSocket is connected
470
+ */
471
+ connected: t,
472
+ /**
473
+ * Whether the WebSocket is attempting to reconnect
474
+ */
475
+ isReconnecting: n,
476
+ /**
477
+ * Server version received on connection
478
+ */
479
+ serverVersion: l(() => P.value),
480
+ /**
481
+ * Number of reconnection attempts made
482
+ */
483
+ reconnectAttempts: l(() => S.value),
484
+ /**
485
+ * Connect to the WebSocket server
486
+ */
487
+ connect: R,
488
+ /**
489
+ * Disconnect from the WebSocket server
490
+ */
491
+ disconnect: ae,
492
+ /**
493
+ * Send a command to the server
494
+ */
495
+ send: qe,
496
+ /**
497
+ * Subscribe to a server event
498
+ */
499
+ on: B,
500
+ /**
501
+ * Unsubscribe from a server event
502
+ */
503
+ off: V,
504
+ /**
505
+ * Subscribe to an event once (one-shot, auto-unsubscribes after first call)
506
+ */
507
+ once: Je,
508
+ /**
509
+ * Subscribe to an event until handler returns true
510
+ */
511
+ onUntil: Ke,
512
+ /**
513
+ * Reset the composable state (useful for testing)
514
+ */
515
+ resetState: Ye
516
+ };
517
+ }
518
+ let J = !1, K = null;
519
+ function Xe() {
520
+ if (J)
521
+ return K;
522
+ const e = fe(He), t = ce();
523
+ return e.use(t), e.use(Me), e.mount("#app"), J = !0, K = e, e;
524
+ }
525
+ typeof window < "u" && document.getElementById("app") && Xe();
526
+ export {
527
+ be as C,
528
+ Se as D,
529
+ G as R,
530
+ Q as Z,
531
+ Re as _,
532
+ at as a,
533
+ Xe as b,
534
+ b as c,
535
+ ct as u
536
+ };
537
+ //# sourceMappingURL=main-AUiFaD93.js.map