@qwik.dev/core 2.0.0-beta.29 → 2.0.0-beta.30

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.
@@ -1,396 +1,49 @@
1
- function jt(e = {}) {
2
- function t(u) {
3
- if (typeof u != "string")
4
- throw new TypeError("Path must be a string. Received " + JSON.stringify(u));
5
- }
6
- function i(u, s) {
7
- let p = "", _ = 0, S = -1, E = 0, c;
8
- for (let w = 0; w <= u.length; ++w) {
9
- if (w < u.length)
10
- c = u.charCodeAt(w);
11
- else {
12
- if (c === 47)
13
- break;
14
- c = 47;
15
- }
16
- if (c === 47) {
17
- if (!(S === w - 1 || E === 1)) if (S !== w - 1 && E === 2) {
18
- if (p.length < 2 || _ !== 2 || p.charCodeAt(p.length - 1) !== 46 || p.charCodeAt(p.length - 2) !== 46) {
19
- if (p.length > 2) {
20
- const x = p.lastIndexOf("/");
21
- if (x !== p.length - 1) {
22
- x === -1 ? (p = "", _ = 0) : (p = p.slice(0, x), _ = p.length - 1 - p.lastIndexOf("/")), S = w, E = 0;
23
- continue;
24
- }
25
- } else if (p.length === 2 || p.length === 1) {
26
- p = "", _ = 0, S = w, E = 0;
27
- continue;
28
- }
29
- }
30
- s && (p.length > 0 ? p += "/.." : p = "..", _ = 2);
31
- } else
32
- p.length > 0 ? p += "/" + u.slice(S + 1, w) : p = u.slice(S + 1, w), _ = w - S - 1;
33
- S = w, E = 0;
34
- } else c === 46 && E !== -1 ? ++E : E = -1;
35
- }
36
- return p;
37
- }
38
- function r(u, s) {
39
- const p = s.dir || s.root, _ = s.base || (s.name || "") + (s.ext || "");
40
- return p ? p === s.root ? p + _ : p + u + _ : _;
41
- }
42
- const o = function(...s) {
43
- let p = "", _ = !1, S;
44
- for (let E = s.length - 1; E >= -1 && !_; E--) {
45
- let c;
46
- E >= 0 ? c = s[E] : (S === void 0 && (e && typeof e.cwd == "function" ? S = e.cwd() : typeof process < "u" && typeof process.cwd == "function" ? S = process.cwd() : S = "/"), c = S), t(c), c.length !== 0 && (p = c + "/" + p, _ = c.charCodeAt(0) === 47);
47
- }
48
- return p = i(p, !_), _ ? p.length > 0 ? "/" + p : "/" : p.length > 0 ? p : ".";
49
- }, m = function(s) {
50
- if (t(s), s.length === 0)
51
- return ".";
52
- const p = s.charCodeAt(0) === 47, _ = s.charCodeAt(s.length - 1) === 47;
53
- return s = i(s, !p), s.length === 0 && !p && (s = "."), s.length > 0 && _ && (s += "/"), p ? "/" + s : s;
54
- }, l = function(s) {
55
- return t(s), s.length > 0 && s.charCodeAt(0) === 47;
56
- }, a = function(...s) {
57
- if (s.length === 0)
58
- return ".";
59
- let p;
60
- for (let _ = 0; _ < s.length; ++_) {
61
- const S = s[_];
62
- t(S), S.length > 0 && (p === void 0 ? p = S : p += "/" + S);
63
- }
64
- return p === void 0 ? "." : m(p);
65
- }, f = function(s, p) {
66
- if (t(s), t(p), s === p || (s = o(s), p = o(p), s === p))
67
- return "";
68
- let _ = 1;
69
- for (; _ < s.length && s.charCodeAt(_) === 47; ++_)
70
- ;
71
- const S = s.length, E = S - _;
72
- let c = 1;
73
- for (; c < p.length && p.charCodeAt(c) === 47; ++c)
74
- ;
75
- const x = p.length - c, N = E < x ? E : x;
76
- let D = -1, T = 0;
77
- for (; T <= N; ++T) {
78
- if (T === N) {
79
- if (x > N) {
80
- if (p.charCodeAt(c + T) === 47)
81
- return p.slice(c + T + 1);
82
- if (T === 0)
83
- return p.slice(c + T);
84
- } else E > N && (s.charCodeAt(_ + T) === 47 ? D = T : T === 0 && (D = 0));
85
- break;
86
- }
87
- const F = s.charCodeAt(_ + T), B = p.charCodeAt(c + T);
88
- if (F !== B)
89
- break;
90
- F === 47 && (D = T);
91
- }
92
- let $ = "";
93
- for (T = _ + D + 1; T <= S; ++T)
94
- (T === S || s.charCodeAt(T) === 47) && ($.length === 0 ? $ += ".." : $ += "/..");
95
- return $.length > 0 ? $ + p.slice(c + D) : (c += D, p.charCodeAt(c) === 47 && ++c, p.slice(c));
96
- }, n = function(s) {
97
- if (t(s), s.length === 0)
98
- return ".";
99
- let p = s.charCodeAt(0);
100
- const _ = p === 47;
101
- let S = -1, E = !0;
102
- for (let c = s.length - 1; c >= 1; --c)
103
- if (p = s.charCodeAt(c), p === 47) {
104
- if (!E) {
105
- S = c;
106
- break;
107
- }
108
- } else
109
- E = !1;
110
- return S === -1 ? _ ? "/" : "." : _ && S === 1 ? "//" : s.slice(0, S);
111
- }, b = function(s, p) {
112
- if (p !== void 0 && typeof p != "string")
113
- throw new TypeError('"ext" argument must be a string');
114
- t(s);
115
- let _ = 0, S = -1, E = !0, c;
116
- if (p !== void 0 && p.length > 0 && p.length <= s.length) {
117
- if (p.length === s.length && p === s)
118
- return "";
119
- let w = p.length - 1, x = -1;
120
- for (c = s.length - 1; c >= 0; --c) {
121
- const N = s.charCodeAt(c);
122
- if (N === 47) {
123
- if (!E) {
124
- _ = c + 1;
125
- break;
126
- }
127
- } else
128
- x === -1 && (E = !1, x = c + 1), w >= 0 && (N === p.charCodeAt(w) ? --w === -1 && (S = c) : (w = -1, S = x));
129
- }
130
- return _ === S ? S = x : S === -1 && (S = s.length), s.slice(_, S);
131
- } else {
132
- for (c = s.length - 1; c >= 0; --c)
133
- if (s.charCodeAt(c) === 47) {
134
- if (!E) {
135
- _ = c + 1;
136
- break;
137
- }
138
- } else S === -1 && (E = !1, S = c + 1);
139
- return S === -1 ? "" : s.slice(_, S);
140
- }
141
- }, v = function(s) {
142
- t(s);
143
- let p = -1, _ = 0, S = -1, E = !0, c = 0;
144
- for (let w = s.length - 1; w >= 0; --w) {
145
- const x = s.charCodeAt(w);
146
- if (x === 47) {
147
- if (!E) {
148
- _ = w + 1;
149
- break;
150
- }
151
- continue;
152
- }
153
- S === -1 && (E = !1, S = w + 1), x === 46 ? p === -1 ? p = w : c !== 1 && (c = 1) : p !== -1 && (c = -1);
154
- }
155
- return p === -1 || S === -1 || // We saw a non-dot character immediately before the dot
156
- c === 0 || // The (right-most) trimmed path component is exactly '..'
157
- c === 1 && p === S - 1 && p === _ + 1 ? "" : s.slice(p, S);
158
- }, I = function(s) {
159
- if (s === null || typeof s != "object")
160
- throw new TypeError(
161
- 'The "pathObject" argument must be of type Object. Received type ' + typeof s
162
- );
163
- return r("/", s);
164
- }, g = function(s) {
165
- t(s);
166
- const p = {
167
- root: "",
168
- dir: "",
169
- base: "",
170
- ext: "",
171
- name: ""
172
- };
173
- if (s.length === 0)
174
- return p;
175
- let _ = s.charCodeAt(0), S;
176
- const E = _ === 47;
177
- E ? (p.root = "/", S = 1) : S = 0;
178
- let c = -1, w = 0, x = -1, N = !0, D = s.length - 1, T = 0;
179
- for (; D >= S; --D) {
180
- if (_ = s.charCodeAt(D), _ === 47) {
181
- if (!N) {
182
- w = D + 1;
183
- break;
184
- }
185
- continue;
186
- }
187
- x === -1 && (N = !1, x = D + 1), _ === 46 ? c === -1 ? c = D : T !== 1 && (T = 1) : c !== -1 && (T = -1);
188
- }
189
- return c === -1 || x === -1 || // We saw a non-dot character immediately before the dot
190
- T === 0 || // The (right-most) trimmed path component is exactly '..'
191
- T === 1 && c === x - 1 && c === w + 1 ? x !== -1 && (w === 0 && E ? p.base = p.name = s.slice(1, x) : p.base = p.name = s.slice(w, x)) : (w === 0 && E ? (p.name = s.slice(1, c), p.base = s.slice(1, x)) : (p.name = s.slice(w, c), p.base = s.slice(w, x)), p.ext = s.slice(c, x)), w > 0 ? p.dir = s.slice(0, w - 1) : E && (p.dir = "/"), p;
192
- }, d = "/", y = ":";
193
- return {
194
- relative: f,
195
- resolve: o,
196
- parse: g,
197
- format: I,
198
- join: a,
199
- isAbsolute: l,
200
- basename: b,
201
- normalize: m,
202
- dirname: n,
203
- extname: v,
204
- delimiter: y,
205
- sep: d,
206
- win32: null,
207
- posix: {
208
- relative: f,
209
- resolve: o,
210
- parse: g,
211
- format: I,
212
- join: a,
213
- isAbsolute: l,
214
- basename: b,
215
- normalize: m,
216
- dirname: n,
217
- extname: v,
218
- delimiter: y,
219
- sep: d,
220
- win32: null,
221
- posix: null
222
- }
223
- };
224
- }
225
- const Ut = {
226
- darwin: {
227
- arm64: [
228
- {
229
- platform: "darwin",
230
- arch: "arm64",
231
- abi: null,
232
- platformArchABI: "qwik.darwin-arm64.node"
233
- }
234
- ],
235
- x64: [
236
- {
237
- platform: "darwin",
238
- arch: "x64",
239
- abi: null,
240
- platformArchABI: "qwik.darwin-x64.node"
241
- }
242
- ]
243
- },
244
- win32: {
245
- x64: [
246
- {
247
- platform: "win32",
248
- arch: "x64",
249
- abi: "msvc",
250
- platformArchABI: "qwik.win32-x64-msvc.node"
251
- }
252
- ]
253
- },
254
- linux: {
255
- x64: [
256
- {
257
- platform: "linux",
258
- arch: "x64",
259
- abi: "gnu",
260
- platformArchABI: "qwik.linux-x64-gnu.node"
261
- }
262
- ]
263
- }
264
- };
265
- async function Bt() {
266
- const e = Tt(), t = {
267
- dynamicImport: (i) => {
268
- throw new Error(
269
- `Qwik Optimizer sys.dynamicImport() not implemented, trying to import: "${i}"`
270
- );
271
- },
272
- strictDynamicImport: (i) => {
273
- throw new Error(
274
- `Qwik Optimizer sys.strictDynamicImport() not implemented, trying to import: "${i}"`
275
- );
276
- },
277
- path: null,
278
- cwd: () => "/",
279
- os: "unknown",
280
- env: e
281
- };
282
- if (t.path = jt(t), t.strictDynamicImport = t.dynamicImport = (i) => import(i), e !== "webworker" && e !== "browsermain")
283
- try {
284
- t.path = await t.dynamicImport("node:path"), t.cwd = () => process.cwd(), t.os = process.platform;
285
- } catch {
286
- }
287
- return t;
288
- }
289
- async function Rt(e) {
290
- const t = Tt();
291
- if (t === "node" || t === "bun") {
292
- const i = Ut[process.platform];
293
- if (i) {
294
- const r = i[process.arch];
295
- if (r)
296
- for (const o of r)
297
- try {
298
- return (await e.dynamicImport("node:module")).default.createRequire(import.meta.url)(
299
- `../bindings/${o.platformArchABI}`
300
- );
301
- } catch (m) {
302
- console.warn(
303
- `Unable to load native binding ${o.platformArchABI}. Falling back to wasm build.`,
304
- m?.message
305
- );
306
- }
307
- }
308
- }
309
- if (t === "node" || t === "bun") {
310
- const i = await e.dynamicImport("node:url"), r = e.path.dirname(i.fileURLToPath(import.meta.url)), o = e.path.join(r, "..", "bindings", "qwik_wasm_bg.wasm"), m = await e.dynamicImport("../bindings/qwik.wasm.mjs"), a = await (await e.dynamicImport("node:fs")).promises.readFile(o), f = await WebAssembly.compile(a);
311
- return await m.default(f), m;
312
- } else {
313
- const i = await e.dynamicImport("../bindings/qwik.wasm.mjs");
314
- return await i.default(), i;
315
- }
316
- }
317
- const Tt = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof process < "u" && typeof global < "u" && process.versions && process.versions.node ? "node" : typeof self < "u" && typeof location < "u" && typeof navigator < "u" && typeof fetch == "function" && typeof WorkerGlobalScope == "function" && typeof self.importScripts == "function" ? "webworker" : typeof window < "u" && typeof document < "u" && typeof location < "u" && typeof navigator < "u" && typeof Window == "function" && typeof fetch == "function" ? "browsermain" : "unknown", At = async (e = {}) => {
318
- const t = e?.sys || await Bt(), i = e?.binding || await Rt(t);
319
- return {
320
- async transformModules(o) {
321
- return Ft(i, o);
322
- },
323
- sys: t
324
- };
325
- }, Ft = (e, t) => e.transform_modules($t(t)), $t = (e) => {
326
- const t = {
327
- minify: "simplify",
328
- sourceMaps: !1,
329
- transpileTs: !1,
330
- transpileJsx: !1,
331
- preserveFilenames: !1,
332
- explicitExtensions: !1,
333
- mode: "lib",
334
- manualChunks: void 0,
335
- scope: void 0,
336
- regCtxName: void 0,
337
- stripEventHandlers: !1,
338
- rootDir: void 0,
339
- stripExports: void 0,
340
- stripCtxName: void 0,
341
- isServer: void 0
342
- };
343
- return Object.entries(e).forEach(([i, r]) => {
344
- r != null && (t[i] = r);
345
- }), t.entryStrategy = e.entryStrategy?.type ?? "smart", t.manualChunks = e.entryStrategy?.manual ?? void 0, t;
346
- }, zr = {
347
- qwik: "2.0.0-beta.29-dev+bc61b71"
348
- }, zt = (e, t = 0) => {
1
+ const Lt = (e, n = 0) => {
349
2
  for (let i = 0; i < e.length; i++) {
350
3
  const r = e.charCodeAt(i);
351
- t = (t << 5) - t + r, t |= 0;
352
- }
353
- return Number(Math.abs(t)).toString(36);
354
- }, Ht = /* @__PURE__ */ new Set(["_chk", "_rsc", "_res", "_run", "_task", "_val"]);
355
- function Wt(e) {
356
- const t = e.symbols;
357
- return Object.keys(t).sort((i, r) => {
358
- const o = t[i], m = t[r];
359
- if (o.ctxKind === "eventHandler" && m.ctxKind !== "eventHandler")
4
+ n = (n << 5) - n + r, n |= 0;
5
+ }
6
+ return Number(Math.abs(n)).toString(36);
7
+ }, Ut = /* @__PURE__ */ new Set(["_chk", "_rsc", "_res", "_run", "_task", "_val", "_eaC", "_eaT"]);
8
+ function Rt(e) {
9
+ const n = e.symbols;
10
+ return Object.keys(n).sort((i, r) => {
11
+ const o = n[i], u = n[r];
12
+ if (o.ctxKind === "eventHandler" && u.ctxKind !== "eventHandler")
360
13
  return -1;
361
- if (o.ctxKind !== "eventHandler" && m.ctxKind === "eventHandler")
14
+ if (o.ctxKind !== "eventHandler" && u.ctxKind === "eventHandler")
362
15
  return 1;
363
- if (o.ctxKind === "eventHandler" && m.ctxKind === "eventHandler") {
364
- const l = et.indexOf(o.ctxName.toLowerCase()), a = et.indexOf(m.ctxName.toLowerCase());
365
- if (l > -1 && a > -1) {
366
- if (l < a)
16
+ if (o.ctxKind === "eventHandler" && u.ctxKind === "eventHandler") {
17
+ const a = Ve.indexOf(o.ctxName.toLowerCase()), l = Ve.indexOf(u.ctxName.toLowerCase());
18
+ if (a > -1 && l > -1) {
19
+ if (a < l)
367
20
  return -1;
368
- if (l > a)
21
+ if (a > l)
369
22
  return 1;
370
23
  } else {
371
- if (l > -1)
372
- return -1;
373
24
  if (a > -1)
25
+ return -1;
26
+ if (l > -1)
374
27
  return 1;
375
28
  }
376
- } else if (o.ctxKind === "function" && m.ctxKind === "function") {
377
- const l = tt.indexOf(o.ctxName.toLowerCase()), a = tt.indexOf(m.ctxName.toLowerCase());
378
- if (l > -1 && a > -1) {
379
- if (l < a)
29
+ } else if (o.ctxKind === "function" && u.ctxKind === "function") {
30
+ const a = Ze.indexOf(o.ctxName.toLowerCase()), l = Ze.indexOf(u.ctxName.toLowerCase());
31
+ if (a > -1 && l > -1) {
32
+ if (a < l)
380
33
  return -1;
381
- if (l > a)
34
+ if (a > l)
382
35
  return 1;
383
36
  } else {
384
- if (l > -1)
385
- return -1;
386
37
  if (a > -1)
38
+ return -1;
39
+ if (l > -1)
387
40
  return 1;
388
41
  }
389
42
  }
390
- return !o.parent && m.parent ? -1 : o.parent && !m.parent ? 1 : o.hash < m.hash ? -1 : o.hash > m.hash ? 1 : 0;
43
+ return !o.parent && u.parent ? -1 : o.parent && !u.parent ? 1 : o.hash < u.hash ? -1 : o.hash > u.hash ? 1 : 0;
391
44
  });
392
45
  }
393
- const et = [
46
+ const Ve = [
394
47
  // Click Events
395
48
  "click",
396
49
  "dblclick",
@@ -446,110 +99,110 @@ const et = [
446
99
  "reset",
447
100
  // Scroll Events
448
101
  "scroll"
449
- ].map((e) => `on${e.toLowerCase()}$`), tt = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
102
+ ].map((e) => `on${e.toLowerCase()}$`), Ze = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
450
103
  (e) => e.toLowerCase()
451
104
  );
452
- function Gt(e) {
453
- return Object.keys(e.bundles).sort(Fe);
105
+ function Bt(e) {
106
+ return Object.keys(e.bundles).sort(Be);
454
107
  }
455
- function Qt(e) {
456
- const t = Wt(e), i = {}, r = {};
457
- for (const l of t)
458
- i[l] = e.symbols[l], r[l] = e.mapping[l];
459
- const o = Gt(e), m = {};
460
- for (const l of o) {
461
- m[l] = e.bundles[l];
462
- const a = e.bundles[l];
463
- Array.isArray(a.imports) && a.imports.sort(Fe), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(Fe);
108
+ function Ft(e) {
109
+ const n = Rt(e), i = {}, r = {};
110
+ for (const a of n)
111
+ i[a] = e.symbols[a], r[a] = e.mapping[a];
112
+ const o = Bt(e), u = {};
113
+ for (const a of o) {
114
+ u[a] = e.bundles[a];
115
+ const l = e.bundles[a];
116
+ Array.isArray(l.imports) && l.imports.sort(Be), Array.isArray(l.dynamicImports) && l.dynamicImports.sort(Be);
464
117
  const f = [];
465
- for (const n of t)
466
- l === r[n] && f.push(n);
467
- f.length > 0 && (f.sort(Fe), a.symbols = f);
118
+ for (const t of n)
119
+ a === r[t] && f.push(t);
120
+ f.length > 0 && (f.sort(Be), l.symbols = f);
468
121
  }
469
- return e.symbols = i, e.mapping = r, e.bundles = m, e;
122
+ return e.symbols = i, e.mapping = r, e.bundles = u, e;
470
123
  }
471
- function Fe(e, t) {
472
- return e = e.toLocaleLowerCase(), t = t.toLocaleLowerCase(), e < t ? -1 : e > t ? 1 : 0;
124
+ function Be(e, n) {
125
+ return e = e.toLocaleLowerCase(), n = n.toLocaleLowerCase(), e < n ? -1 : e > n ? 1 : 0;
473
126
  }
474
- function nt(e) {
127
+ function et(e) {
475
128
  if (e != null && e.mapping != null && typeof e.mapping == "object" && e.symbols != null && typeof e.symbols == "object" && e.bundles != null && typeof e.bundles == "object")
476
129
  return e;
477
130
  }
478
- const Kt = (e, t) => {
131
+ const $t = (e, n) => {
479
132
  let i = 0;
480
133
  if (e.symbols)
481
134
  for (const r of e.symbols) {
482
135
  let o = 1;
483
- const m = t.symbols[r];
484
- m && (m.ctxKind === "function" ? /(component|useStyles|useStylesScoped)/i.test(m.ctxName) ? o += 1 : /(useComputed|useTask|useVisibleTask|useOn)/i.test(m.ctxName) && (o += 2) : (o += 1, /(click|mouse|pointer|touch|key|scroll|gesture|wheel)/i.test(m.ctxName) && (o += 3))), i = Math.max(i, o);
136
+ const u = n.symbols[r];
137
+ u && (u.ctxKind === "function" ? /(component|useStyles|useStylesScoped)/i.test(u.ctxName) ? o += 1 : /(useComputed|useTask|useVisibleTask|useOn)/i.test(u.ctxName) && (o += 2) : (o += 1, /(click|mouse|pointer|touch|key|scroll|gesture|wheel)/i.test(u.ctxName) && (o += 3))), i = Math.max(i, o);
485
138
  }
486
139
  return i;
487
140
  };
488
- function Jt(e) {
489
- let t = 0;
490
- const i = [], r = [], o = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
491
- function a(d) {
492
- o.set(d, t), m.set(d, t), t++, i.push(d), l.add(d);
493
- const y = e[d].imports || [];
494
- for (const u of y)
495
- o.has(u) ? l.has(u) && m.set(d, Math.min(m.get(d), o.get(u))) : (a(u), m.set(d, Math.min(m.get(d), m.get(u))));
496
- if (m.get(d) === o.get(d)) {
497
- const u = [];
498
- let s;
141
+ function zt(e) {
142
+ let n = 0;
143
+ const i = [], r = [], o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
144
+ function l(s) {
145
+ o.set(s, n), u.set(s, n), n++, i.push(s), a.add(s);
146
+ const p = e[s].imports || [];
147
+ for (const c of p)
148
+ o.has(c) ? a.has(c) && u.set(s, Math.min(u.get(s), o.get(c))) : (l(c), u.set(s, Math.min(u.get(s), u.get(c))));
149
+ if (u.get(s) === o.get(s)) {
150
+ const c = [];
151
+ let y;
499
152
  do
500
- s = i.pop(), l.delete(s), u.push(s);
501
- while (s !== d);
502
- r.push(u);
153
+ y = i.pop(), a.delete(y), c.push(y);
154
+ while (y !== s);
155
+ r.push(c);
503
156
  }
504
157
  }
505
- for (const d of Object.keys(e))
506
- o.has(d) || a(d);
158
+ for (const s of Object.keys(e))
159
+ o.has(s) || l(s);
507
160
  const f = /* @__PURE__ */ new Map();
508
- r.forEach((d, y) => {
509
- for (const u of d)
510
- f.set(u, y);
161
+ r.forEach((s, p) => {
162
+ for (const c of s)
163
+ f.set(c, p);
511
164
  });
512
- const n = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
513
- for (const d of Object.keys(e)) {
514
- const y = f.get(d);
515
- for (const u of e[d].imports || []) {
516
- const s = f.get(u);
517
- y !== s && n[y].add(s);
518
- }
519
- }
520
- const b = /* @__PURE__ */ new Set(), v = [];
521
- function I(d) {
522
- b.add(d);
523
- for (const y of n[d])
524
- b.has(y) || I(y);
525
- v.push(d);
526
- }
527
- for (let d = 0; d < r.length; d++)
528
- b.has(d) || I(d);
529
- v.reverse();
530
- const g = new Array(r.length).fill(0);
531
- for (let d = 0; d < r.length; d++) {
532
- let y = 0;
533
- for (const u of r[d])
534
- y += e[u].size;
535
- g[d] = y;
536
- }
537
- for (let d = v.length - 1; d >= 0; d--) {
538
- const y = v[d];
539
- let u = g[y];
540
- for (const s of n[y])
541
- u += g[s];
542
- g[y] = u;
543
- }
544
- for (let d = 0; d < r.length; d++) {
545
- const y = g[d];
546
- for (const u of r[d])
547
- e[u].total = y;
165
+ const t = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
166
+ for (const s of Object.keys(e)) {
167
+ const p = f.get(s);
168
+ for (const c of e[s].imports || []) {
169
+ const y = f.get(c);
170
+ p !== y && t[p].add(y);
171
+ }
172
+ }
173
+ const g = /* @__PURE__ */ new Set(), m = [];
174
+ function v(s) {
175
+ g.add(s);
176
+ for (const p of t[s])
177
+ g.has(p) || v(p);
178
+ m.push(s);
179
+ }
180
+ for (let s = 0; s < r.length; s++)
181
+ g.has(s) || v(s);
182
+ m.reverse();
183
+ const d = new Array(r.length).fill(0);
184
+ for (let s = 0; s < r.length; s++) {
185
+ let p = 0;
186
+ for (const c of r[s])
187
+ p += e[c].size;
188
+ d[s] = p;
189
+ }
190
+ for (let s = m.length - 1; s >= 0; s--) {
191
+ const p = m[s];
192
+ let c = d[p];
193
+ for (const y of t[p])
194
+ c += d[y];
195
+ d[p] = c;
196
+ }
197
+ for (let s = 0; s < r.length; s++) {
198
+ const p = d[s];
199
+ for (const c of r[s])
200
+ e[c].total = p;
548
201
  }
549
202
  }
550
- const rt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, ot = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, it = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
551
- function Yt(e, t, i, r, o, m, l) {
552
- const a = {
203
+ const tt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, nt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, rt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
204
+ function At(e, n, i, r, o, u, a) {
205
+ const l = {
553
206
  version: "1",
554
207
  manifestHash: "",
555
208
  options: {
@@ -568,191 +221,191 @@ function Yt(e, t, i, r, o, m, l) {
568
221
  assets: {},
569
222
  symbols: {},
570
223
  bundleGraph: void 0
571
- }, f = (g) => {
572
- const d = r[g];
573
- if (!d) {
574
- console.warn(`Client manifest generation: skipping external import "${g}"`);
224
+ }, f = (d) => {
225
+ const s = r[d];
226
+ if (!s) {
227
+ console.warn(`Client manifest generation: skipping external import "${d}"`);
575
228
  return;
576
229
  }
577
- return l(d.fileName);
230
+ return a(s.fileName);
578
231
  };
579
- let n, b, v;
580
- for (const g of Object.values(r)) {
581
- const d = f(g.fileName);
582
- g.name === "core" && (n = d), g.name === "preloader" && (b = d), g.name === "handlers" && (v = d);
583
- }
584
- const I = new Set(t.map((g) => g.name));
585
- for (const g of Object.values(r)) {
586
- if (g.type === "asset") {
587
- g.fileName.endsWith("js.map") || (a.assets[g.fileName] = {
588
- name: g.names[0],
589
- size: g.source.length
232
+ let t, g, m;
233
+ for (const d of Object.values(r)) {
234
+ const s = f(d.fileName);
235
+ d.name === "core" && (t = s), d.name === "preloader" && (g = s), d.name === "handlers" && (m = s);
236
+ }
237
+ const v = new Set(n.map((d) => d.name));
238
+ for (const d of Object.values(r)) {
239
+ if (d.type === "asset") {
240
+ d.fileName.endsWith("js.map") || (l.assets[d.fileName] = {
241
+ name: d.names[0],
242
+ size: d.source.length
590
243
  });
591
244
  continue;
592
245
  }
593
- const d = l(g.fileName), u = {
594
- size: g.code.length,
246
+ const s = a(d.fileName), c = {
247
+ size: d.code.length,
595
248
  total: -1
596
249
  };
597
- for (const E of g.exports)
598
- I.has(E) && (!a.mapping[E] || g.exports.length !== 1) && (a.mapping[E] = d);
599
- const s = g.imports.filter((E) => g.code.includes(e.basename(E))).map((E) => f(E)).filter((E) => E !== b && E !== n && E !== v).filter(Boolean);
600
- s.length > 0 && (u.imports = s);
601
- const p = g.dynamicImports.filter((E) => g.code.includes(e.basename(E))).map((E) => f(E)).filter(Boolean);
602
- p.length > 0 && (u.dynamicImports = p), g.facadeModuleId && (rt.test(g.facadeModuleId) ? a.preloader = d : ot.test(g.facadeModuleId) ? a.core = d : it.test(g.facadeModuleId) && (a.qwikLoader = d));
603
- const S = (g.moduleIds || Object.keys(g.modules)).filter((E) => !E.startsWith("\0")).map((E) => e.relative(o.rootDir, E));
604
- S.length > 0 && (u.origins = S, !a.preloader && S.some((E) => rt.test(E)) && (a.preloader = d), !a.core && S.some((E) => ot.test(E)) && (a.core = d), !a.qwikLoader && S.some((E) => it.test(E)) && (a.qwikLoader = d)), a.bundles[d] = u;
605
- }
606
- for (const g of t) {
607
- const d = g.name, y = a.mapping[d];
608
- if (!y) {
609
- m(`Note: qrl ${g.name} is not in the bundle, likely tree shaken`, a);
250
+ for (const k of d.exports)
251
+ v.has(k) && (!l.mapping[k] || d.exports.length !== 1) && (l.mapping[k] = s);
252
+ const y = d.imports.filter((k) => d.code.includes(e.basename(k))).map((k) => f(k)).filter((k) => k !== g && k !== t && k !== m).filter(Boolean);
253
+ y.length > 0 && (c.imports = y);
254
+ const M = d.dynamicImports.filter((k) => d.code.includes(e.basename(k))).map((k) => f(k)).filter(Boolean);
255
+ M.length > 0 && (c.dynamicImports = M), d.facadeModuleId && (tt.test(d.facadeModuleId) ? l.preloader = s : nt.test(d.facadeModuleId) ? l.core = s : rt.test(d.facadeModuleId) && (l.qwikLoader = s));
256
+ const O = (d.moduleIds || Object.keys(d.modules)).filter((k) => !k.startsWith("\0")).map((k) => e.relative(o.rootDir, k));
257
+ O.length > 0 && (c.origins = O, !l.preloader && O.some((k) => tt.test(k)) && (l.preloader = s), !l.core && O.some((k) => nt.test(k)) && (l.core = s), !l.qwikLoader && O.some((k) => rt.test(k)) && (l.qwikLoader = s)), l.bundles[s] = c;
258
+ }
259
+ for (const d of n) {
260
+ const s = d.name, p = l.mapping[s];
261
+ if (!p) {
262
+ u(`Note: qrl ${d.name} is not in the bundle, likely tree shaken`, l);
610
263
  continue;
611
264
  }
612
- (a.bundles[y].symbols ||= []).push(d), a.symbols[d] = {
613
- displayName: g.displayName,
614
- hash: g.hash,
615
- ctxKind: g.ctxKind,
616
- ctxName: g.ctxName,
617
- captures: g.captures,
618
- canonicalFilename: g.canonicalFilename,
619
- parent: g.parent,
620
- origin: g.origin,
621
- loc: g.loc,
622
- paramNames: g.paramNames,
623
- captureNames: g.captureNames
265
+ (l.bundles[p].symbols ||= []).push(s), l.symbols[s] = {
266
+ displayName: d.displayName,
267
+ hash: d.hash,
268
+ ctxKind: d.ctxKind,
269
+ ctxName: d.ctxName,
270
+ captures: d.captures,
271
+ canonicalFilename: d.canonicalFilename,
272
+ parent: d.parent,
273
+ origin: d.origin,
274
+ loc: d.loc,
275
+ paramNames: d.paramNames,
276
+ captureNames: d.captureNames
624
277
  };
625
278
  }
626
- if (v)
627
- for (const g of Ht)
628
- a.symbols[g] = {
279
+ if (m)
280
+ for (const d of Ut)
281
+ l.symbols[d] = {
629
282
  origin: "Qwik core",
630
- displayName: g,
283
+ displayName: d,
631
284
  canonicalFilename: "",
632
- hash: g,
285
+ hash: d,
633
286
  ctxKind: "function",
634
- ctxName: g,
287
+ ctxName: d,
635
288
  captures: !1,
636
289
  parent: null,
637
290
  loc: [0, 0]
638
- }, a.mapping[g] = v;
291
+ }, l.mapping[d] = m;
639
292
  else
640
293
  console.error("Qwik core bundle not found, is Qwik actually used in this project?");
641
- for (const g of Object.values(a.bundles)) {
642
- const d = Kt(g, a);
643
- g.interactivity = d;
294
+ for (const d of Object.values(l.bundles)) {
295
+ const s = $t(d, l);
296
+ d.interactivity = s;
644
297
  }
645
- return Jt(a.bundles), Qt(a);
298
+ return zt(l.bundles), Ft(l);
646
299
  }
647
- const Xt = 300, Vt = 0.5 / (Xt * 1024 / 8), Zt = (e) => {
648
- const t = e.lastIndexOf("_");
649
- return t > -1 ? e.slice(t + 1) : e;
300
+ const Ht = 300, Wt = 0.5 / (Ht * 1024 / 8), Gt = (e) => {
301
+ const n = e.lastIndexOf("_");
302
+ return n > -1 ? e.slice(n + 1) : e;
650
303
  };
651
- function en(e, t) {
304
+ function Kt(e, n) {
652
305
  const i = [];
653
306
  if (!e.bundles)
654
307
  return [];
655
308
  const r = { ...e.bundles };
656
- for (const [f, n] of Object.entries(e.mapping)) {
309
+ for (const [f, t] of Object.entries(e.mapping)) {
657
310
  if (f.startsWith("_") && f.length < 10)
658
311
  continue;
659
- const b = Zt(f);
660
- b && (r[b] = { dynamicImports: [n] });
312
+ const g = Gt(f);
313
+ g && (r[g] = { dynamicImports: [t] });
661
314
  }
662
- if (t) {
315
+ if (n) {
663
316
  const f = { ...e, bundles: r };
664
- for (const n of t) {
665
- const b = n(f);
666
- b && Object.assign(r, b);
317
+ for (const t of n) {
318
+ const g = t(f);
319
+ g && Object.assign(r, g);
667
320
  }
668
321
  }
669
322
  for (const f of Object.keys(r)) {
670
- const n = r[f], b = n.imports?.filter((I) => r[I]) || [], v = n.dynamicImports?.filter(
323
+ const t = r[f], g = t.imports?.filter((v) => r[v]) || [], m = t.dynamicImports?.filter(
671
324
  // we only want to include dynamic imports that belong to the app
672
325
  // e.g. not all languages supported by shiki
673
- (I) => r[I] && // either there are qrls
674
- (r[I].symbols || // or it's a dynamic import from the app source
675
- r[I].origins?.some((g) => !g.includes("node_modules")))
326
+ (v) => r[v] && // either there are qrls
327
+ (r[v].symbols || // or it's a dynamic import from the app source
328
+ r[v].origins?.some((d) => !d.includes("node_modules")))
676
329
  ) || [];
677
330
  r[f] = {
678
- ...n,
679
- imports: b,
680
- dynamicImports: v
331
+ ...t,
332
+ imports: g,
333
+ dynamicImports: m
681
334
  };
682
335
  }
683
336
  const o = new Set(Object.keys(r));
684
337
  for (const f of Object.keys(r)) {
685
- for (const n of r[f].imports)
686
- o.delete(n);
687
- for (const n of r[f].dynamicImports)
688
- o.delete(n);
338
+ for (const t of r[f].imports)
339
+ o.delete(t);
340
+ for (const t of r[f].dynamicImports)
341
+ o.delete(t);
689
342
  }
690
343
  for (const f of o) {
691
- const n = r[f];
692
- !n.imports?.length && !n.dynamicImports?.length && delete r[f];
344
+ const t = r[f];
345
+ !t.imports?.length && !t.dynamicImports?.length && delete r[f];
693
346
  }
694
- const m = Object.keys(r), l = /* @__PURE__ */ new Map(), a = (f, n, b = /* @__PURE__ */ new Set()) => {
695
- const v = r[n];
696
- for (const I of v.imports)
697
- f.has(I) && f.delete(I), b.has(I) || (b.add(I), a(f, I, b));
347
+ const u = Object.keys(r), a = /* @__PURE__ */ new Map(), l = (f, t, g = /* @__PURE__ */ new Set()) => {
348
+ const m = r[t];
349
+ for (const v of m.imports)
350
+ f.has(v) && f.delete(v), g.has(v) || (g.add(v), l(f, v, g));
698
351
  };
699
- for (const f of m) {
700
- const n = r[f], b = new Set(n.imports);
701
- for (const d of b)
702
- a(b, d);
703
- const v = new Set(n.dynamicImports), I = /* @__PURE__ */ new Map();
704
- for (const d of v) {
705
- a(v, d);
706
- const y = r[d];
707
- let u = 0.5;
708
- if (u += (y.interactivity || 0) * 0.08, n.origins && y.origins) {
709
- for (const s of n.origins)
710
- if (y.origins.some((p) => p.startsWith(s))) {
711
- u += 0.25;
352
+ for (const f of u) {
353
+ const t = r[f], g = new Set(t.imports);
354
+ for (const s of g)
355
+ l(g, s);
356
+ const m = new Set(t.dynamicImports), v = /* @__PURE__ */ new Map();
357
+ for (const s of m) {
358
+ l(m, s);
359
+ const p = r[s];
360
+ let c = 0.5;
361
+ if (c += (p.interactivity || 0) * 0.08, t.origins && p.origins) {
362
+ for (const y of t.origins)
363
+ if (p.origins.some((M) => M.startsWith(y))) {
364
+ c += 0.25;
712
365
  break;
713
366
  }
714
367
  }
715
- y.total > Vt && (u += u > 0.5 ? 0.02 : -0.02), y.total < 1e3 && (u += 0.15), I.set(d, Math.min(u, 0.99));
368
+ p.total > Wt && (c += c > 0.5 ? 0.02 : -0.02), p.total < 1e3 && (c += 0.15), v.set(s, Math.min(c, 0.99));
716
369
  }
717
- if (v.size > 0) {
718
- const d = Array.from(v).sort(
719
- (u, s) => I.get(s) - I.get(u)
370
+ if (m.size > 0) {
371
+ const s = Array.from(m).sort(
372
+ (c, y) => v.get(y) - v.get(c)
720
373
  );
721
- let y = -1;
722
- for (const u of d)
723
- I.get(u) !== y && (y = I.get(u), b.add(-Math.round(y * 10))), b.add(u);
374
+ let p = -1;
375
+ for (const c of s)
376
+ v.get(c) !== p && (p = v.get(c), g.add(-Math.round(p * 10))), g.add(c);
724
377
  }
725
- const g = i.length;
378
+ const d = i.length;
726
379
  i.push(f);
727
- for (let d = 0; d < b.size; d++)
380
+ for (let s = 0; s < g.size; s++)
728
381
  i.push(null);
729
- l.set(f, { index: g, deps: b });
730
- }
731
- for (const f of m) {
732
- const n = l.get(f);
733
- let { index: b, deps: v } = n;
734
- b++;
735
- for (const I of v) {
736
- if (typeof I == "number") {
737
- i[b++] = I;
382
+ a.set(f, { index: d, deps: g });
383
+ }
384
+ for (const f of u) {
385
+ const t = a.get(f);
386
+ let { index: g, deps: m } = t;
387
+ g++;
388
+ for (const v of m) {
389
+ if (typeof v == "number") {
390
+ i[g++] = v;
738
391
  continue;
739
392
  }
740
- const d = l.get(I).index;
741
- i[b++] = d;
393
+ const s = a.get(v).index;
394
+ i[g++] = s;
742
395
  }
743
396
  }
744
397
  return i;
745
398
  }
746
- async function tn(e, t, i) {
399
+ async function Qt(e, n, i) {
747
400
  const r = await e.dynamicImport("eslint");
748
401
  let o = new r.ESLint({ cache: !0 });
749
402
  if ((await o.calculateConfigForFile("no-real-file.tsx")).parser === null) {
750
- const a = {
403
+ const l = {
751
404
  cache: !0,
752
405
  overrideConfig: {
753
406
  languageOptions: {
754
407
  parserOptions: {
755
- tsconfigRootDir: t,
408
+ tsconfigRootDir: n,
756
409
  project: i,
757
410
  ecmaVersion: 2021,
758
411
  sourceType: "module",
@@ -763,77 +416,77 @@ async function tn(e, t, i) {
763
416
  }
764
417
  }
765
418
  };
766
- o = new r.ESLint(a);
419
+ o = new r.ESLint(l);
767
420
  }
768
421
  return {
769
- async lint(a, f, n) {
422
+ async lint(l, f, t) {
770
423
  try {
771
- const b = nn(n);
772
- if (await o.isPathIgnored(b))
424
+ const g = Jt(t);
425
+ if (await o.isPathIgnored(g))
773
426
  return null;
774
427
  (await o.lintText(f, {
775
- filePath: b
776
- })).forEach((I) => {
777
- for (const g of I.messages) {
778
- if (g.ruleId != null && !g.ruleId.startsWith("qwik/"))
428
+ filePath: g
429
+ })).forEach((v) => {
430
+ for (const d of v.messages) {
431
+ if (d.ruleId != null && !d.ruleId.startsWith("qwik/"))
779
432
  continue;
780
- const d = rn(I.filePath, g);
781
- a.warn(d);
433
+ const s = Yt(v.filePath, d);
434
+ l.warn(s);
782
435
  }
783
436
  });
784
- } catch (b) {
785
- console.warn(b);
437
+ } catch (g) {
438
+ console.warn(g);
786
439
  }
787
440
  }
788
441
  };
789
442
  }
790
- function nn(e) {
443
+ function Jt(e) {
791
444
  return e.split("?", 2)[0];
792
445
  }
793
- function rn(e, t) {
794
- return Object.assign(new Error(t.message), {
446
+ function Yt(e, n) {
447
+ return Object.assign(new Error(n.message), {
795
448
  id: e,
796
449
  plugin: "vite-plugin-eslint",
797
450
  loc: {
798
451
  file: e,
799
- column: t.column,
800
- line: t.line
452
+ column: n.column,
453
+ line: n.line
801
454
  },
802
455
  stack: ""
803
456
  });
804
457
  }
805
- async function on(e, t) {
806
- const i = t;
458
+ async function Xt(e, n) {
459
+ const i = n;
807
460
  let r = i.loc;
808
- if (!i.frame && !i.plugin && (r || (r = sn(i)), r && (i.loc = r, r.file))) {
809
- const o = await e.dynamicImport("node:fs"), { normalizePath: m } = await e.dynamicImport("vite");
810
- i.id = m(i.loc.file);
461
+ if (!i.frame && !i.plugin && (r || (r = Vt(i)), r && (i.loc = r, r.file))) {
462
+ const o = await e.dynamicImport("node:fs"), { normalizePath: u } = await e.dynamicImport("vite");
463
+ i.id = u(i.loc.file);
811
464
  try {
812
- const l = o.readFileSync(i.loc.file, "utf-8");
813
- i.frame = ln(l, i.loc);
465
+ const a = o.readFileSync(i.loc.file, "utf-8");
466
+ i.frame = en(a, i.loc);
814
467
  } catch {
815
468
  }
816
469
  }
817
- return t;
470
+ return n;
818
471
  }
819
- const sn = (e) => {
820
- const t = e.stack;
821
- if (typeof t == "string") {
822
- const i = t.split(`
472
+ const Vt = (e) => {
473
+ const n = e.stack;
474
+ if (typeof n == "string") {
475
+ const i = n.split(`
823
476
  `).filter((r) => !r.includes("/node_modules/") && !r.includes("(node:"));
824
477
  for (let r = 1; r < i.length; r++) {
825
478
  const o = i[r].replace("file:///", "/");
826
479
  if (/^\s+at/.test(o)) {
827
- const m = o.indexOf("/"), l = o.lastIndexOf(")", m);
828
- if (m > 0) {
829
- const f = o.slice(m, l).split(":"), n = st(f[f.length - 1]), b = st(f[f.length - 2]);
830
- return typeof n == "number" && typeof b == "number" ? (f.length -= 2, {
480
+ const u = o.indexOf("/"), a = o.lastIndexOf(")", u);
481
+ if (u > 0) {
482
+ const f = o.slice(u, a).split(":"), t = ot(f[f.length - 1]), g = ot(f[f.length - 2]);
483
+ return typeof t == "number" && typeof g == "number" ? (f.length -= 2, {
831
484
  file: f.join(":"),
832
- line: b,
833
- column: n
834
- }) : typeof n == "number" ? (f.length -= 1, {
485
+ line: g,
486
+ column: t
487
+ }) : typeof t == "number" ? (f.length -= 1, {
835
488
  file: f.join(":"),
836
- line: n,
489
+ line: t,
837
490
  column: void 0
838
491
  }) : {
839
492
  file: f.join(":"),
@@ -844,66 +497,66 @@ const sn = (e) => {
844
497
  }
845
498
  }
846
499
  }
847
- }, ne = (e) => e.startsWith("\0"), st = (e) => {
500
+ }, oe = (e) => e.startsWith("\0"), ot = (e) => {
848
501
  try {
849
502
  return parseInt(e, 10);
850
503
  } catch {
851
504
  return;
852
505
  }
853
- }, Ct = /\r?\n/, at = 2;
854
- function an(e, t) {
855
- if (typeof t == "number")
856
- return t;
857
- if (t.lo != null)
858
- return t.lo;
859
- const i = e.split(Ct), { line: r, column: o } = t;
860
- let m = 0;
861
- for (let l = 0; l < r - 1 && l < i.length; l++)
862
- m += i[l].length + 1;
863
- return m + o;
506
+ }, kt = /\r?\n/, it = 2;
507
+ function Zt(e, n) {
508
+ if (typeof n == "number")
509
+ return n;
510
+ if (n.lo != null)
511
+ return n.lo;
512
+ const i = e.split(kt), { line: r, column: o } = n;
513
+ let u = 0;
514
+ for (let a = 0; a < r - 1 && a < i.length; a++)
515
+ u += i[a].length + 1;
516
+ return u + o;
864
517
  }
865
- function ln(e, t = 0, i) {
866
- t = an(e, t), i = i || t;
867
- const r = e.split(Ct);
518
+ function en(e, n = 0, i) {
519
+ n = Zt(e, n), i = i || n;
520
+ const r = e.split(kt);
868
521
  let o = 0;
869
- const m = [];
870
- for (let l = 0; l < r.length; l++)
871
- if (o += r[l].length + 1, o >= t) {
872
- for (let a = l - at; a <= l + at || i > o; a++) {
873
- if (a < 0 || a >= r.length)
522
+ const u = [];
523
+ for (let a = 0; a < r.length; a++)
524
+ if (o += r[a].length + 1, o >= n) {
525
+ for (let l = a - it; l <= a + it || i > o; l++) {
526
+ if (l < 0 || l >= r.length)
874
527
  continue;
875
- const f = a + 1;
876
- m.push(`${f}${" ".repeat(Math.max(3 - String(f).length, 0))}| ${r[a]}`);
877
- const n = r[a].length;
878
- if (a === l) {
879
- const b = Math.max(t - (o - n) + 1, 0), v = Math.max(1, i > o ? n - b : i - t);
880
- m.push(" | " + " ".repeat(b) + "^".repeat(v));
881
- } else if (a > l) {
528
+ const f = l + 1;
529
+ u.push(`${f}${" ".repeat(Math.max(3 - String(f).length, 0))}| ${r[l]}`);
530
+ const t = r[l].length;
531
+ if (l === a) {
532
+ const g = Math.max(n - (o - t) + 1, 0), m = Math.max(1, i > o ? t - g : i - n);
533
+ u.push(" | " + " ".repeat(g) + "^".repeat(m));
534
+ } else if (l > a) {
882
535
  if (i > o) {
883
- const b = Math.max(Math.min(i - o, n), 1);
884
- m.push(" | " + "^".repeat(b));
536
+ const g = Math.max(Math.min(i - o, t), 1);
537
+ u.push(" | " + "^".repeat(g));
885
538
  }
886
- o += n + 1;
539
+ o += t + 1;
887
540
  }
888
541
  }
889
542
  break;
890
543
  }
891
- return m.join(`
544
+ return u.join(`
892
545
  `);
893
546
  }
894
- function cn(e) {
547
+ function tn(e) {
895
548
  return e === "win32";
896
549
  }
897
- function Re(e) {
898
- const [t, i] = e.split("?"), r = i || "";
550
+ function Ue(e) {
551
+ const [n, i] = e.split("?"), r = i || "";
899
552
  return {
900
553
  originalId: e,
901
- pathId: t,
554
+ pathId: n,
902
555
  query: r ? `?${i}` : "",
903
556
  params: new URLSearchParams(r)
904
557
  };
905
558
  }
906
- const dn = ["server"], un = [
559
+ const nn = ["server"], rn = [
907
560
  "onGet",
908
561
  "onPost",
909
562
  "onPut",
@@ -913,7 +566,7 @@ const dn = ["server"], un = [
913
566
  "onOptions",
914
567
  "onPatch",
915
568
  "onStaticGenerate"
916
- ], fn = [
569
+ ], on = [
917
570
  "useServer",
918
571
  "route",
919
572
  "server",
@@ -922,7 +575,7 @@ const dn = ["server"], un = [
922
575
  "zod$",
923
576
  "validator$",
924
577
  "globalAction$"
925
- ], pn = [
578
+ ], sn = [
926
579
  "useClient",
927
580
  "useBrowser",
928
581
  "useVisibleTask",
@@ -930,12 +583,12 @@ const dn = ["server"], un = [
930
583
  "browser",
931
584
  "event$"
932
585
  ];
933
- var Pt = /* @__PURE__ */ ((e) => (e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(Pt || {});
934
- function Dt(e = {}) {
935
- const t = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
936
- let l = null, a, f = () => {
586
+ var _t = /* @__PURE__ */ ((e) => (e.each = "each", e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(_t || {});
587
+ function Tt(e = {}) {
588
+ const n = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
589
+ let a = null, l, f = () => {
937
590
  };
938
- const n = {
591
+ const t = {
939
592
  csr: !1,
940
593
  target: "client",
941
594
  buildMode: "development",
@@ -965,137 +618,140 @@ function Dt(e = {}) {
965
618
  lint: !1,
966
619
  experimental: void 0
967
620
  };
968
- let b, v;
969
- const I = async () => {
970
- if (!l && (l = await At(e), b = mn(l.sys), l.sys.env !== "browsermain" && l.sys.env !== "webworker"))
971
- try {
972
- v === void 0 && (v = await l.sys.dynamicImport("node:fs"));
973
- } catch {
974
- console.log("node:fs not available, disabling automatic manifest reading"), v = null;
975
- }
976
- }, g = () => {
977
- if (!l)
621
+ let g, m;
622
+ const v = async () => {
623
+ if (!a) {
624
+ const w = (e._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
625
+ if (a = await w(e), g = an(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
626
+ try {
627
+ m === void 0 && (m = await a.sys.dynamicImport("node:fs"));
628
+ } catch {
629
+ console.log("node:fs not available, disabling automatic manifest reading"), m = null;
630
+ }
631
+ }
632
+ }, d = () => {
633
+ if (!a)
978
634
  throw new Error("Qwik plugin has not been initialized");
979
- return l;
980
- }, d = () => g().sys, y = () => g().sys.path;
981
- let u;
982
- const s = (k) => {
983
- u = k;
984
- }, p = async (k) => {
985
- const h = Object.assign({}, k), P = g(), q = P.sys.path, M = (...U) => K(q.resolve(...U));
986
- n.debug = !!h.debug, h.devTools && (n.devTools = {
987
- ...n.devTools,
635
+ return a;
636
+ }, s = () => d().sys, p = () => d().sys.path;
637
+ let c;
638
+ const y = (w) => {
639
+ c = w;
640
+ }, M = async (w) => {
641
+ const h = Object.assign({}, w), S = d(), T = S.sys.path, _ = (...q) => G(T.resolve(...q));
642
+ t.debug = !!h.debug, h.devTools && (t.devTools = {
643
+ ...t.devTools,
988
644
  ...h.devTools
989
- }), h.assetsDir && (n.assetsDir = h.assetsDir), h.target === "ssr" || h.target === "client" || h.target === "lib" || h.target === "test" ? n.target = h.target : n.target ||= "client", n.target === "lib" ? n.buildMode = "development" : h.buildMode === "production" || h.buildMode === "development" ? n.buildMode = h.buildMode : n.buildMode ||= "development", n.csr = !!h.csr, h.entryStrategy && typeof h.entryStrategy == "object" && (n.entryStrategy = { ...h.entryStrategy }), n.entryStrategy || (n.target === "ssr" || n.target === "test" ? n.entryStrategy = { type: "hoist" } : n.target === "lib" ? n.entryStrategy = { type: "inline" } : n.buildMode === "production" ? n.entryStrategy = { type: "smart" } : n.entryStrategy = { type: "segment" }), typeof h.rootDir == "string" && (n.rootDir = h.rootDir), typeof n.rootDir != "string" && (n.rootDir ||= P.sys.cwd()), n.rootDir = M(P.sys.cwd(), n.rootDir);
990
- let C = M(n.rootDir, yn);
991
- if (typeof h.srcDir == "string" ? (n.srcDir = M(n.rootDir, h.srcDir), C = n.srcDir) : n.srcDir ||= C, n.srcDir = M(n.rootDir, n.srcDir), Array.isArray(h.tsconfigFileNames) && h.tsconfigFileNames.length > 0 && (n.tsconfigFileNames = h.tsconfigFileNames), !n.csr && !h.input && !n.input && (n.target === "ssr" ? n.input = [M(C, "entry.ssr")] : n.target === "client" ? n.input = [M(C, "root")] : n.input = void 0), h.outDir && (n.outDir = M(n.rootDir, h.outDir)), n.clientOutDir = M(n.rootDir, h.clientOutDir || lt), n.ssrOutDir = M(n.rootDir, h.ssrOutDir || vn), n.target === "ssr" ? n.outDir ||= n.ssrOutDir : n.target === "lib" ? n.outDir ||= M(n.rootDir, bn) : n.outDir ||= n.clientOutDir, typeof h.manifestOutput == "function" && (n.manifestOutput = h.manifestOutput), h.manifestInput && (n.manifestInput = nt(h.manifestInput) || null), typeof h.transformedModuleOutput == "function" && (n.transformedModuleOutput = h.transformedModuleOutput), h.scope !== void 0)
992
- n.scope = h.scope;
993
- else if (!n.scope && v) {
994
- let U = "";
645
+ }), h.assetsDir && (t.assetsDir = h.assetsDir), h.target === "ssr" || h.target === "client" || h.target === "lib" || h.target === "test" ? t.target = h.target : t.target ||= "client", t.target === "lib" ? t.buildMode = "development" : h.buildMode === "production" || h.buildMode === "development" ? t.buildMode = h.buildMode : t.buildMode ||= "development", t.csr = !!h.csr, h.entryStrategy && typeof h.entryStrategy == "object" && (t.entryStrategy = { ...h.entryStrategy }), t.entryStrategy || (t.target === "ssr" || t.target === "test" ? t.entryStrategy = { type: "hoist" } : t.target === "lib" ? t.entryStrategy = { type: "inline" } : t.buildMode === "production" ? t.entryStrategy = { type: "smart" } : t.entryStrategy = { type: "segment" }), typeof h.rootDir == "string" && (t.rootDir = h.rootDir), typeof t.rootDir != "string" && (t.rootDir ||= S.sys.cwd()), t.rootDir = _(S.sys.cwd(), t.rootDir);
646
+ let I = _(t.rootDir, dn);
647
+ if (typeof h.srcDir == "string" ? (t.srcDir = _(t.rootDir, h.srcDir), I = t.srcDir) : t.srcDir ||= I, t.srcDir = _(t.rootDir, t.srcDir), Array.isArray(h.tsconfigFileNames) && h.tsconfigFileNames.length > 0 && (t.tsconfigFileNames = h.tsconfigFileNames), !t.csr && !h.input && !t.input && (t.target === "ssr" ? t.input = [_(I, "entry.ssr")] : t.target === "client" ? t.input = [_(I, "root")] : t.input = void 0), h.outDir && (t.outDir = _(t.rootDir, h.outDir)), t.clientOutDir = _(t.rootDir, h.clientOutDir || st), t.ssrOutDir = _(t.rootDir, h.ssrOutDir || un), t.target === "ssr" ? t.outDir ||= t.ssrOutDir : t.target === "lib" ? t.outDir ||= _(t.rootDir, fn) : t.outDir ||= t.clientOutDir, typeof h.manifestOutput == "function" && (t.manifestOutput = h.manifestOutput), h.manifestInput && (t.manifestInput = et(h.manifestInput) || null), typeof h.transformedModuleOutput == "function" && (t.transformedModuleOutput = h.transformedModuleOutput), h.scope !== void 0)
648
+ t.scope = h.scope;
649
+ else if (!t.scope && m) {
650
+ let q = "";
995
651
  try {
996
- let R = n.rootDir;
997
- for (; U = q.resolve(R, "package.json"), !await v.promises.stat(U).catch(() => !1); ) {
998
- const O = q.resolve(R, "..");
999
- if (O === R)
652
+ let L = t.rootDir;
653
+ for (; q = T.resolve(L, "package.json"), !await m.promises.stat(q).catch(() => !1); ) {
654
+ const C = T.resolve(L, "..");
655
+ if (C === L)
1000
656
  break;
1001
- R = O, U = "";
657
+ L = C, q = "";
1002
658
  }
1003
- if (U) {
1004
- const O = await v.promises.readFile(U, "utf-8"), L = JSON.parse(O);
1005
- typeof L.name == "string" && (n.scope = L.name);
659
+ if (q) {
660
+ const C = await m.promises.readFile(q, "utf-8"), D = JSON.parse(C);
661
+ typeof D.name == "string" && (t.scope = D.name);
1006
662
  }
1007
- } catch (R) {
663
+ } catch (L) {
1008
664
  console.warn(
1009
- `could not read ${U || "package.json"} to determine package name, ignoring. (${R})`
665
+ `could not read ${q || "package.json"} to determine package name, ignoring. (${L})`
1010
666
  );
1011
667
  }
1012
668
  }
1013
- if (typeof h.resolveQwikBuild == "boolean" && (n.resolveQwikBuild = h.resolveQwikBuild), typeof h.devTools == "object" && ("imageDevTools" in h.devTools && (n.devTools.imageDevTools = h.devTools.imageDevTools), "clickToSource" in h.devTools && (n.devTools.clickToSource = h.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? n.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof n.inlineStylesUpToBytes != "number" || n.inlineStylesUpToBytes < 0) && (n.inlineStylesUpToBytes = 0)), typeof h.lint == "boolean" && (n.lint = h.lint), "experimental" in h) {
1014
- n.experimental = void 0;
1015
- for (const U of h.experimental ?? [])
1016
- Pt[U] ? (n.experimental ||= {})[U] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${U}`);
669
+ if (typeof h.resolveQwikBuild == "boolean" && (t.resolveQwikBuild = h.resolveQwikBuild), typeof h.devTools == "object" && ("imageDevTools" in h.devTools && (t.devTools.imageDevTools = h.devTools.imageDevTools), "clickToSource" in h.devTools && (t.devTools.clickToSource = h.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? t.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof t.inlineStylesUpToBytes != "number" || t.inlineStylesUpToBytes < 0) && (t.inlineStylesUpToBytes = 0)), typeof h.lint == "boolean" && (t.lint = h.lint), "experimental" in h) {
670
+ t.experimental = void 0;
671
+ for (const q of h.experimental ?? [])
672
+ _t[q] ? (t.experimental ||= {})[q] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${q}`);
1017
673
  }
1018
- const A = { ...n };
1019
- return n.input ||= h.input, n.input && typeof n.input == "string" && (n.input = [n.input]), A;
674
+ const B = { ...t };
675
+ return t.input ||= h.input, t.input && typeof t.input == "string" && (t.input = [t.input]), B;
1020
676
  };
1021
- let _ = !1;
1022
- const S = async (k) => {
1023
- if (!_) {
1024
- _ = !0;
1025
- const h = d();
677
+ let K = !1;
678
+ const O = async (w) => {
679
+ if (!K) {
680
+ K = !0;
681
+ const h = s();
1026
682
  if (h.env === "node") {
1027
- const P = await h.dynamicImport("node:fs");
1028
- if (!P.existsSync(n.rootDir))
1029
- throw new Error(`Qwik rootDir "${n.rootDir}" not found.`);
1030
- if (typeof n.srcDir == "string" && !P.existsSync(n.srcDir))
1031
- throw new Error(`Qwik srcDir "${n.srcDir}" not found.`);
1032
- for (const [q, M] of Object.entries(n.input || {}))
1033
- if (!await k(M))
1034
- throw new Error(`Qwik input "${M}" not found.`);
683
+ const S = await h.dynamicImport("node:fs");
684
+ if (!S.existsSync(t.rootDir))
685
+ throw new Error(`Qwik rootDir "${t.rootDir}" not found.`);
686
+ if (typeof t.srcDir == "string" && !S.existsSync(t.srcDir))
687
+ throw new Error(`Qwik srcDir "${t.srcDir}" not found.`);
688
+ for (const [T, _] of Object.entries(t.input || {}))
689
+ if (!await w(_))
690
+ throw new Error(`Qwik input "${_}" not found.`);
1035
691
  }
1036
692
  }
1037
693
  };
1038
- let E, c = !1;
1039
- const w = async (k) => {
1040
- if (j("buildStart()", n.buildMode, n.scope, n.target, n.rootDir, n.srcDir), E = g(), c = !u, E.sys.env === "node" && n.target === "ssr" && n.lint)
694
+ let k, b = !1;
695
+ const E = async (w) => {
696
+ if (N("buildStart()", t.buildMode, t.scope, t.target, t.rootDir, t.srcDir), k = d(), b = !c, k.sys.env === "node" && t.target === "ssr" && t.lint)
1041
697
  try {
1042
- a = await tn(E.sys, n.rootDir, n.tsconfigFileNames);
698
+ l = await Qt(k.sys, t.rootDir, t.tsconfigFileNames);
1043
699
  } catch {
1044
700
  }
1045
- if (j("transformedOutputs.clear()"), r.clear(), o.clear(), n.target === "client") {
1046
- const h = await k.resolve("@qwik.dev/core/qwikloader.js", void 0, {
701
+ if (N("transformedOutputs.clear()"), r.clear(), o.clear(), t.target === "client") {
702
+ const h = await w.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1047
703
  skipSelf: !0
1048
704
  });
1049
- h && k.emitFile({
705
+ h && w.emitFile({
1050
706
  id: h.id,
1051
707
  type: "chunk",
1052
708
  preserveSignature: "allow-extension"
1053
709
  });
1054
710
  }
1055
- }, x = (k, h) => k.environment ? k.environment.config.consumer === "server" : u ? !!h?.ssr : n.target === "ssr" || n.target === "test";
1056
- let N = 0, D = !1;
1057
- const T = async (k, h, P, q) => {
1058
- if (ne(h))
711
+ }, x = (w, h) => w.environment ? w.environment.config.consumer === "server" : c ? !!h?.ssr : t.target === "ssr" || t.target === "test";
712
+ let U = 0, P = !1;
713
+ const j = async (w, h, S, T) => {
714
+ if (oe(h))
1059
715
  return;
1060
- const M = u && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(h);
1061
- if (M) {
1062
- if (!D) {
1063
- D = !0, setTimeout(() => D = !1, 500);
1064
- const [, H, W] = M, oe = await k.resolve(H, P);
1065
- if (oe) {
1066
- const ie = k.environment.moduleGraph.getModuleById(oe.id)?.file;
716
+ const _ = c && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(h);
717
+ if (_) {
718
+ if (!P) {
719
+ P = !0, setTimeout(() => P = !1, 500);
720
+ const [, $, z] = _, ne = await w.resolve($, S);
721
+ if (ne) {
722
+ const ie = w.environment.moduleGraph.getModuleById(ne.id)?.file;
1067
723
  if (ie) {
1068
- const V = `${ie}${W}`;
724
+ const ee = `${ie}${z}`;
1069
725
  try {
1070
- console.warn(`Opening in editor: ${V}`);
1071
- const se = (await import("launch-editor")).default;
1072
- se(V);
1073
- } catch (se) {
1074
- console.error(`Failed to open editor: ${se.message}`);
726
+ console.warn(`Opening in editor: ${ee}`);
727
+ const V = (await import("launch-editor")).default;
728
+ V(ee);
729
+ } catch (V) {
730
+ console.error(`Failed to open editor: ${V.message}`);
1075
731
  }
1076
732
  }
1077
733
  }
1078
734
  }
1079
735
  return { id: "\0editor" };
1080
736
  }
1081
- const C = N++, A = x(k, q);
1082
- j(`resolveId(${C})`, `begin ${h} | ${A ? "server" : "client"} | ${P}`);
1083
- const U = P && Re(P);
1084
- if (P = U && K(U.pathId), h.startsWith(".") && U) {
1085
- const H = y(), W = H.dirname(U.pathId);
1086
- W && (h = H.resolve(W, h));
737
+ const I = U++, B = x(w, T);
738
+ N(`resolveId(${I})`, `begin ${h} | ${B ? "server" : "client"} | ${S}`);
739
+ const q = S && Ue(S);
740
+ if (S = q && G(q.pathId), h.startsWith(".") && q) {
741
+ const $ = p(), z = $.dirname(q.pathId);
742
+ z && (h = $.resolve(z, h));
1087
743
  }
1088
- const R = Re(h), O = K(R.pathId);
1089
- let L;
744
+ const L = Ue(h), C = G(L.pathId);
745
+ let D;
1090
746
  if (
1091
747
  /**
1092
748
  * Check if we know the QRL. During regular builds, we'll encounter and build parents before
1093
749
  * their QRLs, so this will always match.
1094
750
  */
1095
- m.get(O)
751
+ u.get(C)
1096
752
  )
1097
- j(`resolveId(${C}) Resolved already known ${O}`), L = {
1098
- id: O + R.query,
753
+ N(`resolveId(${I}) Resolved already known ${C}`), D = {
754
+ id: C + L.query,
1099
755
  moduleSideEffects: !1
1100
756
  };
1101
757
  else if (
@@ -1104,245 +760,244 @@ function Dt(e = {}) {
1104
760
  * been transformed yet.
1105
761
  */
1106
762
  // We test with endsWith because the dev server adds the base pathname
1107
- O.endsWith(te)
763
+ C.endsWith(re)
1108
764
  )
1109
- n.resolveQwikBuild && (j(`resolveId(${C})`, "Resolved", te), L = {
1110
- id: te,
765
+ t.resolveQwikBuild && (N(`resolveId(${I})`, "Resolved", re), D = {
766
+ id: re,
1111
767
  moduleSideEffects: !1
1112
768
  });
1113
- else if (O.endsWith(ae))
1114
- j(`resolveId(${C})`, "Resolved", ae), L = {
1115
- id: ae,
769
+ else if (C.endsWith(se))
770
+ N(`resolveId(${I})`, "Resolved", se), D = {
771
+ id: se,
1116
772
  moduleSideEffects: !1
1117
773
  };
1118
- else if (!u && !A && O.endsWith(We)) {
1119
- j(`resolveId(${C})`, "Resolved", We);
1120
- const H = await k.resolve(We, P, {
774
+ else if (!c && !B && C.endsWith(ze)) {
775
+ N(`resolveId(${I})`, "Resolved", ze);
776
+ const $ = await w.resolve(ze, S, {
1121
777
  skipSelf: !0
1122
778
  });
1123
- if (H)
1124
- return k.emitFile({
1125
- id: H.id,
779
+ if ($)
780
+ return w.emitFile({
781
+ id: $.id,
1126
782
  type: "chunk",
1127
783
  preserveSignature: "allow-extension"
1128
- }), H;
1129
- } else if (O.endsWith(he))
1130
- j(`resolveId(${C})`, "Resolved", he), L = {
1131
- id: he,
784
+ }), $;
785
+ } else if (C.endsWith(me))
786
+ N(`resolveId(${I})`, "Resolved", me), D = {
787
+ id: me,
1132
788
  moduleSideEffects: !1
1133
789
  };
1134
790
  else {
1135
- if (!A && c && h.endsWith("@qwik.dev/core")) {
1136
- c = !1;
1137
- const W = await k.resolve("@qwik.dev/core/handlers.mjs", P, {
791
+ if (!B && b && h.endsWith("@qwik.dev/core")) {
792
+ b = !1;
793
+ const z = await w.resolve("@qwik.dev/core/handlers.mjs", S, {
1138
794
  skipSelf: !0
1139
795
  });
1140
- if (!W)
796
+ if (!z)
1141
797
  throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
1142
- k.emitFile({
1143
- id: W.id,
798
+ w.emitFile({
799
+ id: z.id,
1144
800
  type: "chunk",
1145
801
  preserveSignature: "allow-extension"
1146
802
  });
1147
803
  }
1148
- const H = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(h)?.groups;
1149
- if (H) {
1150
- const { parent: W, name: oe, query: pe } = H, ie = await k.resolve(W, P, { skipSelf: !0 });
804
+ const $ = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(h)?.groups;
805
+ if ($) {
806
+ const { parent: z, name: ne, query: fe } = $, ie = await w.resolve(z, S, { skipSelf: !0 });
1151
807
  if (ie) {
1152
- const V = ie.id.split("?")[0], Ue = u && P?.endsWith(".html") ? `${V}_${oe}.js` : O;
1153
- j(`resolveId(${C})`, `resolved to QRL ${oe} of ${V}`), m.set(Ue, V), L = {
1154
- id: Ue + pe,
808
+ const ee = ie.id.split("?")[0], le = c && S?.endsWith(".html") ? `${ee}_${ne}.js` : C;
809
+ N(`resolveId(${I})`, `resolved to QRL ${ne} of ${ee}`), u.set(le, ee), D = {
810
+ id: le + fe,
1155
811
  // QRL segments can't have side effects. Probably never useful, but it's here for consistency
1156
812
  moduleSideEffects: !1
1157
813
  };
1158
814
  } else
1159
- console.error(`resolveId(${C})`, `QRL parent ${W} does not exist!`);
1160
- } else if (P) {
1161
- const W = m.get(P);
1162
- if (W)
1163
- return j(`resolveId(${C}) end`, `resolving via ${W}`), k.resolve(h, W, { skipSelf: !0 });
815
+ console.error(`resolveId(${I})`, `QRL parent ${z} does not exist!`);
816
+ } else if (S) {
817
+ const z = u.get(S);
818
+ if (z)
819
+ return N(`resolveId(${I}) end`, `resolving via ${z}`), w.resolve(h, z, { skipSelf: !0 });
1164
820
  }
1165
821
  }
1166
- return j(`resolveId(${C}) end`, L?.id || L), L;
822
+ return N(`resolveId(${I}) end`, D?.id || D), D;
1167
823
  };
1168
- let $ = 0;
1169
- const F = async (k, h, P) => {
824
+ let Q = 0;
825
+ const W = async (w, h, S) => {
1170
826
  if (h === "\0editor")
1171
827
  return '"opening in editor"';
1172
- if (ne(h) || h.startsWith("/@fs/"))
828
+ if (oe(h) || h.startsWith("/@fs/"))
1173
829
  return;
1174
- const q = $++, M = x(k, P);
1175
- if (n.resolveQwikBuild && h === te)
1176
- return j(`load(${q})`, te, n.buildMode), {
830
+ const T = Q++, _ = x(w, S);
831
+ if (t.resolveQwikBuild && h === re)
832
+ return N(`load(${T})`, re, t.buildMode), {
1177
833
  moduleSideEffects: !1,
1178
- code: z(M, n.target)
834
+ code: Z(_, t.target)
1179
835
  };
1180
- if (h === ae)
1181
- return j(`load(${q})`, ae, n.buildMode), {
836
+ if (h === se)
837
+ return N(`load(${T})`, se, t.buildMode), {
1182
838
  moduleSideEffects: !1,
1183
- code: await Le(M)
839
+ code: await qe(_)
1184
840
  };
1185
- if (h === he)
1186
- return j(`load(${q})`, he, n.buildMode), {
841
+ if (h === me)
842
+ return N(`load(${T})`, me, t.buildMode), {
1187
843
  moduleSideEffects: !1,
1188
844
  code: "export * from '@qwik.dev/core';"
1189
845
  };
1190
- const C = Re(h);
1191
- h = K(C.pathId);
1192
- const A = M ? o : r;
1193
- if (u && !A.has(h)) {
1194
- const R = m.get(h);
1195
- if (R) {
1196
- const O = u.moduleGraph.getModuleById(R);
1197
- if (O) {
1198
- if (j(`load(${q})`, "transforming QRL parent", R), await u.transformRequest(O.url), !A.has(h))
1199
- return j(`load(${q})`, `QRL segment ${h} not found in ${R}`), null;
846
+ const I = Ue(h);
847
+ h = G(I.pathId);
848
+ const B = _ ? o : r;
849
+ if (c && !B.has(h)) {
850
+ const L = u.get(h);
851
+ if (L) {
852
+ const C = c.moduleGraph.getModuleById(L);
853
+ if (C) {
854
+ if (N(`load(${T})`, "transforming QRL parent", L), await c.transformRequest(C.url), !B.has(h))
855
+ return N(`load(${T})`, `QRL segment ${h} not found in ${L}`), null;
1200
856
  } else
1201
- console.error(`load(${q})`, `module ${R} does not exist in the build graph!`);
857
+ console.error(`load(${T})`, `module ${L} does not exist in the build graph!`);
1202
858
  }
1203
859
  }
1204
- const U = A.get(h);
1205
- if (U) {
1206
- j(`load(${q})`, "Found", h);
1207
- let { code: R } = U[0];
1208
- const { map: O, segment: L } = U[0], H = U[1];
1209
- if (u?.hot && H && n.devTools.hmr) {
1210
- const oe = "qHmr" + (H.startsWith(n.rootDir) ? H.slice(n.rootDir.length) : H).replace(/[^a-zA-Z0-9_]/g, "_");
1211
- R += `
860
+ const q = B.get(h);
861
+ if (q) {
862
+ N(`load(${T})`, "Found", h);
863
+ let { code: L } = q[0];
864
+ const { map: C, segment: D } = q[0], $ = q[1];
865
+ if (c?.hot && $ && t.devTools.hmr) {
866
+ const ne = "qHmr" + ($.startsWith(t.rootDir) ? $.slice(t.rootDir.length) : $).replace(/[^a-zA-Z0-9_]/g, "_");
867
+ L += `
1212
868
  if (import.meta.hot) {
1213
869
  import.meta.hot.accept(() => {
1214
- document.dispatchEvent(new CustomEvent(${JSON.stringify(oe)}));
870
+ document.dispatchEvent(new CustomEvent(${JSON.stringify(ne)}));
1215
871
  });
1216
872
  }`;
1217
873
  }
1218
- return { code: R, map: O, meta: { segment: L } };
874
+ return { code: L, map: C, meta: { segment: D } };
1219
875
  }
1220
- return j(`load(${q})`, "Not a QRL or virtual module", h), null;
876
+ return N(`load(${T})`, "Not a QRL or virtual module", h), null;
1221
877
  };
1222
- let B = 0;
1223
- const J = async function(k, h, P, q = {}) {
1224
- if (ne(P))
878
+ let R = 0;
879
+ const Y = async function(w, h, S, T = {}) {
880
+ if (oe(S))
1225
881
  return;
1226
- const M = B++, C = x(k, q), A = C ? o : r;
1227
- if (A.has(P))
882
+ const _ = R++, I = x(w, T), B = I ? o : r;
883
+ if (B.has(S))
1228
884
  return;
1229
- const U = g(), R = y(), { pathId: O } = Re(P), L = R.parse(O), H = L.dir, W = L.base;
1230
- if (L.ext.toLowerCase() in gn || Nt.test(O)) {
1231
- const pe = n.target === "client" || n.target === "ssr";
1232
- j(
1233
- `transform(${M})`,
1234
- `Transforming ${P} (for: ${C ? "server" : "client"}${pe ? ", strip" : ""})`
885
+ const q = d(), L = p(), { pathId: C } = Ue(S), D = L.parse(C), $ = D.dir, z = D.base, ne = D.ext.toLowerCase(), fe = t.target === "lib" ? "lib" : t.buildMode === "development" ? c?.hot && t.devTools.hmr ? "hmr" : "dev" : "prod";
886
+ let ie = !1;
887
+ if (fe !== "lib" && (h = h.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (ee, V) => (ie = !0, t.experimental?.[V] ? "true" : "false"))), ne in cn || Ct.test(C)) {
888
+ const ee = t.target === "client" || t.target === "ssr";
889
+ N(
890
+ `transform(${_})`,
891
+ `Transforming ${S} (for: ${I ? "server" : "client"}${ee ? ", strip" : ""})`
1235
892
  );
1236
- const ie = n.target === "lib" ? "lib" : n.buildMode === "development" ? u?.hot && n.devTools.hmr ? "hmr" : "dev" : "prod";
1237
- ie !== "lib" && (h = h.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (ee, ce) => n.experimental?.[ce] ? "true" : "false"));
1238
- let V = W;
1239
- n.srcDir && (V = R.relative(n.srcDir, O)), V = K(V);
1240
- const se = n.srcDir ? n.srcDir : K(H), Ue = n.entryStrategy;
1241
- let Ze;
1242
- u && (Ze = u.moduleGraph.getModuleById(O)?.url);
1243
- const ue = {
1244
- input: [{ code: h, path: V, devPath: Ze }],
1245
- entryStrategy: C ? { type: "hoist" } : Ue,
893
+ let V = z;
894
+ t.srcDir && (V = L.relative(t.srcDir, C)), V = G(V);
895
+ const le = t.srcDir ? t.srcDir : G($), jt = t.entryStrategy;
896
+ let Ye;
897
+ c && (Ye = c.moduleGraph.getModuleById(C)?.url);
898
+ const ce = {
899
+ input: [{ code: h, path: V, devPath: Ye }],
900
+ entryStrategy: I ? { type: "hoist" } : jt,
1246
901
  minify: "simplify",
1247
902
  // Always enable sourcemaps in dev for click-to-source
1248
- sourceMaps: n.sourcemap || n.buildMode === "development",
903
+ sourceMaps: t.sourcemap || t.buildMode === "development",
1249
904
  transpileTs: !0,
1250
905
  transpileJsx: !0,
1251
906
  explicitExtensions: !0,
1252
907
  preserveFilenames: !0,
1253
- srcDir: se,
1254
- rootDir: n.rootDir,
1255
- mode: ie,
1256
- scope: n.scope || void 0,
1257
- isServer: C
908
+ srcDir: le,
909
+ rootDir: t.rootDir,
910
+ mode: fe,
911
+ scope: t.scope || void 0,
912
+ isServer: I
1258
913
  };
1259
- pe && (C ? (ue.stripCtxName = pn, ue.stripEventHandlers = !0, ue.regCtxName = dn) : (ue.stripCtxName = fn, ue.stripExports = un));
1260
- const Lt = Date.now(), me = await U.transformModules(ue);
1261
- j(`transform(${M})`, `done in ${Date.now() - Lt}ms`);
1262
- const Be = me.modules.find((ee) => !hn(ee));
1263
- f(me.diagnostics, U, se), C ? me.diagnostics.length === 0 && a && a.lint(k, h, P) : i.set(P, me);
1264
- const He = /* @__PURE__ */ new Set();
1265
- for (const ee of me.modules)
1266
- if (ee !== Be) {
1267
- const ce = K(R.join(se, ee.path));
1268
- j(`transform(${M})`, `segment ${ce}`, ee.segment.displayName), m.set(ce, P), A.set(ce, [ee, P]), He.add(ce), n.target === "client" && !u && k.emitFile({
1269
- id: ce,
914
+ ee && (I ? (ce.stripCtxName = sn, ce.stripEventHandlers = !0, ce.regCtxName = nn) : (ce.stripCtxName = on, ce.stripExports = rn));
915
+ const qt = Date.now(), pe = await q.transformModules(ce);
916
+ N(`transform(${_})`, `done in ${Date.now() - qt}ms`);
917
+ const Le = pe.modules.find((de) => !ln(de));
918
+ f(pe.diagnostics, q, le), I ? pe.diagnostics.length === 0 && l && l.lint(w, h, S) : i.set(S, pe);
919
+ const Xe = /* @__PURE__ */ new Set();
920
+ for (const de of pe.modules)
921
+ if (de !== Le) {
922
+ const he = G(L.join(le, de.path));
923
+ N(`transform(${_})`, `segment ${he}`, de.segment.displayName), u.set(he, S), B.set(he, [de, S]), Xe.add(he), t.target === "client" && !c && w.emitFile({
924
+ id: he,
1270
925
  type: "chunk",
1271
926
  preserveSignature: "allow-extension"
1272
927
  });
1273
928
  }
1274
- return await Promise.all([...He.values()].map((ee) => k.load({ id: ee }))), k.addWatchFile(P), {
1275
- code: Be.code,
1276
- map: Be.map,
929
+ return w.addWatchFile(S), {
930
+ code: Le.code,
931
+ map: Le.map,
1277
932
  meta: {
1278
- segment: Be.segment,
1279
- qwikdeps: Array.from(He)
933
+ segment: Le.segment,
934
+ qwikdeps: Array.from(Xe)
1280
935
  }
1281
936
  };
1282
937
  }
1283
- return j(`transform(${M})`, "Not transforming", P), null;
1284
- }, Y = (k) => {
1285
- const h = [], P = {
1286
- addInjection: (q) => h.push(q)
938
+ return N(`transform(${_})`, "Not transforming", S), ie ? { code: h } : null;
939
+ }, J = (w) => {
940
+ const h = [], S = {
941
+ addInjection: (T) => h.push(T)
1287
942
  };
1288
- return P.generateManifest = async (q) => {
1289
- const C = g().sys.path, A = C.resolve(n.rootDir, n.outDir, "build"), U = (L) => C.relative(A, C.resolve(n.rootDir, n.outDir, L));
1290
- P.canonPath = U;
1291
- const R = Array.from(i.values()).flatMap((L) => L.modules).map((L) => L.segment).filter((L) => !!L), O = Yt(
1292
- C,
1293
- R,
943
+ return S.generateManifest = async (T) => {
944
+ const I = d().sys.path, B = I.resolve(t.rootDir, t.outDir, "build"), q = (D) => I.relative(B, I.resolve(t.rootDir, t.outDir, D));
945
+ S.canonPath = q;
946
+ const L = Array.from(i.values()).flatMap((D) => D.modules).map((D) => D.segment).filter((D) => !!D), C = At(
947
+ I,
948
+ L,
1294
949
  h,
1295
- k,
1296
- n,
1297
- j,
1298
- U
950
+ w,
951
+ t,
952
+ N,
953
+ q
1299
954
  );
1300
- q && Object.assign(O, q);
1301
- for (const L of Object.values(O.symbols))
1302
- L.origin && (L.origin = K(L.origin));
1303
- for (const L of Object.values(O.bundles))
1304
- L.origins && (L.origins = L.origins.sort());
1305
- return O.manifestHash = zt(JSON.stringify(O)), O;
1306
- }, P;
1307
- }, Z = () => n, X = () => Array.from(r.values()).map((k) => k[0]), j = (...k) => {
1308
- n.debug && console.debug(`[QWIK PLUGIN: ${t}]`, ...k);
1309
- }, fe = (...k) => {
1310
- console.log(`[QWIK PLUGIN: ${t}]`, ...k);
1311
- }, re = (k) => {
1312
- f = k;
1313
- }, K = (k) => b(k);
1314
- function z(k, h) {
1315
- const P = n.buildMode === "development";
955
+ T && Object.assign(C, T);
956
+ for (const D of Object.values(C.symbols))
957
+ D.origin && (D.origin = G(D.origin));
958
+ for (const D of Object.values(C.bundles))
959
+ D.origins && (D.origins = D.origins.sort());
960
+ return C.manifestHash = Lt(JSON.stringify(C)), C;
961
+ }, S;
962
+ }, te = () => t, X = () => Array.from(r.values()).map((w) => w[0]), N = (...w) => {
963
+ t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ...w);
964
+ }, ue = (...w) => {
965
+ console.log(`[QWIK PLUGIN: ${n}]`, ...w);
966
+ }, F = (w) => {
967
+ f = w;
968
+ }, G = (w) => g(w);
969
+ function Z(w, h) {
970
+ const S = t.buildMode === "development";
1316
971
  return `// @qwik.dev/core/build
1317
- export const isServer = ${JSON.stringify(k)};
1318
- export const isBrowser = ${JSON.stringify(!k)};
1319
- export const isDev = ${JSON.stringify(P)};
972
+ export const isServer = ${JSON.stringify(w)};
973
+ export const isBrowser = ${JSON.stringify(!w)};
974
+ export const isDev = ${JSON.stringify(S)};
1320
975
  `;
1321
976
  }
1322
- async function Le(k) {
1323
- if (!n.manifestInput && n.target === "ssr" && n.buildMode === "production" && v) {
1324
- const q = y();
1325
- let M = n.manifestInputPath || q.resolve(n.clientOutDir, Ge);
1326
- await v.promises.stat(M).catch(() => !1) || (M = q.resolve(n.rootDir, lt, Ge));
977
+ async function qe(w) {
978
+ if (!t.manifestInput && t.target === "ssr" && t.buildMode === "production" && m) {
979
+ const T = p();
980
+ let _ = t.manifestInputPath || T.resolve(t.clientOutDir, Ae);
981
+ await m.promises.stat(_).catch(() => !1) || (_ = T.resolve(t.rootDir, st, Ae));
1327
982
  try {
1328
- const C = await v.promises.readFile(M, "utf-8");
1329
- n.manifestInput = nt(JSON.parse(C)) || null, console.info("Read client manifest from", M);
1330
- } catch (C) {
983
+ const I = await m.promises.readFile(_, "utf-8");
984
+ t.manifestInput = et(JSON.parse(I)) || null, console.info("Read client manifest from", _);
985
+ } catch (I) {
1331
986
  console.warn(
1332
987
  `
1333
988
  ==========
1334
- Could not read Qwik client manifest ${M}.
989
+ Could not read Qwik client manifest ${_}.
1335
990
  Make sure you provide it to the qwikVite plugin via the \`manifestInput\` \`manifestInputPath\` arguments, or to the SSR renderer via the \`manifest\` argument, or define it in \`globalThis.__QWIK_MANIFEST__\` before the server bundle is loaded, or embed it in the server bundle by replacing \`globalThis.__QWIK_MANIFEST__\`.
1336
991
  Without the manifest, the SSR renderer will not be able to generate event handlers.
1337
- (${C})
992
+ (${I})
1338
993
  ==========
1339
994
  `
1340
995
  );
1341
996
  }
1342
997
  }
1343
- const h = k ? n.manifestInput : null;
1344
- let P = null;
1345
- return h?.manifestHash && (P = {
998
+ const h = w ? t.manifestInput : null;
999
+ let S = null;
1000
+ return h?.manifestHash && (S = {
1346
1001
  manifestHash: h.manifestHash,
1347
1002
  core: h.core,
1348
1003
  preloader: h.preloader,
@@ -1352,149 +1007,149 @@ Without the manifest, the SSR renderer will not be able to generate event handle
1352
1007
  mapping: h.mapping,
1353
1008
  bundleGraph: h.bundleGraph
1354
1009
  }), `// @qwik-client-manifest
1355
- export const manifest = ${P ? JSON.stringify(P) : "globalThis.__QWIK_MANIFEST__"};
1010
+ export const manifest = ${S ? JSON.stringify(S) : "globalThis.__QWIK_MANIFEST__"};
1356
1011
  `;
1357
1012
  }
1358
- function de(k) {
1359
- n.sourcemap = k;
1360
- }
1361
- function je(k, h) {
1362
- const P = k.name === "ssr";
1363
- j("hotUpdate()", h.file, k.name);
1364
- const q = P ? o : r;
1365
- for (const M of h.modules) {
1366
- const { id: C } = M;
1367
- if (C) {
1368
- j("hotUpdate()", `invalidate ${C}`), i.delete(C);
1369
- for (const [A, [U, R]] of q)
1370
- if (R === C) {
1371
- j("hotUpdate()", `invalidate ${C} segment ${A}`), q.delete(A);
1372
- const O = k.moduleGraph.getModuleById(A);
1373
- O && k.moduleGraph.invalidateModule(O);
1013
+ function Dt(w) {
1014
+ t.sourcemap = w;
1015
+ }
1016
+ function Nt(w, h) {
1017
+ const S = w.name === "ssr";
1018
+ N("hotUpdate()", h.file, w.name);
1019
+ const T = S ? o : r;
1020
+ for (const _ of h.modules) {
1021
+ const { id: I } = _;
1022
+ if (I) {
1023
+ N("hotUpdate()", `invalidate ${I}`), i.delete(I);
1024
+ for (const [B, [q, L]] of T)
1025
+ if (L === I) {
1026
+ N("hotUpdate()", `invalidate ${I} segment ${B}`), T.delete(B);
1027
+ const C = w.moduleGraph.getModuleById(B);
1028
+ C && w.moduleGraph.invalidateModule(C);
1374
1029
  }
1375
1030
  }
1376
1031
  }
1377
1032
  }
1378
- const qt = (k, { getModuleInfo: h }) => {
1379
- if (n.target === "client") {
1033
+ const Mt = (w, { getModuleInfo: h }) => {
1034
+ if (t.target === "client") {
1380
1035
  if (
1381
1036
  // The preloader has to stay in a separate chunk if it's a client build
1382
1037
  // the vite preload helper must be included or to prevent breaking circular dependencies
1383
- k.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(k) || k === "\0vite/preload-helper.js"
1038
+ w.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(w) || w === "\0vite/preload-helper.js"
1384
1039
  )
1385
1040
  return "qwik-preloader";
1386
1041
  if (
1387
1042
  // likewise, core and handlers have to be in the same chunk so there's no import waterfall
1388
- /[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(k)
1043
+ /[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(w)
1389
1044
  )
1390
1045
  return "qwik-core";
1391
- if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(k))
1046
+ if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(w))
1392
1047
  return "qwik-loader";
1393
1048
  }
1394
- const P = h(k);
1395
- if (P) {
1396
- const q = P.meta.segment;
1397
- if (q) {
1398
- if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(q.ctxName))
1049
+ const S = h(w);
1050
+ if (S) {
1051
+ const T = S.meta.segment;
1052
+ if (T) {
1053
+ if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(T.ctxName))
1399
1054
  return null;
1400
- const { hash: M } = q, C = n.entryStrategy.manual?.[M] || q.entry;
1401
- if (C)
1402
- return C;
1055
+ const { hash: _ } = T, I = t.entryStrategy.manual?.[_] || T.entry;
1056
+ if (I)
1057
+ return I;
1403
1058
  }
1404
1059
  }
1405
1060
  return null;
1406
1061
  };
1407
- async function Ot(k, h, P, q) {
1408
- const C = await Y(h).generateManifest(q);
1409
- C.platform = {
1410
- ...q?.platform,
1411
- rollup: k.meta?.rollupVersion || "",
1412
- env: E.sys.env,
1413
- os: E.sys.os
1414
- }, E.sys.env === "node" && (C.platform.node = process.versions.node);
1415
- const A = en(C, P), U = k.emitFile({
1062
+ async function Ot(w, h, S, T) {
1063
+ const I = await J(h).generateManifest(T);
1064
+ I.platform = {
1065
+ ...T?.platform,
1066
+ rollup: w.meta?.rollupVersion || "",
1067
+ env: k.sys.env,
1068
+ os: k.sys.os
1069
+ }, k.sys.env === "node" && (I.platform.node = process.versions.node);
1070
+ const B = Kt(I, S), q = w.emitFile({
1416
1071
  type: "asset",
1417
1072
  name: "bundle-graph.json",
1418
- source: JSON.stringify(A)
1419
- }), R = k.getFileName(U);
1420
- C.bundleGraphAsset = R, C.assets[R] = {
1073
+ source: JSON.stringify(B)
1074
+ }), L = w.getFileName(q);
1075
+ I.bundleGraphAsset = L, I.assets[L] = {
1421
1076
  name: "bundle-graph.json",
1422
- size: A.length
1077
+ size: B.length
1423
1078
  };
1424
- const O = JSON.stringify(C, null, " ");
1425
- k.emitFile({
1426
- fileName: Ge,
1079
+ const C = JSON.stringify(I, null, " ");
1080
+ w.emitFile({
1081
+ fileName: Ae,
1427
1082
  type: "asset",
1428
- source: O
1429
- }), typeof n.manifestOutput == "function" && await n.manifestOutput(C), typeof n.transformedModuleOutput == "function" && await n.transformedModuleOutput(X());
1083
+ source: C
1084
+ }), typeof t.manifestOutput == "function" && await t.manifestOutput(I), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(X());
1430
1085
  }
1431
1086
  return {
1432
- buildStart: w,
1433
- createOutputAnalyzer: Y,
1434
- getQwikBuildModule: z,
1435
- getOptimizer: g,
1436
- getOptions: Z,
1437
- getPath: y,
1438
- getSys: d,
1087
+ buildStart: E,
1088
+ createOutputAnalyzer: J,
1089
+ getQwikBuildModule: Z,
1090
+ getOptimizer: d,
1091
+ getOptions: te,
1092
+ getPath: p,
1093
+ getSys: s,
1439
1094
  getTransformedOutputs: X,
1440
- init: I,
1441
- load: F,
1442
- debug: j,
1443
- log: fe,
1444
- normalizeOptions: p,
1445
- normalizePath: K,
1446
- onDiagnostics: re,
1447
- resolveId: T,
1448
- transform: J,
1449
- validateSource: S,
1450
- setSourceMapSupport: de,
1451
- configureServer: s,
1452
- hotUpdate: je,
1453
- manualChunks: qt,
1095
+ init: v,
1096
+ load: W,
1097
+ debug: N,
1098
+ log: ue,
1099
+ normalizeOptions: M,
1100
+ normalizePath: G,
1101
+ onDiagnostics: F,
1102
+ resolveId: j,
1103
+ transform: Y,
1104
+ validateSource: O,
1105
+ setSourceMapSupport: Dt,
1106
+ configureServer: y,
1107
+ hotUpdate: Nt,
1108
+ manualChunks: Mt,
1454
1109
  generateManifest: Ot
1455
1110
  };
1456
1111
  }
1457
- const mn = (e) => (t) => typeof t == "string" ? cn(e.os) ? (t.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(t) || (t = t.replace(/\\/g, "/")), e.path.posix.normalize(t)) : e.path.normalize(t) : t;
1458
- function hn(e) {
1112
+ const an = (e) => (n) => typeof n == "string" ? tn(e.os) ? (n.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(n) || (n = n.replace(/\\/g, "/")), e.path.posix.normalize(n)) : e.path.normalize(n) : n;
1113
+ function ln(e) {
1459
1114
  return e.isEntry || e.segment;
1460
1115
  }
1461
- const gn = {
1116
+ const cn = {
1462
1117
  ".jsx": !0,
1463
1118
  ".ts": !0,
1464
1119
  ".tsx": !0
1465
- }, Nt = /\.qwik\.[mc]?js$/, qe = "@qwik.dev/core", Oe = "@qwik.dev/core/internal", te = "@qwik.dev/core/build", Ye = "@qwik.dev/core/jsx-runtime", Xe = "@qwik.dev/core/jsx-dev-runtime", Ae = "@qwik.dev/core/server", ae = "@qwik-client-manifest", We = "@qwik.dev/core/preloader", he = "@qwik-handlers", yn = "src", lt = "dist", vn = "server", bn = "lib", Ge = "q-manifest.json";
1466
- async function wn(e, t, i) {
1120
+ }, Ct = /\.qwik\.[mc]?js$/, Oe = "@qwik.dev/core", je = "@qwik.dev/core/internal", re = "@qwik.dev/core/build", Ke = "@qwik.dev/core/jsx-runtime", Qe = "@qwik.dev/core/jsx-dev-runtime", Re = "@qwik.dev/core/server", se = "@qwik-client-manifest", ze = "@qwik.dev/core/preloader", me = "@qwik-handlers", dn = "src", st = "dist", un = "server", fn = "lib", Ae = "q-manifest.json";
1121
+ async function pn(e, n, i) {
1467
1122
  if (e.env === "browsermain" || e.env === "webworker")
1468
1123
  return;
1469
1124
  const r = await e.dynamicImport("node:fs");
1470
1125
  let o = i;
1471
1126
  for (; o; ) {
1472
- const m = e.path.join(o, "node_modules", t, "package.json");
1127
+ const u = e.path.join(o, "node_modules", n, "package.json");
1473
1128
  try {
1474
- return await r.promises.access(m), r.promises.realpath(m);
1129
+ return await r.promises.access(u), r.promises.realpath(u);
1475
1130
  } catch {
1476
1131
  }
1477
- const l = e.path.dirname(o);
1478
- if (l === o)
1132
+ const a = e.path.dirname(o);
1133
+ if (a === o)
1479
1134
  break;
1480
- o = l;
1135
+ o = a;
1481
1136
  }
1482
1137
  }
1483
- function Hr(e = {}) {
1484
- const t = Dt(e.optimizerOptions);
1138
+ function Lr(e = {}) {
1139
+ const n = Tt(e.optimizerOptions);
1485
1140
  return {
1486
1141
  name: "rollup-plugin-qwik",
1487
1142
  api: {
1488
- getOptimizer: () => t.getOptimizer(),
1489
- getOptions: () => t.getOptions()
1143
+ getOptimizer: () => n.getOptimizer(),
1144
+ getOptions: () => n.getOptions()
1490
1145
  },
1491
1146
  async options(r) {
1492
- await t.init();
1147
+ await n.init();
1493
1148
  const o = r.onwarn;
1494
- r.onwarn = (a, f) => {
1495
- a.plugin === "typescript" && a.message.includes("outputToFilesystem") || (o ? o(a, f) : f(a));
1149
+ r.onwarn = (l, f) => {
1150
+ l.plugin === "typescript" && l.message.includes("outputToFilesystem") || (o ? o(l, f) : f(l));
1496
1151
  };
1497
- const m = {
1152
+ const u = {
1498
1153
  csr: e.csr,
1499
1154
  target: e.target,
1500
1155
  buildMode: e.buildMode,
@@ -1512,81 +1167,81 @@ function Hr(e = {}) {
1512
1167
  lint: e.lint,
1513
1168
  experimental: e.experimental
1514
1169
  };
1515
- await t.normalizeOptions(m);
1516
- const { input: l } = t.getOptions();
1517
- return r.input = l, r;
1170
+ await n.normalizeOptions(u);
1171
+ const { input: a } = n.getOptions();
1172
+ return r.input = a, r;
1518
1173
  },
1519
1174
  outputOptions(r) {
1520
- return Ve(t, r, !1);
1175
+ return Je(n, r, !1);
1521
1176
  },
1522
1177
  async buildStart() {
1523
- t.onDiagnostics((r, o, m) => {
1524
- r.forEach((l) => {
1525
- const a = t.normalizePath(o.sys.path.join(m, l.file));
1526
- l.category === "error" ? this.error($e(a, l)) : this.warn($e(a, l));
1178
+ n.onDiagnostics((r, o, u) => {
1179
+ r.forEach((a) => {
1180
+ const l = n.normalizePath(o.sys.path.join(u, a.file));
1181
+ a.category === "error" ? this.error(Fe(l, a)) : this.warn(Fe(l, a));
1527
1182
  });
1528
- }), await t.buildStart(this);
1183
+ }), await n.buildStart(this);
1529
1184
  },
1530
1185
  resolveId(r, o) {
1531
- return ne(r) ? null : t.resolveId(this, r, o);
1186
+ return oe(r) ? null : n.resolveId(this, r, o);
1532
1187
  },
1533
1188
  load(r) {
1534
- return ne(r) ? null : t.load(this, r);
1189
+ return oe(r) ? null : n.load(this, r);
1535
1190
  },
1536
1191
  transform(r, o) {
1537
- return ne(o) ? null : t.transform(this, r, o);
1192
+ return oe(o) ? null : n.transform(this, r, o);
1538
1193
  },
1539
1194
  async generateBundle(r, o) {
1540
- t.getOptions().target === "client" && await t.generateManifest(this, o);
1195
+ n.getOptions().target === "client" && await n.generateManifest(this, o);
1541
1196
  }
1542
1197
  };
1543
1198
  }
1544
- async function xn(e, t, i, r) {
1545
- return Array.isArray(t) ? (t.length || t.push({}), await Promise.all(
1546
- t.map(async (o) => ({
1547
- ...await Ve(e, o, i),
1199
+ async function hn(e, n, i, r) {
1200
+ return Array.isArray(n) ? (n.length || n.push({}), await Promise.all(
1201
+ n.map(async (o) => ({
1202
+ ...await Je(e, o, i),
1548
1203
  dir: r || o.dir
1549
1204
  }))
1550
1205
  )) : {
1551
- ...await Ve(e, t, i),
1552
- dir: r || t?.dir
1206
+ ...await Je(e, n, i),
1207
+ dir: r || n?.dir
1553
1208
  };
1554
1209
  }
1555
- const In = (e, t, i) => t.buildMode === "production" && !t.debug ? `${e}build/q-[hash].js` : (r) => {
1556
- if (r.moduleIds?.some((l) => /core\.(prod|min)\.mjs$/.test(l)))
1210
+ const mn = (e, n, i) => n.buildMode === "production" && !n.debug ? `${e}build/q-[hash].js` : (r) => {
1211
+ if (r.moduleIds?.some((a) => /core\.(prod|min)\.mjs$/.test(a)))
1557
1212
  return `${e}build/core.js`;
1558
- if (r.moduleIds?.some((l) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(l)))
1213
+ if (r.moduleIds?.some((a) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(a)))
1559
1214
  return `${e}build/qwik-router.js`;
1560
- const m = i.sys.path.relative(i.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
1561
- return `${e}build/${m}.js`;
1215
+ const u = i.sys.path.relative(i.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
1216
+ return `${e}build/${u}.js`;
1562
1217
  };
1563
- async function Ve(e, t, i) {
1564
- const r = { ...t }, o = e.getOptions(), m = e.getOptimizer(), l = e.manualChunks;
1218
+ async function Je(e, n, i) {
1219
+ const r = { ...n }, o = e.getOptions(), u = e.getOptimizer(), a = e.manualChunks;
1565
1220
  r.assetFileNames || (r.assetFileNames = `${i ? `${o.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
1566
- const a = In(i ? `${o.assetsDir}` : "", o, m);
1221
+ const l = mn(i ? `${o.assetsDir}` : "", o, u);
1567
1222
  if (o.target === "client") {
1568
- r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
1569
- const n = r.manualChunks;
1570
- if (n && typeof n != "function")
1223
+ r.entryFileNames || (r.entryFileNames = l), r.chunkFileNames || (r.chunkFileNames = l), r.format = "es";
1224
+ const t = r.manualChunks;
1225
+ if (t && typeof t != "function")
1571
1226
  throw new Error("manualChunks must be a function");
1572
- r.manualChunks = n ? (b, v) => n(b, v) || l(b, v) : l;
1227
+ r.manualChunks = t ? (g, m) => t(g, m) || a(g, m) : a;
1573
1228
  } else
1574
- r.chunkFileNames || (r.chunkFileNames = a);
1229
+ r.chunkFileNames || (r.chunkFileNames = l);
1575
1230
  r.dir || (r.dir = o.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
1576
- const f = await wn(m.sys, "rollup", m.sys.cwd());
1231
+ const f = await pn(u.sys, "rollup", u.sys.cwd());
1577
1232
  if (f)
1578
1233
  try {
1579
- const b = await (await m.sys.dynamicImport("node:fs")).promises.readFile(f, "utf-8"), v = JSON.parse(b), I = String(v?.version || ""), [g, d, y] = I.split(".").map((s) => parseInt(s, 10));
1580
- Number.isFinite(g) && (g > 4 || g === 4 && (d > 52 || d === 52 && (y || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
1581
- `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${I}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
1234
+ const g = await (await u.sys.dynamicImport("node:fs")).promises.readFile(f, "utf-8"), m = JSON.parse(g), v = String(m?.version || ""), [d, s, p] = v.split(".").map((y) => parseInt(y, 10));
1235
+ Number.isFinite(d) && (d > 4 || d === 4 && (s > 52 || s === 52 && (p || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
1236
+ `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${v}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
1582
1237
  );
1583
1238
  } catch {
1584
1239
  }
1585
1240
  return r;
1586
1241
  }
1587
- function $e(e, t) {
1588
- const i = t.highlights?.[0];
1589
- return Object.assign(new Error(t.message), {
1242
+ function Fe(e, n) {
1243
+ const i = n.highlights?.[0];
1244
+ return Object.assign(new Error(n.message), {
1590
1245
  id: e,
1591
1246
  plugin: "qwik",
1592
1247
  loc: i && {
@@ -1596,7 +1251,7 @@ function $e(e, t) {
1596
1251
  stack: ""
1597
1252
  });
1598
1253
  }
1599
- const Sn = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, En = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`).then(()=>{r.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', kn = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, _n = '[data-qwik-cls]{outline:2px solid red}[data-qwik-cls]:after{position:absolute;font-size:12px;content:"CLS " attr(data-qwik-cls);font-family:monospace;font-weight:700;background:red;color:#fff;margin:-2px;padding:1px;line-height:1;pointer-events:none}#qwik-image-warning-container{position:absolute!important;top:0!important;left:0!important;width:0!important;overflow:visible!important;height:0!important;pointer-events:none!important;contain:size layout style content;z-index:1}', Tn = 'if("undefined"!=typeof document){const e=()=>{class e extends HTMLElement{#e=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.createElement("template").innerHTML=globalThis.__TEMPLATE__);const e=this.shadowRoot.querySelector("dialog");this.shadowRoot.addEventListener("click",async t=>{const o=t.target;"BUTTON"===o.nodeName&&("action-btn"===o.id?this.#e&&(this.#e(),e.close()):"icon"===o.id?e.open?e.close():(e.className=function(e){const{x:t}=e.getBoundingClientRect();let o="right";return t>window.innerWidth-260&&(o="left"),`bottom ${o}`}(o),e.show()):"loc"===o.id&&o.dataset.url&&globalThis.qwikOpenInEditor(o.dataset.url))})}set loc(e){const t=this.shadowRoot.querySelector("#loc");t.textContent=e,globalThis.qwikOpenInEditor&&(t.dataset.url=e)}set header(e){this.shadowRoot.querySelector("#title").textContent=e}set message(e){this.shadowRoot.querySelector("#message").innerHTML=e}set actionFn(e){this.#e=e}set actionName(e){e&&(this.shadowRoot.querySelector(".action-container").innerHTML=`<button id="action-btn" type="button">${e}</button>`)}}customElements.define("image-warning",e);const t=new Map;let o=document.querySelector("#qwik-image-warning-container");o||(o=document.createElement("div"),o.id="qwik-image-warning-container",document.body.appendChild(o));let n=!1;const i=new Map;function r(e){let t=i.get(e);return void 0===t&&(t=async function(e){if(!/^(https?|file|capacitor):/.test(e))return;const t=new URL("/__image_info",location.href);return t.searchParams.set("url",e),fetch(t).then(e=>e.json()).catch(()=>null)}(e),i.set(e,t)),t}function a(e){return e.endsWith("px")}async function s(e){const i=t.get(e);e.isConnected?e.complete&&async function(e){const i=window.scrollX,s=window.scrollY,c=e.getBoundingClientRect(),d=e.currentSrc,l=await r(d);let h=t.get(e);const u=window.innerWidth>500;if(l&&u){let r=!1;const d=e.getAttribute("data-qwik-inspector"),u=c.width*c.height;if(!e.hasAttribute("width")||!e.hasAttribute("height")){n=!0;const t=getComputedStyle(e),o="auto"!==t.getPropertyValue("aspect-ratio").toString(),i=a(t.getPropertyValue("width").toString()),s=a(t.getPropertyValue("height").toString()),c="absolute"===t.getPropertyValue("position").toString();r=u>1e3&&!c&&!o&&(!i||!s)}const g=u<.5*(l.width&&l.height)&&"svg"!==l.type;if(n=!1,r||g){if(h||(h=document.createElement("image-warning"),o.appendChild(h),t.set(e,h)),h.style.top=c.top+s+"px",h.style.left=c.left+i+"px",h.style.width=c.width+"px",h.style.height=c.height+"px",h.info=l,h.loc=d,r){const t=`width="${l.width}" height="${l.height}"`;h.header="Perf: layout shift",h.message=`Image\'s size is unknown until it\'s loaded, <a href="https://web.dev/cls/" target="_blank" rel="noopener noreferrer">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre>&lt;img <span>${t}</span></pre>`;const o=1===document.querySelectorAll(\'[data-qwik-inspector="\'+d+\'"]\').length;d&&(o?(h.actionName="Auto fix",h.actionFn=async()=>{const t=new URL("/__image_fix",location.href);t.searchParams.set("loc",d),t.searchParams.set("width",l.width),t.searchParams.set("height",l.height),e.srcset||(t.searchParams.set("src",e.currentSrc),t.searchParams.set("currentHref",location.href)),await fetch(t,{method:"POST"})}):(h.actionName="Open in editor",h.actionFn=async()=>{await navigator.clipboard.writeText(t),globalThis.qwikOpenInEditor(d)}))}else g&&(h.header="Perf: properly size image",h.message=`The image is too big, <a href="https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/" target="_blank" rel="noopener noreferrer">hurting performance</a>, it should be resized to the size it\'s displayed at. The image dimensions are ${l.width} x ${l.height} but it\'s displayed at ${c.width}x${c.height}.</p>`);return}}h&&(h.remove(),t.delete(e))}(e):i&&(i.remove(),t.delete(e))}const c=new ResizeObserver(e=>{if(!n)for(const t of e)s(t.target)}),d=new MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)"IMG"===e.nodeName?c.observe(e):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{c.observe(e)});for(const e of t.removedNodes)"IMG"===e.nodeName?(s(e),c.unobserve(e)):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{s(e),c.unobserve(e)})}});let l,h=0;const u=()=>{setTimeout(()=>{l&&(l.disconnect(),h>.005&&console.error("Detected Layout Shift during page load",h)),d.observe(document.body,{childList:!0,subtree:!0}),document.body.querySelectorAll("img").forEach(e=>{c.observe(e)})},100)};"complete"===document.readyState?u():window.addEventListener("load",u);const g=1===performance?.navigation.type||performance.getEntriesByType("navigation").map(e=>e.type).includes("reload");"undefined"==typeof PerformanceObserver||g||(l=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if(!e.hadRecentInput){if(e.value>.006)for(const t of e.sources)t.node&&1===t.node.nodeType&&"IMAGE-WARNING"!==t.node.nodeName&&t.node.setAttribute("data-qwik-cls",Number(e.value).toFixed(3));h+=e.value}})}),l.observe({type:"layout-shift",buffered:!0}))};document.addEventListener("load",e)}', Cn = `<style>
1254
+ const gn = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, vn = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`).then(()=>{r.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', yn = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, bn = '[data-qwik-cls]{outline:2px solid red}[data-qwik-cls]:after{position:absolute;font-size:12px;content:"CLS " attr(data-qwik-cls);font-family:monospace;font-weight:700;background:red;color:#fff;margin:-2px;padding:1px;line-height:1;pointer-events:none}#qwik-image-warning-container{position:absolute!important;top:0!important;left:0!important;width:0!important;overflow:visible!important;height:0!important;pointer-events:none!important;contain:size layout style content;z-index:1}', wn = 'if("undefined"!=typeof document){const e=()=>{class e extends HTMLElement{#e=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.createElement("template").innerHTML=globalThis.__TEMPLATE__);const e=this.shadowRoot.querySelector("dialog");this.shadowRoot.addEventListener("click",async t=>{const o=t.target;"BUTTON"===o.nodeName&&("action-btn"===o.id?this.#e&&(this.#e(),e.close()):"icon"===o.id?e.open?e.close():(e.className=function(e){const{x:t}=e.getBoundingClientRect();let o="right";return t>window.innerWidth-260&&(o="left"),`bottom ${o}`}(o),e.show()):"loc"===o.id&&o.dataset.url&&globalThis.qwikOpenInEditor(o.dataset.url))})}set loc(e){const t=this.shadowRoot.querySelector("#loc");t.textContent=e,globalThis.qwikOpenInEditor&&(t.dataset.url=e)}set header(e){this.shadowRoot.querySelector("#title").textContent=e}set message(e){this.shadowRoot.querySelector("#message").innerHTML=e}set actionFn(e){this.#e=e}set actionName(e){e&&(this.shadowRoot.querySelector(".action-container").innerHTML=`<button id="action-btn" type="button">${e}</button>`)}}customElements.define("image-warning",e);const t=new Map;let o=document.querySelector("#qwik-image-warning-container");o||(o=document.createElement("div"),o.id="qwik-image-warning-container",document.body.appendChild(o));let n=!1;const i=new Map;function r(e){let t=i.get(e);return void 0===t&&(t=async function(e){if(!/^(https?|file|capacitor):/.test(e))return;const t=new URL("/__image_info",location.href);return t.searchParams.set("url",e),fetch(t).then(e=>e.json()).catch(()=>null)}(e),i.set(e,t)),t}function a(e){return e.endsWith("px")}async function s(e){const i=t.get(e);e.isConnected?e.complete&&async function(e){const i=window.scrollX,s=window.scrollY,c=e.getBoundingClientRect(),d=e.currentSrc,l=await r(d);let h=t.get(e);const u=window.innerWidth>500;if(l&&u){let r=!1;const d=e.getAttribute("data-qwik-inspector"),u=c.width*c.height;if(!e.hasAttribute("width")||!e.hasAttribute("height")){n=!0;const t=getComputedStyle(e),o="auto"!==t.getPropertyValue("aspect-ratio").toString(),i=a(t.getPropertyValue("width").toString()),s=a(t.getPropertyValue("height").toString()),c="absolute"===t.getPropertyValue("position").toString();r=u>1e3&&!c&&!o&&(!i||!s)}const g=u<.5*(l.width&&l.height)&&"svg"!==l.type;if(n=!1,r||g){if(h||(h=document.createElement("image-warning"),o.appendChild(h),t.set(e,h)),h.style.top=c.top+s+"px",h.style.left=c.left+i+"px",h.style.width=c.width+"px",h.style.height=c.height+"px",h.info=l,h.loc=d,r){const t=`width="${l.width}" height="${l.height}"`;h.header="Perf: layout shift",h.message=`Image\'s size is unknown until it\'s loaded, <a href="https://web.dev/cls/" target="_blank" rel="noopener noreferrer">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre>&lt;img <span>${t}</span></pre>`;const o=1===document.querySelectorAll(\'[data-qwik-inspector="\'+d+\'"]\').length;d&&(o?(h.actionName="Auto fix",h.actionFn=async()=>{const t=new URL("/__image_fix",location.href);t.searchParams.set("loc",d),t.searchParams.set("width",l.width),t.searchParams.set("height",l.height),e.srcset||(t.searchParams.set("src",e.currentSrc),t.searchParams.set("currentHref",location.href)),await fetch(t,{method:"POST"})}):(h.actionName="Open in editor",h.actionFn=async()=>{await navigator.clipboard.writeText(t),globalThis.qwikOpenInEditor(d)}))}else g&&(h.header="Perf: properly size image",h.message=`The image is too big, <a href="https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/" target="_blank" rel="noopener noreferrer">hurting performance</a>, it should be resized to the size it\'s displayed at. The image dimensions are ${l.width} x ${l.height} but it\'s displayed at ${c.width}x${c.height}.</p>`);return}}h&&(h.remove(),t.delete(e))}(e):i&&(i.remove(),t.delete(e))}const c=new ResizeObserver(e=>{if(!n)for(const t of e)s(t.target)}),d=new MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)"IMG"===e.nodeName?c.observe(e):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{c.observe(e)});for(const e of t.removedNodes)"IMG"===e.nodeName?(s(e),c.unobserve(e)):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{s(e),c.unobserve(e)})}});let l,h=0;const u=()=>{setTimeout(()=>{l&&(l.disconnect(),h>.005&&console.error("Detected Layout Shift during page load",h)),d.observe(document.body,{childList:!0,subtree:!0}),document.body.querySelectorAll("img").forEach(e=>{c.observe(e)})},100)};"complete"===document.readyState?u():window.addEventListener("load",u);const g=1===performance?.navigation.type||performance.getEntriesByType("navigation").map(e=>e.type).includes("reload");"undefined"==typeof PerformanceObserver||g||(l=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if(!e.hadRecentInput){if(e.value>.006)for(const t of e.sources)t.node&&1===t.node.nodeType&&"IMAGE-WARNING"!==t.node.nodeName&&t.node.setAttribute("data-qwik-cls",Number(e.value).toFixed(3));h+=e.value}})}),l.observe({type:"layout-shift",buffered:!0}))};document.addEventListener("load",e)}', xn = `<style>
1600
1255
  :host {
1601
1256
  position: absolute;
1602
1257
  border: 1px solid red;
@@ -1760,238 +1415,238 @@ const Sn = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
1760
1415
  <p class="action-container"></p>
1761
1416
  </div>
1762
1417
  </dialog>
1763
- `, Pn = `vite-error-overlay{--color-bright: rgba(255, 255, 255, .8);--color-yellow: rgba(255, 246, 85, .8);--qwik-dark-blue: #006ce9;--qwik-light-blue: #3ec2f7;--qwik-light-purple: #ac7ff4;--qwik-dark-purple: #713fc2;--yellow: #fff;--purple: var(--color-bright);--red: var(--qwik-light-blue);--vertical-box-spacing: 15px;--box-padding: 20px;--box-margin: 0 0 var(--vertical-box-spacing) 0;--box-background: rgba(0, 0, 0, .5);--box-border-radius: 8px}vite-error-overlay::part(backdrop){background:#020b1199}vite-error-overlay::part(window){background:transparent;border:none;box-shadow:none;box-sizing:border-box;margin:50px auto;max-width:1200px;padding:var(--box-padding);width:90%}vite-error-overlay::part(message){display:flex;flex-direction:column;font-size:1.6rem;line-height:1.7;margin-bottom:30px}vite-error-overlay::part(plugin){font-size:.8rem;font-weight:100}vite-error-overlay::part(file),vite-error-overlay::part(frame),vite-error-overlay::part(stack),vite-error-overlay::part(tip){background:var(--box-background);border-left:5px solid transparent;border-radius:var(--box-border-radius);margin:var(--box-margin);min-height:50px;padding:var(--box-padding);position:relative}vite-error-overlay::part(file){border-left-color:#19b6f6;color:var(--color-bright)}vite-error-overlay::part(frame){border-left-color:var(--color-yellow);color:var(--color-yellow)}vite-error-overlay::part(stack){border-left-color:#ff5722}vite-error-overlay::part(tip){border-top:none;border-left-color:#ac7ff4}vite-error-overlay::part(file):before,vite-error-overlay::part(frame):before,vite-error-overlay::part(stack):before{border-bottom:1px solid #222;color:var(--color-bright);display:block;margin-bottom:15px;padding-bottom:5px;padding-left:30px;font-size:.8rem}vite-error-overlay::part(file):before{content:"File"}vite-error-overlay::part(frame):before{content:"Frame"}vite-error-overlay::part(stack):before{content:"Stack Trace"}vite-error-overlay::part(file):after,vite-error-overlay::part(frame):after,vite-error-overlay::part(stack):after{content:"";display:block;height:20px;position:absolute;left:var(--box-padding);top:var(--box-padding);width:20px}vite-error-overlay::part(file):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}vite-error-overlay::part(frame):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E")}vite-error-overlay::part(stack):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E")}vite-error-overlay::part(tip):before{content:"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.";display:block;margin-bottom:1em}`, Dn = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
1764
- async function Nn(e, t, i, r) {
1765
- const o = await i.dynamicImport("node:fs"), m = await i.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
1766
- (f) => r.join(t, `entry.preview.${f}`)
1418
+ `, In = `vite-error-overlay{--color-bright: rgba(255, 255, 255, .8);--color-yellow: rgba(255, 246, 85, .8);--qwik-dark-blue: #006ce9;--qwik-light-blue: #3ec2f7;--qwik-light-purple: #ac7ff4;--qwik-dark-purple: #713fc2;--yellow: #fff;--purple: var(--color-bright);--red: var(--qwik-light-blue);--vertical-box-spacing: 15px;--box-padding: 20px;--box-margin: 0 0 var(--vertical-box-spacing) 0;--box-background: rgba(0, 0, 0, .5);--box-border-radius: 8px}vite-error-overlay::part(backdrop){background:#020b1199}vite-error-overlay::part(window){background:transparent;border:none;box-shadow:none;box-sizing:border-box;margin:50px auto;max-width:1200px;padding:var(--box-padding);width:90%}vite-error-overlay::part(message){display:flex;flex-direction:column;font-size:1.6rem;line-height:1.7;margin-bottom:30px}vite-error-overlay::part(plugin){font-size:.8rem;font-weight:100}vite-error-overlay::part(file),vite-error-overlay::part(frame),vite-error-overlay::part(stack),vite-error-overlay::part(tip){background:var(--box-background);border-left:5px solid transparent;border-radius:var(--box-border-radius);margin:var(--box-margin);min-height:50px;padding:var(--box-padding);position:relative}vite-error-overlay::part(file){border-left-color:#19b6f6;color:var(--color-bright)}vite-error-overlay::part(frame){border-left-color:var(--color-yellow);color:var(--color-yellow)}vite-error-overlay::part(stack){border-left-color:#ff5722}vite-error-overlay::part(tip){border-top:none;border-left-color:#ac7ff4}vite-error-overlay::part(file):before,vite-error-overlay::part(frame):before,vite-error-overlay::part(stack):before{border-bottom:1px solid #222;color:var(--color-bright);display:block;margin-bottom:15px;padding-bottom:5px;padding-left:30px;font-size:.8rem}vite-error-overlay::part(file):before{content:"File"}vite-error-overlay::part(frame):before{content:"Frame"}vite-error-overlay::part(stack):before{content:"Stack Trace"}vite-error-overlay::part(file):after,vite-error-overlay::part(frame):after,vite-error-overlay::part(stack):after{content:"";display:block;height:20px;position:absolute;left:var(--box-padding);top:var(--box-padding);width:20px}vite-error-overlay::part(file):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}vite-error-overlay::part(frame):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E")}vite-error-overlay::part(stack):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E")}vite-error-overlay::part(tip):before{content:"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.";display:block;margin-bottom:1em}`, En = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
1419
+ async function Sn(e, n, i, r) {
1420
+ const o = await i.dynamicImport("node:fs"), u = await i.dynamicImport("node:url"), l = ["mjs", "cjs", "js"].map(
1421
+ (f) => r.join(n, `entry.preview.${f}`)
1767
1422
  ).find((f) => o.existsSync(f));
1768
- if (!a)
1769
- return Qe(
1423
+ if (!l)
1424
+ return He(
1770
1425
  e,
1771
- `Unable to find output "${t}/entry.preview" module.
1426
+ `Unable to find output "${n}/entry.preview" module.
1772
1427
 
1773
1428
  Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
1774
1429
  );
1775
1430
  try {
1776
- const f = m.pathToFileURL(a).href, n = await i.strictDynamicImport(f);
1777
- let b = null, v = null;
1778
- if (n.default && (typeof n.default == "function" ? b = n.default : typeof n.default == "object" && (b = n.default.router, v = n.default.notFound)), typeof b != "function")
1779
- return Qe(
1431
+ const f = u.pathToFileURL(l).href, t = await i.strictDynamicImport(f);
1432
+ let g = null, m = null;
1433
+ if (t.default && (typeof t.default == "function" ? g = t.default : typeof t.default == "object" && (g = t.default.router, m = t.default.notFound)), typeof g != "function")
1434
+ return He(
1780
1435
  e,
1781
- `Entry preview module "${a}" does not export a default middleware function`
1436
+ `Entry preview module "${l}" does not export a default middleware function`
1782
1437
  );
1783
- e.use(b), typeof v == "function" && e.use(v);
1438
+ e.use(g), typeof m == "function" && e.use(m);
1784
1439
  } catch (f) {
1785
- return Qe(e, String(f));
1440
+ return He(e, String(f));
1786
1441
  }
1787
1442
  }
1788
- function Qe(e, t) {
1443
+ function He(e, n) {
1789
1444
  console.log(`
1790
- ❌ ${t}
1445
+ ❌ ${n}
1791
1446
  `), e.use((i, r) => {
1792
1447
  r.writeHead(400, {
1793
1448
  "Content-Type": "text/plain"
1794
- }), r.end(t);
1449
+ }), r.end(n);
1795
1450
  });
1796
1451
  }
1797
- const Mn = (e, t) => {
1452
+ const kn = (e, n) => {
1798
1453
  const i = [
1799
- { tag: "style", children: Pn, injectTo: "body" },
1800
- { tag: "style", children: Dn, injectTo: "body" },
1801
- { tag: "script", attrs: { type: "module" }, children: kn, injectTo: "body" },
1802
- { tag: "script", attrs: { type: "module" }, children: Sn, injectTo: "body" }
1454
+ { tag: "style", children: In, injectTo: "body" },
1455
+ { tag: "style", children: En, injectTo: "body" },
1456
+ { tag: "script", attrs: { type: "module" }, children: yn, injectTo: "body" },
1457
+ { tag: "script", attrs: { type: "module" }, children: gn, injectTo: "body" }
1803
1458
  ];
1804
1459
  if ((e.devTools?.imageDevTools ?? !0) && i.push(
1805
1460
  {
1806
1461
  tag: "style",
1807
- children: _n,
1462
+ children: bn,
1808
1463
  injectTo: "body"
1809
1464
  },
1810
1465
  {
1811
1466
  tag: "script",
1812
1467
  attrs: { type: "module" },
1813
- children: Tn.replace(
1468
+ children: wn.replace(
1814
1469
  "globalThis.__TEMPLATE__",
1815
- JSON.stringify(Cn)
1470
+ JSON.stringify(xn)
1816
1471
  ),
1817
1472
  injectTo: "body"
1818
1473
  }
1819
1474
  ), e.devTools?.clickToSource ?? !0) {
1820
1475
  const r = e.devTools.clickToSource ?? [];
1821
- t.endsWith("/") && (t = t.slice(0, -1)), i.push({
1476
+ n.endsWith("/") && (n = n.slice(0, -1)), i.push({
1822
1477
  tag: "script",
1823
1478
  attrs: { type: "module" },
1824
- children: En.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(t)),
1479
+ children: vn.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(n)),
1825
1480
  injectTo: "body"
1826
1481
  });
1827
1482
  }
1828
1483
  return i;
1829
1484
  };
1830
- function G(e) {
1485
+ function A(e) {
1831
1486
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1832
1487
  }
1833
- var ge = {}, Ke = {}, ct;
1834
- function Q() {
1835
- return ct || (ct = 1, (function(e) {
1488
+ var ge = {}, We = {}, at;
1489
+ function H() {
1490
+ return at || (at = 1, (function(e) {
1836
1491
  Object.defineProperty(e, "__esModule", { value: !0 }), e.findBox = e.readUInt = e.readUInt32LE = e.readUInt32BE = e.readInt32LE = e.readUInt24LE = e.readUInt16LE = e.readUInt16BE = e.readInt16LE = e.toHexString = e.toUTF8String = void 0;
1837
- const t = new TextDecoder(), i = (y, u = 0, s = y.length) => t.decode(y.slice(u, s));
1492
+ const n = new TextDecoder(), i = (p, c = 0, y = p.length) => n.decode(p.slice(c, y));
1838
1493
  e.toUTF8String = i;
1839
- const r = (y, u = 0, s = y.length) => y.slice(u, s).reduce((p, _) => p + ("0" + _.toString(16)).slice(-2), "");
1494
+ const r = (p, c = 0, y = p.length) => p.slice(c, y).reduce((M, K) => M + ("0" + K.toString(16)).slice(-2), "");
1840
1495
  e.toHexString = r;
1841
- const o = (y, u = 0) => {
1842
- const s = y[u] + y[u + 1] * 256;
1843
- return s | (s & 2 ** 15) * 131070;
1496
+ const o = (p, c = 0) => {
1497
+ const y = p[c] + p[c + 1] * 256;
1498
+ return y | (y & 2 ** 15) * 131070;
1844
1499
  };
1845
1500
  e.readInt16LE = o;
1846
- const m = (y, u = 0) => y[u] * 2 ** 8 + y[u + 1];
1847
- e.readUInt16BE = m;
1848
- const l = (y, u = 0) => y[u] + y[u + 1] * 2 ** 8;
1849
- e.readUInt16LE = l;
1850
- const a = (y, u = 0) => y[u] + y[u + 1] * 2 ** 8 + y[u + 2] * 2 ** 16;
1851
- e.readUInt24LE = a;
1852
- const f = (y, u = 0) => y[u] + y[u + 1] * 2 ** 8 + y[u + 2] * 2 ** 16 + (y[u + 3] << 24);
1501
+ const u = (p, c = 0) => p[c] * 2 ** 8 + p[c + 1];
1502
+ e.readUInt16BE = u;
1503
+ const a = (p, c = 0) => p[c] + p[c + 1] * 2 ** 8;
1504
+ e.readUInt16LE = a;
1505
+ const l = (p, c = 0) => p[c] + p[c + 1] * 2 ** 8 + p[c + 2] * 2 ** 16;
1506
+ e.readUInt24LE = l;
1507
+ const f = (p, c = 0) => p[c] + p[c + 1] * 2 ** 8 + p[c + 2] * 2 ** 16 + (p[c + 3] << 24);
1853
1508
  e.readInt32LE = f;
1854
- const n = (y, u = 0) => y[u] * 2 ** 24 + y[u + 1] * 2 ** 16 + y[u + 2] * 2 ** 8 + y[u + 3];
1855
- e.readUInt32BE = n;
1856
- const b = (y, u = 0) => y[u] + y[u + 1] * 2 ** 8 + y[u + 2] * 2 ** 16 + y[u + 3] * 2 ** 24;
1857
- e.readUInt32LE = b;
1858
- const v = {
1509
+ const t = (p, c = 0) => p[c] * 2 ** 24 + p[c + 1] * 2 ** 16 + p[c + 2] * 2 ** 8 + p[c + 3];
1510
+ e.readUInt32BE = t;
1511
+ const g = (p, c = 0) => p[c] + p[c + 1] * 2 ** 8 + p[c + 2] * 2 ** 16 + p[c + 3] * 2 ** 24;
1512
+ e.readUInt32LE = g;
1513
+ const m = {
1859
1514
  readUInt16BE: e.readUInt16BE,
1860
1515
  readUInt16LE: e.readUInt16LE,
1861
1516
  readUInt32BE: e.readUInt32BE,
1862
1517
  readUInt32LE: e.readUInt32LE
1863
1518
  };
1864
- function I(y, u, s, p) {
1865
- s = s || 0;
1866
- const _ = p ? "BE" : "LE", S = "readUInt" + u + _;
1867
- return v[S](y, s);
1868
- }
1869
- e.readUInt = I;
1870
- function g(y, u) {
1871
- if (y.length - u < 4)
1519
+ function v(p, c, y, M) {
1520
+ y = y || 0;
1521
+ const K = M ? "BE" : "LE", O = "readUInt" + c + K;
1522
+ return m[O](p, y);
1523
+ }
1524
+ e.readUInt = v;
1525
+ function d(p, c) {
1526
+ if (p.length - c < 4)
1872
1527
  return;
1873
- const s = (0, e.readUInt32BE)(y, u);
1874
- if (!(y.length - u < s))
1528
+ const y = (0, e.readUInt32BE)(p, c);
1529
+ if (!(p.length - c < y))
1875
1530
  return {
1876
- name: (0, e.toUTF8String)(y, 4 + u, 8 + u),
1877
- offset: u,
1878
- size: s
1531
+ name: (0, e.toUTF8String)(p, 4 + c, 8 + c),
1532
+ offset: c,
1533
+ size: y
1879
1534
  };
1880
1535
  }
1881
- function d(y, u, s) {
1882
- for (; s < y.length; ) {
1883
- const p = g(y, s);
1884
- if (!p)
1536
+ function s(p, c, y) {
1537
+ for (; y < p.length; ) {
1538
+ const M = d(p, y);
1539
+ if (!M)
1885
1540
  break;
1886
- if (p.name === u)
1887
- return p;
1888
- s += p.size > 0 ? p.size : 8;
1541
+ if (M.name === c)
1542
+ return M;
1543
+ y += M.size > 0 ? M.size : 8;
1889
1544
  }
1890
1545
  }
1891
- e.findBox = d;
1892
- })(Ke)), Ke;
1546
+ e.findBox = s;
1547
+ })(We)), We;
1893
1548
  }
1894
- var dt;
1895
- function qn() {
1896
- if (dt) return ge;
1897
- dt = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.BMP = void 0;
1898
- const e = Q();
1549
+ var lt;
1550
+ function _n() {
1551
+ if (lt) return ge;
1552
+ lt = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.BMP = void 0;
1553
+ const e = H();
1899
1554
  return ge.BMP = {
1900
- validate: (t) => (0, e.toUTF8String)(t, 0, 2) === "BM",
1901
- calculate: (t) => ({
1902
- height: Math.abs((0, e.readInt32LE)(t, 22)),
1903
- width: (0, e.readUInt32LE)(t, 18)
1555
+ validate: (n) => (0, e.toUTF8String)(n, 0, 2) === "BM",
1556
+ calculate: (n) => ({
1557
+ height: Math.abs((0, e.readInt32LE)(n, 22)),
1558
+ width: (0, e.readUInt32LE)(n, 18)
1904
1559
  })
1905
1560
  }, ge;
1906
1561
  }
1907
- var On = qn();
1908
- const Ln = /* @__PURE__ */ G(On);
1909
- var ye = {}, ve = {}, ut;
1910
- function Mt() {
1911
- if (ut) return ve;
1912
- ut = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.ICO = void 0;
1913
- const e = Q(), t = 1, i = 6, r = 16;
1914
- function o(l, a) {
1915
- const f = l[a];
1562
+ var Tn = _n();
1563
+ const Cn = /* @__PURE__ */ A(Tn);
1564
+ var ve = {}, ye = {}, ct;
1565
+ function Pt() {
1566
+ if (ct) return ye;
1567
+ ct = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.ICO = void 0;
1568
+ const e = H(), n = 1, i = 6, r = 16;
1569
+ function o(a, l) {
1570
+ const f = a[l];
1916
1571
  return f === 0 ? 256 : f;
1917
1572
  }
1918
- function m(l, a) {
1919
- const f = i + a * r;
1573
+ function u(a, l) {
1574
+ const f = i + l * r;
1920
1575
  return {
1921
- height: o(l, f + 1),
1922
- width: o(l, f)
1576
+ height: o(a, f + 1),
1577
+ width: o(a, f)
1923
1578
  };
1924
1579
  }
1925
- return ve.ICO = {
1926
- validate(l) {
1927
- const a = (0, e.readUInt16LE)(l, 0), f = (0, e.readUInt16LE)(l, 4);
1928
- return a !== 0 || f === 0 ? !1 : (0, e.readUInt16LE)(l, 2) === t;
1580
+ return ye.ICO = {
1581
+ validate(a) {
1582
+ const l = (0, e.readUInt16LE)(a, 0), f = (0, e.readUInt16LE)(a, 4);
1583
+ return l !== 0 || f === 0 ? !1 : (0, e.readUInt16LE)(a, 2) === n;
1929
1584
  },
1930
- calculate(l) {
1931
- const a = (0, e.readUInt16LE)(l, 4), f = m(l, 0);
1932
- if (a === 1)
1585
+ calculate(a) {
1586
+ const l = (0, e.readUInt16LE)(a, 4), f = u(a, 0);
1587
+ if (l === 1)
1933
1588
  return f;
1934
- const n = [f];
1935
- for (let b = 1; b < a; b += 1)
1936
- n.push(m(l, b));
1589
+ const t = [f];
1590
+ for (let g = 1; g < l; g += 1)
1591
+ t.push(u(a, g));
1937
1592
  return {
1938
1593
  height: f.height,
1939
- images: n,
1594
+ images: t,
1940
1595
  width: f.width
1941
1596
  };
1942
1597
  }
1943
- }, ve;
1598
+ }, ye;
1944
1599
  }
1945
- var ft;
1946
- function jn() {
1947
- if (ft) return ye;
1948
- ft = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.CUR = void 0;
1949
- const e = Mt(), t = Q(), i = 2;
1950
- return ye.CUR = {
1600
+ var dt;
1601
+ function Pn() {
1602
+ if (dt) return ve;
1603
+ dt = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.CUR = void 0;
1604
+ const e = Pt(), n = H(), i = 2;
1605
+ return ve.CUR = {
1951
1606
  validate(r) {
1952
- const o = (0, t.readUInt16LE)(r, 0), m = (0, t.readUInt16LE)(r, 4);
1953
- return o !== 0 || m === 0 ? !1 : (0, t.readUInt16LE)(r, 2) === i;
1607
+ const o = (0, n.readUInt16LE)(r, 0), u = (0, n.readUInt16LE)(r, 4);
1608
+ return o !== 0 || u === 0 ? !1 : (0, n.readUInt16LE)(r, 2) === i;
1954
1609
  },
1955
1610
  calculate: (r) => e.ICO.calculate(r)
1956
- }, ye;
1611
+ }, ve;
1957
1612
  }
1958
- var Un = jn();
1959
- const Bn = /* @__PURE__ */ G(Un);
1960
- var be = {}, pt;
1961
- function Rn() {
1962
- if (pt) return be;
1963
- pt = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.DDS = void 0;
1964
- const e = Q();
1613
+ var Dn = Pn();
1614
+ const Nn = /* @__PURE__ */ A(Dn);
1615
+ var be = {}, ut;
1616
+ function Mn() {
1617
+ if (ut) return be;
1618
+ ut = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.DDS = void 0;
1619
+ const e = H();
1965
1620
  return be.DDS = {
1966
- validate: (t) => (0, e.readUInt32LE)(t, 0) === 542327876,
1967
- calculate: (t) => ({
1968
- height: (0, e.readUInt32LE)(t, 12),
1969
- width: (0, e.readUInt32LE)(t, 16)
1621
+ validate: (n) => (0, e.readUInt32LE)(n, 0) === 542327876,
1622
+ calculate: (n) => ({
1623
+ height: (0, e.readUInt32LE)(n, 12),
1624
+ width: (0, e.readUInt32LE)(n, 16)
1970
1625
  })
1971
1626
  }, be;
1972
1627
  }
1973
- var An = Rn();
1974
- const Fn = /* @__PURE__ */ G(An);
1975
- var we = {}, mt;
1976
- function $n() {
1977
- if (mt) return we;
1978
- mt = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.GIF = void 0;
1979
- const e = Q(), t = /^GIF8[79]a/;
1628
+ var On = Mn();
1629
+ const jn = /* @__PURE__ */ A(On);
1630
+ var we = {}, ft;
1631
+ function qn() {
1632
+ if (ft) return we;
1633
+ ft = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.GIF = void 0;
1634
+ const e = H(), n = /^GIF8[79]a/;
1980
1635
  return we.GIF = {
1981
- validate: (i) => t.test((0, e.toUTF8String)(i, 0, 6)),
1636
+ validate: (i) => n.test((0, e.toUTF8String)(i, 0, 6)),
1982
1637
  calculate: (i) => ({
1983
1638
  height: (0, e.readUInt16LE)(i, 8),
1984
1639
  width: (0, e.readUInt16LE)(i, 6)
1985
1640
  })
1986
1641
  }, we;
1987
1642
  }
1988
- var zn = $n();
1989
- const Hn = /* @__PURE__ */ G(zn);
1990
- var xe = {}, ht;
1991
- function Wn() {
1992
- if (ht) return xe;
1993
- ht = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.ICNS = void 0;
1994
- const e = Q(), t = 8, i = 4, r = 4, o = {
1643
+ var Ln = qn();
1644
+ const Un = /* @__PURE__ */ A(Ln);
1645
+ var xe = {}, pt;
1646
+ function Rn() {
1647
+ if (pt) return xe;
1648
+ pt = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.ICNS = void 0;
1649
+ const e = H(), n = 8, i = 4, r = 4, o = {
1995
1650
  ICON: 32,
1996
1651
  "ICN#": 32,
1997
1652
  // m => 16 x 16
@@ -2033,175 +1688,175 @@ function Wn() {
2033
1688
  // . => 1024 x 1024
2034
1689
  ic10: 1024
2035
1690
  };
2036
- function m(a, f) {
2037
- const n = f + r;
1691
+ function u(l, f) {
1692
+ const t = f + r;
2038
1693
  return [
2039
- (0, e.toUTF8String)(a, f, n),
2040
- (0, e.readUInt32BE)(a, n)
1694
+ (0, e.toUTF8String)(l, f, t),
1695
+ (0, e.readUInt32BE)(l, t)
2041
1696
  ];
2042
1697
  }
2043
- function l(a) {
2044
- const f = o[a];
2045
- return { width: f, height: f, type: a };
1698
+ function a(l) {
1699
+ const f = o[l];
1700
+ return { width: f, height: f, type: l };
2046
1701
  }
2047
1702
  return xe.ICNS = {
2048
- validate: (a) => (0, e.toUTF8String)(a, 0, 4) === "icns",
2049
- calculate(a) {
2050
- const f = a.length, n = (0, e.readUInt32BE)(a, i);
2051
- let b = t, v = m(a, b), I = l(v[0]);
2052
- if (b += v[1], b === n)
2053
- return I;
2054
- const g = {
2055
- height: I.height,
2056
- images: [I],
2057
- width: I.width
1703
+ validate: (l) => (0, e.toUTF8String)(l, 0, 4) === "icns",
1704
+ calculate(l) {
1705
+ const f = l.length, t = (0, e.readUInt32BE)(l, i);
1706
+ let g = n, m = u(l, g), v = a(m[0]);
1707
+ if (g += m[1], g === t)
1708
+ return v;
1709
+ const d = {
1710
+ height: v.height,
1711
+ images: [v],
1712
+ width: v.width
2058
1713
  };
2059
- for (; b < n && b < f; )
2060
- v = m(a, b), I = l(v[0]), b += v[1], g.images.push(I);
2061
- return g;
1714
+ for (; g < t && g < f; )
1715
+ m = u(l, g), v = a(m[0]), g += m[1], d.images.push(v);
1716
+ return d;
2062
1717
  }
2063
1718
  }, xe;
2064
1719
  }
2065
- var Gn = Wn();
2066
- const Qn = /* @__PURE__ */ G(Gn);
2067
- var Kn = Mt();
2068
- const Jn = /* @__PURE__ */ G(Kn);
2069
- var Ie = {}, gt;
2070
- function Yn() {
2071
- if (gt) return Ie;
2072
- gt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.J2C = void 0;
2073
- const e = Q();
1720
+ var Bn = Rn();
1721
+ const Fn = /* @__PURE__ */ A(Bn);
1722
+ var $n = Pt();
1723
+ const zn = /* @__PURE__ */ A($n);
1724
+ var Ie = {}, ht;
1725
+ function An() {
1726
+ if (ht) return Ie;
1727
+ ht = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.J2C = void 0;
1728
+ const e = H();
2074
1729
  return Ie.J2C = {
2075
1730
  // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
2076
- validate: (t) => (0, e.readUInt32BE)(t, 0) === 4283432785,
2077
- calculate: (t) => ({
2078
- height: (0, e.readUInt32BE)(t, 12),
2079
- width: (0, e.readUInt32BE)(t, 8)
1731
+ validate: (n) => (0, e.readUInt32BE)(n, 0) === 4283432785,
1732
+ calculate: (n) => ({
1733
+ height: (0, e.readUInt32BE)(n, 12),
1734
+ width: (0, e.readUInt32BE)(n, 8)
2080
1735
  })
2081
1736
  }, Ie;
2082
1737
  }
2083
- var Xn = Yn();
2084
- const Vn = /* @__PURE__ */ G(Xn);
2085
- var Se = {}, yt;
2086
- function Zn() {
2087
- if (yt) return Se;
2088
- yt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.JP2 = void 0;
2089
- const e = Q();
2090
- return Se.JP2 = {
2091
- validate(t) {
2092
- if ((0, e.toUTF8String)(t, 4, 8) !== "jP ")
1738
+ var Hn = An();
1739
+ const Wn = /* @__PURE__ */ A(Hn);
1740
+ var Ee = {}, mt;
1741
+ function Gn() {
1742
+ if (mt) return Ee;
1743
+ mt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.JP2 = void 0;
1744
+ const e = H();
1745
+ return Ee.JP2 = {
1746
+ validate(n) {
1747
+ if ((0, e.toUTF8String)(n, 4, 8) !== "jP ")
2093
1748
  return !1;
2094
- const r = (0, e.findBox)(t, "ftyp", 0);
2095
- return r ? (0, e.toUTF8String)(t, r.offset + 8, r.offset + 12) === "jp2 " : !1;
1749
+ const r = (0, e.findBox)(n, "ftyp", 0);
1750
+ return r ? (0, e.toUTF8String)(n, r.offset + 8, r.offset + 12) === "jp2 " : !1;
2096
1751
  },
2097
- calculate(t) {
2098
- const i = (0, e.findBox)(t, "jp2h", 0), r = i && (0, e.findBox)(t, "ihdr", i.offset + 8);
1752
+ calculate(n) {
1753
+ const i = (0, e.findBox)(n, "jp2h", 0), r = i && (0, e.findBox)(n, "ihdr", i.offset + 8);
2099
1754
  if (r)
2100
1755
  return {
2101
- height: (0, e.readUInt32BE)(t, r.offset + 8),
2102
- width: (0, e.readUInt32BE)(t, r.offset + 12)
1756
+ height: (0, e.readUInt32BE)(n, r.offset + 8),
1757
+ width: (0, e.readUInt32BE)(n, r.offset + 12)
2103
1758
  };
2104
1759
  throw new TypeError("Unsupported JPEG 2000 format");
2105
1760
  }
2106
- }, Se;
1761
+ }, Ee;
2107
1762
  }
2108
- var er = Zn();
2109
- const tr = /* @__PURE__ */ G(er);
2110
- var Ee = {}, vt;
2111
- function nr() {
2112
- if (vt) return Ee;
2113
- vt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.JPG = void 0;
2114
- const e = Q(), t = "45786966", i = 2, r = 6, o = 2, m = "4d4d", l = "4949", a = 12, f = 2;
2115
- function n(d) {
2116
- return (0, e.toHexString)(d, 2, 6) === t;
2117
- }
2118
- function b(d, y) {
1763
+ var Kn = Gn();
1764
+ const Qn = /* @__PURE__ */ A(Kn);
1765
+ var Se = {}, gt;
1766
+ function Jn() {
1767
+ if (gt) return Se;
1768
+ gt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.JPG = void 0;
1769
+ const e = H(), n = "45786966", i = 2, r = 6, o = 2, u = "4d4d", a = "4949", l = 12, f = 2;
1770
+ function t(s) {
1771
+ return (0, e.toHexString)(s, 2, 6) === n;
1772
+ }
1773
+ function g(s, p) {
2119
1774
  return {
2120
- height: (0, e.readUInt16BE)(d, y),
2121
- width: (0, e.readUInt16BE)(d, y + 2)
1775
+ height: (0, e.readUInt16BE)(s, p),
1776
+ width: (0, e.readUInt16BE)(s, p + 2)
2122
1777
  };
2123
1778
  }
2124
- function v(d, y) {
2125
- const s = r + 8, p = (0, e.readUInt)(d, 16, s, y);
2126
- for (let _ = 0; _ < p; _++) {
2127
- const S = s + f + _ * a, E = S + a;
2128
- if (S > d.length)
1779
+ function m(s, p) {
1780
+ const y = r + 8, M = (0, e.readUInt)(s, 16, y, p);
1781
+ for (let K = 0; K < M; K++) {
1782
+ const O = y + f + K * l, k = O + l;
1783
+ if (O > s.length)
2129
1784
  return;
2130
- const c = d.slice(S, E);
2131
- if ((0, e.readUInt)(c, 16, 0, y) === 274)
2132
- return (0, e.readUInt)(c, 16, 2, y) !== 3 || (0, e.readUInt)(c, 32, 4, y) !== 1 ? void 0 : (0, e.readUInt)(c, 16, 8, y);
1785
+ const b = s.slice(O, k);
1786
+ if ((0, e.readUInt)(b, 16, 0, p) === 274)
1787
+ return (0, e.readUInt)(b, 16, 2, p) !== 3 || (0, e.readUInt)(b, 32, 4, p) !== 1 ? void 0 : (0, e.readUInt)(b, 16, 8, p);
2133
1788
  }
2134
1789
  }
2135
- function I(d, y) {
2136
- const u = d.slice(i, y), s = (0, e.toHexString)(u, r, r + o), p = s === m;
2137
- if (p || s === l)
2138
- return v(u, p);
1790
+ function v(s, p) {
1791
+ const c = s.slice(i, p), y = (0, e.toHexString)(c, r, r + o), M = y === u;
1792
+ if (M || y === a)
1793
+ return m(c, M);
2139
1794
  }
2140
- function g(d, y) {
2141
- if (y > d.length)
1795
+ function d(s, p) {
1796
+ if (p > s.length)
2142
1797
  throw new TypeError("Corrupt JPG, exceeded buffer limits");
2143
1798
  }
2144
- return Ee.JPG = {
2145
- validate: (d) => (0, e.toHexString)(d, 0, 2) === "ffd8",
2146
- calculate(d) {
2147
- d = d.slice(4);
2148
- let y, u;
2149
- for (; d.length; ) {
2150
- const s = (0, e.readUInt16BE)(d, 0);
2151
- if (d[s] !== 255) {
2152
- d = d.slice(1);
1799
+ return Se.JPG = {
1800
+ validate: (s) => (0, e.toHexString)(s, 0, 2) === "ffd8",
1801
+ calculate(s) {
1802
+ s = s.slice(4);
1803
+ let p, c;
1804
+ for (; s.length; ) {
1805
+ const y = (0, e.readUInt16BE)(s, 0);
1806
+ if (s[y] !== 255) {
1807
+ s = s.slice(1);
2153
1808
  continue;
2154
1809
  }
2155
- if (n(d) && (y = I(d, s)), g(d, s), u = d[s + 1], u === 192 || u === 193 || u === 194) {
2156
- const p = b(d, s + 5);
2157
- return y ? {
2158
- height: p.height,
2159
- orientation: y,
2160
- width: p.width
2161
- } : p;
1810
+ if (t(s) && (p = v(s, y)), d(s, y), c = s[y + 1], c === 192 || c === 193 || c === 194) {
1811
+ const M = g(s, y + 5);
1812
+ return p ? {
1813
+ height: M.height,
1814
+ orientation: p,
1815
+ width: M.width
1816
+ } : M;
2162
1817
  }
2163
- d = d.slice(s + 2);
1818
+ s = s.slice(y + 2);
2164
1819
  }
2165
1820
  throw new TypeError("Invalid JPG, no size found");
2166
1821
  }
2167
- }, Ee;
1822
+ }, Se;
2168
1823
  }
2169
- var rr = nr();
2170
- const or = /* @__PURE__ */ G(rr);
2171
- var ke = {}, bt;
2172
- function ir() {
2173
- if (bt) return ke;
2174
- bt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.KTX = void 0;
2175
- const e = Q();
1824
+ var Yn = Jn();
1825
+ const Xn = /* @__PURE__ */ A(Yn);
1826
+ var ke = {}, vt;
1827
+ function Vn() {
1828
+ if (vt) return ke;
1829
+ vt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.KTX = void 0;
1830
+ const e = H();
2176
1831
  return ke.KTX = {
2177
- validate: (t) => {
2178
- const i = (0, e.toUTF8String)(t, 1, 7);
1832
+ validate: (n) => {
1833
+ const i = (0, e.toUTF8String)(n, 1, 7);
2179
1834
  return ["KTX 11", "KTX 20"].includes(i);
2180
1835
  },
2181
- calculate: (t) => {
2182
- const i = t[5] === 49 ? "ktx" : "ktx2", r = i === "ktx" ? 36 : 20;
1836
+ calculate: (n) => {
1837
+ const i = n[5] === 49 ? "ktx" : "ktx2", r = i === "ktx" ? 36 : 20;
2183
1838
  return {
2184
- height: (0, e.readUInt32LE)(t, r + 4),
2185
- width: (0, e.readUInt32LE)(t, r),
1839
+ height: (0, e.readUInt32LE)(n, r + 4),
1840
+ width: (0, e.readUInt32LE)(n, r),
2186
1841
  type: i
2187
1842
  };
2188
1843
  }
2189
1844
  }, ke;
2190
1845
  }
2191
- var sr = ir();
2192
- const ar = /* @__PURE__ */ G(sr);
2193
- var _e = {}, wt;
2194
- function lr() {
2195
- if (wt) return _e;
2196
- wt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.PNG = void 0;
2197
- const e = Q(), t = `PNG\r
1846
+ var Zn = Vn();
1847
+ const er = /* @__PURE__ */ A(Zn);
1848
+ var _e = {}, yt;
1849
+ function tr() {
1850
+ if (yt) return _e;
1851
+ yt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.PNG = void 0;
1852
+ const e = H(), n = `PNG\r
2198
1853
  
2199
1854
  `, i = "IHDR", r = "CgBI";
2200
1855
  return _e.PNG = {
2201
1856
  validate(o) {
2202
- if (t === (0, e.toUTF8String)(o, 1, 8)) {
2203
- let m = (0, e.toUTF8String)(o, 12, 16);
2204
- if (m === r && (m = (0, e.toUTF8String)(o, 28, 32)), m !== i)
1857
+ if (n === (0, e.toUTF8String)(o, 1, 8)) {
1858
+ let u = (0, e.toUTF8String)(o, 12, 16);
1859
+ if (u === r && (u = (0, e.toUTF8String)(o, 28, 32)), u !== i)
2205
1860
  throw new TypeError("Invalid PNG");
2206
1861
  return !0;
2207
1862
  }
@@ -2218,13 +1873,13 @@ function lr() {
2218
1873
  }
2219
1874
  }, _e;
2220
1875
  }
2221
- var cr = lr();
2222
- const dr = /* @__PURE__ */ G(cr);
2223
- var Te = {}, xt;
2224
- function ur() {
2225
- if (xt) return Te;
2226
- xt = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.PNM = void 0;
2227
- const e = Q(), t = {
1876
+ var nr = tr();
1877
+ const rr = /* @__PURE__ */ A(nr);
1878
+ var Te = {}, bt;
1879
+ function or() {
1880
+ if (bt) return Te;
1881
+ bt = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.PNM = void 0;
1882
+ const e = H(), n = {
2228
1883
  P1: "pbm/ascii",
2229
1884
  P2: "pgm/ascii",
2230
1885
  P3: "ppm/ascii",
@@ -2237,9 +1892,9 @@ function ur() {
2237
1892
  default: (r) => {
2238
1893
  let o = [];
2239
1894
  for (; r.length > 0; ) {
2240
- const m = r.shift();
2241
- if (m[0] !== "#") {
2242
- o = m.split(" ");
1895
+ const u = r.shift();
1896
+ if (u[0] !== "#") {
1897
+ o = u.split(" ");
2243
1898
  break;
2244
1899
  }
2245
1900
  }
@@ -2253,11 +1908,11 @@ function ur() {
2253
1908
  pam: (r) => {
2254
1909
  const o = {};
2255
1910
  for (; r.length > 0; ) {
2256
- const m = r.shift();
2257
- if (m.length > 16 || m.charCodeAt(0) > 128)
1911
+ const u = r.shift();
1912
+ if (u.length > 16 || u.charCodeAt(0) > 128)
2258
1913
  continue;
2259
- const [l, a] = m.split(" ");
2260
- if (l && a && (o[l.toLowerCase()] = parseInt(a, 10)), o.height && o.width)
1914
+ const [a, l] = u.split(" ");
1915
+ if (a && l && (o[a.toLowerCase()] = parseInt(l, 10)), o.height && o.width)
2261
1916
  break;
2262
1917
  }
2263
1918
  if (o.height && o.width)
@@ -2269,37 +1924,37 @@ function ur() {
2269
1924
  }
2270
1925
  };
2271
1926
  return Te.PNM = {
2272
- validate: (r) => (0, e.toUTF8String)(r, 0, 2) in t,
1927
+ validate: (r) => (0, e.toUTF8String)(r, 0, 2) in n,
2273
1928
  calculate(r) {
2274
- const o = (0, e.toUTF8String)(r, 0, 2), m = t[o], l = (0, e.toUTF8String)(r, 3).split(/[\r\n]+/);
2275
- return (i[m] || i.default)(l);
1929
+ const o = (0, e.toUTF8String)(r, 0, 2), u = n[o], a = (0, e.toUTF8String)(r, 3).split(/[\r\n]+/);
1930
+ return (i[u] || i.default)(a);
2276
1931
  }
2277
1932
  }, Te;
2278
1933
  }
2279
- var fr = ur();
2280
- const pr = /* @__PURE__ */ G(fr);
2281
- var Ce = {}, It;
2282
- function mr() {
2283
- if (It) return Ce;
2284
- It = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.PSD = void 0;
2285
- const e = Q();
1934
+ var ir = or();
1935
+ const sr = /* @__PURE__ */ A(ir);
1936
+ var Ce = {}, wt;
1937
+ function ar() {
1938
+ if (wt) return Ce;
1939
+ wt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.PSD = void 0;
1940
+ const e = H();
2286
1941
  return Ce.PSD = {
2287
- validate: (t) => (0, e.toUTF8String)(t, 0, 4) === "8BPS",
2288
- calculate: (t) => ({
2289
- height: (0, e.readUInt32BE)(t, 14),
2290
- width: (0, e.readUInt32BE)(t, 18)
1942
+ validate: (n) => (0, e.toUTF8String)(n, 0, 4) === "8BPS",
1943
+ calculate: (n) => ({
1944
+ height: (0, e.readUInt32BE)(n, 14),
1945
+ width: (0, e.readUInt32BE)(n, 18)
2291
1946
  })
2292
1947
  }, Ce;
2293
1948
  }
2294
- var hr = mr();
2295
- const gr = /* @__PURE__ */ G(hr);
2296
- var Pe = {}, St;
2297
- function yr() {
2298
- if (St) return Pe;
2299
- St = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.SVG = void 0;
2300
- const e = Q(), t = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, i = {
1949
+ var lr = ar();
1950
+ const cr = /* @__PURE__ */ A(lr);
1951
+ var Pe = {}, xt;
1952
+ function dr() {
1953
+ if (xt) return Pe;
1954
+ xt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.SVG = void 0;
1955
+ const e = H(), n = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, i = {
2301
1956
  height: /\sheight=(['"])([^%]+?)\1/,
2302
- root: t,
1957
+ root: n,
2303
1958
  viewbox: /\sviewBox=(['"])(.+?)\1/i,
2304
1959
  width: /\swidth=(['"])([^%]+?)\1/
2305
1960
  }, r = 2.54, o = {
@@ -2312,89 +1967,89 @@ function yr() {
2312
1967
  pc: 96 / 72 / 12,
2313
1968
  pt: 96 / 72,
2314
1969
  px: 1
2315
- }, m = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(o).join("|")})?$`);
2316
- function l(v) {
2317
- const I = m.exec(v);
2318
- if (I)
2319
- return Math.round(Number(I[1]) * (o[I[2]] || 1));
2320
- }
2321
- function a(v) {
2322
- const I = v.split(" ");
1970
+ }, u = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(o).join("|")})?$`);
1971
+ function a(m) {
1972
+ const v = u.exec(m);
1973
+ if (v)
1974
+ return Math.round(Number(v[1]) * (o[v[2]] || 1));
1975
+ }
1976
+ function l(m) {
1977
+ const v = m.split(" ");
2323
1978
  return {
2324
- height: l(I[3]),
2325
- width: l(I[2])
1979
+ height: a(v[3]),
1980
+ width: a(v[2])
2326
1981
  };
2327
1982
  }
2328
- function f(v) {
2329
- const I = v.match(i.width), g = v.match(i.height), d = v.match(i.viewbox);
1983
+ function f(m) {
1984
+ const v = m.match(i.width), d = m.match(i.height), s = m.match(i.viewbox);
2330
1985
  return {
2331
- height: g && l(g[2]),
2332
- viewbox: d && a(d[2]),
2333
- width: I && l(I[2])
1986
+ height: d && a(d[2]),
1987
+ viewbox: s && l(s[2]),
1988
+ width: v && a(v[2])
2334
1989
  };
2335
1990
  }
2336
- function n(v) {
1991
+ function t(m) {
2337
1992
  return {
2338
- height: v.height,
2339
- width: v.width
1993
+ height: m.height,
1994
+ width: m.width
2340
1995
  };
2341
1996
  }
2342
- function b(v, I) {
2343
- const g = I.width / I.height;
2344
- return v.width ? {
2345
- height: Math.floor(v.width / g),
2346
- width: v.width
2347
- } : v.height ? {
2348
- height: v.height,
2349
- width: Math.floor(v.height * g)
1997
+ function g(m, v) {
1998
+ const d = v.width / v.height;
1999
+ return m.width ? {
2000
+ height: Math.floor(m.width / d),
2001
+ width: m.width
2002
+ } : m.height ? {
2003
+ height: m.height,
2004
+ width: Math.floor(m.height * d)
2350
2005
  } : {
2351
- height: I.height,
2352
- width: I.width
2006
+ height: v.height,
2007
+ width: v.width
2353
2008
  };
2354
2009
  }
2355
2010
  return Pe.SVG = {
2356
2011
  // Scan only the first kilo-byte to speed up the check on larger files
2357
- validate: (v) => t.test((0, e.toUTF8String)(v, 0, 1e3)),
2358
- calculate(v) {
2359
- const I = (0, e.toUTF8String)(v).match(i.root);
2360
- if (I) {
2361
- const g = f(I[0]);
2362
- if (g.width && g.height)
2363
- return n(g);
2364
- if (g.viewbox)
2365
- return b(g, g.viewbox);
2012
+ validate: (m) => n.test((0, e.toUTF8String)(m, 0, 1e3)),
2013
+ calculate(m) {
2014
+ const v = (0, e.toUTF8String)(m).match(i.root);
2015
+ if (v) {
2016
+ const d = f(v[0]);
2017
+ if (d.width && d.height)
2018
+ return t(d);
2019
+ if (d.viewbox)
2020
+ return g(d, d.viewbox);
2366
2021
  }
2367
2022
  throw new TypeError("Invalid SVG");
2368
2023
  }
2369
2024
  }, Pe;
2370
2025
  }
2371
- var vr = yr();
2372
- const br = /* @__PURE__ */ G(vr);
2373
- var De = {}, Et;
2374
- function wr() {
2375
- if (Et) return De;
2376
- Et = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.TGA = void 0;
2377
- const e = Q();
2026
+ var ur = dr();
2027
+ const fr = /* @__PURE__ */ A(ur);
2028
+ var De = {}, It;
2029
+ function pr() {
2030
+ if (It) return De;
2031
+ It = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.TGA = void 0;
2032
+ const e = H();
2378
2033
  return De.TGA = {
2379
- validate(t) {
2380
- return (0, e.readUInt16LE)(t, 0) === 0 && (0, e.readUInt16LE)(t, 4) === 0;
2034
+ validate(n) {
2035
+ return (0, e.readUInt16LE)(n, 0) === 0 && (0, e.readUInt16LE)(n, 4) === 0;
2381
2036
  },
2382
- calculate(t) {
2037
+ calculate(n) {
2383
2038
  return {
2384
- height: (0, e.readUInt16LE)(t, 14),
2385
- width: (0, e.readUInt16LE)(t, 12)
2039
+ height: (0, e.readUInt16LE)(n, 14),
2040
+ width: (0, e.readUInt16LE)(n, 12)
2386
2041
  };
2387
2042
  }
2388
2043
  }, De;
2389
2044
  }
2390
- var xr = wr();
2391
- const Ir = /* @__PURE__ */ G(xr);
2392
- var Ne = {}, kt;
2393
- function Sr() {
2394
- if (kt) return Ne;
2395
- kt = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.WEBP = void 0;
2396
- const e = Q();
2397
- function t(o) {
2045
+ var hr = pr();
2046
+ const mr = /* @__PURE__ */ A(hr);
2047
+ var Ne = {}, Et;
2048
+ function gr() {
2049
+ if (Et) return Ne;
2050
+ Et = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.WEBP = void 0;
2051
+ const e = H();
2052
+ function n(o) {
2398
2053
  return {
2399
2054
  height: 1 + (0, e.readUInt24LE)(o, 7),
2400
2055
  width: 1 + (0, e.readUInt24LE)(o, 4)
@@ -2414,33 +2069,33 @@ function Sr() {
2414
2069
  }
2415
2070
  return Ne.WEBP = {
2416
2071
  validate(o) {
2417
- const m = (0, e.toUTF8String)(o, 0, 4) === "RIFF", l = (0, e.toUTF8String)(o, 8, 12) === "WEBP", a = (0, e.toUTF8String)(o, 12, 15) === "VP8";
2418
- return m && l && a;
2072
+ const u = (0, e.toUTF8String)(o, 0, 4) === "RIFF", a = (0, e.toUTF8String)(o, 8, 12) === "WEBP", l = (0, e.toUTF8String)(o, 12, 15) === "VP8";
2073
+ return u && a && l;
2419
2074
  },
2420
2075
  calculate(o) {
2421
- const m = (0, e.toUTF8String)(o, 12, 16);
2422
- if (o = o.slice(20, 30), m === "VP8X") {
2423
- const a = o[0], f = (a & 192) === 0, n = (a & 1) === 0;
2424
- if (f && n)
2425
- return t(o);
2076
+ const u = (0, e.toUTF8String)(o, 12, 16);
2077
+ if (o = o.slice(20, 30), u === "VP8X") {
2078
+ const l = o[0], f = (l & 192) === 0, t = (l & 1) === 0;
2079
+ if (f && t)
2080
+ return n(o);
2426
2081
  throw new TypeError("Invalid WebP");
2427
2082
  }
2428
- if (m === "VP8 " && o[0] !== 47)
2083
+ if (u === "VP8 " && o[0] !== 47)
2429
2084
  return r(o);
2430
- const l = (0, e.toHexString)(o, 3, 6);
2431
- if (m === "VP8L" && l !== "9d012a")
2085
+ const a = (0, e.toHexString)(o, 3, 6);
2086
+ if (u === "VP8L" && a !== "9d012a")
2432
2087
  return i(o);
2433
2088
  throw new TypeError("Invalid WebP");
2434
2089
  }
2435
2090
  }, Ne;
2436
2091
  }
2437
- var Er = Sr();
2438
- const kr = /* @__PURE__ */ G(Er);
2439
- var Me = {}, _t;
2440
- function _r() {
2441
- if (_t) return Me;
2442
- _t = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.HEIF = void 0;
2443
- const e = Q(), t = {
2092
+ var vr = gr();
2093
+ const yr = /* @__PURE__ */ A(vr);
2094
+ var Me = {}, St;
2095
+ function br() {
2096
+ if (St) return Me;
2097
+ St = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.HEIF = void 0;
2098
+ const e = H(), n = {
2444
2099
  avif: "avif",
2445
2100
  mif1: "heif",
2446
2101
  msf1: "heif",
@@ -2457,22 +2112,22 @@ function _r() {
2457
2112
  if ((0, e.toUTF8String)(i, 4, 8) !== "ftyp")
2458
2113
  return !1;
2459
2114
  const o = (0, e.findBox)(i, "ftyp", 0);
2460
- return o ? (0, e.toUTF8String)(i, o.offset + 8, o.offset + 12) in t : !1;
2115
+ return o ? (0, e.toUTF8String)(i, o.offset + 8, o.offset + 12) in n : !1;
2461
2116
  },
2462
2117
  calculate(i) {
2463
- const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12), m = o && (0, e.findBox)(i, "ipco", o.offset + 8), l = m && (0, e.findBox)(i, "ispe", m.offset + 8);
2464
- if (l)
2118
+ const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12), u = o && (0, e.findBox)(i, "ipco", o.offset + 8), a = u && (0, e.findBox)(i, "ispe", u.offset + 8);
2119
+ if (a)
2465
2120
  return {
2466
- height: (0, e.readUInt32BE)(i, l.offset + 16),
2467
- width: (0, e.readUInt32BE)(i, l.offset + 12),
2121
+ height: (0, e.readUInt32BE)(i, a.offset + 16),
2122
+ width: (0, e.readUInt32BE)(i, a.offset + 12),
2468
2123
  type: (0, e.toUTF8String)(i, 8, 12)
2469
2124
  };
2470
2125
  throw new TypeError("Invalid HEIF, no size found");
2471
2126
  }
2472
2127
  }, Me;
2473
2128
  }
2474
- var Tr = _r();
2475
- const Cr = /* @__PURE__ */ G(Tr), Pr = {
2129
+ var wr = br();
2130
+ const xr = /* @__PURE__ */ A(wr), Ir = {
2476
2131
  56: "psd",
2477
2132
  66: "bmp",
2478
2133
  68: "dds",
@@ -2481,48 +2136,48 @@ const Cr = /* @__PURE__ */ G(Tr), Pr = {
2481
2136
  105: "icns",
2482
2137
  137: "png",
2483
2138
  255: "jpg"
2484
- }, ze = {
2485
- webp: kr.WEBP,
2486
- jpg: or.JPG,
2487
- png: dr.PNG,
2488
- svg: br.SVG,
2489
- gif: Hn.GIF,
2490
- avif: Cr.HEIF,
2491
- bmp: Ln.BMP,
2492
- cur: Bn.CUR,
2493
- dds: Fn.DDS,
2494
- icns: Qn.ICNS,
2495
- ico: Jn.ICO,
2496
- j2c: Vn.J2C,
2497
- jp2: tr.JP2,
2498
- ktx: ar.KTX,
2499
- pnm: pr.PNM,
2500
- psd: gr.PSD,
2501
- tga: Ir.TGA
2502
- }, Dr = Object.keys(ze);
2503
- function Nr(e) {
2504
- const t = e[0], i = Pr[t];
2505
- return i && ze[i].validate(e) ? i : Dr.find((r) => ze[r].validate(e));
2139
+ }, $e = {
2140
+ webp: yr.WEBP,
2141
+ jpg: Xn.JPG,
2142
+ png: rr.PNG,
2143
+ svg: fr.SVG,
2144
+ gif: Un.GIF,
2145
+ avif: xr.HEIF,
2146
+ bmp: Cn.BMP,
2147
+ cur: Nn.CUR,
2148
+ dds: jn.DDS,
2149
+ icns: Fn.ICNS,
2150
+ ico: zn.ICO,
2151
+ j2c: Wn.J2C,
2152
+ jp2: Qn.JP2,
2153
+ ktx: er.KTX,
2154
+ pnm: sr.PNM,
2155
+ psd: cr.PSD,
2156
+ tga: mr.TGA
2157
+ }, Er = Object.keys($e);
2158
+ function Sr(e) {
2159
+ const n = e[0], i = Ir[n];
2160
+ return i && $e[i].validate(e) ? i : Er.find((r) => $e[r].validate(e));
2506
2161
  }
2507
- function Mr(e) {
2508
- const t = Nr(e);
2509
- if (typeof t < "u") {
2510
- const i = ze[t].calculate(e);
2162
+ function kr(e) {
2163
+ const n = Sr(e);
2164
+ if (typeof n < "u") {
2165
+ const i = $e[n].calculate(e);
2511
2166
  if (i !== void 0)
2512
- return i.type = t, i;
2167
+ return i.type = n, i;
2513
2168
  }
2514
2169
  }
2515
- async function qr(e) {
2170
+ async function _r(e) {
2516
2171
  if (/^(https?|file|capacitor):/.test(e))
2517
2172
  try {
2518
- const t = await fetch(e, {
2173
+ const n = await fetch(e, {
2519
2174
  headers: { Accept: "image/*,*/*" }
2520
2175
  });
2521
- if (!t.ok) {
2176
+ if (!n.ok) {
2522
2177
  console.error("can not fetch", e);
2523
2178
  return;
2524
2179
  }
2525
- const i = await t.arrayBuffer(), r = Mr(Buffer.from(i));
2180
+ const i = await n.arrayBuffer(), r = kr(Buffer.from(i));
2526
2181
  if (r)
2527
2182
  return {
2528
2183
  width: r.width,
@@ -2530,14 +2185,14 @@ async function qr(e) {
2530
2185
  type: r.type,
2531
2186
  size: i.byteLength
2532
2187
  };
2533
- } catch (t) {
2534
- console.error(t);
2188
+ } catch (n) {
2189
+ console.error(n);
2535
2190
  return;
2536
2191
  }
2537
2192
  }
2538
- const Or = (e, t, i) => async (r, o, m) => {
2193
+ const Tr = (e, n, i) => async (r, o, u) => {
2539
2194
  try {
2540
- const l = await e.dynamicImport("node:fs"), a = await e.dynamicImport("node:path");
2195
+ const a = await e.dynamicImport("node:fs"), l = await e.dynamicImport("node:path");
2541
2196
  let f;
2542
2197
  try {
2543
2198
  f = new URL(r.url, "http://localhost:3000/");
@@ -2546,98 +2201,98 @@ const Or = (e, t, i) => async (r, o, m) => {
2546
2201
  return;
2547
2202
  }
2548
2203
  if (r.method === "GET" && f.pathname === "/__image_info") {
2549
- const n = f.searchParams.get("url");
2550
- if (o.setHeader("content-type", "application/json"), n) {
2551
- const b = await qr(n);
2552
- o.setHeader("cache-control", "public, max-age=31536000, immutable"), b ? o.write(JSON.stringify(b)) : o.statusCode = 404;
2204
+ const t = f.searchParams.get("url");
2205
+ if (o.setHeader("content-type", "application/json"), t) {
2206
+ const g = await _r(t);
2207
+ o.setHeader("cache-control", "public, max-age=31536000, immutable"), g ? o.write(JSON.stringify(g)) : o.statusCode = 404;
2553
2208
  } else {
2554
2209
  o.statusCode = 500;
2555
- const b = { message: "error" };
2556
- o.write(JSON.stringify(b));
2210
+ const g = { message: "error" };
2211
+ o.write(JSON.stringify(g));
2557
2212
  }
2558
2213
  o.end();
2559
2214
  return;
2560
2215
  } else if (r.method === "POST" && f.pathname === "/__image_fix") {
2561
- const n = f.searchParams.get("loc"), b = f.searchParams.get("width"), v = f.searchParams.get("height"), I = f.searchParams.get("src"), g = f.searchParams.get("currentHref"), d = n.split(":"), y = parseInt(d[d.length - 1], 10) - 1;
2562
- let u = parseInt(d[d.length - 2], 10) - 1;
2563
- const s = a.resolve(i, d.slice(0, d.length - 2).join(":")), p = a.extname(s).toLowerCase();
2564
- let S = l.readFileSync(s).toString("utf-8"), E = 0;
2565
- for (; E < S.length; E++)
2566
- if (u === 0) {
2567
- E += y;
2216
+ const t = f.searchParams.get("loc"), g = f.searchParams.get("width"), m = f.searchParams.get("height"), v = f.searchParams.get("src"), d = f.searchParams.get("currentHref"), s = t.split(":"), p = parseInt(s[s.length - 1], 10) - 1;
2217
+ let c = parseInt(s[s.length - 2], 10) - 1;
2218
+ const y = l.resolve(i, s.slice(0, s.length - 2).join(":")), M = l.extname(y).toLowerCase();
2219
+ let O = a.readFileSync(y).toString("utf-8"), k = 0;
2220
+ for (; k < O.length; k++)
2221
+ if (c === 0) {
2222
+ k += p;
2568
2223
  break;
2569
- } else if (S[E] === `
2224
+ } else if (O[k] === `
2570
2225
  `) {
2571
- u--;
2226
+ c--;
2572
2227
  continue;
2573
2228
  }
2574
- if (S.slice(E, E + 4) !== "<img") {
2229
+ if (O.slice(k, k + 4) !== "<img") {
2575
2230
  console.error(
2576
2231
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
2577
2232
  ), o.statusCode = 500;
2578
2233
  return;
2579
2234
  }
2580
- const c = S.indexOf(">", E) + 1;
2581
- if (c < E) {
2235
+ const b = O.indexOf(">", k) + 1;
2236
+ if (b < k) {
2582
2237
  console.error(
2583
2238
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
2584
2239
  ), o.statusCode = 500;
2585
2240
  return;
2586
2241
  }
2587
- const w = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(p);
2588
- let x = S.slice(E, c);
2589
- if (I && g && w) {
2590
- const N = new URL(I), D = new URL(g);
2591
- if (N.origin === D.origin) {
2592
- const T = a.join(t, "public", N.pathname), $ = a.join(t, N.pathname);
2593
- let F;
2594
- if (l.existsSync(T)) {
2595
- const X = a.join(i, "media", a.dirname(N.pathname));
2596
- await l.promises.mkdir(X, { recursive: !0 }), await l.promises.copyFile(
2597
- T,
2598
- a.join(i, "media", N.pathname)
2599
- ), F = "~/media" + N.pathname;
2600
- } else if (l.existsSync($))
2601
- F = N.pathname.replace("/src/", "~/");
2242
+ const E = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(M);
2243
+ let x = O.slice(k, b);
2244
+ if (v && d && E) {
2245
+ const U = new URL(v), P = new URL(d);
2246
+ if (U.origin === P.origin) {
2247
+ const j = l.join(n, "public", U.pathname), Q = l.join(n, U.pathname);
2248
+ let W;
2249
+ if (a.existsSync(j)) {
2250
+ const X = l.join(i, "media", l.dirname(U.pathname));
2251
+ await a.promises.mkdir(X, { recursive: !0 }), await a.promises.copyFile(
2252
+ j,
2253
+ l.join(i, "media", U.pathname)
2254
+ ), W = "~/media" + U.pathname;
2255
+ } else if (a.existsSync(Q))
2256
+ W = U.pathname.replace("/src/", "~/");
2602
2257
  else
2603
2258
  return;
2604
- const B = Lr(N.pathname), J = `${F}?jsx`;
2605
- x = x.replace(/^<img/, `<${B}`), x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
2606
- let Y = 0;
2607
- if (p === ".mdx" && S.startsWith("---") && (Y = S.indexOf("---", 4) + 3, Y === -1))
2259
+ const R = Cr(U.pathname), Y = `${W}?jsx`;
2260
+ x = x.replace(/^<img/, `<${R}`), x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
2261
+ let J = 0;
2262
+ if (M === ".mdx" && O.startsWith("---") && (J = O.indexOf("---", 4) + 3, J === -1))
2608
2263
  return;
2609
- const Z = `
2610
- import ${B} from '${J}';`;
2611
- S = `${S.slice(0, Y)}${Z}${S.slice(
2612
- Y,
2613
- E
2614
- )}${x}${S.slice(c)}`, l.writeFileSync(s, S);
2264
+ const te = `
2265
+ import ${R} from '${Y}';`;
2266
+ O = `${O.slice(0, J)}${te}${O.slice(
2267
+ J,
2268
+ k
2269
+ )}${x}${O.slice(b)}`, a.writeFileSync(y, O);
2615
2270
  return;
2616
2271
  }
2617
2272
  }
2618
- x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${b}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${v}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${v}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${b}"`)), S = S.slice(0, E) + x + S.slice(c), l.writeFileSync(s, S);
2273
+ x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${g}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${m}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${m}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${g}"`)), O = O.slice(0, k) + x + O.slice(b), a.writeFileSync(y, O);
2619
2274
  } else
2620
- m();
2621
- } catch (l) {
2622
- l instanceof Error && await on(e, l), m(l);
2275
+ u();
2276
+ } catch (a) {
2277
+ a instanceof Error && await Xt(e, a), u(a);
2623
2278
  }
2624
2279
  };
2625
- function Lr(e) {
2626
- const t = e.lastIndexOf("."), i = e.lastIndexOf("/");
2627
- return e = e.substring(i + 1, t), `Img${jr(e)}`;
2280
+ function Cr(e) {
2281
+ const n = e.lastIndexOf("."), i = e.lastIndexOf("/");
2282
+ return e = e.substring(i + 1, n), `Img${Pr(e)}`;
2628
2283
  }
2629
- function jr(e) {
2630
- return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (t, i, r) => `${i.toUpperCase() + r}`).replace(new RegExp(/\w/), (t) => t.toUpperCase());
2284
+ function Pr(e) {
2285
+ return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (n, i, r) => `${i.toUpperCase() + r}`).replace(new RegExp(/\w/), (n) => n.toUpperCase());
2631
2286
  }
2632
- const Ur = [
2633
- qe,
2634
- Ye,
2635
- Xe,
2287
+ const Dr = [
2636
2288
  Oe,
2289
+ Ke,
2290
+ Qe,
2291
+ je,
2637
2292
  "@builder.io/qwik",
2638
2293
  "@builder.io/qwik/jsx-runtime",
2639
2294
  "@builder.io/qwik/jsx-dev-runtime"
2640
- ], Br = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Rr = [".woff", ".woff2", ".ttf"], Je = "@qwik-hmr-bridge", Ar = `
2295
+ ], Nr = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Mr = [".woff", ".woff2", ".ttf"], Ge = "@qwik-hmr-bridge", Or = `
2641
2296
  // HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
2642
2297
  if (import.meta.hot) {
2643
2298
  import.meta.hot.on("qwik:hmr", (data) => {
@@ -2649,67 +2304,67 @@ const Ur = [
2649
2304
  });
2650
2305
  }
2651
2306
  `;
2652
- function Wr(e = {}) {
2653
- let t = "serve", i = null, r = null, o = "/", m = null, l, a = null, f = null, n = null, b = "development", v;
2654
- const I = e.client?.outDir;
2655
- let g = null;
2656
- const d = e.fileFilter ? (c, w) => Nt.test(c) || e.fileFilter(c, w) : () => !0, y = e.disableFontPreload ?? !1, u = [], s = Dt(e.optimizerOptions), p = /* @__PURE__ */ new Set();
2307
+ function Ur(e = {}) {
2308
+ let n = "serve", i = null, r = null, o = "/", u = null, a, l = null, f = null, t = null, g = "development", m;
2309
+ const v = e.client?.outDir;
2310
+ let d = null;
2311
+ const s = e.fileFilter ? (b, E) => Ct.test(b) || e.fileFilter(b, E) : () => !0, p = e.disableFontPreload ?? !1, c = [], y = Tt(e.optimizerOptions), M = /* @__PURE__ */ new Set();
2657
2312
  return [{
2658
2313
  name: "vite-plugin-qwik",
2659
2314
  enforce: "pre",
2660
2315
  api: {
2661
- getOptimizer: () => s.getOptimizer(),
2662
- getOptions: () => s.getOptions(),
2316
+ getOptimizer: () => y.getOptimizer(),
2317
+ getOptions: () => y.getOptions(),
2663
2318
  getManifest: () => i,
2664
- getRootDir: () => s.getOptions().rootDir,
2319
+ getRootDir: () => y.getOptions().rootDir,
2665
2320
  getClientOutDir: () => r,
2666
- getClientPublicOutDir: () => m,
2667
- getAssetsDir: () => l,
2668
- registerBundleGraphAdder: (c) => p.add(c),
2321
+ getClientPublicOutDir: () => u,
2322
+ getAssetsDir: () => a,
2323
+ registerBundleGraphAdder: (b) => M.add(b),
2669
2324
  _oldDevSsrServer: () => e.devSsrServer
2670
2325
  },
2671
- async config(c, w) {
2672
- await s.init();
2326
+ async config(b, E) {
2327
+ await y.init();
2673
2328
  let x;
2674
- w.mode === "lib" ? x = "lib" : c.build?.ssr || w.mode === "ssr" ? x = "ssr" : w.mode === "test" ? x = "test" : x = "client", t = w.command, w.mode === "production" ? b = "production" : w.mode === "development" ? b = "development" : t === "build" && x === "client" ? b = "production" : b = "development", s.debug(`vite config(), command: ${t}, env.mode: ${w.mode}`), t === "serve" ? e.entryStrategy = { type: "segment" } : x === "ssr" ? e.entryStrategy = { type: "hoist" } : x === "lib" && (e.entryStrategy = { type: "inline" });
2675
- const N = x === "ssr" ? typeof c.build?.ssr == "string" ? c.build.ssr : e.ssr?.input : void 0, D = x === "client" ? e.client?.input : void 0;
2676
- let T = c.build?.rollupOptions?.input || D || N;
2677
- T && typeof T == "string" && (T = [T]), l = c.build?.assetsDir;
2678
- const $ = x === "client" && !!l && l !== "_astro", F = {
2329
+ E.mode === "lib" ? x = "lib" : b.build?.ssr || E.mode === "ssr" ? x = "ssr" : E.mode === "test" || E.mode === "benchmark" ? x = "test" : x = "client", n = E.command, E.mode === "production" ? g = "production" : E.mode === "development" ? g = "development" : n === "build" && x === "client" ? g = "production" : g = "development", y.debug(`vite config(), command: ${n}, env.mode: ${E.mode}`), n === "serve" ? e.entryStrategy = { type: "segment" } : x === "ssr" ? e.entryStrategy = { type: "hoist" } : x === "lib" && (e.entryStrategy = { type: "inline" });
2330
+ const U = x === "ssr" ? typeof b.build?.ssr == "string" ? b.build.ssr : e.ssr?.input : void 0, P = x === "client" ? e.client?.input : void 0;
2331
+ let j = b.build?.rollupOptions?.input || P || U;
2332
+ j && typeof j == "string" && (j = [j]), a = b.build?.assetsDir;
2333
+ const Q = x === "client" && !!a && a !== "_astro", W = {
2679
2334
  target: x,
2680
- buildMode: b,
2335
+ buildMode: g,
2681
2336
  csr: e.csr,
2682
2337
  debug: e.debug,
2683
2338
  entryStrategy: e.entryStrategy,
2684
2339
  srcDir: e.srcDir,
2685
- rootDir: c.root,
2340
+ rootDir: b.root,
2686
2341
  tsconfigFileNames: e.tsconfigFileNames,
2687
2342
  resolveQwikBuild: !0,
2688
2343
  transformedModuleOutput: e.transformedModuleOutput,
2689
- outDir: c.build?.outDir,
2690
- ssrOutDir: e.ssr?.outDir || c.build?.outDir,
2691
- clientOutDir: I || // When ssr is true, this is probably an adapter build and not where the client build is
2344
+ outDir: b.build?.outDir,
2345
+ ssrOutDir: e.ssr?.outDir || b.build?.outDir,
2346
+ clientOutDir: v || // When ssr is true, this is probably an adapter build and not where the client build is
2692
2347
  // However, if client.outDir was explicitly set, always use it
2693
- (c.build?.ssr && !I ? void 0 : c.build?.outDir),
2694
- assetsDir: $ ? l : void 0,
2348
+ (b.build?.ssr && !v ? void 0 : b.build?.outDir),
2349
+ assetsDir: Q ? a : void 0,
2695
2350
  devTools: e.devTools,
2696
- sourcemap: !!c.build?.sourcemap,
2351
+ sourcemap: !!b.build?.sourcemap,
2697
2352
  lint: e.lint,
2698
2353
  experimental: e.experimental,
2699
- input: T,
2354
+ input: j,
2700
2355
  manifestInput: e.ssr?.manifestInput,
2701
2356
  manifestInputPath: e.ssr?.manifestInputPath,
2702
2357
  manifestOutput: e.client?.manifestOutput
2703
- }, B = await s.normalizeOptions(F);
2704
- T ||= B.input, g = F, i = B.manifestInput, a = B.srcDir, f = B.rootDir, e.csr || (r = B.clientOutDir, m = r, n = B.ssrOutDir);
2705
- const J = b === "development", Y = "globalThis.qDev", Z = "globalThis.qTest", X = "globalThis.qInspector", j = "globalThis.qSerialize", fe = c?.define?.[Y] ?? J, re = c?.define?.[X] ?? J, K = c?.define?.[j] ?? J, z = {
2358
+ }, R = await y.normalizeOptions(W);
2359
+ j ||= R.input, d = W, i = R.manifestInput, l = R.srcDir, f = R.rootDir, e.csr || (r = R.clientOutDir, u = r, t = R.ssrOutDir);
2360
+ const Y = g === "development", J = "globalThis.qDev", te = "globalThis.qTest", X = "globalThis.qInspector", N = b?.define?.[J] ?? Y, ue = b?.define?.[X] ?? Y, F = {
2706
2361
  // Duplicated in configEnvironment to support legacy vite build --ssr compatibility
2707
2362
  ssr: {
2708
- noExternal: [qe, Oe, Ae, te]
2363
+ noExternal: [Oe, je, Re, re]
2709
2364
  },
2710
2365
  envPrefix: ["VITE_", "PUBLIC_"],
2711
2366
  resolve: {
2712
- dedupe: [...Ur],
2367
+ dedupe: [...Dr],
2713
2368
  alias: {
2714
2369
  "@builder.io/qwik": "@qwik.dev/core",
2715
2370
  "@builder.io/qwik/build": "@qwik.dev/core/build",
@@ -2728,17 +2383,17 @@ function Wr(e = {}) {
2728
2383
  exclude: [
2729
2384
  // using optimized deps for qwik libraries will lead to duplicate imports
2730
2385
  // this breaks Qwik because it relies a lot on module scoped symbols
2731
- qe,
2732
2386
  Oe,
2733
- Ae,
2734
- Ye,
2735
- Xe,
2736
- te,
2737
- ae,
2387
+ je,
2388
+ Re,
2389
+ Ke,
2390
+ Qe,
2391
+ re,
2392
+ se,
2738
2393
  "@builder.io/qwik"
2739
2394
  ],
2740
2395
  // Enforce scanning our input even when overridden later
2741
- entries: T && (typeof T == "string" ? [T] : typeof T == "object" ? Object.values(T) : T)
2396
+ entries: j && (typeof j == "string" ? [j] : typeof j == "object" ? Object.values(j) : j)
2742
2397
  },
2743
2398
  build: {
2744
2399
  modulePreload: !1,
@@ -2747,98 +2402,91 @@ function Wr(e = {}) {
2747
2402
  },
2748
2403
  rollupOptions: {
2749
2404
  external: ["node:async_hooks"],
2750
- /**
2751
- * This is a workaround to have predictable chunk hashes between builds. It doesn't seem
2752
- * to impact the build time.
2753
- * https://github.com/QwikDev/qwik/issues/7226#issuecomment-2647122505
2754
- */
2755
- maxParallelFileOps: 1,
2756
2405
  // This will amend the existing input
2757
- input: T
2406
+ input: j
2758
2407
  // temporary fix for rolldown-vite types
2759
2408
  }
2760
2409
  },
2761
2410
  define: {
2762
- [Y]: fe,
2763
- [X]: re,
2764
- [j]: K,
2765
- [Z]: JSON.stringify(process.env.NODE_ENV === "test")
2411
+ [J]: N,
2412
+ [X]: ue,
2413
+ [te]: JSON.stringify(process.env.NODE_ENV === "test")
2766
2414
  }
2767
2415
  };
2768
2416
  if (!e.csr) {
2769
- z.build.cssCodeSplit = !1, B.outDir && (z.build.outDir = B.outDir);
2770
- const Le = z.build.rollupOptions?.onwarn;
2771
- z.build.rollupOptions = {
2772
- ...z.build.rollupOptions,
2773
- output: await xn(
2774
- s,
2775
- c.build?.rollupOptions?.output,
2776
- $,
2777
- B.outDir
2417
+ F.build.cssCodeSplit = !1, R.outDir && (F.build.outDir = R.outDir);
2418
+ const G = F.build.rollupOptions?.onwarn;
2419
+ F.build.rollupOptions = {
2420
+ ...F.build.rollupOptions,
2421
+ output: await hn(
2422
+ y,
2423
+ b.build?.rollupOptions?.output,
2424
+ Q,
2425
+ R.outDir
2778
2426
  ),
2779
2427
  preserveEntrySignatures: "exports-only",
2780
- onwarn: (de, je) => {
2781
- de.plugin === "typescript" && de.message.includes("outputToFilesystem") || (Le ? Le(de, je) : je(de));
2428
+ onwarn: (Z, qe) => {
2429
+ Z.plugin === "typescript" && Z.message.includes("outputToFilesystem") || (G ? G(Z, qe) : qe(Z));
2782
2430
  }
2783
- }, B.target === "ssr" ? t === "build" && (z.publicDir = !1, z.build.ssr = !0, c.build?.minify == null && b === "production" && (z.build.minify = !0)) : B.target === "client" || (B.target === "lib" ? (z.build.minify = !1, z.build.rollupOptions.external = [
2784
- qe,
2431
+ }, R.target === "ssr" ? n === "build" && (F.publicDir = !1, F.build.ssr = !0, b.build?.minify == null && g === "production" && (F.build.minify = !0)) : R.target === "client" || (R.target === "lib" ? (F.build.minify = !1, F.build.rollupOptions.external = [
2785
2432
  Oe,
2786
- Ae,
2787
- Ye,
2788
- Xe,
2789
- te,
2790
- ae
2791
- ]) : z.define = {
2792
- [Y]: !0,
2793
- [Z]: !0,
2433
+ je,
2434
+ Re,
2435
+ Ke,
2436
+ Qe,
2437
+ re,
2438
+ se
2439
+ ]) : F.define = {
2440
+ [J]: !0,
2441
+ [te]: !0,
2794
2442
  [X]: !1
2795
- }), globalThis.qDev = fe, globalThis.qTest = !0, globalThis.qInspector = re;
2443
+ }), globalThis.qDev = N, globalThis.qTest = !0, globalThis.qInspector = ue;
2796
2444
  }
2797
- return z;
2445
+ return F;
2798
2446
  },
2799
- configEnvironment(c, w, x) {
2800
- return c === "ssr" ? {
2447
+ configEnvironment(b, E, x) {
2448
+ return b === "ssr" ? {
2801
2449
  resolve: {
2802
- noExternal: [qe, Oe, Ae, te]
2450
+ noExternal: [Oe, je, Re, re]
2803
2451
  }
2804
- } : b === "production" ? {
2452
+ } : g === "production" ? {
2805
2453
  resolve: {
2806
2454
  conditions: ["min"]
2807
2455
  }
2808
2456
  } : {};
2809
2457
  },
2810
- async configResolved(c) {
2811
- if (o = c.base, !(o.startsWith("/") && o.endsWith("/")))
2458
+ async configResolved(b) {
2459
+ if (o = b.base, !(o.startsWith("/") && o.endsWith("/")))
2812
2460
  throw new Error("vite's config.base must begin and end with /");
2813
- c.build.sourcemap && e.optimizerOptions?.sourcemap === void 0 && s.setSourceMapSupport(!0), g ? s.normalizeOptions(g) : s.normalizeOptions(e);
2461
+ b.build.sourcemap && e.optimizerOptions?.sourcemap === void 0 && y.setSourceMapSupport(!0), d ? y.normalizeOptions(d) : y.normalizeOptions(e);
2814
2462
  },
2815
2463
  async buildStart() {
2816
- u.length = 0;
2817
- const c = this.resolve.bind(this);
2818
- await s.validateSource(c), s.onDiagnostics((w, x, N) => {
2819
- w.forEach((D) => {
2820
- const T = s.normalizePath(x.sys.path.join(N, D.file));
2821
- D.category === "error" ? this.error($e(T, D)) : this.warn($e(T, D));
2464
+ c.length = 0;
2465
+ const b = this.resolve.bind(this);
2466
+ await y.validateSource(b), y.onDiagnostics((E, x, U) => {
2467
+ E.forEach((P) => {
2468
+ const j = y.normalizePath(x.sys.path.join(U, P.file));
2469
+ P.category === "error" ? this.error(Fe(j, P)) : this.warn(Fe(j, P));
2822
2470
  });
2823
- }), await s.buildStart(this);
2471
+ }), await y.buildStart(this);
2824
2472
  },
2825
- resolveId(c, w, x) {
2826
- if (c.endsWith(Je))
2827
- return Je;
2828
- const N = d(c, "resolveId");
2829
- return ne(c) || !N ? null : s.resolveId(this, c, w, x);
2473
+ resolveId(b, E, x) {
2474
+ if (b.endsWith(Ge))
2475
+ return Ge;
2476
+ const U = s(b, "resolveId");
2477
+ return oe(b) || !U ? null : y.resolveId(this, b, E, x);
2830
2478
  },
2831
- load(c, w) {
2832
- if (c === Je)
2833
- return { code: Ar };
2834
- const x = d(c, "load");
2835
- return ne(c) || !x ? null : (c = s.normalizePath(c), t === "serve" && c.endsWith(ae) ? {
2479
+ load(b, E) {
2480
+ if (b === Ge)
2481
+ return { code: Or };
2482
+ const x = s(b, "load");
2483
+ return oe(b) || !x ? null : (b = y.normalizePath(b), n === "serve" && b.endsWith(se) ? {
2836
2484
  code: "export const manifest = undefined;"
2837
- } : s.load(this, c, w));
2485
+ } : y.load(this, b, E));
2838
2486
  },
2839
- transform(c, w, x) {
2840
- if (w.includes(".vite/deps/") && c.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(c)) {
2841
- const T = f && w.startsWith(f) ? w.slice(f.length) : w;
2487
+ transform(b, E, x) {
2488
+ if (E.includes(".vite/deps/") && b.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(b)) {
2489
+ const j = f && E.startsWith(f) ? E.slice(f.length) : E;
2842
2490
  throw new Error(
2843
2491
  `
2844
2492
 
@@ -2847,231 +2495,263 @@ function Wr(e = {}) {
2847
2495
  ⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
2848
2496
 
2849
2497
  👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
2850
- 👉 ${T}
2498
+ 👉 ${j}
2851
2499
 
2852
2500
  ==============
2853
2501
 
2854
2502
  `
2855
2503
  );
2856
2504
  }
2857
- const N = d(w, "transform"), D = w.includes("?raw");
2858
- return ne(w) || !N || D ? null : s.transform(this, c, w, x);
2505
+ const U = s(E, "transform"), P = E.includes("?raw");
2506
+ return oe(E) || !U || P ? null : y.transform(this, b, E, x);
2859
2507
  }
2860
2508
  }, {
2861
2509
  name: "vite-plugin-qwik-post",
2862
2510
  enforce: "post",
2863
2511
  generateBundle: {
2864
2512
  order: "post",
2865
- async handler(c, w) {
2513
+ async handler(b, E) {
2866
2514
  if (this.environment.config.consumer === "client") {
2867
- const N = s.getOptions();
2868
- for (const [D, T] of Object.entries(w))
2869
- if (T.type === "asset") {
2870
- const $ = o + D;
2871
- if (Br.some((F) => D.endsWith(F)))
2872
- typeof T.source == "string" && T.source.length < N.inlineStylesUpToBytes ? u.push({
2515
+ const U = y.getOptions();
2516
+ for (const [P, j] of Object.entries(E))
2517
+ if (j.type === "asset") {
2518
+ const Q = o + P;
2519
+ if (Nr.some((W) => P.endsWith(W)))
2520
+ typeof j.source == "string" && j.source.length < U.inlineStylesUpToBytes ? c.push({
2873
2521
  tag: "style",
2874
2522
  location: "head",
2875
2523
  attributes: {
2876
- "data-src": $,
2877
- dangerouslySetInnerHTML: T.source
2524
+ "data-src": Q,
2525
+ dangerouslySetInnerHTML: j.source
2878
2526
  }
2879
- }) : u.push({
2527
+ }) : c.push({
2880
2528
  tag: "link",
2881
2529
  location: "head",
2882
2530
  attributes: {
2883
2531
  rel: "stylesheet",
2884
- href: $
2532
+ href: Q
2885
2533
  }
2886
2534
  });
2887
2535
  else {
2888
- const F = Rr.find((B) => D.endsWith(B));
2889
- F && !y && u.unshift({
2536
+ const W = Mr.find((R) => P.endsWith(R));
2537
+ W && !p && c.unshift({
2890
2538
  tag: "link",
2891
2539
  location: "head",
2892
2540
  attributes: {
2893
2541
  rel: "preload",
2894
- href: $,
2542
+ href: Q,
2895
2543
  as: "font",
2896
- type: `font/${F.slice(1)}`,
2544
+ type: `font/${W.slice(1)}`,
2897
2545
  crossorigin: ""
2898
2546
  }
2899
2547
  });
2900
2548
  }
2901
2549
  }
2902
- await s.generateManifest(this, w, p, {
2903
- injections: u,
2550
+ await y.generateManifest(this, E, M, {
2551
+ injections: c,
2904
2552
  platform: { vite: "" }
2905
2553
  });
2906
2554
  }
2907
2555
  }
2908
2556
  },
2909
- async writeBundle(c, w) {
2910
- const x = s.getOptions();
2557
+ async writeBundle(b, E) {
2558
+ const x = y.getOptions();
2911
2559
  if (this.environment.config.consumer === "server") {
2912
- const D = s.getSys();
2913
- if (D.env === "node" || D.env === "bun" || D.env === "deno") {
2914
- const T = Object.keys(w), $ = async (F) => {
2560
+ const P = y.getSys();
2561
+ if (P.env === "node" || P.env === "bun" || P.env === "deno") {
2562
+ const j = Object.keys(E), Q = async (W) => {
2915
2563
  try {
2916
- const B = D.path.basename(F), J = D.path.extname(B);
2917
- if ((B.startsWith("entry.") || B.startsWith("entry_")) && !B.includes("preview") && (J === ".mjs" || J === ".cjs")) {
2918
- const Z = D.path.basename(B, J), X = `${Z}.js`, j = Z + J;
2919
- if (!T.some((re) => D.path.basename(re) === X)) {
2920
- const re = D.path.dirname(F), K = await D.dynamicImport("node:fs"), z = D.path.join(x.outDir, re);
2921
- await K.promises.mkdir(z, { recursive: !0 }), await K.promises.writeFile(
2922
- D.path.join(z, X),
2923
- `export * from "./${j}";`
2564
+ const R = P.path.basename(W), Y = P.path.extname(R);
2565
+ if ((R.startsWith("entry.") || R.startsWith("entry_")) && !R.includes("preview") && (Y === ".mjs" || Y === ".cjs")) {
2566
+ const te = P.path.basename(R, Y), X = `${te}.js`, N = te + Y;
2567
+ if (!j.some((F) => P.path.basename(F) === X)) {
2568
+ const F = P.path.dirname(W), G = await P.dynamicImport("node:fs"), Z = P.path.join(x.outDir, F);
2569
+ await G.promises.mkdir(Z, { recursive: !0 }), await G.promises.writeFile(
2570
+ P.path.join(Z, X),
2571
+ `export * from "./${N}";`
2924
2572
  );
2925
2573
  }
2926
2574
  }
2927
- } catch (B) {
2928
- console.error("patchModuleFormat", B);
2575
+ } catch (R) {
2576
+ console.error("patchModuleFormat", R);
2929
2577
  }
2930
2578
  };
2931
- await Promise.all(T.map($));
2579
+ await Promise.all(j.map(Q));
2932
2580
  }
2933
2581
  }
2934
2582
  },
2935
2583
  transformIndexHtml() {
2936
- if (t === "serve")
2937
- return Mn(s.getOptions(), o);
2584
+ if (n === "serve")
2585
+ return kn(y.getOptions(), o);
2938
2586
  },
2939
- configureServer(c) {
2940
- v = c, s.configureServer(c), (e?.devTools?.imageDevTools ?? !0) && c.middlewares.use(Or(s.getSys(), f, a));
2587
+ configureServer(b) {
2588
+ m = b, y.configureServer(b), (e?.devTools?.imageDevTools ?? !0) && b.middlewares.use(Tr(y.getSys(), f, l));
2941
2589
  },
2942
- configurePreviewServer(c) {
2590
+ configurePreviewServer(b) {
2943
2591
  return async () => {
2944
- const w = s.getSys(), x = s.getPath();
2945
- await Nn(c.middlewares, n, w, x);
2592
+ const E = y.getSys(), x = y.getPath();
2593
+ await Sn(b.middlewares, t, E, x);
2946
2594
  };
2947
2595
  },
2948
- hotUpdate(c) {
2949
- s.hotUpdate(this.environment, c);
2950
- const w = e?.devTools?.hmr ?? !0;
2951
- if (this.environment.name === "ssr" && c.modules.length)
2952
- if (w) {
2953
- const x = c.modules.map((N) => N.type === "js" && N.url).filter(Boolean);
2954
- x.length > 0 && v && v.environments.client.hot.send({
2596
+ hotUpdate(b) {
2597
+ y.hotUpdate(this.environment, b);
2598
+ const E = e?.devTools?.hmr ?? !0;
2599
+ if (this.environment.name === "ssr" && b.modules.length)
2600
+ if (E) {
2601
+ const x = b.modules.map((U) => U.type === "js" ? U.url.split("?")[0] : null).filter(Boolean);
2602
+ x.length > 0 && m && m.environments.client.hot.send({
2955
2603
  type: "custom",
2956
2604
  event: "qwik:hmr",
2957
2605
  data: { files: x }
2958
2606
  });
2959
2607
  } else
2960
- v?.environments.client.hot.send({ type: "full-reload" });
2608
+ m?.environments.client.hot.send({ type: "full-reload" });
2961
2609
  },
2962
- onLog(c, w) {
2963
- if (w.plugin == "vite-plugin-qwik") {
2964
- const x = $r[c] || le.White, N = (w.frame || "").split(`
2610
+ onLog(b, E) {
2611
+ if (E.plugin == "vite-plugin-qwik") {
2612
+ const x = qr[b] || ae.White, U = (E.frame || "").split(`
2965
2613
  `).map(
2966
- (D) => (D.match(/^\s*\^\s*$/) ? le.BrightWhite : le.BrightBlack) + D
2614
+ (P) => (P.match(/^\s*\^\s*$/) ? ae.BrightWhite : ae.BrightBlack) + P
2967
2615
  );
2968
- return console[c](
2616
+ return console[b](
2969
2617
  `${x}%s
2970
- ${le.BrightWhite}%s
2971
- %s${le.RESET}`,
2972
- `[${w.plugin}](${c}): ${w.message}
2618
+ ${ae.BrightWhite}%s
2619
+ %s${ae.RESET}`,
2620
+ `[${E.plugin}](${b}): ${E.message}
2973
2621
  `,
2974
- ` ${w?.loc?.file}:${w?.loc?.line}:${w?.loc?.column}
2622
+ ` ${E?.loc?.file}:${E?.loc?.line}:${E?.loc?.column}
2975
2623
  `,
2976
- ` ${N.join(`
2624
+ ` ${U.join(`
2977
2625
  `)}
2978
2626
  `
2979
2627
  ), !1;
2980
2628
  }
2981
2629
  }
2982
- }, Fr()];
2630
+ }, jr()];
2983
2631
  }
2984
- async function Fr() {
2985
- let e, t;
2986
- try {
2987
- e = await import("node:fs").then((a) => a.promises), t = await import("node:path");
2988
- } catch {
2989
- return;
2632
+ async function jr() {
2633
+ let e, n, i = !1;
2634
+ async function r() {
2635
+ if (i)
2636
+ return !0;
2637
+ try {
2638
+ return e = await import("node:fs").then((m) => m.promises), n = await import("node:path"), i = !0, !0;
2639
+ } catch {
2640
+ return !1;
2641
+ }
2990
2642
  }
2991
- const i = /* @__PURE__ */ new Set();
2992
- let r;
2993
- const o = "@qwik-dev/core", m = "@builder.io/qwik";
2994
- async function l(a, f) {
2995
- for (; f; ) {
2996
- const n = t.join(f, "node_modules", a, "package.json");
2643
+ const o = /* @__PURE__ */ new Set(), u = [];
2644
+ let a;
2645
+ const l = "@qwik.dev/core", f = "@builder.io/qwik";
2646
+ async function t(m) {
2647
+ try {
2648
+ const v = n.join(m, "package.json"), d = await e.readFile(v, { encoding: "utf-8" }), s = JSON.parse(d);
2649
+ return [
2650
+ ...Object.keys(s.dependencies || {}),
2651
+ ...Object.keys(s.devDependencies || {}),
2652
+ ...Object.keys(s.optionalDependencies || {})
2653
+ ];
2654
+ } catch {
2655
+ return [];
2656
+ }
2657
+ }
2658
+ async function g(m, v) {
2659
+ for (; v; ) {
2660
+ const d = n.join(v, "node_modules", m, "package.json");
2997
2661
  try {
2998
- await e.access(n);
2999
- const v = await e.readFile(n, {
2662
+ await e.access(d);
2663
+ const p = await e.readFile(d, {
3000
2664
  encoding: "utf-8"
3001
- }), I = JSON.parse(v);
3002
- return !!(I.qwik || I.dependencies?.[o] || I.peerDependencies?.[o] || I.dependencies?.[m] || I.peerDependencies?.[m]);
2665
+ }), c = JSON.parse(p);
2666
+ return !!(c.qwik || c.dependencies?.[l] || c.peerDependencies?.[l] || c.devDependencies?.[l] || c.dependencies?.[f] || c.peerDependencies?.[f] || c.devDependencies?.[f]);
3003
2667
  } catch {
3004
2668
  }
3005
- const b = t.dirname(f);
3006
- if (b === f)
2669
+ const s = n.dirname(v);
2670
+ if (s === v)
3007
2671
  break;
3008
- f = b;
2672
+ v = s;
3009
2673
  }
3010
2674
  return !1;
3011
2675
  }
3012
2676
  return {
3013
2677
  name: "checkQwikExternals",
3014
2678
  enforce: "pre",
3015
- configResolved: (a) => {
3016
- r = a.root;
2679
+ configResolved: (m) => {
2680
+ a = m.root;
3017
2681
  },
3018
2682
  // Attempt to mark the Qwik dependencies as non-optimizeable
3019
2683
  config: {
3020
2684
  order: "post",
3021
- async handler(a) {
3022
- const f = [], n = [a.ssr?.noExternal, a.environments?.ssr?.resolve?.noExternal].flat().filter((v) => typeof v == "string"), b = a.optimizeDeps?.exclude ?? [];
3023
- for (const v of n)
3024
- b.includes(v) || await l(v, a.root || process.cwd()) && f.push(v);
3025
- return { optimizeDeps: { exclude: f } };
2685
+ async handler(m) {
2686
+ if (!await r())
2687
+ return;
2688
+ const v = m.root || process.cwd(), d = m.optimizeDeps?.exclude ?? [], s = await t(v);
2689
+ u.length = 0;
2690
+ for (const c of s)
2691
+ await g(c, v) && u.push(c);
2692
+ const p = u.filter((c) => !d.includes(c));
2693
+ return {
2694
+ optimizeDeps: { exclude: p },
2695
+ ssr: { noExternal: p }
2696
+ };
3026
2697
  }
3027
2698
  },
2699
+ // qwik deps need to be marked as noExternal per-environment
2700
+ configEnvironment(m, v) {
2701
+ if (u.length === 0)
2702
+ return;
2703
+ const d = v.resolve?.noExternal;
2704
+ if (d === !0)
2705
+ return;
2706
+ let s;
2707
+ return Array.isArray(d) ? s = d : d ? s = [d] : s = [], {
2708
+ resolve: { noExternal: [...s, ...u] }
2709
+ };
2710
+ },
3028
2711
  // We check all SSR build lookups for external Qwik deps
3029
2712
  resolveId: {
3030
2713
  order: "pre",
3031
- async handler(a, f, n) {
3032
- if (!(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(a) || i.has(a))
2714
+ async handler(m, v, d) {
2715
+ if (!await r() || !(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(m) || o.has(m))
3033
2716
  return;
3034
- const v = (a.startsWith("@") ? a.split("/").slice(0, 2).join("/") : a.split("/")[0]).split("?")[0];
3035
- if (i.has(v))
2717
+ const p = (m.startsWith("@") ? m.split("/").slice(0, 2).join("/") : m.split("/")[0]).split("?")[0];
2718
+ if (o.has(p))
3036
2719
  return;
3037
- i.add(a), i.add(v);
3038
- let I;
2720
+ o.add(m), o.add(p);
2721
+ let c;
3039
2722
  try {
3040
- I = await this.resolve(v, f, { ...n, skipSelf: !0 });
2723
+ c = await this.resolve(p, v, { ...d, skipSelf: !0 });
3041
2724
  } catch {
3042
2725
  return;
3043
2726
  }
3044
- if (I?.external && await l(v, f ? t.dirname(f) : r))
2727
+ if (c?.external && await g(p, v ? n.dirname(v) : a))
3045
2728
  throw new Error(
3046
2729
  `
3047
2730
  ==============
3048
- ${v} is being treated as an external dependency, but it should be included in the server bundle, because it uses Qwik and it needs to be processed by the optimizer.
2731
+ ${p} is being treated as an external dependency, but it should be included in the server bundle, because it uses Qwik and it needs to be processed by the optimizer.
3049
2732
  Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
3050
2733
  ==============
3051
2734
  `
3052
2735
  );
3053
- if (v === a)
3054
- return I;
2736
+ if (p === m)
2737
+ return c;
3055
2738
  }
3056
2739
  }
3057
2740
  };
3058
2741
  }
3059
- const le = {
2742
+ const ae = {
3060
2743
  Yellow: "\x1B[33m",
3061
2744
  Cyan: "\x1B[36m",
3062
2745
  White: "\x1B[37m",
3063
2746
  BrightBlack: "\x1B[90m",
3064
2747
  BrightWhite: "\x1B[97m",
3065
2748
  RESET: "\x1B[0m"
3066
- }, $r = {
3067
- warn: le.Yellow,
3068
- info: le.Cyan,
3069
- debug: le.BrightBlack
3070
- }, Gr = void 0;
2749
+ }, qr = {
2750
+ warn: ae.Yellow,
2751
+ info: ae.Cyan,
2752
+ debug: ae.BrightBlack
2753
+ };
3071
2754
  export {
3072
- At as createOptimizer,
3073
- Hr as qwikRollup,
3074
- Wr as qwikVite,
3075
- Gr as symbolMapper,
3076
- zr as versions
2755
+ Lr as qwikRollup,
2756
+ Ur as qwikVite
3077
2757
  };