@qwik.dev/core 2.0.0-beta.10 → 2.0.0-beta.11
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/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +55 -101
- package/dist/core.cjs +6498 -6393
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +6498 -6389
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +2458 -2413
- package/dist/core.prod.mjs +4227 -4174
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +31 -24
- package/dist/optimizer.d.ts +1 -1
- package/dist/optimizer.mjs +889 -836
- package/dist/server.cjs +22 -22
- package/dist/server.d.ts +1 -1
- package/dist/server.mjs +5 -9
- package/dist/starters/features/csr/package.json +1 -1
- package/dist/testing/index.cjs +2628 -2535
- package/dist/testing/index.d.ts +59 -82
- package/dist/testing/index.mjs +2587 -2501
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
- package/server.d.ts +2 -0
package/dist/optimizer.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/optimizer 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/optimizer 2.0.0-beta.11-dev+d7daca3
|
|
4
4
|
* Copyright QwikDev. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
7
7
|
*/
|
|
8
|
-
function
|
|
9
|
-
function n(
|
|
10
|
-
if (typeof
|
|
11
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
12
|
-
}
|
|
13
|
-
function s(
|
|
14
|
-
let i = "",
|
|
15
|
-
for (let T = 0; T <=
|
|
16
|
-
if (T <
|
|
17
|
-
v =
|
|
8
|
+
function $t(e = {}) {
|
|
9
|
+
function n(f) {
|
|
10
|
+
if (typeof f != "string")
|
|
11
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(f));
|
|
12
|
+
}
|
|
13
|
+
function s(f, l) {
|
|
14
|
+
let i = "", y = 0, h = -1, I = 0, v;
|
|
15
|
+
for (let T = 0; T <= f.length; ++T) {
|
|
16
|
+
if (T < f.length)
|
|
17
|
+
v = f.charCodeAt(T);
|
|
18
18
|
else {
|
|
19
19
|
if (v === 47)
|
|
20
20
|
break;
|
|
@@ -22,89 +22,89 @@ function Ot(e = {}) {
|
|
|
22
22
|
}
|
|
23
23
|
if (v === 47) {
|
|
24
24
|
if (!(h === T - 1 || I === 1)) if (h !== T - 1 && I === 2) {
|
|
25
|
-
if (i.length < 2 ||
|
|
25
|
+
if (i.length < 2 || y !== 2 || i.charCodeAt(i.length - 1) !== 46 || i.charCodeAt(i.length - 2) !== 46) {
|
|
26
26
|
if (i.length > 2) {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
|
|
27
|
+
const E = i.lastIndexOf("/");
|
|
28
|
+
if (E !== i.length - 1) {
|
|
29
|
+
E === -1 ? (i = "", y = 0) : (i = i.slice(0, E), y = i.length - 1 - i.lastIndexOf("/")), h = T, I = 0;
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
32
32
|
} else if (i.length === 2 || i.length === 1) {
|
|
33
|
-
i = "",
|
|
33
|
+
i = "", y = 0, h = T, I = 0;
|
|
34
34
|
continue;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
l && (i.length > 0 ? i += "/.." : i = "..",
|
|
37
|
+
l && (i.length > 0 ? i += "/.." : i = "..", y = 2);
|
|
38
38
|
} else
|
|
39
|
-
i.length > 0 ? i += "/" +
|
|
39
|
+
i.length > 0 ? i += "/" + f.slice(h + 1, T) : i = f.slice(h + 1, T), y = T - h - 1;
|
|
40
40
|
h = T, I = 0;
|
|
41
41
|
} else v === 46 && I !== -1 ? ++I : I = -1;
|
|
42
42
|
}
|
|
43
43
|
return i;
|
|
44
44
|
}
|
|
45
|
-
function r(
|
|
46
|
-
const i = l.dir || l.root,
|
|
47
|
-
return i ? i === l.root ? i +
|
|
45
|
+
function r(f, l) {
|
|
46
|
+
const i = l.dir || l.root, y = l.base || (l.name || "") + (l.ext || "");
|
|
47
|
+
return i ? i === l.root ? i + y : i + f + y : y;
|
|
48
48
|
}
|
|
49
49
|
const o = function(...l) {
|
|
50
|
-
let i = "",
|
|
51
|
-
for (let I = l.length - 1; I >= -1 && !
|
|
50
|
+
let i = "", y = !1, h;
|
|
51
|
+
for (let I = l.length - 1; I >= -1 && !y; I--) {
|
|
52
52
|
let v;
|
|
53
|
-
I >= 0 ? v = l[I] : (h === void 0 && (e && typeof e.cwd == "function" ? h = e.cwd() : typeof process < "u" && typeof process.cwd == "function" ? h = process.cwd() : h = "/"), v = h), n(v), v.length !== 0 && (i = v + "/" + i,
|
|
53
|
+
I >= 0 ? v = l[I] : (h === void 0 && (e && typeof e.cwd == "function" ? h = e.cwd() : typeof process < "u" && typeof process.cwd == "function" ? h = process.cwd() : h = "/"), v = h), n(v), v.length !== 0 && (i = v + "/" + i, y = v.charCodeAt(0) === 47);
|
|
54
54
|
}
|
|
55
|
-
return i = s(i, !
|
|
55
|
+
return i = s(i, !y), y ? i.length > 0 ? "/" + i : "/" : i.length > 0 ? i : ".";
|
|
56
56
|
}, p = function(l) {
|
|
57
57
|
if (n(l), l.length === 0)
|
|
58
58
|
return ".";
|
|
59
|
-
const i = l.charCodeAt(0) === 47,
|
|
60
|
-
return l = s(l, !i), l.length === 0 && !i && (l = "."), l.length > 0 &&
|
|
59
|
+
const i = l.charCodeAt(0) === 47, y = l.charCodeAt(l.length - 1) === 47;
|
|
60
|
+
return l = s(l, !i), l.length === 0 && !i && (l = "."), l.length > 0 && y && (l += "/"), i ? "/" + l : l;
|
|
61
61
|
}, c = function(l) {
|
|
62
62
|
return n(l), l.length > 0 && l.charCodeAt(0) === 47;
|
|
63
63
|
}, a = function(...l) {
|
|
64
64
|
if (l.length === 0)
|
|
65
65
|
return ".";
|
|
66
66
|
let i;
|
|
67
|
-
for (let
|
|
68
|
-
const h = l[
|
|
67
|
+
for (let y = 0; y < l.length; ++y) {
|
|
68
|
+
const h = l[y];
|
|
69
69
|
n(h), h.length > 0 && (i === void 0 ? i = h : i += "/" + h);
|
|
70
70
|
}
|
|
71
71
|
return i === void 0 ? "." : p(i);
|
|
72
72
|
}, d = function(l, i) {
|
|
73
73
|
if (n(l), n(i), l === i || (l = o(l), i = o(i), l === i))
|
|
74
74
|
return "";
|
|
75
|
-
let
|
|
76
|
-
for (;
|
|
75
|
+
let y = 1;
|
|
76
|
+
for (; y < l.length && l.charCodeAt(y) === 47; ++y)
|
|
77
77
|
;
|
|
78
|
-
const h = l.length, I = h -
|
|
78
|
+
const h = l.length, I = h - y;
|
|
79
79
|
let v = 1;
|
|
80
80
|
for (; v < i.length && i.charCodeAt(v) === 47; ++v)
|
|
81
81
|
;
|
|
82
|
-
const
|
|
82
|
+
const E = i.length - v, P = I < E ? I : E;
|
|
83
83
|
let $ = -1, L = 0;
|
|
84
|
-
for (; L <=
|
|
85
|
-
if (L ===
|
|
86
|
-
if (
|
|
84
|
+
for (; L <= P; ++L) {
|
|
85
|
+
if (L === P) {
|
|
86
|
+
if (E > P) {
|
|
87
87
|
if (i.charCodeAt(v + L) === 47)
|
|
88
88
|
return i.slice(v + L + 1);
|
|
89
89
|
if (L === 0)
|
|
90
90
|
return i.slice(v + L);
|
|
91
|
-
} else I >
|
|
91
|
+
} else I > P && (l.charCodeAt(y + L) === 47 ? $ = L : L === 0 && ($ = 0));
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
const H = l.charCodeAt(
|
|
94
|
+
const H = l.charCodeAt(y + L), J = i.charCodeAt(v + L);
|
|
95
95
|
if (H !== J)
|
|
96
96
|
break;
|
|
97
97
|
H === 47 && ($ = L);
|
|
98
98
|
}
|
|
99
99
|
let B = "";
|
|
100
|
-
for (L =
|
|
100
|
+
for (L = y + $ + 1; L <= h; ++L)
|
|
101
101
|
(L === h || l.charCodeAt(L) === 47) && (B.length === 0 ? B += ".." : B += "/..");
|
|
102
102
|
return B.length > 0 ? B + i.slice(v + $) : (v += $, i.charCodeAt(v) === 47 && ++v, i.slice(v));
|
|
103
103
|
}, t = function(l) {
|
|
104
104
|
if (n(l), l.length === 0)
|
|
105
105
|
return ".";
|
|
106
106
|
let i = l.charCodeAt(0);
|
|
107
|
-
const
|
|
107
|
+
const y = i === 47;
|
|
108
108
|
let h = -1, I = !0;
|
|
109
109
|
for (let v = l.length - 1; v >= 1; --v)
|
|
110
110
|
if (i = l.charCodeAt(v), i === 47) {
|
|
@@ -114,55 +114,55 @@ function Ot(e = {}) {
|
|
|
114
114
|
}
|
|
115
115
|
} else
|
|
116
116
|
I = !1;
|
|
117
|
-
return h === -1 ?
|
|
117
|
+
return h === -1 ? y ? "/" : "." : y && h === 1 ? "//" : l.slice(0, h);
|
|
118
118
|
}, x = function(l, i) {
|
|
119
119
|
if (i !== void 0 && typeof i != "string")
|
|
120
120
|
throw new TypeError('"ext" argument must be a string');
|
|
121
121
|
n(l);
|
|
122
|
-
let
|
|
122
|
+
let y = 0, h = -1, I = !0, v;
|
|
123
123
|
if (i !== void 0 && i.length > 0 && i.length <= l.length) {
|
|
124
124
|
if (i.length === l.length && i === l)
|
|
125
125
|
return "";
|
|
126
|
-
let T = i.length - 1,
|
|
126
|
+
let T = i.length - 1, E = -1;
|
|
127
127
|
for (v = l.length - 1; v >= 0; --v) {
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
128
|
+
const P = l.charCodeAt(v);
|
|
129
|
+
if (P === 47) {
|
|
130
130
|
if (!I) {
|
|
131
|
-
|
|
131
|
+
y = v + 1;
|
|
132
132
|
break;
|
|
133
133
|
}
|
|
134
134
|
} else
|
|
135
|
-
|
|
135
|
+
E === -1 && (I = !1, E = v + 1), T >= 0 && (P === i.charCodeAt(T) ? --T === -1 && (h = v) : (T = -1, h = E));
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return y === h ? h = E : h === -1 && (h = l.length), l.slice(y, h);
|
|
138
138
|
} else {
|
|
139
139
|
for (v = l.length - 1; v >= 0; --v)
|
|
140
140
|
if (l.charCodeAt(v) === 47) {
|
|
141
141
|
if (!I) {
|
|
142
|
-
|
|
142
|
+
y = v + 1;
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
145
|
} else h === -1 && (I = !1, h = v + 1);
|
|
146
|
-
return h === -1 ? "" : l.slice(
|
|
146
|
+
return h === -1 ? "" : l.slice(y, h);
|
|
147
147
|
}
|
|
148
148
|
}, S = function(l) {
|
|
149
149
|
n(l);
|
|
150
|
-
let i = -1,
|
|
150
|
+
let i = -1, y = 0, h = -1, I = !0, v = 0;
|
|
151
151
|
for (let T = l.length - 1; T >= 0; --T) {
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
152
|
+
const E = l.charCodeAt(T);
|
|
153
|
+
if (E === 47) {
|
|
154
154
|
if (!I) {
|
|
155
|
-
|
|
155
|
+
y = T + 1;
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
160
|
-
h === -1 && (I = !1, h = T + 1),
|
|
160
|
+
h === -1 && (I = !1, h = T + 1), E === 46 ? i === -1 ? i = T : v !== 1 && (v = 1) : i !== -1 && (v = -1);
|
|
161
161
|
}
|
|
162
162
|
return i === -1 || h === -1 || // We saw a non-dot character immediately before the dot
|
|
163
163
|
v === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
164
|
-
v === 1 && i === h - 1 && i ===
|
|
165
|
-
},
|
|
164
|
+
v === 1 && i === h - 1 && i === y + 1 ? "" : l.slice(i, h);
|
|
165
|
+
}, u = function(l) {
|
|
166
166
|
if (l === null || typeof l != "object")
|
|
167
167
|
throw new TypeError(
|
|
168
168
|
'The "pathObject" argument must be of type Object. Received type ' + typeof l
|
|
@@ -179,29 +179,29 @@ function Ot(e = {}) {
|
|
|
179
179
|
};
|
|
180
180
|
if (l.length === 0)
|
|
181
181
|
return i;
|
|
182
|
-
let
|
|
183
|
-
const I =
|
|
182
|
+
let y = l.charCodeAt(0), h;
|
|
183
|
+
const I = y === 47;
|
|
184
184
|
I ? (i.root = "/", h = 1) : h = 0;
|
|
185
|
-
let v = -1, T = 0,
|
|
185
|
+
let v = -1, T = 0, E = -1, P = !0, $ = l.length - 1, L = 0;
|
|
186
186
|
for (; $ >= h; --$) {
|
|
187
|
-
if (
|
|
188
|
-
if (!
|
|
187
|
+
if (y = l.charCodeAt($), y === 47) {
|
|
188
|
+
if (!P) {
|
|
189
189
|
T = $ + 1;
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
E === -1 && (P = !1, E = $ + 1), y === 46 ? v === -1 ? v = $ : L !== 1 && (L = 1) : v !== -1 && (L = -1);
|
|
195
195
|
}
|
|
196
|
-
return v === -1 ||
|
|
196
|
+
return v === -1 || E === -1 || // We saw a non-dot character immediately before the dot
|
|
197
197
|
L === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
198
|
-
L === 1 && v ===
|
|
198
|
+
L === 1 && v === E - 1 && v === T + 1 ? E !== -1 && (T === 0 && I ? i.base = i.name = l.slice(1, E) : i.base = i.name = l.slice(T, E)) : (T === 0 && I ? (i.name = l.slice(1, v), i.base = l.slice(1, E)) : (i.name = l.slice(T, v), i.base = l.slice(T, E)), i.ext = l.slice(v, E)), T > 0 ? i.dir = l.slice(0, T - 1) : I && (i.dir = "/"), i;
|
|
199
199
|
}, m = "/", g = ":";
|
|
200
200
|
return {
|
|
201
201
|
relative: d,
|
|
202
202
|
resolve: o,
|
|
203
203
|
parse: w,
|
|
204
|
-
format:
|
|
204
|
+
format: u,
|
|
205
205
|
join: a,
|
|
206
206
|
isAbsolute: c,
|
|
207
207
|
basename: x,
|
|
@@ -215,7 +215,7 @@ function Ot(e = {}) {
|
|
|
215
215
|
relative: d,
|
|
216
216
|
resolve: o,
|
|
217
217
|
parse: w,
|
|
218
|
-
format:
|
|
218
|
+
format: u,
|
|
219
219
|
join: a,
|
|
220
220
|
isAbsolute: c,
|
|
221
221
|
basename: x,
|
|
@@ -268,11 +268,11 @@ const Ut = {
|
|
|
268
268
|
}
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
|
-
},
|
|
272
|
-
qwik: "2.0.0-beta.
|
|
271
|
+
}, zr = {
|
|
272
|
+
qwik: "2.0.0-beta.11-dev+d7daca3"
|
|
273
273
|
};
|
|
274
|
-
async function
|
|
275
|
-
const e =
|
|
274
|
+
async function Bt() {
|
|
275
|
+
const e = _t(), n = {
|
|
276
276
|
dynamicImport: (s) => {
|
|
277
277
|
throw new Error(
|
|
278
278
|
`Qwik Optimizer sys.dynamicImport() not implemented, trying to import: "${s}"`
|
|
@@ -288,15 +288,15 @@ async function $t() {
|
|
|
288
288
|
os: "unknown",
|
|
289
289
|
env: e
|
|
290
290
|
};
|
|
291
|
-
if (n.path =
|
|
291
|
+
if (n.path = $t(n), n.strictDynamicImport = n.dynamicImport = (s) => import(s), e !== "webworker" && e !== "browsermain")
|
|
292
292
|
try {
|
|
293
293
|
n.path = await n.dynamicImport("node:path"), n.cwd = () => process.cwd(), n.os = process.platform;
|
|
294
294
|
} catch {
|
|
295
295
|
}
|
|
296
296
|
return n;
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
299
|
-
const n =
|
|
298
|
+
async function Rt(e) {
|
|
299
|
+
const n = _t();
|
|
300
300
|
if (n === "node" || n === "bun") {
|
|
301
301
|
const s = Ut[process.platform];
|
|
302
302
|
if (s) {
|
|
@@ -323,15 +323,15 @@ async function jt(e) {
|
|
|
323
323
|
return await s.default(), s;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
const
|
|
327
|
-
const n = e?.sys || await
|
|
326
|
+
const _t = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof process < "u" && typeof global < "u" && process.versions && process.versions.node ? "node" : typeof self < "u" && typeof location < "u" && typeof navigator < "u" && typeof fetch == "function" && typeof WorkerGlobalScope == "function" && typeof self.importScripts == "function" ? "webworker" : typeof window < "u" && typeof document < "u" && typeof location < "u" && typeof navigator < "u" && typeof Window == "function" && typeof fetch == "function" ? "browsermain" : "unknown", At = async (e = {}) => {
|
|
327
|
+
const n = e?.sys || await Bt(), s = e?.binding || await Rt(n);
|
|
328
328
|
return {
|
|
329
329
|
async transformModules(o) {
|
|
330
|
-
return
|
|
330
|
+
return Ft(s, o);
|
|
331
331
|
},
|
|
332
332
|
sys: n
|
|
333
333
|
};
|
|
334
|
-
},
|
|
334
|
+
}, Ft = (e, n) => e.transform_modules(zt(n)), zt = (e) => {
|
|
335
335
|
const n = {
|
|
336
336
|
minify: "simplify",
|
|
337
337
|
sourceMaps: !1,
|
|
@@ -352,14 +352,14 @@ const kt = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof
|
|
|
352
352
|
return Object.entries(e).forEach(([s, r]) => {
|
|
353
353
|
r != null && (n[s] = r);
|
|
354
354
|
}), n.entryStrategy = e.entryStrategy?.type ?? "smart", n.manualChunks = e.entryStrategy?.manual ?? void 0, n;
|
|
355
|
-
},
|
|
355
|
+
}, Ht = (e, n = 0) => {
|
|
356
356
|
for (let s = 0; s < e.length; s++) {
|
|
357
357
|
const r = e.charCodeAt(s);
|
|
358
358
|
n = (n << 5) - n + r, n |= 0;
|
|
359
359
|
}
|
|
360
360
|
return Number(Math.abs(n)).toString(36);
|
|
361
|
-
},
|
|
362
|
-
function
|
|
361
|
+
}, Wt = /* @__PURE__ */ new Set(["_run", "_task"]);
|
|
362
|
+
function Gt(e) {
|
|
363
363
|
const n = e.symbols;
|
|
364
364
|
return Object.keys(n).sort((s, r) => {
|
|
365
365
|
const o = n[s], p = n[r];
|
|
@@ -368,7 +368,7 @@ function Ht(e) {
|
|
|
368
368
|
if (o.ctxKind !== "eventHandler" && p.ctxKind === "eventHandler")
|
|
369
369
|
return 1;
|
|
370
370
|
if (o.ctxKind === "eventHandler" && p.ctxKind === "eventHandler") {
|
|
371
|
-
const c =
|
|
371
|
+
const c = Ve.indexOf(o.ctxName.toLowerCase()), a = Ve.indexOf(p.ctxName.toLowerCase());
|
|
372
372
|
if (c > -1 && a > -1) {
|
|
373
373
|
if (c < a)
|
|
374
374
|
return -1;
|
|
@@ -397,7 +397,7 @@ function Ht(e) {
|
|
|
397
397
|
return !o.parent && p.parent ? -1 : o.parent && !p.parent ? 1 : o.hash < p.hash ? -1 : o.hash > p.hash ? 1 : 0;
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
const
|
|
400
|
+
const Ve = [
|
|
401
401
|
// Click Events
|
|
402
402
|
"click",
|
|
403
403
|
"dblclick",
|
|
@@ -456,33 +456,33 @@ const Xe = [
|
|
|
456
456
|
].map((e) => `on${e.toLowerCase()}$`), Ze = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
|
|
457
457
|
(e) => e.toLowerCase()
|
|
458
458
|
);
|
|
459
|
-
function
|
|
460
|
-
return Object.keys(e.bundles).sort(
|
|
459
|
+
function Qt(e) {
|
|
460
|
+
return Object.keys(e.bundles).sort($e);
|
|
461
461
|
}
|
|
462
|
-
function
|
|
463
|
-
const n =
|
|
462
|
+
function Kt(e) {
|
|
463
|
+
const n = Gt(e), s = {}, r = {};
|
|
464
464
|
for (const c of n)
|
|
465
465
|
s[c] = e.symbols[c], r[c] = e.mapping[c];
|
|
466
|
-
const o =
|
|
466
|
+
const o = Qt(e), p = {};
|
|
467
467
|
for (const c of o) {
|
|
468
468
|
p[c] = e.bundles[c];
|
|
469
469
|
const a = e.bundles[c];
|
|
470
|
-
Array.isArray(a.imports) && a.imports.sort(
|
|
470
|
+
Array.isArray(a.imports) && a.imports.sort($e), Array.isArray(a.dynamicImports) && a.dynamicImports.sort($e);
|
|
471
471
|
const d = [];
|
|
472
472
|
for (const t of n)
|
|
473
473
|
c === r[t] && d.push(t);
|
|
474
|
-
d.length > 0 && (d.sort(
|
|
474
|
+
d.length > 0 && (d.sort($e), a.symbols = d);
|
|
475
475
|
}
|
|
476
476
|
return e.symbols = s, e.mapping = r, e.bundles = p, e;
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function $e(e, n) {
|
|
479
479
|
return e = e.toLocaleLowerCase(), n = n.toLocaleLowerCase(), e < n ? -1 : e > n ? 1 : 0;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function et(e) {
|
|
482
482
|
if (e != null && e.mapping != null && typeof e.mapping == "object" && e.symbols != null && typeof e.symbols == "object" && e.bundles != null && typeof e.bundles == "object")
|
|
483
483
|
return e;
|
|
484
484
|
}
|
|
485
|
-
const
|
|
485
|
+
const Jt = (e, n) => {
|
|
486
486
|
let s = 0;
|
|
487
487
|
if (e.symbols)
|
|
488
488
|
for (const r of e.symbols) {
|
|
@@ -492,70 +492,70 @@ const Kt = (e, n) => {
|
|
|
492
492
|
}
|
|
493
493
|
return s;
|
|
494
494
|
};
|
|
495
|
-
function
|
|
495
|
+
function Yt(e) {
|
|
496
496
|
let n = 0;
|
|
497
497
|
const s = [], r = [], o = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
498
498
|
function a(m) {
|
|
499
499
|
o.set(m, n), p.set(m, n), n++, s.push(m), c.add(m);
|
|
500
500
|
const g = e[m].imports || [];
|
|
501
|
-
for (const
|
|
502
|
-
o.has(
|
|
501
|
+
for (const f of g)
|
|
502
|
+
o.has(f) ? c.has(f) && p.set(m, Math.min(p.get(m), o.get(f))) : (a(f), p.set(m, Math.min(p.get(m), p.get(f))));
|
|
503
503
|
if (p.get(m) === o.get(m)) {
|
|
504
|
-
const
|
|
504
|
+
const f = [];
|
|
505
505
|
let l;
|
|
506
506
|
do
|
|
507
|
-
l = s.pop(), c.delete(l),
|
|
507
|
+
l = s.pop(), c.delete(l), f.push(l);
|
|
508
508
|
while (l !== m);
|
|
509
|
-
r.push(
|
|
509
|
+
r.push(f);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
for (const m of Object.keys(e))
|
|
513
513
|
o.has(m) || a(m);
|
|
514
514
|
const d = /* @__PURE__ */ new Map();
|
|
515
515
|
r.forEach((m, g) => {
|
|
516
|
-
for (const
|
|
517
|
-
d.set(
|
|
516
|
+
for (const f of m)
|
|
517
|
+
d.set(f, g);
|
|
518
518
|
});
|
|
519
519
|
const t = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
|
|
520
520
|
for (const m of Object.keys(e)) {
|
|
521
521
|
const g = d.get(m);
|
|
522
|
-
for (const
|
|
523
|
-
const l = d.get(
|
|
522
|
+
for (const f of e[m].imports || []) {
|
|
523
|
+
const l = d.get(f);
|
|
524
524
|
g !== l && t[g].add(l);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
const x = /* @__PURE__ */ new Set(), S = [];
|
|
528
|
-
function
|
|
528
|
+
function u(m) {
|
|
529
529
|
x.add(m);
|
|
530
530
|
for (const g of t[m])
|
|
531
|
-
x.has(g) ||
|
|
531
|
+
x.has(g) || u(g);
|
|
532
532
|
S.push(m);
|
|
533
533
|
}
|
|
534
534
|
for (let m = 0; m < r.length; m++)
|
|
535
|
-
x.has(m) ||
|
|
535
|
+
x.has(m) || u(m);
|
|
536
536
|
S.reverse();
|
|
537
537
|
const w = new Array(r.length).fill(0);
|
|
538
538
|
for (let m = 0; m < r.length; m++) {
|
|
539
539
|
let g = 0;
|
|
540
|
-
for (const
|
|
541
|
-
g += e[
|
|
540
|
+
for (const f of r[m])
|
|
541
|
+
g += e[f].size;
|
|
542
542
|
w[m] = g;
|
|
543
543
|
}
|
|
544
544
|
for (let m = S.length - 1; m >= 0; m--) {
|
|
545
545
|
const g = S[m];
|
|
546
|
-
let
|
|
546
|
+
let f = w[g];
|
|
547
547
|
for (const l of t[g])
|
|
548
|
-
|
|
549
|
-
w[g] =
|
|
548
|
+
f += w[l];
|
|
549
|
+
w[g] = f;
|
|
550
550
|
}
|
|
551
551
|
for (let m = 0; m < r.length; m++) {
|
|
552
552
|
const g = w[m];
|
|
553
|
-
for (const
|
|
554
|
-
e[
|
|
553
|
+
for (const f of r[m])
|
|
554
|
+
e[f].total = g;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
557
|
+
const tt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, nt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, rt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/, ot = /[/\\](core|qwik)[/\\]handlers\.(|c|m)js$/;
|
|
558
|
+
function Xt(e, n, s, r, o, p, c) {
|
|
559
559
|
var S;
|
|
560
560
|
const a = {
|
|
561
561
|
version: "1",
|
|
@@ -576,83 +576,83 @@ function Jt(e, n, s, r, o, p, c) {
|
|
|
576
576
|
assets: {},
|
|
577
577
|
symbols: {},
|
|
578
578
|
bundleGraph: void 0
|
|
579
|
-
}, d = (
|
|
580
|
-
const w = r[
|
|
579
|
+
}, d = (u) => {
|
|
580
|
+
const w = r[u];
|
|
581
581
|
if (!w) {
|
|
582
|
-
console.warn(`Client manifest generation: skipping external import "${
|
|
582
|
+
console.warn(`Client manifest generation: skipping external import "${u}"`);
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
585
|
return c(w.fileName);
|
|
586
586
|
};
|
|
587
587
|
let t;
|
|
588
|
-
const x = new Set(n.map((
|
|
589
|
-
for (const
|
|
590
|
-
if (
|
|
591
|
-
|
|
592
|
-
name:
|
|
593
|
-
size:
|
|
588
|
+
const x = new Set(n.map((u) => u.name));
|
|
589
|
+
for (const u of Object.values(r)) {
|
|
590
|
+
if (u.type === "asset") {
|
|
591
|
+
u.fileName.endsWith("js.map") || (a.assets[u.fileName] = {
|
|
592
|
+
name: u.names[0],
|
|
593
|
+
size: u.source.length
|
|
594
594
|
});
|
|
595
595
|
continue;
|
|
596
596
|
}
|
|
597
|
-
const w = c(
|
|
598
|
-
size:
|
|
597
|
+
const w = c(u.fileName), g = {
|
|
598
|
+
size: u.code.length,
|
|
599
599
|
total: -1
|
|
600
600
|
};
|
|
601
|
-
for (const h of
|
|
602
|
-
x.has(h) && (!a.mapping[h] ||
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
const l =
|
|
606
|
-
l.length > 0 && (g.dynamicImports = l),
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
for (const
|
|
611
|
-
const w =
|
|
601
|
+
for (const h of u.exports)
|
|
602
|
+
x.has(h) && (!a.mapping[h] || u.exports.length !== 1) && (a.mapping[h] = w);
|
|
603
|
+
const f = u.imports.filter((h) => u.code.includes(e.basename(h))).map((h) => d(h)).filter(Boolean);
|
|
604
|
+
f.length > 0 && (g.imports = f);
|
|
605
|
+
const l = u.dynamicImports.filter((h) => u.code.includes(e.basename(h))).map((h) => d(h)).filter(Boolean);
|
|
606
|
+
l.length > 0 && (g.dynamicImports = l), u.facadeModuleId && (tt.test(u.facadeModuleId) ? a.preloader = w : nt.test(u.facadeModuleId) ? a.core = w : rt.test(u.facadeModuleId) ? a.qwikLoader = w : ot.test(u.facadeModuleId) && (t = w));
|
|
607
|
+
const y = (u.moduleIds || Object.keys(u.modules)).filter((h) => !h.startsWith("\0")).map((h) => e.relative(o.rootDir, h));
|
|
608
|
+
y.length > 0 && (g.origins = y, !a.preloader && y.some((h) => tt.test(h)) && (a.preloader = w), !a.core && y.some((h) => nt.test(h)) && (a.core = w), !a.qwikLoader && y.some((h) => rt.test(h)) && (a.qwikLoader = w), !t && y.some((h) => ot.test(h)) && (t = w)), a.bundles[w] = g;
|
|
609
|
+
}
|
|
610
|
+
for (const u of n) {
|
|
611
|
+
const w = u.name, m = a.mapping[w];
|
|
612
612
|
if (!m) {
|
|
613
|
-
p(`Note: qrl ${
|
|
613
|
+
p(`Note: qrl ${u.name} is not in the bundle, likely tree shaken`, a);
|
|
614
614
|
continue;
|
|
615
615
|
}
|
|
616
616
|
((S = a.bundles[m]).symbols || (S.symbols = [])).push(w), a.symbols[w] = {
|
|
617
|
-
displayName:
|
|
618
|
-
hash:
|
|
619
|
-
ctxKind:
|
|
620
|
-
ctxName:
|
|
621
|
-
captures:
|
|
622
|
-
canonicalFilename:
|
|
623
|
-
parent:
|
|
624
|
-
origin:
|
|
625
|
-
loc:
|
|
626
|
-
paramNames:
|
|
627
|
-
captureNames:
|
|
617
|
+
displayName: u.displayName,
|
|
618
|
+
hash: u.hash,
|
|
619
|
+
ctxKind: u.ctxKind,
|
|
620
|
+
ctxName: u.ctxName,
|
|
621
|
+
captures: u.captures,
|
|
622
|
+
canonicalFilename: u.canonicalFilename,
|
|
623
|
+
parent: u.parent,
|
|
624
|
+
origin: u.origin,
|
|
625
|
+
loc: u.loc,
|
|
626
|
+
paramNames: u.paramNames,
|
|
627
|
+
captureNames: u.captureNames
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
630
|
if (t)
|
|
631
|
-
for (const
|
|
632
|
-
a.symbols[
|
|
631
|
+
for (const u of Wt)
|
|
632
|
+
a.symbols[u] = {
|
|
633
633
|
origin: "Qwik core",
|
|
634
|
-
displayName:
|
|
634
|
+
displayName: u,
|
|
635
635
|
canonicalFilename: "",
|
|
636
|
-
hash:
|
|
636
|
+
hash: u,
|
|
637
637
|
ctxKind: "function",
|
|
638
|
-
ctxName:
|
|
638
|
+
ctxName: u,
|
|
639
639
|
captures: !1,
|
|
640
640
|
parent: null,
|
|
641
641
|
loc: [0, 0]
|
|
642
|
-
}, a.mapping[
|
|
642
|
+
}, a.mapping[u] = t;
|
|
643
643
|
else
|
|
644
644
|
console.error("Qwik core bundle not found, is Qwik actually used in this project?");
|
|
645
|
-
for (const
|
|
646
|
-
const w =
|
|
647
|
-
|
|
645
|
+
for (const u of Object.values(a.bundles)) {
|
|
646
|
+
const w = Jt(u, a);
|
|
647
|
+
u.interactivity = w;
|
|
648
648
|
}
|
|
649
|
-
return
|
|
649
|
+
return Yt(a.bundles), Kt(a);
|
|
650
650
|
}
|
|
651
|
-
const
|
|
651
|
+
const Vt = 300, Zt = 0.5 / (Vt * 1024 / 8), en = (e) => {
|
|
652
652
|
const n = e.lastIndexOf("_");
|
|
653
653
|
return n > -1 ? e.slice(n + 1) : e;
|
|
654
654
|
};
|
|
655
|
-
function
|
|
655
|
+
function tn(e, n) {
|
|
656
656
|
const s = [];
|
|
657
657
|
if (!e.bundles)
|
|
658
658
|
return [];
|
|
@@ -660,7 +660,7 @@ function Vt(e, n) {
|
|
|
660
660
|
for (const [d, t] of Object.entries(e.mapping)) {
|
|
661
661
|
if (d.startsWith("_") && d.length < 10)
|
|
662
662
|
continue;
|
|
663
|
-
const x =
|
|
663
|
+
const x = en(d);
|
|
664
664
|
x && (r[x] = { dynamicImports: [t] });
|
|
665
665
|
}
|
|
666
666
|
if (n) {
|
|
@@ -671,12 +671,12 @@ function Vt(e, n) {
|
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
for (const d of Object.keys(r)) {
|
|
674
|
-
const t = r[d], x = t.imports?.filter((
|
|
674
|
+
const t = r[d], x = t.imports?.filter((u) => r[u]) || [], S = t.dynamicImports?.filter(
|
|
675
675
|
// we only want to include dynamic imports that belong to the app
|
|
676
676
|
// e.g. not all languages supported by shiki
|
|
677
|
-
(
|
|
678
|
-
(r[
|
|
679
|
-
r[
|
|
677
|
+
(u) => r[u] && // either there are qrls
|
|
678
|
+
(r[u].symbols || // or it's a dynamic import from the app source
|
|
679
|
+
r[u].origins?.some((w) => !w.includes("node_modules")))
|
|
680
680
|
) || [];
|
|
681
681
|
r[d] = {
|
|
682
682
|
...t,
|
|
@@ -697,34 +697,34 @@ function Vt(e, n) {
|
|
|
697
697
|
}
|
|
698
698
|
const p = Object.keys(r), c = /* @__PURE__ */ new Map(), a = (d, t, x = /* @__PURE__ */ new Set()) => {
|
|
699
699
|
const S = r[t];
|
|
700
|
-
for (const
|
|
701
|
-
d.has(
|
|
700
|
+
for (const u of S.imports)
|
|
701
|
+
d.has(u) && d.delete(u), x.has(u) || (x.add(u), a(d, u, x));
|
|
702
702
|
};
|
|
703
703
|
for (const d of p) {
|
|
704
704
|
const t = r[d], x = new Set(t.imports);
|
|
705
705
|
for (const m of x)
|
|
706
706
|
a(x, m);
|
|
707
|
-
const S = new Set(t.dynamicImports),
|
|
707
|
+
const S = new Set(t.dynamicImports), u = /* @__PURE__ */ new Map();
|
|
708
708
|
for (const m of S) {
|
|
709
709
|
a(S, m);
|
|
710
710
|
const g = r[m];
|
|
711
|
-
let
|
|
712
|
-
if (
|
|
711
|
+
let f = 0.5;
|
|
712
|
+
if (f += (g.interactivity || 0) * 0.08, t.origins && g.origins) {
|
|
713
713
|
for (const l of t.origins)
|
|
714
714
|
if (g.origins.some((i) => i.startsWith(l))) {
|
|
715
|
-
|
|
715
|
+
f += 0.25;
|
|
716
716
|
break;
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
g.total >
|
|
719
|
+
g.total > Zt && (f += f > 0.5 ? 0.02 : -0.02), g.total < 1e3 && (f += 0.15), u.set(m, Math.min(f, 0.99));
|
|
720
720
|
}
|
|
721
721
|
if (S.size > 0) {
|
|
722
722
|
const m = Array.from(S).sort(
|
|
723
|
-
(
|
|
723
|
+
(f, l) => u.get(l) - u.get(f)
|
|
724
724
|
);
|
|
725
725
|
let g = -1;
|
|
726
|
-
for (const
|
|
727
|
-
|
|
726
|
+
for (const f of m)
|
|
727
|
+
u.get(f) !== g && (g = u.get(f), x.add(-Math.round(g * 10))), x.add(f);
|
|
728
728
|
}
|
|
729
729
|
const w = s.length;
|
|
730
730
|
s.push(d);
|
|
@@ -736,18 +736,18 @@ function Vt(e, n) {
|
|
|
736
736
|
const t = c.get(d);
|
|
737
737
|
let { index: x, deps: S } = t;
|
|
738
738
|
x++;
|
|
739
|
-
for (const
|
|
740
|
-
if (typeof
|
|
741
|
-
s[x++] =
|
|
739
|
+
for (const u of S) {
|
|
740
|
+
if (typeof u == "number") {
|
|
741
|
+
s[x++] = u;
|
|
742
742
|
continue;
|
|
743
743
|
}
|
|
744
|
-
const m = c.get(
|
|
744
|
+
const m = c.get(u).index;
|
|
745
745
|
s[x++] = m;
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
return s;
|
|
749
749
|
}
|
|
750
|
-
async function
|
|
750
|
+
async function nn(e, n, s) {
|
|
751
751
|
const r = await e.dynamicImport("eslint");
|
|
752
752
|
let o = new r.ESLint({ cache: !0 });
|
|
753
753
|
if ((await o.calculateConfigForFile("no-real-file.tsx")).parser === null) {
|
|
@@ -772,16 +772,16 @@ async function en(e, n, s) {
|
|
|
772
772
|
return {
|
|
773
773
|
async lint(a, d, t) {
|
|
774
774
|
try {
|
|
775
|
-
const x =
|
|
775
|
+
const x = rn(t);
|
|
776
776
|
if (await o.isPathIgnored(x))
|
|
777
777
|
return null;
|
|
778
778
|
(await o.lintText(d, {
|
|
779
779
|
filePath: x
|
|
780
|
-
})).forEach((
|
|
781
|
-
for (const w of
|
|
780
|
+
})).forEach((u) => {
|
|
781
|
+
for (const w of u.messages) {
|
|
782
782
|
if (w.ruleId != null && !w.ruleId.startsWith("qwik/"))
|
|
783
783
|
continue;
|
|
784
|
-
const m =
|
|
784
|
+
const m = on(u.filePath, w);
|
|
785
785
|
a.warn(m);
|
|
786
786
|
}
|
|
787
787
|
});
|
|
@@ -791,10 +791,10 @@ async function en(e, n, s) {
|
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function rn(e) {
|
|
795
795
|
return e.split("?", 2)[0];
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function on(e, n) {
|
|
798
798
|
return Object.assign(new Error(n.message), {
|
|
799
799
|
id: e,
|
|
800
800
|
plugin: "vite-plugin-eslint",
|
|
@@ -806,21 +806,21 @@ function nn(e, n) {
|
|
|
806
806
|
stack: ""
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
|
-
async function
|
|
809
|
+
async function sn(e, n) {
|
|
810
810
|
const s = n;
|
|
811
811
|
let r = s.loc;
|
|
812
|
-
if (!s.frame && !s.plugin && (r || (r =
|
|
812
|
+
if (!s.frame && !s.plugin && (r || (r = an(s)), r && (s.loc = r, r.file))) {
|
|
813
813
|
const o = await e.dynamicImport("node:fs"), { normalizePath: p } = await e.dynamicImport("vite");
|
|
814
814
|
s.id = p(s.loc.file);
|
|
815
815
|
try {
|
|
816
816
|
const c = o.readFileSync(s.loc.file, "utf-8");
|
|
817
|
-
s.frame =
|
|
817
|
+
s.frame = cn(c, s.loc);
|
|
818
818
|
} catch {
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
return n;
|
|
822
822
|
}
|
|
823
|
-
const
|
|
823
|
+
const an = (e) => {
|
|
824
824
|
const n = e.stack;
|
|
825
825
|
if (typeof n == "string") {
|
|
826
826
|
const s = n.split(`
|
|
@@ -830,7 +830,7 @@ const on = (e) => {
|
|
|
830
830
|
if (/^\s+at/.test(o)) {
|
|
831
831
|
const p = o.indexOf("/"), c = o.lastIndexOf(")", p);
|
|
832
832
|
if (p > 0) {
|
|
833
|
-
const d = o.slice(p, c).split(":"), t =
|
|
833
|
+
const d = o.slice(p, c).split(":"), t = it(d[d.length - 1]), x = it(d[d.length - 2]);
|
|
834
834
|
return typeof t == "number" && typeof x == "number" ? (d.length -= 2, {
|
|
835
835
|
file: d.join(":"),
|
|
836
836
|
line: x,
|
|
@@ -848,32 +848,32 @@ const on = (e) => {
|
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
},
|
|
851
|
+
}, ee = (e) => e.startsWith("\0"), it = (e) => {
|
|
852
852
|
try {
|
|
853
853
|
return parseInt(e, 10);
|
|
854
854
|
} catch {
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
|
-
},
|
|
858
|
-
function
|
|
857
|
+
}, Tt = /\r?\n/, st = 2;
|
|
858
|
+
function ln(e, n) {
|
|
859
859
|
if (typeof n == "number")
|
|
860
860
|
return n;
|
|
861
861
|
if (n.lo != null)
|
|
862
862
|
return n.lo;
|
|
863
|
-
const s = e.split(
|
|
863
|
+
const s = e.split(Tt), { line: r, column: o } = n;
|
|
864
864
|
let p = 0;
|
|
865
865
|
for (let c = 0; c < r - 1 && c < s.length; c++)
|
|
866
866
|
p += s[c].length + 1;
|
|
867
867
|
return p + o;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
870
|
-
n =
|
|
871
|
-
const r = e.split(
|
|
869
|
+
function cn(e, n = 0, s) {
|
|
870
|
+
n = ln(e, n), s = s || n;
|
|
871
|
+
const r = e.split(Tt);
|
|
872
872
|
let o = 0;
|
|
873
873
|
const p = [];
|
|
874
874
|
for (let c = 0; c < r.length; c++)
|
|
875
875
|
if (o += r[c].length + 1, o >= n) {
|
|
876
|
-
for (let a = c -
|
|
876
|
+
for (let a = c - st; a <= c + st || s > o; a++) {
|
|
877
877
|
if (a < 0 || a >= r.length)
|
|
878
878
|
continue;
|
|
879
879
|
const d = a + 1;
|
|
@@ -895,10 +895,10 @@ function an(e, n = 0, s) {
|
|
|
895
895
|
return p.join(`
|
|
896
896
|
`);
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function dn(e) {
|
|
899
899
|
return e === "win32";
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function je(e) {
|
|
902
902
|
const [n, s] = e.split("?"), r = s || "";
|
|
903
903
|
return {
|
|
904
904
|
originalId: e,
|
|
@@ -907,7 +907,7 @@ function Le(e) {
|
|
|
907
907
|
params: new URLSearchParams(r)
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
const
|
|
910
|
+
const un = ["server"], fn = [
|
|
911
911
|
"onGet",
|
|
912
912
|
"onPost",
|
|
913
913
|
"onPut",
|
|
@@ -917,7 +917,7 @@ const cn = ["server"], dn = [
|
|
|
917
917
|
"onOptions",
|
|
918
918
|
"onPatch",
|
|
919
919
|
"onStaticGenerate"
|
|
920
|
-
],
|
|
920
|
+
], pn = [
|
|
921
921
|
"useServer",
|
|
922
922
|
"route",
|
|
923
923
|
"server",
|
|
@@ -926,7 +926,7 @@ const cn = ["server"], dn = [
|
|
|
926
926
|
"zod$",
|
|
927
927
|
"validator$",
|
|
928
928
|
"globalAction$"
|
|
929
|
-
],
|
|
929
|
+
], hn = [
|
|
930
930
|
"useClient",
|
|
931
931
|
"useBrowser",
|
|
932
932
|
"useVisibleTask",
|
|
@@ -934,8 +934,8 @@ const cn = ["server"], dn = [
|
|
|
934
934
|
"browser",
|
|
935
935
|
"event$"
|
|
936
936
|
];
|
|
937
|
-
var
|
|
938
|
-
function
|
|
937
|
+
var Ct = /* @__PURE__ */ ((e) => (e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(Ct || {});
|
|
938
|
+
function Pt(e = {}) {
|
|
939
939
|
const n = `${Math.round(Math.random() * 899) + 100}`, s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
940
940
|
let c = null, a, d = () => {
|
|
941
941
|
};
|
|
@@ -968,9 +968,9 @@ function Ct(e = {}) {
|
|
|
968
968
|
experimental: void 0
|
|
969
969
|
};
|
|
970
970
|
let x, S;
|
|
971
|
-
const
|
|
971
|
+
const u = async () => {
|
|
972
972
|
if (!c) {
|
|
973
|
-
c = await
|
|
973
|
+
c = await At(e), x = mn(c.sys);
|
|
974
974
|
try {
|
|
975
975
|
S === void 0 && (S = await c.sys.dynamicImport("node:fs"));
|
|
976
976
|
} catch {
|
|
@@ -982,95 +982,95 @@ function Ct(e = {}) {
|
|
|
982
982
|
throw new Error("Qwik plugin has not been initialized");
|
|
983
983
|
return c;
|
|
984
984
|
}, m = () => w().sys, g = () => w().sys.path;
|
|
985
|
-
let
|
|
986
|
-
const l = (
|
|
987
|
-
|
|
988
|
-
}, i = async (
|
|
989
|
-
const
|
|
990
|
-
t.debug = !!
|
|
991
|
-
let C =
|
|
992
|
-
if (typeof
|
|
993
|
-
t.scope =
|
|
985
|
+
let f;
|
|
986
|
+
const l = (k) => {
|
|
987
|
+
f = k;
|
|
988
|
+
}, i = async (k) => {
|
|
989
|
+
const b = Object.assign({}, k), _ = w(), N = _.sys.path, D = (...O) => Q(N.resolve(...O));
|
|
990
|
+
t.debug = !!b.debug, b.assetsDir && (t.assetsDir = b.assetsDir), b.target === "ssr" || b.target === "client" || b.target === "lib" || b.target === "test" ? t.target = b.target : t.target || (t.target = "client"), t.target === "lib" ? t.buildMode = "development" : b.buildMode === "production" || b.buildMode === "development" ? t.buildMode = b.buildMode : t.buildMode || (t.buildMode = "development"), t.csr = !!b.csr, b.entryStrategy && typeof b.entryStrategy == "object" && (t.entryStrategy = { ...b.entryStrategy }), t.entryStrategy || (t.target === "ssr" || t.target === "test" ? t.entryStrategy = { type: "hoist" } : t.target === "lib" ? t.entryStrategy = { type: "inline" } : t.buildMode === "production" ? t.entryStrategy = { type: "smart" } : t.entryStrategy = { type: "segment" }), typeof b.rootDir == "string" && (t.rootDir = b.rootDir), typeof t.rootDir != "string" && (t.rootDir || (t.rootDir = _.sys.cwd())), t.rootDir = D(_.sys.cwd(), t.rootDir);
|
|
991
|
+
let C = D(t.rootDir, bn);
|
|
992
|
+
if (typeof b.srcDir == "string" ? (t.srcDir = D(t.rootDir, b.srcDir), C = t.srcDir) : t.srcDir || (t.srcDir = C), t.srcDir = D(t.rootDir, t.srcDir), Array.isArray(b.tsconfigFileNames) && b.tsconfigFileNames.length > 0 && (t.tsconfigFileNames = b.tsconfigFileNames), !t.csr && !b.input && !t.input && (t.target === "ssr" ? t.input = [D(C, "entry.ssr")] : t.target === "client" ? t.input = [D(C, "root")] : t.input = void 0), b.outDir && (t.outDir = D(t.rootDir, b.outDir)), t.clientOutDir = D(t.rootDir, b.clientOutDir || at), t.ssrOutDir = D(t.rootDir, b.ssrOutDir || vn), t.target === "ssr" ? t.outDir || (t.outDir = t.ssrOutDir) : t.target === "lib" ? t.outDir || (t.outDir = D(t.rootDir, wn)) : t.outDir || (t.outDir = t.clientOutDir), typeof b.manifestOutput == "function" && (t.manifestOutput = b.manifestOutput), b.manifestInput && (t.manifestInput = et(b.manifestInput) || null), typeof b.transformedModuleOutput == "function" && (t.transformedModuleOutput = b.transformedModuleOutput), b.scope !== void 0)
|
|
993
|
+
t.scope = b.scope;
|
|
994
994
|
else if (!t.scope && S) {
|
|
995
995
|
let O = "";
|
|
996
996
|
try {
|
|
997
|
-
let
|
|
998
|
-
for (; O = N.resolve(
|
|
999
|
-
const M = N.resolve(
|
|
1000
|
-
if (M ===
|
|
997
|
+
let U = t.rootDir;
|
|
998
|
+
for (; O = N.resolve(U, "package.json"), !await S.promises.stat(O).catch(() => !1); ) {
|
|
999
|
+
const M = N.resolve(U, "..");
|
|
1000
|
+
if (M === U)
|
|
1001
1001
|
break;
|
|
1002
|
-
|
|
1002
|
+
U = M, O = "";
|
|
1003
1003
|
}
|
|
1004
1004
|
if (O) {
|
|
1005
1005
|
const M = await S.promises.readFile(O, "utf-8"), q = JSON.parse(M);
|
|
1006
1006
|
typeof q.name == "string" && (t.scope = q.name);
|
|
1007
1007
|
}
|
|
1008
|
-
} catch (
|
|
1008
|
+
} catch (U) {
|
|
1009
1009
|
console.warn(
|
|
1010
|
-
`could not read ${O || "package.json"} to determine package name, ignoring. (${
|
|
1010
|
+
`could not read ${O || "package.json"} to determine package name, ignoring. (${U})`
|
|
1011
1011
|
);
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
-
if (typeof
|
|
1014
|
+
if (typeof b.resolveQwikBuild == "boolean" && (t.resolveQwikBuild = b.resolveQwikBuild), typeof b.devTools == "object" && ("imageDevTools" in b.devTools && (t.devTools.imageDevTools = b.devTools.imageDevTools), "clickToSource" in b.devTools && (t.devTools.clickToSource = b.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? t.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof t.inlineStylesUpToBytes != "number" || t.inlineStylesUpToBytes < 0) && (t.inlineStylesUpToBytes = 0)), typeof b.lint == "boolean" && (t.lint = b.lint), "experimental" in b) {
|
|
1015
1015
|
t.experimental = void 0;
|
|
1016
|
-
for (const O of
|
|
1017
|
-
|
|
1016
|
+
for (const O of b.experimental ?? [])
|
|
1017
|
+
Ct[O] ? (t.experimental || (t.experimental = {}))[O] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${O}`);
|
|
1018
1018
|
}
|
|
1019
|
-
const
|
|
1020
|
-
return t.input || (t.input =
|
|
1019
|
+
const R = { ...t };
|
|
1020
|
+
return t.input || (t.input = b.input), t.input && typeof t.input == "string" && (t.input = [t.input]), R;
|
|
1021
1021
|
};
|
|
1022
|
-
let
|
|
1023
|
-
const h = async (
|
|
1024
|
-
if (!
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1028
|
-
const _ = await
|
|
1022
|
+
let y = !1;
|
|
1023
|
+
const h = async (k) => {
|
|
1024
|
+
if (!y) {
|
|
1025
|
+
y = !0;
|
|
1026
|
+
const b = m();
|
|
1027
|
+
if (b.env === "node") {
|
|
1028
|
+
const _ = await b.dynamicImport("node:fs");
|
|
1029
1029
|
if (!_.existsSync(t.rootDir))
|
|
1030
1030
|
throw new Error(`Qwik rootDir "${t.rootDir}" not found.`);
|
|
1031
1031
|
if (typeof t.srcDir == "string" && !_.existsSync(t.srcDir))
|
|
1032
1032
|
throw new Error(`Qwik srcDir "${t.srcDir}" not found.`);
|
|
1033
|
-
for (const [N,
|
|
1034
|
-
if (!await
|
|
1035
|
-
throw new Error(`Qwik input "${
|
|
1033
|
+
for (const [N, D] of Object.entries(t.input || {}))
|
|
1034
|
+
if (!await k(D))
|
|
1035
|
+
throw new Error(`Qwik input "${D}" not found.`);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
};
|
|
1039
1039
|
let I, v = !1;
|
|
1040
|
-
const T = async (
|
|
1041
|
-
if (
|
|
1040
|
+
const T = async (k) => {
|
|
1041
|
+
if (j("buildStart()", t.buildMode, t.scope, t.target, t.rootDir, t.srcDir), I = w(), v = !f, I.sys.env === "node" && t.target === "ssr" && t.lint)
|
|
1042
1042
|
try {
|
|
1043
|
-
a = await
|
|
1043
|
+
a = await nn(I.sys, t.rootDir, t.tsconfigFileNames);
|
|
1044
1044
|
} catch {
|
|
1045
1045
|
}
|
|
1046
|
-
if (
|
|
1047
|
-
const
|
|
1046
|
+
if (j("transformedOutputs.clear()"), r.clear(), o.clear(), t.target === "client") {
|
|
1047
|
+
const b = await k.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
1048
1048
|
skipSelf: !0
|
|
1049
1049
|
});
|
|
1050
|
-
|
|
1051
|
-
id:
|
|
1050
|
+
b && k.emitFile({
|
|
1051
|
+
id: b.id,
|
|
1052
1052
|
type: "chunk",
|
|
1053
1053
|
preserveSignature: "allow-extension"
|
|
1054
1054
|
});
|
|
1055
1055
|
}
|
|
1056
|
-
},
|
|
1057
|
-
let
|
|
1058
|
-
const L = async (
|
|
1059
|
-
if (
|
|
1056
|
+
}, E = (k) => f ? !!k?.ssr : t.target === "ssr" || t.target === "test";
|
|
1057
|
+
let P = 0, $ = !1;
|
|
1058
|
+
const L = async (k, b, _, N) => {
|
|
1059
|
+
if (ee(b))
|
|
1060
1060
|
return;
|
|
1061
|
-
const
|
|
1062
|
-
if (
|
|
1061
|
+
const D = f && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(b);
|
|
1062
|
+
if (D) {
|
|
1063
1063
|
if (!$) {
|
|
1064
1064
|
$ = !0, setTimeout(() => $ = !1, 500);
|
|
1065
|
-
const [,
|
|
1066
|
-
if (
|
|
1067
|
-
const
|
|
1068
|
-
if (
|
|
1069
|
-
const
|
|
1065
|
+
const [, K, z] = D, ce = await k.resolve(K, _);
|
|
1066
|
+
if (ce) {
|
|
1067
|
+
const ae = f.moduleGraph.getModuleById(ce.id)?.file;
|
|
1068
|
+
if (ae) {
|
|
1069
|
+
const te = `${ae}${z}`;
|
|
1070
1070
|
try {
|
|
1071
|
-
console.warn(`Opening in editor: ${
|
|
1071
|
+
console.warn(`Opening in editor: ${te}`);
|
|
1072
1072
|
const Y = (await import("launch-editor")).default;
|
|
1073
|
-
Y(
|
|
1073
|
+
Y(te);
|
|
1074
1074
|
} catch (Y) {
|
|
1075
1075
|
console.error(`Failed to open editor: ${Y.message}`);
|
|
1076
1076
|
}
|
|
@@ -1079,14 +1079,14 @@ function Ct(e = {}) {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
return { id: "\0editor" };
|
|
1081
1081
|
}
|
|
1082
|
-
const C =
|
|
1083
|
-
|
|
1084
|
-
const O = _ &&
|
|
1085
|
-
if (_ = O &&
|
|
1086
|
-
const
|
|
1087
|
-
z && (
|
|
1082
|
+
const C = P++, R = E(N);
|
|
1083
|
+
j(`resolveId(${C})`, `begin ${b} | ${R ? "server" : "client"} | ${_}`);
|
|
1084
|
+
const O = _ && je(_);
|
|
1085
|
+
if (_ = O && Q(O.pathId), b.startsWith(".") && O) {
|
|
1086
|
+
const K = g(), z = K.dirname(O.pathId);
|
|
1087
|
+
z && (b = K.resolve(z, b));
|
|
1088
1088
|
}
|
|
1089
|
-
const
|
|
1089
|
+
const U = je(b), M = Q(U.pathId);
|
|
1090
1090
|
let q;
|
|
1091
1091
|
if (
|
|
1092
1092
|
/**
|
|
@@ -1095,8 +1095,8 @@ function Ct(e = {}) {
|
|
|
1095
1095
|
*/
|
|
1096
1096
|
p.get(M)
|
|
1097
1097
|
)
|
|
1098
|
-
|
|
1099
|
-
id: M +
|
|
1098
|
+
j(`resolveId(${C}) Resolved already known ${M}`), q = {
|
|
1099
|
+
id: M + U.query,
|
|
1100
1100
|
moduleSideEffects: !1
|
|
1101
1101
|
};
|
|
1102
1102
|
else if (
|
|
@@ -1105,54 +1105,54 @@ function Ct(e = {}) {
|
|
|
1105
1105
|
* been transformed yet.
|
|
1106
1106
|
*/
|
|
1107
1107
|
// We test with endsWith because the dev server adds the base pathname
|
|
1108
|
-
M.endsWith(
|
|
1108
|
+
M.endsWith(ne)
|
|
1109
1109
|
)
|
|
1110
|
-
t.resolveQwikBuild && (
|
|
1111
|
-
id:
|
|
1110
|
+
t.resolveQwikBuild && (j(`resolveId(${C})`, "Resolved", ne), q = {
|
|
1111
|
+
id: ne,
|
|
1112
1112
|
moduleSideEffects: !1
|
|
1113
1113
|
});
|
|
1114
|
-
else if (M.endsWith(
|
|
1115
|
-
|
|
1116
|
-
id:
|
|
1114
|
+
else if (M.endsWith(re))
|
|
1115
|
+
j(`resolveId(${C})`, "Resolved", re), q = {
|
|
1116
|
+
id: re,
|
|
1117
1117
|
moduleSideEffects: !1
|
|
1118
1118
|
};
|
|
1119
|
-
else if (!
|
|
1120
|
-
|
|
1121
|
-
const
|
|
1119
|
+
else if (!f && !R && M.endsWith(He)) {
|
|
1120
|
+
j(`resolveId(${C})`, "Resolved", He);
|
|
1121
|
+
const K = await k.resolve(He, _, {
|
|
1122
1122
|
skipSelf: !0
|
|
1123
1123
|
});
|
|
1124
|
-
if (
|
|
1125
|
-
return
|
|
1126
|
-
id:
|
|
1124
|
+
if (K)
|
|
1125
|
+
return k.emitFile({
|
|
1126
|
+
id: K.id,
|
|
1127
1127
|
type: "chunk",
|
|
1128
1128
|
preserveSignature: "allow-extension"
|
|
1129
|
-
}),
|
|
1130
|
-
} else if (M.endsWith(
|
|
1131
|
-
|
|
1132
|
-
id:
|
|
1129
|
+
}), K;
|
|
1130
|
+
} else if (M.endsWith(pe))
|
|
1131
|
+
j(`resolveId(${C})`, "Resolved", pe), q = {
|
|
1132
|
+
id: pe,
|
|
1133
1133
|
moduleSideEffects: !1
|
|
1134
1134
|
};
|
|
1135
1135
|
else {
|
|
1136
|
-
if (!
|
|
1136
|
+
if (!R && v && b.endsWith("@qwik.dev/core")) {
|
|
1137
1137
|
v = !1;
|
|
1138
|
-
const z = await
|
|
1138
|
+
const z = await k.resolve("@qwik.dev/core/handlers.mjs", _, {
|
|
1139
1139
|
skipSelf: !0
|
|
1140
1140
|
});
|
|
1141
1141
|
if (!z)
|
|
1142
1142
|
throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
|
|
1143
|
-
|
|
1143
|
+
k.emitFile({
|
|
1144
1144
|
id: z.id,
|
|
1145
1145
|
type: "chunk",
|
|
1146
1146
|
preserveSignature: "allow-extension"
|
|
1147
1147
|
});
|
|
1148
1148
|
}
|
|
1149
|
-
const
|
|
1150
|
-
if (
|
|
1151
|
-
const { parent: z, name:
|
|
1152
|
-
if (
|
|
1153
|
-
const Y =
|
|
1154
|
-
|
|
1155
|
-
id:
|
|
1149
|
+
const K = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(b)?.groups;
|
|
1150
|
+
if (K) {
|
|
1151
|
+
const { parent: z, name: ce, query: ae } = K, te = await k.resolve(z, _, { skipSelf: !0 });
|
|
1152
|
+
if (te) {
|
|
1153
|
+
const Y = te.id.split("?")[0], Le = f && _?.endsWith(".html") ? `${Y}_${ce}.js` : M;
|
|
1154
|
+
j(`resolveId(${C})`, `resolved to QRL ${ce} of ${Y}`), p.set(Le, Y), q = {
|
|
1155
|
+
id: Le + ae,
|
|
1156
1156
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
1157
1157
|
moduleSideEffects: !1
|
|
1158
1158
|
};
|
|
@@ -1161,79 +1161,79 @@ function Ct(e = {}) {
|
|
|
1161
1161
|
} else if (_) {
|
|
1162
1162
|
const z = p.get(_);
|
|
1163
1163
|
if (z)
|
|
1164
|
-
return
|
|
1164
|
+
return j(`resolveId(${C}) end`, `resolving via ${z}`), k.resolve(b, z, { skipSelf: !0 });
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
|
-
return
|
|
1167
|
+
return j(`resolveId(${C}) end`, q?.id || q), q;
|
|
1168
1168
|
};
|
|
1169
1169
|
let B = 0;
|
|
1170
|
-
const H = async (
|
|
1171
|
-
if (
|
|
1170
|
+
const H = async (k, b, _) => {
|
|
1171
|
+
if (b === "\0editor")
|
|
1172
1172
|
return '"opening in editor"';
|
|
1173
|
-
if (
|
|
1173
|
+
if (ee(b) || b.startsWith("/@fs/"))
|
|
1174
1174
|
return;
|
|
1175
|
-
const N = B++,
|
|
1176
|
-
if (t.resolveQwikBuild &&
|
|
1177
|
-
return
|
|
1175
|
+
const N = B++, D = E(_);
|
|
1176
|
+
if (t.resolveQwikBuild && b === ne)
|
|
1177
|
+
return j(`load(${N})`, ne, t.buildMode), {
|
|
1178
1178
|
moduleSideEffects: !1,
|
|
1179
|
-
code:
|
|
1179
|
+
code: se(D, t.target)
|
|
1180
1180
|
};
|
|
1181
|
-
if (
|
|
1182
|
-
return
|
|
1181
|
+
if (b === re)
|
|
1182
|
+
return j(`load(${N})`, re, t.buildMode), {
|
|
1183
1183
|
moduleSideEffects: !1,
|
|
1184
|
-
code: await
|
|
1184
|
+
code: await Me(D)
|
|
1185
1185
|
};
|
|
1186
|
-
if (
|
|
1187
|
-
return
|
|
1186
|
+
if (b === pe)
|
|
1187
|
+
return j(`load(${N})`, pe, t.buildMode), {
|
|
1188
1188
|
moduleSideEffects: !1,
|
|
1189
1189
|
code: "export * from '@qwik.dev/core';"
|
|
1190
1190
|
};
|
|
1191
|
-
const C =
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
const
|
|
1196
|
-
if (
|
|
1197
|
-
const M =
|
|
1191
|
+
const C = je(b);
|
|
1192
|
+
b = Q(C.pathId);
|
|
1193
|
+
const R = D ? o : r;
|
|
1194
|
+
if (f && !R.has(b)) {
|
|
1195
|
+
const U = p.get(b);
|
|
1196
|
+
if (U) {
|
|
1197
|
+
const M = f.moduleGraph.getModuleById(U);
|
|
1198
1198
|
if (M) {
|
|
1199
|
-
if (
|
|
1200
|
-
return
|
|
1199
|
+
if (j(`load(${N})`, "transforming QRL parent", U), await f.transformRequest(M.url), !R.has(b))
|
|
1200
|
+
return j(`load(${N})`, `QRL segment ${b} not found in ${U}`), null;
|
|
1201
1201
|
} else
|
|
1202
1202
|
console.error(`load(${N})`, `${M} does not exist!`);
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
|
-
const O =
|
|
1205
|
+
const O = R.get(b);
|
|
1206
1206
|
if (O) {
|
|
1207
|
-
|
|
1208
|
-
const { code:
|
|
1209
|
-
return { code:
|
|
1210
|
-
}
|
|
1211
|
-
return
|
|
1212
|
-
};
|
|
1213
|
-
let
|
|
1214
|
-
const
|
|
1215
|
-
if (_
|
|
1207
|
+
j(`load(${N})`, "Found", b);
|
|
1208
|
+
const { code: U, map: M, segment: q } = O[0];
|
|
1209
|
+
return { code: U, map: M, meta: { segment: q } };
|
|
1210
|
+
}
|
|
1211
|
+
return j(`load(${N})`, "Not a QRL or virtual module", b), null;
|
|
1212
|
+
}, J = (k, b) => !!(f && k.includes(".vite/deps/") && b.slice(0, 1e4).includes("qwik"));
|
|
1213
|
+
let ie = 0;
|
|
1214
|
+
const W = async function(k, b, _, N = {}) {
|
|
1215
|
+
if (ee(_))
|
|
1216
1216
|
return;
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1217
|
+
const D = ie++, C = E(N), R = C ? o : r;
|
|
1218
|
+
if (R.has(_))
|
|
1219
1219
|
return;
|
|
1220
|
-
const O = w(),
|
|
1221
|
-
if (q.ext.toLowerCase() in
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1224
|
-
`transform(${
|
|
1225
|
-
`Transforming ${_} (for: ${C ? "server" : "client"}${
|
|
1220
|
+
const O = w(), U = g(), { pathId: M } = je(_), q = U.parse(M), K = q.dir, z = q.base;
|
|
1221
|
+
if (q.ext.toLowerCase() in yn || Dt.test(M) || J(_, b)) {
|
|
1222
|
+
const ae = t.target === "client" || t.target === "ssr";
|
|
1223
|
+
j(
|
|
1224
|
+
`transform(${D})`,
|
|
1225
|
+
`Transforming ${_} (for: ${C ? "server" : "client"}${ae ? ", strip" : ""})`
|
|
1226
1226
|
);
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1227
|
+
const te = t.target === "lib" ? "lib" : t.buildMode === "development" ? "dev" : "prod";
|
|
1228
|
+
te !== "lib" && (b = b.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (Z, le) => t.experimental?.[le] ? "true" : "false"));
|
|
1229
1229
|
let Y = z;
|
|
1230
|
-
t.srcDir && (Y =
|
|
1231
|
-
const
|
|
1232
|
-
let
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1235
|
-
input: [{ code:
|
|
1236
|
-
entryStrategy: C ? { type: "hoist" } :
|
|
1230
|
+
t.srcDir && (Y = U.relative(t.srcDir, M)), Y = Q(Y);
|
|
1231
|
+
const qe = t.srcDir ? t.srcDir : Q(K), Le = t.entryStrategy;
|
|
1232
|
+
let Xe;
|
|
1233
|
+
f && (Xe = f.moduleGraph.getModuleById(M)?.url);
|
|
1234
|
+
const de = {
|
|
1235
|
+
input: [{ code: b, path: Y, devPath: Xe }],
|
|
1236
|
+
entryStrategy: C ? { type: "hoist" } : Le,
|
|
1237
1237
|
minify: "simplify",
|
|
1238
1238
|
// Always enable sourcemaps in dev for click-to-source
|
|
1239
1239
|
sourceMaps: t.sourcemap || t.buildMode === "development",
|
|
@@ -1241,88 +1241,88 @@ function Ct(e = {}) {
|
|
|
1241
1241
|
transpileJsx: !0,
|
|
1242
1242
|
explicitExtensions: !0,
|
|
1243
1243
|
preserveFilenames: !0,
|
|
1244
|
-
srcDir:
|
|
1244
|
+
srcDir: qe,
|
|
1245
1245
|
rootDir: t.rootDir,
|
|
1246
|
-
mode:
|
|
1246
|
+
mode: te,
|
|
1247
1247
|
scope: t.scope || void 0,
|
|
1248
1248
|
isServer: C
|
|
1249
1249
|
};
|
|
1250
|
-
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1253
|
-
const
|
|
1254
|
-
d(
|
|
1255
|
-
const
|
|
1256
|
-
for (const
|
|
1257
|
-
if (
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
id:
|
|
1250
|
+
ae && (C ? (de.stripCtxName = hn, de.stripEventHandlers = !0, de.regCtxName = un) : (de.stripCtxName = pn, de.stripExports = fn));
|
|
1251
|
+
const jt = Date.now(), fe = await O.transformModules(de);
|
|
1252
|
+
j(`transform(${D})`, `done in ${Date.now() - jt}ms`);
|
|
1253
|
+
const Oe = fe.modules.find((Z) => !gn(Z));
|
|
1254
|
+
d(fe.diagnostics, O, qe), C ? fe.diagnostics.length === 0 && a && a.lint(k, b, _) : s.set(_, fe);
|
|
1255
|
+
const Fe = /* @__PURE__ */ new Set();
|
|
1256
|
+
for (const Z of fe.modules)
|
|
1257
|
+
if (Z !== Oe) {
|
|
1258
|
+
const le = Q(U.join(qe, Z.path));
|
|
1259
|
+
j(`transform(${D})`, `segment ${le}`, Z.segment.displayName), p.set(le, _), R.set(le, [Z, _]), Fe.add(le), t.target === "client" && !f && k.emitFile({
|
|
1260
|
+
id: le,
|
|
1261
1261
|
type: "chunk",
|
|
1262
1262
|
preserveSignature: "allow-extension"
|
|
1263
1263
|
});
|
|
1264
1264
|
}
|
|
1265
|
-
return await Promise.all([...
|
|
1266
|
-
code:
|
|
1267
|
-
map:
|
|
1265
|
+
return await Promise.all([...Fe.values()].map((Z) => k.load({ id: Z }))), k.addWatchFile(_), {
|
|
1266
|
+
code: Oe.code,
|
|
1267
|
+
map: Oe.map,
|
|
1268
1268
|
meta: {
|
|
1269
|
-
segment:
|
|
1270
|
-
qwikdeps: Array.from(
|
|
1269
|
+
segment: Oe.segment,
|
|
1270
|
+
qwikdeps: Array.from(Fe)
|
|
1271
1271
|
}
|
|
1272
1272
|
};
|
|
1273
1273
|
}
|
|
1274
|
-
return
|
|
1275
|
-
},
|
|
1276
|
-
const
|
|
1277
|
-
addInjection: (N) =>
|
|
1274
|
+
return j(`transform(${D})`, "Not transforming", _), null;
|
|
1275
|
+
}, X = (k) => {
|
|
1276
|
+
const b = [], _ = {
|
|
1277
|
+
addInjection: (N) => b.push(N)
|
|
1278
1278
|
};
|
|
1279
1279
|
return _.generateManifest = async (N) => {
|
|
1280
|
-
const C = w().sys.path,
|
|
1280
|
+
const C = w().sys.path, R = C.resolve(t.rootDir, t.outDir, "build"), O = (q) => C.relative(R, C.resolve(t.rootDir, t.outDir, q));
|
|
1281
1281
|
_.canonPath = O;
|
|
1282
|
-
const
|
|
1282
|
+
const U = Array.from(s.values()).flatMap((q) => q.modules).map((q) => q.segment).filter((q) => !!q), M = Xt(
|
|
1283
1283
|
C,
|
|
1284
|
-
j,
|
|
1285
|
-
y,
|
|
1286
|
-
E,
|
|
1287
|
-
t,
|
|
1288
1284
|
U,
|
|
1285
|
+
b,
|
|
1286
|
+
k,
|
|
1287
|
+
t,
|
|
1288
|
+
j,
|
|
1289
1289
|
O
|
|
1290
1290
|
);
|
|
1291
1291
|
N && Object.assign(M, N);
|
|
1292
1292
|
for (const q of Object.values(M.symbols))
|
|
1293
|
-
q.origin && (q.origin =
|
|
1293
|
+
q.origin && (q.origin = Q(q.origin));
|
|
1294
1294
|
for (const q of Object.values(M.bundles))
|
|
1295
1295
|
q.origins && (q.origins = q.origins.sort());
|
|
1296
|
-
return M.manifestHash =
|
|
1296
|
+
return M.manifestHash = Ht(JSON.stringify(M)), M;
|
|
1297
1297
|
}, _;
|
|
1298
|
-
},
|
|
1299
|
-
t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ...
|
|
1300
|
-
},
|
|
1301
|
-
console.log(`[QWIK PLUGIN: ${n}]`, ...
|
|
1302
|
-
},
|
|
1303
|
-
d =
|
|
1304
|
-
},
|
|
1305
|
-
function
|
|
1298
|
+
}, V = () => t, ue = () => Array.from(r.values()).map((k) => k[0]), j = (...k) => {
|
|
1299
|
+
t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ...k);
|
|
1300
|
+
}, G = (...k) => {
|
|
1301
|
+
console.log(`[QWIK PLUGIN: ${n}]`, ...k);
|
|
1302
|
+
}, Ne = (k) => {
|
|
1303
|
+
d = k;
|
|
1304
|
+
}, Q = (k) => x(k);
|
|
1305
|
+
function se(k, b) {
|
|
1306
1306
|
const _ = t.buildMode === "development";
|
|
1307
1307
|
return `// @qwik.dev/core/build
|
|
1308
|
-
export const isServer = ${JSON.stringify(
|
|
1309
|
-
export const isBrowser = ${JSON.stringify(!
|
|
1308
|
+
export const isServer = ${JSON.stringify(k)};
|
|
1309
|
+
export const isBrowser = ${JSON.stringify(!k)};
|
|
1310
1310
|
export const isDev = ${JSON.stringify(_)};
|
|
1311
1311
|
`;
|
|
1312
1312
|
}
|
|
1313
|
-
async function
|
|
1313
|
+
async function Me(k) {
|
|
1314
1314
|
if (!t.manifestInput && t.target === "ssr" && t.buildMode === "production" && S) {
|
|
1315
1315
|
const N = g();
|
|
1316
|
-
let
|
|
1317
|
-
await S.promises.stat(
|
|
1316
|
+
let D = N.resolve(t.clientOutDir, We);
|
|
1317
|
+
await S.promises.stat(D).catch(() => !1) || (D = N.resolve(t.rootDir, at, We));
|
|
1318
1318
|
try {
|
|
1319
|
-
const C = await S.promises.readFile(
|
|
1320
|
-
t.manifestInput =
|
|
1319
|
+
const C = await S.promises.readFile(D, "utf-8");
|
|
1320
|
+
t.manifestInput = et(JSON.parse(C)) || null, console.info("Read client manifest from", D);
|
|
1321
1321
|
} catch (C) {
|
|
1322
1322
|
console.warn(
|
|
1323
1323
|
`
|
|
1324
1324
|
==========
|
|
1325
|
-
Could not read Qwik client manifest ${
|
|
1325
|
+
Could not read Qwik client manifest ${D}.
|
|
1326
1326
|
Make sure you provide it 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__\`.
|
|
1327
1327
|
Without the manifest, the SSR renderer will not be able to generate event handlers.
|
|
1328
1328
|
(${C})
|
|
@@ -1331,138 +1331,153 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1331
1331
|
);
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
|
-
const
|
|
1334
|
+
const b = k ? t.manifestInput : null;
|
|
1335
1335
|
let _ = null;
|
|
1336
|
-
return
|
|
1337
|
-
manifestHash:
|
|
1338
|
-
core:
|
|
1339
|
-
preloader:
|
|
1340
|
-
qwikLoader:
|
|
1341
|
-
bundleGraphAsset:
|
|
1342
|
-
injections:
|
|
1343
|
-
mapping:
|
|
1344
|
-
bundleGraph:
|
|
1336
|
+
return b?.manifestHash && (_ = {
|
|
1337
|
+
manifestHash: b.manifestHash,
|
|
1338
|
+
core: b.core,
|
|
1339
|
+
preloader: b.preloader,
|
|
1340
|
+
qwikLoader: b.qwikLoader,
|
|
1341
|
+
bundleGraphAsset: b.bundleGraphAsset,
|
|
1342
|
+
injections: b.injections,
|
|
1343
|
+
mapping: b.mapping,
|
|
1344
|
+
bundleGraph: b.bundleGraph
|
|
1345
1345
|
}), `// @qwik-client-manifest
|
|
1346
1346
|
export const manifest = ${_ ? JSON.stringify(_) : "globalThis.__QWIK_MANIFEST__"};
|
|
1347
1347
|
`;
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1350
|
-
t.sourcemap =
|
|
1349
|
+
function Mt(k) {
|
|
1350
|
+
t.sourcemap = k;
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1353
|
-
|
|
1354
|
-
for (const
|
|
1355
|
-
const { id: _ } =
|
|
1352
|
+
function qt(k) {
|
|
1353
|
+
j("handleHotUpdate()", k.file);
|
|
1354
|
+
for (const b of k.modules) {
|
|
1355
|
+
const { id: _ } = b;
|
|
1356
1356
|
if (_) {
|
|
1357
|
-
|
|
1357
|
+
j("handleHotUpdate()", `invalidate ${_}`), s.delete(_);
|
|
1358
1358
|
for (const N of [r, o])
|
|
1359
|
-
for (const [
|
|
1360
|
-
if (
|
|
1361
|
-
|
|
1362
|
-
const O =
|
|
1363
|
-
O &&
|
|
1359
|
+
for (const [D, [C, R]] of N)
|
|
1360
|
+
if (R === _) {
|
|
1361
|
+
j("handleHotUpdate()", `invalidate ${_} segment ${D}`), N.delete(D);
|
|
1362
|
+
const O = k.server.moduleGraph.getModuleById(D);
|
|
1363
|
+
O && k.server.moduleGraph.invalidateModule(O);
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
const
|
|
1368
|
+
const Lt = (k, { getModuleInfo: b }) => {
|
|
1369
1369
|
if (t.target === "client") {
|
|
1370
1370
|
if (
|
|
1371
1371
|
// The preloader has to stay in a separate chunk if it's a client build
|
|
1372
1372
|
// the vite preload helper must be included or to prevent breaking circular dependencies
|
|
1373
|
-
|
|
1373
|
+
k.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(k) || k === "\0vite/preload-helper.js"
|
|
1374
1374
|
)
|
|
1375
1375
|
return "qwik-preloader";
|
|
1376
1376
|
if (
|
|
1377
1377
|
// likewise, core and handlers have to be in the same chunk so there's no import waterfall
|
|
1378
|
-
/[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(
|
|
1378
|
+
/[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(k)
|
|
1379
1379
|
)
|
|
1380
1380
|
return "qwik-core";
|
|
1381
|
-
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(
|
|
1381
|
+
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(k))
|
|
1382
1382
|
return "qwik-loader";
|
|
1383
1383
|
}
|
|
1384
|
-
const _ =
|
|
1384
|
+
const _ = b(k);
|
|
1385
1385
|
if (_) {
|
|
1386
1386
|
const N = _.meta.segment;
|
|
1387
1387
|
if (N) {
|
|
1388
|
-
const { hash:
|
|
1388
|
+
const { hash: D } = N, C = t.entryStrategy.manual?.[D] || N.entry;
|
|
1389
1389
|
if (C)
|
|
1390
1390
|
return C;
|
|
1391
1391
|
}
|
|
1392
1392
|
if (_.meta.qwikdeps?.length === 0) {
|
|
1393
|
-
if (
|
|
1394
|
-
const
|
|
1395
|
-
if (
|
|
1396
|
-
return
|
|
1397
|
-
} else if (t.srcDir &&
|
|
1398
|
-
const
|
|
1399
|
-
return
|
|
1393
|
+
if (k.includes("node_modules")) {
|
|
1394
|
+
const D = k.lastIndexOf("node_modules");
|
|
1395
|
+
if (D >= 0)
|
|
1396
|
+
return k.slice(D + 13);
|
|
1397
|
+
} else if (t.srcDir && k.includes(t.srcDir)) {
|
|
1398
|
+
const D = g();
|
|
1399
|
+
return Q(D.relative(t.srcDir, k));
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
1403
|
return null;
|
|
1404
1404
|
};
|
|
1405
|
-
async function
|
|
1406
|
-
const C = await
|
|
1405
|
+
async function Ot(k, b, _, N) {
|
|
1406
|
+
const C = await X(b).generateManifest(N);
|
|
1407
1407
|
C.platform = {
|
|
1408
1408
|
...N?.platform,
|
|
1409
|
-
rollup:
|
|
1409
|
+
rollup: k.meta?.rollupVersion || "",
|
|
1410
1410
|
env: I.sys.env,
|
|
1411
1411
|
os: I.sys.os
|
|
1412
1412
|
}, I.sys.env === "node" && (C.platform.node = process.versions.node);
|
|
1413
|
-
const
|
|
1413
|
+
const R = tn(C, _), O = k.emitFile({
|
|
1414
1414
|
type: "asset",
|
|
1415
1415
|
name: "bundle-graph.json",
|
|
1416
|
-
source: JSON.stringify(
|
|
1417
|
-
}),
|
|
1418
|
-
C.bundleGraphAsset =
|
|
1416
|
+
source: JSON.stringify(R)
|
|
1417
|
+
}), U = k.getFileName(O);
|
|
1418
|
+
C.bundleGraphAsset = U, C.assets[U] = {
|
|
1419
1419
|
name: "bundle-graph.json",
|
|
1420
|
-
size:
|
|
1420
|
+
size: R.length
|
|
1421
1421
|
};
|
|
1422
1422
|
const M = JSON.stringify(C, null, " ");
|
|
1423
|
-
|
|
1424
|
-
fileName:
|
|
1423
|
+
k.emitFile({
|
|
1424
|
+
fileName: We,
|
|
1425
1425
|
type: "asset",
|
|
1426
1426
|
source: M
|
|
1427
|
-
}), typeof t.manifestOutput == "function" && await t.manifestOutput(C), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(
|
|
1427
|
+
}), typeof t.manifestOutput == "function" && await t.manifestOutput(C), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(ue());
|
|
1428
1428
|
}
|
|
1429
1429
|
return {
|
|
1430
1430
|
buildStart: T,
|
|
1431
|
-
createOutputAnalyzer:
|
|
1432
|
-
getQwikBuildModule:
|
|
1431
|
+
createOutputAnalyzer: X,
|
|
1432
|
+
getQwikBuildModule: se,
|
|
1433
1433
|
getOptimizer: w,
|
|
1434
|
-
getOptions:
|
|
1434
|
+
getOptions: V,
|
|
1435
1435
|
getPath: g,
|
|
1436
1436
|
getSys: m,
|
|
1437
|
-
getTransformedOutputs:
|
|
1438
|
-
init:
|
|
1437
|
+
getTransformedOutputs: ue,
|
|
1438
|
+
init: u,
|
|
1439
1439
|
load: H,
|
|
1440
|
-
debug:
|
|
1441
|
-
log:
|
|
1440
|
+
debug: j,
|
|
1441
|
+
log: G,
|
|
1442
1442
|
normalizeOptions: i,
|
|
1443
|
-
normalizePath:
|
|
1444
|
-
onDiagnostics:
|
|
1443
|
+
normalizePath: Q,
|
|
1444
|
+
onDiagnostics: Ne,
|
|
1445
1445
|
resolveId: L,
|
|
1446
|
-
transform:
|
|
1446
|
+
transform: W,
|
|
1447
1447
|
validateSource: h,
|
|
1448
|
-
setSourceMapSupport:
|
|
1448
|
+
setSourceMapSupport: Mt,
|
|
1449
1449
|
configureServer: l,
|
|
1450
|
-
handleHotUpdate:
|
|
1451
|
-
manualChunks:
|
|
1452
|
-
generateManifest:
|
|
1450
|
+
handleHotUpdate: qt,
|
|
1451
|
+
manualChunks: Lt,
|
|
1452
|
+
generateManifest: Ot
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1456
|
-
function
|
|
1455
|
+
const mn = (e) => (n) => typeof n == "string" ? dn(e.os) ? (n.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(n) || (n = n.replace(/\\/g, "/")), e.path.posix.normalize(n)) : e.path.normalize(n) : n;
|
|
1456
|
+
function gn(e) {
|
|
1457
1457
|
return e.isEntry || e.segment;
|
|
1458
1458
|
}
|
|
1459
|
-
const
|
|
1459
|
+
const yn = {
|
|
1460
1460
|
".jsx": !0,
|
|
1461
1461
|
".ts": !0,
|
|
1462
1462
|
".tsx": !0
|
|
1463
|
-
},
|
|
1464
|
-
function
|
|
1465
|
-
const
|
|
1463
|
+
}, Dt = /\.qwik\.[mc]?js$/, Ue = "@qwik.dev/core", Be = "@qwik.dev/core/internal", ne = "@qwik.dev/core/build", Ke = "@qwik.dev/core/jsx-runtime", Je = "@qwik.dev/core/jsx-dev-runtime", ze = "@qwik.dev/core/server", re = "@qwik-client-manifest", He = "@qwik.dev/core/preloader", pe = "@qwik-handlers", bn = "src", at = "dist", vn = "server", wn = "lib", We = "q-manifest.json";
|
|
1464
|
+
async function xn(e, n, s) {
|
|
1465
|
+
const r = await e.dynamicImport("node:fs");
|
|
1466
|
+
let o = s;
|
|
1467
|
+
for (; o; ) {
|
|
1468
|
+
const p = e.path.join(o, "node_modules", n, "package.json");
|
|
1469
|
+
try {
|
|
1470
|
+
return await r.promises.access(p), r.promises.realpath(p);
|
|
1471
|
+
} catch {
|
|
1472
|
+
}
|
|
1473
|
+
const c = e.path.dirname(o);
|
|
1474
|
+
if (c === o)
|
|
1475
|
+
break;
|
|
1476
|
+
o = c;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
function Hr(e = {}) {
|
|
1480
|
+
const n = Pt(e.optimizerOptions);
|
|
1466
1481
|
return {
|
|
1467
1482
|
name: "rollup-plugin-qwik",
|
|
1468
1483
|
api: {
|
|
@@ -1498,40 +1513,42 @@ function Rr(e = {}) {
|
|
|
1498
1513
|
return r.input = c, r;
|
|
1499
1514
|
},
|
|
1500
1515
|
outputOptions(r) {
|
|
1501
|
-
return
|
|
1516
|
+
return Ye(n, r, !1);
|
|
1502
1517
|
},
|
|
1503
1518
|
async buildStart() {
|
|
1504
1519
|
n.onDiagnostics((r, o, p) => {
|
|
1505
1520
|
r.forEach((c) => {
|
|
1506
1521
|
const a = n.normalizePath(o.sys.path.join(p, c.file));
|
|
1507
|
-
c.category === "error" ? this.error(
|
|
1522
|
+
c.category === "error" ? this.error(Re(a, c)) : this.warn(Re(a, c));
|
|
1508
1523
|
});
|
|
1509
1524
|
}), await n.buildStart(this);
|
|
1510
1525
|
},
|
|
1511
1526
|
resolveId(r, o) {
|
|
1512
|
-
return r
|
|
1527
|
+
return ee(r) ? null : n.resolveId(this, r, o);
|
|
1513
1528
|
},
|
|
1514
1529
|
load(r) {
|
|
1515
|
-
return r
|
|
1530
|
+
return ee(r) ? null : n.load(this, r);
|
|
1516
1531
|
},
|
|
1517
1532
|
transform(r, o) {
|
|
1518
|
-
return o
|
|
1533
|
+
return ee(o) ? null : n.transform(this, r, o);
|
|
1519
1534
|
},
|
|
1520
1535
|
async generateBundle(r, o) {
|
|
1521
1536
|
n.getOptions().target === "client" && await n.generateManifest(this, o);
|
|
1522
1537
|
}
|
|
1523
1538
|
};
|
|
1524
1539
|
}
|
|
1525
|
-
function
|
|
1526
|
-
return Array.isArray(n) ? (n.length || n.push({}),
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1540
|
+
async function In(e, n, s, r) {
|
|
1541
|
+
return Array.isArray(n) ? (n.length || n.push({}), await Promise.all(
|
|
1542
|
+
n.map(async (o) => ({
|
|
1543
|
+
...await Ye(e, o, s),
|
|
1544
|
+
dir: r || o.dir
|
|
1545
|
+
}))
|
|
1546
|
+
)) : {
|
|
1547
|
+
...await Ye(e, n, s),
|
|
1531
1548
|
dir: r || n?.dir
|
|
1532
1549
|
};
|
|
1533
1550
|
}
|
|
1534
|
-
const
|
|
1551
|
+
const Sn = (e, n, s) => n.buildMode === "production" && !n.debug ? `${e}build/q-[hash].js` : (r) => {
|
|
1535
1552
|
if (r.moduleIds?.some((c) => /core\.(prod|min)\.mjs$/.test(c)))
|
|
1536
1553
|
return `${e}build/core.js`;
|
|
1537
1554
|
if (r.moduleIds?.some((c) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(c)))
|
|
@@ -1539,21 +1556,31 @@ const wn = (e, n, s) => n.buildMode === "production" && !n.debug ? `${e}build/q-
|
|
|
1539
1556
|
const p = s.sys.path.relative(s.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
1540
1557
|
return `${e}build/${p}.js`;
|
|
1541
1558
|
};
|
|
1542
|
-
function
|
|
1559
|
+
async function Ye(e, n, s) {
|
|
1543
1560
|
const r = { ...n }, o = e.getOptions(), p = e.getOptimizer(), c = e.manualChunks;
|
|
1544
1561
|
r.assetFileNames || (r.assetFileNames = `${s ? `${o.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
|
|
1545
|
-
const a =
|
|
1562
|
+
const a = Sn(s ? `${o.assetsDir}` : "", o, p);
|
|
1546
1563
|
if (o.target === "client") {
|
|
1547
1564
|
r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
|
|
1548
|
-
const
|
|
1549
|
-
if (
|
|
1565
|
+
const t = r.manualChunks;
|
|
1566
|
+
if (t && typeof t != "function")
|
|
1550
1567
|
throw new Error("manualChunks must be a function");
|
|
1551
|
-
r.manualChunks =
|
|
1568
|
+
r.manualChunks = t ? (x, S) => t(x, S) || c(x, S) : c;
|
|
1552
1569
|
} else
|
|
1553
1570
|
r.chunkFileNames || (r.chunkFileNames = a);
|
|
1554
|
-
|
|
1571
|
+
r.dir || (r.dir = o.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
1572
|
+
const d = await xn(p.sys, "rollup", p.sys.cwd());
|
|
1573
|
+
if (d)
|
|
1574
|
+
try {
|
|
1575
|
+
const x = await (await p.sys.dynamicImport("node:fs")).promises.readFile(d, "utf-8"), S = JSON.parse(x), u = String(S?.version || ""), [w, m, g] = u.split(".").map((l) => parseInt(l, 10));
|
|
1576
|
+
Number.isFinite(w) && (w > 4 || w === 4 && (m > 52 || m === 52 && (g || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
|
|
1577
|
+
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${u}). 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.`
|
|
1578
|
+
);
|
|
1579
|
+
} catch {
|
|
1580
|
+
}
|
|
1581
|
+
return r;
|
|
1555
1582
|
}
|
|
1556
|
-
function
|
|
1583
|
+
function Re(e, n) {
|
|
1557
1584
|
const s = n.highlights?.[0];
|
|
1558
1585
|
return Object.assign(new Error(n.message), {
|
|
1559
1586
|
id: e,
|
|
@@ -1565,33 +1592,33 @@ function $e(e, n) {
|
|
|
1565
1592
|
stack: ""
|
|
1566
1593
|
});
|
|
1567
1594
|
}
|
|
1568
|
-
function
|
|
1595
|
+
function A(e) {
|
|
1569
1596
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1570
1597
|
}
|
|
1571
|
-
var
|
|
1598
|
+
var he = {}, Ge = {}, lt;
|
|
1572
1599
|
function F() {
|
|
1573
|
-
return
|
|
1600
|
+
return lt || (lt = 1, (function(e) {
|
|
1574
1601
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.findBox = e.readUInt = e.readUInt32LE = e.readUInt32BE = e.readInt32LE = e.readUInt24LE = e.readUInt16LE = e.readUInt16BE = e.readInt16LE = e.toHexString = e.toUTF8String = void 0;
|
|
1575
|
-
const n = new TextDecoder(), s = (g,
|
|
1602
|
+
const n = new TextDecoder(), s = (g, f = 0, l = g.length) => n.decode(g.slice(f, l));
|
|
1576
1603
|
e.toUTF8String = s;
|
|
1577
|
-
const r = (g,
|
|
1604
|
+
const r = (g, f = 0, l = g.length) => g.slice(f, l).reduce((i, y) => i + ("0" + y.toString(16)).slice(-2), "");
|
|
1578
1605
|
e.toHexString = r;
|
|
1579
|
-
const o = (g,
|
|
1580
|
-
const l = g[
|
|
1606
|
+
const o = (g, f = 0) => {
|
|
1607
|
+
const l = g[f] + g[f + 1] * 256;
|
|
1581
1608
|
return l | (l & 2 ** 15) * 131070;
|
|
1582
1609
|
};
|
|
1583
1610
|
e.readInt16LE = o;
|
|
1584
|
-
const p = (g,
|
|
1611
|
+
const p = (g, f = 0) => g[f] * 2 ** 8 + g[f + 1];
|
|
1585
1612
|
e.readUInt16BE = p;
|
|
1586
|
-
const c = (g,
|
|
1613
|
+
const c = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8;
|
|
1587
1614
|
e.readUInt16LE = c;
|
|
1588
|
-
const a = (g,
|
|
1615
|
+
const a = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8 + g[f + 2] * 2 ** 16;
|
|
1589
1616
|
e.readUInt24LE = a;
|
|
1590
|
-
const d = (g,
|
|
1617
|
+
const d = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8 + g[f + 2] * 2 ** 16 + (g[f + 3] << 24);
|
|
1591
1618
|
e.readInt32LE = d;
|
|
1592
|
-
const t = (g,
|
|
1619
|
+
const t = (g, f = 0) => g[f] * 2 ** 24 + g[f + 1] * 2 ** 16 + g[f + 2] * 2 ** 8 + g[f + 3];
|
|
1593
1620
|
e.readUInt32BE = t;
|
|
1594
|
-
const x = (g,
|
|
1621
|
+
const x = (g, f = 0) => g[f] + g[f + 1] * 2 ** 8 + g[f + 2] * 2 ** 16 + g[f + 3] * 2 ** 24;
|
|
1595
1622
|
e.readUInt32LE = x;
|
|
1596
1623
|
const S = {
|
|
1597
1624
|
readUInt16BE: e.readUInt16BE,
|
|
@@ -1599,55 +1626,55 @@ function F() {
|
|
|
1599
1626
|
readUInt32BE: e.readUInt32BE,
|
|
1600
1627
|
readUInt32LE: e.readUInt32LE
|
|
1601
1628
|
};
|
|
1602
|
-
function
|
|
1629
|
+
function u(g, f, l, i) {
|
|
1603
1630
|
l = l || 0;
|
|
1604
|
-
const
|
|
1631
|
+
const y = i ? "BE" : "LE", h = "readUInt" + f + y;
|
|
1605
1632
|
return S[h](g, l);
|
|
1606
1633
|
}
|
|
1607
|
-
e.readUInt =
|
|
1608
|
-
function w(g,
|
|
1609
|
-
if (g.length -
|
|
1634
|
+
e.readUInt = u;
|
|
1635
|
+
function w(g, f) {
|
|
1636
|
+
if (g.length - f < 4)
|
|
1610
1637
|
return;
|
|
1611
|
-
const l = (0, e.readUInt32BE)(g,
|
|
1612
|
-
if (!(g.length -
|
|
1638
|
+
const l = (0, e.readUInt32BE)(g, f);
|
|
1639
|
+
if (!(g.length - f < l))
|
|
1613
1640
|
return {
|
|
1614
|
-
name: (0, e.toUTF8String)(g, 4 +
|
|
1615
|
-
offset:
|
|
1641
|
+
name: (0, e.toUTF8String)(g, 4 + f, 8 + f),
|
|
1642
|
+
offset: f,
|
|
1616
1643
|
size: l
|
|
1617
1644
|
};
|
|
1618
1645
|
}
|
|
1619
|
-
function m(g,
|
|
1646
|
+
function m(g, f, l) {
|
|
1620
1647
|
for (; l < g.length; ) {
|
|
1621
1648
|
const i = w(g, l);
|
|
1622
1649
|
if (!i)
|
|
1623
1650
|
break;
|
|
1624
|
-
if (i.name ===
|
|
1651
|
+
if (i.name === f)
|
|
1625
1652
|
return i;
|
|
1626
1653
|
l += i.size > 0 ? i.size : 8;
|
|
1627
1654
|
}
|
|
1628
1655
|
}
|
|
1629
1656
|
e.findBox = m;
|
|
1630
|
-
})(
|
|
1657
|
+
})(Ge)), Ge;
|
|
1631
1658
|
}
|
|
1632
|
-
var
|
|
1633
|
-
function
|
|
1634
|
-
if (
|
|
1635
|
-
|
|
1659
|
+
var ct;
|
|
1660
|
+
function kn() {
|
|
1661
|
+
if (ct) return he;
|
|
1662
|
+
ct = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.BMP = void 0;
|
|
1636
1663
|
const e = F();
|
|
1637
|
-
return
|
|
1664
|
+
return he.BMP = {
|
|
1638
1665
|
validate: (n) => (0, e.toUTF8String)(n, 0, 2) === "BM",
|
|
1639
1666
|
calculate: (n) => ({
|
|
1640
1667
|
height: Math.abs((0, e.readInt32LE)(n, 22)),
|
|
1641
1668
|
width: (0, e.readUInt32LE)(n, 18)
|
|
1642
1669
|
})
|
|
1643
|
-
},
|
|
1670
|
+
}, he;
|
|
1644
1671
|
}
|
|
1645
|
-
var
|
|
1646
|
-
const
|
|
1647
|
-
var
|
|
1648
|
-
function
|
|
1649
|
-
if (
|
|
1650
|
-
|
|
1672
|
+
var En = kn();
|
|
1673
|
+
const _n = /* @__PURE__ */ A(En);
|
|
1674
|
+
var me = {}, ge = {}, dt;
|
|
1675
|
+
function Nt() {
|
|
1676
|
+
if (dt) return ge;
|
|
1677
|
+
dt = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.ICO = void 0;
|
|
1651
1678
|
const e = F(), n = 1, s = 6, r = 16;
|
|
1652
1679
|
function o(c, a) {
|
|
1653
1680
|
const d = c[a];
|
|
@@ -1660,7 +1687,7 @@ function Dt() {
|
|
|
1660
1687
|
width: o(c, d)
|
|
1661
1688
|
};
|
|
1662
1689
|
}
|
|
1663
|
-
return
|
|
1690
|
+
return ge.ICO = {
|
|
1664
1691
|
validate(c) {
|
|
1665
1692
|
const a = (0, e.readUInt16LE)(c, 0), d = (0, e.readUInt16LE)(c, 4);
|
|
1666
1693
|
return a !== 0 || d === 0 ? !1 : (0, e.readUInt16LE)(c, 2) === n;
|
|
@@ -1678,57 +1705,57 @@ function Dt() {
|
|
|
1678
1705
|
width: d.width
|
|
1679
1706
|
};
|
|
1680
1707
|
}
|
|
1681
|
-
},
|
|
1708
|
+
}, ge;
|
|
1682
1709
|
}
|
|
1683
|
-
var
|
|
1684
|
-
function
|
|
1685
|
-
if (
|
|
1686
|
-
|
|
1687
|
-
const e =
|
|
1688
|
-
return
|
|
1710
|
+
var ut;
|
|
1711
|
+
function Tn() {
|
|
1712
|
+
if (ut) return me;
|
|
1713
|
+
ut = 1, Object.defineProperty(me, "__esModule", { value: !0 }), me.CUR = void 0;
|
|
1714
|
+
const e = Nt(), n = F(), s = 2;
|
|
1715
|
+
return me.CUR = {
|
|
1689
1716
|
validate(r) {
|
|
1690
1717
|
const o = (0, n.readUInt16LE)(r, 0), p = (0, n.readUInt16LE)(r, 4);
|
|
1691
1718
|
return o !== 0 || p === 0 ? !1 : (0, n.readUInt16LE)(r, 2) === s;
|
|
1692
1719
|
},
|
|
1693
1720
|
calculate: (r) => e.ICO.calculate(r)
|
|
1694
|
-
},
|
|
1721
|
+
}, me;
|
|
1695
1722
|
}
|
|
1696
|
-
var
|
|
1697
|
-
const
|
|
1698
|
-
var
|
|
1699
|
-
function
|
|
1700
|
-
if (
|
|
1701
|
-
|
|
1723
|
+
var Cn = Tn();
|
|
1724
|
+
const Pn = /* @__PURE__ */ A(Cn);
|
|
1725
|
+
var ye = {}, ft;
|
|
1726
|
+
function Dn() {
|
|
1727
|
+
if (ft) return ye;
|
|
1728
|
+
ft = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.DDS = void 0;
|
|
1702
1729
|
const e = F();
|
|
1703
|
-
return
|
|
1730
|
+
return ye.DDS = {
|
|
1704
1731
|
validate: (n) => (0, e.readUInt32LE)(n, 0) === 542327876,
|
|
1705
1732
|
calculate: (n) => ({
|
|
1706
1733
|
height: (0, e.readUInt32LE)(n, 12),
|
|
1707
1734
|
width: (0, e.readUInt32LE)(n, 16)
|
|
1708
1735
|
})
|
|
1709
|
-
},
|
|
1736
|
+
}, ye;
|
|
1710
1737
|
}
|
|
1711
|
-
var
|
|
1712
|
-
const
|
|
1713
|
-
var
|
|
1714
|
-
function
|
|
1715
|
-
if (
|
|
1716
|
-
|
|
1738
|
+
var Nn = Dn();
|
|
1739
|
+
const Mn = /* @__PURE__ */ A(Nn);
|
|
1740
|
+
var be = {}, pt;
|
|
1741
|
+
function qn() {
|
|
1742
|
+
if (pt) return be;
|
|
1743
|
+
pt = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.GIF = void 0;
|
|
1717
1744
|
const e = F(), n = /^GIF8[79]a/;
|
|
1718
|
-
return
|
|
1745
|
+
return be.GIF = {
|
|
1719
1746
|
validate: (s) => n.test((0, e.toUTF8String)(s, 0, 6)),
|
|
1720
1747
|
calculate: (s) => ({
|
|
1721
1748
|
height: (0, e.readUInt16LE)(s, 8),
|
|
1722
1749
|
width: (0, e.readUInt16LE)(s, 6)
|
|
1723
1750
|
})
|
|
1724
|
-
},
|
|
1751
|
+
}, be;
|
|
1725
1752
|
}
|
|
1726
|
-
var
|
|
1727
|
-
const
|
|
1728
|
-
var
|
|
1729
|
-
function
|
|
1730
|
-
if (
|
|
1731
|
-
|
|
1753
|
+
var Ln = qn();
|
|
1754
|
+
const On = /* @__PURE__ */ A(Ln);
|
|
1755
|
+
var ve = {}, ht;
|
|
1756
|
+
function jn() {
|
|
1757
|
+
if (ht) return ve;
|
|
1758
|
+
ht = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.ICNS = void 0;
|
|
1732
1759
|
const e = F(), n = 8, s = 4, r = 4, o = {
|
|
1733
1760
|
ICON: 32,
|
|
1734
1761
|
"ICN#": 32,
|
|
@@ -1782,50 +1809,50 @@ function qn() {
|
|
|
1782
1809
|
const d = o[a];
|
|
1783
1810
|
return { width: d, height: d, type: a };
|
|
1784
1811
|
}
|
|
1785
|
-
return
|
|
1812
|
+
return ve.ICNS = {
|
|
1786
1813
|
validate: (a) => (0, e.toUTF8String)(a, 0, 4) === "icns",
|
|
1787
1814
|
calculate(a) {
|
|
1788
1815
|
const d = a.length, t = (0, e.readUInt32BE)(a, s);
|
|
1789
|
-
let x = n, S = p(a, x),
|
|
1816
|
+
let x = n, S = p(a, x), u = c(S[0]);
|
|
1790
1817
|
if (x += S[1], x === t)
|
|
1791
|
-
return
|
|
1818
|
+
return u;
|
|
1792
1819
|
const w = {
|
|
1793
|
-
height:
|
|
1794
|
-
images: [
|
|
1795
|
-
width:
|
|
1820
|
+
height: u.height,
|
|
1821
|
+
images: [u],
|
|
1822
|
+
width: u.width
|
|
1796
1823
|
};
|
|
1797
1824
|
for (; x < t && x < d; )
|
|
1798
|
-
S = p(a, x),
|
|
1825
|
+
S = p(a, x), u = c(S[0]), x += S[1], w.images.push(u);
|
|
1799
1826
|
return w;
|
|
1800
1827
|
}
|
|
1801
|
-
},
|
|
1828
|
+
}, ve;
|
|
1802
1829
|
}
|
|
1803
|
-
var
|
|
1804
|
-
const
|
|
1805
|
-
var
|
|
1806
|
-
const
|
|
1807
|
-
var
|
|
1808
|
-
function
|
|
1809
|
-
if (
|
|
1810
|
-
|
|
1830
|
+
var $n = jn();
|
|
1831
|
+
const Un = /* @__PURE__ */ A($n);
|
|
1832
|
+
var Bn = Nt();
|
|
1833
|
+
const Rn = /* @__PURE__ */ A(Bn);
|
|
1834
|
+
var we = {}, mt;
|
|
1835
|
+
function An() {
|
|
1836
|
+
if (mt) return we;
|
|
1837
|
+
mt = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.J2C = void 0;
|
|
1811
1838
|
const e = F();
|
|
1812
|
-
return
|
|
1839
|
+
return we.J2C = {
|
|
1813
1840
|
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
1814
1841
|
validate: (n) => (0, e.readUInt32BE)(n, 0) === 4283432785,
|
|
1815
1842
|
calculate: (n) => ({
|
|
1816
1843
|
height: (0, e.readUInt32BE)(n, 12),
|
|
1817
1844
|
width: (0, e.readUInt32BE)(n, 8)
|
|
1818
1845
|
})
|
|
1819
|
-
},
|
|
1846
|
+
}, we;
|
|
1820
1847
|
}
|
|
1821
|
-
var
|
|
1822
|
-
const
|
|
1823
|
-
var
|
|
1824
|
-
function
|
|
1825
|
-
if (
|
|
1826
|
-
|
|
1848
|
+
var Fn = An();
|
|
1849
|
+
const zn = /* @__PURE__ */ A(Fn);
|
|
1850
|
+
var xe = {}, gt;
|
|
1851
|
+
function Hn() {
|
|
1852
|
+
if (gt) return xe;
|
|
1853
|
+
gt = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.JP2 = void 0;
|
|
1827
1854
|
const e = F();
|
|
1828
|
-
return
|
|
1855
|
+
return xe.JP2 = {
|
|
1829
1856
|
validate(n) {
|
|
1830
1857
|
if ((0, e.toUTF8String)(n, 4, 8) !== "jP ")
|
|
1831
1858
|
return !1;
|
|
@@ -1841,14 +1868,14 @@ function Rn() {
|
|
|
1841
1868
|
};
|
|
1842
1869
|
throw new TypeError("Unsupported JPEG 2000 format");
|
|
1843
1870
|
}
|
|
1844
|
-
},
|
|
1871
|
+
}, xe;
|
|
1845
1872
|
}
|
|
1846
|
-
var
|
|
1847
|
-
const
|
|
1848
|
-
var
|
|
1849
|
-
function
|
|
1850
|
-
if (
|
|
1851
|
-
|
|
1873
|
+
var Wn = Hn();
|
|
1874
|
+
const Gn = /* @__PURE__ */ A(Wn);
|
|
1875
|
+
var Ie = {}, yt;
|
|
1876
|
+
function Qn() {
|
|
1877
|
+
if (yt) return Ie;
|
|
1878
|
+
yt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.JPG = void 0;
|
|
1852
1879
|
const e = F(), n = "45786966", s = 2, r = 6, o = 2, p = "4d4d", c = "4949", a = 12, d = 2;
|
|
1853
1880
|
function t(m) {
|
|
1854
1881
|
return (0, e.toHexString)(m, 2, 6) === n;
|
|
@@ -1861,8 +1888,8 @@ function Hn() {
|
|
|
1861
1888
|
}
|
|
1862
1889
|
function S(m, g) {
|
|
1863
1890
|
const l = r + 8, i = (0, e.readUInt)(m, 16, l, g);
|
|
1864
|
-
for (let
|
|
1865
|
-
const h = l + d +
|
|
1891
|
+
for (let y = 0; y < i; y++) {
|
|
1892
|
+
const h = l + d + y * a, I = h + a;
|
|
1866
1893
|
if (h > m.length)
|
|
1867
1894
|
return;
|
|
1868
1895
|
const v = m.slice(h, I);
|
|
@@ -1870,27 +1897,27 @@ function Hn() {
|
|
|
1870
1897
|
return (0, e.readUInt)(v, 16, 2, g) !== 3 || (0, e.readUInt)(v, 32, 4, g) !== 1 ? void 0 : (0, e.readUInt)(v, 16, 8, g);
|
|
1871
1898
|
}
|
|
1872
1899
|
}
|
|
1873
|
-
function
|
|
1874
|
-
const
|
|
1900
|
+
function u(m, g) {
|
|
1901
|
+
const f = m.slice(s, g), l = (0, e.toHexString)(f, r, r + o), i = l === p;
|
|
1875
1902
|
if (i || l === c)
|
|
1876
|
-
return S(
|
|
1903
|
+
return S(f, i);
|
|
1877
1904
|
}
|
|
1878
1905
|
function w(m, g) {
|
|
1879
1906
|
if (g > m.length)
|
|
1880
1907
|
throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
1881
1908
|
}
|
|
1882
|
-
return
|
|
1909
|
+
return Ie.JPG = {
|
|
1883
1910
|
validate: (m) => (0, e.toHexString)(m, 0, 2) === "ffd8",
|
|
1884
1911
|
calculate(m) {
|
|
1885
1912
|
m = m.slice(4);
|
|
1886
|
-
let g,
|
|
1913
|
+
let g, f;
|
|
1887
1914
|
for (; m.length; ) {
|
|
1888
1915
|
const l = (0, e.readUInt16BE)(m, 0);
|
|
1889
1916
|
if (m[l] !== 255) {
|
|
1890
1917
|
m = m.slice(1);
|
|
1891
1918
|
continue;
|
|
1892
1919
|
}
|
|
1893
|
-
if (t(m) && (g =
|
|
1920
|
+
if (t(m) && (g = u(m, l)), w(m, l), f = m[l + 1], f === 192 || f === 193 || f === 194) {
|
|
1894
1921
|
const i = x(m, l + 5);
|
|
1895
1922
|
return g ? {
|
|
1896
1923
|
height: i.height,
|
|
@@ -1902,16 +1929,16 @@ function Hn() {
|
|
|
1902
1929
|
}
|
|
1903
1930
|
throw new TypeError("Invalid JPG, no size found");
|
|
1904
1931
|
}
|
|
1905
|
-
},
|
|
1932
|
+
}, Ie;
|
|
1906
1933
|
}
|
|
1907
|
-
var
|
|
1908
|
-
const
|
|
1909
|
-
var
|
|
1910
|
-
function
|
|
1911
|
-
if (
|
|
1912
|
-
|
|
1934
|
+
var Kn = Qn();
|
|
1935
|
+
const Jn = /* @__PURE__ */ A(Kn);
|
|
1936
|
+
var Se = {}, bt;
|
|
1937
|
+
function Yn() {
|
|
1938
|
+
if (bt) return Se;
|
|
1939
|
+
bt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.KTX = void 0;
|
|
1913
1940
|
const e = F();
|
|
1914
|
-
return
|
|
1941
|
+
return Se.KTX = {
|
|
1915
1942
|
validate: (n) => {
|
|
1916
1943
|
const s = (0, e.toUTF8String)(n, 1, 7);
|
|
1917
1944
|
return ["KTX 11", "KTX 20"].includes(s);
|
|
@@ -1924,18 +1951,18 @@ function Kn() {
|
|
|
1924
1951
|
type: s
|
|
1925
1952
|
};
|
|
1926
1953
|
}
|
|
1927
|
-
},
|
|
1954
|
+
}, Se;
|
|
1928
1955
|
}
|
|
1929
|
-
var
|
|
1930
|
-
const
|
|
1931
|
-
var
|
|
1932
|
-
function
|
|
1933
|
-
if (
|
|
1934
|
-
|
|
1956
|
+
var Xn = Yn();
|
|
1957
|
+
const Vn = /* @__PURE__ */ A(Xn);
|
|
1958
|
+
var ke = {}, vt;
|
|
1959
|
+
function Zn() {
|
|
1960
|
+
if (vt) return ke;
|
|
1961
|
+
vt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.PNG = void 0;
|
|
1935
1962
|
const e = F(), n = `PNG\r
|
|
1936
1963
|
|
|
1937
1964
|
`, s = "IHDR", r = "CgBI";
|
|
1938
|
-
return
|
|
1965
|
+
return ke.PNG = {
|
|
1939
1966
|
validate(o) {
|
|
1940
1967
|
if (n === (0, e.toUTF8String)(o, 1, 8)) {
|
|
1941
1968
|
let p = (0, e.toUTF8String)(o, 12, 16);
|
|
@@ -1954,14 +1981,14 @@ function Yn() {
|
|
|
1954
1981
|
width: (0, e.readUInt32BE)(o, 16)
|
|
1955
1982
|
};
|
|
1956
1983
|
}
|
|
1957
|
-
},
|
|
1984
|
+
}, ke;
|
|
1958
1985
|
}
|
|
1959
|
-
var
|
|
1960
|
-
const
|
|
1961
|
-
var Ee = {},
|
|
1962
|
-
function
|
|
1963
|
-
if (
|
|
1964
|
-
|
|
1986
|
+
var er = Zn();
|
|
1987
|
+
const tr = /* @__PURE__ */ A(er);
|
|
1988
|
+
var Ee = {}, wt;
|
|
1989
|
+
function nr() {
|
|
1990
|
+
if (wt) return Ee;
|
|
1991
|
+
wt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.PNM = void 0;
|
|
1965
1992
|
const e = F(), n = {
|
|
1966
1993
|
P1: "pbm/ascii",
|
|
1967
1994
|
P2: "pgm/ascii",
|
|
@@ -2014,27 +2041,27 @@ function Vn() {
|
|
|
2014
2041
|
}
|
|
2015
2042
|
}, Ee;
|
|
2016
2043
|
}
|
|
2017
|
-
var
|
|
2018
|
-
const
|
|
2019
|
-
var
|
|
2020
|
-
function
|
|
2021
|
-
if (
|
|
2022
|
-
|
|
2044
|
+
var rr = nr();
|
|
2045
|
+
const or = /* @__PURE__ */ A(rr);
|
|
2046
|
+
var _e = {}, xt;
|
|
2047
|
+
function ir() {
|
|
2048
|
+
if (xt) return _e;
|
|
2049
|
+
xt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.PSD = void 0;
|
|
2023
2050
|
const e = F();
|
|
2024
|
-
return
|
|
2051
|
+
return _e.PSD = {
|
|
2025
2052
|
validate: (n) => (0, e.toUTF8String)(n, 0, 4) === "8BPS",
|
|
2026
2053
|
calculate: (n) => ({
|
|
2027
2054
|
height: (0, e.readUInt32BE)(n, 14),
|
|
2028
2055
|
width: (0, e.readUInt32BE)(n, 18)
|
|
2029
2056
|
})
|
|
2030
|
-
},
|
|
2057
|
+
}, _e;
|
|
2031
2058
|
}
|
|
2032
|
-
var
|
|
2033
|
-
const
|
|
2034
|
-
var
|
|
2035
|
-
function
|
|
2036
|
-
if (
|
|
2037
|
-
|
|
2059
|
+
var sr = ir();
|
|
2060
|
+
const ar = /* @__PURE__ */ A(sr);
|
|
2061
|
+
var Te = {}, It;
|
|
2062
|
+
function lr() {
|
|
2063
|
+
if (It) return Te;
|
|
2064
|
+
It = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.SVG = void 0;
|
|
2038
2065
|
const e = F(), n = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, s = {
|
|
2039
2066
|
height: /\sheight=(['"])([^%]+?)\1/,
|
|
2040
2067
|
root: n,
|
|
@@ -2052,23 +2079,23 @@ function ir() {
|
|
|
2052
2079
|
px: 1
|
|
2053
2080
|
}, p = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(o).join("|")})?$`);
|
|
2054
2081
|
function c(S) {
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
2057
|
-
return Math.round(Number(
|
|
2082
|
+
const u = p.exec(S);
|
|
2083
|
+
if (u)
|
|
2084
|
+
return Math.round(Number(u[1]) * (o[u[2]] || 1));
|
|
2058
2085
|
}
|
|
2059
2086
|
function a(S) {
|
|
2060
|
-
const
|
|
2087
|
+
const u = S.split(" ");
|
|
2061
2088
|
return {
|
|
2062
|
-
height: c(
|
|
2063
|
-
width: c(
|
|
2089
|
+
height: c(u[3]),
|
|
2090
|
+
width: c(u[2])
|
|
2064
2091
|
};
|
|
2065
2092
|
}
|
|
2066
2093
|
function d(S) {
|
|
2067
|
-
const
|
|
2094
|
+
const u = S.match(s.width), w = S.match(s.height), m = S.match(s.viewbox);
|
|
2068
2095
|
return {
|
|
2069
2096
|
height: w && c(w[2]),
|
|
2070
2097
|
viewbox: m && a(m[2]),
|
|
2071
|
-
width:
|
|
2098
|
+
width: u && c(u[2])
|
|
2072
2099
|
};
|
|
2073
2100
|
}
|
|
2074
2101
|
function t(S) {
|
|
@@ -2077,8 +2104,8 @@ function ir() {
|
|
|
2077
2104
|
width: S.width
|
|
2078
2105
|
};
|
|
2079
2106
|
}
|
|
2080
|
-
function x(S,
|
|
2081
|
-
const w =
|
|
2107
|
+
function x(S, u) {
|
|
2108
|
+
const w = u.width / u.height;
|
|
2082
2109
|
return S.width ? {
|
|
2083
2110
|
height: Math.floor(S.width / w),
|
|
2084
2111
|
width: S.width
|
|
@@ -2086,17 +2113,17 @@ function ir() {
|
|
|
2086
2113
|
height: S.height,
|
|
2087
2114
|
width: Math.floor(S.height * w)
|
|
2088
2115
|
} : {
|
|
2089
|
-
height:
|
|
2090
|
-
width:
|
|
2116
|
+
height: u.height,
|
|
2117
|
+
width: u.width
|
|
2091
2118
|
};
|
|
2092
2119
|
}
|
|
2093
|
-
return
|
|
2120
|
+
return Te.SVG = {
|
|
2094
2121
|
// Scan only the first kilo-byte to speed up the check on larger files
|
|
2095
2122
|
validate: (S) => n.test((0, e.toUTF8String)(S, 0, 1e3)),
|
|
2096
2123
|
calculate(S) {
|
|
2097
|
-
const
|
|
2098
|
-
if (
|
|
2099
|
-
const w = d(
|
|
2124
|
+
const u = (0, e.toUTF8String)(S).match(s.root);
|
|
2125
|
+
if (u) {
|
|
2126
|
+
const w = d(u[0]);
|
|
2100
2127
|
if (w.width && w.height)
|
|
2101
2128
|
return t(w);
|
|
2102
2129
|
if (w.viewbox)
|
|
@@ -2104,16 +2131,16 @@ function ir() {
|
|
|
2104
2131
|
}
|
|
2105
2132
|
throw new TypeError("Invalid SVG");
|
|
2106
2133
|
}
|
|
2107
|
-
},
|
|
2134
|
+
}, Te;
|
|
2108
2135
|
}
|
|
2109
|
-
var
|
|
2110
|
-
const
|
|
2111
|
-
var
|
|
2112
|
-
function
|
|
2113
|
-
if (
|
|
2114
|
-
|
|
2136
|
+
var cr = lr();
|
|
2137
|
+
const dr = /* @__PURE__ */ A(cr);
|
|
2138
|
+
var Ce = {}, St;
|
|
2139
|
+
function ur() {
|
|
2140
|
+
if (St) return Ce;
|
|
2141
|
+
St = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.TGA = void 0;
|
|
2115
2142
|
const e = F();
|
|
2116
|
-
return
|
|
2143
|
+
return Ce.TGA = {
|
|
2117
2144
|
validate(n) {
|
|
2118
2145
|
return (0, e.readUInt16LE)(n, 0) === 0 && (0, e.readUInt16LE)(n, 4) === 0;
|
|
2119
2146
|
},
|
|
@@ -2123,14 +2150,14 @@ function lr() {
|
|
|
2123
2150
|
width: (0, e.readUInt16LE)(n, 12)
|
|
2124
2151
|
};
|
|
2125
2152
|
}
|
|
2126
|
-
},
|
|
2153
|
+
}, Ce;
|
|
2127
2154
|
}
|
|
2128
|
-
var
|
|
2129
|
-
const
|
|
2130
|
-
var
|
|
2131
|
-
function
|
|
2132
|
-
if (
|
|
2133
|
-
|
|
2155
|
+
var fr = ur();
|
|
2156
|
+
const pr = /* @__PURE__ */ A(fr);
|
|
2157
|
+
var Pe = {}, kt;
|
|
2158
|
+
function hr() {
|
|
2159
|
+
if (kt) return Pe;
|
|
2160
|
+
kt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.WEBP = void 0;
|
|
2134
2161
|
const e = F();
|
|
2135
2162
|
function n(o) {
|
|
2136
2163
|
return {
|
|
@@ -2150,7 +2177,7 @@ function ur() {
|
|
|
2150
2177
|
width: (0, e.readInt16LE)(o, 6) & 16383
|
|
2151
2178
|
};
|
|
2152
2179
|
}
|
|
2153
|
-
return
|
|
2180
|
+
return Pe.WEBP = {
|
|
2154
2181
|
validate(o) {
|
|
2155
2182
|
const p = (0, e.toUTF8String)(o, 0, 4) === "RIFF", c = (0, e.toUTF8String)(o, 8, 12) === "WEBP", a = (0, e.toUTF8String)(o, 12, 15) === "VP8";
|
|
2156
2183
|
return p && c && a;
|
|
@@ -2170,14 +2197,14 @@ function ur() {
|
|
|
2170
2197
|
return s(o);
|
|
2171
2198
|
throw new TypeError("Invalid WebP");
|
|
2172
2199
|
}
|
|
2173
|
-
},
|
|
2200
|
+
}, Pe;
|
|
2174
2201
|
}
|
|
2175
|
-
var
|
|
2176
|
-
const
|
|
2177
|
-
var
|
|
2178
|
-
function
|
|
2179
|
-
if (Et) return
|
|
2180
|
-
Et = 1, Object.defineProperty(
|
|
2202
|
+
var mr = hr();
|
|
2203
|
+
const gr = /* @__PURE__ */ A(mr);
|
|
2204
|
+
var De = {}, Et;
|
|
2205
|
+
function yr() {
|
|
2206
|
+
if (Et) return De;
|
|
2207
|
+
Et = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.HEIF = void 0;
|
|
2181
2208
|
const e = F(), n = {
|
|
2182
2209
|
avif: "avif",
|
|
2183
2210
|
mif1: "heif",
|
|
@@ -2190,7 +2217,7 @@ function hr() {
|
|
|
2190
2217
|
hevx: "heic"
|
|
2191
2218
|
// heic-sequence
|
|
2192
2219
|
};
|
|
2193
|
-
return
|
|
2220
|
+
return De.HEIF = {
|
|
2194
2221
|
validate(s) {
|
|
2195
2222
|
if ((0, e.toUTF8String)(s, 4, 8) !== "ftyp")
|
|
2196
2223
|
return !1;
|
|
@@ -2207,10 +2234,10 @@ function hr() {
|
|
|
2207
2234
|
};
|
|
2208
2235
|
throw new TypeError("Invalid HEIF, no size found");
|
|
2209
2236
|
}
|
|
2210
|
-
},
|
|
2237
|
+
}, De;
|
|
2211
2238
|
}
|
|
2212
|
-
var
|
|
2213
|
-
const
|
|
2239
|
+
var br = yr();
|
|
2240
|
+
const vr = /* @__PURE__ */ A(br), wr = {
|
|
2214
2241
|
56: "psd",
|
|
2215
2242
|
66: "bmp",
|
|
2216
2243
|
68: "dds",
|
|
@@ -2219,38 +2246,38 @@ const gr = /* @__PURE__ */ R(mr), yr = {
|
|
|
2219
2246
|
105: "icns",
|
|
2220
2247
|
137: "png",
|
|
2221
2248
|
255: "jpg"
|
|
2222
|
-
},
|
|
2223
|
-
webp:
|
|
2224
|
-
jpg:
|
|
2225
|
-
png:
|
|
2226
|
-
svg:
|
|
2227
|
-
gif:
|
|
2228
|
-
avif:
|
|
2229
|
-
bmp:
|
|
2230
|
-
cur:
|
|
2231
|
-
dds:
|
|
2232
|
-
icns:
|
|
2233
|
-
ico:
|
|
2234
|
-
j2c:
|
|
2235
|
-
jp2:
|
|
2236
|
-
ktx:
|
|
2237
|
-
pnm:
|
|
2238
|
-
psd:
|
|
2239
|
-
tga:
|
|
2240
|
-
},
|
|
2241
|
-
function
|
|
2242
|
-
const n = e[0], s =
|
|
2243
|
-
return s &&
|
|
2249
|
+
}, Ae = {
|
|
2250
|
+
webp: gr.WEBP,
|
|
2251
|
+
jpg: Jn.JPG,
|
|
2252
|
+
png: tr.PNG,
|
|
2253
|
+
svg: dr.SVG,
|
|
2254
|
+
gif: On.GIF,
|
|
2255
|
+
avif: vr.HEIF,
|
|
2256
|
+
bmp: _n.BMP,
|
|
2257
|
+
cur: Pn.CUR,
|
|
2258
|
+
dds: Mn.DDS,
|
|
2259
|
+
icns: Un.ICNS,
|
|
2260
|
+
ico: Rn.ICO,
|
|
2261
|
+
j2c: zn.J2C,
|
|
2262
|
+
jp2: Gn.JP2,
|
|
2263
|
+
ktx: Vn.KTX,
|
|
2264
|
+
pnm: or.PNM,
|
|
2265
|
+
psd: ar.PSD,
|
|
2266
|
+
tga: pr.TGA
|
|
2267
|
+
}, xr = Object.keys(Ae);
|
|
2268
|
+
function Ir(e) {
|
|
2269
|
+
const n = e[0], s = wr[n];
|
|
2270
|
+
return s && Ae[s].validate(e) ? s : xr.find((r) => Ae[r].validate(e));
|
|
2244
2271
|
}
|
|
2245
|
-
function
|
|
2246
|
-
const n =
|
|
2272
|
+
function Sr(e) {
|
|
2273
|
+
const n = Ir(e);
|
|
2247
2274
|
if (typeof n < "u") {
|
|
2248
|
-
const s =
|
|
2275
|
+
const s = Ae[n].calculate(e);
|
|
2249
2276
|
if (s !== void 0)
|
|
2250
2277
|
return s.type = n, s;
|
|
2251
2278
|
}
|
|
2252
2279
|
}
|
|
2253
|
-
async function
|
|
2280
|
+
async function kr(e) {
|
|
2254
2281
|
if (/^(https?|file|capacitor):/.test(e))
|
|
2255
2282
|
try {
|
|
2256
2283
|
const n = await fetch(e, {
|
|
@@ -2260,7 +2287,7 @@ async function xr(e) {
|
|
|
2260
2287
|
console.error("can not fetch", e);
|
|
2261
2288
|
return;
|
|
2262
2289
|
}
|
|
2263
|
-
const s = await n.arrayBuffer(), r =
|
|
2290
|
+
const s = await n.arrayBuffer(), r = Sr(Buffer.from(s));
|
|
2264
2291
|
if (r)
|
|
2265
2292
|
return {
|
|
2266
2293
|
width: r.width,
|
|
@@ -2273,7 +2300,7 @@ async function xr(e) {
|
|
|
2273
2300
|
return;
|
|
2274
2301
|
}
|
|
2275
2302
|
}
|
|
2276
|
-
const
|
|
2303
|
+
const Er = (e, n, s) => async (r, o, p) => {
|
|
2277
2304
|
try {
|
|
2278
2305
|
const c = await e.dynamicImport("node:fs"), a = await e.dynamicImport("node:path");
|
|
2279
2306
|
let d;
|
|
@@ -2286,7 +2313,7 @@ const Ir = (e, n, s) => async (r, o, p) => {
|
|
|
2286
2313
|
if (r.method === "GET" && d.pathname === "/__image_info") {
|
|
2287
2314
|
const t = d.searchParams.get("url");
|
|
2288
2315
|
if (o.setHeader("content-type", "application/json"), t) {
|
|
2289
|
-
const x = await
|
|
2316
|
+
const x = await kr(t);
|
|
2290
2317
|
o.setHeader("cache-control", "public, max-age=31536000, immutable"), x ? o.write(JSON.stringify(x)) : o.statusCode = 404;
|
|
2291
2318
|
} else {
|
|
2292
2319
|
o.statusCode = 500;
|
|
@@ -2296,17 +2323,17 @@ const Ir = (e, n, s) => async (r, o, p) => {
|
|
|
2296
2323
|
o.end();
|
|
2297
2324
|
return;
|
|
2298
2325
|
} else if (r.method === "POST" && d.pathname === "/__image_fix") {
|
|
2299
|
-
const t = d.searchParams.get("loc"), x = d.searchParams.get("width"), S = d.searchParams.get("height"),
|
|
2300
|
-
let
|
|
2326
|
+
const t = d.searchParams.get("loc"), x = d.searchParams.get("width"), S = d.searchParams.get("height"), u = d.searchParams.get("src"), w = d.searchParams.get("currentHref"), m = t.split(":"), g = parseInt(m[m.length - 1], 10) - 1;
|
|
2327
|
+
let f = parseInt(m[m.length - 2], 10) - 1;
|
|
2301
2328
|
const l = a.resolve(s, m.slice(0, m.length - 2).join(":")), i = a.extname(l).toLowerCase();
|
|
2302
2329
|
let h = c.readFileSync(l).toString("utf-8"), I = 0;
|
|
2303
2330
|
for (; I < h.length; I++)
|
|
2304
|
-
if (
|
|
2331
|
+
if (f === 0) {
|
|
2305
2332
|
I += g;
|
|
2306
2333
|
break;
|
|
2307
2334
|
} else if (h[I] === `
|
|
2308
2335
|
`) {
|
|
2309
|
-
|
|
2336
|
+
f--;
|
|
2310
2337
|
continue;
|
|
2311
2338
|
}
|
|
2312
2339
|
if (h.slice(I, I + 4) !== "<img") {
|
|
@@ -2323,51 +2350,51 @@ const Ir = (e, n, s) => async (r, o, p) => {
|
|
|
2323
2350
|
return;
|
|
2324
2351
|
}
|
|
2325
2352
|
const T = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(i);
|
|
2326
|
-
let
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2329
|
-
if (
|
|
2330
|
-
const L = a.join(n, "public",
|
|
2353
|
+
let E = h.slice(I, v);
|
|
2354
|
+
if (u && w && T) {
|
|
2355
|
+
const P = new URL(u), $ = new URL(w);
|
|
2356
|
+
if (P.origin === $.origin) {
|
|
2357
|
+
const L = a.join(n, "public", P.pathname), B = a.join(n, P.pathname);
|
|
2331
2358
|
let H;
|
|
2332
2359
|
if (c.existsSync(L)) {
|
|
2333
|
-
const
|
|
2334
|
-
await c.promises.mkdir(
|
|
2360
|
+
const V = a.join(s, "media", a.dirname(P.pathname));
|
|
2361
|
+
await c.promises.mkdir(V, { recursive: !0 }), await c.promises.copyFile(
|
|
2335
2362
|
L,
|
|
2336
|
-
a.join(s, "media",
|
|
2337
|
-
), H = "~/media" +
|
|
2363
|
+
a.join(s, "media", P.pathname)
|
|
2364
|
+
), H = "~/media" + P.pathname;
|
|
2338
2365
|
} else if (c.existsSync(B))
|
|
2339
|
-
H =
|
|
2366
|
+
H = P.pathname.replace("/src/", "~/");
|
|
2340
2367
|
else
|
|
2341
2368
|
return;
|
|
2342
|
-
const J =
|
|
2343
|
-
|
|
2369
|
+
const J = _r(P.pathname), ie = `${H}?jsx`;
|
|
2370
|
+
E = E.replace(/^<img/, `<${J}`), E = E.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), E = E.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), E = E.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
2344
2371
|
let W = 0;
|
|
2345
2372
|
if (i === ".mdx" && h.startsWith("---") && (W = h.indexOf("---", 4) + 3, W === -1))
|
|
2346
2373
|
return;
|
|
2347
|
-
const
|
|
2348
|
-
import ${J} from '${
|
|
2349
|
-
h = `${h.slice(0, W)}${
|
|
2374
|
+
const X = `
|
|
2375
|
+
import ${J} from '${ie}';`;
|
|
2376
|
+
h = `${h.slice(0, W)}${X}${h.slice(
|
|
2350
2377
|
W,
|
|
2351
2378
|
I
|
|
2352
|
-
)}${
|
|
2379
|
+
)}${E}${h.slice(v)}`, c.writeFileSync(l, h);
|
|
2353
2380
|
return;
|
|
2354
2381
|
}
|
|
2355
2382
|
}
|
|
2356
|
-
|
|
2383
|
+
E = E.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${x}"`), E = E.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${S}"`), E.includes("height=") || (E = E.replace(/<img/, `<img height="${S}"`)), E.includes("width=") || (E = E.replace(/<img/, `<img width="${x}"`)), h = h.slice(0, I) + E + h.slice(v), c.writeFileSync(l, h);
|
|
2357
2384
|
} else
|
|
2358
2385
|
p();
|
|
2359
2386
|
} catch (c) {
|
|
2360
|
-
c instanceof Error && await
|
|
2387
|
+
c instanceof Error && await sn(e, c), p(c);
|
|
2361
2388
|
}
|
|
2362
2389
|
};
|
|
2363
|
-
function
|
|
2390
|
+
function _r(e) {
|
|
2364
2391
|
const n = e.lastIndexOf("."), s = e.lastIndexOf("/");
|
|
2365
|
-
return e = e.substring(s + 1, n), `Img${
|
|
2392
|
+
return e = e.substring(s + 1, n), `Img${Tr(e)}`;
|
|
2366
2393
|
}
|
|
2367
|
-
function
|
|
2394
|
+
function Tr(e) {
|
|
2368
2395
|
return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (n, s, r) => `${s.toUpperCase() + r}`).replace(new RegExp(/\w/), (n) => n.toUpperCase());
|
|
2369
2396
|
}
|
|
2370
|
-
const kr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, _r = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__;globalThis.__SRC_DIR__;let o=document.querySelector("#qwik-inspector-info-popup");o||(o=document.createElement("div"),o.id="qwik-inspector-info-popup",o["aria-hidden"]="true",document.body.appendChild(o)),o.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 n=document.body,r=document.createElement("div");function i(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function s(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&d()){const t=e.getBoundingClientRect();r.style.setProperty("height",t.height+"px"),r.style.setProperty("width",t.width+"px"),r.style.setProperty("top",t.top+"px"),r.style.setProperty("left",t.left+"px"),r.style.setProperty("visibility","visible"),n.style.setProperty("cursor","pointer")}else r.style.setProperty("height","0px"),r.style.setProperty("width","0px"),r.style.setProperty("visibility","hidden"),n.style.removeProperty("cursor")}function d(){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))}()}r.id="qwik-inspector-overlay",r.setAttribute("aria-hidden","true"),n.appendChild(r),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),s()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),s()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),s()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=i(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,s()},{capture:!0}),document.addEventListener("click",t=>{if(d()){window.__qwik_inspector_state.pressedKeys.clear();const o=i(t.target);if(o){t.preventDefault(),t.stopPropagation();const r=o.getAttribute(e);if("false"!==r){n.style.setProperty("cursor","progress");const e=r.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,o]=e;fetch(`${t}?editor${o}`).then(()=>{n.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(d()){window.__qwik_inspector_state.pressedKeys.clear();i(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",s),document.addEventListener("scroll",s)};document.addEventListener("DOMContentLoaded",e)}', Tr = `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)})}`, Cr = '[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}', Pr = '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)}', Dr = `<style>
|
|
2397
|
+
const Cr = `"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__;globalThis.__SRC_DIR__;let o=document.querySelector("#qwik-inspector-info-popup");o||(o=document.createElement("div"),o.id="qwik-inspector-info-popup",o["aria-hidden"]="true",document.body.appendChild(o)),o.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 n=document.body,r=document.createElement("div");function i(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function s(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&d()){const t=e.getBoundingClientRect();r.style.setProperty("height",t.height+"px"),r.style.setProperty("width",t.width+"px"),r.style.setProperty("top",t.top+"px"),r.style.setProperty("left",t.left+"px"),r.style.setProperty("visibility","visible"),n.style.setProperty("cursor","pointer")}else r.style.setProperty("height","0px"),r.style.setProperty("width","0px"),r.style.setProperty("visibility","hidden"),n.style.removeProperty("cursor")}function d(){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))}()}r.id="qwik-inspector-overlay",r.setAttribute("aria-hidden","true"),n.appendChild(r),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),s()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),s()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),s()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=i(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,s()},{capture:!0}),document.addEventListener("click",t=>{if(d()){window.__qwik_inspector_state.pressedKeys.clear();const o=i(t.target);if(o){t.preventDefault(),t.stopPropagation();const r=o.getAttribute(e);if("false"!==r){n.style.setProperty("cursor","progress");const e=r.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,o]=e;fetch(`${t}?editor${o}`).then(()=>{n.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(d()){window.__qwik_inspector_state.pressedKeys.clear();i(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",s),document.addEventListener("scroll",s)};document.addEventListener("DOMContentLoaded",e)}', Dr = `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)})}`, Nr = '[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}', Mr = '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)}', qr = `<style>
|
|
2371
2398
|
:host {
|
|
2372
2399
|
position: absolute;
|
|
2373
2400
|
border: 1px solid red;
|
|
@@ -2531,13 +2558,13 @@ const kr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
2531
2558
|
<p class="action-container"></p>
|
|
2532
2559
|
</div>
|
|
2533
2560
|
</dialog>
|
|
2534
|
-
`,
|
|
2535
|
-
async function
|
|
2561
|
+
`, Lr = `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}`, Or = "#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;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}}";
|
|
2562
|
+
async function jr(e, n, s, r) {
|
|
2536
2563
|
const o = await s.dynamicImport("node:fs"), p = await s.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
|
|
2537
2564
|
(d) => r.join(n, `entry.preview.${d}`)
|
|
2538
2565
|
).find((d) => o.existsSync(d));
|
|
2539
2566
|
if (!a)
|
|
2540
|
-
return
|
|
2567
|
+
return Qe(
|
|
2541
2568
|
e,
|
|
2542
2569
|
`Unable to find output "${n}/entry.preview" module.
|
|
2543
2570
|
|
|
@@ -2547,16 +2574,16 @@ Please ensure "src/entry.preview.tsx" has been built before the "preview" comman
|
|
|
2547
2574
|
const d = p.pathToFileURL(a).href, t = await s.strictDynamicImport(d);
|
|
2548
2575
|
let x = null, S = null;
|
|
2549
2576
|
if (t.default && (typeof t.default == "function" ? x = t.default : typeof t.default == "object" && (x = t.default.router, S = t.default.notFound)), typeof x != "function")
|
|
2550
|
-
return
|
|
2577
|
+
return Qe(
|
|
2551
2578
|
e,
|
|
2552
2579
|
`Entry preview module "${a}" does not export a default middleware function`
|
|
2553
2580
|
);
|
|
2554
2581
|
e.use(x), typeof S == "function" && e.use(S);
|
|
2555
2582
|
} catch (d) {
|
|
2556
|
-
return
|
|
2583
|
+
return Qe(e, String(d));
|
|
2557
2584
|
}
|
|
2558
2585
|
}
|
|
2559
|
-
function
|
|
2586
|
+
function Qe(e, n) {
|
|
2560
2587
|
console.log(`
|
|
2561
2588
|
❌ ${n}
|
|
2562
2589
|
`), e.use((s, r) => {
|
|
@@ -2565,25 +2592,25 @@ function Ge(e, n) {
|
|
|
2565
2592
|
}), r.end(n);
|
|
2566
2593
|
});
|
|
2567
2594
|
}
|
|
2568
|
-
const
|
|
2595
|
+
const $r = (e, n) => {
|
|
2569
2596
|
const s = [
|
|
2570
|
-
{ tag: "style", children:
|
|
2571
|
-
{ tag: "style", children:
|
|
2572
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
2573
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
2597
|
+
{ tag: "style", children: Lr, injectTo: "body" },
|
|
2598
|
+
{ tag: "style", children: Or, injectTo: "body" },
|
|
2599
|
+
{ tag: "script", attrs: { type: "module" }, children: Dr, injectTo: "body" },
|
|
2600
|
+
{ tag: "script", attrs: { type: "module" }, children: Cr, injectTo: "body" }
|
|
2574
2601
|
];
|
|
2575
2602
|
if ((e.devTools?.imageDevTools ?? !0) && s.push(
|
|
2576
2603
|
{
|
|
2577
2604
|
tag: "style",
|
|
2578
|
-
children:
|
|
2605
|
+
children: Nr,
|
|
2579
2606
|
injectTo: "body"
|
|
2580
2607
|
},
|
|
2581
2608
|
{
|
|
2582
2609
|
tag: "script",
|
|
2583
2610
|
attrs: { type: "module" },
|
|
2584
|
-
children:
|
|
2611
|
+
children: Mr.replace(
|
|
2585
2612
|
"globalThis.__TEMPLATE__",
|
|
2586
|
-
JSON.stringify(
|
|
2613
|
+
JSON.stringify(qr)
|
|
2587
2614
|
),
|
|
2588
2615
|
injectTo: "body"
|
|
2589
2616
|
}
|
|
@@ -2592,15 +2619,23 @@ const Lr = (e, n) => {
|
|
|
2592
2619
|
s.push({
|
|
2593
2620
|
tag: "script",
|
|
2594
2621
|
attrs: { type: "module" },
|
|
2595
|
-
children:
|
|
2622
|
+
children: Pr.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__SRC_DIR__", JSON.stringify(o)),
|
|
2596
2623
|
injectTo: "body"
|
|
2597
2624
|
});
|
|
2598
2625
|
}
|
|
2599
2626
|
return s;
|
|
2600
|
-
},
|
|
2601
|
-
|
|
2627
|
+
}, Ur = [
|
|
2628
|
+
Ue,
|
|
2629
|
+
Ke,
|
|
2630
|
+
Je,
|
|
2631
|
+
Be,
|
|
2632
|
+
"@builder.io/qwik",
|
|
2633
|
+
"@builder.io/qwik/jsx-runtime",
|
|
2634
|
+
"@builder.io/qwik/jsx-dev-runtime"
|
|
2635
|
+
], Br = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Rr = [".woff", ".woff2", ".ttf"];
|
|
2636
|
+
function Wr(e = {}) {
|
|
2602
2637
|
let n = "serve", s = null, r = null, o = "/", p = null, c, a = null, d = null, t = null;
|
|
2603
|
-
const x = e.fileFilter ? (i,
|
|
2638
|
+
const x = e.fileFilter ? (i, y) => Dt.test(i) || e.fileFilter(i, y) : () => !0, S = e.disableFontPreload ?? !1, u = [], w = Pt(e.optimizerOptions), m = /* @__PURE__ */ new Set();
|
|
2604
2639
|
return [{
|
|
2605
2640
|
name: "vite-plugin-qwik",
|
|
2606
2641
|
enforce: "pre",
|
|
@@ -2615,16 +2650,16 @@ function Fr(e = {}) {
|
|
|
2615
2650
|
registerBundleGraphAdder: (i) => m.add(i),
|
|
2616
2651
|
_oldDevSsrServer: () => e.devSsrServer
|
|
2617
2652
|
},
|
|
2618
|
-
async config(i,
|
|
2653
|
+
async config(i, y) {
|
|
2619
2654
|
await w.init();
|
|
2620
2655
|
const h = w.getPath();
|
|
2621
2656
|
let I;
|
|
2622
|
-
i.build?.ssr ||
|
|
2657
|
+
i.build?.ssr || y.mode === "ssr" ? I = "ssr" : y.mode === "lib" ? I = "lib" : y.mode === "test" ? I = "test" : I = "client", n = y.command;
|
|
2623
2658
|
let v;
|
|
2624
|
-
|
|
2625
|
-
const T = I === "ssr" ? typeof i.build?.ssr == "string" ? i.build.ssr : e.ssr?.input : void 0,
|
|
2626
|
-
let
|
|
2627
|
-
|
|
2659
|
+
y.mode === "production" ? v = "production" : y.mode === "development" ? v = "development" : n === "build" && I === "client" ? v = "production" : v = "development", w.debug(`vite config(), command: ${n}, env.mode: ${y.mode}`), n === "serve" ? e.entryStrategy = { type: "segment" } : I === "ssr" ? e.entryStrategy = { type: "hoist" } : I === "lib" && (e.entryStrategy = { type: "inline" });
|
|
2660
|
+
const T = I === "ssr" ? typeof i.build?.ssr == "string" ? i.build.ssr : e.ssr?.input : void 0, E = I === "client" ? e.client?.input : void 0;
|
|
2661
|
+
let P = i.build?.rollupOptions?.input || E || T;
|
|
2662
|
+
P && typeof P == "string" && (P = [P]), c = i.build?.assetsDir;
|
|
2628
2663
|
const $ = I === "client" && !!c && c !== "_astro", L = {
|
|
2629
2664
|
target: I,
|
|
2630
2665
|
buildMode: v,
|
|
@@ -2645,18 +2680,18 @@ function Fr(e = {}) {
|
|
|
2645
2680
|
sourcemap: !!i.build?.sourcemap,
|
|
2646
2681
|
lint: e.lint,
|
|
2647
2682
|
experimental: e.experimental,
|
|
2648
|
-
input:
|
|
2683
|
+
input: P,
|
|
2649
2684
|
manifestInput: e.ssr?.manifestInput,
|
|
2650
2685
|
manifestOutput: e.client?.manifestOutput
|
|
2651
2686
|
}, B = await w.normalizeOptions(L);
|
|
2652
|
-
|
|
2653
|
-
const H = v === "development", J = "globalThis.qDev",
|
|
2687
|
+
P || (P = B.input), s = B.manifestInput, a = B.srcDir, d = B.rootDir, e.csr || (r = B.clientOutDir, p = i.base ? h.join(r, i.base) : r, t = B.ssrOutDir);
|
|
2688
|
+
const H = v === "development", J = "globalThis.qDev", ie = "globalThis.qTest", W = "globalThis.qInspector", X = "globalThis.qSerialize", V = i?.define?.[J] ?? H, ue = i?.define?.[W] ?? H, j = i?.define?.[X] ?? H, G = {
|
|
2654
2689
|
ssr: {
|
|
2655
|
-
noExternal: [Ue,
|
|
2690
|
+
noExternal: [Ue, Be, ze, ne]
|
|
2656
2691
|
},
|
|
2657
2692
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
2658
2693
|
resolve: {
|
|
2659
|
-
dedupe: [...
|
|
2694
|
+
dedupe: [...Ur],
|
|
2660
2695
|
conditions: v === "production" && I === "client" ? ["min"] : [],
|
|
2661
2696
|
alias: {
|
|
2662
2697
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
@@ -2681,16 +2716,16 @@ function Fr(e = {}) {
|
|
|
2681
2716
|
// using optimized deps for qwik libraries will lead to duplicate imports
|
|
2682
2717
|
// this breaks Qwik because it relies a lot on module scoped symbols
|
|
2683
2718
|
Ue,
|
|
2684
|
-
|
|
2685
|
-
|
|
2719
|
+
Be,
|
|
2720
|
+
ze,
|
|
2686
2721
|
Ke,
|
|
2687
|
-
|
|
2688
|
-
te,
|
|
2722
|
+
Je,
|
|
2689
2723
|
ne,
|
|
2690
|
-
|
|
2691
|
-
"@builder.io/qwik"
|
|
2692
|
-
|
|
2693
|
-
|
|
2724
|
+
re,
|
|
2725
|
+
"@builder.io/qwik"
|
|
2726
|
+
],
|
|
2727
|
+
// Enforce scanning our input even when overridden later
|
|
2728
|
+
entries: P && (typeof P == "string" ? [P] : typeof P == "object" ? Object.values(P) : P)
|
|
2694
2729
|
},
|
|
2695
2730
|
build: {
|
|
2696
2731
|
modulePreload: !1,
|
|
@@ -2705,46 +2740,46 @@ function Fr(e = {}) {
|
|
|
2705
2740
|
*/
|
|
2706
2741
|
maxParallelFileOps: 1,
|
|
2707
2742
|
// This will amend the existing input
|
|
2708
|
-
input:
|
|
2743
|
+
input: P
|
|
2709
2744
|
// temporary fix for rolldown-vite types
|
|
2710
2745
|
}
|
|
2711
2746
|
},
|
|
2712
2747
|
define: {
|
|
2713
|
-
[J]:
|
|
2714
|
-
[W]:
|
|
2715
|
-
[
|
|
2716
|
-
[
|
|
2748
|
+
[J]: V,
|
|
2749
|
+
[W]: ue,
|
|
2750
|
+
[X]: j,
|
|
2751
|
+
[ie]: JSON.stringify(process.env.NODE_ENV === "test")
|
|
2717
2752
|
}
|
|
2718
2753
|
};
|
|
2719
2754
|
if (!e.csr) {
|
|
2720
|
-
const
|
|
2721
|
-
G.build.cssCodeSplit = !1, G.build.outDir =
|
|
2722
|
-
const
|
|
2755
|
+
const Ne = I === "client" && i.base ? h.join(B.outDir, i.base) : B.outDir;
|
|
2756
|
+
G.build.cssCodeSplit = !1, G.build.outDir = Ne;
|
|
2757
|
+
const Q = G.build.rollupOptions?.onwarn;
|
|
2723
2758
|
G.build.rollupOptions = {
|
|
2724
2759
|
...G.build.rollupOptions,
|
|
2725
|
-
output:
|
|
2760
|
+
output: await In(
|
|
2726
2761
|
w,
|
|
2727
2762
|
i.build?.rollupOptions?.output,
|
|
2728
2763
|
$,
|
|
2729
|
-
|
|
2764
|
+
Ne
|
|
2730
2765
|
),
|
|
2731
2766
|
preserveEntrySignatures: "exports-only",
|
|
2732
|
-
onwarn: (
|
|
2733
|
-
|
|
2767
|
+
onwarn: (se, Me) => {
|
|
2768
|
+
se.plugin === "typescript" && se.message.includes("outputToFilesystem") || (Q ? Q(se, Me) : Me(se));
|
|
2734
2769
|
}
|
|
2735
2770
|
}, B.target === "ssr" ? n === "build" && (G.publicDir = !1, G.build.ssr = !0, i.build?.minify == null && v === "production" && (G.build.minify = !0)) : B.target === "client" || (B.target === "lib" ? (G.build.minify = !1, G.build.rollupOptions.external = [
|
|
2736
2771
|
Ue,
|
|
2737
|
-
|
|
2738
|
-
|
|
2772
|
+
Be,
|
|
2773
|
+
ze,
|
|
2739
2774
|
Ke,
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2775
|
+
Je,
|
|
2776
|
+
ne,
|
|
2777
|
+
re
|
|
2743
2778
|
]) : G.define = {
|
|
2744
2779
|
[J]: !0,
|
|
2745
|
-
[
|
|
2780
|
+
[ie]: !0,
|
|
2746
2781
|
[W]: !1
|
|
2747
|
-
}), globalThis.qDev =
|
|
2782
|
+
}), globalThis.qDev = V, globalThis.qTest = !0, globalThis.qInspector = ue;
|
|
2748
2783
|
}
|
|
2749
2784
|
return G;
|
|
2750
2785
|
},
|
|
@@ -2754,46 +2789,63 @@ function Fr(e = {}) {
|
|
|
2754
2789
|
!!i.build.sourcemap && e.optimizerOptions?.sourcemap === void 0 && w.setSourceMapSupport(!0), w.normalizeOptions(e);
|
|
2755
2790
|
},
|
|
2756
2791
|
async buildStart() {
|
|
2757
|
-
|
|
2792
|
+
u.length = 0;
|
|
2758
2793
|
const i = this.resolve.bind(this);
|
|
2759
|
-
await w.validateSource(i), w.onDiagnostics((
|
|
2760
|
-
|
|
2794
|
+
await w.validateSource(i), w.onDiagnostics((y, h, I) => {
|
|
2795
|
+
y.forEach((v) => {
|
|
2761
2796
|
const T = w.normalizePath(h.sys.path.join(I, v.file));
|
|
2762
|
-
v.category === "error" ? this.error(
|
|
2797
|
+
v.category === "error" ? this.error(Re(T, v)) : this.warn(Re(T, v));
|
|
2763
2798
|
});
|
|
2764
2799
|
}), await w.buildStart(this);
|
|
2765
2800
|
},
|
|
2766
|
-
resolveId(i,
|
|
2767
|
-
|
|
2801
|
+
resolveId(i, y, h) {
|
|
2802
|
+
const I = x(i, "resolveId");
|
|
2803
|
+
return ee(i) || !I ? null : w.resolveId(this, i, y, h);
|
|
2768
2804
|
},
|
|
2769
|
-
load(i,
|
|
2770
|
-
|
|
2805
|
+
load(i, y) {
|
|
2806
|
+
const h = x(i, "load");
|
|
2807
|
+
return ee(i) || !h ? null : (i = w.normalizePath(i), n === "serve" && i.endsWith(re) ? {
|
|
2771
2808
|
code: "export const manifest = undefined;"
|
|
2772
|
-
} : w.load(this, i,
|
|
2809
|
+
} : w.load(this, i, y));
|
|
2773
2810
|
},
|
|
2774
|
-
transform(i,
|
|
2775
|
-
|
|
2811
|
+
transform(i, y, h) {
|
|
2812
|
+
const I = x(y, "transform"), v = y.includes("?raw");
|
|
2813
|
+
if (ee(y) || !I || v)
|
|
2814
|
+
return null;
|
|
2815
|
+
if (y.includes(".vite/deps/") && i.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(i)) {
|
|
2816
|
+
const T = d && y.startsWith(d) ? y.slice(d.length) : y;
|
|
2817
|
+
throw new Error(
|
|
2818
|
+
`
|
|
2819
|
+
==============
|
|
2820
|
+
This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
|
|
2821
|
+
Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config:
|
|
2822
|
+
${T}
|
|
2823
|
+
==============
|
|
2824
|
+
`
|
|
2825
|
+
);
|
|
2826
|
+
}
|
|
2827
|
+
return w.transform(this, i, y, h);
|
|
2776
2828
|
}
|
|
2777
2829
|
}, {
|
|
2778
2830
|
name: "vite-plugin-qwik-post",
|
|
2779
2831
|
enforce: "post",
|
|
2780
2832
|
generateBundle: {
|
|
2781
2833
|
order: "post",
|
|
2782
|
-
async handler(i,
|
|
2834
|
+
async handler(i, y) {
|
|
2783
2835
|
const h = w.getOptions();
|
|
2784
2836
|
if (h.target === "client") {
|
|
2785
|
-
for (const [I, v] of Object.entries(
|
|
2837
|
+
for (const [I, v] of Object.entries(y))
|
|
2786
2838
|
if (v.type === "asset") {
|
|
2787
2839
|
const T = o + I;
|
|
2788
|
-
if (
|
|
2789
|
-
typeof v.source == "string" && v.source.length < h.inlineStylesUpToBytes ?
|
|
2840
|
+
if (Br.some((E) => I.endsWith(E)))
|
|
2841
|
+
typeof v.source == "string" && v.source.length < h.inlineStylesUpToBytes ? u.push({
|
|
2790
2842
|
tag: "style",
|
|
2791
2843
|
location: "head",
|
|
2792
2844
|
attributes: {
|
|
2793
2845
|
"data-src": T,
|
|
2794
2846
|
dangerouslySetInnerHTML: v.source
|
|
2795
2847
|
}
|
|
2796
|
-
}) :
|
|
2848
|
+
}) : u.push({
|
|
2797
2849
|
tag: "link",
|
|
2798
2850
|
location: "head",
|
|
2799
2851
|
attributes: {
|
|
@@ -2802,47 +2854,47 @@ function Fr(e = {}) {
|
|
|
2802
2854
|
}
|
|
2803
2855
|
});
|
|
2804
2856
|
else {
|
|
2805
|
-
const
|
|
2806
|
-
|
|
2857
|
+
const E = Rr.find((P) => I.endsWith(P));
|
|
2858
|
+
E && !S && u.unshift({
|
|
2807
2859
|
tag: "link",
|
|
2808
2860
|
location: "head",
|
|
2809
2861
|
attributes: {
|
|
2810
2862
|
rel: "preload",
|
|
2811
2863
|
href: T,
|
|
2812
2864
|
as: "font",
|
|
2813
|
-
type: `font/${
|
|
2865
|
+
type: `font/${E.slice(1)}`,
|
|
2814
2866
|
crossorigin: ""
|
|
2815
2867
|
}
|
|
2816
2868
|
});
|
|
2817
2869
|
}
|
|
2818
2870
|
}
|
|
2819
|
-
await w.generateManifest(this,
|
|
2820
|
-
injections:
|
|
2871
|
+
await w.generateManifest(this, y, m, {
|
|
2872
|
+
injections: u,
|
|
2821
2873
|
platform: { vite: "" }
|
|
2822
2874
|
});
|
|
2823
2875
|
}
|
|
2824
2876
|
}
|
|
2825
2877
|
},
|
|
2826
|
-
async writeBundle(i,
|
|
2878
|
+
async writeBundle(i, y) {
|
|
2827
2879
|
const h = w.getOptions();
|
|
2828
2880
|
if (h.target === "ssr") {
|
|
2829
2881
|
const I = w.getSys();
|
|
2830
2882
|
if (I.env === "node" || I.env === "bun") {
|
|
2831
|
-
const v = Object.keys(
|
|
2883
|
+
const v = Object.keys(y), T = async (E) => {
|
|
2832
2884
|
try {
|
|
2833
|
-
const
|
|
2834
|
-
if ((
|
|
2835
|
-
const B = I.path.basename(
|
|
2885
|
+
const P = I.path.basename(E), $ = I.path.extname(P);
|
|
2886
|
+
if ((P.startsWith("entry.") || P.startsWith("entry_")) && !P.includes("preview") && ($ === ".mjs" || $ === ".cjs")) {
|
|
2887
|
+
const B = I.path.basename(P, $), H = `${B}.js`, J = B + $;
|
|
2836
2888
|
if (!v.some((W) => I.path.basename(W) === H)) {
|
|
2837
|
-
const W = I.path.dirname(
|
|
2838
|
-
await
|
|
2839
|
-
I.path.join(
|
|
2889
|
+
const W = I.path.dirname(E), X = await I.dynamicImport("node:fs"), V = I.path.join(h.outDir, W);
|
|
2890
|
+
await X.promises.mkdir(V, { recursive: !0 }), await X.promises.writeFile(
|
|
2891
|
+
I.path.join(V, H),
|
|
2840
2892
|
`export * from "./${J}";`
|
|
2841
2893
|
);
|
|
2842
2894
|
}
|
|
2843
2895
|
}
|
|
2844
|
-
} catch (
|
|
2845
|
-
console.error("patchModuleFormat",
|
|
2896
|
+
} catch (P) {
|
|
2897
|
+
console.error("patchModuleFormat", P);
|
|
2846
2898
|
}
|
|
2847
2899
|
};
|
|
2848
2900
|
await Promise.all(v.map(T));
|
|
@@ -2851,15 +2903,15 @@ function Fr(e = {}) {
|
|
|
2851
2903
|
},
|
|
2852
2904
|
transformIndexHtml() {
|
|
2853
2905
|
if (n === "serve")
|
|
2854
|
-
return
|
|
2906
|
+
return $r(w.getOptions(), a);
|
|
2855
2907
|
},
|
|
2856
2908
|
configureServer(i) {
|
|
2857
|
-
w.configureServer(i), (e?.devTools?.imageDevTools ?? !0) && i.middlewares.use(
|
|
2909
|
+
w.configureServer(i), (e?.devTools?.imageDevTools ?? !0) && i.middlewares.use(Er(w.getSys(), d, a));
|
|
2858
2910
|
},
|
|
2859
2911
|
configurePreviewServer(i) {
|
|
2860
2912
|
return async () => {
|
|
2861
|
-
const
|
|
2862
|
-
await
|
|
2913
|
+
const y = w.getSys(), h = w.getPath();
|
|
2914
|
+
await jr(i.middlewares, t, y, h);
|
|
2863
2915
|
};
|
|
2864
2916
|
},
|
|
2865
2917
|
handleHotUpdate(i) {
|
|
@@ -2867,19 +2919,19 @@ function Fr(e = {}) {
|
|
|
2867
2919
|
type: "full-reload"
|
|
2868
2920
|
});
|
|
2869
2921
|
},
|
|
2870
|
-
onLog(i,
|
|
2871
|
-
if (
|
|
2872
|
-
const h =
|
|
2922
|
+
onLog(i, y) {
|
|
2923
|
+
if (y.plugin == "vite-plugin-qwik") {
|
|
2924
|
+
const h = Fr[i] || oe.White, I = (y.frame || "").split(`
|
|
2873
2925
|
`).map(
|
|
2874
|
-
(v) => (v.match(/^\s*\^\s*$/) ?
|
|
2926
|
+
(v) => (v.match(/^\s*\^\s*$/) ? oe.BrightWhite : oe.BrightBlack) + v
|
|
2875
2927
|
);
|
|
2876
2928
|
return console[i](
|
|
2877
2929
|
`${h}%s
|
|
2878
|
-
${
|
|
2879
|
-
%s${
|
|
2880
|
-
`[${
|
|
2930
|
+
${oe.BrightWhite}%s
|
|
2931
|
+
%s${oe.RESET}`,
|
|
2932
|
+
`[${y.plugin}](${i}): ${y.message}
|
|
2881
2933
|
`,
|
|
2882
|
-
` ${
|
|
2934
|
+
` ${y?.loc?.file}:${y?.loc?.line}:${y?.loc?.column}
|
|
2883
2935
|
`,
|
|
2884
2936
|
` ${I.join(`
|
|
2885
2937
|
`)}
|
|
@@ -2887,9 +2939,9 @@ ${re.BrightWhite}%s
|
|
|
2887
2939
|
), !1;
|
|
2888
2940
|
}
|
|
2889
2941
|
}
|
|
2890
|
-
},
|
|
2942
|
+
}, Ar()];
|
|
2891
2943
|
}
|
|
2892
|
-
async function
|
|
2944
|
+
async function Ar() {
|
|
2893
2945
|
let e, n;
|
|
2894
2946
|
try {
|
|
2895
2947
|
e = await import("node:fs").then((a) => a.promises), n = await import("node:path");
|
|
@@ -2906,8 +2958,8 @@ async function jr() {
|
|
|
2906
2958
|
await e.access(t);
|
|
2907
2959
|
const S = await e.readFile(t, {
|
|
2908
2960
|
encoding: "utf-8"
|
|
2909
|
-
}),
|
|
2910
|
-
return !!(
|
|
2961
|
+
}), u = JSON.parse(S);
|
|
2962
|
+
return !!(u.qwik || u.dependencies?.[o] || u.peerDependencies?.[o] || u.dependencies?.[p] || u.peerDependencies?.[p]);
|
|
2911
2963
|
} catch {
|
|
2912
2964
|
}
|
|
2913
2965
|
const x = n.dirname(d);
|
|
@@ -2938,9 +2990,10 @@ async function jr() {
|
|
|
2938
2990
|
throw new Error(
|
|
2939
2991
|
`
|
|
2940
2992
|
==============
|
|
2941
|
-
${x} is being treated as an external dependency, but it should be included in the server bundle, because it uses Qwik.
|
|
2942
|
-
Please add the package to "ssr.noExternal" in the Vite config.
|
|
2943
|
-
|
|
2993
|
+
${x} 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.
|
|
2994
|
+
Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
|
|
2995
|
+
==============
|
|
2996
|
+
`
|
|
2944
2997
|
);
|
|
2945
2998
|
if (x === a)
|
|
2946
2999
|
return S;
|
|
@@ -2948,22 +3001,22 @@ Please add the package to "ssr.noExternal" in the Vite config.
|
|
|
2948
3001
|
}
|
|
2949
3002
|
};
|
|
2950
3003
|
}
|
|
2951
|
-
const
|
|
3004
|
+
const oe = {
|
|
2952
3005
|
Yellow: "\x1B[33m",
|
|
2953
3006
|
Cyan: "\x1B[36m",
|
|
2954
3007
|
White: "\x1B[37m",
|
|
2955
3008
|
BrightBlack: "\x1B[90m",
|
|
2956
3009
|
BrightWhite: "\x1B[97m",
|
|
2957
3010
|
RESET: "\x1B[0m"
|
|
2958
|
-
},
|
|
2959
|
-
warn:
|
|
2960
|
-
info:
|
|
2961
|
-
debug:
|
|
2962
|
-
},
|
|
3011
|
+
}, Fr = {
|
|
3012
|
+
warn: oe.Yellow,
|
|
3013
|
+
info: oe.Cyan,
|
|
3014
|
+
debug: oe.BrightBlack
|
|
3015
|
+
}, Gr = void 0;
|
|
2963
3016
|
export {
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
3017
|
+
At as createOptimizer,
|
|
3018
|
+
Hr as qwikRollup,
|
|
3019
|
+
Wr as qwikVite,
|
|
3020
|
+
Gr as symbolMapper,
|
|
3021
|
+
zr as versions
|
|
2969
3022
|
};
|