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