@qwik.dev/core 2.0.0-beta.40 → 2.0.0-beta.42
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.mjs +2 -2
- package/dist/core-internal.d.ts +97 -72
- package/dist/core.min.mjs +11 -9
- package/dist/core.mjs +733 -144
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +3895 -3334
- package/dist/error-swap-executor.debug.js +37 -0
- package/dist/error-swap-executor.js +1 -0
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +3 -7
- package/dist/optimizer.mjs +52 -68
- package/dist/out-of-order-executor.debug.js +12 -12
- package/dist/qwikloader.debug.js +1 -1
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +27 -0
- package/dist/server.mjs +100 -40
- package/dist/server.prod.mjs +853 -785
- package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +3 -3
- package/dist/starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx +4 -5
- package/dist/starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx +1 -1
- package/dist/starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts +1 -1
- package/dist/starters/features/cypress/src/actions/example.action.ts +1 -1
- package/dist/starters/features/cypress/src/components/example/example.cy.tsx +4 -4
- package/dist/starters/features/cypress/src/loaders/example.loader.ts +1 -1
- package/dist/testing/index.d.ts +11 -2
- package/dist/testing/index.mjs +6568 -6298
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/handlers.mjs +3 -0
- package/package.json +3 -3
- package/public.d.ts +3 -3
package/dist/server.prod.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.42-dev+3473a49
|
|
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
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { setPlatform as setPlatform2 } from "@qwik.dev/core";
|
|
10
10
|
|
|
11
11
|
// packages/qwik/src/server/platform.ts
|
|
12
|
-
import { setPlatform as
|
|
12
|
+
import { setPlatform as Ri } from "@qwik.dev/core";
|
|
13
13
|
|
|
14
14
|
import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
|
17
17
|
import { isDev as isDev2 } from "@qwik.dev/core/build";
|
|
18
18
|
|
|
19
19
|
// packages/qwik/src/core/shared/error/assert.ts
|
|
20
|
-
import { isDev as
|
|
20
|
+
import { isDev as Ue } from "@qwik.dev/core/build";
|
|
21
21
|
|
|
22
22
|
// packages/qwik/src/core/shared/utils/qdev.ts
|
|
23
23
|
var qDev = globalThis.qDev !== false;
|
|
@@ -34,109 +34,109 @@ var qRuntimeQrl = globalThis.qRuntimeQrl === true;
|
|
|
34
34
|
var STYLE = qDev ? `background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;` : "";
|
|
35
35
|
|
|
36
36
|
var throwErrorAndStop = (t, ...e) => {
|
|
37
|
-
const
|
|
37
|
+
const r = He(false, t, ...e);
|
|
38
38
|
debugger;
|
|
39
|
-
throw
|
|
39
|
+
throw r;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
var logErrorAndStop = (t, ...e) => {
|
|
43
|
-
const
|
|
43
|
+
const r = He(qDev, t, ...e);
|
|
44
44
|
debugger;
|
|
45
|
-
return
|
|
45
|
+
return r;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
var
|
|
49
|
-
const
|
|
50
|
-
!qTest && console.error("%cQWIK ERROR", STYLE,
|
|
48
|
+
var He = (t, e, ...r) => {
|
|
49
|
+
const n = e instanceof Error ? e : new Error(e);
|
|
50
|
+
!qTest && console.error("%cQWIK ERROR", STYLE, n.message, ...r, n.stack);
|
|
51
51
|
t && !qTest && setTimeout(() => {
|
|
52
|
-
throw
|
|
52
|
+
throw n;
|
|
53
53
|
}, 0);
|
|
54
|
-
return
|
|
54
|
+
return n;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
// packages/qwik/src/core/shared/error/assert.ts
|
|
58
58
|
var ASSERT_DISCLAIMER = "Internal assert, this is likely caused by a bug in Qwik: ";
|
|
59
59
|
|
|
60
|
-
function assertTrue(t, e, ...
|
|
61
|
-
if (
|
|
60
|
+
function assertTrue(t, e, ...r) {
|
|
61
|
+
if (Ue) {
|
|
62
62
|
if (t === true) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
throwErrorAndStop(ASSERT_DISCLAIMER + e, ...
|
|
65
|
+
throwErrorAndStop(ASSERT_DISCLAIMER + e, ...r);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// packages/qwik/src/core/client/util-mapArray.ts
|
|
70
|
-
var
|
|
71
|
-
isDev2 && assertTrue(
|
|
72
|
-
let
|
|
70
|
+
var Qe = (t, e, r) => {
|
|
71
|
+
isDev2 && assertTrue(r % 2 === 0, "Expecting even number.");
|
|
72
|
+
let n = r >> 1;
|
|
73
73
|
let s = t.length - 2 >> 1;
|
|
74
|
-
while (
|
|
75
|
-
const
|
|
76
|
-
const i = t[
|
|
74
|
+
while (n <= s) {
|
|
75
|
+
const r = n + (s - n >> 1);
|
|
76
|
+
const i = t[r << 1];
|
|
77
77
|
if (i === e) {
|
|
78
|
-
return
|
|
78
|
+
return r << 1;
|
|
79
79
|
}
|
|
80
80
|
if (i < e) {
|
|
81
|
-
|
|
81
|
+
n = r + 1;
|
|
82
82
|
} else {
|
|
83
|
-
s =
|
|
83
|
+
s = r - 1;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return n << 1 ^ -1;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
var
|
|
90
|
-
const i =
|
|
89
|
+
var Je = (t, e, r, n, s = false) => {
|
|
90
|
+
const i = Qe(t, e, n);
|
|
91
91
|
if (i >= 0) {
|
|
92
|
-
if (
|
|
92
|
+
if (r == null && !s) {
|
|
93
93
|
t.splice(i, 2);
|
|
94
94
|
} else {
|
|
95
|
-
t[i + 1] =
|
|
95
|
+
t[i + 1] = r;
|
|
96
96
|
}
|
|
97
|
-
} else if (
|
|
98
|
-
t.splice(i ^ -1, 0, e,
|
|
97
|
+
} else if (r != null || s) {
|
|
98
|
+
t.splice(i ^ -1, 0, e, r);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
var mapApp_remove = (t, e,
|
|
103
|
-
const
|
|
102
|
+
var mapApp_remove = (t, e, r) => {
|
|
103
|
+
const n = Qe(t, e, r);
|
|
104
104
|
let s = null;
|
|
105
|
-
if (
|
|
106
|
-
s = t[
|
|
107
|
-
t.splice(
|
|
105
|
+
if (n >= 0) {
|
|
106
|
+
s = t[n + 1];
|
|
107
|
+
t.splice(n, 2);
|
|
108
108
|
return s;
|
|
109
109
|
}
|
|
110
110
|
return s;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
var
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
return t[
|
|
113
|
+
var Ye = (t, e, r) => {
|
|
114
|
+
const n = Qe(t, e, r);
|
|
115
|
+
if (n >= 0) {
|
|
116
|
+
return t[n + 1];
|
|
117
117
|
} else {
|
|
118
118
|
return null;
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
var
|
|
122
|
+
var Ge = (t, e, r) => Qe(t, e, r) >= 0;
|
|
123
123
|
|
|
124
124
|
// packages/qwik/src/core/shared/error/error.ts
|
|
125
125
|
import { isDev as isDev3 } from "@qwik.dev/core/build";
|
|
126
126
|
|
|
127
127
|
// packages/qwik/src/core/shared/utils/types.ts
|
|
128
|
-
var
|
|
128
|
+
var Ke = t => typeof t === "object" && t !== null;
|
|
129
129
|
|
|
130
|
-
var
|
|
130
|
+
var tr = t => Array.isArray(t);
|
|
131
131
|
|
|
132
|
-
var
|
|
132
|
+
var nr = t => typeof t === "string";
|
|
133
133
|
|
|
134
134
|
// packages/qwik/src/core/shared/error/error.ts
|
|
135
135
|
var baseUrl = "https://qwikdev-build-v2.qwik-8nx.pages.dev/docs/errors/#q";
|
|
136
136
|
|
|
137
137
|
var codeToText = (t, ...e) => {
|
|
138
138
|
if (isDev3) {
|
|
139
|
-
const
|
|
139
|
+
const r = [ "Error while serializing class or style attributes",
|
|
140
140
|
// 0
|
|
141
141
|
"Scheduler not found",
|
|
142
142
|
// 1
|
|
@@ -213,34 +213,34 @@ var codeToText = (t, ...e) => {
|
|
|
213
213
|
"Invalid serialized Promise dependency",
|
|
214
214
|
// 37
|
|
215
215
|
"Invalid serialized Uint8Array payload" ];
|
|
216
|
-
let
|
|
216
|
+
let n = r[t] ?? "";
|
|
217
217
|
if (e.length) {
|
|
218
|
-
|
|
219
|
-
let
|
|
220
|
-
if (
|
|
221
|
-
|
|
218
|
+
n = n.replaceAll(/{{(\d+)}}/g, (t, r) => {
|
|
219
|
+
let n = e[r];
|
|
220
|
+
if (n && Ke(n) && n.constructor === Object) {
|
|
221
|
+
n = JSON.stringify(n).slice(0, 50);
|
|
222
222
|
}
|
|
223
|
-
return
|
|
223
|
+
return n;
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
return `Code(Q${t}): ${
|
|
226
|
+
return `Code(Q${t}): ${n}`;
|
|
227
227
|
} else {
|
|
228
228
|
return `Code(Q${t}) ${baseUrl}${t}`;
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
|
|
232
|
-
var
|
|
233
|
-
const
|
|
234
|
-
return logErrorAndStop(
|
|
232
|
+
var rr = (t, e = []) => {
|
|
233
|
+
const r = codeToText(t, ...e);
|
|
234
|
+
return logErrorAndStop(r, ...e);
|
|
235
235
|
};
|
|
236
236
|
|
|
237
237
|
// packages/qwik/src/core/shared/qrl/qrl-utils.ts
|
|
238
238
|
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
239
239
|
|
|
240
|
-
var
|
|
240
|
+
var ir = "<sync>";
|
|
241
241
|
|
|
242
242
|
// packages/qwik/src/core/shared/types.ts
|
|
243
|
-
var
|
|
243
|
+
var or = "q:type";
|
|
244
244
|
|
|
245
245
|
// packages/qwik/src/core/shared/vnode-data-types.ts
|
|
246
246
|
var VNodeDataSeparator = {
|
|
@@ -416,34 +416,34 @@ var VNodeDataChar = {
|
|
|
416
416
|
/* ******* */ "~"
|
|
417
417
|
};
|
|
418
418
|
|
|
419
|
-
var
|
|
420
|
-
const
|
|
421
|
-
const
|
|
422
|
-
return -(
|
|
419
|
+
var ar = (t, e) => {
|
|
420
|
+
const r = parseInt(t, 10) - 1;
|
|
421
|
+
const n = r + e;
|
|
422
|
+
return -(n * (n + 1) / 2 + e + 1);
|
|
423
423
|
};
|
|
424
424
|
|
|
425
425
|
// packages/qwik/src/core/shared/utils/character-escaping.ts
|
|
426
426
|
function escapeHTML(t) {
|
|
427
427
|
let e = "";
|
|
428
|
-
const
|
|
429
|
-
let
|
|
430
|
-
let s =
|
|
431
|
-
for (;
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
434
|
-
e += t.substring(s,
|
|
435
|
-
} else if (
|
|
436
|
-
e += t.substring(s,
|
|
437
|
-
} else if (
|
|
438
|
-
e += t.substring(s,
|
|
439
|
-
} else if (
|
|
440
|
-
e += t.substring(s,
|
|
441
|
-
} else if (
|
|
442
|
-
e += t.substring(s,
|
|
428
|
+
const r = t.length;
|
|
429
|
+
let n = 0;
|
|
430
|
+
let s = n;
|
|
431
|
+
for (;n < r; n++) {
|
|
432
|
+
const r = t.charCodeAt(n);
|
|
433
|
+
if (r === 60) {
|
|
434
|
+
e += t.substring(s, n) + "<";
|
|
435
|
+
} else if (r === 62) {
|
|
436
|
+
e += t.substring(s, n) + ">";
|
|
437
|
+
} else if (r === 38) {
|
|
438
|
+
e += t.substring(s, n) + "&";
|
|
439
|
+
} else if (r === 34) {
|
|
440
|
+
e += t.substring(s, n) + """;
|
|
441
|
+
} else if (r === 39) {
|
|
442
|
+
e += t.substring(s, n) + "'";
|
|
443
443
|
} else {
|
|
444
444
|
continue;
|
|
445
445
|
}
|
|
446
|
-
s =
|
|
446
|
+
s = n + 1;
|
|
447
447
|
}
|
|
448
448
|
if (s === 0) {
|
|
449
449
|
return t;
|
|
@@ -454,17 +454,17 @@ function escapeHTML(t) {
|
|
|
454
454
|
|
|
455
455
|
function encodeVNodeDataString(t) {
|
|
456
456
|
let e = "";
|
|
457
|
-
const
|
|
458
|
-
let
|
|
459
|
-
let s =
|
|
460
|
-
for (;
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
e += t.substring(s,
|
|
457
|
+
const r = t.length;
|
|
458
|
+
let n = 0;
|
|
459
|
+
let s = n;
|
|
460
|
+
for (;n < r; n++) {
|
|
461
|
+
const r = t.charCodeAt(n);
|
|
462
|
+
if (r >= VNodeDataSeparator.ADVANCE_1 && r <= VNodeDataSeparator.ADVANCE_8192) {
|
|
463
|
+
e += t.substring(s, n) + "\\" + t.charAt(n);
|
|
464
464
|
} else {
|
|
465
465
|
continue;
|
|
466
466
|
}
|
|
467
|
-
s =
|
|
467
|
+
s = n + 1;
|
|
468
468
|
}
|
|
469
469
|
if (s === 0) {
|
|
470
470
|
return t;
|
|
@@ -475,60 +475,60 @@ function encodeVNodeDataString(t) {
|
|
|
475
475
|
|
|
476
476
|
function encodeVNodeDataKey(t) {
|
|
477
477
|
const e = encodeURI(t);
|
|
478
|
-
let
|
|
479
|
-
const
|
|
478
|
+
let r = "";
|
|
479
|
+
const n = e.length;
|
|
480
480
|
let s = 0;
|
|
481
481
|
let i = s;
|
|
482
|
-
for (;s <
|
|
482
|
+
for (;s < n; s++) {
|
|
483
483
|
const t = e.charCodeAt(s);
|
|
484
|
-
let
|
|
484
|
+
let n = null;
|
|
485
485
|
if (t === 59) {
|
|
486
|
-
|
|
486
|
+
n = "%3B";
|
|
487
487
|
} else if (t === 61) {
|
|
488
|
-
|
|
488
|
+
n = "%3D";
|
|
489
489
|
} else if (t === 63) {
|
|
490
|
-
|
|
490
|
+
n = "%3F";
|
|
491
491
|
} else if (t === 64) {
|
|
492
|
-
|
|
492
|
+
n = "%40";
|
|
493
493
|
} else if (t === 126) {
|
|
494
|
-
|
|
494
|
+
n = "%7E";
|
|
495
495
|
} else {
|
|
496
496
|
continue;
|
|
497
497
|
}
|
|
498
|
-
|
|
498
|
+
r += e.substring(i, s) + n;
|
|
499
499
|
i = s + 1;
|
|
500
500
|
}
|
|
501
501
|
if (i === 0) {
|
|
502
502
|
return e;
|
|
503
503
|
} else {
|
|
504
|
-
return
|
|
504
|
+
return r + e.substring(i);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
// packages/qwik/src/core/shared/utils/markers.ts
|
|
509
|
-
var
|
|
509
|
+
var hr = "q:renderFn";
|
|
510
510
|
|
|
511
|
-
var
|
|
511
|
+
var yr = "q:slot";
|
|
512
512
|
|
|
513
|
-
var
|
|
513
|
+
var wr = "q:sparent";
|
|
514
514
|
|
|
515
515
|
var QStatePatchAttr = "q:patch";
|
|
516
516
|
|
|
517
|
-
var
|
|
517
|
+
var vr = "q:r";
|
|
518
518
|
|
|
519
|
-
var
|
|
519
|
+
var gr = "q:style";
|
|
520
520
|
|
|
521
|
-
var
|
|
521
|
+
var Er = "style[q\\:style]";
|
|
522
522
|
|
|
523
523
|
var QStyleSSelector = "style[q\\:sstyle]";
|
|
524
524
|
|
|
525
|
-
var
|
|
525
|
+
var Sr = Er + "," + QStyleSSelector;
|
|
526
526
|
|
|
527
|
-
var
|
|
527
|
+
var kr = "q:sstyle";
|
|
528
528
|
|
|
529
|
-
var
|
|
529
|
+
var Rr = "q:ctx";
|
|
530
530
|
|
|
531
|
-
var
|
|
531
|
+
var Pr = "q:brefs";
|
|
532
532
|
|
|
533
533
|
var QwikEvContainerReady = 0;
|
|
534
534
|
|
|
@@ -538,7 +538,7 @@ var QRuntimeAttr = "q:runtime";
|
|
|
538
538
|
|
|
539
539
|
var QVersionAttr = "q:version";
|
|
540
540
|
|
|
541
|
-
var
|
|
541
|
+
var Ar = "q:base";
|
|
542
542
|
|
|
543
543
|
var QLocaleAttr = "q:locale";
|
|
544
544
|
|
|
@@ -548,115 +548,123 @@ var QInstanceAttr = "q:instance";
|
|
|
548
548
|
|
|
549
549
|
var QStatePrewarmAttr = "q:prewarm";
|
|
550
550
|
|
|
551
|
-
var
|
|
551
|
+
var qr = "q:container-island";
|
|
552
552
|
|
|
553
|
-
var
|
|
553
|
+
var Mr = "/" + qr;
|
|
554
554
|
|
|
555
|
-
var
|
|
555
|
+
var Ir = "q:ignore";
|
|
556
556
|
|
|
557
|
-
var
|
|
557
|
+
var xr = "/" + Ir;
|
|
558
558
|
|
|
559
|
-
var
|
|
559
|
+
var Nr = "q:container";
|
|
560
560
|
|
|
561
|
-
var
|
|
561
|
+
var Cr = "/" + Nr;
|
|
562
562
|
|
|
563
|
-
var
|
|
563
|
+
var Or = "q:template";
|
|
564
564
|
|
|
565
|
-
var
|
|
565
|
+
var jr = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
|
|
566
566
|
|
|
567
567
|
var QDefaultSlot = "";
|
|
568
568
|
|
|
569
|
-
var
|
|
569
|
+
var Wr = "q:id";
|
|
570
570
|
|
|
571
|
-
var
|
|
571
|
+
var Vr = "q:key";
|
|
572
572
|
|
|
573
|
-
var
|
|
573
|
+
var Ur = "q:props";
|
|
574
574
|
|
|
575
|
-
var
|
|
575
|
+
var zr = "q:seq";
|
|
576
576
|
|
|
577
|
-
var
|
|
577
|
+
var Br = "q:seqIdx";
|
|
578
578
|
|
|
579
579
|
var ELEMENT_BACKPATCH_DATA = "qwik/backpatch";
|
|
580
580
|
|
|
581
|
-
var
|
|
581
|
+
var Hr = "q:p";
|
|
582
582
|
|
|
583
|
-
var
|
|
583
|
+
var Qr = "q:ps";
|
|
584
584
|
|
|
585
|
-
var
|
|
585
|
+
var Jr = ":";
|
|
586
586
|
|
|
587
|
-
var
|
|
587
|
+
var Yr = Jr + "on";
|
|
588
588
|
|
|
589
|
-
var
|
|
589
|
+
var Gr = Jr + "onIdx";
|
|
590
590
|
|
|
591
|
-
var
|
|
591
|
+
var Zr = Jr + "onFlags";
|
|
592
592
|
|
|
593
|
-
var
|
|
593
|
+
var Kr = Jr + "cursorBoundary";
|
|
594
594
|
|
|
595
|
-
var
|
|
595
|
+
var ti = Jr + "nearestCursorBoundary";
|
|
596
596
|
|
|
597
|
-
var
|
|
597
|
+
var ni = ":";
|
|
598
598
|
|
|
599
|
-
var
|
|
599
|
+
var ei = "dangerouslySetInnerHTML";
|
|
600
600
|
|
|
601
601
|
// packages/qwik/src/core/shared/utils/promises.ts
|
|
602
|
-
import { isDev as isDev5, isServer as
|
|
602
|
+
import { isDev as isDev5, isServer as We } from "@qwik.dev/core/build";
|
|
603
603
|
|
|
604
|
-
var
|
|
604
|
+
var ii = 100;
|
|
605
605
|
|
|
606
|
-
var
|
|
606
|
+
var si = t => {
|
|
607
|
+
try {
|
|
608
|
+
return !!t && typeof t == "object" && typeof t.then === "function";
|
|
609
|
+
} catch {
|
|
610
|
+
return false;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
607
613
|
|
|
608
|
-
var
|
|
614
|
+
var li = (t, e) => si(t) ? t.then(e) : e(t);
|
|
609
615
|
|
|
610
616
|
var checkError = t => {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
617
|
+
try {
|
|
618
|
+
if (We && t instanceof ReferenceError && t.message.includes("window")) {
|
|
619
|
+
t.message = 'It seems like you forgot to add "if (isBrowser) {...}" here:' + t.message;
|
|
620
|
+
}
|
|
621
|
+
} catch {}
|
|
614
622
|
};
|
|
615
623
|
|
|
616
|
-
var
|
|
624
|
+
var ci = t => {
|
|
617
625
|
throw t;
|
|
618
626
|
};
|
|
619
627
|
|
|
620
|
-
function n(t, e =
|
|
621
|
-
let
|
|
622
|
-
let
|
|
628
|
+
function n(t, e = ci) {
|
|
629
|
+
let r = false;
|
|
630
|
+
let n;
|
|
623
631
|
try {
|
|
624
|
-
|
|
625
|
-
|
|
632
|
+
n = t();
|
|
633
|
+
r = true;
|
|
626
634
|
} catch (t) {
|
|
627
|
-
|
|
635
|
+
n = t;
|
|
628
636
|
}
|
|
629
|
-
if (!
|
|
630
|
-
if (
|
|
631
|
-
return
|
|
637
|
+
if (!si(n)) {
|
|
638
|
+
if (r) {
|
|
639
|
+
return n;
|
|
632
640
|
}
|
|
633
|
-
isDev5 && checkError(
|
|
634
|
-
return e(
|
|
641
|
+
isDev5 && checkError(n);
|
|
642
|
+
return e(n);
|
|
635
643
|
}
|
|
636
|
-
let s =
|
|
637
|
-
const i = async
|
|
638
|
-
while (
|
|
644
|
+
let s = ii;
|
|
645
|
+
const i = async r => {
|
|
646
|
+
while (si(r)) {
|
|
639
647
|
try {
|
|
640
|
-
await
|
|
648
|
+
await r;
|
|
641
649
|
return await t();
|
|
642
650
|
} catch (t) {
|
|
643
|
-
if (
|
|
651
|
+
if (si(t)) {
|
|
644
652
|
if (! --s) {
|
|
645
|
-
|
|
653
|
+
r = new Error("Exceeded max retry count in retryOnPromise");
|
|
646
654
|
break;
|
|
647
655
|
} else {
|
|
648
|
-
|
|
656
|
+
r = t;
|
|
649
657
|
}
|
|
650
658
|
} else {
|
|
651
|
-
|
|
659
|
+
r = t;
|
|
652
660
|
break;
|
|
653
661
|
}
|
|
654
662
|
}
|
|
655
663
|
}
|
|
656
|
-
isDev5 && checkError(
|
|
657
|
-
return e(
|
|
664
|
+
isDev5 && checkError(r);
|
|
665
|
+
return e(r);
|
|
658
666
|
};
|
|
659
|
-
return
|
|
667
|
+
return r ? n.catch(i) : i(n);
|
|
660
668
|
}
|
|
661
669
|
|
|
662
670
|
// packages/qwik/src/core/shared/utils/scoped-styles.ts
|
|
@@ -669,67 +677,67 @@ function convertStyleIdsToString(t) {
|
|
|
669
677
|
}
|
|
670
678
|
|
|
671
679
|
// packages/qwik/src/core/shared/utils/event-names.ts
|
|
672
|
-
var
|
|
680
|
+
var hi = t => t.charCodeAt(0) === 113 && t.charCodeAt(1) === 45 && (t.charCodeAt(3) === 58 || t.charCodeAt(3) === 112 && t.charCodeAt(4) === 58);
|
|
673
681
|
|
|
674
682
|
function isPreventDefault(t) {
|
|
675
683
|
return t.startsWith("preventdefault:");
|
|
676
684
|
}
|
|
677
685
|
|
|
678
686
|
// packages/qwik/src/core/shared/utils/unitless_number.ts
|
|
679
|
-
var
|
|
687
|
+
var yi = /* @__PURE__ */ new Set([ "animationIterationCount", "aspectRatio", "borderImageOutset", "borderImageSlice", "borderImageWidth", "boxFlex", "boxFlexGroup", "boxOrdinalGroup", "columnCount", "columns", "flex", "flexGrow", "flexShrink", "gridArea", "gridRow", "gridRowEnd", "gridRowStart", "gridColumn", "gridColumnEnd", "gridColumnStart", "fontWeight", "lineClamp", "lineHeight", "opacity", "order", "orphans", "scale", "tabSize", "widows", "zIndex", "zoom", "MozAnimationIterationCount",
|
|
680
688
|
// Known Prefixed Properties
|
|
681
689
|
"MozBoxFlex",
|
|
682
690
|
// TODO: Remove these since they shouldn't be used in modern code
|
|
683
691
|
"msFlex", "msFlexPositive", "WebkitAnimationIterationCount", "WebkitBoxFlex", "WebkitBoxOrdinalGroup", "WebkitColumnCount", "WebkitColumns", "WebkitFlex", "WebkitFlexGrow", "WebkitFlexShrink", "WebkitLineClamp" ]);
|
|
684
692
|
|
|
685
|
-
var isUnitlessNumber = t =>
|
|
693
|
+
var isUnitlessNumber = t => yi.has(t);
|
|
686
694
|
|
|
687
695
|
// packages/qwik/src/core/shared/utils/styles.ts
|
|
688
|
-
var
|
|
696
|
+
var mi = t => {
|
|
689
697
|
if (!t) {
|
|
690
698
|
return "";
|
|
691
699
|
}
|
|
692
|
-
if (
|
|
700
|
+
if (nr(t)) {
|
|
693
701
|
return t.trim();
|
|
694
702
|
}
|
|
695
703
|
const e = [];
|
|
696
|
-
if (
|
|
697
|
-
for (let
|
|
698
|
-
const
|
|
699
|
-
const s =
|
|
704
|
+
if (tr(t)) {
|
|
705
|
+
for (let r = 0; r < t.length; r++) {
|
|
706
|
+
const n = t[r];
|
|
707
|
+
const s = mi(n);
|
|
700
708
|
if (s) {
|
|
701
709
|
e.push(s);
|
|
702
710
|
}
|
|
703
711
|
}
|
|
704
712
|
} else {
|
|
705
|
-
for (const [
|
|
706
|
-
if (
|
|
707
|
-
e.push(
|
|
713
|
+
for (const [r, n] of Object.entries(t)) {
|
|
714
|
+
if (n) {
|
|
715
|
+
e.push(r.trim());
|
|
708
716
|
}
|
|
709
717
|
}
|
|
710
718
|
}
|
|
711
719
|
return e.join(" ");
|
|
712
720
|
};
|
|
713
721
|
|
|
714
|
-
var
|
|
722
|
+
var bi = t => t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
715
723
|
|
|
716
|
-
var
|
|
724
|
+
var vi = t => {
|
|
717
725
|
if (t == null) {
|
|
718
726
|
return "";
|
|
719
727
|
}
|
|
720
728
|
if (typeof t == "object") {
|
|
721
|
-
if (
|
|
722
|
-
throw
|
|
729
|
+
if (tr(t)) {
|
|
730
|
+
throw rr(0 /* stringifyClassOrStyle */ , [ t, "style" ]);
|
|
723
731
|
} else {
|
|
724
732
|
const e = [];
|
|
725
|
-
for (const
|
|
726
|
-
if (Object.prototype.hasOwnProperty.call(t,
|
|
727
|
-
const
|
|
728
|
-
if (
|
|
729
|
-
if (
|
|
730
|
-
e.push(
|
|
733
|
+
for (const r in t) {
|
|
734
|
+
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
735
|
+
const n = t[r];
|
|
736
|
+
if (n != null && typeof n !== "function") {
|
|
737
|
+
if (r.startsWith("--")) {
|
|
738
|
+
e.push(r + ":" + n);
|
|
731
739
|
} else {
|
|
732
|
-
e.push(
|
|
740
|
+
e.push(bi(r) + ":" + _i(r, n));
|
|
733
741
|
}
|
|
734
742
|
}
|
|
735
743
|
}
|
|
@@ -742,12 +750,12 @@ var ai = t => {
|
|
|
742
750
|
|
|
743
751
|
var serializeBooleanOrNumberAttribute = t => t != null ? String(t) : null;
|
|
744
752
|
|
|
745
|
-
function r(t, e,
|
|
753
|
+
function r(t, e, r) {
|
|
746
754
|
if (isClassAttr(t)) {
|
|
747
|
-
const t =
|
|
748
|
-
e =
|
|
755
|
+
const t = mi(e);
|
|
756
|
+
e = r ? r + (t.length ? " " + t : t) : t;
|
|
749
757
|
} else if (t === "style") {
|
|
750
|
-
e =
|
|
758
|
+
e = vi(e);
|
|
751
759
|
} else if (isEnumeratedBooleanAttribute(t) || typeof e === "number") {
|
|
752
760
|
e = serializeBooleanOrNumberAttribute(e);
|
|
753
761
|
} else if (e === false || e == null) {
|
|
@@ -762,7 +770,7 @@ function isEnumeratedBooleanAttribute(t) {
|
|
|
762
770
|
return isAriaAttribute(t) || [ "spellcheck", "draggable", "contenteditable" ].includes(t);
|
|
763
771
|
}
|
|
764
772
|
|
|
765
|
-
var
|
|
773
|
+
var _i = (t, e) => {
|
|
766
774
|
if (typeof e === "number" && e !== 0 && !isUnitlessNumber(t)) {
|
|
767
775
|
return e + "px";
|
|
768
776
|
}
|
|
@@ -780,25 +788,25 @@ var graph;
|
|
|
780
788
|
|
|
781
789
|
var parseBundleGraph = t => {
|
|
782
790
|
const e = /* @__PURE__ */ new Map;
|
|
783
|
-
let
|
|
784
|
-
while (
|
|
785
|
-
const
|
|
791
|
+
let r = 0;
|
|
792
|
+
while (r < t.length) {
|
|
793
|
+
const n = t[r++];
|
|
786
794
|
const s = [];
|
|
787
795
|
let i;
|
|
788
796
|
let o = 1;
|
|
789
|
-
while (i = t[
|
|
797
|
+
while (i = t[r], typeof i === "number") {
|
|
790
798
|
if (i < 0) {
|
|
791
799
|
o = -i / 10;
|
|
792
800
|
} else {
|
|
793
801
|
s.push({
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
802
|
+
yn: t[i],
|
|
803
|
+
En: o,
|
|
804
|
+
Sn: 1
|
|
797
805
|
});
|
|
798
806
|
}
|
|
799
|
-
|
|
807
|
+
r++;
|
|
800
808
|
}
|
|
801
|
-
e.set(
|
|
809
|
+
e.set(n, s);
|
|
802
810
|
}
|
|
803
811
|
return e;
|
|
804
812
|
};
|
|
@@ -812,7 +820,7 @@ var initPreloader = t => {
|
|
|
812
820
|
};
|
|
813
821
|
|
|
814
822
|
// packages/qwik/src/core/shared/utils/objects.ts
|
|
815
|
-
var
|
|
823
|
+
var zi = t => {
|
|
816
824
|
for (const e in t) {
|
|
817
825
|
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
818
826
|
return false;
|
|
@@ -824,8 +832,8 @@ var Oi = t => {
|
|
|
824
832
|
// packages/qwik/src/core/ssr/stream-writer.ts
|
|
825
833
|
var stringifyRootRefPath = t => {
|
|
826
834
|
let e = String(t[0]);
|
|
827
|
-
for (let
|
|
828
|
-
e += " " + t[
|
|
835
|
+
for (let r = 1; r < t.length; r++) {
|
|
836
|
+
e += " " + t[r];
|
|
829
837
|
}
|
|
830
838
|
return e;
|
|
831
839
|
};
|
|
@@ -834,9 +842,9 @@ var writeStringRootRef = (t, e) => t.write(String(e));
|
|
|
834
842
|
|
|
835
843
|
var writeStringRootRefPath = (t, e) => t.write(stringifyRootRefPath(e));
|
|
836
844
|
|
|
837
|
-
var writeStringRootRefDelta = (t, e,
|
|
845
|
+
var writeStringRootRefDelta = (t, e, r) => t.write(String(e - r));
|
|
838
846
|
|
|
839
|
-
var
|
|
847
|
+
var Bi = t => ({
|
|
840
848
|
write: t,
|
|
841
849
|
writeRootRef(t) {
|
|
842
850
|
return writeStringRootRef(this, t);
|
|
@@ -856,88 +864,88 @@ var GT = ">";
|
|
|
856
864
|
|
|
857
865
|
var CLOSE_TAG = "</";
|
|
858
866
|
|
|
859
|
-
var
|
|
867
|
+
var Sh = " ";
|
|
860
868
|
|
|
861
869
|
var ATTR_EQUALS_QUOTE = '="';
|
|
862
870
|
|
|
863
|
-
var
|
|
871
|
+
var Hi = '"';
|
|
864
872
|
|
|
865
873
|
var EMPTY_ATTR = '=""';
|
|
866
874
|
|
|
867
|
-
var
|
|
875
|
+
var Qi = "[";
|
|
868
876
|
|
|
869
|
-
var
|
|
877
|
+
var Ji = "]";
|
|
870
878
|
|
|
871
879
|
var PAREN_CLOSE = ")";
|
|
872
880
|
|
|
873
|
-
var
|
|
881
|
+
var Yi = ",";
|
|
874
882
|
|
|
875
883
|
// packages/qwik/src/server/platform.ts
|
|
876
|
-
var getDevSegmentPath = (t, e,
|
|
884
|
+
var getDevSegmentPath = (t, e, r, n) => {
|
|
877
885
|
const s = t?.[e];
|
|
878
886
|
if (s) {
|
|
879
887
|
return s;
|
|
880
888
|
}
|
|
881
|
-
if (
|
|
882
|
-
return [
|
|
889
|
+
if (r === ir) {
|
|
890
|
+
return [ r, "" ];
|
|
883
891
|
}
|
|
884
|
-
if (!
|
|
885
|
-
if (
|
|
886
|
-
return [
|
|
892
|
+
if (!n) {
|
|
893
|
+
if (r.startsWith("_") && r.length < 6) {
|
|
894
|
+
return [ r, `${import.meta.env?.BASE_URL}@qwik-handlers` ];
|
|
887
895
|
}
|
|
888
|
-
console.error("qwik symbolMapper: unknown qrl requested without parent:",
|
|
889
|
-
return [
|
|
896
|
+
console.error("qwik symbolMapper: unknown qrl requested without parent:", r);
|
|
897
|
+
return [ r, `${import.meta.env?.BASE_URL}${r}.js` ];
|
|
890
898
|
}
|
|
891
|
-
const i = `${import.meta.env?.BASE_URL}${
|
|
892
|
-
return [
|
|
899
|
+
const i = `${import.meta.env?.BASE_URL}${n.startsWith("/") ? n.slice(1) : n}_${r}.js`;
|
|
900
|
+
return [ r, i ];
|
|
893
901
|
};
|
|
894
902
|
|
|
895
|
-
function
|
|
896
|
-
const
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
const e =
|
|
900
|
-
const s = !isDev6 ?
|
|
903
|
+
function Ei(t, e) {
|
|
904
|
+
const r = e?.mapper;
|
|
905
|
+
const n = t.symbolMapper ? t.symbolMapper : (t, e, n) => {
|
|
906
|
+
if (r || isDev6 && import.meta.env?.MODE !== "test") {
|
|
907
|
+
const e = Nd(t);
|
|
908
|
+
const s = !isDev6 ? r[e] : getDevSegmentPath(r, e, t, n);
|
|
901
909
|
if (!s) {
|
|
902
|
-
if (e ===
|
|
910
|
+
if (e === ir) {
|
|
903
911
|
return [ e, "" ];
|
|
904
912
|
}
|
|
905
913
|
const s = globalThis.__qwik_reg_symbols?.has(e);
|
|
906
914
|
if (s) {
|
|
907
915
|
return [ t, "_" ];
|
|
908
916
|
}
|
|
909
|
-
console.error("Cannot resolve symbol", t, "in",
|
|
917
|
+
console.error("Cannot resolve symbol", t, "in", r, n);
|
|
910
918
|
}
|
|
911
919
|
return s;
|
|
912
920
|
}
|
|
913
921
|
};
|
|
914
922
|
const s = {
|
|
915
923
|
isServer: true,
|
|
916
|
-
async importSymbol(t, e,
|
|
917
|
-
const
|
|
918
|
-
const s = globalThis.__qwik_reg_symbols?.get(
|
|
924
|
+
async importSymbol(t, e, r) {
|
|
925
|
+
const n = Nd(r);
|
|
926
|
+
const s = globalThis.__qwik_reg_symbols?.get(n);
|
|
919
927
|
if (s) {
|
|
920
928
|
return s;
|
|
921
929
|
}
|
|
922
|
-
throw
|
|
930
|
+
throw rr(6 /* dynamicImportFailed */ , [ r ]);
|
|
923
931
|
},
|
|
924
932
|
raf: () => {
|
|
925
933
|
console.error("server can not rerender");
|
|
926
934
|
return Promise.resolve();
|
|
927
935
|
},
|
|
928
936
|
chunkForSymbol(t, e, s) {
|
|
929
|
-
return
|
|
937
|
+
return n(t, r, s);
|
|
930
938
|
}
|
|
931
939
|
};
|
|
932
940
|
return s;
|
|
933
941
|
}
|
|
934
942
|
|
|
935
943
|
async function setServerPlatform(t, e) {
|
|
936
|
-
const
|
|
937
|
-
|
|
944
|
+
const r = Ei(t, e);
|
|
945
|
+
Ri(r);
|
|
938
946
|
}
|
|
939
947
|
|
|
940
|
-
var
|
|
948
|
+
var Nd = t => {
|
|
941
949
|
const e = t.lastIndexOf("_");
|
|
942
950
|
if (e > -1) {
|
|
943
951
|
return t.slice(e + 1);
|
|
@@ -946,31 +954,31 @@ var sd = t => {
|
|
|
946
954
|
};
|
|
947
955
|
|
|
948
956
|
// packages/qwik/src/server/ssr-render.ts
|
|
949
|
-
import { getClientManifest as
|
|
957
|
+
import { getClientManifest as Ya } from "@qwik.dev/core";
|
|
950
958
|
|
|
951
959
|
// packages/qwik/src/server/ssr-container.ts
|
|
952
960
|
import { isDev as isDev8 } from "@qwik.dev/core/build";
|
|
953
961
|
|
|
954
|
-
import { _SubscriptionData as
|
|
962
|
+
import { _SubscriptionData as oo, _SharedContainer as zc, _jsxSorted as vo, _jsxSplit as _o, _res as _, _setEvent, _walkJSX as Bn, _handleSSRError, _createQRL as xa, isSignal as Fu } from "@qwik.dev/core/internal";
|
|
955
963
|
|
|
956
964
|
// packages/qwik/src/server/ooos-utils.ts
|
|
957
|
-
import { _SubscriptionPatch as
|
|
965
|
+
import { _SubscriptionPatch as uc } from "@qwik.dev/core/internal";
|
|
958
966
|
|
|
959
|
-
var recordExternalRootEffect = (t, e,
|
|
960
|
-
if (!
|
|
967
|
+
var recordExternalRootEffect = (t, e, r, n, s, i, o, a) => {
|
|
968
|
+
if (!n || o !== null && !a) {
|
|
961
969
|
return;
|
|
962
970
|
}
|
|
963
971
|
let l = s;
|
|
964
972
|
if (o !== null && s && (typeof s === "object" || typeof s === "function")) {
|
|
965
|
-
l =
|
|
973
|
+
l = r.get(s) || s;
|
|
966
974
|
}
|
|
967
|
-
const c = t.
|
|
975
|
+
const c = t.Xe(l);
|
|
968
976
|
e.Rt(l);
|
|
969
977
|
e.Rt(i);
|
|
970
978
|
if (o !== null && typeof o !== "string") {
|
|
971
979
|
e.Rt(o);
|
|
972
980
|
}
|
|
973
|
-
|
|
981
|
+
n.push({
|
|
974
982
|
rootObj: l,
|
|
975
983
|
rootId: c,
|
|
976
984
|
effect: i,
|
|
@@ -978,23 +986,23 @@ var recordExternalRootEffect = (t, e, n, r, s, i, o, a) => {
|
|
|
978
986
|
});
|
|
979
987
|
};
|
|
980
988
|
|
|
981
|
-
var collectSubscriptionPatches = (t, e,
|
|
989
|
+
var collectSubscriptionPatches = (t, e, r) => {
|
|
982
990
|
if (!e?.length) {
|
|
983
991
|
return;
|
|
984
992
|
}
|
|
985
|
-
const
|
|
993
|
+
const n = [];
|
|
986
994
|
const s = /* @__PURE__ */ new Map;
|
|
987
995
|
for (let i = 0; i < e.length; i++) {
|
|
988
996
|
const o = e[i];
|
|
989
|
-
const a = o.rootId === void 0 ? t.
|
|
990
|
-
if (a === void 0 || a >=
|
|
997
|
+
const a = o.rootId === void 0 ? t.Xe(o.rootObj) : o.rootId;
|
|
998
|
+
if (a === void 0 || a >= r) {
|
|
991
999
|
continue;
|
|
992
1000
|
}
|
|
993
1001
|
let l = s.get(a);
|
|
994
1002
|
if (!l) {
|
|
995
|
-
l = new
|
|
1003
|
+
l = new uc(a, o.prop === null ? /* @__PURE__ */ new Set : /* @__PURE__ */ new Map);
|
|
996
1004
|
s.set(a, l);
|
|
997
|
-
|
|
1005
|
+
n.push(l);
|
|
998
1006
|
}
|
|
999
1007
|
const c = l.subscriptions;
|
|
1000
1008
|
if (o.prop === null) {
|
|
@@ -1012,48 +1020,48 @@ var collectSubscriptionPatches = (t, e, n) => {
|
|
|
1012
1020
|
}
|
|
1013
1021
|
}
|
|
1014
1022
|
}
|
|
1015
|
-
return
|
|
1023
|
+
return n.length ? n : void 0;
|
|
1016
1024
|
};
|
|
1017
1025
|
|
|
1018
1026
|
// packages/qwik/src/server/preload-impl.ts
|
|
1019
|
-
import { getPlatform as
|
|
1027
|
+
import { getPlatform as Pi } from "@qwik.dev/core";
|
|
1020
1028
|
|
|
1021
1029
|
var simplifyPath = (t, e) => {
|
|
1022
1030
|
if (e == null) {
|
|
1023
1031
|
return null;
|
|
1024
1032
|
}
|
|
1025
|
-
const
|
|
1026
|
-
const
|
|
1027
|
-
for (let t = 0; t <
|
|
1028
|
-
const e =
|
|
1029
|
-
if (e === ".." &&
|
|
1030
|
-
|
|
1033
|
+
const r = `${t}${e}`.split("/");
|
|
1034
|
+
const n = [];
|
|
1035
|
+
for (let t = 0; t < r.length; t++) {
|
|
1036
|
+
const e = r[t];
|
|
1037
|
+
if (e === ".." && n.length > 0) {
|
|
1038
|
+
n.pop();
|
|
1031
1039
|
} else {
|
|
1032
|
-
|
|
1040
|
+
n.push(e);
|
|
1033
1041
|
}
|
|
1034
1042
|
}
|
|
1035
|
-
return
|
|
1043
|
+
return n.join("/");
|
|
1036
1044
|
};
|
|
1037
1045
|
|
|
1038
1046
|
var getBase = t => {
|
|
1039
|
-
let e = t.
|
|
1047
|
+
let e = t.ze;
|
|
1040
1048
|
if (import.meta.env?.DEV && !qTest) {
|
|
1041
1049
|
e = import.meta.env?.BASE_URL;
|
|
1042
1050
|
}
|
|
1043
1051
|
return e;
|
|
1044
1052
|
};
|
|
1045
1053
|
|
|
1046
|
-
var preloaderPre = (t, e,
|
|
1047
|
-
const {resolvedManifest:
|
|
1054
|
+
var preloaderPre = (t, e, r) => {
|
|
1055
|
+
const {resolvedManifest: n} = t;
|
|
1048
1056
|
const s = getBase(t);
|
|
1049
|
-
const i = simplifyPath(s,
|
|
1050
|
-
let o =
|
|
1057
|
+
const i = simplifyPath(s, n?.manifest?.preloader);
|
|
1058
|
+
let o = n?.manifest.bundleGraphAsset;
|
|
1051
1059
|
if (o) {
|
|
1052
1060
|
o = (import.meta.env?.BASE_URL || "/") + o;
|
|
1053
1061
|
}
|
|
1054
1062
|
if (!(import.meta.env?.DEV && !qTest) && i && o && e !== false) {
|
|
1055
|
-
const
|
|
1056
|
-
initPreloader(
|
|
1063
|
+
const n = t.resolvedManifest?.manifest.bundleGraph;
|
|
1064
|
+
initPreloader(n);
|
|
1057
1065
|
const a = [];
|
|
1058
1066
|
if (e) {
|
|
1059
1067
|
if (e.maxIdlePreloads) {
|
|
@@ -1065,8 +1073,8 @@ var preloaderPre = (t, e, n) => {
|
|
|
1065
1073
|
rel: "modulepreload",
|
|
1066
1074
|
href: i
|
|
1067
1075
|
};
|
|
1068
|
-
if (
|
|
1069
|
-
c["nonce"] =
|
|
1076
|
+
if (r) {
|
|
1077
|
+
c["nonce"] = r;
|
|
1070
1078
|
}
|
|
1071
1079
|
t.openElement("link", null, c, null, null, null);
|
|
1072
1080
|
t.closeElement();
|
|
@@ -1083,27 +1091,27 @@ var preloaderPre = (t, e, n) => {
|
|
|
1083
1091
|
async: true,
|
|
1084
1092
|
crossorigin: "anonymous"
|
|
1085
1093
|
};
|
|
1086
|
-
if (
|
|
1087
|
-
h["nonce"] =
|
|
1094
|
+
if (r) {
|
|
1095
|
+
h["nonce"] = r;
|
|
1088
1096
|
}
|
|
1089
1097
|
t.writeScript(h, u);
|
|
1090
1098
|
}
|
|
1091
|
-
const a = simplifyPath(s,
|
|
1099
|
+
const a = simplifyPath(s, n?.manifest.core);
|
|
1092
1100
|
if (a) {
|
|
1093
1101
|
const e = {
|
|
1094
1102
|
rel: "modulepreload",
|
|
1095
1103
|
href: a
|
|
1096
1104
|
};
|
|
1097
|
-
if (
|
|
1098
|
-
e["nonce"] =
|
|
1105
|
+
if (r) {
|
|
1106
|
+
e["nonce"] = r;
|
|
1099
1107
|
}
|
|
1100
1108
|
t.openElement("link", null, e, null, null, null);
|
|
1101
1109
|
t.closeElement();
|
|
1102
1110
|
}
|
|
1103
1111
|
};
|
|
1104
1112
|
|
|
1105
|
-
var includePreloader = (t, e,
|
|
1106
|
-
if (
|
|
1113
|
+
var includePreloader = (t, e, r, n) => {
|
|
1114
|
+
if (r.length === 0 || e === false) {
|
|
1107
1115
|
return null;
|
|
1108
1116
|
}
|
|
1109
1117
|
const {ssrPreloads: s} = normalizePreLoaderOptions(typeof e === "boolean" ? void 0 : e);
|
|
@@ -1114,8 +1122,8 @@ var includePreloader = (t, e, n, r) => {
|
|
|
1114
1122
|
if (i) {
|
|
1115
1123
|
const t = l?.manifest.preloader;
|
|
1116
1124
|
const e = l?.manifest.core;
|
|
1117
|
-
for (let
|
|
1118
|
-
const s = n
|
|
1125
|
+
for (let n = 0; n < r.length; n++) {
|
|
1126
|
+
const s = r[n];
|
|
1119
1127
|
if (s === t || s === e) {
|
|
1120
1128
|
continue;
|
|
1121
1129
|
}
|
|
@@ -1134,7 +1142,7 @@ var includePreloader = (t, e, n, r) => {
|
|
|
1134
1142
|
*/ `${JSON.stringify(a)}.map((l,e)=>{e=document.createElement('link');e.rel='modulepreload';e.href=${JSON.stringify(o)}+l;document.head.appendChild(e)});` : "";
|
|
1135
1143
|
let h = u;
|
|
1136
1144
|
if (c) {
|
|
1137
|
-
h += `window.addEventListener('load',f=>{f=_=>import("${c}").then(({p})=>p(${JSON.stringify(
|
|
1145
|
+
h += `window.addEventListener('load',f=>{f=_=>import("${c}").then(({p})=>p(${JSON.stringify(r)}));try{requestIdleCallback(f,{timeout:2000})}catch(e){setTimeout(f,200)}})`;
|
|
1138
1146
|
}
|
|
1139
1147
|
if (h) {
|
|
1140
1148
|
const e = {
|
|
@@ -1142,22 +1150,22 @@ var includePreloader = (t, e, n, r) => {
|
|
|
1142
1150
|
async: "true",
|
|
1143
1151
|
"q:type": "preload"
|
|
1144
1152
|
};
|
|
1145
|
-
if (
|
|
1146
|
-
e["nonce"] =
|
|
1153
|
+
if (n) {
|
|
1154
|
+
e["nonce"] = n;
|
|
1147
1155
|
}
|
|
1148
1156
|
t.writeScript(e, h);
|
|
1149
1157
|
}
|
|
1150
1158
|
return null;
|
|
1151
1159
|
};
|
|
1152
1160
|
|
|
1153
|
-
var preloaderPost = (t, e,
|
|
1161
|
+
var preloaderPost = (t, e, r) => {
|
|
1154
1162
|
if (import.meta.env?.DEV && !qTest) {
|
|
1155
1163
|
return;
|
|
1156
1164
|
}
|
|
1157
1165
|
if (e.preloader !== false) {
|
|
1158
|
-
const
|
|
1159
|
-
const s = getBundles(
|
|
1160
|
-
includePreloader(t, e.preloader, s,
|
|
1166
|
+
const n = Array.from(t.serializationCtx.Ft);
|
|
1167
|
+
const s = getBundles(n);
|
|
1168
|
+
includePreloader(t, e.preloader, s, r);
|
|
1161
1169
|
}
|
|
1162
1170
|
};
|
|
1163
1171
|
|
|
@@ -1169,17 +1177,17 @@ function normalizePreLoaderOptions(t) {
|
|
|
1169
1177
|
}
|
|
1170
1178
|
|
|
1171
1179
|
var getBundles = t => {
|
|
1172
|
-
const e =
|
|
1173
|
-
const
|
|
1174
|
-
const
|
|
1175
|
-
const
|
|
1176
|
-
const s = e.chunkForSymbol(
|
|
1180
|
+
const e = Pi();
|
|
1181
|
+
const r = t?.map(t => {
|
|
1182
|
+
const r = t.gt;
|
|
1183
|
+
const n = t.Et;
|
|
1184
|
+
const s = e.chunkForSymbol(r, n, t.dev?.file);
|
|
1177
1185
|
if (s) {
|
|
1178
1186
|
return s[1];
|
|
1179
1187
|
}
|
|
1180
|
-
return
|
|
1188
|
+
return n;
|
|
1181
1189
|
}).filter(Boolean);
|
|
1182
|
-
return [ ...new Set(
|
|
1190
|
+
return [ ...new Set(r) ];
|
|
1183
1191
|
};
|
|
1184
1192
|
|
|
1185
1193
|
var preLoaderOptionsDefault = {
|
|
@@ -1188,9 +1196,9 @@ var preLoaderOptionsDefault = {
|
|
|
1188
1196
|
};
|
|
1189
1197
|
|
|
1190
1198
|
// packages/qwik/src/server/scripts.ts
|
|
1191
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'var e,t,n,r=document,o=window,s="w",i="wp",a="d",c="dp",l="e",p="ep",u="capture:",d="readystatechange",f=0,h=new Set,q=new Set([r]),b=new Map,g={},m=(e,t)=>Array.from(e.querySelectorAll(t)),v=e=>{const t=[];return q.forEach(n=>t.push(...m(n,e))),t},w=(e,t,n,r=!1,o=!1)=>e.addEventListener(t,n,{capture:r,passive:o}),y=e=>{H(e);const t=m(e,"[q\\\\:shadowroot]");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&y(n)}},A=e=>e&&"function"==typeof e.then,E=async e=>{for(let t=0;t<e.length;t++)await e[t]()},S=e=>{if(e.length){const t=()=>E(e);n=n?n.then(t,t):t()}},C=e=>{if(void 0===e._qwikjson_){let t=(e===r.documentElement?r.body:e).lastElementChild;for(;t;){if("SCRIPT"===t.tagName&&"qwik/json"===t.getAttribute("type")){e._qwikjson_=JSON.parse(t.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}t=t.previousElementSibling}}},_=e=>{g[e]=1,I(d)},k=e=>{const t=e.getAttribute("q:instance");return"paused"===e.getAttribute("q:container")&&"loading"===r.readyState&&!g[t]&&new Promise(e=>{w(r,d,()=>{("loading"!==r.readyState||g[t])&&e()})})},$=(e,t)=>new CustomEvent(e,{detail:t}),I=(e,t)=>{r.dispatchEvent($(e,t))},N=e=>e.replace(/([A-Z-])/g,e=>"-"+e.toLowerCase()),R=e=>e.replace(/-./g,e=>e[1].toUpperCase()),T=e=>{const t=e.indexOf(":");return{scope:e.slice(0,t),eventName:R(e.slice(t+1))}},x=e=>2===e.length,B=e=>e.charAt(0),L=e=>!!e&&1===e.nodeType,U=(e,t,n)=>e.hasAttribute(n)&&(!!e._qDispatch?.[t]||e.hasAttribute("q-"+t)),j=(e,t,n,o,s,i,a,c=!0)=>{const l={qBase:n,symbol:i,element:t,reqTime:a};if(!s){const t=(r["qFuncs_"+e.getAttribute("q:instance")]||[])[+i];if(!t&&c){const e=Error("sym:"+i);I("qerror",{importError:"sync",error:e,...l}),console.error(e)}return t}const p=`${i}|${n}|${s}`,u=b.get(p);if(u)return u;const d=new URL(s,o).href,f=import(d);return C(e),f.then(e=>{const t=e[i];if(t)b.set(p,t),I("qsymbol",l);else{const e=Error(`${i} not in ${d}`);I("qerror",{importError:"no-symbol",error:e,...l}),console.error(e)}return t},e=>{I("qerror",{importError:"async",error:e,...l}),console.error(e)})},D=(e,t,n,o,s,i=!0)=>{let a=!1;s&&(i&&e.hasAttribute("preventdefault:"+s)&&t.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&t.stopPropagation());const c=e._qDispatch?.[n];if(c){if("function"==typeof c){const n=()=>c(t,e);if(a)o.push(async()=>{const e=n();A(e)&&await e});else{const e=n();A(e)&&(a=!0,o.push(()=>e))}}else if(c.length)for(let n=0;n<c.length;n++){const r=c[n];if(r){const n=()=>r(t,e);if(a)o.push(async()=>{const e=n();A(e)&&await e});else{const e=n();A(e)&&(a=!0,o.push(()=>e))}}}return}const l=e.getAttribute("q-"+n);if(l){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),s=n.getAttribute("q:base"),i=new URL(s,r.baseURI),c=l.split("|"),p=k(n);for(let r=0;r<c.length;r++){const l=c[r],u=performance.now(),[d,f,h]=l.split("#"),q=n=>{if(n&&e.isConnected){const r=t=>{I("qerror",{error:t,qBase:s,symbol:f,element:e,reqTime:u})};try{const o=n.call(h,t,e);if(A(o))return o.catch(r)}catch(e){return r(e)}}},b=(t=!0)=>j(n,e,s,i,d,f,u,t),g=p?void 0:b();if(p)a=!0,o.push(async()=>{await p,await q(await b(!1)||await b())});else if(A(g))a=!0,o.push(()=>g.then(q));else if(a)a=!0,o.push(async()=>{await q(g||await b())});else{const e=q(g);A(e)&&(a=!0,o.push(()=>e))}}}},O=(e,t=l,n=!0)=>{const r=N(e.type),o=t+":"+r,s=u+r,i=[],a=[],c=[];let p=e.target;for(;p;)L(p)?(i.push(p),a.push(U(p,o,s)),p=p.parentElement):p=p.parentElement;for(let t=i.length-1;t>=0;t--)if(a[t]&&(D(i[t],e,o,c,r,n),e.cancelBubble))return void S(c);for(let t=0;t<i.length;t++)if(!a[t]&&(D(i[t],e,o,c,r,n),!e.bubbles||e.cancelBubble))return void S(c);S(c)},P=e=>O(e,p,!1),F=(e,t,n=!0)=>{const r=N(t.type),o=e+":"+r,s=v("[q-"+CSS.escape(o)+"]"),i=[];for(let e=0;e<s.length;e++){const a=s[e];D(a,t,o,i,r,n)}S(i)},J=e=>{F(a,e)},M=e=>{F(c,e,!1)},Z=e=>{F(s,e)},z=e=>{F(i,e,!1)},G=()=>{const n=r.readyState;if("interactive"==n||"complete"==n){if(t=1,q.forEach(y),h.has("d:qinit")){h.delete("d:qinit");const e=$("qinit"),t=v("[q-d\\\\:qinit]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qinit",n),o.removeAttribute("q-d:qinit")}S(n)}if(h.has("d:qidle")&&(h.delete("d:qidle"),(o.requestIdleCallback??o.setTimeout).bind(o)(()=>{const e=$("qidle"),t=v("[q-d\\\\:qidle]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qidle",n),o.removeAttribute("q-d:qidle")}S(n)})),h.has("e:qvisible")){e||(e=new IntersectionObserver(t=>{const n=[];for(let r=0;r<t.length;r++){const o=t[r];o.isIntersecting&&(e.unobserve(o.target),D(o.target,$("qvisible",o),"e:qvisible",n))}S(n)}));const t=v("[q-e\\\\:qvisible]:not([q\\\\:observed])");for(let n=0;n<t.length;n++){const r=t[n];e.observe(r),r.setAttribute("q:observed","true")}}}},H=(...e)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r===f)_(e[++n]);else if("string"==typeof r){if(!h.has(r)){h.add(r);const{scope:e,eventName:n}=T(r),i=x(e),c=B(e);c===s?w(o,n,i?z:Z,!0,i):q.forEach(e=>w(e,n,c===a?i?M:J:i?P:O,!0,i)),1!==t||"e:qvisible"!==r&&"d:qinit"!==r&&"d:qidle"!==r||G()}}else q.has(r)||(h.forEach(e=>{const{scope:t,eventName:n}=T(e),o=x(t),i=B(t);i!==s&&w(r,n,i===a?o?M:J:o?P:O,!0,o)}),q.add(r))}},K=o._qwikEv;K?.roots||(Array.isArray(K)?H(...K):H("e:click","e:input"),o._qwikEv={events:h,roots:q,push:H},w(r,d,G),G())';
|
|
1199
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'var e,t,n,r=document,o=window,s="w",i="wp",a="d",c="dp",l="e",p="ep",u="capture:",d="readystatechange",f=0,h=new Set,q=new Set([r]),b=new Map,g={},m=(e,t)=>Array.from(e.querySelectorAll(t)),v=e=>{const t=[];return q.forEach(n=>t.push(...m(n,e))),t},w=(e,t,n,r=!1,o=!1)=>e.addEventListener(t,n,{capture:r,passive:o}),y=e=>{H(e);const t=m(e,"[q\\\\:shadowroot]");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&y(n)}},A=e=>e&&"function"==typeof e.then,E=async e=>{for(let t=0;t<e.length;t++)await e[t]()},S=e=>{if(e.length){const t=()=>E(e);n=n?n.then(t,t):t()}},C=e=>{if(void 0===e._qwikjson_){let t=(e===r.documentElement?r.body:e).lastElementChild;for(;t;){if("SCRIPT"===t.tagName&&"qwik/json"===t.getAttribute("type")){e._qwikjson_=JSON.parse(t.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}t=t.previousElementSibling}}},_=e=>{g[e]=1,I(d)},k=e=>{const t=e.getAttribute("q:instance");return"paused"===e.getAttribute("q:container")&&"loading"===r.readyState&&!g[t]&&new Promise(e=>{w(r,d,()=>{("loading"!==r.readyState||g[t])&&e()})})},$=(e,t)=>new CustomEvent(e,{detail:t}),I=(e,t)=>{r.dispatchEvent($(e,t))},N=e=>e.replace(/([A-Z-])/g,e=>"-"+e.toLowerCase()),R=e=>e.replace(/-./g,e=>e[1].toUpperCase()),T=e=>{const t=e.indexOf(":");return{scope:e.slice(0,t),eventName:R(e.slice(t+1))}},x=e=>2===e.length,B=e=>e.charAt(0),L=e=>!!e&&1===e.nodeType,U=(e,t,n)=>e.hasAttribute(n)&&(!!e._qDispatch?.[t]||e.hasAttribute("q-"+t)),j=(e,t,n,o,s,i,a,c=!0)=>{const l={qBase:n,symbol:i,element:t,reqTime:a};if(!s){const t=(r["qFuncs_"+e.getAttribute("q:instance")]||[])[+i];if(!t&&c){const e=Error("sym:"+i);I("qerror",{importError:"sync",error:e,...l}),console.error(e)}return t}const p=`${i}|${n}|${s}`,u=b.get(p);if(u)return u;const d=new URL(s,o).href,f=import(d);return C(e),f.then(e=>{const t=e[i];if(t)b.set(p,t),I("qsymbol",l);else{const e=Error(`${i} not in ${d}`);I("qerror",{importError:"no-symbol",error:e,...l}),console.error(e)}return t},e=>{I("qerror",{importError:"async",error:e,...l}),console.error(e)})},D=(e,t,n,o,s,i=!0)=>{let a=!1;s&&(i&&e.hasAttribute("preventdefault:"+s)&&t.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&t.stopPropagation());const c=e._qDispatch?.[n];if(c){if("function"==typeof c){const n=()=>c(t,e);if(a)o.push(async()=>{const e=n();A(e)&&await e});else{const e=n();A(e)&&(a=!0,o.push(()=>e))}}else if(c.length)for(let n=0;n<c.length;n++){const r=c[n];if(r){const n=()=>r(t,e);if(a)o.push(async()=>{const e=n();A(e)&&await e});else{const e=n();A(e)&&(a=!0,o.push(()=>e))}}}return}const l=e.getAttribute("q-"+n);if(l){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),s=n.getAttribute("q:base"),i=new URL(s,r.baseURI),c=l.split("|"),p=k(n);for(let r=0;r<c.length;r++){const l=c[r],u=performance.now(),[d,f,h]=l.split("#"),q=n=>{if(n&&e.isConnected){const r=t=>{I("qerror",{error:t,qBase:s,symbol:f,element:e,reqTime:u})};try{const o=n.call(h,t,e);if(A(o))return o.catch(r)}catch(e){return r(e)}}},b=(t=!0)=>j(n,e,s,i,d,f,u,t),g=p?void 0:b();if(p)a=!0,o.push(async()=>{await p,await q(d?await b():await b(!1)||await b())});else if(A(g))a=!0,o.push(()=>g.then(q));else if(a)a=!0,o.push(async()=>{await q(g||await b())});else{const e=q(g);A(e)&&(a=!0,o.push(()=>e))}}}},O=(e,t=l,n=!0)=>{const r=N(e.type),o=t+":"+r,s=u+r,i=[],a=[],c=[];let p=e.target;for(;p;)L(p)?(i.push(p),a.push(U(p,o,s)),p=p.parentElement):p=p.parentElement;for(let t=i.length-1;t>=0;t--)if(a[t]&&(D(i[t],e,o,c,r,n),e.cancelBubble))return void S(c);for(let t=0;t<i.length;t++)if(!a[t]&&(D(i[t],e,o,c,r,n),!e.bubbles||e.cancelBubble))return void S(c);S(c)},P=e=>O(e,p,!1),F=(e,t,n=!0)=>{const r=N(t.type),o=e+":"+r,s=v("[q-"+CSS.escape(o)+"]"),i=[];for(let e=0;e<s.length;e++){const a=s[e];D(a,t,o,i,r,n)}S(i)},J=e=>{F(a,e)},M=e=>{F(c,e,!1)},Z=e=>{F(s,e)},z=e=>{F(i,e,!1)},G=()=>{const n=r.readyState;if("interactive"==n||"complete"==n){if(t=1,q.forEach(y),h.has("d:qinit")){h.delete("d:qinit");const e=$("qinit"),t=v("[q-d\\\\:qinit]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qinit",n),o.removeAttribute("q-d:qinit")}S(n)}if(h.has("d:qidle")&&(h.delete("d:qidle"),(o.requestIdleCallback??o.setTimeout).bind(o)(()=>{const e=$("qidle"),t=v("[q-d\\\\:qidle]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qidle",n),o.removeAttribute("q-d:qidle")}S(n)})),h.has("e:qvisible")){e||(e=new IntersectionObserver(t=>{const n=[];for(let r=0;r<t.length;r++){const o=t[r];o.isIntersecting&&(e.unobserve(o.target),D(o.target,$("qvisible",o),"e:qvisible",n))}S(n)}));const t=v("[q-e\\\\:qvisible]:not([q\\\\:observed])");for(let n=0;n<t.length;n++){const r=t[n];e.observe(r),r.setAttribute("q:observed","true")}}}},H=(...e)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r===f)_(e[++n]);else if("string"==typeof r){if(!h.has(r)){h.add(r);const{scope:e,eventName:n}=T(r),i=x(e),c=B(e);c===s?w(o,n,i?z:Z,!0,i):q.forEach(e=>w(e,n,c===a?i?M:J:i?P:O,!0,i)),1!==t||"e:qvisible"!==r&&"d:qinit"!==r&&"d:qidle"!==r||G()}}else q.has(r)||(h.forEach(e=>{const{scope:t,eventName:n}=T(e),o=x(t),i=B(t);i!==s&&w(r,n,i===a?o?M:J:o?P:O,!0,o)}),q.add(r))}},K=o._qwikEv;K?.roots||(Array.isArray(K)?H(...K):H("e:click","e:input"),o._qwikEv={events:h,roots:q,push:H},w(r,d,G),G())';
|
|
1192
1200
|
|
|
1193
|
-
var QWIK_LOADER_DEFAULT_DEBUG = '//#region packages/qwik/src/qwikloader.ts\nvar doc = document;\nvar win = window;\nvar windowPrefix = "w";\nvar passiveWindowPrefix = "wp";\nvar documentPrefix = "d";\nvar passiveDocumentPrefix = "dp";\nvar elementPrefix = "e";\nvar passiveElementPrefix = "ep";\nvar capturePrefix = "capture:";\nvar readyStateChange = "readystatechange";\nvar QwikEvContainerReady = 0;\nvar events = /* @__PURE__ */ new Set();\nvar roots = /* @__PURE__ */ new Set([doc]);\nvar symbols = /* @__PURE__ */ new Map();\nvar readyContainers = {};\nvar observer;\nvar hasInitialized;\nvar queuedTasks;\nvar nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nvar querySelectorAll = (query) => {\n\tconst elements = [];\n\troots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n\treturn elements;\n};\nvar addEventListener = (el, eventName, handler, capture = false, passive = false) => el.addEventListener(eventName, handler, {\n\tcapture,\n\tpassive\n});\nvar findShadowRoots = (fragment) => {\n\taddEventOrRoot(fragment);\n\tconst shadowRoots = nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]");\n\tfor (let i = 0; i < shadowRoots.length; i++) {\n\t\tconst shadowRoot = shadowRoots[i].shadowRoot;\n\t\tshadowRoot && findShadowRoots(shadowRoot);\n\t}\n};\nvar isPromise = (promise) => promise && typeof promise.then === "function";\nvar runTasks = async (tasks) => {\n\tfor (let i = 0; i < tasks.length; i++) await tasks[i]();\n};\nvar queueTasks = (tasks) => {\n\tif (tasks.length) {\n\t\tconst run = () => runTasks(tasks);\n\t\tqueuedTasks = queuedTasks ? queuedTasks.then(run, run) : run();\n\t}\n};\nvar resolveContainer = (containerEl) => {\n\tif (containerEl._qwikjson_ === void 0) {\n\t\tlet script = (containerEl === doc.documentElement ? doc.body : containerEl).lastElementChild;\n\t\twhile (script) {\n\t\t\tif (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n\t\t\t\tcontainerEl._qwikjson_ = JSON.parse(script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1"));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tscript = script.previousElementSibling;\n\t\t}\n\t}\n};\nvar markContainerReady = (hash) => {\n\treadyContainers[hash] = 1;\n\temitEvent(readyStateChange);\n};\nvar waitForContainerReady = (container) => {\n\tconst hash = container.getAttribute("q:instance");\n\treturn container.getAttribute("q:container") === "paused" && doc.readyState === "loading" && !readyContainers[hash] && new Promise((resolve) => {\n\t\tconst ready = () => {\n\t\t\tif (doc.readyState !== "loading" || readyContainers[hash]) resolve();\n\t\t};\n\t\taddEventListener(doc, readyStateChange, ready);\n\t});\n};\nvar createEvent = (eventName, detail) => new CustomEvent(eventName, { detail });\nvar emitEvent = (eventName, detail) => {\n\tdoc.dispatchEvent(createEvent(eventName, detail));\n};\nvar camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => "-" + a.toLowerCase());\nvar kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nvar parseKebabEvent = (event) => {\n\tconst separatorIndex = event.indexOf(":");\n\treturn {\n\t\tscope: event.slice(0, separatorIndex),\n\t\teventName: kebabToCamel(event.slice(separatorIndex + 1))\n\t};\n};\nvar isPassiveScope = (scope) => scope.length === 2;\nvar getRootScope = (scope) => scope.charAt(0);\nvar isElementNode = (node) => !!node && node.nodeType === 1;\nvar isCaptureHandlerElement = (element, scopedKebabName, captureAttribute) => element.hasAttribute(captureAttribute) && (!!element._qDispatch?.[scopedKebabName] || element.hasAttribute("q-" + scopedKebabName));\nvar resolveHandler = (container, element, qBase, base, chunk, symbol, reqTime, reportSyncError = true) => {\n\tconst eventData = {\n\t\tqBase,\n\t\tsymbol,\n\t\telement,\n\t\treqTime\n\t};\n\tif (!chunk) {\n\t\tconst handler = (doc["qFuncs_" + container.getAttribute("q:instance")] || [])[+symbol];\n\t\tif (!handler && reportSyncError) {\n\t\t\tconst error = /* @__PURE__ */ new Error("sym:" + symbol);\n\t\t\temitEvent("qerror", {\n\t\t\t\timportError: "sync",\n\t\t\t\terror,\n\t\t\t\t...eventData\n\t\t\t});\n\t\t\tconsole.error(error);\n\t\t}\n\t\treturn handler;\n\t}\n\tconst key = `${symbol}|${qBase}|${chunk}`;\n\tconst handler = symbols.get(key);\n\tif (handler) return handler;\n\tconst href = new URL(chunk, base).href;\n\tconst module = import(\n\t\t\t\thref\n);\n\tresolveContainer(container);\n\treturn module.then((module) => {\n\t\tconst handler = module[symbol];\n\t\tif (!handler) {\n\t\t\tconst error = /* @__PURE__ */ new Error(`${symbol} not in ${href}`);\n\t\t\temitEvent("qerror", {\n\t\t\t\timportError: "no-symbol",\n\t\t\t\terror,\n\t\t\t\t...eventData\n\t\t\t});\n\t\t\tconsole.error(error);\n\t\t} else {\n\t\t\tsymbols.set(key, handler);\n\t\t\temitEvent("qsymbol", eventData);\n\t\t}\n\t\treturn handler;\n\t}, (error) => {\n\t\temitEvent("qerror", {\n\t\t\timportError: "async",\n\t\t\terror,\n\t\t\t...eventData\n\t\t});\n\t\tconsole.error(error);\n\t});\n};\n/**\n* Dispatch an event by invoking QRL handlers. If there are multiple handlers, they are awaited in\n* order.\n*/\nvar dispatch = (element, ev, scopedKebabName, tasks, kebabName, allowPreventDefault = true) => {\n\tlet defer = false;\n\tif (kebabName) {\n\t\tif (allowPreventDefault && element.hasAttribute("preventdefault:" + kebabName)) ev.preventDefault();\n\t\tif (element.hasAttribute("stoppropagation:" + kebabName)) ev.stopPropagation();\n\t}\n\tconst handlers = element._qDispatch?.[scopedKebabName];\n\tif (handlers) {\n\t\tif (typeof handlers === "function") {\n\t\t\tconst run = () => handlers(ev, element);\n\t\t\tif (defer) tasks.push(async () => {\n\t\t\t\tconst result = run();\n\t\t\t\tif (isPromise(result)) await result;\n\t\t\t});\n\t\t\telse {\n\t\t\t\tconst result = run();\n\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\tdefer = true;\n\t\t\t\t\ttasks.push(() => result);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (handlers.length) for (let i = 0; i < handlers.length; i++) {\n\t\t\tconst handler = handlers[i];\n\t\t\tif (handler) {\n\t\t\t\tconst run = () => handler(ev, element);\n\t\t\t\tif (defer) tasks.push(async () => {\n\t\t\t\t\tconst result = run();\n\t\t\t\t\tif (isPromise(result)) await result;\n\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tconst result = run();\n\t\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\t\tdefer = true;\n\t\t\t\t\t\ttasks.push(() => result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tconst attrValue = element.getAttribute("q-" + scopedKebabName);\n\tif (attrValue) {\n\t\tconst container = element.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");\n\t\tconst qBase = container.getAttribute("q:base");\n\t\tconst base = new URL(qBase, doc.baseURI);\n\t\tconst qrls = attrValue.split("|");\n\t\tconst waitForReady = waitForContainerReady(container);\n\t\tfor (let i = 0; i < qrls.length; i++) {\n\t\t\tconst qrl = qrls[i];\n\t\t\tconst reqTime = performance.now();\n\t\t\tconst [chunk, symbol, capturedIds] = qrl.split("#");\n\t\t\tconst run = (handler) => {\n\t\t\t\tif (handler && element.isConnected) {\n\t\t\t\t\tconst onError = (error) => {\n\t\t\t\t\t\temitEvent("qerror", {\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\tqBase,\n\t\t\t\t\t\t\tsymbol,\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\treqTime\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = handler.call(capturedIds, ev, element);\n\t\t\t\t\t\tif (isPromise(result)) return result.catch(onError);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn onError(error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst resolve = (reportSyncError = true) => resolveHandler(container, element, qBase, base, chunk, symbol, reqTime, reportSyncError);\n\t\t\tconst handler = waitForReady ? void 0 : resolve();\n\t\t\tif (waitForReady) {\n\t\t\t\tdefer = true;\n\t\t\t\ttasks.push(async () => {\n\t\t\t\t\tawait waitForReady;\n\t\t\t\t\tawait run(await resolve(false) || await resolve());\n\t\t\t\t});\n\t\t\t} else if (isPromise(handler)) {\n\t\t\t\tdefer = true;\n\t\t\t\ttasks.push(() => handler.then(run));\n\t\t\t} else if (defer) {\n\t\t\t\tdefer = true;\n\t\t\t\ttasks.push(async () => {\n\t\t\t\t\tawait run(handler || await resolve());\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst result = run(handler);\n\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\tdefer = true;\n\t\t\t\t\ttasks.push(() => result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n/**\n* Event handler responsible for processing element events.\n*\n* If browser emits an event, the `eventProcessor` walks the DOM tree looking for corresponding\n* `(${event.type})`. If found the event\'s URL is parsed and `import()`ed.\n*\n* @param ev - Browser event.\n*/\nvar processElementEvent = (ev, scope = elementPrefix, allowPreventDefault = true) => {\n\tconst kebabName = camelToKebab(ev.type);\n\tconst scopedKebabName = scope + ":" + kebabName;\n\tconst captureAttribute = capturePrefix + kebabName;\n\tconst elements = [];\n\tconst captureHandlers = [];\n\tconst tasks = [];\n\tlet current = ev.target;\n\twhile (current) if (isElementNode(current)) {\n\t\telements.push(current);\n\t\tcaptureHandlers.push(isCaptureHandlerElement(current, scopedKebabName, captureAttribute));\n\t\tcurrent = current.parentElement;\n\t} else current = current.parentElement;\n\tfor (let i = elements.length - 1; i >= 0; i--) if (captureHandlers[i]) {\n\t\tdispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n\t\tif (ev.cancelBubble) {\n\t\t\tqueueTasks(tasks);\n\t\t\treturn;\n\t\t}\n\t}\n\tfor (let i = 0; i < elements.length; i++) if (!captureHandlers[i]) {\n\t\tdispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n\t\tif (!ev.bubbles || ev.cancelBubble) {\n\t\t\tqueueTasks(tasks);\n\t\t\treturn;\n\t\t}\n\t}\n\tqueueTasks(tasks);\n};\nvar processPassiveElementEvent = (ev) => processElementEvent(ev, passiveElementPrefix, false);\nvar broadcast = (scope, ev, allowPreventDefault = true) => {\n\tconst kebabName = camelToKebab(ev.type);\n\tconst scopedKebabName = scope + ":" + kebabName;\n\tconst elements = querySelectorAll("[q-" + CSS.escape(scopedKebabName) + "]");\n\tconst tasks = [];\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst el = elements[i];\n\t\tdispatch(el, ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n\t}\n\tqueueTasks(tasks);\n};\n/**\n* Event handler responsible for processing browser events.\n*\n* If browser emits an event, the `eventProcessor` walks the DOM tree looking for corresponding\n* `(${event.type})`. If found the event\'s URL is parsed and `import()`ed.\n*\n* @param ev - Browser event.\n*/\nvar processDocumentEvent = (ev) => {\n\tbroadcast(documentPrefix, ev);\n};\nvar processPassiveDocumentEvent = (ev) => {\n\tbroadcast(passiveDocumentPrefix, ev, false);\n};\nvar processWindowEvent = (ev) => {\n\tbroadcast(windowPrefix, ev);\n};\nvar processPassiveWindowEvent = (ev) => {\n\tbroadcast(passiveWindowPrefix, ev, false);\n};\n/**\n* Called when the document is ready and whenever a container is added, so make this idempotent. For\n* qidle and qinit we remove the attributes immediately, and for qvisible we add an attribute\n*/\nvar processReadyStateChange = () => {\n\tconst readyState = doc.readyState;\n\tif (readyState == "interactive" || readyState == "complete") {\n\t\thasInitialized = 1;\n\t\troots.forEach(findShadowRoots);\n\t\tif (events.has("d:qinit")) {\n\t\t\tevents.delete("d:qinit");\n\t\t\tconst ev = createEvent("qinit");\n\t\t\tconst elements = querySelectorAll("[q-d\\\\:qinit]");\n\t\t\tconst tasks = [];\n\t\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\t\tconst el = elements[i];\n\t\t\t\tdispatch(el, ev, "d:qinit", tasks);\n\t\t\t\tel.removeAttribute("q-d:qinit");\n\t\t\t}\n\t\t\tqueueTasks(tasks);\n\t\t}\n\t\tif (events.has("d:qidle")) {\n\t\t\tevents.delete("d:qidle");\n\t\t\t(win.requestIdleCallback ?? win.setTimeout).bind(win)(() => {\n\t\t\t\tconst ev = createEvent("qidle");\n\t\t\t\tconst elements = querySelectorAll("[q-d\\\\:qidle]");\n\t\t\t\tconst tasks = [];\n\t\t\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\t\t\tconst el = elements[i];\n\t\t\t\t\tdispatch(el, ev, "d:qidle", tasks);\n\t\t\t\t\tel.removeAttribute("q-d:qidle");\n\t\t\t\t}\n\t\t\t\tqueueTasks(tasks);\n\t\t\t});\n\t\t}\n\t\tif (events.has("e:qvisible")) {\n\t\t\tobserver || (observer = new IntersectionObserver((entries) => {\n\t\t\t\tconst tasks = [];\n\t\t\t\tfor (let i = 0; i < entries.length; i++) {\n\t\t\t\t\tconst entry = entries[i];\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tobserver.unobserve(entry.target);\n\t\t\t\t\t\tdispatch(entry.target, createEvent("qvisible", entry), "e:qvisible", tasks);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tqueueTasks(tasks);\n\t\t\t}));\n\t\t\tconst elements = querySelectorAll("[q-e\\\\:qvisible]:not([q\\\\:observed])");\n\t\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\t\tconst el = elements[i];\n\t\t\t\tobserver.observe(el);\n\t\t\t\tel.setAttribute("q:observed", "true");\n\t\t\t}\n\t\t}\n\t}\n};\nvar addEventOrRoot = (...eventNames) => {\n\tfor (let i = 0; i < eventNames.length; i++) {\n\t\tconst eventNameOrRoot = eventNames[i];\n\t\tif (eventNameOrRoot === QwikEvContainerReady) markContainerReady(eventNames[++i]);\n\t\telse if (typeof eventNameOrRoot === "string") {\n\t\t\tif (!events.has(eventNameOrRoot)) {\n\t\t\t\tevents.add(eventNameOrRoot);\n\t\t\t\tconst { scope, eventName } = parseKebabEvent(eventNameOrRoot);\n\t\t\t\tconst passive = isPassiveScope(scope);\n\t\t\t\tconst rootScope = getRootScope(scope);\n\t\t\t\tif (rootScope === windowPrefix) addEventListener(win, eventName, passive ? processPassiveWindowEvent : processWindowEvent, true, passive);\n\t\t\t\telse roots.forEach((root) => addEventListener(root, eventName, rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent, true, passive));\n\t\t\t\tif (hasInitialized === 1 && (eventNameOrRoot === "e:qvisible" || eventNameOrRoot === "d:qinit" || eventNameOrRoot === "d:qidle")) processReadyStateChange();\n\t\t\t}\n\t\t} else if (!roots.has(eventNameOrRoot)) {\n\t\t\tevents.forEach((kebabEventName) => {\n\t\t\t\tconst { scope, eventName } = parseKebabEvent(kebabEventName);\n\t\t\t\tconst passive = isPassiveScope(scope);\n\t\t\t\tconst rootScope = getRootScope(scope);\n\t\t\t\tif (rootScope !== windowPrefix) addEventListener(eventNameOrRoot, eventName, rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent, true, passive);\n\t\t\t});\n\t\t\troots.add(eventNameOrRoot);\n\t\t}\n\t}\n};\nvar _qwikEv = win._qwikEv;\nif (!_qwikEv?.roots) {\n\tif (Array.isArray(_qwikEv)) addEventOrRoot(..._qwikEv);\n\telse addEventOrRoot("e:click", "e:input");\n\twin._qwikEv = {\n\t\tevents,\n\t\troots,\n\t\tpush: addEventOrRoot\n\t};\n\taddEventListener(doc, readyStateChange, processReadyStateChange);\n\tprocessReadyStateChange();\n}\n//#endregion';
|
|
1201
|
+
var QWIK_LOADER_DEFAULT_DEBUG = '//#region packages/qwik/src/qwikloader.ts\nvar doc = document;\nvar win = window;\nvar windowPrefix = "w";\nvar passiveWindowPrefix = "wp";\nvar documentPrefix = "d";\nvar passiveDocumentPrefix = "dp";\nvar elementPrefix = "e";\nvar passiveElementPrefix = "ep";\nvar capturePrefix = "capture:";\nvar readyStateChange = "readystatechange";\nvar QwikEvContainerReady = 0;\nvar events = /* @__PURE__ */ new Set();\nvar roots = /* @__PURE__ */ new Set([doc]);\nvar symbols = /* @__PURE__ */ new Map();\nvar readyContainers = {};\nvar observer;\nvar hasInitialized;\nvar queuedTasks;\nvar nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nvar querySelectorAll = (query) => {\n\tconst elements = [];\n\troots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n\treturn elements;\n};\nvar addEventListener = (el, eventName, handler, capture = false, passive = false) => el.addEventListener(eventName, handler, {\n\tcapture,\n\tpassive\n});\nvar findShadowRoots = (fragment) => {\n\taddEventOrRoot(fragment);\n\tconst shadowRoots = nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]");\n\tfor (let i = 0; i < shadowRoots.length; i++) {\n\t\tconst shadowRoot = shadowRoots[i].shadowRoot;\n\t\tshadowRoot && findShadowRoots(shadowRoot);\n\t}\n};\nvar isPromise = (promise) => promise && typeof promise.then === "function";\nvar runTasks = async (tasks) => {\n\tfor (let i = 0; i < tasks.length; i++) await tasks[i]();\n};\nvar queueTasks = (tasks) => {\n\tif (tasks.length) {\n\t\tconst run = () => runTasks(tasks);\n\t\tqueuedTasks = queuedTasks ? queuedTasks.then(run, run) : run();\n\t}\n};\nvar resolveContainer = (containerEl) => {\n\tif (containerEl._qwikjson_ === void 0) {\n\t\tlet script = (containerEl === doc.documentElement ? doc.body : containerEl).lastElementChild;\n\t\twhile (script) {\n\t\t\tif (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n\t\t\t\tcontainerEl._qwikjson_ = JSON.parse(script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1"));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tscript = script.previousElementSibling;\n\t\t}\n\t}\n};\nvar markContainerReady = (hash) => {\n\treadyContainers[hash] = 1;\n\temitEvent(readyStateChange);\n};\nvar waitForContainerReady = (container) => {\n\tconst hash = container.getAttribute("q:instance");\n\treturn container.getAttribute("q:container") === "paused" && doc.readyState === "loading" && !readyContainers[hash] && new Promise((resolve) => {\n\t\tconst ready = () => {\n\t\t\tif (doc.readyState !== "loading" || readyContainers[hash]) resolve();\n\t\t};\n\t\taddEventListener(doc, readyStateChange, ready);\n\t});\n};\nvar createEvent = (eventName, detail) => new CustomEvent(eventName, { detail });\nvar emitEvent = (eventName, detail) => {\n\tdoc.dispatchEvent(createEvent(eventName, detail));\n};\nvar camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => "-" + a.toLowerCase());\nvar kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nvar parseKebabEvent = (event) => {\n\tconst separatorIndex = event.indexOf(":");\n\treturn {\n\t\tscope: event.slice(0, separatorIndex),\n\t\teventName: kebabToCamel(event.slice(separatorIndex + 1))\n\t};\n};\nvar isPassiveScope = (scope) => scope.length === 2;\nvar getRootScope = (scope) => scope.charAt(0);\nvar isElementNode = (node) => !!node && node.nodeType === 1;\nvar isCaptureHandlerElement = (element, scopedKebabName, captureAttribute) => element.hasAttribute(captureAttribute) && (!!element._qDispatch?.[scopedKebabName] || element.hasAttribute("q-" + scopedKebabName));\nvar resolveHandler = (container, element, qBase, base, chunk, symbol, reqTime, reportSyncError = true) => {\n\tconst eventData = {\n\t\tqBase,\n\t\tsymbol,\n\t\telement,\n\t\treqTime\n\t};\n\tif (!chunk) {\n\t\tconst handler = (doc["qFuncs_" + container.getAttribute("q:instance")] || [])[+symbol];\n\t\tif (!handler && reportSyncError) {\n\t\t\tconst error = /* @__PURE__ */ new Error("sym:" + symbol);\n\t\t\temitEvent("qerror", {\n\t\t\t\timportError: "sync",\n\t\t\t\terror,\n\t\t\t\t...eventData\n\t\t\t});\n\t\t\tconsole.error(error);\n\t\t}\n\t\treturn handler;\n\t}\n\tconst key = `${symbol}|${qBase}|${chunk}`;\n\tconst handler = symbols.get(key);\n\tif (handler) return handler;\n\tconst href = new URL(chunk, base).href;\n\tconst module = import(\n\t\t\t\thref\n);\n\tresolveContainer(container);\n\treturn module.then((module) => {\n\t\tconst handler = module[symbol];\n\t\tif (!handler) {\n\t\t\tconst error = /* @__PURE__ */ new Error(`${symbol} not in ${href}`);\n\t\t\temitEvent("qerror", {\n\t\t\t\timportError: "no-symbol",\n\t\t\t\terror,\n\t\t\t\t...eventData\n\t\t\t});\n\t\t\tconsole.error(error);\n\t\t} else {\n\t\t\tsymbols.set(key, handler);\n\t\t\temitEvent("qsymbol", eventData);\n\t\t}\n\t\treturn handler;\n\t}, (error) => {\n\t\temitEvent("qerror", {\n\t\t\timportError: "async",\n\t\t\terror,\n\t\t\t...eventData\n\t\t});\n\t\tconsole.error(error);\n\t});\n};\n/**\n* Dispatch an event by invoking QRL handlers. If there are multiple handlers, they are awaited in\n* order.\n*/\nvar dispatch = (element, ev, scopedKebabName, tasks, kebabName, allowPreventDefault = true) => {\n\tlet defer = false;\n\tif (kebabName) {\n\t\tif (allowPreventDefault && element.hasAttribute("preventdefault:" + kebabName)) ev.preventDefault();\n\t\tif (element.hasAttribute("stoppropagation:" + kebabName)) ev.stopPropagation();\n\t}\n\tconst handlers = element._qDispatch?.[scopedKebabName];\n\tif (handlers) {\n\t\tif (typeof handlers === "function") {\n\t\t\tconst run = () => handlers(ev, element);\n\t\t\tif (defer) tasks.push(async () => {\n\t\t\t\tconst result = run();\n\t\t\t\tif (isPromise(result)) await result;\n\t\t\t});\n\t\t\telse {\n\t\t\t\tconst result = run();\n\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\tdefer = true;\n\t\t\t\t\ttasks.push(() => result);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (handlers.length) for (let i = 0; i < handlers.length; i++) {\n\t\t\tconst handler = handlers[i];\n\t\t\tif (handler) {\n\t\t\t\tconst run = () => handler(ev, element);\n\t\t\t\tif (defer) tasks.push(async () => {\n\t\t\t\t\tconst result = run();\n\t\t\t\t\tif (isPromise(result)) await result;\n\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tconst result = run();\n\t\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\t\tdefer = true;\n\t\t\t\t\t\ttasks.push(() => result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tconst attrValue = element.getAttribute("q-" + scopedKebabName);\n\tif (attrValue) {\n\t\tconst container = element.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");\n\t\tconst qBase = container.getAttribute("q:base");\n\t\tconst base = new URL(qBase, doc.baseURI);\n\t\tconst qrls = attrValue.split("|");\n\t\tconst waitForReady = waitForContainerReady(container);\n\t\tfor (let i = 0; i < qrls.length; i++) {\n\t\t\tconst qrl = qrls[i];\n\t\t\tconst reqTime = performance.now();\n\t\t\tconst [chunk, symbol, capturedIds] = qrl.split("#");\n\t\t\tconst run = (handler) => {\n\t\t\t\tif (handler && element.isConnected) {\n\t\t\t\t\tconst onError = (error) => {\n\t\t\t\t\t\temitEvent("qerror", {\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\tqBase,\n\t\t\t\t\t\t\tsymbol,\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\treqTime\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = handler.call(capturedIds, ev, element);\n\t\t\t\t\t\tif (isPromise(result)) return result.catch(onError);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn onError(error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst resolve = (reportSyncError = true) => resolveHandler(container, element, qBase, base, chunk, symbol, reqTime, reportSyncError);\n\t\t\tconst handler = waitForReady ? void 0 : resolve();\n\t\t\tif (waitForReady) {\n\t\t\t\tdefer = true;\n\t\t\t\ttasks.push(async () => {\n\t\t\t\t\tawait waitForReady;\n\t\t\t\t\tawait run(chunk ? await resolve() : await resolve(false) || await resolve());\n\t\t\t\t});\n\t\t\t} else if (isPromise(handler)) {\n\t\t\t\tdefer = true;\n\t\t\t\ttasks.push(() => handler.then(run));\n\t\t\t} else if (defer) {\n\t\t\t\tdefer = true;\n\t\t\t\ttasks.push(async () => {\n\t\t\t\t\tawait run(handler || await resolve());\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst result = run(handler);\n\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\tdefer = true;\n\t\t\t\t\ttasks.push(() => result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n/**\n* Event handler responsible for processing element events.\n*\n* If browser emits an event, the `eventProcessor` walks the DOM tree looking for corresponding\n* `(${event.type})`. If found the event\'s URL is parsed and `import()`ed.\n*\n* @param ev - Browser event.\n*/\nvar processElementEvent = (ev, scope = elementPrefix, allowPreventDefault = true) => {\n\tconst kebabName = camelToKebab(ev.type);\n\tconst scopedKebabName = scope + ":" + kebabName;\n\tconst captureAttribute = capturePrefix + kebabName;\n\tconst elements = [];\n\tconst captureHandlers = [];\n\tconst tasks = [];\n\tlet current = ev.target;\n\twhile (current) if (isElementNode(current)) {\n\t\telements.push(current);\n\t\tcaptureHandlers.push(isCaptureHandlerElement(current, scopedKebabName, captureAttribute));\n\t\tcurrent = current.parentElement;\n\t} else current = current.parentElement;\n\tfor (let i = elements.length - 1; i >= 0; i--) if (captureHandlers[i]) {\n\t\tdispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n\t\tif (ev.cancelBubble) {\n\t\t\tqueueTasks(tasks);\n\t\t\treturn;\n\t\t}\n\t}\n\tfor (let i = 0; i < elements.length; i++) if (!captureHandlers[i]) {\n\t\tdispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n\t\tif (!ev.bubbles || ev.cancelBubble) {\n\t\t\tqueueTasks(tasks);\n\t\t\treturn;\n\t\t}\n\t}\n\tqueueTasks(tasks);\n};\nvar processPassiveElementEvent = (ev) => processElementEvent(ev, passiveElementPrefix, false);\nvar broadcast = (scope, ev, allowPreventDefault = true) => {\n\tconst kebabName = camelToKebab(ev.type);\n\tconst scopedKebabName = scope + ":" + kebabName;\n\tconst elements = querySelectorAll("[q-" + CSS.escape(scopedKebabName) + "]");\n\tconst tasks = [];\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst el = elements[i];\n\t\tdispatch(el, ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n\t}\n\tqueueTasks(tasks);\n};\n/**\n* Event handler responsible for processing browser events.\n*\n* If browser emits an event, the `eventProcessor` walks the DOM tree looking for corresponding\n* `(${event.type})`. If found the event\'s URL is parsed and `import()`ed.\n*\n* @param ev - Browser event.\n*/\nvar processDocumentEvent = (ev) => {\n\tbroadcast(documentPrefix, ev);\n};\nvar processPassiveDocumentEvent = (ev) => {\n\tbroadcast(passiveDocumentPrefix, ev, false);\n};\nvar processWindowEvent = (ev) => {\n\tbroadcast(windowPrefix, ev);\n};\nvar processPassiveWindowEvent = (ev) => {\n\tbroadcast(passiveWindowPrefix, ev, false);\n};\n/**\n* Called when the document is ready and whenever a container is added, so make this idempotent. For\n* qidle and qinit we remove the attributes immediately, and for qvisible we add an attribute\n*/\nvar processReadyStateChange = () => {\n\tconst readyState = doc.readyState;\n\tif (readyState == "interactive" || readyState == "complete") {\n\t\thasInitialized = 1;\n\t\troots.forEach(findShadowRoots);\n\t\tif (events.has("d:qinit")) {\n\t\t\tevents.delete("d:qinit");\n\t\t\tconst ev = createEvent("qinit");\n\t\t\tconst elements = querySelectorAll("[q-d\\\\:qinit]");\n\t\t\tconst tasks = [];\n\t\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\t\tconst el = elements[i];\n\t\t\t\tdispatch(el, ev, "d:qinit", tasks);\n\t\t\t\tel.removeAttribute("q-d:qinit");\n\t\t\t}\n\t\t\tqueueTasks(tasks);\n\t\t}\n\t\tif (events.has("d:qidle")) {\n\t\t\tevents.delete("d:qidle");\n\t\t\t(win.requestIdleCallback ?? win.setTimeout).bind(win)(() => {\n\t\t\t\tconst ev = createEvent("qidle");\n\t\t\t\tconst elements = querySelectorAll("[q-d\\\\:qidle]");\n\t\t\t\tconst tasks = [];\n\t\t\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\t\t\tconst el = elements[i];\n\t\t\t\t\tdispatch(el, ev, "d:qidle", tasks);\n\t\t\t\t\tel.removeAttribute("q-d:qidle");\n\t\t\t\t}\n\t\t\t\tqueueTasks(tasks);\n\t\t\t});\n\t\t}\n\t\tif (events.has("e:qvisible")) {\n\t\t\tobserver || (observer = new IntersectionObserver((entries) => {\n\t\t\t\tconst tasks = [];\n\t\t\t\tfor (let i = 0; i < entries.length; i++) {\n\t\t\t\t\tconst entry = entries[i];\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tobserver.unobserve(entry.target);\n\t\t\t\t\t\tdispatch(entry.target, createEvent("qvisible", entry), "e:qvisible", tasks);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tqueueTasks(tasks);\n\t\t\t}));\n\t\t\tconst elements = querySelectorAll("[q-e\\\\:qvisible]:not([q\\\\:observed])");\n\t\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\t\tconst el = elements[i];\n\t\t\t\tobserver.observe(el);\n\t\t\t\tel.setAttribute("q:observed", "true");\n\t\t\t}\n\t\t}\n\t}\n};\nvar addEventOrRoot = (...eventNames) => {\n\tfor (let i = 0; i < eventNames.length; i++) {\n\t\tconst eventNameOrRoot = eventNames[i];\n\t\tif (eventNameOrRoot === QwikEvContainerReady) markContainerReady(eventNames[++i]);\n\t\telse if (typeof eventNameOrRoot === "string") {\n\t\t\tif (!events.has(eventNameOrRoot)) {\n\t\t\t\tevents.add(eventNameOrRoot);\n\t\t\t\tconst { scope, eventName } = parseKebabEvent(eventNameOrRoot);\n\t\t\t\tconst passive = isPassiveScope(scope);\n\t\t\t\tconst rootScope = getRootScope(scope);\n\t\t\t\tif (rootScope === windowPrefix) addEventListener(win, eventName, passive ? processPassiveWindowEvent : processWindowEvent, true, passive);\n\t\t\t\telse roots.forEach((root) => addEventListener(root, eventName, rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent, true, passive));\n\t\t\t\tif (hasInitialized === 1 && (eventNameOrRoot === "e:qvisible" || eventNameOrRoot === "d:qinit" || eventNameOrRoot === "d:qidle")) processReadyStateChange();\n\t\t\t}\n\t\t} else if (!roots.has(eventNameOrRoot)) {\n\t\t\tevents.forEach((kebabEventName) => {\n\t\t\t\tconst { scope, eventName } = parseKebabEvent(kebabEventName);\n\t\t\t\tconst passive = isPassiveScope(scope);\n\t\t\t\tconst rootScope = getRootScope(scope);\n\t\t\t\tif (rootScope !== windowPrefix) addEventListener(eventNameOrRoot, eventName, rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent, true, passive);\n\t\t\t});\n\t\t\troots.add(eventNameOrRoot);\n\t\t}\n\t}\n};\nvar _qwikEv = win._qwikEv;\nif (!_qwikEv?.roots) {\n\tif (Array.isArray(_qwikEv)) addEventOrRoot(..._qwikEv);\n\telse addEventOrRoot("e:click", "e:input");\n\twin._qwikEv = {\n\t\tevents,\n\t\troots,\n\t\tpush: addEventOrRoot\n\t};\n\taddEventListener(doc, readyStateChange, processReadyStateChange);\n\tprocessReadyStateChange();\n}\n//#endregion';
|
|
1194
1202
|
|
|
1195
1203
|
var QWIK_BACKPATCH_EXECUTOR_MINIFIED = `var t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||"[]"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(":")&&i++;const a=c;null==l||!1===l?a.removeAttribute(r):("boolean"==typeof l&&(l=""),a.setAttribute(r,l))}}}}var n=document.currentScript;if(n){const t=n.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");t&&e(document,t)}`;
|
|
1196
1204
|
|
|
@@ -1198,7 +1206,11 @@ var QWIK_BACKPATCH_EXECUTOR_DEBUG = '//#region packages/qwik/src/backpatch-execu
|
|
|
1198
1206
|
|
|
1199
1207
|
var QWIK_OUT_OF_ORDER_EXECUTOR_MINIFIED = `var t='template[q\\\\:r="',e="q:r",r='[q\\\\:rp="',n="q:g",l="q:i",o="q:o",i="[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])",u=u=>{const s=new WeakMap,c=()=>{const t=u.currentScript;return t&&t.closest(i)||u},f=(t,e,r,n)=>{let l=s.get(t);return l||s.set(t,l={}),l[e]||(l[e]={r:{},n:0,t:r,o:n})},a=(t,e)=>t?(e&&e.style&&(e.style.display="none"),t.style&&(t.style.display="contents"),1):0,q=t=>{const e=t.o;let r,n,l=0;if("p"===e)for(const e in t.r)r=t.r[e],r[0]&&a(r[0],r[1])&&(r[0]=0,l++);else if("s"===e)for(n=t.n;(r=t.r[n])&&r[0]&&a(r[0],r[1]);n++)r[0]=0,l++,t.n=n+1;else if("r"===e){if(t.t<0)return 0;for(t.n<0&&(t.n=t.t-1),n=t.n;(r=t.r[n])&&r[0]&&a(r[0],r[1]);n--)r[0]=0,l++,t.n=n-1}else{if(t.t<0)return 0;for(n=0;n<t.t;n++)if(r=t.r[n],!r)return 0;for(n=0;n<t.t;n++)r=t.r[n],r[0]&&a(r[0],r[1])&&(r[0]=0,l++)}return l},p=i=>{const s=c(),p=((r,n)=>{const l=u.currentScript,o=l?l.previousElementSibling:null;if(o&&"template"===o.localName&&o.getAttribute(e)===n+"")return o;const i=r.querySelectorAll(t+n+'"]');return i.length?i[i.length-1]:null})(s,i);if(!p)return;const g=((e,n,l)=>{if(!l)return null;const o=((t,e)=>t.querySelector(r+e+'"]'))(e,n),i=o?((e,r)=>e.querySelector(t+r+'"]'))(o,n):null,u=i?i.parentNode:null;return i&&o&&u?(u.insertBefore(l.content,i),i.remove(),l.remove(),[o,o.previousElementSibling]):null})(s,i,p);if(!g)return;((t,e)=>{var r;const n=u;null===(r=n.qProcessOOOS)||void 0===r||r.call(n,t,e)})(i,g[0]||null);const m=p.getAttribute(n);if(m){const t=+(p.getAttribute(l)||0),e=f(s,m,-1,p.getAttribute(o)||"p");return e.r[t]=g,void q(e)}a(g[0]||null,g[1])};p.g=(t,e,r)=>{const n=f(c(),t,e,r);n.t=e,n.o=r,"r"===n.o&&0===n.n&&(n.n=e-1),q(n)},p.d=u,globalThis.qO=p};u(document)`;
|
|
1200
1208
|
|
|
1201
|
-
var QWIK_OUT_OF_ORDER_EXECUTOR_DEBUG = '//#region packages/qwik/src/out-of-order-executor-shared.ts\n/** Shared out-of-order Suspense executor logic for the inline script and source tests. */\nvar Q_RESOLVED_SELECTOR = "template[q\\\\:r=\\"";\nvar Q_RESOLVED_ATTR = "q:r";\nvar Q_RESULT_PARENT_SELECTOR = "[q\\\\:rp=\\"";\nvar Q_GROUP_ATTR = "q:g";\nvar Q_INDEX_ATTR = "q:i";\nvar Q_ORDER_ATTR = "q:o";\nvar Q_CONTAINER_SELECTOR = "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])";\nvar installOutOfOrderExecutor = (doc) => {\n\tconst groups = /* @__PURE__ */ new WeakMap();\n\tconst process = (boundaryId,
|
|
1209
|
+
var QWIK_OUT_OF_ORDER_EXECUTOR_DEBUG = '//#region packages/qwik/src/out-of-order-executor-shared.ts\n/** Shared out-of-order Suspense executor logic for the inline script and source tests. */\nvar Q_RESOLVED_SELECTOR = "template[q\\\\:r=\\"";\nvar Q_RESOLVED_ATTR = "q:r";\nvar Q_RESULT_PARENT_SELECTOR = "[q\\\\:rp=\\"";\nvar Q_GROUP_ATTR = "q:g";\nvar Q_INDEX_ATTR = "q:i";\nvar Q_ORDER_ATTR = "q:o";\nvar Q_CONTAINER_SELECTOR = "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])";\nvar installOutOfOrderExecutor = (doc) => {\n\tconst groups = /* @__PURE__ */ new WeakMap();\n\tconst process = (boundaryId, revealNode) => {\n\t\tvar _executorDoc$qProcess;\n\t\tconst executorDoc = doc;\n\t\t(_executorDoc$qProcess = executorDoc.qProcessOOOS) === null || _executorDoc$qProcess === void 0 || _executorDoc$qProcess.call(executorDoc, boundaryId, revealNode);\n\t};\n\tconst getScope = () => {\n\t\tconst script = doc.currentScript;\n\t\treturn script ? script.closest(Q_CONTAINER_SELECTOR) || doc : doc;\n\t};\n\tconst group = (scope, groupId, total, order) => {\n\t\tlet scopedGroups = groups.get(scope);\n\t\tif (!scopedGroups) groups.set(scope, scopedGroups = {});\n\t\treturn scopedGroups[groupId] || (scopedGroups[groupId] = {\n\t\t\tr: {},\n\t\t\tn: 0,\n\t\t\tt: total,\n\t\t\to: order\n\t\t});\n\t};\n\tconst getResolvedTemplate = (scope, boundaryId) => {\n\t\tconst currentScript = doc.currentScript;\n\t\tconst previousElement = currentScript ? currentScript.previousElementSibling : null;\n\t\tif (previousElement && previousElement.localName === "template" && previousElement.getAttribute(Q_RESOLVED_ATTR) === String(boundaryId)) return previousElement;\n\t\tconst templates = scope.querySelectorAll(Q_RESOLVED_SELECTOR + boundaryId + "\\"]");\n\t\treturn templates.length ? templates[templates.length - 1] : null;\n\t};\n\tconst getPlaceholderTemplate = (revealHost, boundaryId) => {\n\t\treturn revealHost.querySelector(Q_RESOLVED_SELECTOR + boundaryId + "\\"]");\n\t};\n\tconst getResultParent = (scope, boundaryId) => {\n\t\treturn scope.querySelector(Q_RESULT_PARENT_SELECTOR + boundaryId + "\\"]");\n\t};\n\tconst reveal = (revealHost, hideHost) => {\n\t\tif (!revealHost) return 0;\n\t\tif (hideHost && hideHost.style) hideHost.style.display = "none";\n\t\tif (revealHost.style) revealHost.style.display = "contents";\n\t\treturn 1;\n\t};\n\tconst move = (scope, boundaryId, resolved) => {\n\t\tif (!resolved) return null;\n\t\tconst revealHost = getResultParent(scope, boundaryId);\n\t\tconst placeholder = revealHost ? getPlaceholderTemplate(revealHost, boundaryId) : null;\n\t\tconst parent = placeholder ? placeholder.parentNode : null;\n\t\tif (!placeholder || !revealHost || !parent) return null;\n\t\tparent.insertBefore(resolved.content, placeholder);\n\t\tplaceholder.remove();\n\t\tresolved.remove();\n\t\treturn [revealHost, revealHost.previousElementSibling];\n\t};\n\tconst flush = (group) => {\n\t\tconst order = group.o;\n\t\tlet entry;\n\t\tlet index;\n\t\tlet swapped = 0;\n\t\tif (order === "p") for (const key in group.r) {\n\t\t\tentry = group.r[key];\n\t\t\tif (entry[0] && reveal(entry[0], entry[1])) {\n\t\t\t\tentry[0] = 0;\n\t\t\t\tswapped++;\n\t\t\t}\n\t\t}\n\t\telse if (order === "s") for (index = group.n; (entry = group.r[index]) && entry[0]; index++) {\n\t\t\tif (!reveal(entry[0], entry[1])) break;\n\t\t\tentry[0] = 0;\n\t\t\tswapped++;\n\t\t\tgroup.n = index + 1;\n\t\t}\n\t\telse if (order === "r") {\n\t\t\tif (group.t < 0) return 0;\n\t\t\tif (group.n < 0) group.n = group.t - 1;\n\t\t\tfor (index = group.n; (entry = group.r[index]) && entry[0]; index--) {\n\t\t\t\tif (!reveal(entry[0], entry[1])) break;\n\t\t\t\tentry[0] = 0;\n\t\t\t\tswapped++;\n\t\t\t\tgroup.n = index - 1;\n\t\t\t}\n\t\t} else {\n\t\t\tif (group.t < 0) return 0;\n\t\t\tfor (index = 0; index < group.t; index++) {\n\t\t\t\tentry = group.r[index];\n\t\t\t\tif (!entry) return 0;\n\t\t\t}\n\t\t\tfor (index = 0; index < group.t; index++) {\n\t\t\t\tentry = group.r[index];\n\t\t\t\tif (entry[0] && reveal(entry[0], entry[1])) {\n\t\t\t\t\tentry[0] = 0;\n\t\t\t\t\tswapped++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn swapped;\n\t};\n\tconst qO = ((boundaryId) => {\n\t\tconst scope = getScope();\n\t\tconst resolved = getResolvedTemplate(scope, boundaryId);\n\t\tif (!resolved) return;\n\t\tconst entry = move(scope, boundaryId, resolved);\n\t\tif (!entry) return;\n\t\tprocess(boundaryId, entry[0] || null);\n\t\tconst groupId = resolved.getAttribute(Q_GROUP_ATTR);\n\t\tif (groupId) {\n\t\t\tconst index = +(resolved.getAttribute(Q_INDEX_ATTR) || 0);\n\t\t\tconst currentGroup = group(scope, groupId, -1, resolved.getAttribute(Q_ORDER_ATTR) || "p");\n\t\t\tcurrentGroup.r[index] = entry;\n\t\t\tflush(currentGroup);\n\t\t\treturn;\n\t\t}\n\t\treveal(entry[0] || null, entry[1]);\n\t});\n\tqO.g = (groupId, total, order) => {\n\t\tconst currentGroup = group(getScope(), groupId, total, order);\n\t\tcurrentGroup.t = total;\n\t\tcurrentGroup.o = order;\n\t\tif (currentGroup.o === "r" && currentGroup.n === 0) currentGroup.n = total - 1;\n\t\tflush(currentGroup);\n\t};\n\tqO.d = doc;\n\tglobalThis.qO = qO;\n};\n//#endregion\n//#region packages/qwik/src/out-of-order-executor.ts\n/**\n* Qwik Out-of-Order Suspense Executor\n*\n* This is the inline script entry. The actual logic lives in out-of-order-executor-shared.ts so\n* source tests can install the same executor.\n*/\ninstallOutOfOrderExecutor(document);\n//#endregion';
|
|
1210
|
+
|
|
1211
|
+
var QWIK_ERROR_SWAP_EXECUTOR_MINIFIED = `var t='[q\\\\:ebc="',e='[q\\\\:ebf="',n="[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])",o=t=>{const e=t.querySelectorAll("*");for(let t=0;t<e.length;t++){const n=e[t].attributes;for(let o=n.length-1;o>=0;o--){const l=n[o].name;0!==l.indexOf("q-d:")&&0!==l.indexOf("q-w:")||e[t].removeAttribute(l)}}},l=l=>{const r=r=>{var c;const s=(null===(c=l.currentScript)||void 0===c?void 0:c.closest(n))||l,i=s.querySelector(t+r+'"]'),q=s.querySelector(e+r+'"]');i&&i.style&&(i.style.display="none",o(i)),q&&q.style&&(q.style.display="contents")};r.d=l,globalThis.qErr=r};l(document)`;
|
|
1212
|
+
|
|
1213
|
+
var QWIK_ERROR_SWAP_EXECUTOR_DEBUG = '//#region packages/qwik/src/error-swap-executor-shared.ts\nvar Q_ERROR_CONTENT_SELECTOR = "[q\\\\:ebc=\\"";\nvar Q_ERROR_FALLBACK_SELECTOR = "[q\\\\:ebf=\\"";\nvar Q_CONTAINER_SELECTOR = "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])";\n/**\n* Qwikloader broadcasts document/window events to every matching element in the document, and\n* `display:none` still counts as connected, so a torn-down subtree keeps handling them.\n*/\nvar stripBroadcastHandlers = (content) => {\n\tconst nodes = content.querySelectorAll("*");\n\tfor (let i = 0; i < nodes.length; i++) {\n\t\tconst attrs = nodes[i].attributes;\n\t\tfor (let j = attrs.length - 1; j >= 0; j--) {\n\t\t\tconst name = attrs[j].name;\n\t\t\tif (name.indexOf("q-d:") === 0 || name.indexOf("q-w:") === 0) nodes[i].removeAttribute(name);\n\t\t}\n\t}\n};\nvar installErrorSwapExecutor = (doc) => {\n\tconst qErr = ((boundaryId) => {\n\t\tvar _doc$currentScript;\n\t\tconst scope = ((_doc$currentScript = doc.currentScript) === null || _doc$currentScript === void 0 ? void 0 : _doc$currentScript.closest(Q_CONTAINER_SELECTOR)) || doc;\n\t\tconst content = scope.querySelector(Q_ERROR_CONTENT_SELECTOR + boundaryId + "\\"]");\n\t\tconst fallback = scope.querySelector(Q_ERROR_FALLBACK_SELECTOR + boundaryId + "\\"]");\n\t\tif (content && content.style) {\n\t\t\tcontent.style.display = "none";\n\t\t\tstripBroadcastHandlers(content);\n\t\t}\n\t\tif (fallback && fallback.style) fallback.style.display = "contents";\n\t});\n\tqErr.d = doc;\n\tglobalThis.qErr = qErr;\n};\n//#endregion\n//#region packages/qwik/src/error-swap-executor.ts\ninstallErrorSwapExecutor(document);\n//#endregion';
|
|
1202
1214
|
|
|
1203
1215
|
function getQwikLoaderScript(t = {}) {
|
|
1204
1216
|
return t.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -1224,16 +1236,21 @@ function getQwikOutOfOrderExecutorScript(t = {}) {
|
|
|
1224
1236
|
return `if(!globalThis.qO||globalThis.qO.d!==document){${e}\n}`;
|
|
1225
1237
|
}
|
|
1226
1238
|
|
|
1239
|
+
function getQwikErrorSwapExecutorScript(t = {}) {
|
|
1240
|
+
const e = t.debug ? QWIK_ERROR_SWAP_EXECUTOR_DEBUG : QWIK_ERROR_SWAP_EXECUTOR_MINIFIED;
|
|
1241
|
+
return `if(!globalThis.qErr||globalThis.qErr.d!==document){${e}\n}`;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1227
1244
|
// packages/qwik/src/server/ssr-node.ts
|
|
1228
|
-
import { _isJSXNode as
|
|
1245
|
+
import { _isJSXNode as co, _EMPTY_OBJ, _EFFECT_BACK_REF as ts } from "@qwik.dev/core/internal";
|
|
1229
1246
|
|
|
1230
1247
|
import { isDev as isDev7 } from "@qwik.dev/core/build";
|
|
1231
1248
|
|
|
1232
1249
|
var SsrNode = class {
|
|
1233
|
-
constructor(t, e,
|
|
1250
|
+
constructor(t, e, r, n, s, i) {
|
|
1234
1251
|
this.parentComponent = t;
|
|
1235
|
-
this.attributesIndex =
|
|
1236
|
-
this.cleanupQueue =
|
|
1252
|
+
this.attributesIndex = r;
|
|
1253
|
+
this.cleanupQueue = n;
|
|
1237
1254
|
this.vnodeData = s;
|
|
1238
1255
|
this.currentFile = i;
|
|
1239
1256
|
this.id = e;
|
|
@@ -1262,19 +1279,19 @@ var SsrNode = class {
|
|
|
1262
1279
|
attrs;
|
|
1263
1280
|
/** Local props which don't serialize; */
|
|
1264
1281
|
localProps=null;
|
|
1265
|
-
get [
|
|
1266
|
-
return this.getProp(
|
|
1282
|
+
get [ts]() {
|
|
1283
|
+
return this.getProp(Pr);
|
|
1267
1284
|
}
|
|
1268
1285
|
setProp(t, e) {
|
|
1269
1286
|
if (this.attrs === _EMPTY_OBJ) {
|
|
1270
1287
|
this.setEmptyArrayAsVNodeDataAttributes();
|
|
1271
1288
|
}
|
|
1272
|
-
if (t.startsWith(
|
|
1289
|
+
if (t.startsWith(Jr)) {
|
|
1273
1290
|
(this.localProps ||= {})[t] = e;
|
|
1274
1291
|
} else {
|
|
1275
1292
|
this.attrs[t] = e;
|
|
1276
1293
|
}
|
|
1277
|
-
if (t ==
|
|
1294
|
+
if (t == zr && e) {
|
|
1278
1295
|
this.cleanupQueue.push(e);
|
|
1279
1296
|
}
|
|
1280
1297
|
}
|
|
@@ -1290,14 +1307,14 @@ var SsrNode = class {
|
|
|
1290
1307
|
}
|
|
1291
1308
|
}
|
|
1292
1309
|
getProp(t) {
|
|
1293
|
-
if (t.startsWith(
|
|
1310
|
+
if (t.startsWith(Jr)) {
|
|
1294
1311
|
return this.localProps ? this.localProps[t] ?? null : null;
|
|
1295
1312
|
} else {
|
|
1296
1313
|
return this.attrs[t] ?? null;
|
|
1297
1314
|
}
|
|
1298
1315
|
}
|
|
1299
1316
|
removeProp(t) {
|
|
1300
|
-
if (t.startsWith(
|
|
1317
|
+
if (t.startsWith(Jr)) {
|
|
1301
1318
|
if (this.localProps) {
|
|
1302
1319
|
delete this.localProps[t];
|
|
1303
1320
|
}
|
|
@@ -1326,9 +1343,9 @@ var SsrNode = class {
|
|
|
1326
1343
|
if (isDev7) {
|
|
1327
1344
|
let t = "";
|
|
1328
1345
|
for (const e in this.attrs) {
|
|
1329
|
-
const
|
|
1346
|
+
const r = this.attrs[e];
|
|
1330
1347
|
t += `${e}=`;
|
|
1331
|
-
t += `${typeof
|
|
1348
|
+
t += `${typeof r === "string" || typeof r === "number" ? JSON.stringify(r) : "*"}`;
|
|
1332
1349
|
t += ", ";
|
|
1333
1350
|
}
|
|
1334
1351
|
return `<SSRNode id="${this.id}" ${t} />`;
|
|
@@ -1340,9 +1357,9 @@ var SsrNode = class {
|
|
|
1340
1357
|
|
|
1341
1358
|
var DomRef = class {
|
|
1342
1359
|
constructor(t) {
|
|
1343
|
-
this.
|
|
1360
|
+
this.me = t;
|
|
1344
1361
|
}
|
|
1345
|
-
|
|
1362
|
+
me;
|
|
1346
1363
|
__brand__="DomRef";
|
|
1347
1364
|
};
|
|
1348
1365
|
|
|
@@ -1356,87 +1373,87 @@ var SsrComponentFrame = class {
|
|
|
1356
1373
|
scopedStyleIds=/* @__PURE__ */ new Set;
|
|
1357
1374
|
projectionScopedStyle=null;
|
|
1358
1375
|
projectionComponentFrame=null;
|
|
1359
|
-
distributeChildrenIntoSlots(t, e,
|
|
1376
|
+
distributeChildrenIntoSlots(t, e, r) {
|
|
1360
1377
|
this.projectionScopedStyle = e;
|
|
1361
|
-
this.projectionComponentFrame =
|
|
1362
|
-
if (
|
|
1378
|
+
this.projectionComponentFrame = r;
|
|
1379
|
+
if (co(t)) {
|
|
1363
1380
|
const e = this.getSlotName(t);
|
|
1364
|
-
|
|
1381
|
+
Je(this.slots, e, t, 0);
|
|
1365
1382
|
} else if (Array.isArray(t) && t.length > 0) {
|
|
1366
1383
|
const e = [];
|
|
1367
|
-
for (let
|
|
1368
|
-
const
|
|
1369
|
-
if (
|
|
1370
|
-
const t = this.getSlotName(
|
|
1384
|
+
for (let r = 0; r < t.length; r++) {
|
|
1385
|
+
const n = t[r];
|
|
1386
|
+
if (co(n)) {
|
|
1387
|
+
const t = this.getSlotName(n);
|
|
1371
1388
|
if (t === QDefaultSlot) {
|
|
1372
|
-
e.push(
|
|
1389
|
+
e.push(n);
|
|
1373
1390
|
} else {
|
|
1374
|
-
this.updateSlot(t,
|
|
1391
|
+
this.updateSlot(t, n);
|
|
1375
1392
|
}
|
|
1376
1393
|
} else {
|
|
1377
|
-
e.push(
|
|
1394
|
+
e.push(n);
|
|
1378
1395
|
}
|
|
1379
1396
|
}
|
|
1380
|
-
e.length > 0 &&
|
|
1397
|
+
e.length > 0 && Je(this.slots, QDefaultSlot, e, 0);
|
|
1381
1398
|
} else {
|
|
1382
|
-
|
|
1399
|
+
Je(this.slots, QDefaultSlot, t, 0);
|
|
1383
1400
|
}
|
|
1384
1401
|
}
|
|
1385
1402
|
updateSlot(t, e) {
|
|
1386
|
-
let
|
|
1387
|
-
if (
|
|
1388
|
-
|
|
1389
|
-
} else if (Array.isArray(
|
|
1390
|
-
|
|
1403
|
+
let r = Ye(this.slots, t, 0);
|
|
1404
|
+
if (r === null) {
|
|
1405
|
+
r = e;
|
|
1406
|
+
} else if (Array.isArray(r)) {
|
|
1407
|
+
r.push(e);
|
|
1391
1408
|
} else {
|
|
1392
|
-
|
|
1409
|
+
r = [ r, e ];
|
|
1393
1410
|
}
|
|
1394
|
-
|
|
1411
|
+
Je(this.slots, t, r, 0);
|
|
1395
1412
|
}
|
|
1396
1413
|
getSlotName(t) {
|
|
1397
|
-
if (t.props[
|
|
1398
|
-
return t.props[
|
|
1414
|
+
if (t.props[yr]) {
|
|
1415
|
+
return t.props[yr];
|
|
1399
1416
|
}
|
|
1400
1417
|
return QDefaultSlot;
|
|
1401
1418
|
}
|
|
1402
1419
|
hasSlot(t) {
|
|
1403
|
-
return
|
|
1420
|
+
return Ge(this.slots, t, 0);
|
|
1404
1421
|
}
|
|
1405
1422
|
claimChildrenForSlot(t) {
|
|
1406
1423
|
return mapApp_remove(this.slots, t, 0);
|
|
1407
1424
|
}
|
|
1408
1425
|
consumeChildrenForSlot(t, e) {
|
|
1409
|
-
const
|
|
1426
|
+
const r = this.claimChildrenForSlot(e);
|
|
1410
1427
|
this.componentNode.setProp(e, t.id);
|
|
1411
|
-
t.setProp(
|
|
1412
|
-
return
|
|
1428
|
+
t.setProp(wr, this.componentNode.id);
|
|
1429
|
+
return r;
|
|
1413
1430
|
}
|
|
1414
1431
|
};
|
|
1415
1432
|
|
|
1416
1433
|
// packages/qwik/src/server/ssr-stream-writer.ts
|
|
1417
1434
|
var renderSSRChunks = (t, e) => {
|
|
1418
|
-
let
|
|
1419
|
-
for (let
|
|
1420
|
-
const s = t[
|
|
1435
|
+
let r = "";
|
|
1436
|
+
for (let n = 0; n < t.length; n++) {
|
|
1437
|
+
const s = t[n];
|
|
1421
1438
|
if (typeof s === "string") {
|
|
1422
|
-
|
|
1439
|
+
r += s;
|
|
1423
1440
|
} else if (s.type === "root-ref-delta") {
|
|
1424
1441
|
const t = e ? e[s.localId] ?? s.localId : s.localId;
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1442
|
+
const n = e ? e[s.localBaseId] ?? s.localBaseId : s.localBaseId;
|
|
1443
|
+
r += String(t - n);
|
|
1427
1444
|
} else {
|
|
1428
1445
|
const t = s.type === "root-ref" ? s.localId : s.localPath[0];
|
|
1429
|
-
|
|
1446
|
+
r += String(e ? e[t] ?? t : t);
|
|
1430
1447
|
if (s.type !== "root-ref-path") {
|
|
1431
1448
|
continue;
|
|
1432
1449
|
}
|
|
1433
|
-
const
|
|
1434
|
-
for (let t = 1; t <
|
|
1435
|
-
|
|
1450
|
+
const n = s.localPath;
|
|
1451
|
+
for (let t = 1; t < n.length; t++) {
|
|
1452
|
+
r += " " + n[t];
|
|
1436
1453
|
}
|
|
1437
1454
|
}
|
|
1438
1455
|
}
|
|
1439
|
-
return
|
|
1456
|
+
return r;
|
|
1440
1457
|
};
|
|
1441
1458
|
|
|
1442
1459
|
var StringSSRWriter = class {
|
|
@@ -1894,8 +1911,8 @@ function createTimer() {
|
|
|
1894
1911
|
const t = performance.now();
|
|
1895
1912
|
return () => {
|
|
1896
1913
|
const e = performance.now();
|
|
1897
|
-
const
|
|
1898
|
-
return
|
|
1914
|
+
const r = e - t;
|
|
1915
|
+
return r / 1e6;
|
|
1899
1916
|
};
|
|
1900
1917
|
}
|
|
1901
1918
|
|
|
@@ -1914,7 +1931,7 @@ function getBuildBase(t) {
|
|
|
1914
1931
|
}
|
|
1915
1932
|
|
|
1916
1933
|
var versions = {
|
|
1917
|
-
qwik: "2.0.0-beta.
|
|
1934
|
+
qwik: "2.0.0-beta.42-dev+3473a49",
|
|
1918
1935
|
qwikDom: "2.1.19"
|
|
1919
1936
|
};
|
|
1920
1937
|
|
|
@@ -1927,18 +1944,18 @@ var WRITE_ELEMENT_ATTRS = Number.MAX_SAFE_INTEGER - 2;
|
|
|
1927
1944
|
|
|
1928
1945
|
function vNodeData_incrementElementCount(t) {
|
|
1929
1946
|
const e = t.length;
|
|
1930
|
-
const
|
|
1931
|
-
if (
|
|
1947
|
+
const r = e > 1 ? t[e - 1] : 0;
|
|
1948
|
+
if (r >= 0) {
|
|
1932
1949
|
t.push(-1);
|
|
1933
1950
|
} else {
|
|
1934
|
-
t[e - 1] =
|
|
1951
|
+
t[e - 1] = r - 1;
|
|
1935
1952
|
}
|
|
1936
1953
|
}
|
|
1937
1954
|
|
|
1938
1955
|
function vNodeData_addTextSize(t, e) {
|
|
1939
|
-
const
|
|
1940
|
-
const
|
|
1941
|
-
if (
|
|
1956
|
+
const r = t.length;
|
|
1957
|
+
const n = r > 1 ? t[r - 1] : 0;
|
|
1958
|
+
if (r > 1 && n >= 0) {
|
|
1942
1959
|
t[0] |= 1 /* TEXT_DATA */;
|
|
1943
1960
|
}
|
|
1944
1961
|
t.push(e);
|
|
@@ -1961,29 +1978,29 @@ function vNodeData_openElement(t) {
|
|
|
1961
1978
|
t[0] |= 4 /* ELEMENT_NODE */;
|
|
1962
1979
|
}
|
|
1963
1980
|
|
|
1964
|
-
function vNodeData_createSsrNodeReference(t, e,
|
|
1981
|
+
function vNodeData_createSsrNodeReference(t, e, r, n, s) {
|
|
1965
1982
|
e[0] |= 8 /* REFERENCE */;
|
|
1966
1983
|
const i = [ -1 ];
|
|
1967
1984
|
let o = -1;
|
|
1968
1985
|
for (let t = 1; t < e.length; t++) {
|
|
1969
|
-
const
|
|
1970
|
-
if (typeof
|
|
1986
|
+
const r = e[t];
|
|
1987
|
+
if (typeof r === "object" && r !== null) {
|
|
1971
1988
|
o = t;
|
|
1972
1989
|
t++;
|
|
1973
1990
|
if (e[t] !== WRITE_ELEMENT_ATTRS) {
|
|
1974
1991
|
i[i.length - 1]++;
|
|
1975
1992
|
i.push(-1);
|
|
1976
1993
|
}
|
|
1977
|
-
} else if (
|
|
1994
|
+
} else if (r === CLOSE_FRAGMENT) {
|
|
1978
1995
|
i.pop();
|
|
1979
|
-
} else if (
|
|
1980
|
-
const t = 0 -
|
|
1996
|
+
} else if (r < 0) {
|
|
1997
|
+
const t = 0 - r;
|
|
1981
1998
|
i[i.length - 1] += t;
|
|
1982
1999
|
} else {
|
|
1983
2000
|
i[i.length - 1]++;
|
|
1984
2001
|
}
|
|
1985
2002
|
}
|
|
1986
|
-
let a = String(
|
|
2003
|
+
let a = String(r);
|
|
1987
2004
|
if (e[0] & (2 /* VIRTUAL_NODE */ | 1 /* TEXT_DATA */)) {
|
|
1988
2005
|
for (let t = 0; t < i.length; t++) {
|
|
1989
2006
|
const e = i[t];
|
|
@@ -1992,7 +2009,7 @@ function vNodeData_createSsrNodeReference(t, e, n, r, s) {
|
|
|
1992
2009
|
}
|
|
1993
2010
|
}
|
|
1994
2011
|
}
|
|
1995
|
-
return new SsrNode(t, a, o,
|
|
2012
|
+
return new SsrNode(t, a, o, n, e, s);
|
|
1996
2013
|
}
|
|
1997
2014
|
|
|
1998
2015
|
var ALPHANUMERIC = [];
|
|
@@ -2053,7 +2070,7 @@ var QTemplateProps = {
|
|
|
2053
2070
|
"aria-hidden": true
|
|
2054
2071
|
};
|
|
2055
2072
|
|
|
2056
|
-
var SSRContainer = class extends
|
|
2073
|
+
var SSRContainer = class extends zc {
|
|
2057
2074
|
tag;
|
|
2058
2075
|
isHtml;
|
|
2059
2076
|
writer;
|
|
@@ -2064,6 +2081,7 @@ var SSRContainer = class extends Cc {
|
|
|
2064
2081
|
symbolToChunkResolver;
|
|
2065
2082
|
renderOptions;
|
|
2066
2083
|
outOfOrderStreaming;
|
|
2084
|
+
I;
|
|
2067
2085
|
serializationCtx;
|
|
2068
2086
|
// Sometimes there is no app state, but framework metadata still points to a vnode id.
|
|
2069
2087
|
// For example, an OOOS segment can point outside the segment to a root vnode through
|
|
@@ -2087,6 +2105,7 @@ var SSRContainer = class extends Cc {
|
|
|
2087
2105
|
styleIds=/* @__PURE__ */ new Set;
|
|
2088
2106
|
isBackpatchExecutorEmitted=false;
|
|
2089
2107
|
isOutOfOrderExecutorEmitted=false;
|
|
2108
|
+
isErrorSwapExecutorEmitted=false;
|
|
2090
2109
|
backpatchMap=/* @__PURE__ */ new Map;
|
|
2091
2110
|
currentElementFrame=null;
|
|
2092
2111
|
renderTimer;
|
|
@@ -2102,7 +2121,7 @@ var SSRContainer = class extends Cc {
|
|
|
2102
2121
|
componentStack=[];
|
|
2103
2122
|
cleanupQueue=[];
|
|
2104
2123
|
emitContainerDataFrame=null;
|
|
2105
|
-
|
|
2124
|
+
Kt=randomStr();
|
|
2106
2125
|
// Temporary flag to find missing roots after the state was serialized
|
|
2107
2126
|
t=false;
|
|
2108
2127
|
qlInclude;
|
|
@@ -2125,8 +2144,8 @@ var SSRContainer = class extends Cc {
|
|
|
2125
2144
|
super(t.renderOptions.serverData ?? {}, t.locale);
|
|
2126
2145
|
this.symbolToChunkResolver = t => {
|
|
2127
2146
|
const e = t.lastIndexOf("_");
|
|
2128
|
-
const
|
|
2129
|
-
return
|
|
2147
|
+
const r = this.resolvedManifest.mapper[e == -1 ? t : t.substring(e + 1)];
|
|
2148
|
+
return r ? r[1] : "";
|
|
2130
2149
|
};
|
|
2131
2150
|
this.serializationCtx = this.serializationCtxFactory(SsrNode, DomRef, this.symbolToChunkResolver, t.writer);
|
|
2132
2151
|
this.renderTimer = createTimer();
|
|
@@ -2135,9 +2154,10 @@ var SSRContainer = class extends Cc {
|
|
|
2135
2154
|
this.writer = t.writer;
|
|
2136
2155
|
this.streamHandler = t.streamHandler;
|
|
2137
2156
|
this.timing = t.timing;
|
|
2138
|
-
this.
|
|
2157
|
+
this.ze = t.buildBase;
|
|
2139
2158
|
this.resolvedManifest = t.resolvedManifest;
|
|
2140
2159
|
this.renderOptions = t.renderOptions;
|
|
2160
|
+
this.I = t.renderOptions.transformError;
|
|
2141
2161
|
const e = this.renderOptions.streaming?.outOfOrder === true;
|
|
2142
2162
|
if (!__EXPERIMENTAL__.suspense) {
|
|
2143
2163
|
if (e) {
|
|
@@ -2147,9 +2167,9 @@ var SSRContainer = class extends Cc {
|
|
|
2147
2167
|
} else {
|
|
2148
2168
|
this.outOfOrderStreaming = e;
|
|
2149
2169
|
}
|
|
2150
|
-
this.
|
|
2151
|
-
const
|
|
2152
|
-
this.qlInclude =
|
|
2170
|
+
this.Ue = 1e5;
|
|
2171
|
+
const r = this.renderOptions.qwikLoader;
|
|
2172
|
+
this.qlInclude = r ? typeof r === "object" ? r.include === "never" ? 2 /* Done */ : 0 /* Module */ : r === "inline" ? 1 /* Inline */ : r === "never" ? 2 /* Done */ : 0 /* Module */ : 0 /* Module */;
|
|
2153
2173
|
if (this.qlInclude === 0 /* Module */) {
|
|
2154
2174
|
const t = this.resolvedManifest?.manifest.qwikLoader;
|
|
2155
2175
|
if (!t) {
|
|
@@ -2159,18 +2179,18 @@ var SSRContainer = class extends Cc {
|
|
|
2159
2179
|
this.m();
|
|
2160
2180
|
}
|
|
2161
2181
|
ensureProjectionResolved(t) {}
|
|
2162
|
-
handleError(t, e) {
|
|
2163
|
-
|
|
2182
|
+
handleError(t, e, r = "render" /* Render */) {
|
|
2183
|
+
_handleSSRError(this, t, e, r);
|
|
2164
2184
|
}
|
|
2165
|
-
addBackpatchEntry(t, e,
|
|
2166
|
-
const
|
|
2185
|
+
addBackpatchEntry(t, e, r) {
|
|
2186
|
+
const n = parseInt(t, 10);
|
|
2167
2187
|
const s = {
|
|
2168
2188
|
attrName: e,
|
|
2169
|
-
value:
|
|
2189
|
+
value: r
|
|
2170
2190
|
};
|
|
2171
|
-
const i = this.backpatchMap.get(
|
|
2191
|
+
const i = this.backpatchMap.get(n) || [];
|
|
2172
2192
|
i.push(s);
|
|
2173
|
-
this.backpatchMap.set(
|
|
2193
|
+
this.backpatchMap.set(n, i);
|
|
2174
2194
|
}
|
|
2175
2195
|
async render(t) {
|
|
2176
2196
|
this.openContainer();
|
|
@@ -2181,23 +2201,23 @@ var SSRContainer = class extends Cc {
|
|
|
2181
2201
|
await this.closeContainer();
|
|
2182
2202
|
}
|
|
2183
2203
|
async renderJSX(t, e) {
|
|
2184
|
-
await
|
|
2204
|
+
await Bn(this, t, e);
|
|
2185
2205
|
}
|
|
2186
2206
|
v() {
|
|
2187
2207
|
return this.i === 2 /* OOOSReady */;
|
|
2188
2208
|
}
|
|
2189
|
-
/** Queue OOOS serialization/write work that must not overlap with root state serialization. */
|
|
2209
|
+
/** Queue OOOS serialization/write work that must not overlap with root state serialization. */ C(t) {
|
|
2190
2210
|
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2191
2211
|
return t();
|
|
2192
2212
|
}
|
|
2193
2213
|
if (this.i === 0 /* NotReady */) {
|
|
2194
2214
|
return t();
|
|
2195
2215
|
}
|
|
2196
|
-
const e = this.i === 1 /* DataStreamStarted */ ? this.renderQueue.then(() => this.
|
|
2216
|
+
const e = this.i === 1 /* DataStreamStarted */ ? this.renderQueue.then(() => this.F()).then(t) : this.renderQueue.then(t);
|
|
2197
2217
|
this.renderQueue = e.catch(() => {});
|
|
2198
2218
|
return e;
|
|
2199
2219
|
}
|
|
2200
|
-
|
|
2220
|
+
F() {
|
|
2201
2221
|
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || this.v()) {
|
|
2202
2222
|
return;
|
|
2203
2223
|
}
|
|
@@ -2205,21 +2225,24 @@ var SSRContainer = class extends Cc {
|
|
|
2205
2225
|
this.resolveRootContainerReady = t;
|
|
2206
2226
|
});
|
|
2207
2227
|
}
|
|
2208
|
-
|
|
2228
|
+
ar() {
|
|
2209
2229
|
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || this.v()) {
|
|
2210
2230
|
return;
|
|
2211
2231
|
}
|
|
2212
|
-
this.rootContainerSerializedRootCount = this.serializationCtx.
|
|
2232
|
+
this.rootContainerSerializedRootCount = this.serializationCtx.de.length;
|
|
2213
2233
|
this.i = 2 /* OOOSReady */;
|
|
2214
2234
|
this.resolveRootContainerReady?.();
|
|
2215
2235
|
this.resolveRootContainerReady = null;
|
|
2216
2236
|
this.rootContainerReadyPromise = null;
|
|
2217
2237
|
}
|
|
2218
|
-
nextOutOfOrderId() {
|
|
2219
|
-
|
|
2238
|
+
nextOutOfOrderId(t = true) {
|
|
2239
|
+
const e = __EXPERIMENTAL__.suspense && this.outOfOrderStreaming;
|
|
2240
|
+
if (!e && !__EXPERIMENTAL__.errorBoundary) {
|
|
2220
2241
|
return 0;
|
|
2221
2242
|
}
|
|
2222
|
-
|
|
2243
|
+
if (t && e) {
|
|
2244
|
+
this.outOfOrderUsed = true;
|
|
2245
|
+
}
|
|
2223
2246
|
return ++this.outOfOrderId;
|
|
2224
2247
|
}
|
|
2225
2248
|
emitOutOfOrderSegmentScripts(t) {
|
|
@@ -2228,24 +2251,25 @@ var SSRContainer = class extends Cc {
|
|
|
2228
2251
|
}
|
|
2229
2252
|
this.write(t);
|
|
2230
2253
|
}
|
|
2231
|
-
async segment(t, e,
|
|
2254
|
+
async segment(t, e, r) {
|
|
2232
2255
|
if (!__EXPERIMENTAL__.suspense) {
|
|
2233
2256
|
throw new Error('Out-of-order Suspense streaming requires `experimental: ["suspense"]` in the `qwikVite` plugin.');
|
|
2234
2257
|
}
|
|
2235
2258
|
if (!this.outOfOrderStreaming) {
|
|
2236
2259
|
throw new Error("Out-of-order Suspense streaming requires `streaming.outOfOrder` to be `true`.");
|
|
2237
2260
|
}
|
|
2238
|
-
this.
|
|
2239
|
-
|
|
2240
|
-
const
|
|
2261
|
+
this.outOfOrderUsed = true;
|
|
2262
|
+
this.markVNodeRefForSerialization(r.parentComponentFrame?.componentNode);
|
|
2263
|
+
const n = new StringBufferSegmentWriter;
|
|
2264
|
+
const s = this.createSegmentContainer(t, n);
|
|
2241
2265
|
this.outOfOrderSegments.push(s);
|
|
2242
2266
|
try {
|
|
2243
|
-
await s.renderJSX(e,
|
|
2267
|
+
await s.renderJSX(e, r);
|
|
2244
2268
|
await s.resolvePromiseAttributes();
|
|
2245
|
-
const t =
|
|
2269
|
+
const t = n.extract();
|
|
2246
2270
|
return {
|
|
2247
2271
|
container: s,
|
|
2248
|
-
writer:
|
|
2272
|
+
writer: n,
|
|
2249
2273
|
htmlChunks: t
|
|
2250
2274
|
};
|
|
2251
2275
|
} catch (t) {
|
|
@@ -2253,18 +2277,17 @@ var SSRContainer = class extends Cc {
|
|
|
2253
2277
|
throw t;
|
|
2254
2278
|
}
|
|
2255
2279
|
}
|
|
2256
|
-
|
|
2280
|
+
hr() {
|
|
2257
2281
|
let t = this;
|
|
2258
2282
|
while (t instanceof SSRSegmentContainer) {
|
|
2259
|
-
t = t.
|
|
2283
|
+
t = t.Rn;
|
|
2260
2284
|
}
|
|
2261
2285
|
return t;
|
|
2262
2286
|
}
|
|
2263
2287
|
createSegmentContainer(t, e) {
|
|
2264
|
-
const
|
|
2265
|
-
const
|
|
2266
|
-
this.
|
|
2267
|
-
this.markVNodeRefForSerialization(r);
|
|
2288
|
+
const r = this.hr();
|
|
2289
|
+
const n = this.getOrCreateLastNode();
|
|
2290
|
+
this.Ct(n);
|
|
2268
2291
|
const s = {
|
|
2269
2292
|
tagNesting: 10 /* ANYTHING */ ,
|
|
2270
2293
|
parent: null,
|
|
@@ -2273,23 +2296,23 @@ var SSRContainer = class extends Cc {
|
|
|
2273
2296
|
// OOOS inserts this synthetic root under the Suspense content host on the client.
|
|
2274
2297
|
vNodeData: [ 16 /* SERIALIZE */ ],
|
|
2275
2298
|
currentFile: null,
|
|
2276
|
-
refBase:
|
|
2299
|
+
refBase: n.id
|
|
2277
2300
|
};
|
|
2278
2301
|
const i = new SSRSegmentContainer({
|
|
2279
2302
|
tagName: this.tag,
|
|
2280
2303
|
writer: e,
|
|
2281
2304
|
streamHandler: noopStreamHandler,
|
|
2282
|
-
locale: this.
|
|
2305
|
+
locale: this.fn,
|
|
2283
2306
|
timing: this.timing,
|
|
2284
|
-
buildBase: this.
|
|
2307
|
+
buildBase: this.ze || "/build/",
|
|
2285
2308
|
resolvedManifest: this.resolvedManifest,
|
|
2286
2309
|
renderOptions: this.renderOptions
|
|
2287
|
-
},
|
|
2310
|
+
}, r);
|
|
2288
2311
|
const o = i;
|
|
2289
|
-
o.
|
|
2312
|
+
o.It = true;
|
|
2290
2313
|
o.yt = this.yt;
|
|
2291
|
-
i.serializationCtx =
|
|
2292
|
-
i.serializationCtx.
|
|
2314
|
+
i.serializationCtx.yt = this.yt;
|
|
2315
|
+
i.serializationCtx.St = this.serializationCtx.St.bind(this.serializationCtx);
|
|
2293
2316
|
i.currentElementFrame = s;
|
|
2294
2317
|
i.currentComponentNode = this.currentComponentNode;
|
|
2295
2318
|
i.depthFirstElementCount = 0;
|
|
@@ -2299,7 +2322,7 @@ var SSRContainer = class extends Cc {
|
|
|
2299
2322
|
i.styleIds = this.styleIds;
|
|
2300
2323
|
i.emittedQwikEventNames = this.emittedQwikEventNames;
|
|
2301
2324
|
i.qlInclude = 2 /* Done */;
|
|
2302
|
-
i.
|
|
2325
|
+
i.Kt = this.Kt;
|
|
2303
2326
|
o._didAddQwikLoader = true;
|
|
2304
2327
|
return i;
|
|
2305
2328
|
}
|
|
@@ -2311,30 +2334,30 @@ var SSRContainer = class extends Cc {
|
|
|
2311
2334
|
}
|
|
2312
2335
|
removeOutOfOrderSegment(t) {
|
|
2313
2336
|
const e = this.outOfOrderSegments;
|
|
2314
|
-
for (let
|
|
2315
|
-
if (e[
|
|
2316
|
-
e.splice(
|
|
2337
|
+
for (let r = 0; r < e.length; r++) {
|
|
2338
|
+
if (e[r] === t) {
|
|
2339
|
+
e.splice(r, 1);
|
|
2317
2340
|
return;
|
|
2318
2341
|
}
|
|
2319
2342
|
}
|
|
2320
2343
|
}
|
|
2321
|
-
setContext(t, e,
|
|
2322
|
-
const
|
|
2323
|
-
let s =
|
|
2344
|
+
setContext(t, e, r) {
|
|
2345
|
+
const n = t;
|
|
2346
|
+
let s = n.getProp(Rr);
|
|
2324
2347
|
if (s == null) {
|
|
2325
|
-
|
|
2348
|
+
n.setProp(Rr, s = []);
|
|
2326
2349
|
}
|
|
2327
|
-
|
|
2328
|
-
this.addRoot(
|
|
2350
|
+
Je(s, e.id, r, 0, true);
|
|
2351
|
+
this.addRoot(n);
|
|
2329
2352
|
}
|
|
2330
2353
|
resolveContext(t, e) {
|
|
2331
|
-
let
|
|
2332
|
-
while (
|
|
2333
|
-
const t =
|
|
2334
|
-
if (t != null &&
|
|
2335
|
-
return
|
|
2354
|
+
let r = t;
|
|
2355
|
+
while (r) {
|
|
2356
|
+
const t = r.getProp(Rr);
|
|
2357
|
+
if (t != null && Ge(t, e.id, 0)) {
|
|
2358
|
+
return Ye(t, e.id, 0);
|
|
2336
2359
|
}
|
|
2337
|
-
|
|
2360
|
+
r = r.parentComponent;
|
|
2338
2361
|
}
|
|
2339
2362
|
return void 0;
|
|
2340
2363
|
}
|
|
@@ -2342,13 +2365,13 @@ var SSRContainer = class extends Cc {
|
|
|
2342
2365
|
const e = t;
|
|
2343
2366
|
return e.parentComponent;
|
|
2344
2367
|
}
|
|
2345
|
-
setHostProp(t, e,
|
|
2346
|
-
const
|
|
2347
|
-
return
|
|
2368
|
+
setHostProp(t, e, r) {
|
|
2369
|
+
const n = t;
|
|
2370
|
+
return n.setProp(e, r);
|
|
2348
2371
|
}
|
|
2349
2372
|
getHostProp(t, e) {
|
|
2350
|
-
const
|
|
2351
|
-
return
|
|
2373
|
+
const r = t;
|
|
2374
|
+
return r.getProp(e);
|
|
2352
2375
|
}
|
|
2353
2376
|
/**
|
|
2354
2377
|
* Renders opening tag for container. It could be a html tag for regular apps or custom element
|
|
@@ -2359,21 +2382,21 @@ var SSRContainer = class extends Cc {
|
|
|
2359
2382
|
}
|
|
2360
2383
|
const t = this.renderOptions.containerAttributes || {};
|
|
2361
2384
|
const e = t[QRenderAttr];
|
|
2362
|
-
t[
|
|
2385
|
+
t[Nr] = "paused" /* PAUSED */;
|
|
2363
2386
|
t[QRuntimeAttr] = "2";
|
|
2364
|
-
t[QVersionAttr] = this.
|
|
2387
|
+
t[QVersionAttr] = this.Ve ?? "dev";
|
|
2365
2388
|
t[QRenderAttr] = (e ? e + "-" : "") + (isDev8 ? "ssr-dev" : "ssr");
|
|
2366
|
-
t[
|
|
2367
|
-
t[QLocaleAttr] = this.
|
|
2389
|
+
t[Ar] = this.ze || "";
|
|
2390
|
+
t[QLocaleAttr] = this.fn;
|
|
2368
2391
|
t[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
2369
|
-
t[QInstanceAttr] = this.
|
|
2370
|
-
const
|
|
2371
|
-
if (typeof
|
|
2372
|
-
t[QStatePrewarmAttr] = String(
|
|
2392
|
+
t[QInstanceAttr] = this.Kt;
|
|
2393
|
+
const r = this.renderOptions.statePrewarm;
|
|
2394
|
+
if (typeof r === "number") {
|
|
2395
|
+
t[QStatePrewarmAttr] = String(r);
|
|
2373
2396
|
} else {
|
|
2374
2397
|
delete t[QStatePrewarmAttr];
|
|
2375
2398
|
}
|
|
2376
|
-
this.
|
|
2399
|
+
this.pn.containerAttributes = t;
|
|
2377
2400
|
this.openElement(this.tag, null, t);
|
|
2378
2401
|
if (!this.isHtml) {
|
|
2379
2402
|
this.emitContainerDataFrame = this.currentElementFrame;
|
|
@@ -2382,21 +2405,22 @@ var SSRContainer = class extends Cc {
|
|
|
2382
2405
|
/** Renders closing tag for current container */ closeContainer() {
|
|
2383
2406
|
return this.closeElement();
|
|
2384
2407
|
}
|
|
2385
|
-
|
|
2408
|
+
qt=0;
|
|
2409
|
+
At=null;
|
|
2386
2410
|
/** Renders opening tag for DOM element */
|
|
2387
|
-
openElement(t, e,
|
|
2411
|
+
openElement(t, e, r, n = null, s = null, i = null, o = true) {
|
|
2388
2412
|
if (!VALID_ELEMENT_NAME.test(t)) {
|
|
2389
|
-
throw
|
|
2413
|
+
throw rr(36 /* invalidElementName */ , [ JSON.stringify(t) ]);
|
|
2390
2414
|
}
|
|
2391
|
-
const a = isQwikStyleElement(t,
|
|
2415
|
+
const a = isQwikStyleElement(t, r) || isQwikStyleElement(t, n);
|
|
2392
2416
|
if (NO_SCRIPT_HERE_ELEMENTS.has(t)) {
|
|
2393
|
-
this.
|
|
2417
|
+
this.qt++;
|
|
2394
2418
|
}
|
|
2395
2419
|
if (
|
|
2396
2420
|
// don't append qwik loader before qwik style elements
|
|
2397
2421
|
// it will confuse the resuming, because styles are expected to be the first nodes in subtree
|
|
2398
2422
|
!a && this.qlInclude === 1 /* Inline */) {
|
|
2399
|
-
if (this.
|
|
2423
|
+
if (this.qt === 0 && this.size > 30 * 1024 && t !== "body") {
|
|
2400
2424
|
this.emitQwikLoaderInline();
|
|
2401
2425
|
}
|
|
2402
2426
|
}
|
|
@@ -2413,19 +2437,19 @@ var SSRContainer = class extends Cc {
|
|
|
2413
2437
|
this.write(LT);
|
|
2414
2438
|
this.write(t);
|
|
2415
2439
|
const c = this.getOrCreateLastNode();
|
|
2416
|
-
if (
|
|
2417
|
-
l = this.writeAttrs(t,
|
|
2440
|
+
if (r) {
|
|
2441
|
+
l = this.writeAttrs(t, r, false, s, i, o);
|
|
2418
2442
|
}
|
|
2419
|
-
this.write(" " +
|
|
2443
|
+
this.write(" " + ni);
|
|
2420
2444
|
if (e !== null) {
|
|
2421
2445
|
this.write(ATTR_EQUALS_QUOTE);
|
|
2422
2446
|
this.write(escapeHTML(e));
|
|
2423
|
-
this.write(
|
|
2447
|
+
this.write(Hi);
|
|
2424
2448
|
} else if (qTest) {
|
|
2425
2449
|
this.write(EMPTY_ATTR);
|
|
2426
2450
|
}
|
|
2427
|
-
if (
|
|
2428
|
-
l = this.writeAttrs(t,
|
|
2451
|
+
if (n && !zi(n)) {
|
|
2452
|
+
l = this.writeAttrs(t, n, true, s, i, o) || l;
|
|
2429
2453
|
}
|
|
2430
2454
|
this.write(GT);
|
|
2431
2455
|
if (c) {
|
|
@@ -2438,7 +2462,7 @@ var SSRContainer = class extends Cc {
|
|
|
2438
2462
|
this.emitContainerDataFrame = null;
|
|
2439
2463
|
this.onRenderDone();
|
|
2440
2464
|
const t = createTimer();
|
|
2441
|
-
return
|
|
2465
|
+
return li(li(this.emitContainerData(), () => this._closeElement()), () => {
|
|
2442
2466
|
this.timing.snapshot = t();
|
|
2443
2467
|
});
|
|
2444
2468
|
}
|
|
@@ -2452,9 +2476,9 @@ var SSRContainer = class extends Cc {
|
|
|
2452
2476
|
let t = this.cleanupQueue.pop();
|
|
2453
2477
|
while (t) {
|
|
2454
2478
|
for (let e = 0; e < t.length; e++) {
|
|
2455
|
-
const
|
|
2456
|
-
if (hasDestroy(
|
|
2457
|
-
n
|
|
2479
|
+
const r = t[e];
|
|
2480
|
+
if (hasDestroy(r)) {
|
|
2481
|
+
r.$n();
|
|
2458
2482
|
}
|
|
2459
2483
|
}
|
|
2460
2484
|
t = this.cleanupQueue.pop();
|
|
@@ -2470,7 +2494,7 @@ var SSRContainer = class extends Cc {
|
|
|
2470
2494
|
}
|
|
2471
2495
|
this.lastNode = null;
|
|
2472
2496
|
if (NO_SCRIPT_HERE_ELEMENTS.has(e)) {
|
|
2473
|
-
this.
|
|
2497
|
+
this.qt--;
|
|
2474
2498
|
}
|
|
2475
2499
|
}
|
|
2476
2500
|
/** Writes opening data to vNodeData for fragment boundaries */ openFragment(t) {
|
|
@@ -2519,8 +2543,8 @@ var SSRContainer = class extends Cc {
|
|
|
2519
2543
|
* @returns
|
|
2520
2544
|
*/ getComponentFrame(t = 0) {
|
|
2521
2545
|
const e = this.componentStack.length;
|
|
2522
|
-
const
|
|
2523
|
-
return
|
|
2546
|
+
const r = e - t - 1;
|
|
2547
|
+
return r >= 0 ? this.componentStack[r] : null;
|
|
2524
2548
|
}
|
|
2525
2549
|
getParentComponentFrame() {
|
|
2526
2550
|
const t = this.getComponentFrame()?.projectionDepth || 0;
|
|
@@ -2536,25 +2560,25 @@ var SSRContainer = class extends Cc {
|
|
|
2536
2560
|
if (t.slots.length === 0) {
|
|
2537
2561
|
return;
|
|
2538
2562
|
}
|
|
2539
|
-
this.openElement(
|
|
2563
|
+
this.openElement(Or, null, QTemplateProps, null);
|
|
2540
2564
|
const e = t.projectionScopedStyle;
|
|
2541
|
-
for (let
|
|
2542
|
-
const
|
|
2543
|
-
const s = t.slots[
|
|
2565
|
+
for (let r = 0; r < t.slots.length; r += 2) {
|
|
2566
|
+
const n = t.slots[r];
|
|
2567
|
+
const s = t.slots[r + 1];
|
|
2544
2568
|
if (this.vnodeSegment) {
|
|
2545
2569
|
this.markVNodeRefForSerialization(t.componentNode);
|
|
2546
2570
|
}
|
|
2547
2571
|
this.openFragment(isDev8 ? {
|
|
2548
|
-
[
|
|
2549
|
-
[
|
|
2550
|
-
[
|
|
2572
|
+
[or]: "P" /* Projection */ ,
|
|
2573
|
+
[wr]: t.componentNode.id,
|
|
2574
|
+
[yr]: n
|
|
2551
2575
|
} : {
|
|
2552
|
-
[
|
|
2553
|
-
[
|
|
2576
|
+
[wr]: t.componentNode.id,
|
|
2577
|
+
[yr]: n
|
|
2554
2578
|
});
|
|
2555
2579
|
const i = this.getOrCreateLastNode();
|
|
2556
2580
|
i.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
2557
|
-
t.componentNode.setProp(
|
|
2581
|
+
t.componentNode.setProp(n, i.id);
|
|
2558
2582
|
await this.renderJSX(s, {
|
|
2559
2583
|
currentStyleScoped: e,
|
|
2560
2584
|
parentComponentFrame: t.projectionComponentFrame
|
|
@@ -2576,7 +2600,7 @@ var SSRContainer = class extends Cc {
|
|
|
2576
2600
|
}
|
|
2577
2601
|
addRoot(t) {
|
|
2578
2602
|
if (this.t) {
|
|
2579
|
-
const e = this.serializationCtx.
|
|
2603
|
+
const e = this.serializationCtx.Xe(t);
|
|
2580
2604
|
return e;
|
|
2581
2605
|
}
|
|
2582
2606
|
return this.serializationCtx.Rt(t);
|
|
@@ -2585,13 +2609,13 @@ var SSRContainer = class extends Cc {
|
|
|
2585
2609
|
if (!this.lastNode) {
|
|
2586
2610
|
const t = this.currentElementFrame;
|
|
2587
2611
|
const e = t.depthFirstElementIdx + 1;
|
|
2588
|
-
const
|
|
2589
|
-
this.lastNode = vNodeData_createSsrNodeReference(this.currentComponentNode, t.vNodeData,
|
|
2612
|
+
const r = t.refBase ?? (this.vnodeSegment ? ar(this.vnodeSegment, e) : e + this.vNodeDataOffset);
|
|
2613
|
+
this.lastNode = vNodeData_createSsrNodeReference(this.currentComponentNode, t.vNodeData, r, this.cleanupQueue, t.currentFile);
|
|
2590
2614
|
}
|
|
2591
2615
|
return this.lastNode;
|
|
2592
2616
|
}
|
|
2593
|
-
addUnclaimedProjection(t, e,
|
|
2594
|
-
t.slots.push(e,
|
|
2617
|
+
addUnclaimedProjection(t, e, r) {
|
|
2618
|
+
t.slots.push(e, r);
|
|
2595
2619
|
}
|
|
2596
2620
|
m() {
|
|
2597
2621
|
const t = this.resolvedManifest.manifest.injections;
|
|
@@ -2599,28 +2623,28 @@ var SSRContainer = class extends Cc {
|
|
|
2599
2623
|
return;
|
|
2600
2624
|
}
|
|
2601
2625
|
for (let e = 0; e < t.length; e++) {
|
|
2602
|
-
const
|
|
2603
|
-
const
|
|
2604
|
-
if (
|
|
2605
|
-
this.additionalHeadNodes.push(
|
|
2626
|
+
const r = t[e];
|
|
2627
|
+
const n = _o(r.tag, null, r.attributes || {}, null, 0, null);
|
|
2628
|
+
if (r.location === "head") {
|
|
2629
|
+
this.additionalHeadNodes.push(n);
|
|
2606
2630
|
} else {
|
|
2607
|
-
this.additionalBodyNodes.push(
|
|
2631
|
+
this.additionalBodyNodes.push(n);
|
|
2608
2632
|
}
|
|
2609
2633
|
}
|
|
2610
2634
|
}
|
|
2611
|
-
|
|
2612
|
-
if (
|
|
2635
|
+
er(t, e, r, n) {
|
|
2636
|
+
if (n) {
|
|
2613
2637
|
const t = this.getComponentFrame(0);
|
|
2614
2638
|
t.scopedStyleIds.add(e);
|
|
2615
|
-
const
|
|
2616
|
-
this.setHostProp(
|
|
2639
|
+
const n = convertStyleIdsToString(t.scopedStyleIds);
|
|
2640
|
+
this.setHostProp(r, kr, n);
|
|
2617
2641
|
}
|
|
2618
2642
|
if (!this.styleIds.has(e)) {
|
|
2619
2643
|
this.styleIds.add(e);
|
|
2620
2644
|
if (this.currentElementFrame?.elementName === "html") {
|
|
2621
|
-
this.additionalHeadNodes.push(
|
|
2645
|
+
this.additionalHeadNodes.push(vo("style", null, {
|
|
2622
2646
|
dangerouslySetInnerHTML: t,
|
|
2623
|
-
[
|
|
2647
|
+
[gr]: e
|
|
2624
2648
|
}, null, 0, e));
|
|
2625
2649
|
} else {
|
|
2626
2650
|
this._styleNode(e, t);
|
|
@@ -2629,7 +2653,7 @@ var SSRContainer = class extends Cc {
|
|
|
2629
2653
|
}
|
|
2630
2654
|
_styleNode(t, e) {
|
|
2631
2655
|
this.openElement("style", null, {
|
|
2632
|
-
[
|
|
2656
|
+
[gr]: t
|
|
2633
2657
|
});
|
|
2634
2658
|
this.write(e);
|
|
2635
2659
|
this.closeElement();
|
|
@@ -2645,11 +2669,11 @@ var SSRContainer = class extends Cc {
|
|
|
2645
2669
|
emitContainerData() {
|
|
2646
2670
|
const t = this.renderOptions.streaming?.inOrder?.strategy === "disabled";
|
|
2647
2671
|
const e = !t || __EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed;
|
|
2648
|
-
return
|
|
2672
|
+
return li(li(e ? this.streamHandler.flush() : void 0, () => this.resolvePromiseAttributes()), () => {
|
|
2649
2673
|
this.i = 1 /* DataStreamStarted */;
|
|
2650
|
-
return
|
|
2674
|
+
return li(this.emitStateData(), () => {
|
|
2651
2675
|
this.t = true;
|
|
2652
|
-
return
|
|
2676
|
+
return li(this.emitRestStateData(), () => this.emitOutOfOrderSegmentsAndData());
|
|
2653
2677
|
});
|
|
2654
2678
|
});
|
|
2655
2679
|
}
|
|
@@ -2657,7 +2681,7 @@ var SSRContainer = class extends Cc {
|
|
|
2657
2681
|
this.emitVNodeData();
|
|
2658
2682
|
this.emitDelayedOutOfOrderSegmentVNodeData();
|
|
2659
2683
|
if (!isDev8) {
|
|
2660
|
-
preloaderPost(this, this.renderOptions, this.
|
|
2684
|
+
preloaderPost(this, this.renderOptions, this.pn?.nonce);
|
|
2661
2685
|
}
|
|
2662
2686
|
this.emitSyncFnsData();
|
|
2663
2687
|
this.emitPatchDataIfNeeded();
|
|
@@ -2670,8 +2694,8 @@ var SSRContainer = class extends Cc {
|
|
|
2670
2694
|
}
|
|
2671
2695
|
for (let t = 0; t < this.outOfOrderSegments.length; t++) {
|
|
2672
2696
|
const e = this.outOfOrderSegments[t];
|
|
2673
|
-
if (e.
|
|
2674
|
-
e.
|
|
2697
|
+
if (e.dr === 1 /* EarlyFinalized */) {
|
|
2698
|
+
e.pr();
|
|
2675
2699
|
t--;
|
|
2676
2700
|
}
|
|
2677
2701
|
}
|
|
@@ -2681,8 +2705,8 @@ var SSRContainer = class extends Cc {
|
|
|
2681
2705
|
return;
|
|
2682
2706
|
}
|
|
2683
2707
|
this.emitOutOfOrderExecutorIfNeeded();
|
|
2684
|
-
return
|
|
2685
|
-
this.
|
|
2708
|
+
return li(this.streamHandler.flush(), async () => {
|
|
2709
|
+
this.ar();
|
|
2686
2710
|
if (this.outOfOrderPendingSegments.length) {
|
|
2687
2711
|
await Promise.all(this.outOfOrderPendingSegments);
|
|
2688
2712
|
}
|
|
@@ -2706,37 +2730,37 @@ var SSRContainer = class extends Cc {
|
|
|
2706
2730
|
* NOTE: Not every element will need vNodeData. So we need to encode how many elements should be
|
|
2707
2731
|
* skipped. By choosing different separators we can encode different numbers of elements to skip.
|
|
2708
2732
|
*/ emitVNodeData(t) {
|
|
2709
|
-
this.
|
|
2710
|
-
if (!t && !this.serializationCtx.
|
|
2733
|
+
this.hr().markVNodeDataOwnerEmitted(t);
|
|
2734
|
+
if (!t && !this.serializationCtx.de.length && !this.hasVNodeRefsForSerialization) {
|
|
2711
2735
|
return;
|
|
2712
2736
|
}
|
|
2713
2737
|
this.emitVNodeDataScript(t, this.vNodeDatas.entries());
|
|
2714
2738
|
}
|
|
2715
|
-
emitVNodeDataScript(t, e,
|
|
2716
|
-
const
|
|
2739
|
+
emitVNodeDataScript(t, e, r = false) {
|
|
2740
|
+
const n = {
|
|
2717
2741
|
type: "qwik/vnode"
|
|
2718
2742
|
};
|
|
2719
2743
|
if (__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && t) {
|
|
2720
|
-
|
|
2744
|
+
n[vr] = t;
|
|
2721
2745
|
}
|
|
2722
|
-
if (
|
|
2723
|
-
|
|
2746
|
+
if (r) {
|
|
2747
|
+
n[QStatePatchAttr] = true;
|
|
2724
2748
|
}
|
|
2725
|
-
this.openScript(
|
|
2749
|
+
this.openScript(n);
|
|
2726
2750
|
const s = [];
|
|
2727
2751
|
let i = 0;
|
|
2728
|
-
for (const [t,
|
|
2729
|
-
const e =
|
|
2752
|
+
for (const [t, r] of e) {
|
|
2753
|
+
const e = r[0];
|
|
2730
2754
|
if (e & 16 /* SERIALIZE */) {
|
|
2731
2755
|
i = this.emitVNodeSeparators(i, t);
|
|
2732
2756
|
if (e & 8 /* REFERENCE */) {
|
|
2733
2757
|
this.write(VNodeDataSeparator.REFERENCE_CH);
|
|
2734
2758
|
}
|
|
2735
|
-
if (e & (1 /* TEXT_DATA */ | 2 /* VIRTUAL_NODE */ | 4 /* ELEMENT_NODE */)) {
|
|
2759
|
+
if (!(e & 32 /* INERT */) && e & (1 /* TEXT_DATA */ | 2 /* VIRTUAL_NODE */ | 4 /* ELEMENT_NODE */)) {
|
|
2736
2760
|
let t = null;
|
|
2737
2761
|
let e = 0;
|
|
2738
|
-
for (let
|
|
2739
|
-
const i = n
|
|
2762
|
+
for (let n = 1; n < r.length; n++) {
|
|
2763
|
+
const i = r[n];
|
|
2740
2764
|
if (typeof i === "object" && i !== null) {
|
|
2741
2765
|
s.push(t);
|
|
2742
2766
|
t = i;
|
|
@@ -2751,7 +2775,7 @@ var SSRContainer = class extends Cc {
|
|
|
2751
2775
|
e--;
|
|
2752
2776
|
this.write(VNodeDataChar.CLOSE_CHAR);
|
|
2753
2777
|
} else if (i === WRITE_ELEMENT_ATTRS) {
|
|
2754
|
-
if (t && !
|
|
2778
|
+
if (t && !zi(t)) {
|
|
2755
2779
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2756
2780
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2757
2781
|
this.writeFragmentAttrs(t);
|
|
@@ -2776,10 +2800,16 @@ var SSRContainer = class extends Cc {
|
|
|
2776
2800
|
}
|
|
2777
2801
|
}
|
|
2778
2802
|
this.closeScript();
|
|
2779
|
-
if (
|
|
2803
|
+
if (r && !t) {
|
|
2780
2804
|
this.emitInlineScript("document.qProcessVNodeDataPatch&&document.qProcessVNodeDataPatch(document.currentScript.previousElementSibling)");
|
|
2781
2805
|
}
|
|
2782
2806
|
}
|
|
2807
|
+
Ct(t) {
|
|
2808
|
+
if (t) {
|
|
2809
|
+
this.addRoot(t);
|
|
2810
|
+
this.markVNodeRefForSerialization(t);
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2783
2813
|
markVNodeRefForSerialization(t) {
|
|
2784
2814
|
if (t) {
|
|
2785
2815
|
this.hasVNodeRefsForSerialization = true;
|
|
@@ -2803,11 +2833,11 @@ var SSRContainer = class extends Cc {
|
|
|
2803
2833
|
localIndex: e
|
|
2804
2834
|
};
|
|
2805
2835
|
}
|
|
2806
|
-
const
|
|
2807
|
-
const
|
|
2808
|
-
const s =
|
|
2809
|
-
const i =
|
|
2810
|
-
const o =
|
|
2836
|
+
const r = -e - 1;
|
|
2837
|
+
const n = Math.floor((Math.sqrt(8 * r + 1) - 1) / 2);
|
|
2838
|
+
const s = n * (n + 1) / 2;
|
|
2839
|
+
const i = r - s;
|
|
2840
|
+
const o = n - i;
|
|
2811
2841
|
return {
|
|
2812
2842
|
owner: String(o + 1),
|
|
2813
2843
|
localIndex: i
|
|
@@ -2815,69 +2845,69 @@ var SSRContainer = class extends Cc {
|
|
|
2815
2845
|
}
|
|
2816
2846
|
writeFragmentAttrs(t) {
|
|
2817
2847
|
for (const e in t) {
|
|
2818
|
-
const
|
|
2819
|
-
let
|
|
2848
|
+
const r = t[e];
|
|
2849
|
+
let n = r;
|
|
2820
2850
|
let s;
|
|
2821
2851
|
let i = null;
|
|
2822
|
-
if (e ===
|
|
2823
|
-
s =
|
|
2824
|
-
|
|
2825
|
-
} else if (typeof
|
|
2826
|
-
s = this.addRoot(
|
|
2852
|
+
if (e === Wr && typeof r === "number") {
|
|
2853
|
+
s = r;
|
|
2854
|
+
n = String(r);
|
|
2855
|
+
} else if (typeof r !== "string") {
|
|
2856
|
+
s = this.addRoot(r);
|
|
2827
2857
|
if (s === void 0) {
|
|
2828
|
-
if (e ===
|
|
2858
|
+
if (e === hr) {
|
|
2829
2859
|
this.write(VNodeDataChar.RENDER_FN_CHAR);
|
|
2830
2860
|
this.write(VNodeDataChar.RENDER_HASH_PREFIX_CHAR);
|
|
2831
|
-
this.write(encodeVNodeDataString(encodeVNodeDataKey(
|
|
2861
|
+
this.write(encodeVNodeDataString(encodeVNodeDataKey(r.ot)));
|
|
2832
2862
|
}
|
|
2833
2863
|
continue;
|
|
2834
2864
|
}
|
|
2835
|
-
|
|
2865
|
+
n = String(s);
|
|
2836
2866
|
}
|
|
2837
2867
|
switch (e) {
|
|
2838
|
-
case
|
|
2868
|
+
case kr:
|
|
2839
2869
|
this.write(VNodeDataChar.SCOPED_STYLE_CHAR);
|
|
2840
2870
|
break;
|
|
2841
2871
|
|
|
2842
|
-
case
|
|
2872
|
+
case hr:
|
|
2843
2873
|
this.write(VNodeDataChar.RENDER_FN_CHAR);
|
|
2844
2874
|
break;
|
|
2845
2875
|
|
|
2846
|
-
case
|
|
2876
|
+
case Wr:
|
|
2847
2877
|
this.write(VNodeDataChar.ID_CHAR);
|
|
2848
2878
|
break;
|
|
2849
2879
|
|
|
2850
|
-
case
|
|
2880
|
+
case Ur:
|
|
2851
2881
|
this.write(VNodeDataChar.PROPS_CHAR);
|
|
2852
2882
|
break;
|
|
2853
2883
|
|
|
2854
|
-
case
|
|
2884
|
+
case Vr:
|
|
2855
2885
|
i = encodeVNodeDataKey;
|
|
2856
2886
|
this.write(VNodeDataChar.KEY_CHAR);
|
|
2857
2887
|
break;
|
|
2858
2888
|
|
|
2859
|
-
case
|
|
2889
|
+
case zr:
|
|
2860
2890
|
this.write(VNodeDataChar.SEQ_CHAR);
|
|
2861
2891
|
break;
|
|
2862
2892
|
|
|
2863
|
-
case
|
|
2893
|
+
case Br:
|
|
2864
2894
|
this.write(VNodeDataChar.SEQ_IDX_CHAR);
|
|
2865
2895
|
break;
|
|
2866
2896
|
|
|
2867
|
-
case
|
|
2897
|
+
case Pr:
|
|
2868
2898
|
this.write(VNodeDataChar.BACK_REFS_CHAR);
|
|
2869
2899
|
break;
|
|
2870
2900
|
|
|
2871
|
-
case
|
|
2901
|
+
case wr:
|
|
2872
2902
|
this.write(VNodeDataChar.SLOT_PARENT_CHAR);
|
|
2873
2903
|
break;
|
|
2874
2904
|
|
|
2875
2905
|
// Skipping `\` character for now because it is used for escaping.
|
|
2876
|
-
case
|
|
2906
|
+
case Rr:
|
|
2877
2907
|
this.write(VNodeDataChar.CONTEXT_CHAR);
|
|
2878
2908
|
break;
|
|
2879
2909
|
|
|
2880
|
-
case
|
|
2910
|
+
case yr:
|
|
2881
2911
|
i = encodeVNodeDataKey;
|
|
2882
2912
|
this.write(VNodeDataChar.SLOT_CHAR);
|
|
2883
2913
|
break;
|
|
@@ -2890,8 +2920,8 @@ var SSRContainer = class extends Cc {
|
|
|
2890
2920
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2891
2921
|
}
|
|
2892
2922
|
}
|
|
2893
|
-
const o = encodeVNodeDataString(i ? i(
|
|
2894
|
-
const a = i ? o !==
|
|
2923
|
+
const o = encodeVNodeDataString(i ? i(n) : n);
|
|
2924
|
+
const a = i ? o !== n : false;
|
|
2895
2925
|
if (a) {
|
|
2896
2926
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2897
2927
|
this.write(o);
|
|
@@ -2899,55 +2929,55 @@ var SSRContainer = class extends Cc {
|
|
|
2899
2929
|
} else if (typeof s === "number") {
|
|
2900
2930
|
this.writeRootRef(s);
|
|
2901
2931
|
} else {
|
|
2902
|
-
this.write(
|
|
2932
|
+
this.write(n);
|
|
2903
2933
|
}
|
|
2904
2934
|
}
|
|
2905
2935
|
}
|
|
2906
2936
|
emitStateData() {
|
|
2907
|
-
if (!this.serializationCtx.
|
|
2937
|
+
if (!this.serializationCtx.de.length && !this.serializationCtx.Ce.size) {
|
|
2908
2938
|
return;
|
|
2909
2939
|
}
|
|
2910
2940
|
const t = this.stateScriptAttrs();
|
|
2911
2941
|
this.openScript(t);
|
|
2912
|
-
this.serializationCtx.
|
|
2913
|
-
return
|
|
2942
|
+
this.serializationCtx.ce(this.writer);
|
|
2943
|
+
return li(this.serializationCtx.Jt(), () => {
|
|
2914
2944
|
this.closeScript();
|
|
2915
2945
|
});
|
|
2916
2946
|
}
|
|
2917
2947
|
/** Add q-d:qidle attribute to eagerly resume some state if needed */ stateScriptAttrs() {
|
|
2918
2948
|
const t = {
|
|
2919
2949
|
type: "qwik/state",
|
|
2920
|
-
[QInstanceAttr]: this.
|
|
2950
|
+
[QInstanceAttr]: this.Kt
|
|
2921
2951
|
};
|
|
2922
|
-
const e = this.serializationCtx.
|
|
2952
|
+
const e = this.serializationCtx.Ce;
|
|
2923
2953
|
if (e.size > 0) {
|
|
2924
|
-
t["q-d:qidle"] =
|
|
2954
|
+
t["q-d:qidle"] = xa(null, "_res", _, null, [ ...e ]);
|
|
2925
2955
|
}
|
|
2926
2956
|
return t;
|
|
2927
2957
|
}
|
|
2928
2958
|
emitSyncFnsData(t = false) {
|
|
2929
|
-
const e = this.serializationCtx.
|
|
2930
|
-
const
|
|
2931
|
-
if (e.length >
|
|
2932
|
-
const
|
|
2959
|
+
const e = this.serializationCtx.Ie;
|
|
2960
|
+
const r = t ? this.emittedSyncFnCount : 0;
|
|
2961
|
+
if (e.length > r) {
|
|
2962
|
+
const n = {
|
|
2933
2963
|
"q:func": "qwik/json"
|
|
2934
2964
|
};
|
|
2935
2965
|
if (this.renderOptions.serverData?.nonce) {
|
|
2936
|
-
|
|
2966
|
+
n["nonce"] = this.renderOptions.serverData.nonce;
|
|
2937
2967
|
}
|
|
2938
|
-
this.openScript(
|
|
2968
|
+
this.openScript(n);
|
|
2939
2969
|
if (t) {
|
|
2940
|
-
const t = Q_FUNCS_PREFIX.replace("HASH", this.
|
|
2970
|
+
const t = Q_FUNCS_PREFIX.replace("HASH", this.Kt).slice(0, -1);
|
|
2941
2971
|
this.write(`(${t}||(${t}=[])).push(`);
|
|
2942
2972
|
} else {
|
|
2943
|
-
this.write(Q_FUNCS_PREFIX.replace("HASH", this.
|
|
2973
|
+
this.write(Q_FUNCS_PREFIX.replace("HASH", this.Kt));
|
|
2944
2974
|
}
|
|
2945
2975
|
if (!t) {
|
|
2946
|
-
this.write(
|
|
2976
|
+
this.write(Qi);
|
|
2947
2977
|
}
|
|
2948
|
-
this.writeArray(t ?
|
|
2978
|
+
this.writeArray(e, Yi, t ? r : 0);
|
|
2949
2979
|
if (!t) {
|
|
2950
|
-
this.write(
|
|
2980
|
+
this.write(Ji);
|
|
2951
2981
|
}
|
|
2952
2982
|
if (t) {
|
|
2953
2983
|
this.write(")");
|
|
@@ -2957,24 +2987,27 @@ var SSRContainer = class extends Cc {
|
|
|
2957
2987
|
}
|
|
2958
2988
|
}
|
|
2959
2989
|
emitPatchDataIfNeeded() {
|
|
2990
|
+
if (this.backpatchMap.size === 0) {
|
|
2991
|
+
return;
|
|
2992
|
+
}
|
|
2960
2993
|
const t = [];
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2994
|
+
const e = [ ...this.backpatchMap.entries() ].sort(([t], [e]) => Number(t) - Number(e));
|
|
2995
|
+
for (let r = 0; r < e.length; r++) {
|
|
2996
|
+
const [n, s] = e[r];
|
|
2997
|
+
for (let e = 0; e < s.length; e++) {
|
|
2998
|
+
const r = s[e];
|
|
2999
|
+
t.push(n, r.attrName, Fu(r.value) ? r.value.untrackedValue : r.value);
|
|
2965
3000
|
}
|
|
2966
3001
|
}
|
|
2967
3002
|
this.backpatchMap.clear();
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
e["nonce"] = this.renderOptions.serverData.nonce;
|
|
2975
|
-
}
|
|
2976
|
-
this.writeScript(e, JSON.stringify(t).replaceAll("<", "\\u003C"));
|
|
3003
|
+
this.isBackpatchExecutorEmitted = true;
|
|
3004
|
+
const r = {
|
|
3005
|
+
type: ELEMENT_BACKPATCH_DATA
|
|
3006
|
+
};
|
|
3007
|
+
if (this.renderOptions.serverData?.nonce) {
|
|
3008
|
+
r["nonce"] = this.renderOptions.serverData.nonce;
|
|
2977
3009
|
}
|
|
3010
|
+
this.writeScript(r, JSON.stringify(t).replaceAll("<", "\\u003C"));
|
|
2978
3011
|
}
|
|
2979
3012
|
emitBackpatchDataAndExecutorIfNeeded() {
|
|
2980
3013
|
if (this.backpatchMap.size === 0) {
|
|
@@ -3011,6 +3044,17 @@ var SSRContainer = class extends Cc {
|
|
|
3011
3044
|
debug: isDev8
|
|
3012
3045
|
}));
|
|
3013
3046
|
}
|
|
3047
|
+
emitErrorSwapExecutorIfNeeded() {
|
|
3048
|
+
if (!__EXPERIMENTAL__.errorBoundary || this.isErrorSwapExecutorEmitted) {
|
|
3049
|
+
return;
|
|
3050
|
+
}
|
|
3051
|
+
this.isErrorSwapExecutorEmitted = true;
|
|
3052
|
+
this.emitInlineScript(getQwikErrorSwapExecutorScript({
|
|
3053
|
+
debug: isDev8
|
|
3054
|
+
}));
|
|
3055
|
+
}
|
|
3056
|
+
// Root containers emit qErr inline at the swap site; only segment containers defer ids.
|
|
3057
|
+
A(t) {}
|
|
3014
3058
|
emitInlineScript(t) {
|
|
3015
3059
|
const e = {
|
|
3016
3060
|
type: "text/javascript"
|
|
@@ -3041,31 +3085,31 @@ var SSRContainer = class extends Cc {
|
|
|
3041
3085
|
}
|
|
3042
3086
|
}
|
|
3043
3087
|
isStatic() {
|
|
3044
|
-
return !(__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed) && this.serializationCtx.
|
|
3088
|
+
return !(__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed) && this.serializationCtx.Ft.size === 0;
|
|
3045
3089
|
}
|
|
3046
3090
|
emitQwikLoaderAtTopIfNeeded() {
|
|
3047
3091
|
if (this.qlInclude === 0 /* Module */) {
|
|
3048
3092
|
this.qlInclude = 2 /* Done */;
|
|
3049
|
-
const t = this.
|
|
3093
|
+
const t = this.ze + this.resolvedManifest.manifest.qwikLoader;
|
|
3050
3094
|
const e = {
|
|
3051
3095
|
rel: "modulepreload",
|
|
3052
3096
|
href: t
|
|
3053
3097
|
};
|
|
3054
|
-
const
|
|
3055
|
-
if (
|
|
3056
|
-
e["nonce"] =
|
|
3098
|
+
const r = this.renderOptions.serverData?.nonce;
|
|
3099
|
+
if (r) {
|
|
3100
|
+
e["nonce"] = r;
|
|
3057
3101
|
}
|
|
3058
3102
|
this.openElement("link", null, e);
|
|
3059
3103
|
this.closeElement();
|
|
3060
|
-
const
|
|
3104
|
+
const n = {
|
|
3061
3105
|
async: true,
|
|
3062
3106
|
type: "module",
|
|
3063
3107
|
src: t
|
|
3064
3108
|
};
|
|
3065
|
-
if (
|
|
3066
|
-
|
|
3109
|
+
if (r) {
|
|
3110
|
+
n["nonce"] = r;
|
|
3067
3111
|
}
|
|
3068
|
-
this.writeScript(
|
|
3112
|
+
this.writeScript(n);
|
|
3069
3113
|
}
|
|
3070
3114
|
}
|
|
3071
3115
|
emitQwikLoaderInline() {
|
|
@@ -3093,84 +3137,84 @@ var SSRContainer = class extends Cc {
|
|
|
3093
3137
|
}
|
|
3094
3138
|
emitNewQwikEvents(t = false) {
|
|
3095
3139
|
const e = [];
|
|
3096
|
-
for (const t of this.serializationCtx.
|
|
3140
|
+
for (const t of this.serializationCtx.Lt) {
|
|
3097
3141
|
if (!this.emittedQwikEventNames.has(t)) {
|
|
3098
3142
|
this.emittedQwikEventNames.add(t);
|
|
3099
3143
|
e.push(JSON.stringify(t));
|
|
3100
3144
|
}
|
|
3101
3145
|
}
|
|
3102
3146
|
if (t) {
|
|
3103
|
-
e.push(`${QwikEvContainerReady}`, JSON.stringify(this.
|
|
3147
|
+
e.push(`${QwikEvContainerReady}`, JSON.stringify(this.Kt));
|
|
3104
3148
|
}
|
|
3105
3149
|
this.emitQwikEvents(e);
|
|
3106
3150
|
}
|
|
3107
3151
|
emitQwikEvents(t) {
|
|
3108
3152
|
if (t.length > 0) {
|
|
3109
3153
|
const e = {};
|
|
3110
|
-
const
|
|
3111
|
-
if (
|
|
3112
|
-
e["nonce"] =
|
|
3154
|
+
const r = this.renderOptions.serverData?.nonce;
|
|
3155
|
+
if (r) {
|
|
3156
|
+
e["nonce"] = r;
|
|
3113
3157
|
}
|
|
3114
3158
|
this.openScript(e);
|
|
3115
3159
|
this.write(`(window._qwikEv||(window._qwikEv=[])).push(`);
|
|
3116
|
-
this.writeArray(t,
|
|
3160
|
+
this.writeArray(t, Yi);
|
|
3117
3161
|
this.write(PAREN_CLOSE);
|
|
3118
3162
|
this.closeScript();
|
|
3119
3163
|
}
|
|
3120
3164
|
}
|
|
3121
3165
|
// Keep in sync with process-vnode-data.unit.ts
|
|
3122
3166
|
emitVNodeSeparators(t, e) {
|
|
3123
|
-
let
|
|
3124
|
-
while (
|
|
3125
|
-
if (
|
|
3167
|
+
let r = e - t;
|
|
3168
|
+
while (r != 0) {
|
|
3169
|
+
if (r >= 8192) {
|
|
3126
3170
|
this.write(VNodeDataSeparator.ADVANCE_8192_CH);
|
|
3127
|
-
|
|
3171
|
+
r -= 8192;
|
|
3128
3172
|
} else {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3173
|
+
r & 4096 && this.write(VNodeDataSeparator.ADVANCE_4096_CH);
|
|
3174
|
+
r & 2048 && this.write(VNodeDataSeparator.ADVANCE_2048_CH);
|
|
3175
|
+
r & 1024 && this.write(VNodeDataSeparator.ADVANCE_1024_CH);
|
|
3176
|
+
r & 512 && this.write(VNodeDataSeparator.ADVANCE_512_CH);
|
|
3177
|
+
r & 256 && this.write(VNodeDataSeparator.ADVANCE_256_CH);
|
|
3178
|
+
r & 128 && this.write(VNodeDataSeparator.ADVANCE_128_CH);
|
|
3179
|
+
r & 64 && this.write(VNodeDataSeparator.ADVANCE_64_CH);
|
|
3180
|
+
r & 32 && this.write(VNodeDataSeparator.ADVANCE_32_CH);
|
|
3181
|
+
r & 16 && this.write(VNodeDataSeparator.ADVANCE_16_CH);
|
|
3182
|
+
r & 8 && this.write(VNodeDataSeparator.ADVANCE_8_CH);
|
|
3183
|
+
r & 4 && this.write(VNodeDataSeparator.ADVANCE_4_CH);
|
|
3184
|
+
r & 2 && this.write(VNodeDataSeparator.ADVANCE_2_CH);
|
|
3185
|
+
r & 1 && this.write(VNodeDataSeparator.ADVANCE_1_CH);
|
|
3186
|
+
r = 0;
|
|
3143
3187
|
}
|
|
3144
3188
|
}
|
|
3145
3189
|
return e;
|
|
3146
3190
|
}
|
|
3147
|
-
createAndPushFrame(t, e,
|
|
3148
|
-
let
|
|
3191
|
+
createAndPushFrame(t, e, r) {
|
|
3192
|
+
let n = 10 /* ANYTHING */;
|
|
3149
3193
|
if (isDev8) {
|
|
3150
3194
|
if (!this.currentElementFrame) {
|
|
3151
|
-
|
|
3195
|
+
n = initialTag(t);
|
|
3152
3196
|
} else {
|
|
3153
3197
|
let e = this.currentElementFrame;
|
|
3154
3198
|
const s = e.tagNesting;
|
|
3155
|
-
|
|
3156
|
-
if (
|
|
3157
|
-
const
|
|
3199
|
+
n = isTagAllowed(s, t);
|
|
3200
|
+
if (n === 0 /* NOT_ALLOWED */) {
|
|
3201
|
+
const n = [];
|
|
3158
3202
|
while (e) {
|
|
3159
|
-
|
|
3203
|
+
n.unshift(e);
|
|
3160
3204
|
e = e.parent;
|
|
3161
3205
|
}
|
|
3162
3206
|
const i = [];
|
|
3163
|
-
if (
|
|
3164
|
-
i.push(`Error found in file: ${
|
|
3207
|
+
if (r) {
|
|
3208
|
+
i.push(`Error found in file: ${r}`);
|
|
3165
3209
|
}
|
|
3166
3210
|
i.push(`HTML rules do not allow '<${t}>' at this location.`, ` (The HTML parser will try to recover by auto-closing or inserting additional tags which will confuse Qwik when it resumes.)`, ` Offending tag: <${t}>`, ` Existing tag context:`);
|
|
3167
3211
|
let o = " ";
|
|
3168
3212
|
let a = "";
|
|
3169
|
-
for (let t = 0; t <
|
|
3170
|
-
const e =
|
|
3171
|
-
const [
|
|
3172
|
-
i.push(`${o}<${e.elementName}>${a !==
|
|
3173
|
-
a =
|
|
3213
|
+
for (let t = 0; t < n.length; t++) {
|
|
3214
|
+
const e = n[t];
|
|
3215
|
+
const [r, s] = allowedContent(e.tagNesting);
|
|
3216
|
+
i.push(`${o}<${e.elementName}>${a !== r ? ` [${r}]${s ? ` -> ${s}` : ""}` : ""}`);
|
|
3217
|
+
a = r;
|
|
3174
3218
|
o += " ";
|
|
3175
3219
|
}
|
|
3176
3220
|
i.push(`${o}<${t}> <= is not allowed as a child of ${allowedContent(s)[0]}.`);
|
|
@@ -3179,12 +3223,12 @@ var SSRContainer = class extends Cc {
|
|
|
3179
3223
|
}
|
|
3180
3224
|
}
|
|
3181
3225
|
const s = {
|
|
3182
|
-
tagNesting:
|
|
3226
|
+
tagNesting: n,
|
|
3183
3227
|
parent: this.currentElementFrame,
|
|
3184
3228
|
elementName: t,
|
|
3185
3229
|
depthFirstElementIdx: e,
|
|
3186
3230
|
vNodeData: [ 0 /* NONE */ ],
|
|
3187
|
-
currentFile: isDev8 ?
|
|
3231
|
+
currentFile: isDev8 ? r || null : null,
|
|
3188
3232
|
refBase: null
|
|
3189
3233
|
};
|
|
3190
3234
|
this.currentElementFrame = s;
|
|
@@ -3212,17 +3256,17 @@ var SSRContainer = class extends Cc {
|
|
|
3212
3256
|
}
|
|
3213
3257
|
}
|
|
3214
3258
|
writeRootRefDelta(t, e) {
|
|
3215
|
-
const
|
|
3216
|
-
this.size += String(
|
|
3259
|
+
const r = t - e;
|
|
3260
|
+
this.size += String(r).length;
|
|
3217
3261
|
this.writer.writeRootRefDelta(t, e);
|
|
3218
3262
|
}
|
|
3219
|
-
writeArray(t, e) {
|
|
3220
|
-
for (let n =
|
|
3221
|
-
const
|
|
3222
|
-
if (n >
|
|
3263
|
+
writeArray(t, e, r = 0) {
|
|
3264
|
+
for (let n = r; n < t.length; n++) {
|
|
3265
|
+
const s = t[n];
|
|
3266
|
+
if (n > r) {
|
|
3223
3267
|
this.write(e);
|
|
3224
3268
|
}
|
|
3225
|
-
this.write(
|
|
3269
|
+
this.write(s);
|
|
3226
3270
|
}
|
|
3227
3271
|
}
|
|
3228
3272
|
writeAttrs(t, e, s, i, o, a) {
|
|
@@ -3231,16 +3275,16 @@ var SSRContainer = class extends Cc {
|
|
|
3231
3275
|
let u = e[c];
|
|
3232
3276
|
if (isSSRUnsafeAttr(c)) {
|
|
3233
3277
|
if (isDev8) {
|
|
3234
|
-
throw
|
|
3278
|
+
throw rr(32 /* unsafeAttr */ , [ c ]);
|
|
3235
3279
|
}
|
|
3236
3280
|
continue;
|
|
3237
3281
|
}
|
|
3238
|
-
if (
|
|
3282
|
+
if (hi(c)) {
|
|
3239
3283
|
u = _setEvent(this.serializationCtx, c, u, a);
|
|
3240
3284
|
} else if (c === "ref") {
|
|
3241
3285
|
const t = this.getOrCreateLastNode();
|
|
3242
|
-
if (
|
|
3243
|
-
u.
|
|
3286
|
+
if (Fu(u)) {
|
|
3287
|
+
u.Dt = new DomRef(t);
|
|
3244
3288
|
continue;
|
|
3245
3289
|
} else if (typeof u === "function") {
|
|
3246
3290
|
u(new DomRef(t));
|
|
@@ -3248,24 +3292,24 @@ var SSRContainer = class extends Cc {
|
|
|
3248
3292
|
} else if (u == null) {
|
|
3249
3293
|
continue;
|
|
3250
3294
|
} else {
|
|
3251
|
-
throw
|
|
3295
|
+
throw rr(15 /* invalidRefValue */ , [ o ]);
|
|
3252
3296
|
}
|
|
3253
|
-
} else if (c ===
|
|
3297
|
+
} else if (c === Hr || c === Qr) {
|
|
3254
3298
|
const t = this.addRoot(u);
|
|
3255
3299
|
if (t === void 0) {
|
|
3256
3300
|
continue;
|
|
3257
3301
|
}
|
|
3258
3302
|
u = typeof t === "number" ? [ t ] : String(t);
|
|
3259
|
-
} else if (
|
|
3303
|
+
} else if (Fu(u)) {
|
|
3260
3304
|
const t = this.getOrCreateLastNode();
|
|
3261
|
-
const e = new
|
|
3305
|
+
const e = new oo({
|
|
3262
3306
|
j: i,
|
|
3263
3307
|
rt: s
|
|
3264
3308
|
});
|
|
3265
3309
|
const r = u;
|
|
3266
3310
|
u = n(() => this.trackSignalValue(r, t, c, e));
|
|
3267
3311
|
}
|
|
3268
|
-
if (
|
|
3312
|
+
if (si(u)) {
|
|
3269
3313
|
const t = this.getOrCreateLastNode();
|
|
3270
3314
|
this.addPromiseAttribute(u);
|
|
3271
3315
|
u.then(e => {
|
|
@@ -3273,10 +3317,10 @@ var SSRContainer = class extends Cc {
|
|
|
3273
3317
|
});
|
|
3274
3318
|
continue;
|
|
3275
3319
|
}
|
|
3276
|
-
if (c ===
|
|
3320
|
+
if (c === ei) {
|
|
3277
3321
|
if (u) {
|
|
3278
3322
|
l = String(u);
|
|
3279
|
-
c =
|
|
3323
|
+
c = Nr;
|
|
3280
3324
|
u = "html" /* HTML */;
|
|
3281
3325
|
}
|
|
3282
3326
|
if (t === "style") {
|
|
@@ -3288,17 +3332,17 @@ var SSRContainer = class extends Cc {
|
|
|
3288
3332
|
if (t === "textarea" && c === "value") {
|
|
3289
3333
|
if (u && typeof u !== "string") {
|
|
3290
3334
|
if (isDev8) {
|
|
3291
|
-
throw
|
|
3335
|
+
throw rr(23 /* wrongTextareaValue */ , [ o, u ]);
|
|
3292
3336
|
}
|
|
3293
3337
|
continue;
|
|
3294
3338
|
}
|
|
3295
3339
|
l = escapeHTML(u || "");
|
|
3296
|
-
c =
|
|
3340
|
+
c = Nr;
|
|
3297
3341
|
u = "text" /* TEXT */;
|
|
3298
3342
|
}
|
|
3299
3343
|
const h = r(c, u, i);
|
|
3300
3344
|
if (h != null && h !== false) {
|
|
3301
|
-
this.write(
|
|
3345
|
+
this.write(Sh);
|
|
3302
3346
|
this.write(c);
|
|
3303
3347
|
if (h !== true) {
|
|
3304
3348
|
this.write(ATTR_EQUALS_QUOTE);
|
|
@@ -3308,7 +3352,7 @@ var SSRContainer = class extends Cc {
|
|
|
3308
3352
|
const t = escapeHTML(String(h));
|
|
3309
3353
|
this.write(t);
|
|
3310
3354
|
}
|
|
3311
|
-
this.write(
|
|
3355
|
+
this.write(Hi);
|
|
3312
3356
|
}
|
|
3313
3357
|
}
|
|
3314
3358
|
}
|
|
@@ -3316,15 +3360,15 @@ var SSRContainer = class extends Cc {
|
|
|
3316
3360
|
}
|
|
3317
3361
|
writeEscapedChunks(t) {
|
|
3318
3362
|
for (let e = 0; e < t.length; e++) {
|
|
3319
|
-
const
|
|
3320
|
-
if (typeof
|
|
3321
|
-
this.write(escapeHTML(
|
|
3322
|
-
} else if (typeof
|
|
3323
|
-
this.writeRootRef(
|
|
3324
|
-
} else if ("base" in
|
|
3325
|
-
this.writeRootRefDelta(
|
|
3363
|
+
const r = t[e];
|
|
3364
|
+
if (typeof r === "string") {
|
|
3365
|
+
this.write(escapeHTML(r));
|
|
3366
|
+
} else if (typeof r === "number") {
|
|
3367
|
+
this.writeRootRef(r);
|
|
3368
|
+
} else if ("base" in r) {
|
|
3369
|
+
this.writeRootRefDelta(r.id, r.base);
|
|
3326
3370
|
} else {
|
|
3327
|
-
this.writeRootRefPath(
|
|
3371
|
+
this.writeRootRefPath(r.path);
|
|
3328
3372
|
}
|
|
3329
3373
|
}
|
|
3330
3374
|
}
|
|
@@ -3343,95 +3387,105 @@ var SSRContainer = class extends Cc {
|
|
|
3343
3387
|
var SSRSegmentContainer = class extends SSRContainer {
|
|
3344
3388
|
constructor(t, e) {
|
|
3345
3389
|
super(t);
|
|
3346
|
-
this.
|
|
3390
|
+
this.Rn = e;
|
|
3347
3391
|
}
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3392
|
+
Rn;
|
|
3393
|
+
dr=0 /* Rendering */;
|
|
3394
|
+
mr=null;
|
|
3395
|
+
P=null;
|
|
3351
3396
|
subscriptionPatchRecords=[];
|
|
3352
3397
|
pendingVNodeDataPatches=null;
|
|
3353
|
-
|
|
3354
|
-
|
|
3398
|
+
nextOutOfOrderId(t = true) {
|
|
3399
|
+
return this.Rn.nextOutOfOrderId(t);
|
|
3400
|
+
}
|
|
3401
|
+
A(t) {
|
|
3402
|
+
(this.P ||= []).push(t);
|
|
3403
|
+
}
|
|
3404
|
+
emitErrorSwapExecutorIfNeeded() {
|
|
3405
|
+
this.Rn.emitErrorSwapExecutorIfNeeded();
|
|
3406
|
+
}
|
|
3407
|
+
Tn(t, e, r, n) {
|
|
3408
|
+
recordExternalRootEffect(this.Rn.serializationCtx, this.serializationCtx, this.Rn.yt, this.subscriptionPatchRecords, t, e, r, n);
|
|
3355
3409
|
}
|
|
3356
|
-
async
|
|
3357
|
-
const
|
|
3358
|
-
const
|
|
3410
|
+
async S(t, e) {
|
|
3411
|
+
const r = this.Rn;
|
|
3412
|
+
const n = r.v();
|
|
3359
3413
|
const s = this.serializationCtx;
|
|
3360
3414
|
try {
|
|
3361
|
-
const i = this.
|
|
3362
|
-
this.
|
|
3363
|
-
const o = this.
|
|
3364
|
-
if (
|
|
3365
|
-
s.
|
|
3415
|
+
const i = this.vr(r, s);
|
|
3416
|
+
this.Er(r, s);
|
|
3417
|
+
const o = this.Sr(r, n, s);
|
|
3418
|
+
if (n && (i.newRootLocalIds.length > 0 || o !== void 0)) {
|
|
3419
|
+
s.ke = r.serializationCtx.ue;
|
|
3366
3420
|
await this.emitStatePatchData(t, i.newRootStart, i.newRootLocalIds, o);
|
|
3367
|
-
|
|
3368
|
-
|
|
3421
|
+
r.serializationCtx.Te = r.serializationCtx.de.length + (r.serializationCtx.Pe ? 1 : 0);
|
|
3422
|
+
r.serializationCtx.ue += s.ue;
|
|
3369
3423
|
}
|
|
3370
3424
|
this.emitPendingVNodeDataPatches();
|
|
3371
|
-
if (
|
|
3425
|
+
if (n) {
|
|
3372
3426
|
this.t = true;
|
|
3373
3427
|
this.emitVNodeData(t);
|
|
3374
3428
|
const e = this.serializationCtx;
|
|
3375
|
-
this.serializationCtx =
|
|
3376
|
-
this.emittedSyncFnCount =
|
|
3429
|
+
this.serializationCtx = r.serializationCtx;
|
|
3430
|
+
this.emittedSyncFnCount = r.emittedSyncFnCount;
|
|
3377
3431
|
this.emitSyncFnsData(true);
|
|
3378
|
-
|
|
3432
|
+
r.emittedSyncFnCount = this.emittedSyncFnCount;
|
|
3379
3433
|
this.serializationCtx = e;
|
|
3380
3434
|
this.emitNewQwikEvents();
|
|
3381
3435
|
}
|
|
3382
3436
|
this.emitPatchDataIfNeeded();
|
|
3383
3437
|
this.drainCleanupQueue();
|
|
3384
3438
|
const a = i.rootIdMap;
|
|
3385
|
-
if (
|
|
3386
|
-
this.
|
|
3439
|
+
if (n) {
|
|
3440
|
+
this.dr = 2 /* Done */;
|
|
3387
3441
|
} else {
|
|
3388
|
-
this.
|
|
3389
|
-
this.
|
|
3442
|
+
this.mr = a;
|
|
3443
|
+
this.dr = 1 /* EarlyFinalized */;
|
|
3390
3444
|
}
|
|
3391
3445
|
return {
|
|
3392
3446
|
html: renderSSRChunks(e.htmlChunks, a),
|
|
3393
3447
|
scripts: e.writer.toString(a)
|
|
3394
3448
|
};
|
|
3395
3449
|
} finally {
|
|
3396
|
-
if (this.
|
|
3397
|
-
s.
|
|
3398
|
-
|
|
3450
|
+
if (this.dr !== 1 /* EarlyFinalized */) {
|
|
3451
|
+
s.Ne = void 0;
|
|
3452
|
+
r.removeOutOfOrderSegment(this);
|
|
3399
3453
|
}
|
|
3400
|
-
|
|
3454
|
+
r.serializationCtx.ce(r.writer);
|
|
3401
3455
|
}
|
|
3402
3456
|
}
|
|
3403
|
-
|
|
3457
|
+
pr() {
|
|
3404
3458
|
try {
|
|
3405
3459
|
this.emitVNodeData(this.vnodeSegment);
|
|
3406
3460
|
this.emitPendingVNodeDataPatches();
|
|
3407
|
-
this.
|
|
3408
|
-
this.
|
|
3409
|
-
this.
|
|
3461
|
+
this.Rn.emitOutOfOrderSegmentScripts(this.writer.toString(this.mr));
|
|
3462
|
+
this.dr = 2 /* Done */;
|
|
3463
|
+
this.Rn.removeOutOfOrderSegment(this);
|
|
3410
3464
|
} finally {
|
|
3411
|
-
this.serializationCtx.
|
|
3465
|
+
this.serializationCtx.Ne = void 0;
|
|
3412
3466
|
}
|
|
3413
3467
|
}
|
|
3414
3468
|
markVNodeDataForSerialization(t, e = 16 /* SERIALIZE */) {
|
|
3415
|
-
const
|
|
3416
|
-
const
|
|
3417
|
-
if (
|
|
3418
|
-
t.vnodeData[0] =
|
|
3419
|
-
this.queueLateVNodeDataPatch(t,
|
|
3469
|
+
const r = t.vnodeData[0];
|
|
3470
|
+
const n = r | e;
|
|
3471
|
+
if (n !== r) {
|
|
3472
|
+
t.vnodeData[0] = n;
|
|
3473
|
+
this.queueLateVNodeDataPatch(t, n & ~r);
|
|
3420
3474
|
}
|
|
3421
3475
|
}
|
|
3422
3476
|
queueLateVNodeDataPatch(t, e) {
|
|
3423
3477
|
if (!(e & (16 /* SERIALIZE */ | 8 /* REFERENCE */))) {
|
|
3424
3478
|
return;
|
|
3425
3479
|
}
|
|
3426
|
-
const
|
|
3427
|
-
if (!this.
|
|
3480
|
+
const r = this.getVNodeDataOwnerFromNodeId(t.id);
|
|
3481
|
+
if (!this.hr().isVNodeDataOwnerEmitted(r.owner)) {
|
|
3428
3482
|
return;
|
|
3429
3483
|
}
|
|
3430
|
-
let
|
|
3431
|
-
if (!
|
|
3432
|
-
this.pendingVNodeDataPatches.set(
|
|
3484
|
+
let n = (this.pendingVNodeDataPatches ||= /* @__PURE__ */ new Map).get(r.owner);
|
|
3485
|
+
if (!n) {
|
|
3486
|
+
this.pendingVNodeDataPatches.set(r.owner, n = /* @__PURE__ */ new Map);
|
|
3433
3487
|
}
|
|
3434
|
-
|
|
3488
|
+
n.set(r.localIndex, t.vnodeData);
|
|
3435
3489
|
}
|
|
3436
3490
|
emitPendingVNodeDataPatches() {
|
|
3437
3491
|
const t = this.pendingVNodeDataPatches;
|
|
@@ -3439,115 +3493,112 @@ var SSRSegmentContainer = class extends SSRContainer {
|
|
|
3439
3493
|
if (!t) {
|
|
3440
3494
|
return;
|
|
3441
3495
|
}
|
|
3442
|
-
for (const [e,
|
|
3443
|
-
if (
|
|
3496
|
+
for (const [e, r] of t) {
|
|
3497
|
+
if (r.size === 0) {
|
|
3444
3498
|
continue;
|
|
3445
3499
|
}
|
|
3446
|
-
const t = Array.from(
|
|
3500
|
+
const t = Array.from(r).sort((t, e) => t[0] - e[0]);
|
|
3447
3501
|
this.emitVNodeDataScript(e, t, true);
|
|
3448
3502
|
}
|
|
3449
3503
|
}
|
|
3450
|
-
|
|
3451
|
-
const
|
|
3452
|
-
e.
|
|
3453
|
-
this.commitSegmentRoot(t, e,
|
|
3504
|
+
vr(t, e) {
|
|
3505
|
+
const r = this.commitSegmentRoots(t, e);
|
|
3506
|
+
e.Ne = (e, n, s) => {
|
|
3507
|
+
this.commitSegmentRoot(t, e, n, s, r);
|
|
3454
3508
|
};
|
|
3455
|
-
return
|
|
3509
|
+
return r;
|
|
3456
3510
|
}
|
|
3457
|
-
|
|
3458
|
-
let
|
|
3511
|
+
Sr(t, e, r) {
|
|
3512
|
+
let n = void 0;
|
|
3459
3513
|
const s = e ? this.collectSubscriptionPatches(t, t.rootContainerSerializedRootCount) : void 0;
|
|
3460
3514
|
if (s) {
|
|
3461
|
-
|
|
3515
|
+
n = r.Rt(s);
|
|
3462
3516
|
}
|
|
3463
|
-
return
|
|
3517
|
+
return n;
|
|
3464
3518
|
}
|
|
3465
3519
|
commitSegmentRoots(t, e) {
|
|
3466
|
-
const
|
|
3467
|
-
const
|
|
3520
|
+
const r = [];
|
|
3521
|
+
const n = t.v() ? t.serializationCtx.Te : t.serializationCtx.de.length;
|
|
3468
3522
|
const s = [];
|
|
3469
3523
|
const i = {
|
|
3470
|
-
rootIdMap:
|
|
3471
|
-
newRootStart:
|
|
3524
|
+
rootIdMap: r,
|
|
3525
|
+
newRootStart: n,
|
|
3472
3526
|
newRootLocalIds: s
|
|
3473
3527
|
};
|
|
3474
3528
|
this.promoteSharedSegmentRoots(t, e, i);
|
|
3475
|
-
const o = e.
|
|
3476
|
-
const a = e.
|
|
3529
|
+
const o = e.de;
|
|
3530
|
+
const a = e.xe;
|
|
3477
3531
|
for (let e = 0; e < o.length; e++) {
|
|
3478
|
-
const
|
|
3479
|
-
this.commitSegmentRoot(t, e, o[e],
|
|
3532
|
+
const r = a[e];
|
|
3533
|
+
this.commitSegmentRoot(t, e, o[e], r, i);
|
|
3480
3534
|
}
|
|
3481
3535
|
return i;
|
|
3482
3536
|
}
|
|
3483
|
-
promoteSharedSegmentRoots(t, e,
|
|
3484
|
-
const
|
|
3485
|
-
const s = e.
|
|
3537
|
+
promoteSharedSegmentRoots(t, e, r) {
|
|
3538
|
+
const n = e.de;
|
|
3539
|
+
const s = e.xe;
|
|
3486
3540
|
for (let e = 0; e < s.length; e++) {
|
|
3487
3541
|
const i = s[e];
|
|
3488
3542
|
if (this.isRootOrUsedByOtherLiveSegment(t, i)) {
|
|
3489
|
-
this.commitSegmentRoot(t, e,
|
|
3543
|
+
this.commitSegmentRoot(t, e, n[e], i, r);
|
|
3490
3544
|
}
|
|
3491
3545
|
}
|
|
3492
3546
|
}
|
|
3493
3547
|
isRootOrUsedByOtherLiveSegment(t, e) {
|
|
3494
|
-
if (t.serializationCtx.
|
|
3548
|
+
if (t.serializationCtx.Xe(e) !== void 0) {
|
|
3495
3549
|
return true;
|
|
3496
3550
|
}
|
|
3497
|
-
const
|
|
3498
|
-
for (let t = 0; t <
|
|
3499
|
-
const
|
|
3500
|
-
if (
|
|
3551
|
+
const r = t.outOfOrderSegments;
|
|
3552
|
+
for (let t = 0; t < r.length; t++) {
|
|
3553
|
+
const n = r[t];
|
|
3554
|
+
if (n === this) {
|
|
3501
3555
|
continue;
|
|
3502
3556
|
}
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
if (s[t] === e) {
|
|
3506
|
-
return true;
|
|
3507
|
-
}
|
|
3557
|
+
if (e === e && n.serializationCtx.Xe(e) !== void 0) {
|
|
3558
|
+
return true;
|
|
3508
3559
|
}
|
|
3509
3560
|
}
|
|
3510
3561
|
return false;
|
|
3511
3562
|
}
|
|
3512
|
-
commitSegmentRoot(t, e,
|
|
3563
|
+
commitSegmentRoot(t, e, r, n, s) {
|
|
3513
3564
|
if (s.rootIdMap[e] !== void 0) {
|
|
3514
3565
|
return;
|
|
3515
3566
|
}
|
|
3516
|
-
let i = t.serializationCtx.
|
|
3567
|
+
let i = t.serializationCtx.Xe(n);
|
|
3517
3568
|
if (i === void 0) {
|
|
3518
|
-
i = t.serializationCtx.
|
|
3569
|
+
i = t.serializationCtx.Fe(r, n);
|
|
3519
3570
|
s.newRootLocalIds.push(e);
|
|
3520
|
-
this.seedCommittedRootForLiveSegments(t,
|
|
3571
|
+
this.seedCommittedRootForLiveSegments(t, n);
|
|
3521
3572
|
}
|
|
3522
3573
|
const o = t.serializationCtx;
|
|
3523
|
-
s.rootIdMap[e] = t.v() && i >= o.
|
|
3574
|
+
s.rootIdMap[e] = t.v() && i >= o.Re ? i + (o.Pe ? 1 : 0) : i;
|
|
3524
3575
|
}
|
|
3525
3576
|
seedCommittedRootForLiveSegments(t, e) {
|
|
3526
|
-
const
|
|
3527
|
-
for (let t = 0; t <
|
|
3528
|
-
const
|
|
3529
|
-
if (
|
|
3530
|
-
|
|
3577
|
+
const r = t.outOfOrderSegments;
|
|
3578
|
+
for (let t = 0; t < r.length; t++) {
|
|
3579
|
+
const n = r[t];
|
|
3580
|
+
if (n !== this && n.dr === 0 /* Rendering */) {
|
|
3581
|
+
n.serializationCtx.Rt(e);
|
|
3531
3582
|
}
|
|
3532
3583
|
}
|
|
3533
3584
|
}
|
|
3534
|
-
|
|
3535
|
-
for (const
|
|
3536
|
-
t.serializationCtx.
|
|
3585
|
+
Er(t, e) {
|
|
3586
|
+
for (const r of e.Lt) {
|
|
3587
|
+
t.serializationCtx.Lt.add(r);
|
|
3537
3588
|
}
|
|
3538
|
-
for (const
|
|
3539
|
-
t.serializationCtx.
|
|
3589
|
+
for (const r of e.Ft) {
|
|
3590
|
+
t.serializationCtx.Ft.add(r);
|
|
3540
3591
|
}
|
|
3541
3592
|
}
|
|
3542
3593
|
collectSubscriptionPatches(t, e) {
|
|
3543
3594
|
return collectSubscriptionPatches(t.serializationCtx, this.subscriptionPatchRecords, e);
|
|
3544
3595
|
}
|
|
3545
|
-
emitStatePatchData(t, e,
|
|
3596
|
+
emitStatePatchData(t, e, r, n) {
|
|
3546
3597
|
const s = this.statePatchScriptAttrs(t);
|
|
3547
3598
|
this.openScript(s);
|
|
3548
|
-
this.serializationCtx.
|
|
3549
|
-
this.serializationCtx.
|
|
3550
|
-
return
|
|
3599
|
+
this.serializationCtx.ce(this.writer);
|
|
3600
|
+
this.serializationCtx.we = this.markVNodeDataForSerialization.bind(this);
|
|
3601
|
+
return li(this.serializationCtx.je(e, r, n, 0), () => {
|
|
3551
3602
|
this.closeScript();
|
|
3552
3603
|
});
|
|
3553
3604
|
}
|
|
@@ -3555,7 +3606,7 @@ var SSRSegmentContainer = class extends SSRContainer {
|
|
|
3555
3606
|
const e = this.stateScriptAttrs();
|
|
3556
3607
|
e[QStatePatchAttr] = true;
|
|
3557
3608
|
if (t) {
|
|
3558
|
-
e[
|
|
3609
|
+
e[vr] = t;
|
|
3559
3610
|
}
|
|
3560
3611
|
return e;
|
|
3561
3612
|
}
|
|
@@ -3563,23 +3614,23 @@ var SSRSegmentContainer = class extends SSRContainer {
|
|
|
3563
3614
|
|
|
3564
3615
|
var isQwikStyleElement = (t, e) => {
|
|
3565
3616
|
if (t === "style" && e != null) {
|
|
3566
|
-
return Object.prototype.hasOwnProperty.call(e,
|
|
3617
|
+
return Object.prototype.hasOwnProperty.call(e, gr) || Object.prototype.hasOwnProperty.call(e, kr);
|
|
3567
3618
|
}
|
|
3568
3619
|
return false;
|
|
3569
3620
|
};
|
|
3570
3621
|
|
|
3571
3622
|
function newTagError(t) {
|
|
3572
|
-
return
|
|
3623
|
+
return rr(12 /* tagError */ , [ t ]);
|
|
3573
3624
|
}
|
|
3574
3625
|
|
|
3575
3626
|
function hasDestroy(t) {
|
|
3576
|
-
return t && typeof t === "object" && typeof t
|
|
3627
|
+
return t && typeof t === "object" && typeof t.$n === "function";
|
|
3577
3628
|
}
|
|
3578
3629
|
|
|
3579
3630
|
function isSSRUnsafeAttr(t) {
|
|
3580
3631
|
for (let e = 0; e < t.length; e++) {
|
|
3581
|
-
const
|
|
3582
|
-
if (
|
|
3632
|
+
const r = t.charCodeAt(e);
|
|
3633
|
+
if (r === 62 || r === 47 || r === 61 || r === 34 || r === 39 || r === 9 || r === 10 || r === 12 || r === 32) {
|
|
3583
3634
|
return true;
|
|
3584
3635
|
}
|
|
3585
3636
|
}
|
|
@@ -3591,9 +3642,9 @@ function randomStr() {
|
|
|
3591
3642
|
}
|
|
3592
3643
|
|
|
3593
3644
|
function addPreventDefaultEventToSerializationContext(t, e) {
|
|
3594
|
-
const
|
|
3595
|
-
if (
|
|
3596
|
-
t.
|
|
3645
|
+
const r = "e" + e.substring(14);
|
|
3646
|
+
if (r) {
|
|
3647
|
+
t.Lt.add(r);
|
|
3597
3648
|
}
|
|
3598
3649
|
}
|
|
3599
3650
|
|
|
@@ -3614,6 +3665,8 @@ var StreamHandler = class {
|
|
|
3614
3665
|
timing;
|
|
3615
3666
|
bufferSize=0;
|
|
3616
3667
|
buffer="";
|
|
3668
|
+
firstWriteNotified=false;
|
|
3669
|
+
onFirstWrite;
|
|
3617
3670
|
networkFlushes=0;
|
|
3618
3671
|
inOrderStreaming;
|
|
3619
3672
|
streamBlockDepth=0;
|
|
@@ -3629,7 +3682,7 @@ var StreamHandler = class {
|
|
|
3629
3682
|
let e;
|
|
3630
3683
|
switch (this.inOrderStreaming.strategy) {
|
|
3631
3684
|
case "disabled":
|
|
3632
|
-
e =
|
|
3685
|
+
e = Bi(e => {
|
|
3633
3686
|
if (e === void 0 || e === null) {
|
|
3634
3687
|
return;
|
|
3635
3688
|
}
|
|
@@ -3639,16 +3692,17 @@ var StreamHandler = class {
|
|
|
3639
3692
|
|
|
3640
3693
|
case "direct":
|
|
3641
3694
|
{
|
|
3642
|
-
const
|
|
3643
|
-
e =
|
|
3695
|
+
const r = this.nativeStream;
|
|
3696
|
+
e = Bi(e => {
|
|
3644
3697
|
if (e === void 0 || e === null) {
|
|
3645
3698
|
return;
|
|
3646
3699
|
}
|
|
3700
|
+
t.notifyFirstWrite();
|
|
3647
3701
|
if (t.pendingFlush) {
|
|
3648
|
-
const
|
|
3649
|
-
return t.trackPendingFlush(
|
|
3702
|
+
const n = t.pendingFlush.then(() => r.write(e));
|
|
3703
|
+
return t.trackPendingFlush(n);
|
|
3650
3704
|
}
|
|
3651
|
-
return t.trackPendingFlush(
|
|
3705
|
+
return t.trackPendingFlush(r.write(e));
|
|
3652
3706
|
});
|
|
3653
3707
|
break;
|
|
3654
3708
|
}
|
|
@@ -3656,15 +3710,15 @@ var StreamHandler = class {
|
|
|
3656
3710
|
default:
|
|
3657
3711
|
case "auto":
|
|
3658
3712
|
{
|
|
3659
|
-
const
|
|
3660
|
-
const
|
|
3661
|
-
e =
|
|
3713
|
+
const r = this.inOrderStreaming.maximumChunk ?? 0;
|
|
3714
|
+
const n = this.inOrderStreaming.maximumInitialChunk ?? 0;
|
|
3715
|
+
e = Bi(e => {
|
|
3662
3716
|
if (e === void 0 || e === null) {
|
|
3663
3717
|
return;
|
|
3664
3718
|
}
|
|
3665
3719
|
t.enqueue(e);
|
|
3666
3720
|
if (t.streamBlockDepth === 0) {
|
|
3667
|
-
const e = t.networkFlushes === 0 ?
|
|
3721
|
+
const e = t.networkFlushes === 0 ? n : r;
|
|
3668
3722
|
if (t.bufferSize >= e) {
|
|
3669
3723
|
return t.flush();
|
|
3670
3724
|
}
|
|
@@ -3686,7 +3740,7 @@ var StreamHandler = class {
|
|
|
3686
3740
|
}
|
|
3687
3741
|
}
|
|
3688
3742
|
trackPendingFlush(t) {
|
|
3689
|
-
if (!
|
|
3743
|
+
if (!si(t)) {
|
|
3690
3744
|
return;
|
|
3691
3745
|
}
|
|
3692
3746
|
const e = Promise.resolve(t).finally(() => {
|
|
@@ -3697,7 +3751,14 @@ var StreamHandler = class {
|
|
|
3697
3751
|
this.pendingFlush = e;
|
|
3698
3752
|
return e;
|
|
3699
3753
|
}
|
|
3754
|
+
notifyFirstWrite() {
|
|
3755
|
+
if (!this.firstWriteNotified) {
|
|
3756
|
+
this.firstWriteNotified = true;
|
|
3757
|
+
this.onFirstWrite?.();
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3700
3760
|
flushBuffer() {
|
|
3761
|
+
this.notifyFirstWrite();
|
|
3701
3762
|
const t = this.buffer;
|
|
3702
3763
|
this.buffer = "";
|
|
3703
3764
|
this.bufferSize = 0;
|
|
@@ -3749,17 +3810,17 @@ var StreamHandler = class {
|
|
|
3749
3810
|
|
|
3750
3811
|
// packages/qwik/src/server/ssr-render.ts
|
|
3751
3812
|
var renderToString = async (t, e = {}) => {
|
|
3752
|
-
const
|
|
3753
|
-
const
|
|
3813
|
+
const r = new StringSSRWriter;
|
|
3814
|
+
const n = await renderToStream(t, {
|
|
3754
3815
|
...e,
|
|
3755
|
-
stream:
|
|
3816
|
+
stream: r
|
|
3756
3817
|
});
|
|
3757
3818
|
return {
|
|
3758
|
-
isStatic:
|
|
3759
|
-
timing:
|
|
3760
|
-
manifest:
|
|
3761
|
-
snapshotResult:
|
|
3762
|
-
html:
|
|
3819
|
+
isStatic: n.isStatic,
|
|
3820
|
+
timing: n.timing,
|
|
3821
|
+
manifest: n.manifest,
|
|
3822
|
+
snapshotResult: n.snapshotResult,
|
|
3823
|
+
html: r.toString()
|
|
3763
3824
|
};
|
|
3764
3825
|
};
|
|
3765
3826
|
|
|
@@ -3773,59 +3834,66 @@ var renderToStream = async (t, e) => {
|
|
|
3773
3834
|
}
|
|
3774
3835
|
};
|
|
3775
3836
|
}
|
|
3776
|
-
const
|
|
3837
|
+
const r = {
|
|
3777
3838
|
firstFlush: 0,
|
|
3778
3839
|
render: 0,
|
|
3779
3840
|
snapshot: 0
|
|
3780
3841
|
};
|
|
3781
|
-
const
|
|
3842
|
+
const n = e.containerTagName ?? "html";
|
|
3782
3843
|
const s = getBuildBase(e);
|
|
3783
3844
|
const i = resolveManifest(e.manifest);
|
|
3784
3845
|
const o = typeof e.locale === "function" ? e.locale(e) : e.serverData?.locale || e.locale || e.containerAttributes?.locale || "";
|
|
3785
|
-
const a = new StreamHandler(e,
|
|
3846
|
+
const a = new StreamHandler(e, r);
|
|
3786
3847
|
const l = ssrCreateContainer({
|
|
3787
|
-
tagName:
|
|
3848
|
+
tagName: n,
|
|
3788
3849
|
locale: o,
|
|
3789
3850
|
writer: a.stream,
|
|
3790
3851
|
streamHandler: a,
|
|
3791
|
-
timing:
|
|
3852
|
+
timing: r,
|
|
3792
3853
|
buildBase: s,
|
|
3793
3854
|
resolvedManifest: i,
|
|
3794
3855
|
renderOptions: e
|
|
3795
3856
|
});
|
|
3857
|
+
const c = e.onBeforeFirstFlush;
|
|
3858
|
+
if (c) {
|
|
3859
|
+
a.onFirstWrite = () => c({
|
|
3860
|
+
errorBoundaryCaught: l.Nt === true
|
|
3861
|
+
});
|
|
3862
|
+
}
|
|
3796
3863
|
await setServerPlatform(e, i);
|
|
3797
3864
|
await l.render(t);
|
|
3798
3865
|
await l.l;
|
|
3799
3866
|
await a.flush();
|
|
3800
|
-
const
|
|
3867
|
+
const u = {
|
|
3801
3868
|
flushes: a.networkFlushes,
|
|
3802
3869
|
manifest: i?.manifest,
|
|
3803
3870
|
size: l.size,
|
|
3804
3871
|
isStatic: false,
|
|
3805
|
-
timing:
|
|
3872
|
+
timing: r,
|
|
3873
|
+
errorBoundaryCaught: l.Nt === true
|
|
3806
3874
|
};
|
|
3807
|
-
return
|
|
3875
|
+
return u;
|
|
3808
3876
|
};
|
|
3809
3877
|
|
|
3810
3878
|
function resolveManifest(t) {
|
|
3811
|
-
const e =
|
|
3812
|
-
const
|
|
3879
|
+
const e = Ya();
|
|
3880
|
+
const r = t ? {
|
|
3813
3881
|
...e,
|
|
3814
3882
|
...t
|
|
3815
3883
|
} : e;
|
|
3816
|
-
if (!
|
|
3817
|
-
return
|
|
3884
|
+
if (!r || "mapper" in r) {
|
|
3885
|
+
return r;
|
|
3818
3886
|
}
|
|
3819
|
-
if (
|
|
3887
|
+
if (r.mapping) {
|
|
3820
3888
|
const t = {};
|
|
3821
|
-
for (const e in
|
|
3822
|
-
const
|
|
3823
|
-
t[
|
|
3889
|
+
for (const e in r.mapping) {
|
|
3890
|
+
const n = r.mapping[e];
|
|
3891
|
+
t[Nd(e)] = [ e, n ];
|
|
3824
3892
|
}
|
|
3825
3893
|
return {
|
|
3826
3894
|
mapper: t,
|
|
3827
|
-
manifest:
|
|
3828
|
-
injections:
|
|
3895
|
+
manifest: r,
|
|
3896
|
+
injections: r.injections || []
|
|
3829
3897
|
};
|
|
3830
3898
|
}
|
|
3831
3899
|
return void 0;
|
|
@@ -3835,7 +3903,7 @@ var Q_FUNCS_PREFIX = 'document["qFuncs_HASH"]=';
|
|
|
3835
3903
|
|
|
3836
3904
|
// packages/qwik/src/server/index.ts
|
|
3837
3905
|
async function setServerPlatform2(t) {
|
|
3838
|
-
const e =
|
|
3906
|
+
const e = Ei({
|
|
3839
3907
|
manifest: t
|
|
3840
3908
|
}, resolveManifest(t));
|
|
3841
3909
|
setPlatform2(e);
|