@qwik.dev/core 2.0.0-beta.37 → 2.0.0-beta.38

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,10 +1,10 @@
1
- const En = (t, e = 0) => {
1
+ const Cn = (t, e = 0) => {
2
2
  for (let n = 0; n < t.length; n++) {
3
3
  const r = t.charCodeAt(n);
4
4
  e = (e << 5) - e + r, e |= 0;
5
5
  }
6
6
  return Number(Math.abs(e)).toString(36);
7
- }, kn = /* @__PURE__ */ new Set([
7
+ }, Tn = /* @__PURE__ */ new Set([
8
8
  "_chk",
9
9
  "_rsc",
10
10
  "_res",
@@ -14,6 +14,9 @@ const En = (t, e = 0) => {
14
14
  // Each
15
15
  "_eaC",
16
16
  "_eaT",
17
+ // Show
18
+ "_shC",
19
+ "_shT",
17
20
  // Suspense
18
21
  "_suC",
19
22
  "_suT",
@@ -22,7 +25,7 @@ const En = (t, e = 0) => {
22
25
  "_reC",
23
26
  "_reT"
24
27
  ]);
25
- function In(t) {
28
+ function Pn(t) {
26
29
  const e = t.symbols;
27
30
  return Object.keys(e).sort((n, r) => {
28
31
  const i = e[n], s = e[r];
@@ -119,33 +122,33 @@ const bt = [
119
122
  ].map((t) => `on${t.toLowerCase()}$`), xt = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
120
123
  (t) => t.toLowerCase()
121
124
  );
122
- function _n(t) {
123
- return Object.keys(t.bundles).sort(Ze);
125
+ function Nn(t) {
126
+ return Object.keys(t.bundles).sort(Ye);
124
127
  }
125
- function Cn(t) {
126
- const e = In(t), n = {}, r = {};
128
+ function Dn(t) {
129
+ const e = Pn(t), n = {}, r = {};
127
130
  for (const l of e)
128
131
  n[l] = t.symbols[l], r[l] = t.mapping[l];
129
- const i = _n(t), s = {};
132
+ const i = Nn(t), s = {};
130
133
  for (const l of i) {
131
134
  s[l] = t.bundles[l];
132
135
  const a = t.bundles[l];
133
- Array.isArray(a.imports) && a.imports.sort(Ze), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(Ze);
136
+ Array.isArray(a.imports) && a.imports.sort(Ye), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(Ye);
134
137
  const c = [];
135
- for (const u of e)
136
- l === r[u] && c.push(u);
137
- c.length > 0 && (c.sort(Ze), a.symbols = c);
138
+ for (const h of e)
139
+ l === r[h] && c.push(h);
140
+ c.length > 0 && (c.sort(Ye), a.symbols = c);
138
141
  }
139
142
  return t.symbols = n, t.mapping = r, t.bundles = s, t;
140
143
  }
141
- function Ze(t, e) {
144
+ function Ye(t, e) {
142
145
  return t = t.toLocaleLowerCase(), e = e.toLocaleLowerCase(), t < e ? -1 : t > e ? 1 : 0;
143
146
  }
144
147
  function St(t) {
145
148
  if (t != null && t.mapping != null && typeof t.mapping == "object" && t.symbols != null && typeof t.symbols == "object" && t.bundles != null && typeof t.bundles == "object")
146
149
  return t;
147
150
  }
148
- const Tn = (t, e) => {
151
+ const Rn = (t, e) => {
149
152
  let n = 0;
150
153
  if (t.symbols)
151
154
  for (const r of t.symbols) {
@@ -155,70 +158,70 @@ const Tn = (t, e) => {
155
158
  }
156
159
  return n;
157
160
  };
158
- function Pn(t) {
161
+ function Ln(t) {
159
162
  let e = 0;
160
163
  const n = [], r = [], i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
161
164
  function a(d) {
162
165
  i.set(d, e), s.set(d, e), e++, n.push(d), l.add(d);
163
- const g = t[d].imports || [];
164
- for (const f of g)
165
- i.has(f) ? l.has(f) && s.set(d, Math.min(s.get(d), i.get(f))) : (a(f), s.set(d, Math.min(s.get(d), s.get(f))));
166
+ const u = t[d].imports || [];
167
+ for (const p of u)
168
+ i.has(p) ? l.has(p) && s.set(d, Math.min(s.get(d), i.get(p))) : (a(p), s.set(d, Math.min(s.get(d), s.get(p))));
166
169
  if (s.get(d) === i.get(d)) {
167
- const f = [];
168
- let m;
170
+ const p = [];
171
+ let x;
169
172
  do
170
- m = n.pop(), l.delete(m), f.push(m);
171
- while (m !== d);
172
- r.push(f);
173
+ x = n.pop(), l.delete(x), p.push(x);
174
+ while (x !== d);
175
+ r.push(p);
173
176
  }
174
177
  }
175
178
  for (const d of Object.keys(t))
176
179
  i.has(d) || a(d);
177
180
  const c = /* @__PURE__ */ new Map();
178
- r.forEach((d, g) => {
179
- for (const f of d)
180
- c.set(f, g);
181
+ r.forEach((d, u) => {
182
+ for (const p of d)
183
+ c.set(p, u);
181
184
  });
182
- const u = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
185
+ const h = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
183
186
  for (const d of Object.keys(t)) {
184
- const g = c.get(d);
185
- for (const f of t[d].imports || []) {
186
- const m = c.get(f);
187
- g !== m && u[g].add(m);
187
+ const u = c.get(d);
188
+ for (const p of t[d].imports || []) {
189
+ const x = c.get(p);
190
+ u !== x && h[u].add(x);
188
191
  }
189
192
  }
190
193
  const o = /* @__PURE__ */ new Set(), w = [];
191
194
  function v(d) {
192
195
  o.add(d);
193
- for (const g of u[d])
194
- o.has(g) || v(g);
196
+ for (const u of h[d])
197
+ o.has(u) || v(u);
195
198
  w.push(d);
196
199
  }
197
200
  for (let d = 0; d < r.length; d++)
198
201
  o.has(d) || v(d);
199
202
  w.reverse();
200
- const p = new Array(r.length).fill(0);
203
+ const g = new Array(r.length).fill(0);
201
204
  for (let d = 0; d < r.length; d++) {
202
- let g = 0;
203
- for (const f of r[d])
204
- g += t[f].size;
205
- p[d] = g;
205
+ let u = 0;
206
+ for (const p of r[d])
207
+ u += t[p].size;
208
+ g[d] = u;
206
209
  }
207
210
  for (let d = w.length - 1; d >= 0; d--) {
208
- const g = w[d];
209
- let f = p[g];
210
- for (const m of u[g])
211
- f += p[m];
212
- p[g] = f;
211
+ const u = w[d];
212
+ let p = g[u];
213
+ for (const x of h[u])
214
+ p += g[x];
215
+ g[u] = p;
213
216
  }
214
217
  for (let d = 0; d < r.length; d++) {
215
- const g = p[d];
216
- for (const f of r[d])
217
- t[f].total = g;
218
+ const u = g[d];
219
+ for (const p of r[d])
220
+ t[p].total = u;
218
221
  }
219
222
  }
220
- const Et = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, kt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, It = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
221
- function Dn(t, e, n, r, i, s, l) {
223
+ const kt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, Et = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, It = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
224
+ function On(t, e, n, r, i, s, l) {
222
225
  const a = {
223
226
  version: "1",
224
227
  manifestHash: "",
@@ -238,169 +241,169 @@ function Dn(t, e, n, r, i, s, l) {
238
241
  assets: {},
239
242
  symbols: {},
240
243
  bundleGraph: void 0
241
- }, c = (p) => {
242
- const d = r[p];
244
+ }, c = (g) => {
245
+ const d = r[g];
243
246
  if (!d) {
244
- console.warn(`Client manifest generation: skipping external import "${p}"`);
247
+ console.warn(`Client manifest generation: skipping external import "${g}"`);
245
248
  return;
246
249
  }
247
250
  return l(d.fileName);
248
251
  };
249
- let u, o, w;
250
- for (const p of Object.values(r)) {
251
- const d = c(p.fileName);
252
- p.name === "core" && (u = d), p.name === "preloader" && (o = d), p.name === "handlers" && (w = d);
253
- }
254
- const v = new Set(e.map((p) => p.name));
255
- for (const p of Object.values(r)) {
256
- if (p.type === "asset") {
257
- p.fileName.endsWith("js.map") || (a.assets[p.fileName] = {
258
- name: p.names[0],
259
- size: p.source.length
252
+ let h, o, w;
253
+ for (const g of Object.values(r)) {
254
+ const d = c(g.fileName);
255
+ g.name === "core" && (h = d), g.name === "preloader" && (o = d), g.name === "handlers" && (w = d);
256
+ }
257
+ const v = new Set(e.map((g) => g.name));
258
+ for (const g of Object.values(r)) {
259
+ if (g.type === "asset") {
260
+ g.fileName.endsWith("js.map") || (a.assets[g.fileName] = {
261
+ name: g.names[0],
262
+ size: g.source.length
260
263
  });
261
264
  continue;
262
265
  }
263
- const d = l(p.fileName), f = {
264
- size: p.code.length,
266
+ const d = l(g.fileName), p = {
267
+ size: g.code.length,
265
268
  total: -1
266
269
  };
267
- for (const C of p.exports)
268
- v.has(C) && (!a.mapping[C] || p.exports.length !== 1) && (a.mapping[C] = d);
269
- const m = p.imports.filter((C) => p.code.includes(t.basename(C))).map((C) => c(C)).filter((C) => C !== o && C !== u && C !== w).filter(Boolean);
270
- m.length > 0 && (f.imports = m);
271
- const R = p.dynamicImports.filter((C) => p.code.includes(t.basename(C))).map((C) => c(C)).filter(Boolean);
272
- R.length > 0 && (f.dynamicImports = R), p.facadeModuleId && (Et.test(p.facadeModuleId) ? a.preloader = d : kt.test(p.facadeModuleId) ? a.core = d : It.test(p.facadeModuleId) && (a.qwikLoader = d));
273
- const M = (p.moduleIds || Object.keys(p.modules)).filter((C) => !C.startsWith("\0")).map((C) => t.relative(i.rootDir, C));
274
- M.length > 0 && (f.origins = M, !a.preloader && M.some((C) => Et.test(C)) && (a.preloader = d), !a.core && M.some((C) => kt.test(C)) && (a.core = d), !a.qwikLoader && M.some((C) => It.test(C)) && (a.qwikLoader = d)), a.bundles[d] = f;
275
- }
276
- for (const p of e) {
277
- const d = p.name, g = a.mapping[d];
278
- if (!g) {
279
- s(`Note: qrl ${p.name} is not in the bundle, likely tree shaken`, a);
270
+ for (const b of g.exports)
271
+ v.has(b) && (!a.mapping[b] || g.exports.length !== 1) && (a.mapping[b] = d);
272
+ const x = g.imports.filter((b) => g.code.includes(t.basename(b))).map((b) => c(b)).filter((b) => b !== o && b !== h && b !== w).filter(Boolean);
273
+ x.length > 0 && (p.imports = x);
274
+ const R = g.dynamicImports.filter((b) => g.code.includes(t.basename(b))).map((b) => c(b)).filter(Boolean);
275
+ R.length > 0 && (p.dynamicImports = R), g.facadeModuleId && (kt.test(g.facadeModuleId) ? a.preloader = d : Et.test(g.facadeModuleId) ? a.core = d : It.test(g.facadeModuleId) && (a.qwikLoader = d));
276
+ const m = (g.moduleIds || Object.keys(g.modules)).filter((b) => !b.startsWith("\0")).map((b) => t.relative(i.rootDir, b));
277
+ m.length > 0 && (p.origins = m, !a.preloader && m.some((b) => kt.test(b)) && (a.preloader = d), !a.core && m.some((b) => Et.test(b)) && (a.core = d), !a.qwikLoader && m.some((b) => It.test(b)) && (a.qwikLoader = d)), a.bundles[d] = p;
278
+ }
279
+ for (const g of e) {
280
+ const d = g.name, u = a.mapping[d];
281
+ if (!u) {
282
+ s(`Note: qrl ${g.name} is not in the bundle, likely tree shaken`, a);
280
283
  continue;
281
284
  }
282
- (a.bundles[g].symbols ||= []).push(d), a.symbols[d] = {
283
- displayName: p.displayName,
284
- hash: p.hash,
285
- ctxKind: p.ctxKind,
286
- ctxName: p.ctxName,
287
- captures: p.captures,
288
- canonicalFilename: p.canonicalFilename,
289
- parent: p.parent,
290
- origin: p.origin,
291
- loc: p.loc,
292
- paramNames: p.paramNames,
293
- captureNames: p.captureNames
285
+ (a.bundles[u].symbols ||= []).push(d), a.symbols[d] = {
286
+ displayName: g.displayName,
287
+ hash: g.hash,
288
+ ctxKind: g.ctxKind,
289
+ ctxName: g.ctxName,
290
+ captures: g.captures,
291
+ canonicalFilename: g.canonicalFilename,
292
+ parent: g.parent,
293
+ origin: g.origin,
294
+ loc: g.loc,
295
+ paramNames: g.paramNames,
296
+ captureNames: g.captureNames
294
297
  };
295
298
  }
296
299
  if (w)
297
- for (const p of kn)
298
- a.symbols[p] = {
300
+ for (const g of Tn)
301
+ a.symbols[g] = {
299
302
  origin: "Qwik core",
300
- displayName: p,
303
+ displayName: g,
301
304
  canonicalFilename: "",
302
- hash: p,
305
+ hash: g,
303
306
  ctxKind: "function",
304
- ctxName: p,
307
+ ctxName: g,
305
308
  captures: !1,
306
309
  parent: null,
307
310
  loc: [0, 0]
308
- }, a.mapping[p] = w;
311
+ }, a.mapping[g] = w;
309
312
  else
310
313
  console.error("Qwik core bundle not found, is Qwik actually used in this project?");
311
- for (const p of Object.values(a.bundles)) {
312
- const d = Tn(p, a);
313
- p.interactivity = d;
314
+ for (const g of Object.values(a.bundles)) {
315
+ const d = Rn(g, a);
316
+ g.interactivity = d;
314
317
  }
315
- return Pn(a.bundles), Cn(a);
318
+ return Ln(a.bundles), Dn(a);
316
319
  }
317
- const Nn = 300, Rn = 0.5 / (Nn * 1024 / 8), Ln = (t) => {
320
+ const Mn = 300, $n = 0.5 / (Mn * 1024 / 8), jn = (t) => {
318
321
  const e = t.lastIndexOf("_");
319
322
  return e > -1 ? t.slice(e + 1) : t;
320
323
  };
321
- function On(t, e) {
324
+ function qn(t, e) {
322
325
  const n = [];
323
326
  if (!t.bundles)
324
327
  return [];
325
328
  const r = { ...t.bundles };
326
- for (const [c, u] of Object.entries(t.mapping)) {
329
+ for (const [c, h] of Object.entries(t.mapping)) {
327
330
  if (c.startsWith("_") && c.length < 10)
328
331
  continue;
329
- const o = Ln(c);
330
- o && (r[o] = { dynamicImports: [u] });
332
+ const o = jn(c);
333
+ o && (r[o] = { dynamicImports: [h] });
331
334
  }
332
335
  if (e) {
333
336
  const c = { ...t, bundles: r };
334
- for (const u of e) {
335
- const o = u(c);
337
+ for (const h of e) {
338
+ const o = h(c);
336
339
  o && Object.assign(r, o);
337
340
  }
338
341
  }
339
342
  for (const c of Object.keys(r)) {
340
- const u = r[c], o = u.imports?.filter((v) => r[v]) || [], w = u.dynamicImports?.filter(
343
+ const h = r[c], o = h.imports?.filter((v) => r[v]) || [], w = h.dynamicImports?.filter(
341
344
  // we only want to include dynamic imports that belong to the app
342
345
  // e.g. not all languages supported by shiki
343
346
  (v) => r[v] && // either there are qrls
344
347
  (r[v].symbols || // or it's a dynamic import from the app source
345
- r[v].origins?.some((p) => !p.includes("node_modules")))
348
+ r[v].origins?.some((g) => !g.includes("node_modules")))
346
349
  ) || [];
347
350
  r[c] = {
348
- ...u,
351
+ ...h,
349
352
  imports: o,
350
353
  dynamicImports: w
351
354
  };
352
355
  }
353
356
  const i = new Set(Object.keys(r));
354
357
  for (const c of Object.keys(r)) {
355
- for (const u of r[c].imports)
356
- i.delete(u);
357
- for (const u of r[c].dynamicImports)
358
- i.delete(u);
358
+ for (const h of r[c].imports)
359
+ i.delete(h);
360
+ for (const h of r[c].dynamicImports)
361
+ i.delete(h);
359
362
  }
360
363
  for (const c of i) {
361
- const u = r[c];
362
- !u.imports?.length && !u.dynamicImports?.length && delete r[c];
364
+ const h = r[c];
365
+ !h.imports?.length && !h.dynamicImports?.length && delete r[c];
363
366
  }
364
- const s = Object.keys(r), l = /* @__PURE__ */ new Map(), a = (c, u, o = /* @__PURE__ */ new Set()) => {
365
- const w = r[u];
367
+ const s = Object.keys(r), l = /* @__PURE__ */ new Map(), a = (c, h, o = /* @__PURE__ */ new Set()) => {
368
+ const w = r[h];
366
369
  for (const v of w.imports)
367
370
  c.has(v) && c.delete(v), o.has(v) || (o.add(v), a(c, v, o));
368
371
  };
369
372
  for (const c of s) {
370
- const u = r[c], o = new Set(u.imports);
373
+ const h = r[c], o = new Set(h.imports);
371
374
  for (const d of o)
372
375
  a(o, d);
373
- const w = new Set(u.dynamicImports), v = /* @__PURE__ */ new Map();
376
+ const w = new Set(h.dynamicImports), v = /* @__PURE__ */ new Map();
374
377
  for (const d of w) {
375
378
  a(w, d);
376
- const g = r[d];
377
- let f = 0.5;
378
- if (f += (g.interactivity || 0) * 0.08, u.origins && g.origins) {
379
- for (const m of u.origins)
380
- if (g.origins.some((R) => R.startsWith(m))) {
381
- f += 0.25;
379
+ const u = r[d];
380
+ let p = 0.5;
381
+ if (p += (u.interactivity || 0) * 0.08, h.origins && u.origins) {
382
+ for (const x of h.origins)
383
+ if (u.origins.some((R) => R.startsWith(x))) {
384
+ p += 0.25;
382
385
  break;
383
386
  }
384
387
  }
385
- g.total > Rn && (f += f > 0.5 ? 0.02 : -0.02), g.total < 1e3 && (f += 0.15), v.set(d, Math.min(f, 0.99));
388
+ u.total > $n && (p += p > 0.5 ? 0.02 : -0.02), u.total < 1e3 && (p += 0.15), v.set(d, Math.min(p, 0.99));
386
389
  }
387
390
  if (w.size > 0) {
388
391
  const d = Array.from(w).sort(
389
- (f, m) => v.get(m) - v.get(f)
392
+ (p, x) => v.get(x) - v.get(p)
390
393
  );
391
- let g = -1;
392
- for (const f of d)
393
- v.get(f) !== g && (g = v.get(f), o.add(-Math.round(g * 10))), o.add(f);
394
+ let u = -1;
395
+ for (const p of d)
396
+ v.get(p) !== u && (u = v.get(p), o.add(-Math.round(u * 10))), o.add(p);
394
397
  }
395
- const p = n.length;
398
+ const g = n.length;
396
399
  n.push(c);
397
400
  for (let d = 0; d < o.size; d++)
398
401
  n.push(null);
399
- l.set(c, { index: p, deps: o });
402
+ l.set(c, { index: g, deps: o });
400
403
  }
401
404
  for (const c of s) {
402
- const u = l.get(c);
403
- let { index: o, deps: w } = u;
405
+ const h = l.get(c);
406
+ let { index: o, deps: w } = h;
404
407
  o++;
405
408
  for (const v of w) {
406
409
  if (typeof v == "number") {
@@ -413,7 +416,7 @@ function On(t, e) {
413
416
  }
414
417
  return n;
415
418
  }
416
- async function Mn(t, e, n) {
419
+ async function Un(t, e, n) {
417
420
  const r = await t.dynamicImport("eslint");
418
421
  let i = new r.ESLint({ cache: !0 });
419
422
  if ((await i.calculateConfigForFile("no-real-file.tsx")).parser === null) {
@@ -424,7 +427,7 @@ async function Mn(t, e, n) {
424
427
  parserOptions: {
425
428
  tsconfigRootDir: e,
426
429
  project: n,
427
- ecmaVersion: 2021,
430
+ ecmaVersion: 2022,
428
431
  sourceType: "module",
429
432
  ecmaFeatures: {
430
433
  jsx: !0
@@ -436,18 +439,18 @@ async function Mn(t, e, n) {
436
439
  i = new r.ESLint(a);
437
440
  }
438
441
  return {
439
- async lint(a, c, u) {
442
+ async lint(a, c, h) {
440
443
  try {
441
- const o = jn(u);
444
+ const o = Bn(h);
442
445
  if (await i.isPathIgnored(o))
443
446
  return null;
444
447
  (await i.lintText(c, {
445
448
  filePath: o
446
449
  })).forEach((v) => {
447
- for (const p of v.messages) {
448
- if (p.ruleId != null && !p.ruleId.startsWith("qwik/"))
450
+ for (const g of v.messages) {
451
+ if (g.ruleId != null && !g.ruleId.startsWith("qwik/"))
449
452
  continue;
450
- const d = $n(v.filePath, p);
453
+ const d = Fn(v.filePath, g);
451
454
  a.warn(d);
452
455
  }
453
456
  });
@@ -457,10 +460,10 @@ async function Mn(t, e, n) {
457
460
  }
458
461
  };
459
462
  }
460
- function jn(t) {
463
+ function Bn(t) {
461
464
  return t.split("?", 2)[0];
462
465
  }
463
- function $n(t, e) {
466
+ function Fn(t, e) {
464
467
  return Object.assign(new Error(e.message), {
465
468
  id: t,
466
469
  plugin: "vite-plugin-eslint",
@@ -472,19 +475,19 @@ function $n(t, e) {
472
475
  stack: ""
473
476
  });
474
477
  }
475
- const Un = /\.server\.[cm]?[jt]sx?$/, qn = /\.server\.[cm]?[jt]sx?_/, Bn = /(^|\/)server(\/|$)/, _t = (t) => t.includes(".server") || t.includes("/server") || t.includes("\\server") || t.includes("server/") || t.includes("server\\"), Ve = (t) => t.replace(/\\/g, "/").replace(/^\/@fs\//, ""), Fn = (t, e) => {
476
- const n = Ve(t), r = e.rootDir ? Ve(e.rootDir).replace(/\/+$/, "") : "";
478
+ const An = /\.server\.[cm]?[jt]sx?$/, zn = /\.server\.[cm]?[jt]sx?_/, Wn = /(^|\/)server(\/|$)/, _t = (t) => t.includes(".server") || t.includes("/server") || t.includes("\\server") || t.includes("server/") || t.includes("server\\"), Xe = (t) => t.replace(/\\/g, "/").replace(/^\/@fs\//, ""), Hn = (t, e) => {
479
+ const n = Xe(t), r = e.rootDir ? Xe(e.rootDir).replace(/\/+$/, "") : "";
477
480
  return r && (n === r || n.startsWith(r + "/")) ? n : r && n.startsWith("/") && !n.startsWith("//") && !/^[a-zA-Z]:\//.test(n) ? `${r}${n}` : n;
478
- }, An = (t) => {
479
- const e = Ve(t);
480
- return Un.test(e) || qn.test(e);
481
- }, zn = (t, e) => {
481
+ }, Gn = (t) => {
482
+ const e = Xe(t);
483
+ return An.test(e) || zn.test(e);
484
+ }, Qn = (t, e) => {
482
485
  const n = typeof e == "string" || e == null ? { srcDir: e } : e;
483
486
  if (!n.srcDir)
484
487
  return !1;
485
- const r = Fn(t, n), i = Ve(n.srcDir).replace(/\/+$/, "");
486
- return r.startsWith(i + "/") ? Bn.test(r.slice(i.length + 1)) : !1;
487
- }, Wn = (t, e) => An(t) || zn(t, e), Hn = (t, e) => {
488
+ const r = Hn(t, n), i = Xe(n.srcDir).replace(/\/+$/, "");
489
+ return r.startsWith(i + "/") ? Wn.test(r.slice(i.length + 1)) : !1;
490
+ }, Kn = (t, e) => Gn(t) || Qn(t, e), Jn = (t, e) => {
488
491
  const n = e ? `
489
492
  Importer: ${e}` : "";
490
493
  return `Server-only module cannot be imported by client code.
@@ -492,22 +495,7 @@ Importer: ${e}` : "";
492
495
  Server-only module: ${t}${n}
493
496
 
494
497
  Files named \`.server.*\` or placed under \`src/**/server/**\` are excluded from client bundles. Move this import behind SSR-only route loaders, actions, endpoint handlers, or expose the operation through an intentional \`server$\` API.`;
495
- };
496
- async function Gn(t, e) {
497
- const n = e;
498
- let r = n.loc;
499
- if (!n.frame && !n.plugin && (r || (r = Qn(n)), r && (n.loc = r, r.file))) {
500
- const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
501
- n.id = s(n.loc.file);
502
- try {
503
- const l = i.readFileSync(n.loc.file, "utf-8");
504
- n.frame = Jn(l, n.loc);
505
- } catch {
506
- }
507
- }
508
- return e;
509
- }
510
- const Qn = (t) => {
498
+ }, Yn = (t) => {
511
499
  const e = t.stack;
512
500
  if (typeof e == "string") {
513
501
  const n = e.split(`
@@ -517,14 +505,14 @@ const Qn = (t) => {
517
505
  if (/^\s+at/.test(i)) {
518
506
  const s = i.indexOf("/"), l = i.lastIndexOf(")", s);
519
507
  if (s > 0) {
520
- const c = i.slice(s, l).split(":"), u = Ct(c[c.length - 1]), o = Ct(c[c.length - 2]);
521
- return typeof u == "number" && typeof o == "number" ? (c.length -= 2, {
508
+ const c = i.slice(s, l).split(":"), h = Ct(c[c.length - 1]), o = Ct(c[c.length - 2]);
509
+ return typeof h == "number" && typeof o == "number" ? (c.length -= 2, {
522
510
  file: c.join(":"),
523
511
  line: o,
524
- column: u
525
- }) : typeof u == "number" ? (c.length -= 1, {
512
+ column: h
513
+ }) : typeof h == "number" ? (c.length -= 1, {
526
514
  file: c.join(":"),
527
- line: u,
515
+ line: h,
528
516
  column: void 0
529
517
  }) : {
530
518
  file: c.join(":"),
@@ -535,27 +523,27 @@ const Qn = (t) => {
535
523
  }
536
524
  }
537
525
  }
538
- }, ce = (t) => t.startsWith("\0"), Ct = (t) => {
526
+ }, ne = (t) => t.startsWith("\0"), Ct = (t) => {
539
527
  try {
540
528
  return parseInt(t, 10);
541
529
  } catch {
542
530
  return;
543
531
  }
544
- }, rn = /\r?\n/, Tt = 2;
545
- function Kn(t, e) {
532
+ }, on = /\r?\n/, Tt = 2;
533
+ function Xn(t, e) {
546
534
  if (typeof e == "number")
547
535
  return e;
548
536
  if (e.lo != null)
549
537
  return e.lo;
550
- const n = t.split(rn), { line: r, column: i } = e;
538
+ const n = t.split(on), { line: r, column: i } = e;
551
539
  let s = 0;
552
540
  for (let l = 0; l < r - 1 && l < n.length; l++)
553
541
  s += n[l].length + 1;
554
542
  return s + i;
555
543
  }
556
- function Jn(t, e = 0, n) {
557
- e = Kn(t, e), n = n || e;
558
- const r = t.split(rn);
544
+ function Zn(t, e = 0, n) {
545
+ e = Xn(t, e), n = n || e;
546
+ const r = t.split(on);
559
547
  let i = 0;
560
548
  const s = [];
561
549
  for (let l = 0; l < r.length; l++)
@@ -565,16 +553,16 @@ function Jn(t, e = 0, n) {
565
553
  continue;
566
554
  const c = a + 1;
567
555
  s.push(`${c}${" ".repeat(Math.max(3 - String(c).length, 0))}| ${r[a]}`);
568
- const u = r[a].length;
556
+ const h = r[a].length;
569
557
  if (a === l) {
570
- const o = Math.max(e - (i - u) + 1, 0), w = Math.max(1, n > i ? u - o : n - e);
558
+ const o = Math.max(e - (i - h) + 1, 0), w = Math.max(1, n > i ? h - o : n - e);
571
559
  s.push(" | " + " ".repeat(o) + "^".repeat(w));
572
560
  } else if (a > l) {
573
561
  if (n > i) {
574
- const o = Math.max(Math.min(n - i, u), 1);
562
+ const o = Math.max(Math.min(n - i, h), 1);
575
563
  s.push(" | " + "^".repeat(o));
576
564
  }
577
- i += u + 1;
565
+ i += h + 1;
578
566
  }
579
567
  }
580
568
  break;
@@ -582,10 +570,10 @@ function Jn(t, e = 0, n) {
582
570
  return s.join(`
583
571
  `);
584
572
  }
585
- function Yn(t) {
573
+ function Vn(t) {
586
574
  return t === "win32";
587
575
  }
588
- function Ee(t) {
576
+ function me(t) {
589
577
  const [e, n] = t.split("?"), r = n || "";
590
578
  return {
591
579
  originalId: t,
@@ -594,21 +582,21 @@ function Ee(t) {
594
582
  params: new URLSearchParams(r)
595
583
  };
596
584
  }
597
- var Xn = 44, Zn = 59, Pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", on = new Uint8Array(64), Vn = new Uint8Array(128);
585
+ var er = 44, tr = 59, Pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", sn = new Uint8Array(64), nr = new Uint8Array(128);
598
586
  for (let t = 0; t < Pt.length; t++) {
599
587
  const e = Pt.charCodeAt(t);
600
- on[t] = e, Vn[e] = t;
588
+ sn[t] = e, nr[e] = t;
601
589
  }
602
590
  function ke(t, e, n) {
603
591
  let r = e - n;
604
592
  r = r < 0 ? -r << 1 | 1 : r << 1;
605
593
  do {
606
594
  let i = r & 31;
607
- r >>>= 5, r > 0 && (i |= 32), t.write(on[i]);
595
+ r >>>= 5, r > 0 && (i |= 32), t.write(sn[i]);
608
596
  } while (r > 0);
609
597
  return e;
610
598
  }
611
- var Dt = 1024 * 16, Nt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
599
+ var Nt = 1024 * 16, Dt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
612
600
  decode(t) {
613
601
  return Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString();
614
602
  }
@@ -619,36 +607,36 @@ var Dt = 1024 * 16, Nt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDeco
619
607
  e += String.fromCharCode(t[n]);
620
608
  return e;
621
609
  }
622
- }, er = class {
610
+ }, rr = class {
623
611
  constructor() {
624
- this.pos = 0, this.out = "", this.buffer = new Uint8Array(Dt);
612
+ this.pos = 0, this.out = "", this.buffer = new Uint8Array(Nt);
625
613
  }
626
614
  write(t) {
627
615
  const { buffer: e } = this;
628
- e[this.pos++] = t, this.pos === Dt && (this.out += Nt.decode(e), this.pos = 0);
616
+ e[this.pos++] = t, this.pos === Nt && (this.out += Dt.decode(e), this.pos = 0);
629
617
  }
630
618
  flush() {
631
619
  const { buffer: t, out: e, pos: n } = this;
632
- return n > 0 ? e + Nt.decode(t.subarray(0, n)) : e;
620
+ return n > 0 ? e + Dt.decode(t.subarray(0, n)) : e;
633
621
  }
634
622
  };
635
- function tr(t) {
636
- const e = new er();
623
+ function ir(t) {
624
+ const e = new rr();
637
625
  let n = 0, r = 0, i = 0, s = 0;
638
626
  for (let l = 0; l < t.length; l++) {
639
627
  const a = t[l];
640
- if (l > 0 && e.write(Zn), a.length === 0) continue;
628
+ if (l > 0 && e.write(tr), a.length === 0) continue;
641
629
  let c = 0;
642
- for (let u = 0; u < a.length; u++) {
643
- const o = a[u];
644
- u > 0 && e.write(Xn), c = ke(e, o[0], c), o.length !== 1 && (n = ke(e, o[1], n), r = ke(e, o[2], r), i = ke(e, o[3], i), o.length !== 4 && (s = ke(e, o[4], s)));
630
+ for (let h = 0; h < a.length; h++) {
631
+ const o = a[h];
632
+ h > 0 && e.write(er), c = ke(e, o[0], c), o.length !== 1 && (n = ke(e, o[1], n), r = ke(e, o[2], r), i = ke(e, o[3], i), o.length !== 4 && (s = ke(e, o[4], s)));
645
633
  }
646
634
  }
647
635
  return e.flush();
648
636
  }
649
- class et {
637
+ class Ze {
650
638
  constructor(e) {
651
- this.bits = e instanceof et ? e.bits.slice() : [];
639
+ this.bits = e instanceof Ze ? e.bits.slice() : [];
652
640
  }
653
641
  add(e) {
654
642
  this.bits[e >> 5] |= 1 << (e & 31);
@@ -657,7 +645,7 @@ class et {
657
645
  return !!(this.bits[e >> 5] & 1 << (e & 31));
658
646
  }
659
647
  }
660
- class We {
648
+ class ze {
661
649
  constructor(e, n, r) {
662
650
  this.start = e, this.end = n, this.original = r, this.intro = "", this.outro = "", this.content = r, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
663
651
  }
@@ -668,7 +656,7 @@ class We {
668
656
  this.intro = this.intro + e;
669
657
  }
670
658
  clone() {
671
- const e = new We(this.start, this.end, this.original);
659
+ const e = new ze(this.start, this.end, this.original);
672
660
  return e.intro = this.intro, e.outro = this.outro, e.content = this.content, e.storeName = this.storeName, e.edited = this.edited, e;
673
661
  }
674
662
  contains(e) {
@@ -699,7 +687,7 @@ class We {
699
687
  split(e) {
700
688
  const n = e - this.start, r = this.original.slice(0, n), i = this.original.slice(n);
701
689
  this.original = r;
702
- const s = new We(e, this.end, i);
690
+ const s = new ze(e, this.end, i);
703
691
  return s.outro = this.outro, this.outro = "", this.end = e, this.edited ? (s.edit("", !1), this.content = "") : this.content = r, s.next = this.next, s.next && (s.next.previous = s), s.previous = this, this.next = s, s;
704
692
  }
705
693
  toString() {
@@ -724,24 +712,24 @@ class We {
724
712
  } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
725
713
  }
726
714
  }
727
- function nr() {
715
+ function or() {
728
716
  return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (t) => globalThis.btoa(unescape(encodeURIComponent(t))) : typeof Buffer == "function" ? (t) => Buffer.from(t, "utf-8").toString("base64") : () => {
729
717
  throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
730
718
  };
731
719
  }
732
- const rr = /* @__PURE__ */ nr();
733
- class ir {
720
+ const sr = /* @__PURE__ */ or();
721
+ class ar {
734
722
  constructor(e) {
735
- this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = tr(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
723
+ this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = ir(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
736
724
  }
737
725
  toString() {
738
726
  return JSON.stringify(this);
739
727
  }
740
728
  toUrl() {
741
- return "data:application/json;charset=utf-8;base64," + rr(this.toString());
729
+ return "data:application/json;charset=utf-8;base64," + sr(this.toString());
742
730
  }
743
731
  }
744
- function or(t) {
732
+ function lr(t) {
745
733
  const e = t.split(`
746
734
  `), n = e.filter((s) => /^\t+/.test(s)), r = e.filter((s) => /^ {2,}/.test(s));
747
735
  if (n.length === 0 && r.length === 0)
@@ -754,7 +742,7 @@ function or(t) {
754
742
  }, 1 / 0);
755
743
  return new Array(i + 1).join(" ");
756
744
  }
757
- function sr(t, e) {
745
+ function cr(t, e) {
758
746
  const n = t.split(/[/\\]/), r = e.split(/[/\\]/);
759
747
  for (n.pop(); n[0] === r[0]; )
760
748
  n.shift(), r.shift();
@@ -764,9 +752,9 @@ function sr(t, e) {
764
752
  }
765
753
  return n.concat(r).join("/");
766
754
  }
767
- const ar = Object.prototype.toString;
768
- function lr(t) {
769
- return ar.call(t) === "[object Object]";
755
+ const dr = Object.prototype.toString;
756
+ function ur(t) {
757
+ return dr.call(t) === "[object Object]";
770
758
  }
771
759
  function Rt(t) {
772
760
  const e = t.split(`
@@ -776,15 +764,15 @@ function Rt(t) {
776
764
  return function(i) {
777
765
  let s = 0, l = n.length;
778
766
  for (; s < l; ) {
779
- const u = s + l >> 1;
780
- i < n[u] ? l = u : s = u + 1;
767
+ const h = s + l >> 1;
768
+ i < n[h] ? l = h : s = h + 1;
781
769
  }
782
770
  const a = s - 1, c = i - n[a];
783
771
  return { line: a, column: c };
784
772
  };
785
773
  }
786
- const cr = /\w/;
787
- class dr {
774
+ const fr = /\w/;
775
+ class hr {
788
776
  constructor(e) {
789
777
  this.hires = e, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
790
778
  }
@@ -794,8 +782,8 @@ class dr {
794
782
  let l = n.indexOf(`
795
783
  `, 0), a = -1;
796
784
  for (; l >= 0 && s > l; ) {
797
- const u = [this.generatedCodeColumn, e, r.line, r.column];
798
- i >= 0 && u.push(i), this.rawSegments.push(u), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = l, l = n.indexOf(`
785
+ const h = [this.generatedCodeColumn, e, r.line, r.column];
786
+ i >= 0 && h.push(i), this.rawSegments.push(h), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = l, l = n.indexOf(`
799
787
  `, l + 1);
800
788
  }
801
789
  const c = [this.generatedCodeColumn, e, r.line, r.column];
@@ -811,8 +799,8 @@ class dr {
811
799
  i.line += 1, i.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = !0, c = !1;
812
800
  else {
813
801
  if (this.hires || a || s.has(l)) {
814
- const u = [this.generatedCodeColumn, e, i.line, i.column];
815
- this.hires === "boundary" ? cr.test(r[l]) ? c || (this.rawSegments.push(u), c = !0) : (this.rawSegments.push(u), c = !1) : this.rawSegments.push(u);
802
+ const h = [this.generatedCodeColumn, e, i.line, i.column];
803
+ this.hires === "boundary" ? fr.test(r[l]) ? c || (this.rawSegments.push(h), c = !0) : (this.rawSegments.push(h), c = !1) : this.rawSegments.push(h);
816
804
  }
817
805
  i.column += 1, this.generatedCodeColumn += 1, a = !1;
818
806
  }
@@ -832,15 +820,15 @@ class dr {
832
820
  this.generatedCodeColumn += n[n.length - 1].length;
833
821
  }
834
822
  }
835
- const Ie = `
823
+ const Ee = `
836
824
  `, ve = {
837
825
  insertLeft: !1,
838
826
  insertRight: !1,
839
827
  storeName: !1
840
828
  };
841
- class ft {
829
+ class ht {
842
830
  constructor(e, n = {}) {
843
- const r = new We(0, e.length, e);
831
+ const r = new ze(0, e.length, e);
844
832
  Object.defineProperties(this, {
845
833
  original: { writable: !0, value: e },
846
834
  outro: { writable: !0, value: "" },
@@ -852,7 +840,7 @@ class ft {
852
840
  byEnd: { writable: !0, value: {} },
853
841
  filename: { writable: !0, value: n.filename },
854
842
  indentExclusionRanges: { writable: !0, value: n.indentExclusionRanges },
855
- sourcemapLocations: { writable: !0, value: new et() },
843
+ sourcemapLocations: { writable: !0, value: new Ze() },
856
844
  storedNames: { writable: !0, value: {} },
857
845
  indentStr: { writable: !0, value: void 0 },
858
846
  ignoreList: { writable: !0, value: n.ignoreList },
@@ -879,18 +867,18 @@ class ft {
879
867
  return r ? r.appendRight(n) : this.outro += n, this;
880
868
  }
881
869
  clone() {
882
- const e = new ft(this.original, { filename: this.filename, offset: this.offset });
870
+ const e = new ht(this.original, { filename: this.filename, offset: this.offset });
883
871
  let n = this.firstChunk, r = e.firstChunk = e.lastSearchedChunk = n.clone();
884
872
  for (; n; ) {
885
873
  e.byStart[r.start] = r, e.byEnd[r.end] = r;
886
874
  const i = n.next, s = i && i.clone();
887
875
  s && (r.next = s, s.previous = r, r = s), n = i;
888
876
  }
889
- return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new et(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
877
+ return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new Ze(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
890
878
  }
891
879
  generateDecodedMap(e) {
892
880
  e = e || {};
893
- const n = 0, r = Object.keys(this.storedNames), i = new dr(e.hires), s = Rt(this.original);
881
+ const n = 0, r = Object.keys(this.storedNames), i = new hr(e.hires), s = Rt(this.original);
894
882
  return this.intro && i.advance(this.intro), this.firstChunk.eachNext((l) => {
895
883
  const a = s(l.start);
896
884
  l.intro.length && i.advance(l.intro), l.edited ? i.addEdit(
@@ -902,7 +890,7 @@ class ft {
902
890
  }), this.outro && i.advance(this.outro), {
903
891
  file: e.file ? e.file.split(/[/\\]/).pop() : void 0,
904
892
  sources: [
905
- e.source ? sr(e.file || "", e.source) : e.file || ""
893
+ e.source ? cr(e.file || "", e.source) : e.file || ""
906
894
  ],
907
895
  sourcesContent: e.includeContent ? [this.original] : void 0,
908
896
  names: r,
@@ -911,10 +899,10 @@ class ft {
911
899
  };
912
900
  }
913
901
  generateMap(e) {
914
- return new ir(this.generateDecodedMap(e));
902
+ return new ar(this.generateDecodedMap(e));
915
903
  }
916
904
  _ensureindentStr() {
917
- this.indentStr === void 0 && (this.indentStr = or(this.original));
905
+ this.indentStr === void 0 && (this.indentStr = lr(this.original));
918
906
  }
919
907
  _getRawIndentString() {
920
908
  return this._ensureindentStr(), this.indentStr;
@@ -924,7 +912,7 @@ class ft {
924
912
  }
925
913
  indent(e, n) {
926
914
  const r = /^[^\r\n]/gm;
927
- if (lr(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
915
+ if (ur(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
928
916
  n = n || {};
929
917
  const i = {};
930
918
  n.exclude && (typeof n.exclude[0] == "number" ? [n.exclude] : n.exclude).forEach((o) => {
@@ -932,16 +920,16 @@ class ft {
932
920
  i[w] = !0;
933
921
  });
934
922
  let s = n.indentStart !== !1;
935
- const l = (u) => s ? `${e}${u}` : (s = !0, u);
923
+ const l = (h) => s ? `${e}${h}` : (s = !0, h);
936
924
  this.intro = this.intro.replace(r, l);
937
925
  let a = 0, c = this.firstChunk;
938
926
  for (; c; ) {
939
- const u = c.end;
927
+ const h = c.end;
940
928
  if (c.edited)
941
929
  i[a] || (c.content = c.content.replace(r, l), c.content.length && (s = c.content[c.content.length - 1] === `
942
930
  `));
943
931
  else
944
- for (a = c.start; a < u; ) {
932
+ for (a = c.start; a < h; ) {
945
933
  if (!i[a]) {
946
934
  const o = this.original[a];
947
935
  o === `
@@ -973,8 +961,8 @@ class ft {
973
961
  this._split(e), this._split(n), this._split(r);
974
962
  const i = this.byStart[e], s = this.byEnd[n], l = i.previous, a = s.next, c = this.byStart[r];
975
963
  if (!c && s === this.lastChunk) return this;
976
- const u = c ? c.previous : this.lastChunk;
977
- return l && (l.next = a), a && (a.previous = l), u && (u.next = i), c && (c.previous = s), i.previous || (this.firstChunk = s.next), s.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = u, s.next = c || null, u || (this.firstChunk = i), c || (this.lastChunk = s), this;
964
+ const h = c ? c.previous : this.lastChunk;
965
+ return l && (l.next = a), a && (a.previous = l), h && (h.next = i), c && (c.previous = s), i.previous || (this.firstChunk = s.next), s.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = h, s.next = c || null, h || (this.firstChunk = i), c || (this.lastChunk = s), this;
978
966
  }
979
967
  overwrite(e, n, r, i) {
980
968
  return i = i || {}, this.update(e, n, r, { ...i, overwrite: !i.contentOnly });
@@ -995,8 +983,8 @@ class ft {
995
983
  ), ve.storeName = !0), i = { storeName: !0 });
996
984
  const s = i !== void 0 ? i.storeName : !1, l = i !== void 0 ? i.overwrite : !1;
997
985
  if (s) {
998
- const u = this.original.slice(e, n);
999
- Object.defineProperty(this.storedNames, u, {
986
+ const h = this.original.slice(e, n);
987
+ Object.defineProperty(this.storedNames, h, {
1000
988
  writable: !0,
1001
989
  value: !0,
1002
990
  enumerable: !0
@@ -1004,16 +992,16 @@ class ft {
1004
992
  }
1005
993
  const a = this.byStart[e], c = this.byEnd[n];
1006
994
  if (a) {
1007
- let u = a;
1008
- for (; u !== c; ) {
1009
- if (u.next !== this.byStart[u.end])
995
+ let h = a;
996
+ for (; h !== c; ) {
997
+ if (h.next !== this.byStart[h.end])
1010
998
  throw new Error("Cannot overwrite across a split point");
1011
- u = u.next, u.edit("", !1);
999
+ h = h.next, h.edit("", !1);
1012
1000
  }
1013
1001
  a.edit(r, s, !l);
1014
1002
  } else {
1015
- const u = new We(e, n, "").edit(r, s);
1016
- c.next = u, u.previous = c;
1003
+ const h = new ze(e, n, "").edit(r, s);
1004
+ c.next = h, h.previous = c;
1017
1005
  }
1018
1006
  return this;
1019
1007
  }
@@ -1072,24 +1060,24 @@ class ft {
1072
1060
  return this.intro.length ? this.intro[this.intro.length - 1] : "";
1073
1061
  }
1074
1062
  lastLine() {
1075
- let e = this.outro.lastIndexOf(Ie);
1063
+ let e = this.outro.lastIndexOf(Ee);
1076
1064
  if (e !== -1) return this.outro.substr(e + 1);
1077
1065
  let n = this.outro, r = this.lastChunk;
1078
1066
  do {
1079
1067
  if (r.outro.length > 0) {
1080
- if (e = r.outro.lastIndexOf(Ie), e !== -1) return r.outro.substr(e + 1) + n;
1068
+ if (e = r.outro.lastIndexOf(Ee), e !== -1) return r.outro.substr(e + 1) + n;
1081
1069
  n = r.outro + n;
1082
1070
  }
1083
1071
  if (r.content.length > 0) {
1084
- if (e = r.content.lastIndexOf(Ie), e !== -1) return r.content.substr(e + 1) + n;
1072
+ if (e = r.content.lastIndexOf(Ee), e !== -1) return r.content.substr(e + 1) + n;
1085
1073
  n = r.content + n;
1086
1074
  }
1087
1075
  if (r.intro.length > 0) {
1088
- if (e = r.intro.lastIndexOf(Ie), e !== -1) return r.intro.substr(e + 1) + n;
1076
+ if (e = r.intro.lastIndexOf(Ee), e !== -1) return r.intro.substr(e + 1) + n;
1089
1077
  n = r.intro + n;
1090
1078
  }
1091
1079
  } while (r = r.previous);
1092
- return e = this.intro.lastIndexOf(Ie), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
1080
+ return e = this.intro.lastIndexOf(Ee), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
1093
1081
  }
1094
1082
  slice(e = 0, n = this.original.length - this.offset) {
1095
1083
  if (e = e + this.offset, n = n + this.offset, this.original.length !== 0) {
@@ -1253,13 +1241,13 @@ class ft {
1253
1241
  return this._replaceRegexp(e, n);
1254
1242
  }
1255
1243
  }
1256
- const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr = new RegExp(`${hr}([^"'\\\`\\s]+)`, "g"), ct = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), sn = (t) => {
1244
+ const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr = new RegExp(`${gr}([^"'\\\`\\s]+)`, "g"), lt = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), an = (t) => {
1257
1245
  const e = t.replace(/\/+$/, ""), n = e.lastIndexOf("/");
1258
1246
  return n === -1 ? "." : n === 0 ? "/" : e.slice(0, n);
1259
- }, pr = (t, e) => {
1247
+ }, vr = (t, e) => {
1260
1248
  const n = e.replace(/^\.\//, "");
1261
- return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? ct(t, n) : new URL(n, `https://qwik.dev${ct(t, "build/")}`).pathname;
1262
- }, gr = (t, e) => {
1249
+ return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? lt(t, n) : new URL(n, `https://qwik.dev${lt(t, "build/")}`).pathname;
1250
+ }, wr = (t, e) => {
1263
1251
  const n = /* @__PURE__ */ new Map();
1264
1252
  for (const [r, i] of Object.entries(t.symbols)) {
1265
1253
  const s = t.mapping[r];
@@ -1271,35 +1259,35 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
1271
1259
  return (r) => n.get(
1272
1260
  r.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, "")
1273
1261
  );
1274
- }, an = (t, e) => t.replace(fr, (n, r) => e(r) ?? n), mr = (t, e) => gr(
1262
+ }, ln = (t, e) => t.replace(mr, (n, r) => e(r) ?? n), yr = (t, e) => wr(
1275
1263
  t,
1276
- (n) => pr(e, n)
1277
- ), vr = (t) => {
1278
- const e = t.replace(/\\/g, "/"), n = sn(e);
1264
+ (n) => vr(e, n)
1265
+ ), br = (t) => {
1266
+ const e = t.replace(/\\/g, "/"), n = an(e);
1279
1267
  return (r) => {
1280
- const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a = ct(n, `${l}.js`);
1268
+ const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a = lt(n, `${l}.js`);
1281
1269
  return s.startsWith("?") ? `${a}?worker_file&type=module&${s.slice(1)}` : s.startsWith("#") ? `${a}?worker_file&type=module${s}` : `${a}?worker_file&type=module`;
1282
1270
  };
1283
- }, wr = (t) => t.startsWith(".") ? t : `./${t}`, Lt = (t) => {
1271
+ }, xr = (t) => t.startsWith(".") ? t : `./${t}`, Lt = (t) => {
1284
1272
  const e = [];
1285
1273
  for (const n of t.replace(/\\/g, "/").split("/"))
1286
1274
  !n || n === "." || (n === ".." && e.length > 0 && e[e.length - 1] !== ".." ? e.pop() : e.push(n));
1287
1275
  return e;
1288
- }, yr = (t, e) => {
1276
+ }, Sr = (t, e) => {
1289
1277
  const n = t === "." ? [] : Lt(t), r = Lt(e);
1290
1278
  let i = 0;
1291
1279
  for (; i < n.length && i < r.length && n[i] === r[i]; )
1292
1280
  i++;
1293
1281
  return [...n.slice(i).map(() => ".."), ...r.slice(i)].join("/");
1294
- }, ln = (t) => (e) => {
1295
- const n = yr(sn(e), t);
1296
- return wr(n);
1282
+ }, cn = (t) => (e) => {
1283
+ const n = Sr(an(e), t);
1284
+ return xr(n);
1297
1285
  }, Ot = (t, e) => {
1298
- if (!t.includes(lt))
1286
+ if (!t.includes(at))
1299
1287
  return t;
1300
1288
  const n = e();
1301
- return n ? t.replaceAll(lt, n) : t;
1302
- }, br = ["server"], Mt = [
1289
+ return n ? t.replaceAll(at, n) : t;
1290
+ }, kr = ["server"], Mt = [
1303
1291
  "onGet",
1304
1292
  "onPost",
1305
1293
  "onPut",
@@ -1309,7 +1297,7 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
1309
1297
  "onOptions",
1310
1298
  "onPatch",
1311
1299
  "onStaticGenerate"
1312
- ], jt = [
1300
+ ], $t = [
1313
1301
  "useServer",
1314
1302
  "route",
1315
1303
  "server",
@@ -1318,7 +1306,7 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
1318
1306
  "zod$",
1319
1307
  "validator$",
1320
1308
  "globalAction$"
1321
- ], xr = [
1309
+ ], Er = [
1322
1310
  "useClient",
1323
1311
  "useBrowser",
1324
1312
  "useVisibleTask",
@@ -1326,10 +1314,10 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
1326
1314
  "browser",
1327
1315
  "event$"
1328
1316
  ];
1329
- var cn = /* @__PURE__ */ ((t) => (t.each = "each", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t))(cn || {});
1330
- function dn(t = {}) {
1317
+ var dn = /* @__PURE__ */ ((t) => (t.each = "each", t.show = "show", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t.blockSSR = "blockSSR", t))(dn || {});
1318
+ function un(t = {}) {
1331
1319
  const e = `${Math.round(Math.random() * 899) + 100}`, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
1332
- let a = null, c, u = () => {
1320
+ let a = null, c, h = () => {
1333
1321
  };
1334
1322
  const o = {
1335
1323
  csr: !1,
@@ -1340,7 +1328,6 @@ function dn(t = {}) {
1340
1328
  tsconfigFileNames: ["./tsconfig.json"],
1341
1329
  input: void 0,
1342
1330
  outDir: void 0,
1343
- assetsDir: void 0,
1344
1331
  resolveQwikBuild: !0,
1345
1332
  entryStrategy: void 0,
1346
1333
  srcDir: void 0,
@@ -1362,10 +1349,10 @@ function dn(t = {}) {
1362
1349
  experimental: void 0
1363
1350
  };
1364
1351
  let w, v;
1365
- const p = async () => {
1352
+ const g = async () => {
1366
1353
  if (!a) {
1367
1354
  const y = (t._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
1368
- if (a = await y(t), w = Sr(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
1355
+ if (a = await y(t), w = Ir(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
1369
1356
  try {
1370
1357
  v === void 0 && (v = await a.sys.dynamicImport("node:fs"));
1371
1358
  } catch {
@@ -1376,167 +1363,186 @@ function dn(t = {}) {
1376
1363
  if (!a)
1377
1364
  throw new Error("Qwik plugin has not been initialized");
1378
1365
  return a;
1379
- }, g = () => d().sys, f = () => d().sys.path;
1380
- let m;
1366
+ }, u = () => d().sys, p = () => d().sys.path;
1367
+ let x;
1381
1368
  const R = (y) => {
1382
- m = y;
1383
- }, X = async (y) => {
1384
- const h = Object.assign({}, y), S = d(), _ = S.sys.path, I = (...T) => Y(_.resolve(...T));
1385
- o.debug = !!h.debug, h.devTools && (o.devTools = {
1369
+ x = y;
1370
+ }, K = async (y) => {
1371
+ const f = Object.assign({}, y), k = d(), _ = k.sys.path, E = (...P) => Q(_.resolve(...P));
1372
+ o.debug = !!f.debug, f.devTools && (o.devTools = {
1386
1373
  ...o.devTools,
1387
- ...h.devTools
1388
- }), h.assetsDir && (o.assetsDir = h.assetsDir), h.target === "ssr" || h.target === "client" || h.target === "lib" || h.target === "test" ? o.target = h.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : h.buildMode === "production" || h.buildMode === "development" ? o.buildMode = h.buildMode : o.buildMode ||= "development", o.csr = !!h.csr, h.entryStrategy && typeof h.entryStrategy == "object" && (o.entryStrategy = { ...h.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof h.rootDir == "string" && (o.rootDir = h.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= S.sys.cwd()), o.rootDir = I(S.sys.cwd(), o.rootDir);
1389
- let x = I(o.rootDir, Ir);
1390
- if (typeof h.srcDir == "string" ? (o.srcDir = I(o.rootDir, h.srcDir), x = o.srcDir) : o.srcDir ||= x, o.srcDir = I(o.rootDir, o.srcDir), Array.isArray(h.tsconfigFileNames) && h.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = h.tsconfigFileNames), !o.csr && !h.input && !o.input && (o.target === "ssr" ? o.input = [I(x, "entry.ssr")] : o.target === "client" ? o.input = [I(x, "root")] : o.input = void 0), h.outDir && (o.outDir = I(o.rootDir, h.outDir)), o.clientOutDir = I(o.rootDir, h.clientOutDir || Ut), o.ssrOutDir = I(o.rootDir, h.ssrOutDir || _r), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= I(o.rootDir, Cr) : o.outDir ||= o.clientOutDir, typeof h.manifestOutput == "function" && (o.manifestOutput = h.manifestOutput), h.manifestInput && (o.manifestInput = St(h.manifestInput) || null), typeof h.transformedModuleOutput == "function" && (o.transformedModuleOutput = h.transformedModuleOutput), h.scope !== void 0)
1391
- o.scope = h.scope;
1374
+ ...f.devTools
1375
+ }), f.target === "ssr" || f.target === "client" || f.target === "lib" || f.target === "test" ? o.target = f.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : f.buildMode === "production" || f.buildMode === "development" ? o.buildMode = f.buildMode : o.buildMode ||= "development", o.csr = !!f.csr, f.entryStrategy && typeof f.entryStrategy == "object" && (o.entryStrategy = { ...f.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof f.rootDir == "string" && (o.rootDir = f.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= k.sys.cwd()), o.rootDir = E(k.sys.cwd(), o.rootDir);
1376
+ let S = E(o.rootDir, Cr);
1377
+ if (typeof f.srcDir == "string" ? (o.srcDir = E(o.rootDir, f.srcDir), S = o.srcDir) : o.srcDir ||= S, o.srcDir = E(o.rootDir, o.srcDir), Array.isArray(f.tsconfigFileNames) && f.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = f.tsconfigFileNames), !o.csr && !f.input && !o.input && (o.target === "ssr" ? o.input = [E(S, "entry.ssr")] : o.target === "client" ? o.input = [E(S, "root")] : o.input = void 0), f.outDir && (o.outDir = E(o.rootDir, f.outDir)), o.clientOutDir = E(o.rootDir, f.clientOutDir || Ut), o.ssrOutDir = E(o.rootDir, f.ssrOutDir || Tr), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= E(o.rootDir, Pr) : o.outDir ||= o.clientOutDir, typeof f.manifestOutput == "function" && (o.manifestOutput = f.manifestOutput), f.manifestInput && (o.manifestInput = St(f.manifestInput) || null), typeof f.transformedModuleOutput == "function" && (o.transformedModuleOutput = f.transformedModuleOutput), f.scope !== void 0)
1378
+ o.scope = f.scope;
1392
1379
  else if (!o.scope && v) {
1393
- let T = "";
1380
+ let P = "";
1394
1381
  try {
1395
- let q = o.rootDir;
1396
- for (; T = _.resolve(q, "package.json"), !await v.promises.stat(T).catch(() => !1); ) {
1397
- const D = _.resolve(q, "..");
1398
- if (D === q)
1382
+ let M = o.rootDir;
1383
+ for (; P = _.resolve(M, "package.json"), !await v.promises.stat(P).catch(() => !1); ) {
1384
+ const N = _.resolve(M, "..");
1385
+ if (N === M)
1399
1386
  break;
1400
- q = D, T = "";
1387
+ M = N, P = "";
1401
1388
  }
1402
- if (T) {
1403
- const D = await v.promises.readFile(T, "utf-8"), N = JSON.parse(D);
1404
- typeof N.name == "string" && (o.scope = N.name);
1389
+ if (P) {
1390
+ const N = await v.promises.readFile(P, "utf-8"), D = JSON.parse(N);
1391
+ typeof D.name == "string" && (o.scope = D.name);
1405
1392
  }
1406
- } catch (q) {
1393
+ } catch (M) {
1407
1394
  console.warn(
1408
- `could not read ${T || "package.json"} to determine package name, ignoring. (${q})`
1395
+ `could not read ${P || "package.json"} to determine package name, ignoring. (${M})`
1409
1396
  );
1410
1397
  }
1411
1398
  }
1412
- if (typeof h.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = h.resolveQwikBuild), typeof h.devTools == "object" && ("imageDevTools" in h.devTools && (o.devTools.imageDevTools = h.devTools.imageDevTools), "clickToSource" in h.devTools && (o.devTools.clickToSource = h.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof h.lint == "boolean" && (o.lint = h.lint), "experimental" in h) {
1399
+ if (typeof f.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = f.resolveQwikBuild), typeof f.devTools == "object" && ("imageDevTools" in f.devTools && (o.devTools.imageDevTools = f.devTools.imageDevTools), "clickToSource" in f.devTools && (o.devTools.clickToSource = f.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof f.lint == "boolean" && (o.lint = f.lint), "experimental" in f) {
1413
1400
  o.experimental = void 0;
1414
- for (const T of h.experimental ?? [])
1415
- cn[T] ? (o.experimental ||= {})[T] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${T}`);
1401
+ for (const P of f.experimental ?? [])
1402
+ dn[P] ? (o.experimental ||= {})[P] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${P}`);
1416
1403
  }
1417
- const $ = { ...o };
1418
- return o.input ||= h.input, o.input && typeof o.input == "string" && (o.input = [o.input]), $;
1404
+ const L = { ...o };
1405
+ return o.input ||= f.input, o.input && typeof o.input == "string" && (o.input = [o.input]), L;
1419
1406
  };
1420
- let M = !1;
1421
- const C = async (y) => {
1422
- if (!M) {
1423
- M = !0;
1424
- const h = g();
1425
- if (h.env === "node") {
1426
- const S = await h.dynamicImport("node:fs");
1427
- if (!S.existsSync(o.rootDir))
1407
+ let m = !1;
1408
+ const b = async (y) => {
1409
+ if (!m) {
1410
+ m = !0;
1411
+ const f = u();
1412
+ if (f.env === "node") {
1413
+ const k = await f.dynamicImport("node:fs");
1414
+ if (!k.existsSync(o.rootDir))
1428
1415
  throw new Error(`Qwik rootDir "${o.rootDir}" not found.`);
1429
- if (typeof o.srcDir == "string" && !S.existsSync(o.srcDir))
1416
+ if (typeof o.srcDir == "string" && !k.existsSync(o.srcDir))
1430
1417
  throw new Error(`Qwik srcDir "${o.srcDir}" not found.`);
1431
- for (const [_, I] of Object.entries(o.input || {}))
1432
- if (!await y(I))
1433
- throw new Error(`Qwik input "${I}" not found.`);
1418
+ for (const [_, E] of Object.entries(o.input || {}))
1419
+ if (!await y(E))
1420
+ throw new Error(`Qwik input "${E}" not found.`);
1434
1421
  }
1435
1422
  }
1436
1423
  };
1437
- let b, k = !1;
1438
- const E = async (y) => {
1439
- if (U("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), b = d(), k = !m, b.sys.env === "node" && o.target === "ssr" && o.lint)
1424
+ let C, $ = !1;
1425
+ const I = async (y) => {
1426
+ if (O("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), C = d(), $ = !x, C.sys.env === "node" && o.target === "ssr" && o.lint)
1440
1427
  try {
1441
- c = await Mn(b.sys, o.rootDir, o.tsconfigFileNames);
1428
+ c = await Un(C.sys, o.rootDir, o.tsconfigFileNames);
1442
1429
  } catch {
1443
1430
  }
1444
- if (U("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !m) {
1445
- const h = await y.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1431
+ if (O("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !x) {
1432
+ const f = await y.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1446
1433
  skipSelf: !0
1447
1434
  });
1448
- h && y.emitFile({
1449
- id: h.id,
1435
+ f && y.emitFile({
1436
+ id: f.id,
1450
1437
  type: "chunk",
1451
1438
  preserveSignature: "allow-extension"
1452
1439
  });
1453
1440
  }
1454
- }, L = (y, h) => y.environment ? y.environment.config.consumer === "server" : m ? !!h?.ssr : o.target === "ssr" || o.target === "test", P = (y) => !y && (o.target === "client" || !!m && o.target === "ssr"), O = (y) => !!m && y && (o.target === "client" || o.target === "ssr"), F = (y, h, S = !1) => {
1455
- if (P(S) && Wn(y, o))
1456
- throw new Error(Hn(y, h));
1441
+ }, T = (y, f) => y.environment ? y.environment.config.consumer === "server" : x ? !!f?.ssr : o.target === "ssr" || o.target === "test", z = (y) => !y && (o.target === "client" || !!x && o.target === "ssr"), j = (y) => !!x && y && (o.target === "client" || o.target === "ssr"), q = (y, f, k = !1) => {
1442
+ if (z(k) && Kn(y, o))
1443
+ throw new Error(Jn(y, f));
1457
1444
  }, A = (y) => {
1458
- const h = y.replace(/\\/g, "/");
1459
- return h.includes(".server") || /(^|\/)server(\/|$)/.test(h);
1460
- }, j = (y, h) => {
1461
- const S = /* @__PURE__ */ new Set(), _ = (x) => {
1462
- typeof x?.value == "string" && S.add(x.value);
1463
- }, I = [y.parse(h)];
1464
- for (; I.length > 0; ) {
1465
- const x = I.pop();
1466
- if (!(!x || typeof x != "object" || typeof x.type != "string")) {
1467
- x.type === "ImportDeclaration" && x.importKind !== "type" || (x.type === "ExportNamedDeclaration" || x.type === "ExportAllDeclaration") && x.exportKind !== "type" || x.type === "ImportExpression" ? _(x.source) : x.type === "CallExpression" && x.callee?.type === "Import" && _(x.arguments?.[0]);
1468
- for (const $ of Object.keys(x)) {
1469
- if ($ === "parent")
1445
+ const f = y.replace(/\\/g, "/");
1446
+ return f.includes(".server") || /(^|\/)server(\/|$)/.test(f);
1447
+ }, J = (y, f) => {
1448
+ const k = /* @__PURE__ */ new Set(), _ = (S) => {
1449
+ typeof S?.value == "string" && k.add(S.value);
1450
+ }, E = [y.parse(f)];
1451
+ for (; E.length > 0; ) {
1452
+ const S = E.pop();
1453
+ if (!(!S || typeof S != "object" || typeof S.type != "string")) {
1454
+ S.type === "ImportDeclaration" && S.importKind !== "type" || (S.type === "ExportNamedDeclaration" || S.type === "ExportAllDeclaration") && S.exportKind !== "type" || S.type === "ImportExpression" ? _(S.source) : S.type === "CallExpression" && S.callee?.type === "Import" && _(S.arguments?.[0]);
1455
+ for (const L of Object.keys(S)) {
1456
+ if (L === "parent")
1470
1457
  continue;
1471
- const T = x[$];
1472
- if (Array.isArray(T))
1473
- for (const q of T)
1474
- I.push(q);
1458
+ const P = S[L];
1459
+ if (Array.isArray(P))
1460
+ for (const M of P)
1461
+ E.push(M);
1475
1462
  else
1476
- I.push(T);
1463
+ E.push(P);
1477
1464
  }
1478
1465
  }
1479
1466
  }
1480
- return Array.from(S);
1481
- }, J = async (y, h, S, _ = S) => {
1482
- if (_t(h))
1483
- for (const I of j(y, h)) {
1484
- if (!A(I))
1467
+ return Array.from(k);
1468
+ }, X = async (y, f, k, _ = k) => {
1469
+ if (_t(f))
1470
+ for (const E of J(y, f)) {
1471
+ if (!A(E))
1485
1472
  continue;
1486
- F(I, _);
1487
- const x = await y.resolve(I, S, { skipSelf: !0 });
1488
- x && F(Y(Ee(x.id).pathId), _);
1473
+ q(E, _);
1474
+ const S = await y.resolve(E, k, { skipSelf: !0 });
1475
+ S && q(Q(me(S.id).pathId), _);
1489
1476
  }
1490
- }, G = async (y, h, S, _, I = !1) => {
1491
- const x = f();
1492
- for (const $ of h.modules) {
1493
- if (I && !$t($))
1477
+ }, Y = async (y, f, k, _, E = !1) => {
1478
+ const S = p();
1479
+ for (const L of f.modules) {
1480
+ if (E && !jt(L))
1494
1481
  continue;
1495
- const T = Y(x.join(S, $.path));
1496
- await J(y, $.code, T, _ ?? T);
1482
+ const P = Q(S.join(k, L.path));
1483
+ await X(y, L.code, P, _ ?? P);
1497
1484
  }
1485
+ }, ae = async (y, f, k) => {
1486
+ const _ = await y.resolve(f, k, { skipSelf: !0 });
1487
+ if (!_ || _.external || ne(_.id))
1488
+ return;
1489
+ const E = me(_.id);
1490
+ if (E.query)
1491
+ return;
1492
+ const S = Q(E.pathId);
1493
+ if (p().extname(S).toLowerCase() in qt || ct.test(S))
1494
+ return S;
1495
+ }, W = async (y, f, k) => {
1496
+ if (f.length === 0)
1497
+ return [];
1498
+ const _ = [];
1499
+ for (const E of f) {
1500
+ const S = await ae(y, E, k);
1501
+ S && _.push(S);
1502
+ }
1503
+ return _;
1498
1504
  };
1499
- let ee = 0, Z = !1;
1500
- const ge = async (y, h, S, _) => {
1501
- if (ce(h))
1505
+ let le = 0, V = !1;
1506
+ const de = async (y, f, k, _) => {
1507
+ if (ne(f))
1502
1508
  return;
1503
- const I = m && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(h);
1504
- if (I) {
1505
- if (!Z) {
1506
- Z = !0, setTimeout(() => Z = !1, 500);
1507
- const [, H, B] = I, ie = await y.resolve(H, S);
1508
- if (ie) {
1509
- const ue = y.environment.moduleGraph.getModuleById(ie.id)?.file;
1509
+ const E = x && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(f);
1510
+ if (E) {
1511
+ if (!V) {
1512
+ V = !0, setTimeout(() => V = !1, 500);
1513
+ const [, F, U] = E, re = await y.resolve(F, k);
1514
+ if (re) {
1515
+ const ue = y.environment.moduleGraph.getModuleById(re.id)?.file;
1510
1516
  if (ue) {
1511
- const te = `${ue}${B}`;
1517
+ const ee = `${ue}${U}`;
1512
1518
  try {
1513
- console.warn(`Opening in editor: ${te}`);
1514
- const he = (await import("launch-editor")).default;
1515
- he(te);
1516
- } catch (he) {
1517
- console.error(`Failed to open editor: ${he.message}`);
1519
+ console.warn(`Opening in editor: ${ee}`);
1520
+ const fe = (await import("launch-editor")).default;
1521
+ fe(ee);
1522
+ } catch (fe) {
1523
+ console.error(`Failed to open editor: ${fe.message}`);
1518
1524
  }
1519
1525
  }
1520
1526
  }
1521
1527
  }
1522
1528
  return { id: "\0editor" };
1523
1529
  }
1524
- const x = ee++, $ = L(y, _);
1525
- U(`resolveId(${x})`, `begin ${h} | ${$ ? "server" : "client"} | ${S}`);
1526
- const T = S && Ee(S);
1527
- if (S = T && Y(T.pathId), h.startsWith(".") && T) {
1528
- const H = f(), B = H.dirname(T.pathId);
1529
- B && (h = H.resolve(B, h));
1530
+ const S = le++, L = T(y, _);
1531
+ O(`resolveId(${S})`, `begin ${f} | ${L ? "server" : "client"} | ${k}`);
1532
+ const P = k && me(k);
1533
+ if (k = P && Q(P.pathId), f.startsWith(".") && P) {
1534
+ const F = p(), U = F.dirname(P.pathId);
1535
+ U && (f = F.resolve(U, f));
1530
1536
  }
1531
- const q = Ee(h), D = Y(q.pathId);
1532
- let N;
1533
- if (m && _?.scan || F(D, S, $), /**
1537
+ const M = me(f), N = Q(M.pathId);
1538
+ let D;
1539
+ if (x && _?.scan || q(N, k, L), /**
1534
1540
  * Check if we know the QRL. During regular builds, we'll encounter and build parents before
1535
1541
  * their QRLs, so this will always match.
1536
1542
  */
1537
- s.get(D))
1538
- U(`resolveId(${x}) Resolved already known ${D}`), N = {
1539
- id: D + q.query,
1543
+ s.get(N))
1544
+ O(`resolveId(${S}) Resolved already known ${N}`), D = {
1545
+ id: N + M.query,
1540
1546
  moduleSideEffects: !1
1541
1547
  };
1542
1548
  else if (
@@ -1545,152 +1551,158 @@ function dn(t = {}) {
1545
1551
  * been transformed yet.
1546
1552
  */
1547
1553
  // We test with endsWith because the dev server adds the base pathname
1548
- D.endsWith(le)
1554
+ N.endsWith(se)
1549
1555
  )
1550
- o.resolveQwikBuild && (U(`resolveId(${x})`, "Resolved", le), N = {
1551
- id: le,
1556
+ o.resolveQwikBuild && (O(`resolveId(${S})`, "Resolved", se), D = {
1557
+ id: se,
1552
1558
  moduleSideEffects: !1
1553
1559
  });
1554
- else if (D.endsWith(ae))
1560
+ else if (N.endsWith(oe))
1555
1561
  console.error(
1556
- `${S ? `${S}: ` : ""}importing ${ae} is deprecated. Use \`getClientManifest()\` instead.`
1557
- ), U(`resolveId(${x})`, "Resolved", ae), N = {
1558
- id: ae,
1562
+ `${k ? `${k}: ` : ""}importing ${oe} is deprecated. Use \`getClientManifest()\` instead.`
1563
+ ), O(`resolveId(${S})`, "Resolved", oe), D = {
1564
+ id: oe,
1559
1565
  moduleSideEffects: !1
1560
1566
  };
1561
- else if (!m && !$ && D.endsWith(rt)) {
1562
- U(`resolveId(${x})`, "Resolved", rt);
1563
- const H = await y.resolve(rt, S, {
1567
+ else if (!x && !L && N.endsWith(nt)) {
1568
+ O(`resolveId(${S})`, "Resolved", nt);
1569
+ const F = await y.resolve(nt, k, {
1564
1570
  skipSelf: !0
1565
1571
  });
1566
- if (H)
1572
+ if (F)
1567
1573
  return y.emitFile({
1568
- id: H.id,
1574
+ id: F.id,
1569
1575
  type: "chunk",
1570
1576
  preserveSignature: "allow-extension"
1571
- }), H;
1572
- } else if (D.endsWith(_e))
1573
- U(`resolveId(${x})`, "Resolved", _e), N = {
1574
- id: _e,
1577
+ }), F;
1578
+ } else if (N.endsWith(Ie))
1579
+ O(`resolveId(${S})`, "Resolved", Ie), D = {
1580
+ id: Ie,
1575
1581
  moduleSideEffects: !1
1576
1582
  };
1577
1583
  else {
1578
- if (!$ && k && h.endsWith("@qwik.dev/core")) {
1579
- k = !1;
1580
- const B = await y.resolve("@qwik.dev/core/handlers.mjs", S, {
1584
+ if (!L && $ && f.endsWith("@qwik.dev/core")) {
1585
+ $ = !1;
1586
+ const U = await y.resolve("@qwik.dev/core/handlers.mjs", k, {
1581
1587
  skipSelf: !0
1582
1588
  });
1583
- if (!B)
1589
+ if (!U)
1584
1590
  throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
1585
1591
  y.emitFile({
1586
- id: B.id,
1592
+ id: U.id,
1587
1593
  type: "chunk",
1588
1594
  preserveSignature: "allow-extension"
1589
1595
  });
1590
1596
  }
1591
- const H = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(h)?.groups;
1592
- if (H) {
1593
- const { parent: B, name: ie, query: Qe } = H, ue = await y.resolve(B, S, { skipSelf: !0 });
1597
+ const F = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(f)?.groups;
1598
+ if (F) {
1599
+ const { parent: U, name: re, query: Ge } = F, ue = await y.resolve(U, k, { skipSelf: !0 });
1594
1600
  if (ue) {
1595
- const te = ue.id.split("?")[0], xe = m && S?.endsWith(".html") ? `${te}_${ie}.js` : D;
1596
- U(`resolveId(${x})`, `resolved to QRL ${ie} of ${te}`), s.set(xe, te), N = {
1597
- id: xe + Qe,
1601
+ const ee = ue.id.split("?")[0], be = x && k?.endsWith(".html") ? `${ee}_${re}.js` : N;
1602
+ O(`resolveId(${S})`, `resolved to QRL ${re} of ${ee}`), s.set(be, ee), D = {
1603
+ id: be + Ge,
1598
1604
  // QRL segments can't have side effects. Probably never useful, but it's here for consistency
1599
1605
  moduleSideEffects: !1
1600
1606
  };
1601
1607
  } else
1602
- console.error(`resolveId(${x})`, `QRL parent ${B} does not exist!`);
1603
- } else if (S) {
1604
- const B = s.get(S);
1605
- if (B)
1606
- return U(`resolveId(${x}) end`, `resolving via ${B}`), y.resolve(h, B, { skipSelf: !0 });
1608
+ console.error(`resolveId(${S})`, `QRL parent ${U} does not exist!`);
1609
+ } else if (k) {
1610
+ const U = s.get(k);
1611
+ if (U)
1612
+ return O(`resolveId(${S}) end`, `resolving via ${U}`), y.resolve(f, U, { skipSelf: !0 });
1607
1613
  }
1608
1614
  }
1609
- return U(`resolveId(${x}) end`, N?.id || N), N;
1615
+ return O(`resolveId(${S}) end`, D?.id || D), D;
1610
1616
  };
1611
- let be = 0;
1612
- const W = async (y, h, S) => {
1613
- if (h === "\0editor")
1617
+ let pn = 0;
1618
+ const gn = async (y, f, k) => {
1619
+ if (f === "\0editor")
1614
1620
  return '"opening in editor"';
1615
- if (ce(h))
1621
+ if (ne(f))
1616
1622
  return;
1617
- const _ = be++, I = L(y, S), x = Ee(h), $ = Y(x.pathId);
1618
- if (F($, void 0, I), h.startsWith("/@fs/"))
1623
+ const _ = pn++, E = T(y, k), S = me(f), L = Q(S.pathId);
1624
+ if (q(L, void 0, E), f.startsWith("/@fs/"))
1619
1625
  return;
1620
- if (o.resolveQwikBuild && h === le)
1621
- return U(`load(${_})`, le, o.buildMode), {
1626
+ if (o.resolveQwikBuild && f === se)
1627
+ return O(`load(${_})`, se, o.buildMode), {
1622
1628
  moduleSideEffects: !1,
1623
- code: mt(I, o.target)
1629
+ code: mt(E, o.target)
1624
1630
  };
1625
- if (h === ae)
1626
- return U(`load(${_})`, ae, o.buildMode), {
1631
+ if (f === oe)
1632
+ return O(`load(${_})`, oe, o.buildMode), {
1627
1633
  moduleSideEffects: !1,
1628
1634
  code: `import { getClientManifest } from '@qwik.dev/core'; export const manifest = getClientManifest();
1629
1635
  `
1630
1636
  };
1631
- if (h === _e)
1632
- return U(`load(${_})`, _e, o.buildMode), {
1637
+ if (f === Ie)
1638
+ return O(`load(${_})`, Ie, o.buildMode), {
1633
1639
  moduleSideEffects: !1,
1634
1640
  code: "export * from '@qwik.dev/core';"
1635
1641
  };
1636
- h = $;
1637
- const T = I ? i : r;
1638
- if (m && !T.has(h)) {
1639
- const D = s.get(h);
1640
- if (D) {
1641
- const N = m.moduleGraph.getModuleById(D);
1642
- if (N) {
1643
- if (U(`load(${_})`, "transforming QRL parent", D), await m.transformRequest(N.url), !T.has(h))
1644
- return U(`load(${_})`, `QRL segment ${h} not found in ${D}`), null;
1645
- } else
1646
- console.error(`load(${_})`, `module ${D} does not exist in the build graph!`);
1642
+ f = L;
1643
+ const P = E ? i : r;
1644
+ if (x && !P.has(f)) {
1645
+ const N = s.get(f);
1646
+ if (N) {
1647
+ O(`load(${_})`, "transforming QRL parent", N);
1648
+ const D = x.moduleGraph.getModuleById(N);
1649
+ if (D)
1650
+ await x.transformRequest(D.url);
1651
+ else
1652
+ try {
1653
+ await x.transformRequest(N);
1654
+ } catch (F) {
1655
+ console.error(`load(${_})`, `could not transform QRL parent ${N}:`, F);
1656
+ }
1657
+ if (!P.has(f))
1658
+ return O(`load(${_})`, `QRL segment ${f} not found in ${N}`), null;
1647
1659
  }
1648
1660
  }
1649
- const q = T.get(h);
1650
- if (q) {
1651
- U(`load(${_})`, "Found", h);
1652
- let { code: D } = q[0];
1653
- const { map: N, segment: H } = q[0], B = q[1];
1654
- if (m?.hot && B && o.devTools.hmr && H?.ctxName !== "worker$") {
1655
- const ie = B.startsWith(o.rootDir) ? B.slice(o.rootDir.length) : B;
1656
- D += `
1657
- if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(ie)}], t: document.__hmrT}}));});}`;
1661
+ const M = P.get(f);
1662
+ if (M) {
1663
+ O(`load(${_})`, "Found", f);
1664
+ let { code: N } = M[0];
1665
+ const { map: D, segment: F } = M[0], U = M[1];
1666
+ if (x?.hot && U && o.devTools.hmr && F?.ctxName !== "worker$") {
1667
+ const re = U.startsWith(o.rootDir) ? U.slice(o.rootDir.length) : U;
1668
+ N += `
1669
+ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(re)}], t: document.__hmrT}}));});}`;
1658
1670
  }
1659
- return { code: D, map: N, meta: { segment: H } };
1671
+ return { code: N, map: D, meta: { segment: F } };
1660
1672
  }
1661
- return U(`load(${_})`, "Not a QRL or virtual module", h), null;
1673
+ return O(`load(${_})`, "Not a QRL or virtual module", f), null;
1662
1674
  };
1663
- let ne, re = 0;
1664
- const Ge = async function(y, h, S, _ = {}) {
1665
- if (ce(S))
1675
+ let He, mn = 0;
1676
+ const vn = async function(y, f, k, _ = {}) {
1677
+ if (ne(k))
1666
1678
  return;
1667
- const I = L(y, _), x = I ? i : r;
1668
- if (x.has(S))
1679
+ const E = T(y, _), S = E ? i : r;
1680
+ if (S.has(k))
1669
1681
  return;
1670
- let $ = !1;
1671
- const T = re++, q = d(), D = f(), { pathId: N } = Ee(S), H = Y(N);
1672
- F(H, void 0, I);
1673
- const B = D.parse(N), ie = B.dir, Qe = B.base, ue = B.ext.toLowerCase();
1674
- let te, he;
1675
- const xe = o.target === "lib" ? "lib" : o.buildMode === "development" ? m?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
1676
- if (xe !== "lib" && (h = h.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (oe, me) => ($ = !0, o.experimental?.[me] ? "true" : "false"))), ue in kr || un.test(N)) {
1677
- const oe = o.target === "client" || o.target === "ssr";
1678
- U(
1679
- `transform(${T})`,
1680
- `Transforming ${S} (for: ${I ? "server" : "client"}${oe ? ", strip" : ""})`
1682
+ let L = !1;
1683
+ const P = mn++, M = d(), N = p(), { pathId: D } = me(k), F = Q(D);
1684
+ q(F, void 0, E);
1685
+ const U = N.parse(D), re = U.dir, Ge = U.base, ue = U.ext.toLowerCase();
1686
+ let ee, fe;
1687
+ const be = o.target === "lib" ? "lib" : o.buildMode === "development" ? x?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
1688
+ if (be !== "lib" && (f = f.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (te, ge) => (L = !0, o.experimental?.[ge] ? "true" : "false"))), ue in qt || ct.test(D)) {
1689
+ const te = o.target === "client" || o.target === "ssr";
1690
+ O(
1691
+ `transform(${P})`,
1692
+ `Transforming ${k} (for: ${E ? "server" : "client"}${te ? ", strip" : ""})`
1681
1693
  );
1682
- let me = Qe;
1683
- o.srcDir && (me = D.relative(o.srcDir, N)), me = Y(me);
1684
- const Se = o.srcDir ? o.srcDir : Y(ie), vt = o.entryStrategy;
1685
- let se;
1686
- const wt = y.environment?.moduleGraph ?? m?.moduleGraph;
1687
- if (wt && (se = wt.getModuleById(N)?.url, !se && o.rootDir)) {
1688
- const z = Y(o.rootDir), V = Y(N);
1689
- V.startsWith(z) && (se = V.slice(z.length), se.startsWith("/") || (se = "/" + se));
1694
+ let ge = Ge;
1695
+ o.srcDir && (ge = N.relative(o.srcDir, D)), ge = Q(ge);
1696
+ const xe = o.srcDir ? o.srcDir : Q(re), vt = o.entryStrategy;
1697
+ let ie;
1698
+ const wt = y.environment?.moduleGraph ?? x?.moduleGraph;
1699
+ if (wt && (ie = wt.getModuleById(D)?.url, !ie && o.rootDir)) {
1700
+ const B = Q(o.rootDir), Z = Q(D);
1701
+ Z.startsWith(B) && (ie = Z.slice(B.length), ie.startsWith("/") || (ie = "/" + ie));
1690
1702
  }
1691
- const fe = {
1692
- input: [{ code: h, path: me, devPath: se }],
1693
- entryStrategy: I ? { type: "hoist" } : vt,
1703
+ const he = {
1704
+ input: [{ code: f, path: ge, devPath: ie }],
1705
+ entryStrategy: E ? { type: "hoist" } : vt,
1694
1706
  minify: "simplify",
1695
1707
  // Always enable sourcemaps in dev for click-to-source
1696
1708
  sourceMaps: o.sourcemap || o.buildMode === "development",
@@ -1698,102 +1710,106 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
1698
1710
  transpileJsx: !0,
1699
1711
  explicitExtensions: !0,
1700
1712
  preserveFilenames: !0,
1701
- srcDir: Se,
1713
+ srcDir: xe,
1702
1714
  rootDir: o.rootDir,
1703
- mode: xe,
1715
+ mode: be,
1704
1716
  scope: o.scope || void 0,
1705
- isServer: I
1717
+ isServer: E
1706
1718
  };
1707
- oe && (I ? (fe.stripCtxName = xr, fe.stripEventHandlers = !0, fe.regCtxName = br) : (fe.stripCtxName = jt, fe.stripExports = Mt));
1708
- const Sn = Date.now(), pe = await q.transformModules(fe);
1709
- if (U(`transform(${T})`, `done in ${Date.now() - Sn}ms`), se) {
1710
- const z = vr(se);
1711
- for (const V of pe.modules)
1712
- V.code = an(
1713
- V.code,
1714
- z
1719
+ te && (E ? (he.stripCtxName = Er, he.stripEventHandlers = !0, he.regCtxName = kr) : (he.stripCtxName = $t, he.stripExports = Mt));
1720
+ const _n = Date.now(), pe = await M.transformModules(he);
1721
+ if (O(`transform(${P})`, `done in ${Date.now() - _n}ms`), ie) {
1722
+ const B = br(ie);
1723
+ for (const Z of pe.modules)
1724
+ Z.code = ln(
1725
+ Z.code,
1726
+ B
1715
1727
  );
1716
1728
  }
1717
- const Ke = pe.modules.find((z) => !$t(z));
1718
- if (P(I))
1719
- await G(y, pe, Se, H);
1720
- else if (O(I) && _t(h)) {
1721
- const z = {
1722
- ...fe,
1729
+ const Se = pe.modules.find((B) => !jt(B));
1730
+ if (z(E))
1731
+ await Y(y, pe, xe, F);
1732
+ else if (j(E) && _t(f)) {
1733
+ const B = {
1734
+ ...he,
1723
1735
  entryStrategy: vt,
1724
1736
  isServer: !1
1725
1737
  };
1726
- oe && (z.stripCtxName = jt, z.stripExports = Mt, z.stripEventHandlers = void 0, z.regCtxName = void 0), await G(
1738
+ te && (B.stripCtxName = $t, B.stripExports = Mt, B.stripEventHandlers = void 0, B.regCtxName = void 0), await Y(
1727
1739
  y,
1728
- await q.transformModules(z),
1729
- Se,
1730
- H,
1740
+ await M.transformModules(B),
1741
+ xe,
1742
+ F,
1731
1743
  !0
1732
1744
  );
1733
1745
  }
1734
- u(pe.diagnostics, q, Se), I ? pe.diagnostics.length === 0 && c && c.lint(y, h, S) : n.set(S, pe);
1735
- const yt = /* @__PURE__ */ new Set();
1736
- for (const z of pe.modules)
1737
- if (z !== Ke) {
1738
- const V = Y(D.join(Se, z.path));
1739
- if (U(`transform(${T})`, `segment ${V}`, z.segment.displayName), s.set(V, S), x.set(V, [z, S]), yt.add(V), m) {
1740
- const Je = m.moduleGraph.getModuleById(V);
1741
- Je && m.moduleGraph.invalidateModule(Je);
1746
+ h(pe.diagnostics, M, xe);
1747
+ let yt = [];
1748
+ E && te && (yt = await W(y, Se.imports ?? [], k)), E ? pe.diagnostics.length === 0 && c && c.lint(y, f, k) : n.set(k, pe);
1749
+ const tt = /* @__PURE__ */ new Set();
1750
+ for (const B of pe.modules)
1751
+ if (B !== Se) {
1752
+ const Z = Q(N.join(xe, B.path));
1753
+ if (O(`transform(${P})`, `segment ${Z}`, B.segment.displayName), s.set(Z, k), S.set(Z, [B, k]), tt.add(Z), x) {
1754
+ const Qe = x.moduleGraph.getModuleById(Z);
1755
+ Qe && x.moduleGraph.invalidateModule(Qe);
1742
1756
  }
1743
- if (o.target === "client" && !m && y.emitFile({
1744
- id: V,
1757
+ if (o.target === "client" && !x && y.emitFile({
1758
+ id: Z,
1745
1759
  type: "chunk",
1746
1760
  preserveSignature: "allow-extension"
1747
- }), z.segment && l.size > 0)
1748
- for (const Je of l)
1749
- Je(S, z.segment);
1761
+ }), B.segment && l.size > 0)
1762
+ for (const Qe of l)
1763
+ Qe(k, B.segment);
1750
1764
  }
1751
- y.addWatchFile(S), h = Ke.code, te = Ke.map, he = {
1752
- segment: Ke.segment,
1753
- qwikdeps: Array.from(yt)
1754
- }, $ = !0;
1755
- }
1756
- if (h.includes(`globalThis.${Xe}`)) {
1757
- ne === void 0 && (ne = await vn(I));
1758
- const oe = new ft(h);
1759
- oe.replace(`!globalThis.${Xe}`, "false"), ne && oe.replace(`globalThis.${Xe}`, ne), h = oe.toString(), te ||= oe.generateMap({ source: S, includeContent: !1 }), $ = !0, U(`transform(${T})`, `Replaced globalThis.${Xe} with manifest input`);
1760
- }
1761
- if ($)
1762
- return Er(S) && (te = null), { code: h, map: te, meta: he };
1763
- U(`transform(${T})`, "Not transforming", S);
1765
+ for (const B of yt)
1766
+ tt.add(B);
1767
+ y.addWatchFile(k), f = Se.code, ee = Se.map, fe = {
1768
+ segment: Se.segment,
1769
+ qwikdeps: Array.from(tt)
1770
+ }, L = !0;
1771
+ }
1772
+ if (f.includes(`globalThis.${Je}`)) {
1773
+ He === void 0 && (He = await xn(E));
1774
+ const te = new ht(f);
1775
+ te.replace(`!globalThis.${Je}`, "false"), He && te.replace(`globalThis.${Je}`, He), f = te.toString(), ee ||= te.generateMap({ source: k, includeContent: !1 }), L = !0, O(`transform(${P})`, `Replaced globalThis.${Je} with manifest input`);
1776
+ }
1777
+ if (L)
1778
+ return _r(k) && (ee = null), { code: f, map: ee, meta: fe };
1779
+ O(`transform(${P})`, "Not transforming", k);
1764
1780
  }, pt = (y) => {
1765
- const h = [], S = {
1766
- addInjection: (_) => h.push(_)
1781
+ const f = [], k = {
1782
+ addInjection: (_) => f.push(_)
1767
1783
  };
1768
- return S.generateManifest = async (_) => {
1769
- const x = d().sys.path, $ = x.resolve(o.rootDir, o.outDir, "build"), T = (N) => x.relative($, x.resolve(o.rootDir, o.outDir, N));
1770
- S.canonPath = T;
1771
- const q = Array.from(n.values()).flatMap((N) => N.modules).map((N) => N.segment).filter((N) => !!N), D = Dn(
1772
- x,
1773
- q,
1774
- h,
1784
+ return k.generateManifest = async (_) => {
1785
+ const S = d().sys.path, L = S.resolve(o.rootDir, o.outDir, "build"), P = (D) => S.relative(L, S.resolve(o.rootDir, o.outDir, D));
1786
+ k.canonPath = P;
1787
+ const M = Array.from(n.values()).flatMap((D) => D.modules).map((D) => D.segment).filter((D) => !!D), N = On(
1788
+ S,
1789
+ M,
1790
+ f,
1775
1791
  y,
1776
1792
  o,
1777
- U,
1778
- T
1793
+ O,
1794
+ P
1779
1795
  );
1780
- _ && Object.assign(D, _);
1781
- for (const N of Object.values(D.symbols))
1782
- N.origin && (N.origin = Y(N.origin));
1783
- for (const N of Object.values(D.bundles))
1784
- N.origins && (N.origins = N.origins.sort());
1785
- return D.manifestHash = En(JSON.stringify(D)), D;
1786
- }, S;
1787
- }, pn = () => o, gt = () => Array.from(r.values()).map((y) => y[0]), U = (...y) => {
1796
+ _ && Object.assign(N, _);
1797
+ for (const D of Object.values(N.symbols))
1798
+ D.origin && (D.origin = Q(D.origin));
1799
+ for (const D of Object.values(N.bundles))
1800
+ D.origins && (D.origins = D.origins.sort());
1801
+ return N.manifestHash = Cn(JSON.stringify(N)), N;
1802
+ }, k;
1803
+ }, wn = () => o, gt = () => Array.from(r.values()).map((y) => y[0]), O = (...y) => {
1788
1804
  o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...y);
1789
- }, gn = (...y) => {
1805
+ }, yn = (...y) => {
1790
1806
  console.log(`[QWIK PLUGIN: ${e}]`, ...y);
1791
- }, mn = (y) => {
1792
- u = y;
1793
- }, Y = (y) => w(y);
1794
- function mt(y, h) {
1795
- const S = o.buildMode === "development";
1796
- return S ? `// @qwik.dev/core/build
1807
+ }, bn = (y) => {
1808
+ h = y;
1809
+ }, Q = (y) => w(y);
1810
+ function mt(y, f) {
1811
+ const k = o.buildMode === "development";
1812
+ return k ? `// @qwik.dev/core/build
1797
1813
  export const isBrowser = /*#__PURE__*/ (() =>
1798
1814
  typeof window !== 'undefined' &&
1799
1815
  typeof HTMLElement !== 'undefined' &&
@@ -1804,64 +1820,64 @@ export const isDev = true;
1804
1820
  ` : `// @qwik.dev/core/build
1805
1821
  export const isServer = ${JSON.stringify(y)};
1806
1822
  export const isBrowser = ${JSON.stringify(!y)};
1807
- export const isDev = ${JSON.stringify(S)};
1823
+ export const isDev = ${JSON.stringify(k)};
1808
1824
  `;
1809
1825
  }
1810
- async function vn(y) {
1826
+ async function xn(y) {
1811
1827
  if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && v) {
1812
- const _ = f();
1813
- let I = o.manifestInputPath || _.resolve(o.clientOutDir, it);
1814
- await v.promises.stat(I).catch(() => !1) || (I = _.resolve(o.rootDir, Ut, it));
1828
+ const _ = p();
1829
+ let E = o.manifestInputPath || _.resolve(o.clientOutDir, rt);
1830
+ await v.promises.stat(E).catch(() => !1) || (E = _.resolve(o.rootDir, Ut, rt));
1815
1831
  try {
1816
- const x = await v.promises.readFile(I, "utf-8");
1817
- o.manifestInput = St(JSON.parse(x)) || null, console.info("Read client manifest from", I);
1818
- } catch (x) {
1832
+ const S = await v.promises.readFile(E, "utf-8");
1833
+ o.manifestInput = St(JSON.parse(S)) || null, console.info("Read client manifest from", E);
1834
+ } catch (S) {
1819
1835
  console.warn(
1820
1836
  `
1821
1837
  ==========
1822
- Could not read Qwik client manifest ${I}.
1838
+ Could not read Qwik client manifest ${E}.
1823
1839
  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__\`.
1824
1840
  Without the manifest, the SSR renderer will not be able to generate event handlers.
1825
- (${x})
1841
+ (${S})
1826
1842
  ==========
1827
1843
  `
1828
1844
  );
1829
1845
  }
1830
1846
  }
1831
- const h = y ? o.manifestInput : null;
1832
- let S = null;
1833
- return h?.manifestHash && (S = {
1834
- manifestHash: h.manifestHash,
1835
- core: h.core,
1836
- preloader: h.preloader,
1837
- qwikLoader: h.qwikLoader,
1838
- bundleGraphAsset: h.bundleGraphAsset,
1839
- injections: h.injections,
1840
- mapping: h.mapping,
1841
- bundleGraph: h.bundleGraph
1842
- }), S && JSON.stringify(S);
1843
- }
1844
- function wn(y) {
1847
+ const f = y ? o.manifestInput : null;
1848
+ let k = null;
1849
+ return f?.manifestHash && (k = {
1850
+ manifestHash: f.manifestHash,
1851
+ core: f.core,
1852
+ preloader: f.preloader,
1853
+ qwikLoader: f.qwikLoader,
1854
+ bundleGraphAsset: f.bundleGraphAsset,
1855
+ injections: f.injections,
1856
+ mapping: f.mapping,
1857
+ bundleGraph: f.bundleGraph
1858
+ }), k && JSON.stringify(k);
1859
+ }
1860
+ function Sn(y) {
1845
1861
  o.sourcemap = y;
1846
1862
  }
1847
- function yn(y, h) {
1848
- const S = y.name === "ssr";
1849
- U("hotUpdate()", h.file, y.name);
1850
- const _ = S ? i : r;
1851
- for (const I of h.modules) {
1852
- const { id: x } = I;
1853
- if (x) {
1854
- U("hotUpdate()", `invalidate ${x}`), n.delete(x);
1855
- for (const [$, [T, q]] of _)
1856
- if (q === x) {
1857
- U("hotUpdate()", `invalidate ${x} segment ${$}`), _.delete($);
1858
- const D = y.moduleGraph.getModuleById($);
1859
- D && y.moduleGraph.invalidateModule(D);
1863
+ function kn(y, f) {
1864
+ const k = y.name === "ssr";
1865
+ O("hotUpdate()", f.file, y.name);
1866
+ const _ = k ? i : r;
1867
+ for (const E of f.modules) {
1868
+ const { id: S } = E;
1869
+ if (S) {
1870
+ O("hotUpdate()", `invalidate ${S}`), n.delete(S);
1871
+ for (const [L, [P, M]] of _)
1872
+ if (M === S) {
1873
+ O("hotUpdate()", `invalidate ${S} segment ${L}`), _.delete(L);
1874
+ const N = y.moduleGraph.getModuleById(L);
1875
+ N && y.moduleGraph.invalidateModule(N);
1860
1876
  }
1861
1877
  }
1862
1878
  }
1863
1879
  }
1864
- const bn = (y, { getModuleInfo: h }) => {
1880
+ const En = (y, { getModuleInfo: f }) => {
1865
1881
  if (o.target === "client") {
1866
1882
  if (
1867
1883
  // The preloader has to stay in a separate chunk if it's a client build
@@ -1876,80 +1892,80 @@ Without the manifest, the SSR renderer will not be able to generate event handle
1876
1892
  if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(y))
1877
1893
  return "qwik-loader";
1878
1894
  }
1879
- const S = h(y);
1880
- if (S) {
1881
- const _ = S.meta.segment;
1895
+ const k = f(y);
1896
+ if (k) {
1897
+ const _ = k.meta.segment;
1882
1898
  if (_) {
1883
1899
  if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(_.ctxName))
1884
1900
  return null;
1885
- const { hash: I } = _, x = o.entryStrategy.manual?.[I] || _.entry;
1886
- if (x)
1887
- return x;
1901
+ const { hash: E } = _, S = o.entryStrategy.manual?.[E] || _.entry;
1902
+ if (S)
1903
+ return S;
1888
1904
  }
1889
1905
  }
1890
1906
  return null;
1891
1907
  };
1892
- async function xn(y, h, S, _) {
1893
- const x = await pt(h).generateManifest(_);
1894
- x.platform = {
1908
+ async function In(y, f, k, _) {
1909
+ const S = await pt(f).generateManifest(_);
1910
+ S.platform = {
1895
1911
  ..._?.platform,
1896
1912
  rollup: y.meta?.rollupVersion || "",
1897
- env: b.sys.env,
1898
- os: b.sys.os
1899
- }, b.sys.env === "node" && (x.platform.node = process.versions.node);
1900
- const $ = On(x, S), T = y.emitFile({
1913
+ env: C.sys.env,
1914
+ os: C.sys.os
1915
+ }, C.sys.env === "node" && (S.platform.node = process.versions.node);
1916
+ const L = qn(S, k), P = y.emitFile({
1901
1917
  type: "asset",
1902
1918
  name: "bundle-graph.json",
1903
- source: JSON.stringify($)
1904
- }), q = y.getFileName(T);
1905
- x.bundleGraphAsset = q, x.assets[q] = {
1919
+ source: JSON.stringify(L)
1920
+ }), M = y.getFileName(P);
1921
+ S.bundleGraphAsset = M, S.assets[M] = {
1906
1922
  name: "bundle-graph.json",
1907
- size: $.length
1923
+ size: L.length
1908
1924
  };
1909
- const D = JSON.stringify(x, null, " ");
1925
+ const N = JSON.stringify(S, null, " ");
1910
1926
  return y.emitFile({
1911
- fileName: it,
1927
+ fileName: rt,
1912
1928
  type: "asset",
1913
- source: D
1914
- }), typeof o.manifestOutput == "function" && await o.manifestOutput(x), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(gt()), x;
1929
+ source: N
1930
+ }), typeof o.manifestOutput == "function" && await o.manifestOutput(S), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(gt()), S;
1915
1931
  }
1916
1932
  return {
1917
- buildStart: E,
1933
+ buildStart: I,
1918
1934
  createOutputAnalyzer: pt,
1919
1935
  getQwikBuildModule: mt,
1920
1936
  getOptimizer: d,
1921
- getOptions: pn,
1922
- getPath: f,
1923
- getSys: g,
1937
+ getOptions: wn,
1938
+ getPath: p,
1939
+ getSys: u,
1924
1940
  getTransformedOutputs: gt,
1925
- init: p,
1926
- load: W,
1927
- debug: U,
1928
- log: gn,
1929
- normalizeOptions: X,
1930
- normalizePath: Y,
1931
- onDiagnostics: mn,
1932
- resolveId: ge,
1941
+ init: g,
1942
+ load: gn,
1943
+ debug: O,
1944
+ log: yn,
1945
+ normalizeOptions: K,
1946
+ normalizePath: Q,
1947
+ onDiagnostics: bn,
1948
+ resolveId: de,
1933
1949
  segmentCallbacks: l,
1934
- transform: Ge,
1935
- validateSource: C,
1936
- setSourceMapSupport: wn,
1950
+ transform: vn,
1951
+ validateSource: b,
1952
+ setSourceMapSupport: Sn,
1937
1953
  configureServer: R,
1938
- hotUpdate: yn,
1939
- manualChunks: bn,
1940
- generateManifest: xn
1954
+ hotUpdate: kn,
1955
+ manualChunks: En,
1956
+ generateManifest: In
1941
1957
  };
1942
1958
  }
1943
- const Sr = (t) => (e) => typeof e == "string" ? Yn(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
1944
- function $t(t) {
1959
+ const Ir = (t) => (e) => typeof e == "string" ? Vn(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
1960
+ function jt(t) {
1945
1961
  return t.isEntry || t.segment;
1946
1962
  }
1947
- const Er = (t) => t.startsWith("virtual:"), kr = {
1963
+ const _r = (t) => t.startsWith("virtual:"), qt = {
1948
1964
  ".jsx": !0,
1949
1965
  ".ts": !0,
1950
1966
  ".tsx": !0
1951
- }, un = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", ye = "@qwik.dev/core/internal", le = "@qwik.dev/core/build", dt = "@qwik.dev/core/jsx-runtime", ut = "@qwik.dev/core/jsx-dev-runtime", Ye = "@qwik.dev/core/server", ae = "@qwik-client-manifest", rt = "@qwik.dev/core/preloader", _e = "@qwik-handlers", Ir = "src", Ut = "dist", _r = "server", Cr = "lib", it = "q-manifest.json", Xe = "__QWIK_MANIFEST__";
1952
- async function Tr(t, e, n) {
1967
+ }, ct = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", ye = "@qwik.dev/core/internal", se = "@qwik.dev/core/build", dt = "@qwik.dev/core/jsx-runtime", ut = "@qwik.dev/core/jsx-dev-runtime", Ke = "@qwik.dev/core/server", oe = "@qwik-client-manifest", nt = "@qwik.dev/core/preloader", Ie = "@qwik-handlers", Cr = "src", Ut = "dist", Tr = "server", Pr = "lib", rt = "q-manifest.json", Je = "__QWIK_MANIFEST__";
1968
+ async function Nr(t, e, n) {
1953
1969
  if (t.env === "browsermain" || t.env === "webworker")
1954
1970
  return;
1955
1971
  const r = await t.dynamicImport("node:fs");
@@ -1966,8 +1982,8 @@ async function Tr(t, e, n) {
1966
1982
  i = l;
1967
1983
  }
1968
1984
  }
1969
- function co(t = {}) {
1970
- const e = dn(t.optimizerOptions);
1985
+ function ho(t = {}) {
1986
+ const e = un(t.optimizerOptions);
1971
1987
  return {
1972
1988
  name: "rollup-plugin-qwik",
1973
1989
  api: {
@@ -2003,43 +2019,43 @@ function co(t = {}) {
2003
2019
  return r.input = l, r;
2004
2020
  },
2005
2021
  outputOptions(r) {
2006
- return ht(e, r, !1);
2022
+ return ft(
2023
+ e,
2024
+ r,
2025
+ e.getOptions().outDir
2026
+ );
2007
2027
  },
2008
2028
  async buildStart() {
2009
2029
  e.onDiagnostics((r, i, s) => {
2010
2030
  r.forEach((l) => {
2011
2031
  const a = e.normalizePath(i.sys.path.join(s, l.file));
2012
- l.category === "error" ? this.error(tt(a, l)) : this.warn(tt(a, l));
2032
+ l.category === "error" ? this.error(Ve(a, l)) : this.warn(Ve(a, l));
2013
2033
  });
2014
2034
  }), await e.buildStart(this);
2015
2035
  },
2016
2036
  resolveId(r, i) {
2017
- return ce(r) ? null : e.resolveId(this, r, i);
2037
+ return ne(r) ? null : e.resolveId(this, r, i);
2018
2038
  },
2019
2039
  load(r) {
2020
- return ce(r) ? null : e.load(this, r);
2040
+ return ne(r) ? null : e.load(this, r);
2021
2041
  },
2022
2042
  transform(r, i) {
2023
- return ce(i) ? null : e.transform(this, r, i);
2043
+ return ne(i) ? null : e.transform(this, r, i);
2024
2044
  },
2025
2045
  async generateBundle(r, i) {
2026
2046
  e.getOptions().target === "client" && await e.generateManifest(this, i);
2027
2047
  }
2028
2048
  };
2029
2049
  }
2030
- async function Pr(t, e, n, r) {
2050
+ async function Dr(t, e) {
2031
2051
  return Array.isArray(e) ? (e.length || e.push({}), await Promise.all(
2032
- e.map(async (i) => ({
2033
- ...await ht(t, i, n),
2034
- dir: r || i.dir
2035
- }))
2036
- )) : {
2037
- ...await ht(t, e, n),
2038
- dir: r || e?.dir
2039
- };
2052
+ e.map(
2053
+ (n) => ft(t, n)
2054
+ )
2055
+ )) : ft(t, e);
2040
2056
  }
2041
- const Dr = (t) => t ? `${t.replace(/\/+$/, "")}/` : "", Nr = (t) => `${Dr(t)}build/`, Rr = (t, e, n) => {
2042
- const r = Nr(t);
2057
+ const Rr = (t) => "", Lr = (t) => `${Rr()}build/`, Or = (t, e, n) => {
2058
+ const r = Lr();
2043
2059
  return e.buildMode === "production" && !e.debug ? `${r}q-[hash].js` : (i) => {
2044
2060
  if (i.moduleIds?.some((a) => /core\.(prod|min)\.mjs$/.test(a)))
2045
2061
  return `${r}core.js`;
@@ -2049,31 +2065,31 @@ const Dr = (t) => t ? `${t.replace(/\/+$/, "")}/` : "", Nr = (t) => `${Dr(t)}bui
2049
2065
  return `${r}${l}.js`;
2050
2066
  };
2051
2067
  };
2052
- async function ht(t, e, n) {
2068
+ async function ft(t, e, n) {
2053
2069
  const r = { ...e }, i = t.getOptions(), s = t.getOptimizer(), l = t.manualChunks;
2054
- r.assetFileNames || (r.assetFileNames = `${n ? `${i.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
2055
- const a = Rr(n ? `${i.assetsDir}` : "", i, s);
2070
+ r.assetFileNames || (r.assetFileNames = "assets/[hash]-[name].[ext]");
2071
+ const a = Or("", i, s);
2056
2072
  if (i.target === "client") {
2057
2073
  r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
2058
- const u = r.manualChunks;
2059
- if (u && typeof u != "function")
2074
+ const h = r.manualChunks;
2075
+ if (h && typeof h != "function")
2060
2076
  throw new Error("manualChunks must be a function");
2061
- r.manualChunks = u ? (o, w) => u(o, w) || l(o, w) : l;
2077
+ r.manualChunks = h ? (o, w) => h(o, w) || l(o, w) : l;
2062
2078
  } else
2063
2079
  r.chunkFileNames || (r.chunkFileNames = a);
2064
- r.dir || (r.dir = i.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
2065
- const c = await Tr(s.sys, "rollup", s.sys.cwd());
2080
+ !r.dir && n && (r.dir = n), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
2081
+ const c = await Nr(s.sys, "rollup", s.sys.cwd());
2066
2082
  if (c)
2067
2083
  try {
2068
- const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o), v = String(w?.version || ""), [p, d, g] = v.split(".").map((m) => parseInt(m, 10));
2069
- Number.isFinite(p) && (p > 4 || p === 4 && (d > 52 || d === 52 && (g || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
2084
+ const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o), v = String(w?.version || ""), [g, d, u] = v.split(".").map((x) => parseInt(x, 10));
2085
+ Number.isFinite(g) && (g > 4 || g === 4 && (d > 52 || d === 52 && (u || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
2070
2086
  `⚠️ 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.`
2071
2087
  );
2072
2088
  } catch {
2073
2089
  }
2074
2090
  return r;
2075
2091
  }
2076
- function tt(t, e) {
2092
+ function Ve(t, e) {
2077
2093
  const n = e.highlights?.[0];
2078
2094
  return Object.assign(new Error(e.message), {
2079
2095
  id: t,
@@ -2085,7 +2101,7 @@ function tt(t, e) {
2085
2101
  stack: ""
2086
2102
  });
2087
2103
  }
2088
- const Lr = `"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'"))`, Or = '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}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{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)}', Mr = `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)})}`, jr = '[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}', $r = '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)}', Ur = `<style>
2104
+ const Mr = `"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'"))`, $r = '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}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{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)}', jr = `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)})}`, qr = '[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}', Ur = '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)}', Br = `<style>
2089
2105
  :host {
2090
2106
  position: absolute;
2091
2107
  border: 1px solid red;
@@ -2249,32 +2265,32 @@ const Lr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
2249
2265
  <p class="action-container"></p>
2250
2266
  </div>
2251
2267
  </dialog>
2252
- `, qr = `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}`, Br = "#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}}";
2253
- async function Fr(t, e, n, r) {
2268
+ `, Fr = `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}`, Ar = "#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}}";
2269
+ async function zr(t, e, n, r) {
2254
2270
  const i = await n.dynamicImport("node:fs"), s = await n.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
2255
2271
  (c) => r.join(e, `entry.preview.${c}`)
2256
2272
  ).find((c) => i.existsSync(c));
2257
2273
  if (!a)
2258
- return ot(
2274
+ return it(
2259
2275
  t,
2260
2276
  `Unable to find output "${e}/entry.preview" module.
2261
2277
 
2262
2278
  Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
2263
2279
  );
2264
2280
  try {
2265
- const c = s.pathToFileURL(a).href, u = await n.strictDynamicImport(c);
2281
+ const c = s.pathToFileURL(a).href, h = await n.strictDynamicImport(c);
2266
2282
  let o = null;
2267
- if (u.default && (typeof u.default == "function" ? o = u.default : typeof u.default == "object" && (o = u.default.router)), typeof o != "function")
2268
- return ot(
2283
+ if (h.default && (typeof h.default == "function" ? o = h.default : typeof h.default == "object" && (o = h.default.router)), typeof o != "function")
2284
+ return it(
2269
2285
  t,
2270
2286
  `Entry preview module "${a}" does not export a default middleware function`
2271
2287
  );
2272
2288
  t.use(o);
2273
2289
  } catch (c) {
2274
- return ot(t, String(c));
2290
+ return it(t, String(c));
2275
2291
  }
2276
2292
  }
2277
- function ot(t, e) {
2293
+ function it(t, e) {
2278
2294
  console.log(`
2279
2295
  ❌ ${e}
2280
2296
  `), t.use((n, r) => {
@@ -2283,25 +2299,25 @@ function ot(t, e) {
2283
2299
  }), r.end(e);
2284
2300
  });
2285
2301
  }
2286
- const Ar = (t, e) => {
2302
+ const Wr = (t, e) => {
2287
2303
  const n = [
2288
- { tag: "style", children: qr, injectTo: "body" },
2289
- { tag: "style", children: Br, injectTo: "body" },
2290
- { tag: "script", attrs: { type: "module" }, children: Mr, injectTo: "body" },
2291
- { tag: "script", attrs: { type: "module" }, children: Lr, injectTo: "body" }
2304
+ { tag: "style", children: Fr, injectTo: "body" },
2305
+ { tag: "style", children: Ar, injectTo: "body" },
2306
+ { tag: "script", attrs: { type: "module" }, children: jr, injectTo: "body" },
2307
+ { tag: "script", attrs: { type: "module" }, children: Mr, injectTo: "body" }
2292
2308
  ];
2293
2309
  if ((t.devTools?.imageDevTools ?? !0) && n.push(
2294
2310
  {
2295
2311
  tag: "style",
2296
- children: jr,
2312
+ children: qr,
2297
2313
  injectTo: "body"
2298
2314
  },
2299
2315
  {
2300
2316
  tag: "script",
2301
2317
  attrs: { type: "module" },
2302
- children: $r.replace(
2318
+ children: Ur.replace(
2303
2319
  "globalThis.__TEMPLATE__",
2304
- JSON.stringify(Ur)
2320
+ JSON.stringify(Br)
2305
2321
  ),
2306
2322
  injectTo: "body"
2307
2323
  }
@@ -2310,39 +2326,39 @@ const Ar = (t, e) => {
2310
2326
  e.endsWith("/") && (e = e.slice(0, -1)), n.push({
2311
2327
  tag: "script",
2312
2328
  attrs: { type: "module" },
2313
- children: Or.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
2329
+ children: $r.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
2314
2330
  injectTo: "body"
2315
2331
  });
2316
2332
  }
2317
2333
  return n;
2318
2334
  };
2319
- function Q(t) {
2335
+ function H(t) {
2320
2336
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2321
2337
  }
2322
- var Ce = {}, st = {}, qt;
2323
- function K() {
2324
- return qt || (qt = 1, (function(t) {
2338
+ var _e = {}, ot = {}, Bt;
2339
+ function G() {
2340
+ return Bt || (Bt = 1, (function(t) {
2325
2341
  Object.defineProperty(t, "__esModule", { value: !0 }), t.findBox = t.readUInt = t.readUInt32LE = t.readUInt32BE = t.readInt32LE = t.readUInt24LE = t.readUInt16LE = t.readUInt16BE = t.readInt16LE = t.toHexString = t.toUTF8String = void 0;
2326
- const e = new TextDecoder(), n = (g, f = 0, m = g.length) => e.decode(g.slice(f, m));
2342
+ const e = new TextDecoder(), n = (u, p = 0, x = u.length) => e.decode(u.slice(p, x));
2327
2343
  t.toUTF8String = n;
2328
- const r = (g, f = 0, m = g.length) => g.slice(f, m).reduce((R, X) => R + ("0" + X.toString(16)).slice(-2), "");
2344
+ const r = (u, p = 0, x = u.length) => u.slice(p, x).reduce((R, K) => R + ("0" + K.toString(16)).slice(-2), "");
2329
2345
  t.toHexString = r;
2330
- const i = (g, f = 0) => {
2331
- const m = g[f] + g[f + 1] * 256;
2332
- return m | (m & 2 ** 15) * 131070;
2346
+ const i = (u, p = 0) => {
2347
+ const x = u[p] + u[p + 1] * 256;
2348
+ return x | (x & 2 ** 15) * 131070;
2333
2349
  };
2334
2350
  t.readInt16LE = i;
2335
- const s = (g, f = 0) => g[f] * 2 ** 8 + g[f + 1];
2351
+ const s = (u, p = 0) => u[p] * 2 ** 8 + u[p + 1];
2336
2352
  t.readUInt16BE = s;
2337
- const l = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8;
2353
+ const l = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8;
2338
2354
  t.readUInt16LE = l;
2339
- const a = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8 + g[f + 2] * 2 ** 16;
2355
+ const a = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16;
2340
2356
  t.readUInt24LE = a;
2341
- const c = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8 + g[f + 2] * 2 ** 16 + (g[f + 3] << 24);
2357
+ const c = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + (u[p + 3] << 24);
2342
2358
  t.readInt32LE = c;
2343
- const u = (g, f = 0) => g[f] * 2 ** 24 + g[f + 1] * 2 ** 16 + g[f + 2] * 2 ** 8 + g[f + 3];
2344
- t.readUInt32BE = u;
2345
- const o = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8 + g[f + 2] * 2 ** 16 + g[f + 3] * 2 ** 24;
2359
+ const h = (u, p = 0) => u[p] * 2 ** 24 + u[p + 1] * 2 ** 16 + u[p + 2] * 2 ** 8 + u[p + 3];
2360
+ t.readUInt32BE = h;
2361
+ const o = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + u[p + 3] * 2 ** 24;
2346
2362
  t.readUInt32LE = o;
2347
2363
  const w = {
2348
2364
  readUInt16BE: t.readUInt16BE,
@@ -2350,56 +2366,56 @@ function K() {
2350
2366
  readUInt32BE: t.readUInt32BE,
2351
2367
  readUInt32LE: t.readUInt32LE
2352
2368
  };
2353
- function v(g, f, m, R) {
2354
- m = m || 0;
2355
- const X = R ? "BE" : "LE", M = "readUInt" + f + X;
2356
- return w[M](g, m);
2369
+ function v(u, p, x, R) {
2370
+ x = x || 0;
2371
+ const K = R ? "BE" : "LE", m = "readUInt" + p + K;
2372
+ return w[m](u, x);
2357
2373
  }
2358
2374
  t.readUInt = v;
2359
- function p(g, f) {
2360
- if (g.length - f < 4)
2375
+ function g(u, p) {
2376
+ if (u.length - p < 4)
2361
2377
  return;
2362
- const m = (0, t.readUInt32BE)(g, f);
2363
- if (!(g.length - f < m))
2378
+ const x = (0, t.readUInt32BE)(u, p);
2379
+ if (!(u.length - p < x))
2364
2380
  return {
2365
- name: (0, t.toUTF8String)(g, 4 + f, 8 + f),
2366
- offset: f,
2367
- size: m
2381
+ name: (0, t.toUTF8String)(u, 4 + p, 8 + p),
2382
+ offset: p,
2383
+ size: x
2368
2384
  };
2369
2385
  }
2370
- function d(g, f, m) {
2371
- for (; m < g.length; ) {
2372
- const R = p(g, m);
2386
+ function d(u, p, x) {
2387
+ for (; x < u.length; ) {
2388
+ const R = g(u, x);
2373
2389
  if (!R)
2374
2390
  break;
2375
- if (R.name === f)
2391
+ if (R.name === p)
2376
2392
  return R;
2377
- m += R.size > 0 ? R.size : 8;
2393
+ x += R.size > 0 ? R.size : 8;
2378
2394
  }
2379
2395
  }
2380
2396
  t.findBox = d;
2381
- })(st)), st;
2382
- }
2383
- var Bt;
2384
- function zr() {
2385
- if (Bt) return Ce;
2386
- Bt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.BMP = void 0;
2387
- const t = K();
2388
- return Ce.BMP = {
2397
+ })(ot)), ot;
2398
+ }
2399
+ var Ft;
2400
+ function Hr() {
2401
+ if (Ft) return _e;
2402
+ Ft = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.BMP = void 0;
2403
+ const t = G();
2404
+ return _e.BMP = {
2389
2405
  validate: (e) => (0, t.toUTF8String)(e, 0, 2) === "BM",
2390
2406
  calculate: (e) => ({
2391
2407
  height: Math.abs((0, t.readInt32LE)(e, 22)),
2392
2408
  width: (0, t.readUInt32LE)(e, 18)
2393
2409
  })
2394
- }, Ce;
2410
+ }, _e;
2395
2411
  }
2396
- var Wr = zr();
2397
- const Hr = /* @__PURE__ */ Q(Wr);
2398
- var Te = {}, Pe = {}, Ft;
2399
- function hn() {
2400
- if (Ft) return Pe;
2401
- Ft = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.ICO = void 0;
2402
- const t = K(), e = 1, n = 6, r = 16;
2412
+ var Gr = Hr();
2413
+ const Qr = /* @__PURE__ */ H(Gr);
2414
+ var Ce = {}, Te = {}, At;
2415
+ function fn() {
2416
+ if (At) return Te;
2417
+ At = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.ICO = void 0;
2418
+ const t = G(), e = 1, n = 6, r = 16;
2403
2419
  function i(l, a) {
2404
2420
  const c = l[a];
2405
2421
  return c === 0 ? 256 : c;
@@ -2411,7 +2427,7 @@ function hn() {
2411
2427
  width: i(l, c)
2412
2428
  };
2413
2429
  }
2414
- return Pe.ICO = {
2430
+ return Te.ICO = {
2415
2431
  validate(l) {
2416
2432
  const a = (0, t.readUInt16LE)(l, 0), c = (0, t.readUInt16LE)(l, 4);
2417
2433
  return a !== 0 || c === 0 ? !1 : (0, t.readUInt16LE)(l, 2) === e;
@@ -2420,52 +2436,52 @@ function hn() {
2420
2436
  const a = (0, t.readUInt16LE)(l, 4), c = s(l, 0);
2421
2437
  if (a === 1)
2422
2438
  return c;
2423
- const u = [c];
2439
+ const h = [c];
2424
2440
  for (let o = 1; o < a; o += 1)
2425
- u.push(s(l, o));
2441
+ h.push(s(l, o));
2426
2442
  return {
2427
2443
  height: c.height,
2428
- images: u,
2444
+ images: h,
2429
2445
  width: c.width
2430
2446
  };
2431
2447
  }
2432
- }, Pe;
2448
+ }, Te;
2433
2449
  }
2434
- var At;
2435
- function Gr() {
2436
- if (At) return Te;
2437
- At = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.CUR = void 0;
2438
- const t = hn(), e = K(), n = 2;
2439
- return Te.CUR = {
2450
+ var zt;
2451
+ function Kr() {
2452
+ if (zt) return Ce;
2453
+ zt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.CUR = void 0;
2454
+ const t = fn(), e = G(), n = 2;
2455
+ return Ce.CUR = {
2440
2456
  validate(r) {
2441
2457
  const i = (0, e.readUInt16LE)(r, 0), s = (0, e.readUInt16LE)(r, 4);
2442
2458
  return i !== 0 || s === 0 ? !1 : (0, e.readUInt16LE)(r, 2) === n;
2443
2459
  },
2444
2460
  calculate: (r) => t.ICO.calculate(r)
2445
- }, Te;
2461
+ }, Ce;
2446
2462
  }
2447
- var Qr = Gr();
2448
- const Kr = /* @__PURE__ */ Q(Qr);
2449
- var De = {}, zt;
2450
- function Jr() {
2451
- if (zt) return De;
2452
- zt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.DDS = void 0;
2453
- const t = K();
2454
- return De.DDS = {
2463
+ var Jr = Kr();
2464
+ const Yr = /* @__PURE__ */ H(Jr);
2465
+ var Pe = {}, Wt;
2466
+ function Xr() {
2467
+ if (Wt) return Pe;
2468
+ Wt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.DDS = void 0;
2469
+ const t = G();
2470
+ return Pe.DDS = {
2455
2471
  validate: (e) => (0, t.readUInt32LE)(e, 0) === 542327876,
2456
2472
  calculate: (e) => ({
2457
2473
  height: (0, t.readUInt32LE)(e, 12),
2458
2474
  width: (0, t.readUInt32LE)(e, 16)
2459
2475
  })
2460
- }, De;
2476
+ }, Pe;
2461
2477
  }
2462
- var Yr = Jr();
2463
- const Xr = /* @__PURE__ */ Q(Yr);
2464
- var Ne = {}, Wt;
2465
- function Zr() {
2466
- if (Wt) return Ne;
2467
- Wt = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.GIF = void 0;
2468
- const t = K(), e = /^GIF8[79]a/;
2478
+ var Zr = Xr();
2479
+ const Vr = /* @__PURE__ */ H(Zr);
2480
+ var Ne = {}, Ht;
2481
+ function ei() {
2482
+ if (Ht) return Ne;
2483
+ Ht = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.GIF = void 0;
2484
+ const t = G(), e = /^GIF8[79]a/;
2469
2485
  return Ne.GIF = {
2470
2486
  validate: (n) => e.test((0, t.toUTF8String)(n, 0, 6)),
2471
2487
  calculate: (n) => ({
@@ -2474,13 +2490,13 @@ function Zr() {
2474
2490
  })
2475
2491
  }, Ne;
2476
2492
  }
2477
- var Vr = Zr();
2478
- const ei = /* @__PURE__ */ Q(Vr);
2479
- var Re = {}, Ht;
2480
- function ti() {
2481
- if (Ht) return Re;
2482
- Ht = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.ICNS = void 0;
2483
- const t = K(), e = 8, n = 4, r = 4, i = {
2493
+ var ti = ei();
2494
+ const ni = /* @__PURE__ */ H(ti);
2495
+ var De = {}, Gt;
2496
+ function ri() {
2497
+ if (Gt) return De;
2498
+ Gt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.ICNS = void 0;
2499
+ const t = G(), e = 8, n = 4, r = 4, i = {
2484
2500
  ICON: 32,
2485
2501
  "ICN#": 32,
2486
2502
  // m => 16 x 16
@@ -2523,60 +2539,60 @@ function ti() {
2523
2539
  ic10: 1024
2524
2540
  };
2525
2541
  function s(a, c) {
2526
- const u = c + r;
2542
+ const h = c + r;
2527
2543
  return [
2528
- (0, t.toUTF8String)(a, c, u),
2529
- (0, t.readUInt32BE)(a, u)
2544
+ (0, t.toUTF8String)(a, c, h),
2545
+ (0, t.readUInt32BE)(a, h)
2530
2546
  ];
2531
2547
  }
2532
2548
  function l(a) {
2533
2549
  const c = i[a];
2534
2550
  return { width: c, height: c, type: a };
2535
2551
  }
2536
- return Re.ICNS = {
2552
+ return De.ICNS = {
2537
2553
  validate: (a) => (0, t.toUTF8String)(a, 0, 4) === "icns",
2538
2554
  calculate(a) {
2539
- const c = a.length, u = (0, t.readUInt32BE)(a, n);
2555
+ const c = a.length, h = (0, t.readUInt32BE)(a, n);
2540
2556
  let o = e, w = s(a, o), v = l(w[0]);
2541
- if (o += w[1], o === u)
2557
+ if (o += w[1], o === h)
2542
2558
  return v;
2543
- const p = {
2559
+ const g = {
2544
2560
  height: v.height,
2545
2561
  images: [v],
2546
2562
  width: v.width
2547
2563
  };
2548
- for (; o < u && o < c; )
2549
- w = s(a, o), v = l(w[0]), o += w[1], p.images.push(v);
2550
- return p;
2564
+ for (; o < h && o < c; )
2565
+ w = s(a, o), v = l(w[0]), o += w[1], g.images.push(v);
2566
+ return g;
2551
2567
  }
2552
- }, Re;
2568
+ }, De;
2553
2569
  }
2554
- var ni = ti();
2555
- const ri = /* @__PURE__ */ Q(ni);
2556
- var ii = hn();
2557
- const oi = /* @__PURE__ */ Q(ii);
2558
- var Le = {}, Gt;
2559
- function si() {
2560
- if (Gt) return Le;
2561
- Gt = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.J2C = void 0;
2562
- const t = K();
2563
- return Le.J2C = {
2570
+ var ii = ri();
2571
+ const oi = /* @__PURE__ */ H(ii);
2572
+ var si = fn();
2573
+ const ai = /* @__PURE__ */ H(si);
2574
+ var Re = {}, Qt;
2575
+ function li() {
2576
+ if (Qt) return Re;
2577
+ Qt = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.J2C = void 0;
2578
+ const t = G();
2579
+ return Re.J2C = {
2564
2580
  // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
2565
2581
  validate: (e) => (0, t.readUInt32BE)(e, 0) === 4283432785,
2566
2582
  calculate: (e) => ({
2567
2583
  height: (0, t.readUInt32BE)(e, 12),
2568
2584
  width: (0, t.readUInt32BE)(e, 8)
2569
2585
  })
2570
- }, Le;
2586
+ }, Re;
2571
2587
  }
2572
- var ai = si();
2573
- const li = /* @__PURE__ */ Q(ai);
2574
- var Oe = {}, Qt;
2575
- function ci() {
2576
- if (Qt) return Oe;
2577
- Qt = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.JP2 = void 0;
2578
- const t = K();
2579
- return Oe.JP2 = {
2588
+ var ci = li();
2589
+ const di = /* @__PURE__ */ H(ci);
2590
+ var Le = {}, Kt;
2591
+ function ui() {
2592
+ if (Kt) return Le;
2593
+ Kt = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.JP2 = void 0;
2594
+ const t = G();
2595
+ return Le.JP2 = {
2580
2596
  validate(e) {
2581
2597
  if ((0, t.toUTF8String)(e, 4, 8) !== "jP ")
2582
2598
  return !1;
@@ -2592,77 +2608,77 @@ function ci() {
2592
2608
  };
2593
2609
  throw new TypeError("Unsupported JPEG 2000 format");
2594
2610
  }
2595
- }, Oe;
2611
+ }, Le;
2596
2612
  }
2597
- var di = ci();
2598
- const ui = /* @__PURE__ */ Q(di);
2599
- var Me = {}, Kt;
2600
- function hi() {
2601
- if (Kt) return Me;
2602
- Kt = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.JPG = void 0;
2603
- const t = K(), e = "45786966", n = 2, r = 6, i = 2, s = "4d4d", l = "4949", a = 12, c = 2;
2604
- function u(d) {
2613
+ var fi = ui();
2614
+ const hi = /* @__PURE__ */ H(fi);
2615
+ var Oe = {}, Jt;
2616
+ function pi() {
2617
+ if (Jt) return Oe;
2618
+ Jt = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.JPG = void 0;
2619
+ const t = G(), e = "45786966", n = 2, r = 6, i = 2, s = "4d4d", l = "4949", a = 12, c = 2;
2620
+ function h(d) {
2605
2621
  return (0, t.toHexString)(d, 2, 6) === e;
2606
2622
  }
2607
- function o(d, g) {
2623
+ function o(d, u) {
2608
2624
  return {
2609
- height: (0, t.readUInt16BE)(d, g),
2610
- width: (0, t.readUInt16BE)(d, g + 2)
2625
+ height: (0, t.readUInt16BE)(d, u),
2626
+ width: (0, t.readUInt16BE)(d, u + 2)
2611
2627
  };
2612
2628
  }
2613
- function w(d, g) {
2614
- const m = r + 8, R = (0, t.readUInt)(d, 16, m, g);
2615
- for (let X = 0; X < R; X++) {
2616
- const M = m + c + X * a, C = M + a;
2617
- if (M > d.length)
2629
+ function w(d, u) {
2630
+ const x = r + 8, R = (0, t.readUInt)(d, 16, x, u);
2631
+ for (let K = 0; K < R; K++) {
2632
+ const m = x + c + K * a, b = m + a;
2633
+ if (m > d.length)
2618
2634
  return;
2619
- const b = d.slice(M, C);
2620
- if ((0, t.readUInt)(b, 16, 0, g) === 274)
2621
- return (0, t.readUInt)(b, 16, 2, g) !== 3 || (0, t.readUInt)(b, 32, 4, g) !== 1 ? void 0 : (0, t.readUInt)(b, 16, 8, g);
2635
+ const C = d.slice(m, b);
2636
+ if ((0, t.readUInt)(C, 16, 0, u) === 274)
2637
+ return (0, t.readUInt)(C, 16, 2, u) !== 3 || (0, t.readUInt)(C, 32, 4, u) !== 1 ? void 0 : (0, t.readUInt)(C, 16, 8, u);
2622
2638
  }
2623
2639
  }
2624
- function v(d, g) {
2625
- const f = d.slice(n, g), m = (0, t.toHexString)(f, r, r + i), R = m === s;
2626
- if (R || m === l)
2627
- return w(f, R);
2640
+ function v(d, u) {
2641
+ const p = d.slice(n, u), x = (0, t.toHexString)(p, r, r + i), R = x === s;
2642
+ if (R || x === l)
2643
+ return w(p, R);
2628
2644
  }
2629
- function p(d, g) {
2630
- if (g > d.length)
2645
+ function g(d, u) {
2646
+ if (u > d.length)
2631
2647
  throw new TypeError("Corrupt JPG, exceeded buffer limits");
2632
2648
  }
2633
- return Me.JPG = {
2649
+ return Oe.JPG = {
2634
2650
  validate: (d) => (0, t.toHexString)(d, 0, 2) === "ffd8",
2635
2651
  calculate(d) {
2636
2652
  d = d.slice(4);
2637
- let g, f;
2653
+ let u, p;
2638
2654
  for (; d.length; ) {
2639
- const m = (0, t.readUInt16BE)(d, 0);
2640
- if (d[m] !== 255) {
2655
+ const x = (0, t.readUInt16BE)(d, 0);
2656
+ if (d[x] !== 255) {
2641
2657
  d = d.slice(1);
2642
2658
  continue;
2643
2659
  }
2644
- if (u(d) && (g = v(d, m)), p(d, m), f = d[m + 1], f === 192 || f === 193 || f === 194) {
2645
- const R = o(d, m + 5);
2646
- return g ? {
2660
+ if (h(d) && (u = v(d, x)), g(d, x), p = d[x + 1], p === 192 || p === 193 || p === 194) {
2661
+ const R = o(d, x + 5);
2662
+ return u ? {
2647
2663
  height: R.height,
2648
- orientation: g,
2664
+ orientation: u,
2649
2665
  width: R.width
2650
2666
  } : R;
2651
2667
  }
2652
- d = d.slice(m + 2);
2668
+ d = d.slice(x + 2);
2653
2669
  }
2654
2670
  throw new TypeError("Invalid JPG, no size found");
2655
2671
  }
2656
- }, Me;
2672
+ }, Oe;
2657
2673
  }
2658
- var fi = hi();
2659
- const pi = /* @__PURE__ */ Q(fi);
2660
- var je = {}, Jt;
2661
- function gi() {
2662
- if (Jt) return je;
2663
- Jt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.KTX = void 0;
2664
- const t = K();
2665
- return je.KTX = {
2674
+ var gi = pi();
2675
+ const mi = /* @__PURE__ */ H(gi);
2676
+ var Me = {}, Yt;
2677
+ function vi() {
2678
+ if (Yt) return Me;
2679
+ Yt = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.KTX = void 0;
2680
+ const t = G();
2681
+ return Me.KTX = {
2666
2682
  validate: (e) => {
2667
2683
  const n = (0, t.toUTF8String)(e, 1, 7);
2668
2684
  return ["KTX 11", "KTX 20"].includes(n);
@@ -2675,15 +2691,15 @@ function gi() {
2675
2691
  type: n
2676
2692
  };
2677
2693
  }
2678
- }, je;
2694
+ }, Me;
2679
2695
  }
2680
- var mi = gi();
2681
- const vi = /* @__PURE__ */ Q(mi);
2682
- var $e = {}, Yt;
2683
- function wi() {
2684
- if (Yt) return $e;
2685
- Yt = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.PNG = void 0;
2686
- const t = K(), e = `PNG\r
2696
+ var wi = vi();
2697
+ const yi = /* @__PURE__ */ H(wi);
2698
+ var $e = {}, Xt;
2699
+ function bi() {
2700
+ if (Xt) return $e;
2701
+ Xt = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.PNG = void 0;
2702
+ const t = G(), e = `PNG\r
2687
2703
  
2688
2704
  `, n = "IHDR", r = "CgBI";
2689
2705
  return $e.PNG = {
@@ -2707,13 +2723,13 @@ function wi() {
2707
2723
  }
2708
2724
  }, $e;
2709
2725
  }
2710
- var yi = wi();
2711
- const bi = /* @__PURE__ */ Q(yi);
2712
- var Ue = {}, Xt;
2713
- function xi() {
2714
- if (Xt) return Ue;
2715
- Xt = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.PNM = void 0;
2716
- const t = K(), e = {
2726
+ var xi = bi();
2727
+ const Si = /* @__PURE__ */ H(xi);
2728
+ var je = {}, Zt;
2729
+ function ki() {
2730
+ if (Zt) return je;
2731
+ Zt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.PNM = void 0;
2732
+ const t = G(), e = {
2717
2733
  P1: "pbm/ascii",
2718
2734
  P2: "pgm/ascii",
2719
2735
  P3: "ppm/ascii",
@@ -2757,21 +2773,21 @@ function xi() {
2757
2773
  throw new TypeError("Invalid PAM");
2758
2774
  }
2759
2775
  };
2760
- return Ue.PNM = {
2776
+ return je.PNM = {
2761
2777
  validate: (r) => (0, t.toUTF8String)(r, 0, 2) in e,
2762
2778
  calculate(r) {
2763
2779
  const i = (0, t.toUTF8String)(r, 0, 2), s = e[i], l = (0, t.toUTF8String)(r, 3).split(/[\r\n]+/);
2764
2780
  return (n[s] || n.default)(l);
2765
2781
  }
2766
- }, Ue;
2782
+ }, je;
2767
2783
  }
2768
- var Si = xi();
2769
- const Ei = /* @__PURE__ */ Q(Si);
2770
- var qe = {}, Zt;
2771
- function ki() {
2772
- if (Zt) return qe;
2773
- Zt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.PSD = void 0;
2774
- const t = K();
2784
+ var Ei = ki();
2785
+ const Ii = /* @__PURE__ */ H(Ei);
2786
+ var qe = {}, Vt;
2787
+ function _i() {
2788
+ if (Vt) return qe;
2789
+ Vt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.PSD = void 0;
2790
+ const t = G();
2775
2791
  return qe.PSD = {
2776
2792
  validate: (e) => (0, t.toUTF8String)(e, 0, 4) === "8BPS",
2777
2793
  calculate: (e) => ({
@@ -2780,13 +2796,13 @@ function ki() {
2780
2796
  })
2781
2797
  }, qe;
2782
2798
  }
2783
- var Ii = ki();
2784
- const _i = /* @__PURE__ */ Q(Ii);
2785
- var Be = {}, Vt;
2786
- function Ci() {
2787
- if (Vt) return Be;
2788
- Vt = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.SVG = void 0;
2789
- const t = K(), e = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, n = {
2799
+ var Ci = _i();
2800
+ const Ti = /* @__PURE__ */ H(Ci);
2801
+ var Ue = {}, en;
2802
+ function Pi() {
2803
+ if (en) return Ue;
2804
+ en = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.SVG = void 0;
2805
+ const t = G(), e = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, n = {
2790
2806
  height: /\sheight=(['"])([^%]+?)\1/,
2791
2807
  root: e,
2792
2808
  viewbox: /\sviewBox=(['"])(.+?)\1/i,
@@ -2815,56 +2831,56 @@ function Ci() {
2815
2831
  };
2816
2832
  }
2817
2833
  function c(w) {
2818
- const v = w.match(n.width), p = w.match(n.height), d = w.match(n.viewbox);
2834
+ const v = w.match(n.width), g = w.match(n.height), d = w.match(n.viewbox);
2819
2835
  return {
2820
- height: p && l(p[2]),
2836
+ height: g && l(g[2]),
2821
2837
  viewbox: d && a(d[2]),
2822
2838
  width: v && l(v[2])
2823
2839
  };
2824
2840
  }
2825
- function u(w) {
2841
+ function h(w) {
2826
2842
  return {
2827
2843
  height: w.height,
2828
2844
  width: w.width
2829
2845
  };
2830
2846
  }
2831
2847
  function o(w, v) {
2832
- const p = v.width / v.height;
2848
+ const g = v.width / v.height;
2833
2849
  return w.width ? {
2834
- height: Math.floor(w.width / p),
2850
+ height: Math.floor(w.width / g),
2835
2851
  width: w.width
2836
2852
  } : w.height ? {
2837
2853
  height: w.height,
2838
- width: Math.floor(w.height * p)
2854
+ width: Math.floor(w.height * g)
2839
2855
  } : {
2840
2856
  height: v.height,
2841
2857
  width: v.width
2842
2858
  };
2843
2859
  }
2844
- return Be.SVG = {
2860
+ return Ue.SVG = {
2845
2861
  // Scan only the first kilo-byte to speed up the check on larger files
2846
2862
  validate: (w) => e.test((0, t.toUTF8String)(w, 0, 1e3)),
2847
2863
  calculate(w) {
2848
2864
  const v = (0, t.toUTF8String)(w).match(n.root);
2849
2865
  if (v) {
2850
- const p = c(v[0]);
2851
- if (p.width && p.height)
2852
- return u(p);
2853
- if (p.viewbox)
2854
- return o(p, p.viewbox);
2866
+ const g = c(v[0]);
2867
+ if (g.width && g.height)
2868
+ return h(g);
2869
+ if (g.viewbox)
2870
+ return o(g, g.viewbox);
2855
2871
  }
2856
2872
  throw new TypeError("Invalid SVG");
2857
2873
  }
2858
- }, Be;
2874
+ }, Ue;
2859
2875
  }
2860
- var Ti = Ci();
2861
- const Pi = /* @__PURE__ */ Q(Ti);
2862
- var Fe = {}, en;
2863
- function Di() {
2864
- if (en) return Fe;
2865
- en = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.TGA = void 0;
2866
- const t = K();
2867
- return Fe.TGA = {
2876
+ var Ni = Pi();
2877
+ const Di = /* @__PURE__ */ H(Ni);
2878
+ var Be = {}, tn;
2879
+ function Ri() {
2880
+ if (tn) return Be;
2881
+ tn = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.TGA = void 0;
2882
+ const t = G();
2883
+ return Be.TGA = {
2868
2884
  validate(e) {
2869
2885
  return (0, t.readUInt16LE)(e, 0) === 0 && (0, t.readUInt16LE)(e, 4) === 0;
2870
2886
  },
@@ -2874,15 +2890,15 @@ function Di() {
2874
2890
  width: (0, t.readUInt16LE)(e, 12)
2875
2891
  };
2876
2892
  }
2877
- }, Fe;
2893
+ }, Be;
2878
2894
  }
2879
- var Ni = Di();
2880
- const Ri = /* @__PURE__ */ Q(Ni);
2881
- var Ae = {}, tn;
2882
- function Li() {
2883
- if (tn) return Ae;
2884
- tn = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.WEBP = void 0;
2885
- const t = K();
2895
+ var Li = Ri();
2896
+ const Oi = /* @__PURE__ */ H(Li);
2897
+ var Fe = {}, nn;
2898
+ function Mi() {
2899
+ if (nn) return Fe;
2900
+ nn = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.WEBP = void 0;
2901
+ const t = G();
2886
2902
  function e(i) {
2887
2903
  return {
2888
2904
  height: 1 + (0, t.readUInt24LE)(i, 7),
@@ -2901,7 +2917,7 @@ function Li() {
2901
2917
  width: (0, t.readInt16LE)(i, 6) & 16383
2902
2918
  };
2903
2919
  }
2904
- return Ae.WEBP = {
2920
+ return Fe.WEBP = {
2905
2921
  validate(i) {
2906
2922
  const s = (0, t.toUTF8String)(i, 0, 4) === "RIFF", l = (0, t.toUTF8String)(i, 8, 12) === "WEBP", a = (0, t.toUTF8String)(i, 12, 15) === "VP8";
2907
2923
  return s && l && a;
@@ -2909,8 +2925,8 @@ function Li() {
2909
2925
  calculate(i) {
2910
2926
  const s = (0, t.toUTF8String)(i, 12, 16);
2911
2927
  if (i = i.slice(20, 30), s === "VP8X") {
2912
- const a = i[0], c = (a & 192) === 0, u = (a & 1) === 0;
2913
- if (c && u)
2928
+ const a = i[0], c = (a & 192) === 0, h = (a & 1) === 0;
2929
+ if (c && h)
2914
2930
  return e(i);
2915
2931
  throw new TypeError("Invalid WebP");
2916
2932
  }
@@ -2921,15 +2937,15 @@ function Li() {
2921
2937
  return n(i);
2922
2938
  throw new TypeError("Invalid WebP");
2923
2939
  }
2924
- }, Ae;
2940
+ }, Fe;
2925
2941
  }
2926
- var Oi = Li();
2927
- const Mi = /* @__PURE__ */ Q(Oi);
2928
- var ze = {}, nn;
2929
- function ji() {
2930
- if (nn) return ze;
2931
- nn = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.HEIF = void 0;
2932
- const t = K(), e = {
2942
+ var $i = Mi();
2943
+ const ji = /* @__PURE__ */ H($i);
2944
+ var Ae = {}, rn;
2945
+ function qi() {
2946
+ if (rn) return Ae;
2947
+ rn = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.HEIF = void 0;
2948
+ const t = G(), e = {
2933
2949
  avif: "avif",
2934
2950
  mif1: "heif",
2935
2951
  msf1: "heif",
@@ -2941,7 +2957,7 @@ function ji() {
2941
2957
  hevx: "heic"
2942
2958
  // heic-sequence
2943
2959
  };
2944
- return ze.HEIF = {
2960
+ return Ae.HEIF = {
2945
2961
  validate(n) {
2946
2962
  if ((0, t.toUTF8String)(n, 4, 8) !== "ftyp")
2947
2963
  return !1;
@@ -2958,10 +2974,25 @@ function ji() {
2958
2974
  };
2959
2975
  throw new TypeError("Invalid HEIF, no size found");
2960
2976
  }
2961
- }, ze;
2977
+ }, Ae;
2978
+ }
2979
+ var Ui = qi();
2980
+ const Bi = /* @__PURE__ */ H(Ui);
2981
+ async function Fi(t, e) {
2982
+ const n = e;
2983
+ let r = n.loc;
2984
+ if (!n.frame && !n.plugin && (r || (r = Yn(n)), r && (n.loc = r, r.file))) {
2985
+ const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
2986
+ n.id = s(n.loc.file);
2987
+ try {
2988
+ const l = i.readFileSync(n.loc.file, "utf-8");
2989
+ n.frame = Zn(l, n.loc);
2990
+ } catch {
2991
+ }
2992
+ }
2993
+ return e;
2962
2994
  }
2963
- var $i = ji();
2964
- const Ui = /* @__PURE__ */ Q($i), qi = {
2995
+ const Ai = {
2965
2996
  56: "psd",
2966
2997
  66: "bmp",
2967
2998
  68: "dds",
@@ -2970,38 +3001,38 @@ const Ui = /* @__PURE__ */ Q($i), qi = {
2970
3001
  105: "icns",
2971
3002
  137: "png",
2972
3003
  255: "jpg"
2973
- }, nt = {
2974
- webp: Mi.WEBP,
2975
- jpg: pi.JPG,
2976
- png: bi.PNG,
2977
- svg: Pi.SVG,
2978
- gif: ei.GIF,
2979
- avif: Ui.HEIF,
2980
- bmp: Hr.BMP,
2981
- cur: Kr.CUR,
2982
- dds: Xr.DDS,
2983
- icns: ri.ICNS,
2984
- ico: oi.ICO,
2985
- j2c: li.J2C,
2986
- jp2: ui.JP2,
2987
- ktx: vi.KTX,
2988
- pnm: Ei.PNM,
2989
- psd: _i.PSD,
2990
- tga: Ri.TGA
2991
- }, Bi = Object.keys(nt);
2992
- function Fi(t) {
2993
- const e = t[0], n = qi[e];
2994
- return n && nt[n].validate(t) ? n : Bi.find((r) => nt[r].validate(t));
2995
- }
2996
- function Ai(t) {
2997
- const e = Fi(t);
3004
+ }, et = {
3005
+ webp: ji.WEBP,
3006
+ jpg: mi.JPG,
3007
+ png: Si.PNG,
3008
+ svg: Di.SVG,
3009
+ gif: ni.GIF,
3010
+ avif: Bi.HEIF,
3011
+ bmp: Qr.BMP,
3012
+ cur: Yr.CUR,
3013
+ dds: Vr.DDS,
3014
+ icns: oi.ICNS,
3015
+ ico: ai.ICO,
3016
+ j2c: di.J2C,
3017
+ jp2: hi.JP2,
3018
+ ktx: yi.KTX,
3019
+ pnm: Ii.PNM,
3020
+ psd: Ti.PSD,
3021
+ tga: Oi.TGA
3022
+ }, zi = Object.keys(et);
3023
+ function Wi(t) {
3024
+ const e = t[0], n = Ai[e];
3025
+ return n && et[n].validate(t) ? n : zi.find((r) => et[r].validate(t));
3026
+ }
3027
+ function Hi(t) {
3028
+ const e = Wi(t);
2998
3029
  if (typeof e < "u") {
2999
- const n = nt[e].calculate(t);
3030
+ const n = et[e].calculate(t);
3000
3031
  if (n !== void 0)
3001
3032
  return n.type = e, n;
3002
3033
  }
3003
3034
  }
3004
- async function zi(t) {
3035
+ async function Gi(t) {
3005
3036
  if (/^(https?|file|capacitor):/.test(t))
3006
3037
  try {
3007
3038
  const e = await fetch(t, {
@@ -3011,7 +3042,7 @@ async function zi(t) {
3011
3042
  console.error("can not fetch", t);
3012
3043
  return;
3013
3044
  }
3014
- const n = await e.arrayBuffer(), r = Ai(Buffer.from(n));
3045
+ const n = await e.arrayBuffer(), r = Hi(Buffer.from(n));
3015
3046
  if (r)
3016
3047
  return {
3017
3048
  width: r.width,
@@ -3024,7 +3055,7 @@ async function zi(t) {
3024
3055
  return;
3025
3056
  }
3026
3057
  }
3027
- const Wi = (t, e, n) => async (r, i, s) => {
3058
+ const Qi = (t, e, n) => async (r, i, s) => {
3028
3059
  try {
3029
3060
  const l = await t.dynamicImport("node:fs"), a = await t.dynamicImport("node:path");
3030
3061
  let c;
@@ -3035,9 +3066,9 @@ const Wi = (t, e, n) => async (r, i, s) => {
3035
3066
  return;
3036
3067
  }
3037
3068
  if (r.method === "GET" && c.pathname === "/__image_info") {
3038
- const u = c.searchParams.get("url");
3039
- if (i.setHeader("content-type", "application/json"), u) {
3040
- const o = await zi(u);
3069
+ const h = c.searchParams.get("url");
3070
+ if (i.setHeader("content-type", "application/json"), h) {
3071
+ const o = await Gi(h);
3041
3072
  i.setHeader("cache-control", "public, max-age=31536000, immutable"), o ? i.write(JSON.stringify(o)) : i.statusCode = 404;
3042
3073
  } else {
3043
3074
  i.statusCode = 500;
@@ -3047,118 +3078,118 @@ const Wi = (t, e, n) => async (r, i, s) => {
3047
3078
  i.end();
3048
3079
  return;
3049
3080
  } else if (r.method === "POST" && c.pathname === "/__image_fix") {
3050
- const u = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"), v = c.searchParams.get("src"), p = c.searchParams.get("currentHref"), d = u.split(":"), g = parseInt(d[d.length - 1], 10) - 1;
3051
- let f = parseInt(d[d.length - 2], 10) - 1;
3052
- const m = a.resolve(n, d.slice(0, d.length - 2).join(":")), R = a.extname(m).toLowerCase();
3053
- let M = l.readFileSync(m).toString("utf-8"), C = 0;
3054
- for (; C < M.length; C++)
3055
- if (f === 0) {
3056
- C += g;
3081
+ const h = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"), v = c.searchParams.get("src"), g = c.searchParams.get("currentHref"), d = h.split(":"), u = parseInt(d[d.length - 1], 10) - 1;
3082
+ let p = parseInt(d[d.length - 2], 10) - 1;
3083
+ const x = a.resolve(n, d.slice(0, d.length - 2).join(":")), R = a.extname(x).toLowerCase();
3084
+ let m = l.readFileSync(x).toString("utf-8"), b = 0;
3085
+ for (; b < m.length; b++)
3086
+ if (p === 0) {
3087
+ b += u;
3057
3088
  break;
3058
- } else if (M[C] === `
3089
+ } else if (m[b] === `
3059
3090
  `) {
3060
- f--;
3091
+ p--;
3061
3092
  continue;
3062
3093
  }
3063
- if (M.slice(C, C + 4) !== "<img") {
3094
+ if (m.slice(b, b + 4) !== "<img") {
3064
3095
  console.error(
3065
3096
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
3066
3097
  ), i.statusCode = 500;
3067
3098
  return;
3068
3099
  }
3069
- const b = M.indexOf(">", C) + 1;
3070
- if (b < C) {
3100
+ const C = m.indexOf(">", b) + 1;
3101
+ if (C < b) {
3071
3102
  console.error(
3072
3103
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
3073
3104
  ), i.statusCode = 500;
3074
3105
  return;
3075
3106
  }
3076
- const k = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(R);
3077
- let E = M.slice(C, b);
3078
- if (v && p && k) {
3079
- const L = new URL(v), P = new URL(p);
3080
- if (L.origin === P.origin) {
3081
- const O = a.join(e, "public", L.pathname), F = a.join(e, L.pathname);
3107
+ const $ = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(R);
3108
+ let I = m.slice(b, C);
3109
+ if (v && g && $) {
3110
+ const T = new URL(v), z = new URL(g);
3111
+ if (T.origin === z.origin) {
3112
+ const j = a.join(e, "public", T.pathname), q = a.join(e, T.pathname);
3082
3113
  let A;
3083
- if (l.existsSync(O)) {
3084
- const Z = a.join(n, "media", a.dirname(L.pathname));
3085
- await l.promises.mkdir(Z, { recursive: !0 }), await l.promises.copyFile(
3086
- O,
3087
- a.join(n, "media", L.pathname)
3088
- ), A = "~/media" + L.pathname;
3089
- } else if (l.existsSync(F))
3090
- A = L.pathname.replace("/src/", "~/");
3114
+ if (l.existsSync(j)) {
3115
+ const W = a.join(n, "media", a.dirname(T.pathname));
3116
+ await l.promises.mkdir(W, { recursive: !0 }), await l.promises.copyFile(
3117
+ j,
3118
+ a.join(n, "media", T.pathname)
3119
+ ), A = "~/media" + T.pathname;
3120
+ } else if (l.existsSync(q))
3121
+ A = T.pathname.replace("/src/", "~/");
3091
3122
  else
3092
3123
  return;
3093
- const j = Hi(L.pathname), J = `${A}?jsx`;
3094
- E = E.replace(/^<img/, `<${j}`), E = E.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), E = E.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), E = E.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
3095
- let G = 0;
3096
- if (R === ".mdx" && M.startsWith("---") && (G = M.indexOf("---", 4) + 3, G === -1))
3124
+ const J = Ki(T.pathname), X = `${A}?jsx`;
3125
+ I = I.replace(/^<img/, `<${J}`), I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
3126
+ let Y = 0;
3127
+ if (R === ".mdx" && m.startsWith("---") && (Y = m.indexOf("---", 4) + 3, Y === -1))
3097
3128
  return;
3098
- const ee = `
3099
- import ${j} from '${J}';`;
3100
- M = `${M.slice(0, G)}${ee}${M.slice(
3101
- G,
3102
- C
3103
- )}${E}${M.slice(b)}`, l.writeFileSync(m, M);
3129
+ const ae = `
3130
+ import ${J} from '${X}';`;
3131
+ m = `${m.slice(0, Y)}${ae}${m.slice(
3132
+ Y,
3133
+ b
3134
+ )}${I}${m.slice(C)}`, l.writeFileSync(x, m);
3104
3135
  return;
3105
3136
  }
3106
3137
  }
3107
- E = E.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${o}"`), E = E.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), E.includes("height=") || (E = E.replace(/<img/, `<img height="${w}"`)), E.includes("width=") || (E = E.replace(/<img/, `<img width="${o}"`)), M = M.slice(0, C) + E + M.slice(b), l.writeFileSync(m, M);
3138
+ I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${o}"`), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), I.includes("height=") || (I = I.replace(/<img/, `<img height="${w}"`)), I.includes("width=") || (I = I.replace(/<img/, `<img width="${o}"`)), m = m.slice(0, b) + I + m.slice(C), l.writeFileSync(x, m);
3108
3139
  } else
3109
3140
  s();
3110
3141
  } catch (l) {
3111
- l instanceof Error && await Gn(t, l), s(l);
3142
+ l instanceof Error && await Fi(t, l), s(l);
3112
3143
  }
3113
3144
  };
3114
- function Hi(t) {
3145
+ function Ki(t) {
3115
3146
  const e = t.lastIndexOf("."), n = t.lastIndexOf("/");
3116
- return t = t.substring(n + 1, e), `Img${Gi(t)}`;
3147
+ return t = t.substring(n + 1, e), `Img${Ji(t)}`;
3117
3148
  }
3118
- function Gi(t) {
3149
+ function Ji(t) {
3119
3150
  return `${t}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (e, n, r) => `${n.toUpperCase() + r}`).replace(new RegExp(/\w/), (e) => e.toUpperCase());
3120
3151
  }
3121
- const He = "@qwik-worker-core", Qi = `
3152
+ const We = "@qwik-worker-core", Yi = `
3122
3153
  export { setPlatform } from '@qwik.dev/core';
3123
3154
  export { _deserialize } from '@qwik.dev/core/internal';
3124
- `, Ki = (t) => t.endsWith(He), Ji = () => ({
3155
+ `, Xi = (t) => t.endsWith(We), Zi = () => ({
3125
3156
  moduleSideEffects: !1,
3126
- code: Qi
3127
- }), Yi = (t) => {
3157
+ code: Yi
3158
+ }), Vi = (t) => {
3128
3159
  t.emitFile({
3129
- id: He,
3160
+ id: We,
3130
3161
  name: "qwik-worker-core",
3131
3162
  type: "chunk",
3132
3163
  preserveSignature: "allow-extension"
3133
3164
  });
3134
- }, Xi = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
3165
+ }, eo = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
3135
3166
  ...t,
3136
3167
  format: "es",
3137
- plugins: to(t?.plugins)
3138
- }, Zi = (t) => {
3168
+ plugins: io(t?.plugins)
3169
+ }, to = (t) => {
3139
3170
  const e = Object.values(t).find(
3140
- (r) => r.type === "chunk" && r.facadeModuleId === He
3141
- ), n = e ? ln(e.fileName) : void 0;
3142
- fn(
3171
+ (r) => r.type === "chunk" && r.facadeModuleId === We
3172
+ ), n = e ? cn(e.fileName) : void 0;
3173
+ hn(
3143
3174
  t,
3144
3175
  (r) => n?.(r)
3145
3176
  );
3146
- }, Vi = (t, e) => {
3147
- const n = no(e), r = n ? ln(n) : void 0;
3148
- fn(
3177
+ }, no = (t, e) => {
3178
+ const n = oo(e), r = n ? cn(n) : void 0;
3179
+ hn(
3149
3180
  t,
3150
3181
  (i) => r?.(i)
3151
3182
  );
3152
- }, eo = () => ({
3183
+ }, ro = () => ({
3153
3184
  name: "vite-plugin-qwik-worker-core-external",
3154
3185
  enforce: "pre",
3155
3186
  resolveId(t) {
3156
3187
  return t === we || t === ye ? {
3157
- id: lt,
3188
+ id: at,
3158
3189
  external: !0
3159
3190
  } : null;
3160
3191
  }
3161
- }), to = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], eo()], fn = (t, e) => {
3192
+ }), io = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], ro()], hn = (t, e) => {
3162
3193
  for (const n of Object.values(t))
3163
3194
  n.type === "chunk" ? n.code = Ot(
3164
3195
  n.code,
@@ -3167,7 +3198,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
3167
3198
  n.source,
3168
3199
  () => e(n.fileName)
3169
3200
  ));
3170
- }, no = (t) => {
3201
+ }, oo = (t) => {
3171
3202
  if (!t)
3172
3203
  return;
3173
3204
  const e = Object.keys(t.bundles).find(
@@ -3175,7 +3206,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
3175
3206
  );
3176
3207
  if (e)
3177
3208
  return e === "build" || e.startsWith("build/") || /[/\\]build[/\\]/.test(e) ? e : `build/${e}`;
3178
- }, ro = [
3209
+ }, so = [
3179
3210
  we,
3180
3211
  dt,
3181
3212
  ut,
@@ -3183,7 +3214,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
3183
3214
  "@builder.io/qwik",
3184
3215
  "@builder.io/qwik/jsx-runtime",
3185
3216
  "@builder.io/qwik/jsx-dev-runtime"
3186
- ], io = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], oo = [".woff", ".woff2", ".ttf"], at = "@qwik-hmr-bridge", so = `
3217
+ ], ao = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], lo = [".woff", ".woff2", ".ttf"], st = "@qwik-hmr-bridge", co = `
3187
3218
  // HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
3188
3219
  if (import.meta.hot) {
3189
3220
  let timeout;
@@ -3208,70 +3239,68 @@ export { _deserialize } from '@qwik.dev/core/internal';
3208
3239
  });
3209
3240
  }
3210
3241
  `;
3211
- function uo(t = {}) {
3212
- let e = "serve", n = null, r = null, i = "/", s = null, l, a = null, c = null, u = null, o = "development", w;
3213
- const v = t.client?.outDir;
3214
- let p = null;
3215
- const d = t.fileFilter ? (b, k) => un.test(b) || t.fileFilter(b, k) : () => !0, g = t.disableFontPreload ?? !1, f = [], m = dn(t.optimizerOptions), R = /* @__PURE__ */ new Set();
3242
+ function po(t = {}) {
3243
+ let e = "serve", n = null, r = "/", i = null, s = null, l = null, a = null, c = "development", h;
3244
+ const o = t.client?.outDir;
3245
+ let w = null;
3246
+ const v = t.fileFilter ? (m, b) => ct.test(m) || t.fileFilter(m, b) : () => !0, g = t.disableFontPreload ?? !1, d = [], u = un(t.optimizerOptions), p = /* @__PURE__ */ new Set();
3216
3247
  return [{
3217
3248
  name: "vite-plugin-qwik",
3218
3249
  enforce: "pre",
3219
3250
  api: {
3220
- getOptimizer: () => m.getOptimizer(),
3221
- getOptions: () => m.getOptions(),
3222
- getManifest: () => n,
3223
- getRootDir: () => m.getOptions().rootDir,
3224
- getClientOutDir: () => r,
3225
- getClientPublicOutDir: () => s,
3226
- getAssetsDir: () => l,
3227
- registerBundleGraphAdder: (b) => R.add(b),
3228
- onSegment: (b) => {
3229
- m.segmentCallbacks.add(b);
3251
+ getOptimizer: () => u.getOptimizer(),
3252
+ getOptions: () => u.getOptions(),
3253
+ getManifest: () => u.getOptions().manifestInput,
3254
+ getRootDir: () => u.getOptions().rootDir,
3255
+ getClientOutDir: () => n,
3256
+ getClientPublicOutDir: () => i,
3257
+ registerBundleGraphAdder: (m) => p.add(m),
3258
+ onSegment: (m) => {
3259
+ u.segmentCallbacks.add(m);
3230
3260
  },
3231
3261
  _oldDevSsrServer: () => t.devSsrServer
3232
3262
  },
3233
- async config(b, k) {
3234
- await m.init();
3235
- let E;
3236
- k.mode === "lib" ? E = "lib" : b.build?.ssr || k.mode === "ssr" ? E = "ssr" : k.mode === "test" || k.mode === "benchmark" ? E = "test" : E = "client", e = k.command, k.mode === "production" ? o = "production" : k.mode === "development" ? o = "development" : e === "build" && E === "client" ? o = "production" : o = "development", m.debug(`vite config(), command: ${e}, env.mode: ${k.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : E === "ssr" ? t.entryStrategy = { type: "hoist" } : E === "lib" && (t.entryStrategy = { type: "inline" });
3237
- const L = E === "ssr" ? typeof b.build?.ssr == "string" ? b.build.ssr : t.ssr?.input : void 0, P = E === "client" ? t.client?.input : void 0;
3238
- let O = b.build?.rollupOptions?.input || P || L;
3239
- O && typeof O == "string" && (O = [O]), l = b.build?.assetsDir;
3240
- const F = E === "client" && !!l && l !== "_astro", A = {
3241
- target: E,
3242
- buildMode: o,
3263
+ async config(m, b) {
3264
+ await u.init();
3265
+ let C;
3266
+ b.mode === "lib" ? C = "lib" : m.build?.ssr || b.mode === "ssr" ? C = "ssr" : b.mode === "test" || b.mode === "benchmark" ? C = "test" : C = "client", e = b.command, b.mode === "production" ? c = "production" : b.mode === "development" ? c = "development" : e === "build" && C === "client" ? c = "production" : c = "development", u.debug(`vite config(), command: ${e}, env.mode: ${b.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : C === "ssr" ? t.entryStrategy = { type: "hoist" } : C === "lib" && (t.entryStrategy = { type: "inline" });
3267
+ const $ = C === "ssr" ? typeof m.build?.ssr == "string" ? m.build.ssr : t.ssr?.input : void 0, I = C === "client" ? t.client?.input : void 0;
3268
+ let T = m.build?.rollupOptions?.input || I || $;
3269
+ T && typeof T == "string" && (T = [T]);
3270
+ const z = {
3271
+ target: C,
3272
+ buildMode: c,
3243
3273
  csr: t.csr,
3244
3274
  debug: t.debug,
3245
3275
  entryStrategy: t.entryStrategy,
3246
3276
  srcDir: t.srcDir,
3247
- rootDir: b.root,
3277
+ rootDir: m.root,
3248
3278
  tsconfigFileNames: t.tsconfigFileNames,
3249
3279
  resolveQwikBuild: !0,
3250
3280
  transformedModuleOutput: t.transformedModuleOutput,
3251
- outDir: b.build?.outDir,
3252
- ssrOutDir: t.ssr?.outDir || b.build?.outDir,
3253
- clientOutDir: v || // When ssr is true, this is probably an adapter build and not where the client build is
3281
+ outDir: m.build?.outDir,
3282
+ ssrOutDir: t.ssr?.outDir || m.build?.outDir,
3283
+ clientOutDir: o || // When ssr is true, this is probably an adapter build and not where the client build is
3254
3284
  // However, if client.outDir was explicitly set, always use it
3255
- (b.build?.ssr && !v ? void 0 : b.build?.outDir),
3256
- assetsDir: F ? l : void 0,
3285
+ (m.build?.ssr && !o ? void 0 : m.build?.outDir),
3257
3286
  devTools: t.devTools,
3258
- sourcemap: !!b.build?.sourcemap,
3287
+ sourcemap: !!m.build?.sourcemap,
3259
3288
  lint: t.lint,
3260
3289
  experimental: t.experimental,
3261
- input: O,
3290
+ input: T,
3262
3291
  manifestInput: t.ssr?.manifestInput,
3263
3292
  manifestInputPath: t.ssr?.manifestInputPath,
3264
3293
  manifestOutput: t.client?.manifestOutput
3265
- }, j = await m.normalizeOptions(A);
3266
- O ||= j.input, p = A, n = j.manifestInput, a = j.srcDir, c = j.rootDir, t.csr || (r = j.clientOutDir, s = r, u = j.ssrOutDir);
3267
- const J = o === "development", G = "globalThis.qDev", ee = "globalThis.qTest", Z = "globalThis.qInspector", ge = b?.define?.[G] ?? J, be = b?.define?.[Z] ?? J, W = {
3294
+ }, j = await u.normalizeOptions(z);
3295
+ T ||= j.input, w = z, s = j.srcDir, l = j.rootDir, t.csr || (n = j.clientOutDir, i = n, a = j.ssrOutDir);
3296
+ const q = c === "development", A = "globalThis.qDev", J = "globalThis.qTest", X = "globalThis.qInspector", Y = m?.define?.[A] ?? q, ae = m?.define?.[X] ?? q, W = {
3268
3297
  // Duplicated in configEnvironment to support legacy vite build --ssr compatibility
3269
3298
  ssr: {
3270
- noExternal: [we, ye, Ye, le]
3299
+ noExternal: [we, ye, Ke, se]
3271
3300
  },
3272
3301
  envPrefix: ["VITE_", "PUBLIC_"],
3273
3302
  resolve: {
3274
- dedupe: [...ro],
3303
+ dedupe: [...so],
3275
3304
  alias: {
3276
3305
  "@builder.io/qwik": "@qwik.dev/core",
3277
3306
  "@builder.io/qwik/build": "@qwik.dev/core/build",
@@ -3292,15 +3321,15 @@ function uo(t = {}) {
3292
3321
  // this breaks Qwik because it relies a lot on module scoped symbols
3293
3322
  we,
3294
3323
  ye,
3295
- Ye,
3324
+ Ke,
3296
3325
  dt,
3297
3326
  ut,
3298
- le,
3299
- ae,
3327
+ se,
3328
+ oe,
3300
3329
  "@builder.io/qwik"
3301
3330
  ],
3302
3331
  // Enforce scanning our input even when overridden later
3303
- entries: O && (typeof O == "string" ? [O] : typeof O == "object" ? Object.values(O) : O)
3332
+ entries: T && (typeof T == "string" ? [T] : typeof T == "object" ? Object.values(T) : T)
3304
3333
  },
3305
3334
  build: {
3306
3335
  modulePreload: !1,
@@ -3310,101 +3339,99 @@ function uo(t = {}) {
3310
3339
  rollupOptions: {
3311
3340
  external: ["node:async_hooks"],
3312
3341
  // This will amend the existing input
3313
- input: O
3342
+ input: T
3314
3343
  // temporary fix for rolldown-vite types
3315
3344
  }
3316
3345
  },
3317
- worker: Xi(b.worker, E, e),
3346
+ worker: eo(m.worker, C, e),
3318
3347
  define: {
3319
- [G]: ge,
3320
- [Z]: be,
3321
- [ee]: JSON.stringify(process.env.NODE_ENV === "test")
3348
+ [A]: Y,
3349
+ [X]: ae,
3350
+ [J]: JSON.stringify(process.env.NODE_ENV === "test")
3322
3351
  }
3323
3352
  };
3324
3353
  if (!t.csr) {
3325
3354
  W.build.cssCodeSplit = !1, j.outDir && (W.build.outDir = j.outDir);
3326
- const ne = W.build.rollupOptions?.onwarn;
3355
+ const le = W.build.rollupOptions?.onwarn;
3327
3356
  W.build.rollupOptions = {
3328
3357
  ...W.build.rollupOptions,
3329
- output: await Pr(
3330
- m,
3331
- b.build?.rollupOptions?.output,
3332
- F,
3333
- j.outDir
3358
+ output: await Dr(
3359
+ u,
3360
+ m.build?.rollupOptions?.output
3334
3361
  ),
3335
3362
  preserveEntrySignatures: "exports-only",
3336
- onwarn: (re, Ge) => {
3337
- re.plugin === "typescript" && re.message.includes("outputToFilesystem") || (ne ? ne(re, Ge) : Ge(re));
3363
+ onwarn: (V, de) => {
3364
+ V.plugin === "typescript" && V.message.includes("outputToFilesystem") || (le ? le(V, de) : de(V));
3338
3365
  }
3339
- }, j.target === "ssr" ? e === "build" && (W.publicDir = !1, W.build.ssr = !0, b.build?.minify == null && o === "production" && (W.build.minify = !0)) : j.target === "client" || (j.target === "lib" ? (W.build.minify = !1, W.build.rollupOptions.external = [
3366
+ }, j.target === "ssr" ? e === "build" && (W.publicDir = !1, W.build.ssr = !0, m.build?.minify == null && c === "production" && (W.build.minify = !0)) : j.target === "client" || (j.target === "lib" ? (W.build.minify = !1, W.build.rollupOptions.external = [
3340
3367
  we,
3341
3368
  ye,
3342
- Ye,
3369
+ Ke,
3343
3370
  dt,
3344
3371
  ut,
3345
- le,
3346
- ae
3372
+ se,
3373
+ oe
3347
3374
  ]) : W.define = {
3348
- [G]: !0,
3349
- [ee]: !0,
3350
- [Z]: !1
3351
- }), globalThis.qDev = ge, globalThis.qTest = !0, globalThis.qInspector = be;
3375
+ [A]: !0,
3376
+ [J]: !0,
3377
+ [X]: !1
3378
+ }), globalThis.qDev = Y, globalThis.qTest = !0, globalThis.qInspector = ae;
3352
3379
  }
3353
3380
  return W;
3354
3381
  },
3355
- configEnvironment(b, k, E) {
3356
- return b === "ssr" ? {
3382
+ configEnvironment(m, b, C) {
3383
+ return m === "ssr" || m === "ssg" ? {
3357
3384
  resolve: {
3358
- noExternal: [we, ye, Ye, le]
3385
+ noExternal: [we, ye, Ke, se]
3359
3386
  }
3360
- } : o === "production" ? {
3387
+ } : c === "production" ? {
3361
3388
  resolve: {
3362
3389
  conditions: ["min"]
3363
3390
  }
3364
3391
  } : {};
3365
3392
  },
3366
- async configResolved(b) {
3367
- if (i = b.base, !(i.startsWith("/") && i.endsWith("/")))
3393
+ async configResolved(m) {
3394
+ if (r = m.base, !(r.startsWith("/") && r.endsWith("/")))
3368
3395
  throw new Error("vite's config.base must begin and end with /");
3369
- if (b.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && m.setSourceMapSupport(!0), p ? m.normalizeOptions(p) : m.normalizeOptions(t), e === "build" && !t.csr && m.getOptions().target === "client") {
3370
- const E = ["vite:build-import-analysis"], L = b.plugins;
3371
- for (const P of E) {
3372
- const O = L.findIndex((F) => F?.name === P);
3373
- O >= 0 && L.splice(O, 1);
3396
+ if (m.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && u.setSourceMapSupport(!0), w ? u.normalizeOptions(w) : u.normalizeOptions(t), e === "build" && !t.csr && u.getOptions().target === "client") {
3397
+ const C = ["vite:build-import-analysis"], $ = m.plugins;
3398
+ for (const I of C) {
3399
+ const T = $.findIndex((z) => z?.name === I);
3400
+ T >= 0 && $.splice(T, 1);
3374
3401
  }
3375
3402
  }
3376
3403
  },
3377
3404
  async buildStart() {
3378
- f.length = 0;
3379
- const b = this.resolve.bind(this);
3380
- await m.validateSource(b), m.onDiagnostics((k, E, L) => {
3381
- k.forEach((P) => {
3382
- const O = m.normalizePath(E.sys.path.join(L, P.file));
3383
- P.category === "error" ? this.error(tt(O, P)) : this.warn(tt(O, P));
3405
+ d.length = 0;
3406
+ const m = this.resolve.bind(this);
3407
+ await u.validateSource(m), u.onDiagnostics((b, C, $) => {
3408
+ b.forEach((I) => {
3409
+ const T = u.normalizePath(C.sys.path.join($, I.file));
3410
+ I.category === "error" ? this.error(Ve(T, I)) : this.warn(Ve(T, I));
3384
3411
  });
3385
- }), await m.buildStart(this), e === "build" && m.getOptions().target === "client" && Yi(this);
3412
+ }), await u.buildStart(this), e === "build" && u.getOptions().target === "client" && Vi(this);
3386
3413
  },
3387
- resolveId(b, k, E) {
3388
- if (b.endsWith(at))
3389
- return at;
3390
- if (Ki(b))
3391
- return He;
3392
- const L = d(b, "resolveId");
3393
- return ce(b) || !L ? null : m.resolveId(this, b, k, E);
3414
+ resolveId(m, b, C) {
3415
+ if (m.endsWith(st))
3416
+ return st;
3417
+ if (Xi(m))
3418
+ return We;
3419
+ const $ = v(m, "resolveId");
3420
+ return ne(m) || !$ ? null : u.resolveId(this, m, b, C);
3394
3421
  },
3395
- load(b, k) {
3396
- if (b === at)
3397
- return { code: so };
3398
- if (b === He)
3399
- return Ji();
3400
- const E = d(b, "load");
3401
- return ce(b) || !E ? null : (b = m.normalizePath(b), e === "serve" && b.endsWith(ae) ? {
3422
+ load(m, b) {
3423
+ if (m === st)
3424
+ return { code: co };
3425
+ if (m === We)
3426
+ return Zi();
3427
+ const C = v(m, "load");
3428
+ return ne(m) || !C ? null : (m = u.normalizePath(m), e === "serve" && m.endsWith(oe) ? {
3402
3429
  code: "export const manifest = undefined;"
3403
- } : m.load(this, b, k));
3430
+ } : u.load(this, m, b));
3404
3431
  },
3405
- transform(b, k, E) {
3406
- if (k.includes(".vite/deps/") && b.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(b)) {
3407
- const O = c && k.startsWith(c) ? k.slice(c.length) : k;
3432
+ transform(m, b, C) {
3433
+ if (b.includes(".vite/deps/") && m.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(m)) {
3434
+ const T = l && b.startsWith(l) ? b.slice(l.length) : b;
3408
3435
  throw new Error(
3409
3436
  `
3410
3437
 
@@ -3413,158 +3440,158 @@ function uo(t = {}) {
3413
3440
  ⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
3414
3441
 
3415
3442
  👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
3416
- 👉 ${O}
3443
+ 👉 ${T}
3417
3444
 
3418
3445
  ==============
3419
3446
 
3420
3447
  `
3421
3448
  );
3422
3449
  }
3423
- const L = d(k, "transform"), P = k.includes("?raw");
3424
- return ce(k) || !L || P ? null : m.transform(this, b, k, E);
3450
+ const $ = v(b, "transform"), I = b.includes("?raw");
3451
+ return ne(b) || !$ || I ? null : u.transform(this, m, b, C);
3425
3452
  }
3426
3453
  }, {
3427
3454
  name: "vite-plugin-qwik-post",
3428
3455
  enforce: "post",
3429
3456
  generateBundle: {
3430
3457
  order: "post",
3431
- async handler(b, k) {
3432
- const E = this.environment.config.consumer === "client", L = this.environment.config.consumer === "server";
3433
- if (E) {
3434
- const P = m.getOptions();
3435
- for (const [A, j] of Object.entries(k))
3436
- if (j.type === "asset") {
3437
- const J = i + A;
3438
- if (io.some((G) => A.endsWith(G)))
3439
- typeof j.source == "string" && j.source.length < P.inlineStylesUpToBytes ? f.push({
3458
+ async handler(m, b) {
3459
+ const C = this.environment.config.consumer === "client", $ = this.environment.config.consumer === "server";
3460
+ if (C) {
3461
+ const I = u.getOptions();
3462
+ for (const [j, q] of Object.entries(b))
3463
+ if (q.type === "asset") {
3464
+ const A = r + j;
3465
+ if (ao.some((J) => j.endsWith(J)))
3466
+ typeof q.source == "string" && q.source.length < I.inlineStylesUpToBytes ? d.push({
3440
3467
  tag: "style",
3441
3468
  location: "head",
3442
3469
  attributes: {
3443
- "data-src": J,
3444
- dangerouslySetInnerHTML: j.source
3470
+ "data-src": A,
3471
+ dangerouslySetInnerHTML: q.source
3445
3472
  }
3446
- }) : f.push({
3473
+ }) : d.push({
3447
3474
  tag: "link",
3448
3475
  location: "head",
3449
3476
  attributes: {
3450
3477
  rel: "stylesheet",
3451
- href: J
3478
+ href: A
3452
3479
  }
3453
3480
  });
3454
3481
  else {
3455
- const G = oo.find((ee) => A.endsWith(ee));
3456
- G && !g && f.unshift({
3482
+ const J = lo.find((X) => j.endsWith(X));
3483
+ J && !g && d.unshift({
3457
3484
  tag: "link",
3458
3485
  location: "head",
3459
3486
  attributes: {
3460
3487
  rel: "preload",
3461
- href: J,
3488
+ href: A,
3462
3489
  as: "font",
3463
- type: `font/${G.slice(1)}`,
3490
+ type: `font/${J.slice(1)}`,
3464
3491
  crossorigin: ""
3465
3492
  }
3466
3493
  });
3467
3494
  }
3468
3495
  }
3469
- const O = await m.generateManifest(
3496
+ const T = await u.generateManifest(
3470
3497
  this,
3471
- k,
3472
- R,
3498
+ b,
3499
+ p,
3473
3500
  {
3474
- injections: f,
3501
+ injections: d,
3475
3502
  platform: { vite: "" }
3476
3503
  }
3477
- ), F = mr(O, i);
3478
- for (const A of Object.values(k))
3479
- A.type === "chunk" && (A.code = an(A.code, F));
3480
- Zi(k);
3481
- } else L && Vi(k, n);
3504
+ ), z = yr(T, r);
3505
+ for (const j of Object.values(b))
3506
+ j.type === "chunk" && (j.code = ln(j.code, z));
3507
+ to(b);
3508
+ } else $ && no(b, u.getOptions().manifestInput);
3482
3509
  }
3483
3510
  },
3484
- async writeBundle(b, k) {
3485
- const E = m.getOptions();
3511
+ async writeBundle(m, b) {
3512
+ const C = u.getOptions();
3486
3513
  if (this.environment.config.consumer === "server") {
3487
- const P = m.getSys();
3488
- if (P.env === "node" || P.env === "bun" || P.env === "deno") {
3489
- const O = Object.keys(k), F = async (A) => {
3514
+ const I = u.getSys();
3515
+ if (I.env === "node" || I.env === "bun" || I.env === "deno") {
3516
+ const T = Object.keys(b), z = async (j) => {
3490
3517
  try {
3491
- const j = P.path.basename(A), J = P.path.extname(j);
3492
- if ((j.startsWith("entry.") || j.startsWith("entry_")) && !j.includes("preview") && (J === ".mjs" || J === ".cjs")) {
3493
- const ee = P.path.basename(j, J), Z = `${ee}.js`, ge = ee + J;
3494
- if (!O.some((W) => P.path.basename(W) === Z)) {
3495
- const W = P.path.dirname(A), ne = await P.dynamicImport("node:fs"), re = P.path.join(E.outDir, W);
3496
- await ne.promises.mkdir(re, { recursive: !0 }), await ne.promises.writeFile(
3497
- P.path.join(re, Z),
3498
- `export * from "./${ge}";`
3518
+ const q = I.path.basename(j), A = I.path.extname(q);
3519
+ if ((q.startsWith("entry.") || q.startsWith("entry_")) && !q.includes("preview") && (A === ".mjs" || A === ".cjs")) {
3520
+ const X = I.path.basename(q, A), Y = `${X}.js`, ae = X + A;
3521
+ if (!T.some((le) => I.path.basename(le) === Y)) {
3522
+ const le = I.path.dirname(j), V = await I.dynamicImport("node:fs"), de = I.path.join(m.dir || C.outDir, le);
3523
+ await V.promises.mkdir(de, { recursive: !0 }), await V.promises.writeFile(
3524
+ I.path.join(de, Y),
3525
+ `export * from "./${ae}";`
3499
3526
  );
3500
3527
  }
3501
3528
  }
3502
- } catch (j) {
3503
- console.error("patchModuleFormat", j);
3529
+ } catch (q) {
3530
+ console.error("patchModuleFormat", q);
3504
3531
  }
3505
3532
  };
3506
- await Promise.all(O.map(F));
3533
+ await Promise.all(T.map(z));
3507
3534
  }
3508
3535
  }
3509
3536
  },
3510
3537
  transformIndexHtml() {
3511
3538
  if (e === "serve")
3512
- return Ar(m.getOptions(), i);
3539
+ return Wr(u.getOptions(), r);
3513
3540
  },
3514
- configureServer(b) {
3515
- w = b, m.configureServer(b), (t?.devTools?.imageDevTools ?? !0) && b.middlewares.use(Wi(m.getSys(), c, a));
3541
+ configureServer(m) {
3542
+ h = m, u.configureServer(m), (t?.devTools?.imageDevTools ?? !0) && m.middlewares.use(Qi(u.getSys(), l, s));
3516
3543
  },
3517
- configurePreviewServer(b) {
3544
+ configurePreviewServer(m) {
3518
3545
  return async () => {
3519
- const k = m.getSys(), E = m.getPath();
3520
- await Fr(b.middlewares, u, k, E);
3546
+ const b = u.getSys(), C = u.getPath();
3547
+ await zr(m.middlewares, a, b, C);
3521
3548
  };
3522
3549
  },
3523
- hotUpdate(b) {
3524
- m.hotUpdate(this.environment, b);
3525
- const k = t?.devTools?.hmr ?? !0;
3526
- if (this.environment.name === "ssr" && b.modules.length)
3527
- if (k) {
3528
- const E = /* @__PURE__ */ new Set(), L = (P) => /\.([mc]?[jt]sx?|mdx?)$/.test(P.split("?")[0]);
3529
- for (const P of b.modules) {
3530
- const O = P.url.split("?")[0];
3531
- if (P.type === "js" && L(P.url))
3532
- E.add(O);
3550
+ hotUpdate(m) {
3551
+ u.hotUpdate(this.environment, m);
3552
+ const b = t?.devTools?.hmr ?? !0;
3553
+ if (this.environment.name === "ssr" && m.modules.length)
3554
+ if (b) {
3555
+ const C = /* @__PURE__ */ new Set(), $ = (I) => /\.([mc]?[jt]sx?|mdx?)$/.test(I.split("?")[0]);
3556
+ for (const I of m.modules) {
3557
+ const T = I.url.split("?")[0];
3558
+ if (I.type === "js" && $(I.url))
3559
+ C.add(T);
3533
3560
  else
3534
- for (const F of P.importers)
3535
- F.type === "js" && L(F.url) && E.add(F.url.split("?")[0]);
3561
+ for (const z of I.importers)
3562
+ z.type === "js" && $(z.url) && C.add(z.url.split("?")[0]);
3536
3563
  }
3537
- E.size > 0 && w && w.environments.client.hot.send({
3564
+ C.size > 0 && h && h.environments.client.hot.send({
3538
3565
  type: "custom",
3539
3566
  event: "qwik:hmr",
3540
- data: { files: [...E], t: b.timestamp }
3567
+ data: { files: [...C], t: m.timestamp }
3541
3568
  });
3542
3569
  } else
3543
- w?.environments.client.hot.send({ type: "full-reload" });
3570
+ h?.environments.client.hot.send({ type: "full-reload" });
3544
3571
  },
3545
- onLog(b, k) {
3546
- if (k.plugin == "vite-plugin-qwik") {
3547
- const E = lo[b] || de.White, L = (k.frame || "").split(`
3572
+ onLog(m, b) {
3573
+ if (b.plugin == "vite-plugin-qwik") {
3574
+ const C = fo[m] || ce.White, $ = (b.frame || "").split(`
3548
3575
  `).map(
3549
- (P) => (P.match(/^\s*\^\s*$/) ? de.BrightWhite : de.BrightBlack) + P
3576
+ (I) => (I.match(/^\s*\^\s*$/) ? ce.BrightWhite : ce.BrightBlack) + I
3550
3577
  );
3551
- return console[b](
3552
- `${E}%s
3553
- ${de.BrightWhite}%s
3554
- %s${de.RESET}`,
3555
- `[${k.plugin}](${b}): ${k.message}
3578
+ return console[m](
3579
+ `${C}%s
3580
+ ${ce.BrightWhite}%s
3581
+ %s${ce.RESET}`,
3582
+ `[${b.plugin}](${m}): ${b.message}
3556
3583
  `,
3557
- ` ${k?.loc?.file}:${k?.loc?.line}:${k?.loc?.column}
3584
+ ` ${b?.loc?.file}:${b?.loc?.line}:${b?.loc?.column}
3558
3585
  `,
3559
- ` ${L.join(`
3586
+ ` ${$.join(`
3560
3587
  `)}
3561
3588
  `
3562
3589
  ), !1;
3563
3590
  }
3564
3591
  }
3565
- }, ao()];
3592
+ }, uo()];
3566
3593
  }
3567
- async function ao() {
3594
+ async function uo() {
3568
3595
  let t, e, n = !1;
3569
3596
  async function r() {
3570
3597
  if (n)
@@ -3578,36 +3605,36 @@ async function ao() {
3578
3605
  const i = /* @__PURE__ */ new Set(), s = [];
3579
3606
  let l;
3580
3607
  const a = "@qwik.dev/core", c = "@builder.io/qwik";
3581
- async function u(w) {
3608
+ async function h(w) {
3582
3609
  const v = /* @__PURE__ */ new Set();
3583
- let p = w;
3584
- for (; p; ) {
3610
+ let g = w;
3611
+ for (; g; ) {
3585
3612
  try {
3586
- const g = e.join(p, "package.json"), f = await t.readFile(g, { encoding: "utf-8" }), m = JSON.parse(f);
3587
- for (const R of Object.keys(m.dependencies || {}))
3613
+ const u = e.join(g, "package.json"), p = await t.readFile(u, { encoding: "utf-8" }), x = JSON.parse(p);
3614
+ for (const R of Object.keys(x.dependencies || {}))
3588
3615
  v.add(R);
3589
- for (const R of Object.keys(m.devDependencies || {}))
3616
+ for (const R of Object.keys(x.devDependencies || {}))
3590
3617
  v.add(R);
3591
- for (const R of Object.keys(m.optionalDependencies || {}))
3618
+ for (const R of Object.keys(x.optionalDependencies || {}))
3592
3619
  v.add(R);
3593
3620
  } catch {
3594
3621
  }
3595
- const d = e.dirname(p);
3596
- if (d === p)
3622
+ const d = e.dirname(g);
3623
+ if (d === g)
3597
3624
  break;
3598
- p = d;
3625
+ g = d;
3599
3626
  }
3600
3627
  return [...v];
3601
3628
  }
3602
3629
  async function o(w, v) {
3603
3630
  for (; v; ) {
3604
- const p = e.join(v, "node_modules", w, "package.json");
3631
+ const g = e.join(v, "node_modules", w, "package.json");
3605
3632
  try {
3606
- await t.access(p);
3607
- const g = await t.readFile(p, {
3633
+ await t.access(g);
3634
+ const u = await t.readFile(g, {
3608
3635
  encoding: "utf-8"
3609
- }), f = JSON.parse(g);
3610
- return !!(f.qwik || f.dependencies?.[a] || f.peerDependencies?.[a] || f.devDependencies?.[a] || f.dependencies?.[c] || f.peerDependencies?.[c] || f.devDependencies?.[c]);
3636
+ }), p = JSON.parse(u);
3637
+ return !!(p.qwik || p.dependencies?.[a] || p.peerDependencies?.[a] || p.devDependencies?.[a] || p.dependencies?.[c] || p.peerDependencies?.[c] || p.devDependencies?.[c]);
3611
3638
  } catch {
3612
3639
  }
3613
3640
  const d = e.dirname(v);
@@ -3629,14 +3656,14 @@ async function ao() {
3629
3656
  async handler(w) {
3630
3657
  if (!await r())
3631
3658
  return;
3632
- const v = w.root || process.cwd(), p = w.optimizeDeps?.exclude ?? [], d = await u(v);
3659
+ const v = w.root || process.cwd(), g = w.optimizeDeps?.exclude ?? [], d = await h(v);
3633
3660
  s.length = 0;
3634
- for (const f of d)
3635
- await o(f, v) && s.push(f);
3636
- const g = s.filter((f) => !p.includes(f));
3661
+ for (const p of d)
3662
+ await o(p, v) && s.push(p);
3663
+ const u = s.filter((p) => !g.includes(p));
3637
3664
  return {
3638
- optimizeDeps: { exclude: g },
3639
- ssr: { noExternal: g }
3665
+ optimizeDeps: { exclude: u },
3666
+ ssr: { noExternal: u }
3640
3667
  };
3641
3668
  }
3642
3669
  },
@@ -3644,58 +3671,58 @@ async function ao() {
3644
3671
  configEnvironment(w, v) {
3645
3672
  if (s.length === 0)
3646
3673
  return;
3647
- const p = v.resolve?.noExternal;
3648
- if (p === !0)
3674
+ const g = v.resolve?.noExternal;
3675
+ if (g === !0)
3649
3676
  return;
3650
3677
  let d;
3651
- return Array.isArray(p) ? d = p : p ? d = [p] : d = [], {
3678
+ return Array.isArray(g) ? d = g : g ? d = [g] : d = [], {
3652
3679
  resolve: { noExternal: [...d, ...s] }
3653
3680
  };
3654
3681
  },
3655
3682
  // We check all SSR build lookups for external Qwik deps
3656
3683
  resolveId: {
3657
3684
  order: "pre",
3658
- async handler(w, v, p) {
3685
+ async handler(w, v, g) {
3659
3686
  if (!await r() || !(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(w) || i.has(w))
3660
3687
  return;
3661
- const g = (w.startsWith("@") ? w.split("/").slice(0, 2).join("/") : w.split("/")[0]).split("?")[0];
3662
- if (i.has(g))
3688
+ const u = (w.startsWith("@") ? w.split("/").slice(0, 2).join("/") : w.split("/")[0]).split("?")[0];
3689
+ if (i.has(u))
3663
3690
  return;
3664
- i.add(w), i.add(g);
3665
- let f;
3691
+ i.add(w), i.add(u);
3692
+ let p;
3666
3693
  try {
3667
- f = await this.resolve(g, v, { ...p, skipSelf: !0 });
3694
+ p = await this.resolve(u, v, { ...g, skipSelf: !0 });
3668
3695
  } catch {
3669
3696
  return;
3670
3697
  }
3671
- if (f?.external && await o(g, v ? e.dirname(v) : l))
3698
+ if (p?.external && await o(u, v ? e.dirname(v) : l))
3672
3699
  throw new Error(
3673
3700
  `
3674
3701
  ==============
3675
- ${g} 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.
3702
+ ${u} 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.
3676
3703
  Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
3677
3704
  ==============
3678
3705
  `
3679
3706
  );
3680
- if (g === w)
3681
- return f;
3707
+ if (u === w)
3708
+ return p;
3682
3709
  }
3683
3710
  }
3684
3711
  };
3685
3712
  }
3686
- const de = {
3713
+ const ce = {
3687
3714
  Yellow: "\x1B[33m",
3688
3715
  Cyan: "\x1B[36m",
3689
3716
  White: "\x1B[37m",
3690
3717
  BrightBlack: "\x1B[90m",
3691
3718
  BrightWhite: "\x1B[97m",
3692
3719
  RESET: "\x1B[0m"
3693
- }, lo = {
3694
- warn: de.Yellow,
3695
- info: de.Cyan,
3696
- debug: de.BrightBlack
3720
+ }, fo = {
3721
+ warn: ce.Yellow,
3722
+ info: ce.Cyan,
3723
+ debug: ce.BrightBlack
3697
3724
  };
3698
3725
  export {
3699
- co as qwikRollup,
3700
- uo as qwikVite
3726
+ ho as qwikRollup,
3727
+ po as qwikVite
3701
3728
  };