@qwik.dev/core 2.0.0-beta.34 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backpatch/index.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +2 -1
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +26 -22
- package/dist/core-internal.d.ts +244 -34
- package/dist/core.min.mjs +8 -2
- package/dist/core.mjs +2309 -1028
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4872 -3877
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +2 -6
- package/dist/optimizer.mjs +2407 -1580
- package/dist/out-of-order-executor.debug.js +163 -0
- package/dist/out-of-order-executor.js +1 -0
- package/dist/preloader.mjs +1 -268
- package/dist/qwikloader.debug.js +47 -26
- package/dist/qwikloader.js +1 -1
- package/dist/server-modules.d.ts +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.mjs +1238 -272
- package/dist/server.prod.mjs +1313 -558
- package/dist/testing/index.d.ts +76 -20
- package/dist/testing/index.mjs +3317 -1408
- package/dist/testing/package.json +1 -1
- package/dist/worker/index.d.mts +21 -0
- package/dist/worker/index.mjs +318 -0
- package/dist/worker/package.json +9 -0
- package/dist/worker/worker.js +13 -0
- package/dist/worker/worker.node.js +15 -0
- package/dist/worker/worker.shared.js +63 -0
- package/handlers.mjs +18 -1
- package/package.json +11 -5
- package/public.d.ts +6 -0
- package/worker.d.ts +2 -0
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.36-dev+3268fab
|
|
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,48 +9,46 @@
|
|
|
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 Bs } from "@qwik.dev/core";
|
|
13
13
|
|
|
14
|
-
import { isDev as
|
|
14
|
+
import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
15
15
|
|
|
16
16
|
// packages/qwik/src/core/client/util-mapArray.ts
|
|
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 me } from "@qwik.dev/core/build";
|
|
21
21
|
|
|
22
22
|
// packages/qwik/src/core/shared/utils/qdev.ts
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var re = ee.qDev !== false;
|
|
23
|
+
var qDev = globalThis.qDev !== false;
|
|
26
24
|
|
|
27
|
-
var qInspector =
|
|
25
|
+
var qInspector = globalThis.qInspector === true;
|
|
28
26
|
|
|
29
|
-
var
|
|
27
|
+
var qDynamicPlatform = globalThis.qDynamicPlatform !== false;
|
|
30
28
|
|
|
31
|
-
var
|
|
29
|
+
var qTest = globalThis.qTest === true;
|
|
32
30
|
|
|
33
|
-
var
|
|
31
|
+
var qRuntimeQrl = globalThis.qRuntimeQrl === true;
|
|
34
32
|
|
|
35
33
|
// packages/qwik/src/core/shared/utils/log.ts
|
|
36
|
-
var
|
|
34
|
+
var STYLE = qDev ? `background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;` : "";
|
|
37
35
|
|
|
38
36
|
var throwErrorAndStop = (e, ...t) => {
|
|
39
|
-
const n =
|
|
37
|
+
const n = be(false, e, ...t);
|
|
40
38
|
debugger;
|
|
41
39
|
throw n;
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
var logErrorAndStop = (e, ...t) => {
|
|
45
|
-
const n =
|
|
43
|
+
const n = be(qDev, e, ...t);
|
|
46
44
|
debugger;
|
|
47
45
|
return n;
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
var
|
|
48
|
+
var be = (e, t, ...n) => {
|
|
51
49
|
const r = t instanceof Error ? t : new Error(t);
|
|
52
|
-
!
|
|
53
|
-
e && !
|
|
50
|
+
!qTest && console.error("%cQWIK ERROR", STYLE, r.message, ...n, r.stack);
|
|
51
|
+
e && !qTest && setTimeout(() => {
|
|
54
52
|
throw r;
|
|
55
53
|
}, 0);
|
|
56
54
|
return r;
|
|
@@ -60,7 +58,7 @@ var he = (e, t, ...n) => {
|
|
|
60
58
|
var ASSERT_DISCLAIMER = "Internal assert, this is likely caused by a bug in Qwik: ";
|
|
61
59
|
|
|
62
60
|
function assertTrue(e, t, ...n) {
|
|
63
|
-
if (
|
|
61
|
+
if (me) {
|
|
64
62
|
if (e === true) {
|
|
65
63
|
return;
|
|
66
64
|
}
|
|
@@ -69,7 +67,7 @@ function assertTrue(e, t, ...n) {
|
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
// packages/qwik/src/core/client/util-mapArray.ts
|
|
72
|
-
var
|
|
70
|
+
var ve = (e, t, n) => {
|
|
73
71
|
isDev2 && assertTrue(n % 2 === 0, "Expecting even number.");
|
|
74
72
|
let r = n >> 1;
|
|
75
73
|
let s = e.length - 2 >> 1;
|
|
@@ -88,8 +86,8 @@ var de = (e, t, n) => {
|
|
|
88
86
|
return r << 1 ^ -1;
|
|
89
87
|
};
|
|
90
88
|
|
|
91
|
-
var
|
|
92
|
-
const i =
|
|
89
|
+
var _e = (e, t, n, r, s = false) => {
|
|
90
|
+
const i = ve(e, t, r);
|
|
93
91
|
if (i >= 0) {
|
|
94
92
|
if (n == null && !s) {
|
|
95
93
|
e.splice(i, 2);
|
|
@@ -102,7 +100,7 @@ var pe = (e, t, n, r, s = false) => {
|
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
var mapApp_remove = (e, t, n) => {
|
|
105
|
-
const r =
|
|
103
|
+
const r = ve(e, t, n);
|
|
106
104
|
let s = null;
|
|
107
105
|
if (r >= 0) {
|
|
108
106
|
s = e[r + 1];
|
|
@@ -112,8 +110,8 @@ var mapApp_remove = (e, t, n) => {
|
|
|
112
110
|
return s;
|
|
113
111
|
};
|
|
114
112
|
|
|
115
|
-
var
|
|
116
|
-
const r =
|
|
113
|
+
var ge = (e, t, n) => {
|
|
114
|
+
const r = ve(e, t, n);
|
|
117
115
|
if (r >= 0) {
|
|
118
116
|
return e[r + 1];
|
|
119
117
|
} else {
|
|
@@ -121,20 +119,23 @@ var $e = (e, t, n) => {
|
|
|
121
119
|
}
|
|
122
120
|
};
|
|
123
121
|
|
|
124
|
-
var
|
|
122
|
+
var Ee = (e, t, n) => ve(e, t, n) >= 0;
|
|
123
|
+
|
|
124
|
+
// packages/qwik/src/core/shared/error/error.ts
|
|
125
|
+
import { isDev as isDev3 } from "@qwik.dev/core/build";
|
|
125
126
|
|
|
126
127
|
// packages/qwik/src/core/shared/utils/types.ts
|
|
127
|
-
var
|
|
128
|
+
var ke = e => typeof e === "object" && e !== null;
|
|
128
129
|
|
|
129
|
-
var
|
|
130
|
+
var Re = e => Array.isArray(e);
|
|
130
131
|
|
|
131
|
-
var
|
|
132
|
+
var Pe = e => typeof e === "string";
|
|
132
133
|
|
|
133
134
|
// packages/qwik/src/core/shared/error/error.ts
|
|
134
135
|
var baseUrl = "https://qwikdev-build-v2.qwik-8nx.pages.dev/docs/errors/#q";
|
|
135
136
|
|
|
136
137
|
var codeToText = (e, ...t) => {
|
|
137
|
-
if (
|
|
138
|
+
if (isDev3) {
|
|
138
139
|
const n = [ "Error while serializing class or style attributes",
|
|
139
140
|
// 0
|
|
140
141
|
"Scheduler not found",
|
|
@@ -210,7 +211,7 @@ var codeToText = (e, ...t) => {
|
|
|
210
211
|
if (t.length) {
|
|
211
212
|
r = r.replaceAll(/{{(\d+)}}/g, (e, n) => {
|
|
212
213
|
let r = t[n];
|
|
213
|
-
if (r &&
|
|
214
|
+
if (r && ke(r) && r.constructor === Object) {
|
|
214
215
|
r = JSON.stringify(r).slice(0, 50);
|
|
215
216
|
}
|
|
216
217
|
return r;
|
|
@@ -222,23 +223,18 @@ var codeToText = (e, ...t) => {
|
|
|
222
223
|
}
|
|
223
224
|
};
|
|
224
225
|
|
|
225
|
-
var
|
|
226
|
+
var qe = (e, t = []) => {
|
|
226
227
|
const n = codeToText(e, ...t);
|
|
227
228
|
return logErrorAndStop(n, ...t);
|
|
228
229
|
};
|
|
229
230
|
|
|
230
231
|
// packages/qwik/src/core/shared/qrl/qrl-utils.ts
|
|
231
|
-
import { isDev as
|
|
232
|
-
|
|
233
|
-
var ke = "<sync>";
|
|
232
|
+
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
234
233
|
|
|
235
|
-
var
|
|
236
|
-
const t = e.lastIndexOf("_") + 1;
|
|
237
|
-
return e.slice(t);
|
|
238
|
-
};
|
|
234
|
+
var Me = "<sync>";
|
|
239
235
|
|
|
240
236
|
// packages/qwik/src/core/shared/types.ts
|
|
241
|
-
var
|
|
237
|
+
var xe = "q:type";
|
|
242
238
|
|
|
243
239
|
// packages/qwik/src/core/shared/vnode-data-types.ts
|
|
244
240
|
var VNodeDataSeparator = {
|
|
@@ -410,6 +406,12 @@ var VNodeDataChar = {
|
|
|
410
406
|
/* ******* */ "~"
|
|
411
407
|
};
|
|
412
408
|
|
|
409
|
+
var je = (e, t) => {
|
|
410
|
+
const n = parseInt(e, 10) - 1;
|
|
411
|
+
const r = n + t;
|
|
412
|
+
return -(r * (r + 1) / 2 + t + 1);
|
|
413
|
+
};
|
|
414
|
+
|
|
413
415
|
// packages/qwik/src/core/shared/utils/character-escaping.ts
|
|
414
416
|
function escapeHTML(e) {
|
|
415
417
|
let t = "";
|
|
@@ -461,26 +463,62 @@ function encodeVNodeDataString(e) {
|
|
|
461
463
|
}
|
|
462
464
|
}
|
|
463
465
|
|
|
466
|
+
function encodeVNodeDataKey(e) {
|
|
467
|
+
const t = encodeURI(e);
|
|
468
|
+
let n = "";
|
|
469
|
+
const r = t.length;
|
|
470
|
+
let s = 0;
|
|
471
|
+
let i = s;
|
|
472
|
+
for (;s < r; s++) {
|
|
473
|
+
const e = t.charCodeAt(s);
|
|
474
|
+
let r = null;
|
|
475
|
+
if (e === 59) {
|
|
476
|
+
r = "%3B";
|
|
477
|
+
} else if (e === 61) {
|
|
478
|
+
r = "%3D";
|
|
479
|
+
} else if (e === 63) {
|
|
480
|
+
r = "%3F";
|
|
481
|
+
} else if (e === 64) {
|
|
482
|
+
r = "%40";
|
|
483
|
+
} else if (e === 126) {
|
|
484
|
+
r = "%7E";
|
|
485
|
+
} else {
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
n += t.substring(i, s) + r;
|
|
489
|
+
i = s + 1;
|
|
490
|
+
}
|
|
491
|
+
if (i === 0) {
|
|
492
|
+
return t;
|
|
493
|
+
} else {
|
|
494
|
+
return n + t.substring(i);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
464
498
|
// packages/qwik/src/core/shared/utils/markers.ts
|
|
465
|
-
var
|
|
499
|
+
var Le = "q:renderFn";
|
|
466
500
|
|
|
467
|
-
var
|
|
501
|
+
var De = "q:slot";
|
|
468
502
|
|
|
469
503
|
var QSlotParent = "q:sparent";
|
|
470
504
|
|
|
471
|
-
var
|
|
505
|
+
var QStatePatchAttr = "q:patch";
|
|
506
|
+
|
|
507
|
+
var kh = "q:r";
|
|
472
508
|
|
|
473
|
-
var
|
|
509
|
+
var Ue = "q:style";
|
|
510
|
+
|
|
511
|
+
var ze = "style[q\\:style]";
|
|
474
512
|
|
|
475
513
|
var QStyleSSelector = "style[q\\:sstyle]";
|
|
476
514
|
|
|
477
|
-
var
|
|
515
|
+
var Be = ze + "," + QStyleSSelector;
|
|
478
516
|
|
|
479
|
-
var
|
|
517
|
+
var He = "q:sstyle";
|
|
480
518
|
|
|
481
|
-
var
|
|
519
|
+
var Je = "q:ctx";
|
|
482
520
|
|
|
483
|
-
var
|
|
521
|
+
var Qe = "q:brefs";
|
|
484
522
|
|
|
485
523
|
var QRenderAttr = "q:render";
|
|
486
524
|
|
|
@@ -488,7 +526,7 @@ var QRuntimeAttr = "q:runtime";
|
|
|
488
526
|
|
|
489
527
|
var QVersionAttr = "q:version";
|
|
490
528
|
|
|
491
|
-
var
|
|
529
|
+
var Ge = "q:base";
|
|
492
530
|
|
|
493
531
|
var QLocaleAttr = "q:locale";
|
|
494
532
|
|
|
@@ -496,72 +534,74 @@ var QManifestHashAttr = "q:manifest-hash";
|
|
|
496
534
|
|
|
497
535
|
var QInstanceAttr = "q:instance";
|
|
498
536
|
|
|
499
|
-
var
|
|
537
|
+
var Ke = "q:container-island";
|
|
500
538
|
|
|
501
|
-
var
|
|
539
|
+
var Ze = "/" + Ke;
|
|
502
540
|
|
|
503
|
-
var
|
|
541
|
+
var ts = "q:ignore";
|
|
504
542
|
|
|
505
|
-
var
|
|
543
|
+
var ns = "/" + ts;
|
|
506
544
|
|
|
507
|
-
var
|
|
545
|
+
var es = "q:container";
|
|
508
546
|
|
|
509
|
-
var
|
|
547
|
+
var ss = "/" + es;
|
|
510
548
|
|
|
511
|
-
var
|
|
549
|
+
var is = "q:template";
|
|
512
550
|
|
|
513
|
-
var
|
|
551
|
+
var os = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
|
|
514
552
|
|
|
515
|
-
var
|
|
553
|
+
var QDefaultSlot = "";
|
|
516
554
|
|
|
517
|
-
var
|
|
555
|
+
var as = "q:id";
|
|
518
556
|
|
|
519
|
-
var
|
|
557
|
+
var hs = "q:key";
|
|
520
558
|
|
|
521
|
-
var
|
|
559
|
+
var ds = "q:props";
|
|
522
560
|
|
|
523
|
-
var
|
|
561
|
+
var ps = "q:seq";
|
|
524
562
|
|
|
525
|
-
var
|
|
563
|
+
var $s = "q:seqIdx";
|
|
526
564
|
|
|
527
565
|
var ELEMENT_BACKPATCH_DATA = "qwik/backpatch";
|
|
528
566
|
|
|
529
|
-
var
|
|
567
|
+
var ys = "q:p";
|
|
568
|
+
|
|
569
|
+
var ms = "q:ps";
|
|
530
570
|
|
|
531
|
-
var
|
|
571
|
+
var ws = ":";
|
|
532
572
|
|
|
533
|
-
var
|
|
573
|
+
var bs = ws + "on";
|
|
534
574
|
|
|
535
|
-
var
|
|
575
|
+
var vs = ws + "onIdx";
|
|
536
576
|
|
|
537
|
-
var
|
|
577
|
+
var _s = ws + "onFlags";
|
|
538
578
|
|
|
539
|
-
var
|
|
579
|
+
var gs = ws + "nearestCursorBoundary";
|
|
540
580
|
|
|
541
|
-
var
|
|
581
|
+
var Es = ":";
|
|
542
582
|
|
|
543
|
-
var
|
|
583
|
+
var Ss = "dangerouslySetInnerHTML";
|
|
544
584
|
|
|
545
585
|
// packages/qwik/src/core/shared/utils/promises.ts
|
|
546
|
-
import { isDev as
|
|
586
|
+
import { isDev as isDev5, isServer as $e } from "@qwik.dev/core/build";
|
|
547
587
|
|
|
548
|
-
var
|
|
588
|
+
var Rs = 100;
|
|
549
589
|
|
|
550
|
-
var
|
|
590
|
+
var Ps = e => !!e && typeof e == "object" && typeof e.then === "function";
|
|
551
591
|
|
|
552
|
-
var
|
|
592
|
+
var qs = (e, t) => Ps(e) ? e.then(t) : t(e);
|
|
553
593
|
|
|
554
594
|
var checkError = e => {
|
|
555
|
-
if (
|
|
595
|
+
if ($e && e instanceof ReferenceError && e.message.includes("window")) {
|
|
556
596
|
e.message = 'It seems like you forgot to add "if (isBrowser) {...}" here:' + e.message;
|
|
557
597
|
}
|
|
558
598
|
};
|
|
559
599
|
|
|
560
|
-
var
|
|
600
|
+
var Ms = e => {
|
|
561
601
|
throw e;
|
|
562
602
|
};
|
|
563
603
|
|
|
564
|
-
function n(e, t =
|
|
604
|
+
function n(e, t = Ms) {
|
|
565
605
|
let n = false;
|
|
566
606
|
let r;
|
|
567
607
|
try {
|
|
@@ -570,21 +610,21 @@ function n(e, t = mr) {
|
|
|
570
610
|
} catch (e) {
|
|
571
611
|
r = e;
|
|
572
612
|
}
|
|
573
|
-
if (!
|
|
613
|
+
if (!Ps(r)) {
|
|
574
614
|
if (n) {
|
|
575
615
|
return r;
|
|
576
616
|
}
|
|
577
|
-
|
|
617
|
+
isDev5 && checkError(r);
|
|
578
618
|
return t(r);
|
|
579
619
|
}
|
|
580
|
-
let s =
|
|
620
|
+
let s = Rs;
|
|
581
621
|
const i = async n => {
|
|
582
|
-
while (
|
|
622
|
+
while (Ps(n)) {
|
|
583
623
|
try {
|
|
584
624
|
await n;
|
|
585
625
|
return await e();
|
|
586
626
|
} catch (e) {
|
|
587
|
-
if (
|
|
627
|
+
if (Ps(e)) {
|
|
588
628
|
if (! --s) {
|
|
589
629
|
n = new Error("Exceeded max retry count in retryOnPromise");
|
|
590
630
|
break;
|
|
@@ -597,7 +637,7 @@ function n(e, t = mr) {
|
|
|
597
637
|
}
|
|
598
638
|
}
|
|
599
639
|
}
|
|
600
|
-
|
|
640
|
+
isDev5 && checkError(n);
|
|
601
641
|
return t(n);
|
|
602
642
|
};
|
|
603
643
|
return n ? r.catch(i) : i(r);
|
|
@@ -613,34 +653,34 @@ function convertStyleIdsToString(e) {
|
|
|
613
653
|
}
|
|
614
654
|
|
|
615
655
|
// packages/qwik/src/core/shared/utils/event-names.ts
|
|
616
|
-
var
|
|
656
|
+
var Is = e => e.charCodeAt(0) === 113 && e.charCodeAt(1) === 45 && (e.charCodeAt(3) === 58 || e.charCodeAt(3) === 112 && e.charCodeAt(4) === 58);
|
|
617
657
|
|
|
618
658
|
function isPreventDefault(e) {
|
|
619
659
|
return e.startsWith("preventdefault:");
|
|
620
660
|
}
|
|
621
661
|
|
|
622
662
|
// packages/qwik/src/core/shared/utils/unitless_number.ts
|
|
623
|
-
var
|
|
663
|
+
var js = /* @__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",
|
|
624
664
|
// Known Prefixed Properties
|
|
625
665
|
"MozBoxFlex",
|
|
626
666
|
// TODO: Remove these since they shouldn't be used in modern code
|
|
627
667
|
"msFlex", "msFlexPositive", "WebkitAnimationIterationCount", "WebkitBoxFlex", "WebkitBoxOrdinalGroup", "WebkitColumnCount", "WebkitColumns", "WebkitFlex", "WebkitFlexGrow", "WebkitFlexShrink", "WebkitLineClamp" ]);
|
|
628
668
|
|
|
629
|
-
var isUnitlessNumber = e =>
|
|
669
|
+
var isUnitlessNumber = e => js.has(e);
|
|
630
670
|
|
|
631
671
|
// packages/qwik/src/core/shared/utils/styles.ts
|
|
632
|
-
var
|
|
672
|
+
var Fs = e => {
|
|
633
673
|
if (!e) {
|
|
634
674
|
return "";
|
|
635
675
|
}
|
|
636
|
-
if (
|
|
676
|
+
if (Pe(e)) {
|
|
637
677
|
return e.trim();
|
|
638
678
|
}
|
|
639
679
|
const t = [];
|
|
640
|
-
if (
|
|
680
|
+
if (Re(e)) {
|
|
641
681
|
for (let n = 0; n < e.length; n++) {
|
|
642
682
|
const r = e[n];
|
|
643
|
-
const s =
|
|
683
|
+
const s = Fs(r);
|
|
644
684
|
if (s) {
|
|
645
685
|
t.push(s);
|
|
646
686
|
}
|
|
@@ -655,15 +695,15 @@ var qr = e => {
|
|
|
655
695
|
return t.join(" ");
|
|
656
696
|
};
|
|
657
697
|
|
|
658
|
-
var
|
|
698
|
+
var Xs = e => e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
659
699
|
|
|
660
700
|
var stringifyStyle = e => {
|
|
661
701
|
if (e == null) {
|
|
662
702
|
return "";
|
|
663
703
|
}
|
|
664
704
|
if (typeof e == "object") {
|
|
665
|
-
if (
|
|
666
|
-
throw
|
|
705
|
+
if (Re(e)) {
|
|
706
|
+
throw qe(0 /* stringifyClassOrStyle */ , [ e, "style" ]);
|
|
667
707
|
} else {
|
|
668
708
|
const t = [];
|
|
669
709
|
for (const n in e) {
|
|
@@ -673,7 +713,7 @@ var stringifyStyle = e => {
|
|
|
673
713
|
if (n.startsWith("--")) {
|
|
674
714
|
t.push(n + ":" + r);
|
|
675
715
|
} else {
|
|
676
|
-
t.push(
|
|
716
|
+
t.push(Xs(n) + ":" + Ds(n, r));
|
|
677
717
|
}
|
|
678
718
|
}
|
|
679
719
|
}
|
|
@@ -686,9 +726,9 @@ var stringifyStyle = e => {
|
|
|
686
726
|
|
|
687
727
|
var serializeBooleanOrNumberAttribute = e => e != null ? String(e) : null;
|
|
688
728
|
|
|
689
|
-
function
|
|
729
|
+
function s(e, t, n) {
|
|
690
730
|
if (isClassAttr(e)) {
|
|
691
|
-
const e =
|
|
731
|
+
const e = Fs(t);
|
|
692
732
|
t = n ? n + (e.length ? " " + e : e) : e;
|
|
693
733
|
} else if (e === "style") {
|
|
694
734
|
t = stringifyStyle(t);
|
|
@@ -706,7 +746,7 @@ function isEnumeratedBooleanAttribute(e) {
|
|
|
706
746
|
return isAriaAttribute(e) || [ "spellcheck", "draggable", "contenteditable" ].includes(e);
|
|
707
747
|
}
|
|
708
748
|
|
|
709
|
-
var
|
|
749
|
+
var Ds = (e, t) => {
|
|
710
750
|
if (typeof t === "number" && t !== 0 && !isUnitlessNumber(e)) {
|
|
711
751
|
return t + "px";
|
|
712
752
|
}
|
|
@@ -717,69 +757,11 @@ function isAriaAttribute(e) {
|
|
|
717
757
|
return e.startsWith("aria-");
|
|
718
758
|
}
|
|
719
759
|
|
|
720
|
-
// packages/qwik/src/core/preloader/bundle-graph.ts
|
|
721
|
-
import { isServer as isServer3 } from "@qwik.dev/core/build";
|
|
722
|
-
|
|
723
|
-
// packages/qwik/src/core/shared/platform/platform.ts
|
|
724
|
-
import { isServer as isServer2 } from "@qwik.dev/core/build";
|
|
725
|
-
|
|
726
|
-
var Er = () => ({
|
|
727
|
-
isServer: isServer2,
|
|
728
|
-
importSymbol(e, t, n) {
|
|
729
|
-
if (isServer2) {
|
|
730
|
-
const e = Na(n);
|
|
731
|
-
const t = globalThis.__qwik_reg_symbols?.get(e);
|
|
732
|
-
if (t) {
|
|
733
|
-
return t;
|
|
734
|
-
}
|
|
735
|
-
throw Se(6 /* dynamicImportFailed */ , [ n ]);
|
|
736
|
-
}
|
|
737
|
-
if (!t) {
|
|
738
|
-
throw Se(14 /* qrlMissingChunk */ , [ n ]);
|
|
739
|
-
}
|
|
740
|
-
if (!e) {
|
|
741
|
-
throw Se(13 /* qrlMissingContainer */ , [ t, n ]);
|
|
742
|
-
}
|
|
743
|
-
const r = Cr(e.ownerDocument, e, t).toString();
|
|
744
|
-
const s = new URL(r);
|
|
745
|
-
s.hash = "";
|
|
746
|
-
const i = s.href;
|
|
747
|
-
return import(
|
|
748
|
-
/* @vite-ignore */
|
|
749
|
-
i).then(e => e[n]);
|
|
750
|
-
},
|
|
751
|
-
raf: e => new Promise(t => {
|
|
752
|
-
requestAnimationFrame(() => {
|
|
753
|
-
t(e());
|
|
754
|
-
});
|
|
755
|
-
}),
|
|
756
|
-
chunkForSymbol(e, t) {
|
|
757
|
-
return [ e, t ?? "_" ];
|
|
758
|
-
}
|
|
759
|
-
});
|
|
760
|
-
|
|
761
|
-
var Cr = (e, t, n) => {
|
|
762
|
-
const r = e.baseURI;
|
|
763
|
-
const s = new URL(t.getAttribute(ze) ?? r, r);
|
|
764
|
-
return new URL(n, s);
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
var Tr = /* @__PURE__ */ Er();
|
|
768
|
-
|
|
769
|
-
var Or = () => {
|
|
770
|
-
if (ie) {
|
|
771
|
-
return Tr.isServer;
|
|
772
|
-
}
|
|
773
|
-
return false;
|
|
774
|
-
};
|
|
775
|
-
|
|
776
760
|
// packages/qwik/src/core/preloader/bundle-graph.ts
|
|
777
761
|
var base;
|
|
778
762
|
|
|
779
763
|
var graph;
|
|
780
764
|
|
|
781
|
-
var Mr = import.meta.env.TEST ? !Or() : !isServer3;
|
|
782
|
-
|
|
783
765
|
var parseBundleGraph = e => {
|
|
784
766
|
const t = /* @__PURE__ */ new Map;
|
|
785
767
|
let n = 0;
|
|
@@ -793,9 +775,9 @@ var parseBundleGraph = e => {
|
|
|
793
775
|
o = -i / 10;
|
|
794
776
|
} else {
|
|
795
777
|
s.push({
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
778
|
+
Wt: e[i],
|
|
779
|
+
Yt: o,
|
|
780
|
+
Gt: 1
|
|
799
781
|
});
|
|
800
782
|
}
|
|
801
783
|
n++;
|
|
@@ -814,7 +796,7 @@ var initPreloader = e => {
|
|
|
814
796
|
};
|
|
815
797
|
|
|
816
798
|
// packages/qwik/src/core/shared/utils/objects.ts
|
|
817
|
-
var
|
|
799
|
+
var hr = e => {
|
|
818
800
|
for (const t in e) {
|
|
819
801
|
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
820
802
|
return false;
|
|
@@ -823,6 +805,29 @@ var ti = e => {
|
|
|
823
805
|
return true;
|
|
824
806
|
};
|
|
825
807
|
|
|
808
|
+
// packages/qwik/src/core/ssr/stream-writer.ts
|
|
809
|
+
var stringifyRootRefPath = e => {
|
|
810
|
+
let t = String(e[0]);
|
|
811
|
+
for (let n = 1; n < e.length; n++) {
|
|
812
|
+
t += " " + e[n];
|
|
813
|
+
}
|
|
814
|
+
return t;
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
var writeStringRootRef = (e, t) => e.write(String(t));
|
|
818
|
+
|
|
819
|
+
var writeStringRootRefPath = (e, t) => e.write(stringifyRootRefPath(t));
|
|
820
|
+
|
|
821
|
+
var dr = e => ({
|
|
822
|
+
write: e,
|
|
823
|
+
writeRootRef(e) {
|
|
824
|
+
return writeStringRootRef(this, e);
|
|
825
|
+
},
|
|
826
|
+
writeRootRefPath(e) {
|
|
827
|
+
return writeStringRootRefPath(this, e);
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
|
|
826
831
|
// packages/qwik/src/core/shared/ssr-const.ts
|
|
827
832
|
var LT = "<";
|
|
828
833
|
|
|
@@ -830,21 +835,21 @@ var GT = ">";
|
|
|
830
835
|
|
|
831
836
|
var CLOSE_TAG = "</";
|
|
832
837
|
|
|
833
|
-
var
|
|
838
|
+
var va = " ";
|
|
834
839
|
|
|
835
840
|
var ATTR_EQUALS_QUOTE = '="';
|
|
836
841
|
|
|
837
|
-
var
|
|
842
|
+
var pr = '"';
|
|
838
843
|
|
|
839
844
|
var EMPTY_ATTR = '=""';
|
|
840
845
|
|
|
841
|
-
var
|
|
846
|
+
var $r = "[";
|
|
842
847
|
|
|
843
|
-
var
|
|
848
|
+
var yr = "]";
|
|
844
849
|
|
|
845
850
|
var PAREN_CLOSE = ")";
|
|
846
851
|
|
|
847
|
-
var
|
|
852
|
+
var mr = ",";
|
|
848
853
|
|
|
849
854
|
// packages/qwik/src/server/platform.ts
|
|
850
855
|
var getDevSegmentPath = (e, t, n, r) => {
|
|
@@ -852,28 +857,28 @@ var getDevSegmentPath = (e, t, n, r) => {
|
|
|
852
857
|
if (s) {
|
|
853
858
|
return s;
|
|
854
859
|
}
|
|
855
|
-
if (n ===
|
|
860
|
+
if (n === Me) {
|
|
856
861
|
return [ n, "" ];
|
|
857
862
|
}
|
|
858
863
|
if (!r) {
|
|
859
864
|
if (n.startsWith("_") && n.length < 6) {
|
|
860
|
-
return [ n, `${import.meta.env
|
|
865
|
+
return [ n, `${import.meta.env?.BASE_URL}@qwik-handlers` ];
|
|
861
866
|
}
|
|
862
867
|
console.error("qwik symbolMapper: unknown qrl requested without parent:", n);
|
|
863
|
-
return [ n, `${import.meta.env
|
|
868
|
+
return [ n, `${import.meta.env?.BASE_URL}${n}.js` ];
|
|
864
869
|
}
|
|
865
|
-
const i = `${import.meta.env
|
|
870
|
+
const i = `${import.meta.env?.BASE_URL}${r.startsWith("/") ? r.slice(1) : r}_${n}.js`;
|
|
866
871
|
return [ n, i ];
|
|
867
872
|
};
|
|
868
873
|
|
|
869
|
-
function
|
|
874
|
+
function Vs(e, t) {
|
|
870
875
|
const n = t?.mapper;
|
|
871
876
|
const r = e.symbolMapper ? e.symbolMapper : (e, t, r) => {
|
|
872
|
-
if (n ||
|
|
873
|
-
const t =
|
|
874
|
-
const s = !
|
|
877
|
+
if (n || isDev6 && import.meta.env?.MODE !== "test") {
|
|
878
|
+
const t = Sh(e);
|
|
879
|
+
const s = !isDev6 ? n[t] : getDevSegmentPath(n, t, e, r);
|
|
875
880
|
if (!s) {
|
|
876
|
-
if (t ===
|
|
881
|
+
if (t === Me) {
|
|
877
882
|
return [ t, "" ];
|
|
878
883
|
}
|
|
879
884
|
const s = globalThis.__qwik_reg_symbols?.has(t);
|
|
@@ -888,12 +893,12 @@ function createPlatform2(e, t) {
|
|
|
888
893
|
const s = {
|
|
889
894
|
isServer: true,
|
|
890
895
|
async importSymbol(e, t, n) {
|
|
891
|
-
const r =
|
|
896
|
+
const r = Sh(n);
|
|
892
897
|
const s = globalThis.__qwik_reg_symbols?.get(r);
|
|
893
898
|
if (s) {
|
|
894
899
|
return s;
|
|
895
900
|
}
|
|
896
|
-
throw
|
|
901
|
+
throw qe(6 /* dynamicImportFailed */ , [ n ]);
|
|
897
902
|
},
|
|
898
903
|
raf: () => {
|
|
899
904
|
console.error("server can not rerender");
|
|
@@ -907,11 +912,11 @@ function createPlatform2(e, t) {
|
|
|
907
912
|
}
|
|
908
913
|
|
|
909
914
|
async function setServerPlatform(e, t) {
|
|
910
|
-
const n =
|
|
911
|
-
|
|
915
|
+
const n = Vs(e, t);
|
|
916
|
+
Bs(n);
|
|
912
917
|
}
|
|
913
918
|
|
|
914
|
-
var
|
|
919
|
+
var Sh = e => {
|
|
915
920
|
const t = e.lastIndexOf("_");
|
|
916
921
|
if (t > -1) {
|
|
917
922
|
return e.slice(t + 1);
|
|
@@ -919,45 +924,78 @@ var getSymbolHash2 = e => {
|
|
|
919
924
|
return e;
|
|
920
925
|
};
|
|
921
926
|
|
|
922
|
-
// packages/qwik/src/server/
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
927
|
+
// packages/qwik/src/server/ssr-render.ts
|
|
928
|
+
import { getClientManifest as Hf } from "@qwik.dev/core";
|
|
929
|
+
|
|
930
|
+
// packages/qwik/src/server/ssr-container.ts
|
|
931
|
+
import { isDev as isDev8 } from "@qwik.dev/core/build";
|
|
932
|
+
|
|
933
|
+
import { _SubscriptionData as Ri, _SharedContainer as ic, _jsxSorted as Fi, _jsxSplit as Xi, _res as _, _setEvent, _walkJSX as Xn, _createQRL as Mf, isSignal as iu } from "@qwik.dev/core/internal";
|
|
934
|
+
|
|
935
|
+
// packages/qwik/src/server/ooos-utils.ts
|
|
936
|
+
import { _SubscriptionPatch as Pu } from "@qwik.dev/core/internal";
|
|
937
|
+
|
|
938
|
+
var recordExternalRootEffect = (e, t, n, r, s, i, o, a) => {
|
|
939
|
+
if (!r || o !== null && !a) {
|
|
940
|
+
return;
|
|
926
941
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
942
|
+
let c = s;
|
|
943
|
+
if (o !== null && s && (typeof s === "object" || typeof s === "function")) {
|
|
944
|
+
c = n.get(s) || s;
|
|
945
|
+
}
|
|
946
|
+
const l = e.ge(c);
|
|
947
|
+
t.St(c);
|
|
948
|
+
t.St(i);
|
|
949
|
+
if (o !== null && typeof o !== "string") {
|
|
950
|
+
t.St(o);
|
|
951
|
+
}
|
|
952
|
+
r.push({
|
|
953
|
+
rootObj: c,
|
|
954
|
+
rootId: l,
|
|
955
|
+
effect: i,
|
|
956
|
+
prop: o
|
|
957
|
+
});
|
|
958
|
+
};
|
|
934
959
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
t = e.base(e);
|
|
960
|
+
var collectSubscriptionPatches = (e, t, n) => {
|
|
961
|
+
if (!t?.length) {
|
|
962
|
+
return;
|
|
939
963
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
964
|
+
const r = [];
|
|
965
|
+
const s = /* @__PURE__ */ new Map;
|
|
966
|
+
for (let i = 0; i < t.length; i++) {
|
|
967
|
+
const o = t[i];
|
|
968
|
+
const a = o.rootId === void 0 ? e.ge(o.rootObj) : o.rootId;
|
|
969
|
+
if (a === void 0 || a >= n) {
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
let c = s.get(a);
|
|
973
|
+
if (!c) {
|
|
974
|
+
c = new Pu(a, o.prop === null ? /* @__PURE__ */ new Set : /* @__PURE__ */ new Map);
|
|
975
|
+
s.set(a, c);
|
|
976
|
+
r.push(c);
|
|
977
|
+
}
|
|
978
|
+
const l = c.subscriptions;
|
|
979
|
+
if (o.prop === null) {
|
|
980
|
+
if (l instanceof Set) {
|
|
981
|
+
l.add(o.effect);
|
|
982
|
+
}
|
|
983
|
+
} else {
|
|
984
|
+
if (l instanceof Map) {
|
|
985
|
+
let e = l.get(o.prop);
|
|
986
|
+
if (!e) {
|
|
987
|
+
e = /* @__PURE__ */ new Set;
|
|
988
|
+
l.set(o.prop, e);
|
|
989
|
+
}
|
|
990
|
+
e.add(o.effect);
|
|
991
|
+
}
|
|
943
992
|
}
|
|
944
|
-
return t;
|
|
945
993
|
}
|
|
946
|
-
return
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
var versions = {
|
|
950
|
-
qwik: "2.0.0-beta.34-dev+8b055bb",
|
|
951
|
-
qwikDom: "2.1.19"
|
|
994
|
+
return r.length ? r : void 0;
|
|
952
995
|
};
|
|
953
996
|
|
|
954
|
-
// packages/qwik/src/server/ssr-container.ts
|
|
955
|
-
import { isDev as isDev7 } from "@qwik.dev/core/build";
|
|
956
|
-
|
|
957
|
-
import { _SubscriptionData as cs, _SharedContainer as Ou, _jsxSorted as ks, _jsxSplit as xs, _res as w, _setEvent, _walkJSX as Rn, _createQRL as Xc, isSignal as Fl } from "@qwik.dev/core/internal";
|
|
958
|
-
|
|
959
997
|
// packages/qwik/src/server/preload-impl.ts
|
|
960
|
-
import { getPlatform as
|
|
998
|
+
import { getPlatform as Hs } from "@qwik.dev/core";
|
|
961
999
|
|
|
962
1000
|
var simplifyPath = (e, t) => {
|
|
963
1001
|
if (t == null) {
|
|
@@ -977,9 +1015,9 @@ var simplifyPath = (e, t) => {
|
|
|
977
1015
|
};
|
|
978
1016
|
|
|
979
1017
|
var getBase = e => {
|
|
980
|
-
let t = e.
|
|
981
|
-
if (import.meta.env
|
|
982
|
-
t = import.meta.env
|
|
1018
|
+
let t = e.qe;
|
|
1019
|
+
if (import.meta.env?.DEV && !qTest) {
|
|
1020
|
+
t = import.meta.env?.BASE_URL;
|
|
983
1021
|
}
|
|
984
1022
|
return t;
|
|
985
1023
|
};
|
|
@@ -990,9 +1028,9 @@ var preloaderPre = (e, t, n) => {
|
|
|
990
1028
|
const i = simplifyPath(s, r?.manifest?.preloader);
|
|
991
1029
|
let o = r?.manifest.bundleGraphAsset;
|
|
992
1030
|
if (o) {
|
|
993
|
-
o = (import.meta.env
|
|
1031
|
+
o = (import.meta.env?.BASE_URL || "/") + o;
|
|
994
1032
|
}
|
|
995
|
-
if (i && o && t !== false) {
|
|
1033
|
+
if (!(import.meta.env?.DEV && !qTest) && i && o && t !== false) {
|
|
996
1034
|
const r = e.resolvedManifest?.manifest.bundleGraph;
|
|
997
1035
|
initPreloader(r);
|
|
998
1036
|
const a = [];
|
|
@@ -1001,15 +1039,15 @@ var preloaderPre = (e, t, n) => {
|
|
|
1001
1039
|
a.push(`P:${t.maxIdlePreloads}`);
|
|
1002
1040
|
}
|
|
1003
1041
|
}
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
1042
|
+
const c = a.length ? `,{${a.join(",")}}` : "";
|
|
1043
|
+
const l = {
|
|
1006
1044
|
rel: "modulepreload",
|
|
1007
1045
|
href: i
|
|
1008
1046
|
};
|
|
1009
1047
|
if (n) {
|
|
1010
|
-
|
|
1048
|
+
l["nonce"] = n;
|
|
1011
1049
|
}
|
|
1012
|
-
e.openElement("link", null,
|
|
1050
|
+
e.openElement("link", null, l, null, null, null);
|
|
1013
1051
|
e.closeElement();
|
|
1014
1052
|
e.openElement("link", null, {
|
|
1015
1053
|
rel: "preload",
|
|
@@ -1018,7 +1056,7 @@ var preloaderPre = (e, t, n) => {
|
|
|
1018
1056
|
crossorigin: "anonymous"
|
|
1019
1057
|
}, null, null, null);
|
|
1020
1058
|
e.closeElement();
|
|
1021
|
-
const u = `let b=fetch("${o}");import("${i}").then(({l})=>l(${JSON.stringify(s)},b${
|
|
1059
|
+
const u = `let b=fetch("${o}");import("${i}").then(({l})=>l(${JSON.stringify(s)},b${c}));`;
|
|
1022
1060
|
const h = {
|
|
1023
1061
|
type: "module",
|
|
1024
1062
|
async: true,
|
|
@@ -1027,9 +1065,7 @@ var preloaderPre = (e, t, n) => {
|
|
|
1027
1065
|
if (n) {
|
|
1028
1066
|
h["nonce"] = n;
|
|
1029
1067
|
}
|
|
1030
|
-
e.
|
|
1031
|
-
e.write(u);
|
|
1032
|
-
e.closeElement();
|
|
1068
|
+
e.writeScript(h, u);
|
|
1033
1069
|
}
|
|
1034
1070
|
const a = simplifyPath(s, r?.manifest.core);
|
|
1035
1071
|
if (a) {
|
|
@@ -1053,10 +1089,10 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1053
1089
|
let i = s;
|
|
1054
1090
|
const o = getBase(e);
|
|
1055
1091
|
const a = [];
|
|
1056
|
-
const {resolvedManifest:
|
|
1092
|
+
const {resolvedManifest: c} = e;
|
|
1057
1093
|
if (i) {
|
|
1058
|
-
const e =
|
|
1059
|
-
const t =
|
|
1094
|
+
const e = c?.manifest.preloader;
|
|
1095
|
+
const t = c?.manifest.core;
|
|
1060
1096
|
for (let r = 0; r < n.length; r++) {
|
|
1061
1097
|
const s = n[r];
|
|
1062
1098
|
if (s === e || s === t) {
|
|
@@ -1068,7 +1104,7 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1068
1104
|
}
|
|
1069
1105
|
}
|
|
1070
1106
|
}
|
|
1071
|
-
const
|
|
1107
|
+
const l = simplifyPath(o, c?.manifest.preloader);
|
|
1072
1108
|
const u = a.length ?
|
|
1073
1109
|
/**
|
|
1074
1110
|
* We only use modulepreload links because they behave best. Older browsers can rely on the
|
|
@@ -1076,8 +1112,8 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1076
1112
|
* links.
|
|
1077
1113
|
*/ `${JSON.stringify(a)}.map((l,e)=>{e=document.createElement('link');e.rel='modulepreload';e.href=${JSON.stringify(o)}+l;document.head.appendChild(e)});` : "";
|
|
1078
1114
|
let h = u;
|
|
1079
|
-
if (
|
|
1080
|
-
h += `window.addEventListener('load',f=>{f=_=>import("${
|
|
1115
|
+
if (l) {
|
|
1116
|
+
h += `window.addEventListener('load',f=>{f=_=>import("${l}").then(({p})=>p(${JSON.stringify(n)}));try{requestIdleCallback(f,{timeout:2000})}catch(e){setTimeout(f,200)}})`;
|
|
1081
1117
|
}
|
|
1082
1118
|
if (h) {
|
|
1083
1119
|
const t = {
|
|
@@ -1088,16 +1124,17 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1088
1124
|
if (r) {
|
|
1089
1125
|
t["nonce"] = r;
|
|
1090
1126
|
}
|
|
1091
|
-
e.
|
|
1092
|
-
e.write(h);
|
|
1093
|
-
e.closeElement();
|
|
1127
|
+
e.writeScript(t, h);
|
|
1094
1128
|
}
|
|
1095
1129
|
return null;
|
|
1096
1130
|
};
|
|
1097
1131
|
|
|
1098
1132
|
var preloaderPost = (e, t, n) => {
|
|
1133
|
+
if (import.meta.env?.DEV && !qTest) {
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1099
1136
|
if (t.preloader !== false) {
|
|
1100
|
-
const r = Array.from(e.serializationCtx.
|
|
1137
|
+
const r = Array.from(e.serializationCtx.xt);
|
|
1101
1138
|
const s = getBundles(r);
|
|
1102
1139
|
includePreloader(e, t.preloader, s, n);
|
|
1103
1140
|
}
|
|
@@ -1111,10 +1148,10 @@ function normalizePreLoaderOptions(e) {
|
|
|
1111
1148
|
}
|
|
1112
1149
|
|
|
1113
1150
|
var getBundles = e => {
|
|
1114
|
-
const t =
|
|
1151
|
+
const t = Hs();
|
|
1115
1152
|
const n = e?.map(e => {
|
|
1116
|
-
const n = e.
|
|
1117
|
-
const r = e.
|
|
1153
|
+
const n = e.vt;
|
|
1154
|
+
const r = e._t;
|
|
1118
1155
|
const s = t.chunkForSymbol(n, r, e.dev?.file);
|
|
1119
1156
|
if (s) {
|
|
1120
1157
|
return s[1];
|
|
@@ -1130,13 +1167,17 @@ var preLoaderOptionsDefault = {
|
|
|
1130
1167
|
};
|
|
1131
1168
|
|
|
1132
1169
|
// packages/qwik/src/server/scripts.ts
|
|
1133
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const e=document,t=window,
|
|
1170
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const e=document,t=window,n="w",r="wp",o="d",s="dp",i="e",c="ep",a="capture:",l="readystatechange",p="qready",u=new Set,q=new Set([e]),d=new Map;let h,f,b;const g=(e,t)=>Array.from(e.querySelectorAll(t)),m=e=>{const t=[];return q.forEach(n=>t.push(...g(n,e))),t},v=(e,t,n,r=!1,o=!1)=>e.addEventListener(t,n,{capture:r,passive:o}),y=e=>{z(e);const t=g(e,"[q\\\\:shadowroot]");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&y(n)}},w=e=>e&&"function"==typeof e.then,E=async e=>{for(let t=0;t<e.length;t++)await e[t]()},A=e=>{if(e.length){const t=()=>E(e);b=b?b.then(t,t):t()}},C=t=>{if(void 0===t._qwikjson_){let n=(t===e.documentElement?e.body:t).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){t._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},_=t=>{const n=t.getAttribute("q:instance");return"paused"===t.getAttribute("q:container")&&"loading"===e.readyState&&!e[p]?.[n]&&new Promise(t=>{const r=o=>{o.detail===n&&(e.removeEventListener(p,r),t())};v(e,l,t),v(e,p,r)})},k=(e,t)=>new CustomEvent(e,{detail:t}),S=(t,n)=>{e.dispatchEvent(k(t,n))},$=e=>e.replace(/([A-Z-])/g,e=>"-"+e.toLowerCase()),I=e=>e.replace(/-./g,e=>e[1].toUpperCase()),L=e=>{const t=e.indexOf(":");return{scope:e.slice(0,t),eventName:I(e.slice(t+1))}},N=e=>2===e.length,R=e=>e.charAt(0),T=e=>!!e&&1===e.nodeType,x=(e,t,n)=>e.hasAttribute(n)&&(!!e._qDispatch?.[t]||e.hasAttribute("q-"+t)),B=(t,n,r,o,s,i,c,a=!0)=>{const l={qBase:r,symbol:i,element:n,reqTime:c};if(!s){const n=(e["qFuncs_"+t.getAttribute("q:instance")]||[])[+i];if(!n&&a){const e=Error("sym:"+i);S("qerror",{importError:"sync",error:e,...l}),console.error(e)}return n}const p=`${i}|${r}|${s}`,u=d.get(p);if(u)return u;const q=new URL(s,o).href,h=import(q);return C(t),h.then(e=>{const t=e[i];if(t)d.set(p,t),S("qsymbol",l);else{const e=Error(`${i} not in ${q}`);S("qerror",{importError:"no-symbol",error:e,...l}),console.error(e)}return t},e=>{S("qerror",{importError:"async",error:e,...l}),console.error(e)})},U=(t,n,r,o,s,i=!0)=>{let c=!1;s&&(i&&t.hasAttribute("preventdefault:"+s)&&n.preventDefault(),t.hasAttribute("stoppropagation:"+s)&&n.stopPropagation());const a=t._qDispatch?.[r];if(a){if("function"==typeof a){const e=()=>a(n,t);if(c)o.push(async()=>{const t=e();w(t)&&await t});else{const t=e();w(t)&&(c=!0,o.push(()=>t))}}else if(a.length)for(let e=0;e<a.length;e++){const r=a[e];if(r){const e=()=>r(n,t);if(c)o.push(async()=>{const t=e();w(t)&&await t});else{const t=e();w(t)&&(c=!0,o.push(()=>t))}}}return}const l=t.getAttribute("q-"+r);if(l){const r=t.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),s=r.getAttribute("q:base"),i=new URL(s,e.baseURI),a=l.split("|"),p=_(r);for(let e=0;e<a.length;e++){const l=a[e],u=performance.now(),[q,d,h]=l.split("#"),f=e=>{if(e&&t.isConnected){const o=n=>{const o=_(r);if(o)return o.then(()=>f(e));S("qerror",{error:n,qBase:s,symbol:d,element:t,reqTime:u})};try{const r=e.call(h,n,t);if(w(r))return r.catch(o)}catch(e){return o(e)}}},b=(e=!0)=>B(r,t,s,i,q,d,u,e),g=p&&!q?b(!1):b();if(w(g))c=!0,o.push(()=>g.then(f));else if(c||p&&!q&&!g)c=!0,o.push(async()=>{let e=g;!e&&p&&(await p,e=b(!1)),await f(e||await b())});else{const e=f(g);w(e)&&(c=!0,o.push(()=>e))}}}},j=(e,t=i,n=!0)=>{const r=$(e.type),o=t+":"+r,s=a+r,c=[],l=[],p=[];let u=e.target;for(;u;)T(u)?(c.push(u),l.push(x(u,o,s)),u=u.parentElement):u=u.parentElement;for(let t=c.length-1;t>=0;t--)if(l[t]&&(U(c[t],e,o,p,r,n),e.cancelBubble))return void A(p);for(let t=0;t<c.length;t++)if(!l[t]&&(U(c[t],e,o,p,r,n),!e.bubbles||e.cancelBubble))return void A(p);A(p)},D=e=>j(e,c,!1),O=(e,t,n=!0)=>{const r=$(t.type),o=e+":"+r,s=m("[q-"+e+"\\\\:"+r+"]"),i=[];for(let e=0;e<s.length;e++){const c=s[e];U(c,t,o,i,r,n)}A(i)},P=e=>{O(o,e)},F=e=>{O(s,e,!1)},J=e=>{O(n,e)},M=e=>{O(r,e,!1)},Z=()=>{const n=e.readyState;if("interactive"==n||"complete"==n){if(f=1,q.forEach(y),u.has("d:qinit")){u.delete("d:qinit");const e=k("qinit"),t=m("[q-d\\\\:qinit]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];U(o,e,"d:qinit",n),o.removeAttribute("q-d:qinit")}A(n)}if(u.has("d:qidle")&&(u.delete("d:qidle"),(t.requestIdleCallback??t.setTimeout).bind(t)(()=>{const e=k("qidle"),t=m("[q-d\\\\:qidle]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];U(o,e,"d:qidle",n),o.removeAttribute("q-d:qidle")}A(n)})),u.has("e:qvisible")){h||(h=new IntersectionObserver(e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.isIntersecting&&(h.unobserve(r.target),U(r.target,k("qvisible",r),"e:qvisible",t))}A(t)}));const e=m("[q-e\\\\:qvisible]:not([q\\\\:observed])");for(let t=0;t<e.length;t++){const n=e[t];h.observe(n),n.setAttribute("q:observed","true")}}}},z=(...e)=>{for(let r=0;r<e.length;r++){const s=e[r];if("string"==typeof s){if(!u.has(s)){u.add(s);const{scope:e,eventName:r}=L(s),i=N(e),c=R(e);c===n?v(t,r,i?M:J,!0,i):q.forEach(e=>v(e,r,c===o?i?F:P:i?D:j,!0,i)),1!==f||"e:qvisible"!==s&&"d:qinit"!==s&&"d:qidle"!==s||Z()}}else q.has(s)||(u.forEach(e=>{const{scope:t,eventName:r}=L(e),i=N(t),c=R(t);c!==n&&v(s,r,c===o?i?F:P:i?D:j,!0,i)}),q.add(s))}},G=t._qwikEv;G?.roots||(Array.isArray(G)?z(...G):z("e:click","e:input"),t._qwikEv={events:u,roots:q,push:z},v(e,l,Z),Z())';
|
|
1171
|
+
|
|
1172
|
+
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst windowPrefix = "w";\nconst passiveWindowPrefix = "wp";\nconst documentPrefix = "d";\nconst passiveDocumentPrefix = "dp";\nconst elementPrefix = "e";\nconst passiveElementPrefix = "ep";\nconst capturePrefix = "capture:";\nconst readyStateChange = "readystatechange";\nconst containerReady = "qready";\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = /* @__PURE__ */ new Map();\nlet observer;\nlet hasInitialized;\nlet queuedTasks;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst addEventListener = (el, eventName, handler, capture = false, passive = false) => el.addEventListener(eventName, handler, { capture, passive });\nconst findShadowRoots = (fragment) => {\n addEventOrRoot(fragment);\n const shadowRoots = nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]");\n for (let i = 0; i < shadowRoots.length; i++) {\n const parent = shadowRoots[i];\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n }\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nconst runTasks = async (tasks) => {\n for (let i = 0; i < tasks.length; i++) {\n await tasks[i]();\n }\n};\nconst queueTasks = (tasks) => {\n if (tasks.length) {\n const run = () => runTasks(tasks);\n queuedTasks = queuedTasks ? queuedTasks.then(run, run) : run();\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst waitForContainerReady = (container) => {\n const hash = container.getAttribute("q:instance");\n return container.getAttribute("q:container") === "paused" && doc.readyState === "loading" && !doc[containerReady]?.[hash] && new Promise((resolve) => {\n const ready = (ev) => {\n if (ev.detail === hash) {\n doc.removeEventListener(containerReady, ready);\n resolve();\n }\n };\n addEventListener(doc, readyStateChange, resolve);\n addEventListener(doc, containerReady, ready);\n });\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, { detail });\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => "-" + a.toLowerCase());\nconst kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nconst parseKebabEvent = (event) => {\n const separatorIndex = event.indexOf(":");\n const scope = event.slice(0, separatorIndex);\n return {\n scope,\n eventName: kebabToCamel(event.slice(separatorIndex + 1))\n };\n};\nconst isPassiveScope = (scope) => scope.length === 2;\nconst getRootScope = (scope) => scope.charAt(0);\nconst isElementNode = (node) => !!node && node.nodeType === 1;\nconst isCaptureHandlerElement = (element, scopedKebabName, captureAttribute) => element.hasAttribute(captureAttribute) && (!!element._qDispatch?.[scopedKebabName] || element.hasAttribute("q-" + scopedKebabName));\nconst resolveHandler = (container, element, qBase, base, chunk, symbol, reqTime, reportSyncError = true) => {\n const eventData = {\n qBase,\n symbol,\n element,\n reqTime\n };\n if (!chunk) {\n const handler2 = (doc["qFuncs_" + container.getAttribute("q:instance")] || [])[+symbol];\n if (!handler2 && reportSyncError) {\n const error = new Error("sym:" + symbol);\n emitEvent("qerror", {\n importError: "sync",\n error,\n ...eventData\n });\n console.error(error);\n }\n return handler2;\n }\n const key = `${symbol}|${qBase}|${chunk}`;\n const handler = symbols.get(key);\n if (handler) {\n return handler;\n }\n const href = new URL(chunk, base).href;\n const module = import(\n href\n );\n resolveContainer(container);\n return module.then(\n (module2) => {\n const handler2 = module2[symbol];\n if (!handler2) {\n const error = new Error(`${symbol} not in ${href}`);\n emitEvent("qerror", {\n importError: "no-symbol",\n error,\n ...eventData\n });\n console.error(error);\n } else {\n symbols.set(key, handler2);\n emitEvent("qsymbol", eventData);\n }\n return handler2;\n },\n (error) => {\n emitEvent("qerror", {\n importError: "async",\n error,\n ...eventData\n });\n console.error(error);\n return void 0;\n }\n );\n};\nconst dispatch = (element, ev, scopedKebabName, tasks, kebabName, allowPreventDefault = true) => {\n let defer = false;\n if (kebabName) {\n if (allowPreventDefault && element.hasAttribute("preventdefault:" + kebabName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + kebabName)) {\n ev.stopPropagation();\n }\n }\n const handlers = element._qDispatch?.[scopedKebabName];\n if (handlers) {\n if (typeof handlers === "function") {\n const run = () => handlers(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n } else if (handlers.length) {\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i];\n if (handler) {\n const run = () => handler(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n }\n }\n }\n return;\n }\n const attrValue = element.getAttribute("q-" + scopedKebabName);\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const base = new URL(qBase, doc.baseURI);\n const qrls = attrValue.split("|");\n const waitForReady = waitForContainerReady(container);\n for (let i = 0; i < qrls.length; i++) {\n const qrl = qrls[i];\n const reqTime = performance.now();\n const [chunk, symbol, capturedIds] = qrl.split("#");\n const run = (handler2) => {\n if (handler2 && element.isConnected) {\n const onError = (error) => {\n const retry = waitForContainerReady(container);\n if (retry) {\n return retry.then(() => run(handler2));\n }\n emitEvent("qerror", {\n error,\n qBase,\n symbol,\n element,\n reqTime\n });\n };\n try {\n const result = handler2.call(capturedIds, ev, element);\n if (isPromise(result)) {\n return result.catch(onError);\n }\n } catch (error) {\n return onError(error);\n }\n }\n };\n const resolve = (reportSyncError = true) => resolveHandler(container, element, qBase, base, chunk, symbol, reqTime, reportSyncError);\n const handler = waitForReady && !chunk ? resolve(false) : resolve();\n if (isPromise(handler)) {\n defer = true;\n tasks.push(() => handler.then(run));\n } else if (defer || waitForReady && !chunk && !handler) {\n defer = true;\n tasks.push(async () => {\n let retryHandler = handler;\n if (!retryHandler && waitForReady) {\n await waitForReady;\n retryHandler = resolve(false);\n }\n await run(retryHandler || await resolve());\n });\n } else {\n const result = run(handler);\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n }\n }\n};\nconst processElementEvent = (ev, scope = elementPrefix, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const captureAttribute = capturePrefix + kebabName;\n const elements = [];\n const captureHandlers = [];\n const tasks = [];\n let current = ev.target;\n while (current) {\n if (isElementNode(current)) {\n elements.push(current);\n captureHandlers.push(isCaptureHandlerElement(current, scopedKebabName, captureAttribute));\n current = current.parentElement;\n } else {\n current = current.parentElement;\n }\n }\n for (let i = elements.length - 1; i >= 0; i--) {\n if (captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n if (ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n for (let i = 0; i < elements.length; i++) {\n if (!captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n if (!ev.bubbles || ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n queueTasks(tasks);\n};\nconst processPassiveElementEvent = (ev) => processElementEvent(ev, passiveElementPrefix, false);\nconst broadcast = (scope, ev, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const elements = querySelectorAll("[q-" + scope + "\\\\:" + kebabName + "]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n }\n queueTasks(tasks);\n};\nconst processDocumentEvent = (ev) => {\n broadcast(documentPrefix, ev);\n};\nconst processPassiveDocumentEvent = (ev) => {\n broadcast(passiveDocumentPrefix, ev, false);\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev);\n};\nconst processPassiveWindowEvent = (ev) => {\n broadcast(passiveWindowPrefix, ev, false);\n};\nconst processReadyStateChange = () => {\n const readyState = doc.readyState;\n if (readyState == "interactive" || readyState == "complete") {\n hasInitialized = 1;\n roots.forEach(findShadowRoots);\n if (events.has("d:qinit")) {\n events.delete("d:qinit");\n const ev = createEvent("qinit");\n const elements = querySelectorAll("[q-d\\\\:qinit]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qinit", tasks);\n el.removeAttribute("q-d:qinit");\n }\n queueTasks(tasks);\n }\n if (events.has("d:qidle")) {\n events.delete("d:qidle");\n const riC = win.requestIdleCallback ?? win.setTimeout;\n riC.bind(win)(() => {\n const ev = createEvent("qidle");\n const elements = querySelectorAll("[q-d\\\\:qidle]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qidle", tasks);\n el.removeAttribute("q-d:qidle");\n }\n queueTasks(tasks);\n });\n }\n if (events.has("e:qvisible")) {\n observer || (observer = new IntersectionObserver((entries) => {\n const tasks = [];\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(\n entry.target,\n createEvent("qvisible", entry),\n "e:qvisible",\n tasks\n );\n }\n }\n queueTasks(tasks);\n }));\n const elements = querySelectorAll("[q-e\\\\:qvisible]:not([q\\\\:observed])");\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n observer.observe(el);\n el.setAttribute("q:observed", "true");\n }\n }\n }\n};\nconst addEventOrRoot = (...eventNames) => {\n for (let i = 0; i < eventNames.length; i++) {\n const eventNameOrRoot = eventNames[i];\n if (typeof eventNameOrRoot === "string") {\n if (!events.has(eventNameOrRoot)) {\n events.add(eventNameOrRoot);\n const { scope, eventName } = parseKebabEvent(eventNameOrRoot);\n const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope === windowPrefix) {\n addEventListener(\n win,\n eventName,\n passive ? processPassiveWindowEvent : processWindowEvent,\n true,\n passive\n );\n } else {\n roots.forEach(\n (root) => addEventListener(\n root,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\n )\n );\n }\n if (hasInitialized === 1 && (eventNameOrRoot === "e:qvisible" || eventNameOrRoot === "d:qinit" || eventNameOrRoot === "d:qidle")) {\n processReadyStateChange();\n }\n }\n } else {\n if (!roots.has(eventNameOrRoot)) {\n events.forEach((kebabEventName) => {\n const { scope, eventName } = parseKebabEvent(kebabEventName);\n const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope !== windowPrefix) {\n addEventListener(\n eventNameOrRoot,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\n );\n }\n });\n roots.add(eventNameOrRoot);\n }\n }\n }\n};\nconst _qwikEv = win._qwikEv;\nif (!_qwikEv?.roots) {\n if (Array.isArray(_qwikEv)) {\n addEventOrRoot(..._qwikEv);\n } else {\n addEventOrRoot("e:click", "e:input");\n }\n win._qwikEv = {\n events,\n roots,\n push: addEventOrRoot\n };\n addEventListener(doc, readyStateChange, processReadyStateChange);\n processReadyStateChange();\n}';
|
|
1173
|
+
|
|
1174
|
+
var QWIK_BACKPATCH_EXECUTOR_MINIFIED = `const 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 s=c;null==l||!1===l?s.removeAttribute(r):("boolean"==typeof l&&(l=""),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");t&&e(document,t)}`;
|
|
1134
1175
|
|
|
1135
|
-
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst windowPrefix = "w";\nconst passiveWindowPrefix = "wp";\nconst documentPrefix = "d";\nconst passiveDocumentPrefix = "dp";\nconst elementPrefix = "e";\nconst passiveElementPrefix = "ep";\nconst capturePrefix = "capture:";\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = /* @__PURE__ */ new Map();\nlet observer;\nlet hasInitialized;\nlet queuedTasks;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst addEventListener = (el, eventName, handler, capture = false, passive = false) => el.addEventListener(eventName, handler, { capture, passive });\nconst findShadowRoots = (fragment) => {\n addEventOrRoot(fragment);\n const shadowRoots = nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]");\n for (let i = 0; i < shadowRoots.length; i++) {\n const parent = shadowRoots[i];\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n }\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nconst runTasks = async (tasks) => {\n for (let i = 0; i < tasks.length; i++) {\n await tasks[i]();\n }\n};\nconst queueTasks = (tasks) => {\n if (tasks.length) {\n const run = () => runTasks(tasks);\n queuedTasks = queuedTasks ? queuedTasks.then(run, run) : run();\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, { detail });\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => "-" + a.toLowerCase());\nconst kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nconst parseKebabEvent = (event) => {\n const separatorIndex = event.indexOf(":");\n const scope = event.slice(0, separatorIndex);\n return {\n scope,\n eventName: kebabToCamel(event.slice(separatorIndex + 1))\n };\n};\nconst isPassiveScope = (scope) => scope.length === 2;\nconst getRootScope = (scope) => scope.charAt(0);\nconst isElementNode = (node) => !!node && node.nodeType === 1;\nconst isCaptureHandlerElement = (element, scopedKebabName, captureAttribute) => element.hasAttribute(captureAttribute) && (!!element._qDispatch?.[scopedKebabName] || element.hasAttribute("q-" + scopedKebabName));\nconst resolveHandler = (container, element, qBase, base, chunk, symbol, reqTime) => {\n const eventData = {\n qBase,\n symbol,\n element,\n reqTime\n };\n if (chunk === "") {\n const hash = container.getAttribute("q:instance");\n const handler2 = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler2) {\n const error = new Error("sym:" + symbol);\n emitEvent("qerror", {\n importError: "sync",\n error,\n ...eventData\n });\n console.error(error);\n }\n return handler2;\n }\n const key = `${symbol}|${qBase}|${chunk}`;\n const handler = symbols.get(key);\n if (handler) {\n return handler;\n }\n const href = new URL(chunk, base).href;\n const module = import(\n href\n );\n resolveContainer(container);\n return module.then(\n (module2) => {\n const handler2 = module2[symbol];\n if (!handler2) {\n const error = new Error(`${symbol} not in ${href}`);\n emitEvent("qerror", {\n importError: "no-symbol",\n error,\n ...eventData\n });\n console.error(error);\n } else {\n symbols.set(key, handler2);\n emitEvent("qsymbol", eventData);\n }\n return handler2;\n },\n (error) => {\n emitEvent("qerror", {\n importError: "async",\n error,\n ...eventData\n });\n console.error(error);\n return void 0;\n }\n );\n};\nconst dispatch = (element, ev, scopedKebabName, tasks, kebabName, allowPreventDefault = true) => {\n let defer = false;\n if (kebabName) {\n if (allowPreventDefault && element.hasAttribute("preventdefault:" + kebabName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + kebabName)) {\n ev.stopPropagation();\n }\n }\n const handlers = element._qDispatch?.[scopedKebabName];\n if (handlers) {\n if (typeof handlers === "function") {\n const run = () => handlers(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n } else if (handlers.length) {\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i];\n if (handler) {\n const run = () => handler(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n }\n }\n }\n return;\n }\n const attrValue = element.getAttribute("q-" + scopedKebabName);\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const base = new URL(qBase, doc.baseURI);\n const qrls = attrValue.split("|");\n for (let i = 0; i < qrls.length; i++) {\n const qrl = qrls[i];\n const reqTime = performance.now();\n const [chunk, symbol, capturedIds] = qrl.split("#");\n const run = (handler2) => {\n if (handler2 && element.isConnected) {\n try {\n const result = handler2.call(capturedIds, ev, element);\n if (isPromise(result)) {\n return result.catch((error) => {\n emitEvent("qerror", {\n error,\n qBase,\n symbol,\n element,\n reqTime\n });\n });\n }\n } catch (error) {\n emitEvent("qerror", {\n error,\n qBase,\n symbol,\n element,\n reqTime\n });\n }\n }\n };\n const handler = resolveHandler(container, element, qBase, base, chunk, symbol, reqTime);\n if (defer || isPromise(handler)) {\n defer = true;\n tasks.push(async () => {\n await run(isPromise(handler) ? await handler : handler);\n });\n } else {\n const result = run(handler);\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n }\n }\n};\nconst processElementEvent = (ev, scope = elementPrefix, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const captureAttribute = capturePrefix + kebabName;\n const elements = [];\n const captureHandlers = [];\n const tasks = [];\n let current = ev.target;\n while (current) {\n if (isElementNode(current)) {\n elements.push(current);\n captureHandlers.push(isCaptureHandlerElement(current, scopedKebabName, captureAttribute));\n current = current.parentElement;\n } else {\n current = current.parentElement;\n }\n }\n for (let i = elements.length - 1; i >= 0; i--) {\n if (captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n const continuePropagation = !ev.cancelBubble;\n if (!continuePropagation || ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n for (let i = 0; i < elements.length; i++) {\n if (!captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n const doBubble = ev.bubbles && !ev.cancelBubble;\n if (!doBubble || ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n queueTasks(tasks);\n};\nconst processPassiveElementEvent = (ev) => processElementEvent(ev, passiveElementPrefix, false);\nconst broadcast = (scope, ev, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const elements = querySelectorAll("[q-" + scope + "\\\\:" + kebabName + "]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n }\n queueTasks(tasks);\n};\nconst processDocumentEvent = (ev) => {\n broadcast(documentPrefix, ev);\n};\nconst processPassiveDocumentEvent = (ev) => {\n broadcast(passiveDocumentPrefix, ev, false);\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev);\n};\nconst processPassiveWindowEvent = (ev) => {\n broadcast(passiveWindowPrefix, ev, false);\n};\nconst processReadyStateChange = () => {\n const readyState = doc.readyState;\n if (readyState == "interactive" || readyState == "complete") {\n hasInitialized = 1;\n roots.forEach(findShadowRoots);\n if (events.has("d:qinit")) {\n events.delete("d:qinit");\n const ev = createEvent("qinit");\n const elements = querySelectorAll("[q-d\\\\:qinit]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qinit", tasks);\n el.removeAttribute("q-d:qinit");\n }\n queueTasks(tasks);\n }\n if (events.has("d:qidle")) {\n events.delete("d:qidle");\n const riC = win.requestIdleCallback ?? win.setTimeout;\n riC.bind(win)(() => {\n const ev = createEvent("qidle");\n const elements = querySelectorAll("[q-d\\\\:qidle]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qidle", tasks);\n el.removeAttribute("q-d:qidle");\n }\n queueTasks(tasks);\n });\n }\n if (events.has("e:qvisible")) {\n observer || (observer = new IntersectionObserver((entries) => {\n const tasks = [];\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(\n entry.target,\n createEvent("qvisible", entry),\n "e:qvisible",\n tasks\n );\n }\n }\n queueTasks(tasks);\n }));\n const elements = querySelectorAll("[q-e\\\\:qvisible]:not([q\\\\:observed])");\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n observer.observe(el);\n el.setAttribute("q:observed", "true");\n }\n }\n }\n};\nconst addEventOrRoot = (...eventNames) => {\n for (let i = 0; i < eventNames.length; i++) {\n const eventNameOrRoot = eventNames[i];\n if (typeof eventNameOrRoot === "string") {\n if (!events.has(eventNameOrRoot)) {\n events.add(eventNameOrRoot);\n const { scope, eventName } = parseKebabEvent(eventNameOrRoot);\n const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope === windowPrefix) {\n addEventListener(\n win,\n eventName,\n passive ? processPassiveWindowEvent : processWindowEvent,\n true,\n passive\n );\n } else {\n roots.forEach(\n (root) => addEventListener(\n root,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\n )\n );\n }\n if (hasInitialized === 1 && (eventNameOrRoot === "e:qvisible" || eventNameOrRoot === "d:qinit" || eventNameOrRoot === "d:qidle")) {\n processReadyStateChange();\n }\n }\n } else {\n if (!roots.has(eventNameOrRoot)) {\n events.forEach((kebabEventName) => {\n const { scope, eventName } = parseKebabEvent(kebabEventName);\n const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope !== windowPrefix) {\n addEventListener(\n eventNameOrRoot,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\n );\n }\n });\n roots.add(eventNameOrRoot);\n }\n }\n }\n};\nconst _qwikEv = win._qwikEv;\nif (!_qwikEv?.roots) {\n if (Array.isArray(_qwikEv)) {\n addEventOrRoot(..._qwikEv);\n } else {\n addEventOrRoot("e:click", "e:input");\n }\n win._qwikEv = {\n events,\n roots,\n push: addEventOrRoot\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
|
|
1176
|
+
var QWIK_BACKPATCH_EXECUTOR_DEBUG = `const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");\n if (container) {\n const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);\n const script = scripts[scripts.length - 1];\n if (script) {\n const data = JSON.parse(script.textContent || "[]");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(":") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(":")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === "boolean") {\n value = "";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}`;
|
|
1136
1177
|
|
|
1137
|
-
var
|
|
1178
|
+
var QWIK_OUT_OF_ORDER_EXECUTOR_MINIFIED = `const t='template[q\\\\:r="',e="q:r",n='[q\\\\:rp="',r="q:g",l="q:i",o="q:o",s="[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])",u=u=>{const i=new WeakMap,c=()=>{const t=u.currentScript;return t&&t.closest(s)||u},f=(t,e,n,r)=>{let l=i.get(t);return l||i.set(t,l={}),l[e]||(l[e]={r:{},n:0,t:n,o:r})},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 n,r,l=0;if("p"===e)for(const e in t.r)n=t.r[e],n[0]&&a(n[0],n[1])&&(n[0]=0,l++);else if("s"===e)for(r=t.n;(n=t.r[r])&&n[0]&&a(n[0],n[1]);r++)n[0]=0,l++,t.n=r+1;else if("r"===e){if(t.t<0)return 0;for(t.n<0&&(t.n=t.t-1),r=t.n;(n=t.r[r])&&n[0]&&a(n[0],n[1]);r--)n[0]=0,l++,t.n=r-1}else{if(t.t<0)return 0;for(r=0;r<t.t;r++)if(n=t.r[r],!n)return 0;for(r=0;r<t.t;r++)n=t.r[r],n[0]&&a(n[0],n[1])&&(n[0]=0,l++)}return l},p=s=>{const i=c(),p=((n,r)=>{const l=u.currentScript,o=l?l.previousElementSibling:null;if(o&&"template"===o.localName&&o.getAttribute(e)===r+"")return o;const s=n.querySelectorAll(t+r+'"]');return s.length?s[s.length-1]:null})(i,s);if(!p)return;const g=((e,r,l)=>{if(!l)return null;const o=((t,e)=>t.querySelector(n+e+'"]'))(e,r),s=o?((e,n)=>e.querySelector(t+n+'"]'))(o,r):null,u=s?s.parentNode:null;return s&&o&&u?(u.insertBefore(l.content,s),s.remove(),l.remove(),[o,o.previousElementSibling]):null})(i,s,p);if(!g)return;((t,e)=>{var n;const r=u;null==(n=r.qProcessOOOS)||n.call(r,t,e)})(s,g[0]||null);const m=p.getAttribute(r);if(m){const t=+(p.getAttribute(l)||0),e=f(i,m,-1,p.getAttribute(o)||"p");return e.r[t]=g,void q(e)}a(g[0]||null,g[1])};p.g=(t,e,n)=>{const r=f(c(),t,e,n);r.t=e,r.o=n,"r"===r.o&&0===r.n&&(r.n=e-1),q(r)},p.d=u,globalThis.qO=p};u(document)`;
|
|
1138
1179
|
|
|
1139
|
-
var
|
|
1180
|
+
var QWIK_OUT_OF_ORDER_EXECUTOR_DEBUG = `const Q_RESOLVED_SELECTOR = 'template[q\\\\:r="';\nconst Q_RESOLVED_ATTR = "q:r";\nconst Q_RESULT_PARENT_SELECTOR = '[q\\\\:rp="';\nconst Q_GROUP_ATTR = "q:g";\nconst Q_INDEX_ATTR = "q:i";\nconst Q_ORDER_ATTR = "q:o";\nconst Q_CONTAINER_SELECTOR = "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])";\nconst installOutOfOrderExecutor = (doc) => {\n const groups = /* @__PURE__ */ new WeakMap();\n const process = (boundaryId, content) => {\n var _a;\n const executorDoc = doc;\n (_a = executorDoc.qProcessOOOS) == null ? void 0 : _a.call(executorDoc, boundaryId, content);\n };\n const getScope = () => {\n const script = doc.currentScript;\n return script ? script.closest(Q_CONTAINER_SELECTOR) || doc : doc;\n };\n const group = (scope, groupId, total, order) => {\n let scopedGroups = groups.get(scope);\n if (!scopedGroups) {\n groups.set(scope, scopedGroups = {});\n }\n return scopedGroups[groupId] || (scopedGroups[groupId] = {\n r: {},\n n: 0,\n t: total,\n o: order\n });\n };\n const getResolvedTemplate = (scope, boundaryId) => {\n const currentScript = doc.currentScript;\n const previousElement = currentScript ? currentScript.previousElementSibling : null;\n if (previousElement && previousElement.localName === "template" && previousElement.getAttribute(Q_RESOLVED_ATTR) === String(boundaryId)) {\n return previousElement;\n }\n const templates = scope.querySelectorAll(Q_RESOLVED_SELECTOR + boundaryId + '"]');\n return templates.length ? templates[templates.length - 1] : null;\n };\n const getPlaceholderTemplate = (content, boundaryId) => {\n return content.querySelector(Q_RESOLVED_SELECTOR + boundaryId + '"]');\n };\n const getResultParent = (scope, boundaryId) => {\n return scope.querySelector(Q_RESULT_PARENT_SELECTOR + boundaryId + '"]');\n };\n const reveal = (content, fallback) => {\n if (!content) {\n return 0;\n }\n if (fallback && fallback.style) {\n fallback.style.display = "none";\n }\n if (content.style) {\n content.style.display = "contents";\n }\n return 1;\n };\n const move = (scope, boundaryId, resolved) => {\n if (!resolved) {\n return null;\n }\n const content = getResultParent(scope, boundaryId);\n const placeholder = content ? getPlaceholderTemplate(content, boundaryId) : null;\n const parent = placeholder ? placeholder.parentNode : null;\n if (!placeholder || !content || !parent) {\n return null;\n }\n parent.insertBefore(resolved.content, placeholder);\n placeholder.remove();\n resolved.remove();\n return [content, content.previousElementSibling];\n };\n const flush = (group2) => {\n const order = group2.o;\n let entry;\n let index;\n let swapped = 0;\n if (order === "p") {\n for (const key in group2.r) {\n entry = group2.r[key];\n if (entry[0] && reveal(entry[0], entry[1])) {\n entry[0] = 0;\n swapped++;\n }\n }\n } else if (order === "s") {\n for (index = group2.n; (entry = group2.r[index]) && entry[0]; index++) {\n if (!reveal(entry[0], entry[1])) {\n break;\n }\n entry[0] = 0;\n swapped++;\n group2.n = index + 1;\n }\n } else if (order === "r") {\n if (group2.t < 0) {\n return 0;\n }\n if (group2.n < 0) {\n group2.n = group2.t - 1;\n }\n for (index = group2.n; (entry = group2.r[index]) && entry[0]; index--) {\n if (!reveal(entry[0], entry[1])) {\n break;\n }\n entry[0] = 0;\n swapped++;\n group2.n = index - 1;\n }\n } else {\n if (group2.t < 0) {\n return 0;\n }\n for (index = 0; index < group2.t; index++) {\n entry = group2.r[index];\n if (!entry) {\n return 0;\n }\n }\n for (index = 0; index < group2.t; index++) {\n entry = group2.r[index];\n if (entry[0] && reveal(entry[0], entry[1])) {\n entry[0] = 0;\n swapped++;\n }\n }\n }\n return swapped;\n };\n const qO = ((boundaryId) => {\n const scope = getScope();\n const resolved = getResolvedTemplate(scope, boundaryId);\n if (!resolved) {\n return;\n }\n const entry = move(scope, boundaryId, resolved);\n if (!entry) {\n return;\n }\n process(boundaryId, entry[0] || null);\n const groupId = resolved.getAttribute(Q_GROUP_ATTR);\n if (groupId) {\n const index = +(resolved.getAttribute(Q_INDEX_ATTR) || 0);\n const currentGroup = group(scope, groupId, -1, resolved.getAttribute(Q_ORDER_ATTR) || "p");\n currentGroup.r[index] = entry;\n flush(currentGroup);\n return;\n }\n reveal(entry[0] || null, entry[1]);\n });\n qO.g = (groupId, total, order) => {\n const currentGroup = group(getScope(), groupId, total, order);\n currentGroup.t = total;\n currentGroup.o = order;\n if (currentGroup.o === "r" && currentGroup.n === 0) {\n currentGroup.n = total - 1;\n }\n flush(currentGroup);\n };\n qO.d = doc;\n globalThis.qO = qO;\n};\ninstallOutOfOrderExecutor(document)`;
|
|
1140
1181
|
|
|
1141
1182
|
function getQwikLoaderScript(e = {}) {
|
|
1142
1183
|
return e.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -1154,10 +1195,18 @@ function getQwikBackpatchExecutorScript(e = {}) {
|
|
|
1154
1195
|
return e.debug ? QWIK_BACKPATCH_EXECUTOR_DEBUG : QWIK_BACKPATCH_EXECUTOR_MINIFIED;
|
|
1155
1196
|
}
|
|
1156
1197
|
|
|
1198
|
+
function getQwikOutOfOrderExecutorScript(e = {}) {
|
|
1199
|
+
if (!__EXPERIMENTAL__.suspense) {
|
|
1200
|
+
return "";
|
|
1201
|
+
}
|
|
1202
|
+
const t = e.debug ? QWIK_OUT_OF_ORDER_EXECUTOR_DEBUG : QWIK_OUT_OF_ORDER_EXECUTOR_MINIFIED;
|
|
1203
|
+
return `if(!globalThis.qO||globalThis.qO.d!==document){${t}}`;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1157
1206
|
// packages/qwik/src/server/ssr-node.ts
|
|
1158
|
-
import { _isJSXNode as
|
|
1207
|
+
import { _isJSXNode as qi, _EMPTY_OBJ, _EFFECT_BACK_REF as vr } from "@qwik.dev/core/internal";
|
|
1159
1208
|
|
|
1160
|
-
import { isDev as
|
|
1209
|
+
import { isDev as isDev7 } from "@qwik.dev/core/build";
|
|
1161
1210
|
|
|
1162
1211
|
var SsrNode = class {
|
|
1163
1212
|
constructor(e, t, n, r, s, i) {
|
|
@@ -1170,7 +1219,7 @@ var SsrNode = class {
|
|
|
1170
1219
|
this.flags = 1 /* Updatable */;
|
|
1171
1220
|
this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : _EMPTY_OBJ;
|
|
1172
1221
|
this.parentComponent?.addChild(this);
|
|
1173
|
-
if (
|
|
1222
|
+
if (isDev7 && t.indexOf("undefined") != -1) {
|
|
1174
1223
|
throw new Error(`Invalid SSR node id: ${t}`);
|
|
1175
1224
|
}
|
|
1176
1225
|
}
|
|
@@ -1187,19 +1236,19 @@ var SsrNode = class {
|
|
|
1187
1236
|
attrs;
|
|
1188
1237
|
/** Local props which don't serialize; */
|
|
1189
1238
|
localProps=null;
|
|
1190
|
-
get [
|
|
1191
|
-
return this.getProp(
|
|
1239
|
+
get [vr]() {
|
|
1240
|
+
return this.getProp(Qe);
|
|
1192
1241
|
}
|
|
1193
1242
|
setProp(e, t) {
|
|
1194
1243
|
if (this.attrs === _EMPTY_OBJ) {
|
|
1195
1244
|
this.setEmptyArrayAsVNodeDataAttributes();
|
|
1196
1245
|
}
|
|
1197
|
-
if (e.startsWith(
|
|
1246
|
+
if (e.startsWith(ws)) {
|
|
1198
1247
|
(this.localProps ||= {})[e] = t;
|
|
1199
1248
|
} else {
|
|
1200
1249
|
this.attrs[e] = t;
|
|
1201
1250
|
}
|
|
1202
|
-
if (e ==
|
|
1251
|
+
if (e == ps && t) {
|
|
1203
1252
|
this.cleanupQueue.push(t);
|
|
1204
1253
|
}
|
|
1205
1254
|
}
|
|
@@ -1215,14 +1264,14 @@ var SsrNode = class {
|
|
|
1215
1264
|
}
|
|
1216
1265
|
}
|
|
1217
1266
|
getProp(e) {
|
|
1218
|
-
if (e.startsWith(
|
|
1267
|
+
if (e.startsWith(ws)) {
|
|
1219
1268
|
return this.localProps ? this.localProps[e] ?? null : null;
|
|
1220
1269
|
} else {
|
|
1221
1270
|
return this.attrs[e] ?? null;
|
|
1222
1271
|
}
|
|
1223
1272
|
}
|
|
1224
1273
|
removeProp(e) {
|
|
1225
|
-
if (e.startsWith(
|
|
1274
|
+
if (e.startsWith(ws)) {
|
|
1226
1275
|
if (this.localProps) {
|
|
1227
1276
|
delete this.localProps[e];
|
|
1228
1277
|
}
|
|
@@ -1248,7 +1297,7 @@ var SsrNode = class {
|
|
|
1248
1297
|
}
|
|
1249
1298
|
}
|
|
1250
1299
|
toString() {
|
|
1251
|
-
if (
|
|
1300
|
+
if (isDev7) {
|
|
1252
1301
|
let e = "";
|
|
1253
1302
|
for (const t in this.attrs) {
|
|
1254
1303
|
const n = this.attrs[t];
|
|
@@ -1265,7 +1314,7 @@ var SsrNode = class {
|
|
|
1265
1314
|
|
|
1266
1315
|
var DomRef = class {
|
|
1267
1316
|
constructor(e) {
|
|
1268
|
-
this.
|
|
1317
|
+
this.ne = e;
|
|
1269
1318
|
}
|
|
1270
1319
|
__brand__="DomRef";
|
|
1271
1320
|
};
|
|
@@ -1282,16 +1331,16 @@ var SsrComponentFrame = class {
|
|
|
1282
1331
|
distributeChildrenIntoSlots(e, t, n) {
|
|
1283
1332
|
this.projectionScopedStyle = t;
|
|
1284
1333
|
this.projectionComponentFrame = n;
|
|
1285
|
-
if (
|
|
1334
|
+
if (qi(e)) {
|
|
1286
1335
|
const t = this.getSlotName(e);
|
|
1287
|
-
|
|
1336
|
+
_e(this.slots, t, e, 0);
|
|
1288
1337
|
} else if (Array.isArray(e) && e.length > 0) {
|
|
1289
1338
|
const t = [];
|
|
1290
1339
|
for (let n = 0; n < e.length; n++) {
|
|
1291
1340
|
const r = e[n];
|
|
1292
|
-
if (
|
|
1341
|
+
if (qi(r)) {
|
|
1293
1342
|
const e = this.getSlotName(r);
|
|
1294
|
-
if (e ===
|
|
1343
|
+
if (e === QDefaultSlot) {
|
|
1295
1344
|
t.push(r);
|
|
1296
1345
|
} else {
|
|
1297
1346
|
this.updateSlot(e, r);
|
|
@@ -1300,13 +1349,13 @@ var SsrComponentFrame = class {
|
|
|
1300
1349
|
t.push(r);
|
|
1301
1350
|
}
|
|
1302
1351
|
}
|
|
1303
|
-
t.length > 0 &&
|
|
1352
|
+
t.length > 0 && _e(this.slots, QDefaultSlot, t, 0);
|
|
1304
1353
|
} else {
|
|
1305
|
-
|
|
1354
|
+
_e(this.slots, QDefaultSlot, e, 0);
|
|
1306
1355
|
}
|
|
1307
1356
|
}
|
|
1308
1357
|
updateSlot(e, t) {
|
|
1309
|
-
let n =
|
|
1358
|
+
let n = ge(this.slots, e, 0);
|
|
1310
1359
|
if (n === null) {
|
|
1311
1360
|
n = t;
|
|
1312
1361
|
} else if (Array.isArray(n)) {
|
|
@@ -1314,25 +1363,99 @@ var SsrComponentFrame = class {
|
|
|
1314
1363
|
} else {
|
|
1315
1364
|
n = [ n, t ];
|
|
1316
1365
|
}
|
|
1317
|
-
|
|
1366
|
+
_e(this.slots, e, n, 0);
|
|
1318
1367
|
}
|
|
1319
1368
|
getSlotName(e) {
|
|
1320
|
-
if (e.props[
|
|
1321
|
-
return e.props[
|
|
1369
|
+
if (e.props[De]) {
|
|
1370
|
+
return e.props[De];
|
|
1322
1371
|
}
|
|
1323
|
-
return
|
|
1372
|
+
return QDefaultSlot;
|
|
1324
1373
|
}
|
|
1325
1374
|
hasSlot(e) {
|
|
1326
|
-
return
|
|
1375
|
+
return Ee(this.slots, e, 0);
|
|
1376
|
+
}
|
|
1377
|
+
claimChildrenForSlot(e) {
|
|
1378
|
+
return mapApp_remove(this.slots, e, 0);
|
|
1327
1379
|
}
|
|
1328
1380
|
consumeChildrenForSlot(e, t) {
|
|
1329
|
-
const n =
|
|
1381
|
+
const n = this.claimChildrenForSlot(t);
|
|
1330
1382
|
this.componentNode.setProp(t, e.id);
|
|
1331
1383
|
e.setProp(QSlotParent, this.componentNode.id);
|
|
1332
1384
|
return n;
|
|
1333
1385
|
}
|
|
1334
1386
|
};
|
|
1335
1387
|
|
|
1388
|
+
// packages/qwik/src/server/ssr-stream-writer.ts
|
|
1389
|
+
var renderSSRChunks = (e, t) => {
|
|
1390
|
+
let n = "";
|
|
1391
|
+
for (let r = 0; r < e.length; r++) {
|
|
1392
|
+
const s = e[r];
|
|
1393
|
+
if (typeof s === "string") {
|
|
1394
|
+
n += s;
|
|
1395
|
+
} else {
|
|
1396
|
+
const e = s.type === "root-ref" ? s.localId : s.localPath[0];
|
|
1397
|
+
n += String(t ? t[e] ?? e : e);
|
|
1398
|
+
if (s.type !== "root-ref-path") {
|
|
1399
|
+
continue;
|
|
1400
|
+
}
|
|
1401
|
+
const r = s.localPath;
|
|
1402
|
+
for (let e = 1; e < r.length; e++) {
|
|
1403
|
+
n += " " + r[e];
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
return n;
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1410
|
+
var StringSSRWriter = class {
|
|
1411
|
+
buffer=[];
|
|
1412
|
+
write(e) {
|
|
1413
|
+
this.buffer.push(e);
|
|
1414
|
+
}
|
|
1415
|
+
writeRootRef(e) {
|
|
1416
|
+
writeStringRootRef(this, e);
|
|
1417
|
+
}
|
|
1418
|
+
writeRootRefPath(e) {
|
|
1419
|
+
writeStringRootRefPath(this, e);
|
|
1420
|
+
}
|
|
1421
|
+
clear() {
|
|
1422
|
+
this.buffer.length = 0;
|
|
1423
|
+
}
|
|
1424
|
+
toString(e) {
|
|
1425
|
+
return this.buffer.join("");
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
var StringBufferSegmentWriter = class {
|
|
1430
|
+
chunks=[];
|
|
1431
|
+
write(e) {
|
|
1432
|
+
this.chunks.push(e);
|
|
1433
|
+
}
|
|
1434
|
+
writeRootRef(e) {
|
|
1435
|
+
this.chunks.push({
|
|
1436
|
+
type: "root-ref",
|
|
1437
|
+
localId: e
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
writeRootRefPath(e) {
|
|
1441
|
+
this.chunks.push({
|
|
1442
|
+
type: "root-ref-path",
|
|
1443
|
+
localPath: e
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
clear() {
|
|
1447
|
+
this.chunks.length = 0;
|
|
1448
|
+
}
|
|
1449
|
+
extract() {
|
|
1450
|
+
const e = this.chunks;
|
|
1451
|
+
this.chunks = [];
|
|
1452
|
+
return e;
|
|
1453
|
+
}
|
|
1454
|
+
toString(e) {
|
|
1455
|
+
return renderSSRChunks(this.chunks, e);
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1336
1459
|
// packages/qwik/src/server/tag-nesting.ts
|
|
1337
1460
|
var allowedContent = e => {
|
|
1338
1461
|
switch (e) {
|
|
@@ -1721,6 +1844,38 @@ function isInPhrasing(e, t) {
|
|
|
1721
1844
|
}
|
|
1722
1845
|
}
|
|
1723
1846
|
|
|
1847
|
+
// packages/qwik/src/server/utils.ts
|
|
1848
|
+
function createTimer() {
|
|
1849
|
+
if (typeof performance === "undefined") {
|
|
1850
|
+
return () => 0;
|
|
1851
|
+
}
|
|
1852
|
+
const e = performance.now();
|
|
1853
|
+
return () => {
|
|
1854
|
+
const t = performance.now();
|
|
1855
|
+
const n = t - e;
|
|
1856
|
+
return n / 1e6;
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
function getBuildBase(e) {
|
|
1861
|
+
let t = e.base;
|
|
1862
|
+
if (typeof e.base === "function") {
|
|
1863
|
+
t = e.base(e);
|
|
1864
|
+
}
|
|
1865
|
+
if (typeof t === "string") {
|
|
1866
|
+
if (!t.endsWith("/")) {
|
|
1867
|
+
t += "/";
|
|
1868
|
+
}
|
|
1869
|
+
return t;
|
|
1870
|
+
}
|
|
1871
|
+
return `${import.meta.env?.BASE_URL || "/"}build/`;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
var versions = {
|
|
1875
|
+
qwik: "2.0.0-beta.36-dev+3268fab",
|
|
1876
|
+
qwikDom: "2.1.19"
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1724
1879
|
// packages/qwik/src/server/vnode-data.ts
|
|
1725
1880
|
var OPEN_FRAGMENT = Number.MAX_SAFE_INTEGER;
|
|
1726
1881
|
|
|
@@ -1786,7 +1941,7 @@ function vNodeData_createSsrNodeReference(e, t, n, r, s) {
|
|
|
1786
1941
|
i[i.length - 1]++;
|
|
1787
1942
|
}
|
|
1788
1943
|
}
|
|
1789
|
-
let a = n
|
|
1944
|
+
let a = String(n);
|
|
1790
1945
|
if (t[0] & (2 /* VIRTUAL_NODE */ | 1 /* TEXT_DATA */)) {
|
|
1791
1946
|
for (let e = 0; e < i.length; e++) {
|
|
1792
1947
|
const t = i[e];
|
|
@@ -1816,11 +1971,13 @@ function encodeAsAlphanumeric(e) {
|
|
|
1816
1971
|
}
|
|
1817
1972
|
|
|
1818
1973
|
// packages/qwik/src/server/ssr-container.ts
|
|
1974
|
+
var NO_SCRIPT_HERE_ELEMENTS = /* @__PURE__ */ new Set([ "script", "style", "textarea", "title", "iframe", "noframes", "noscript", "xmp", "template", "svg", "math" ]);
|
|
1975
|
+
|
|
1819
1976
|
function ssrCreateContainer(e) {
|
|
1820
1977
|
e.renderOptions ||= {};
|
|
1821
1978
|
return new SSRContainer({
|
|
1822
1979
|
tagName: e.tagName || "div",
|
|
1823
|
-
writer: e.writer || new
|
|
1980
|
+
writer: e.writer || new StringSSRWriter,
|
|
1824
1981
|
streamHandler: e.streamHandler,
|
|
1825
1982
|
locale: e.locale || "",
|
|
1826
1983
|
timing: e.timing || {
|
|
@@ -1840,24 +1997,19 @@ function ssrCreateContainer(e) {
|
|
|
1840
1997
|
});
|
|
1841
1998
|
}
|
|
1842
1999
|
|
|
1843
|
-
var
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
}
|
|
1848
|
-
toString() {
|
|
1849
|
-
return this.buffer.join("");
|
|
1850
|
-
}
|
|
2000
|
+
var noopStreamHandler = {
|
|
2001
|
+
flush() {},
|
|
2002
|
+
waitForPendingFlush() {},
|
|
2003
|
+
streamBlockStart() {},
|
|
2004
|
+
streamBlockEnd() {}
|
|
1851
2005
|
};
|
|
1852
2006
|
|
|
1853
|
-
var Fi = {};
|
|
1854
|
-
|
|
1855
2007
|
var QTemplateProps = {
|
|
1856
2008
|
hidden: true,
|
|
1857
2009
|
"aria-hidden": true
|
|
1858
2010
|
};
|
|
1859
2011
|
|
|
1860
|
-
var SSRContainer = class extends
|
|
2012
|
+
var SSRContainer = class extends ic {
|
|
1861
2013
|
tag;
|
|
1862
2014
|
isHtml;
|
|
1863
2015
|
writer;
|
|
@@ -1867,7 +2019,12 @@ var SSRContainer = class extends Ou {
|
|
|
1867
2019
|
resolvedManifest;
|
|
1868
2020
|
symbolToChunkResolver;
|
|
1869
2021
|
renderOptions;
|
|
2022
|
+
outOfOrderStreaming;
|
|
1870
2023
|
serializationCtx;
|
|
2024
|
+
// Sometimes there is no app state, but framework metadata still points to a vnode id.
|
|
2025
|
+
// For example, an OOOS segment can point outside the segment to a root vnode through
|
|
2026
|
+
// q:sparent, so root vnode data must still be emitted for the client ref table.
|
|
2027
|
+
hasVNodeRefsForSerialization=false;
|
|
1871
2028
|
/**
|
|
1872
2029
|
* We use this to append additional nodes in the head node
|
|
1873
2030
|
*
|
|
@@ -1885,6 +2042,7 @@ var SSRContainer = class extends Ou {
|
|
|
1885
2042
|
currentComponentNode=null;
|
|
1886
2043
|
styleIds=/* @__PURE__ */ new Set;
|
|
1887
2044
|
isBackpatchExecutorEmitted=false;
|
|
2045
|
+
isOutOfOrderExecutorEmitted=false;
|
|
1888
2046
|
backpatchMap=/* @__PURE__ */ new Map;
|
|
1889
2047
|
currentElementFrame=null;
|
|
1890
2048
|
renderTimer;
|
|
@@ -1896,16 +2054,31 @@ var SSRContainer = class extends Ou {
|
|
|
1896
2054
|
*/
|
|
1897
2055
|
depthFirstElementCount=-1;
|
|
1898
2056
|
vNodeDatas=[];
|
|
2057
|
+
vNodeDataOffset=0;
|
|
1899
2058
|
componentStack=[];
|
|
1900
2059
|
cleanupQueue=[];
|
|
1901
2060
|
emitContainerDataFrame=null;
|
|
1902
|
-
|
|
2061
|
+
Te=randomStr();
|
|
1903
2062
|
// Temporary flag to find missing roots after the state was serialized
|
|
1904
2063
|
t=false;
|
|
1905
2064
|
qlInclude;
|
|
1906
2065
|
promiseAttributes=null;
|
|
2066
|
+
vnodeSegment=null;
|
|
2067
|
+
i=0 /* NotReady */;
|
|
2068
|
+
// OOOS related fields
|
|
2069
|
+
outOfOrderId=0;
|
|
2070
|
+
outOfOrderUsed=false;
|
|
2071
|
+
outOfOrderPendingSegments=[];
|
|
2072
|
+
outOfOrderSegments=[];
|
|
2073
|
+
rootContainerReadyPromise=null;
|
|
2074
|
+
resolveRootContainerReady=null;
|
|
2075
|
+
renderQueue=Promise.resolve();
|
|
2076
|
+
emittedQwikEventNames=/* @__PURE__ */ new Set;
|
|
2077
|
+
emittedSyncFnCount=0;
|
|
2078
|
+
rootContainerSerializedRootCount=0;
|
|
2079
|
+
emittedVNodeDataOwners=null;
|
|
1907
2080
|
constructor(e) {
|
|
1908
|
-
super(e.renderOptions.serverData ??
|
|
2081
|
+
super(e.renderOptions.serverData ?? {}, e.locale);
|
|
1909
2082
|
this.symbolToChunkResolver = e => {
|
|
1910
2083
|
const t = e.lastIndexOf("_");
|
|
1911
2084
|
const n = this.resolvedManifest.mapper[t == -1 ? e : e.substring(t + 1)];
|
|
@@ -1918,19 +2091,28 @@ var SSRContainer = class extends Ou {
|
|
|
1918
2091
|
this.writer = e.writer;
|
|
1919
2092
|
this.streamHandler = e.streamHandler;
|
|
1920
2093
|
this.timing = e.timing;
|
|
1921
|
-
this.
|
|
2094
|
+
this.qe = e.buildBase;
|
|
1922
2095
|
this.resolvedManifest = e.resolvedManifest;
|
|
1923
2096
|
this.renderOptions = e.renderOptions;
|
|
1924
|
-
this.
|
|
1925
|
-
|
|
1926
|
-
|
|
2097
|
+
const t = this.renderOptions.streaming?.outOfOrder === true;
|
|
2098
|
+
if (!__EXPERIMENTAL__.suspense) {
|
|
2099
|
+
if (t) {
|
|
2100
|
+
throw new Error('Out-of-order Suspense streaming requires `experimental: ["suspense"]` in the `qwikVite` plugin.');
|
|
2101
|
+
}
|
|
2102
|
+
this.outOfOrderStreaming = false;
|
|
2103
|
+
} else {
|
|
2104
|
+
this.outOfOrderStreaming = t;
|
|
2105
|
+
}
|
|
2106
|
+
this.Pe = 1e5;
|
|
2107
|
+
const n = this.renderOptions.qwikLoader;
|
|
2108
|
+
this.qlInclude = n ? typeof n === "object" ? n.include === "never" ? 2 /* Done */ : 0 /* Module */ : n === "inline" ? 1 /* Inline */ : n === "never" ? 2 /* Done */ : 0 /* Module */ : 0 /* Module */;
|
|
1927
2109
|
if (this.qlInclude === 0 /* Module */) {
|
|
1928
2110
|
const e = this.resolvedManifest?.manifest.qwikLoader;
|
|
1929
2111
|
if (!e) {
|
|
1930
2112
|
this.qlInclude = 1 /* Inline */;
|
|
1931
2113
|
}
|
|
1932
2114
|
}
|
|
1933
|
-
this.
|
|
2115
|
+
this.v();
|
|
1934
2116
|
}
|
|
1935
2117
|
ensureProjectionResolved(e) {}
|
|
1936
2118
|
handleError(e, t) {
|
|
@@ -1955,23 +2137,158 @@ var SSRContainer = class extends Ou {
|
|
|
1955
2137
|
await this.closeContainer();
|
|
1956
2138
|
}
|
|
1957
2139
|
async renderJSX(e, t) {
|
|
1958
|
-
await
|
|
2140
|
+
await Xn(this, e, t);
|
|
2141
|
+
}
|
|
2142
|
+
A() {
|
|
2143
|
+
return this.i === 2 /* OOOSReady */;
|
|
2144
|
+
}
|
|
2145
|
+
/** Queue OOOS serialization/write work that must not overlap with root state serialization. */ S(e) {
|
|
2146
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2147
|
+
return e();
|
|
2148
|
+
}
|
|
2149
|
+
if (this.i === 0 /* NotReady */) {
|
|
2150
|
+
return e();
|
|
2151
|
+
}
|
|
2152
|
+
const t = this.i === 1 /* DataStreamStarted */ ? this.renderQueue.then(() => this.C()).then(e) : this.renderQueue.then(e);
|
|
2153
|
+
this.renderQueue = t.catch(() => {});
|
|
2154
|
+
return t;
|
|
2155
|
+
}
|
|
2156
|
+
C() {
|
|
2157
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || this.A()) {
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2160
|
+
return this.rootContainerReadyPromise ||= new Promise(e => {
|
|
2161
|
+
this.resolveRootContainerReady = e;
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
I() {
|
|
2165
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || this.A()) {
|
|
2166
|
+
return;
|
|
2167
|
+
}
|
|
2168
|
+
this.rootContainerSerializedRootCount = this.serializationCtx.Yn.length;
|
|
2169
|
+
this.i = 2 /* OOOSReady */;
|
|
2170
|
+
this.resolveRootContainerReady?.();
|
|
2171
|
+
this.resolveRootContainerReady = null;
|
|
2172
|
+
this.rootContainerReadyPromise = null;
|
|
2173
|
+
}
|
|
2174
|
+
nextOutOfOrderId() {
|
|
2175
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2176
|
+
return 0;
|
|
2177
|
+
}
|
|
2178
|
+
this.outOfOrderUsed = true;
|
|
2179
|
+
return ++this.outOfOrderId;
|
|
2180
|
+
}
|
|
2181
|
+
emitOutOfOrderSegmentScripts(e) {
|
|
2182
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !e) {
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
this.write(e);
|
|
2186
|
+
}
|
|
2187
|
+
async segment(e, t, n) {
|
|
2188
|
+
if (!__EXPERIMENTAL__.suspense) {
|
|
2189
|
+
throw new Error('Out-of-order Suspense streaming requires `experimental: ["suspense"]` in the `qwikVite` plugin.');
|
|
2190
|
+
}
|
|
2191
|
+
if (!this.outOfOrderStreaming) {
|
|
2192
|
+
throw new Error("Out-of-order Suspense streaming requires `streaming.outOfOrder` to be `true`.");
|
|
2193
|
+
}
|
|
2194
|
+
this.markVNodeRefForSerialization(n.parentComponentFrame?.componentNode);
|
|
2195
|
+
const r = new StringBufferSegmentWriter;
|
|
2196
|
+
const s = this.createSegmentContainer(e, r);
|
|
2197
|
+
this.outOfOrderSegments.push(s);
|
|
2198
|
+
try {
|
|
2199
|
+
await s.renderJSX(t, n);
|
|
2200
|
+
await s.resolvePromiseAttributes();
|
|
2201
|
+
const e = r.extract();
|
|
2202
|
+
return {
|
|
2203
|
+
container: s,
|
|
2204
|
+
writer: r,
|
|
2205
|
+
htmlChunks: e
|
|
2206
|
+
};
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
this.removeOutOfOrderSegment(s);
|
|
2209
|
+
throw e;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
F() {
|
|
2213
|
+
let e = this;
|
|
2214
|
+
while (e instanceof SSRSegmentContainer) {
|
|
2215
|
+
e = e.Re;
|
|
2216
|
+
}
|
|
2217
|
+
return e;
|
|
2218
|
+
}
|
|
2219
|
+
createSegmentContainer(e, t) {
|
|
2220
|
+
const n = this.F();
|
|
2221
|
+
const r = this.getOrCreateLastNode();
|
|
2222
|
+
this.addRoot(r);
|
|
2223
|
+
this.markVNodeRefForSerialization(r);
|
|
2224
|
+
const s = {
|
|
2225
|
+
tagNesting: 10 /* ANYTHING */ ,
|
|
2226
|
+
parent: null,
|
|
2227
|
+
elementName: "#segment",
|
|
2228
|
+
depthFirstElementIdx: -1,
|
|
2229
|
+
// OOOS inserts this synthetic root under the Suspense content host on the client.
|
|
2230
|
+
vNodeData: [ 16 /* SERIALIZE */ ],
|
|
2231
|
+
currentFile: null,
|
|
2232
|
+
refBase: r.id
|
|
2233
|
+
};
|
|
2234
|
+
const i = new SSRSegmentContainer({
|
|
2235
|
+
tagName: this.tag,
|
|
2236
|
+
writer: t,
|
|
2237
|
+
streamHandler: noopStreamHandler,
|
|
2238
|
+
locale: this.jt,
|
|
2239
|
+
timing: this.timing,
|
|
2240
|
+
buildBase: this.qe || "/build/",
|
|
2241
|
+
resolvedManifest: this.resolvedManifest,
|
|
2242
|
+
renderOptions: this.renderOptions
|
|
2243
|
+
}, n);
|
|
2244
|
+
const o = i;
|
|
2245
|
+
o.Cn = true;
|
|
2246
|
+
o.dt = this.dt;
|
|
2247
|
+
i.serializationCtx = i.serializationCtxFactory(SsrNode, DomRef, this.symbolToChunkResolver, t);
|
|
2248
|
+
i.serializationCtx.gt = this.serializationCtx.gt.bind(this.serializationCtx);
|
|
2249
|
+
i.currentElementFrame = s;
|
|
2250
|
+
i.currentComponentNode = this.currentComponentNode;
|
|
2251
|
+
i.depthFirstElementCount = 0;
|
|
2252
|
+
i.vNodeDatas = [ s.vNodeData ];
|
|
2253
|
+
i.componentStack = this.componentStack.slice();
|
|
2254
|
+
i.vnodeSegment = e;
|
|
2255
|
+
i.styleIds = this.styleIds;
|
|
2256
|
+
i.emittedQwikEventNames = this.emittedQwikEventNames;
|
|
2257
|
+
i.qlInclude = 2 /* Done */;
|
|
2258
|
+
i.Te = this.Te;
|
|
2259
|
+
o._didAddQwikLoader = true;
|
|
2260
|
+
return i;
|
|
2261
|
+
}
|
|
2262
|
+
queueOutOfOrderSegment(e) {
|
|
2263
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
this.outOfOrderPendingSegments.push(e);
|
|
2267
|
+
}
|
|
2268
|
+
removeOutOfOrderSegment(e) {
|
|
2269
|
+
const t = this.outOfOrderSegments;
|
|
2270
|
+
for (let n = 0; n < t.length; n++) {
|
|
2271
|
+
if (t[n] === e) {
|
|
2272
|
+
t.splice(n, 1);
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
1959
2276
|
}
|
|
1960
2277
|
setContext(e, t, n) {
|
|
1961
2278
|
const r = e;
|
|
1962
|
-
let s = r.getProp(
|
|
2279
|
+
let s = r.getProp(Je);
|
|
1963
2280
|
if (s == null) {
|
|
1964
|
-
r.setProp(
|
|
2281
|
+
r.setProp(Je, s = []);
|
|
1965
2282
|
}
|
|
1966
|
-
|
|
2283
|
+
_e(s, t.id, n, 0, true);
|
|
1967
2284
|
this.addRoot(r);
|
|
1968
2285
|
}
|
|
1969
2286
|
resolveContext(e, t) {
|
|
1970
2287
|
let n = e;
|
|
1971
2288
|
while (n) {
|
|
1972
|
-
const e = n.getProp(
|
|
1973
|
-
if (e != null &&
|
|
1974
|
-
return
|
|
2289
|
+
const e = n.getProp(Je);
|
|
2290
|
+
if (e != null && Ee(e, t.id, 0)) {
|
|
2291
|
+
return ge(e, t.id, 0);
|
|
1975
2292
|
}
|
|
1976
2293
|
n = n.parentComponent;
|
|
1977
2294
|
}
|
|
@@ -1998,14 +2315,14 @@ var SSRContainer = class extends Ou {
|
|
|
1998
2315
|
}
|
|
1999
2316
|
const e = this.renderOptions.containerAttributes || {};
|
|
2000
2317
|
const t = e[QRenderAttr];
|
|
2001
|
-
e[
|
|
2318
|
+
e[es] = "paused" /* PAUSED */;
|
|
2002
2319
|
e[QRuntimeAttr] = "2";
|
|
2003
|
-
e[QVersionAttr] = this.
|
|
2004
|
-
e[QRenderAttr] = (t ? t + "-" : "") + (
|
|
2005
|
-
e[
|
|
2006
|
-
e[QLocaleAttr] = this.
|
|
2320
|
+
e[QVersionAttr] = this.ke ?? "dev";
|
|
2321
|
+
e[QRenderAttr] = (t ? t + "-" : "") + (isDev8 ? "ssr-dev" : "ssr");
|
|
2322
|
+
e[Ge] = this.qe || "";
|
|
2323
|
+
e[QLocaleAttr] = this.jt;
|
|
2007
2324
|
e[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
2008
|
-
e[QInstanceAttr] = this.
|
|
2325
|
+
e[QInstanceAttr] = this.Te;
|
|
2009
2326
|
this.Dt.containerAttributes = e;
|
|
2010
2327
|
this.openElement(this.tag, null, e);
|
|
2011
2328
|
if (!this.isHtml) {
|
|
@@ -2015,22 +2332,22 @@ var SSRContainer = class extends Ou {
|
|
|
2015
2332
|
/** Renders closing tag for current container */ closeContainer() {
|
|
2016
2333
|
return this.closeElement();
|
|
2017
2334
|
}
|
|
2018
|
-
|
|
2335
|
+
qt=0;
|
|
2019
2336
|
/** Renders opening tag for DOM element */
|
|
2020
2337
|
openElement(e, t, n, r = null, s = null, i = null, o = true) {
|
|
2021
2338
|
const a = isQwikStyleElement(e, n) || isQwikStyleElement(e, r);
|
|
2022
|
-
if (e
|
|
2023
|
-
this.
|
|
2339
|
+
if (NO_SCRIPT_HERE_ELEMENTS.has(e)) {
|
|
2340
|
+
this.qt++;
|
|
2024
2341
|
}
|
|
2025
2342
|
if (
|
|
2026
2343
|
// don't append qwik loader before qwik style elements
|
|
2027
2344
|
// it will confuse the resuming, because styles are expected to be the first nodes in subtree
|
|
2028
2345
|
!a && this.qlInclude === 1 /* Inline */) {
|
|
2029
|
-
if (this.
|
|
2346
|
+
if (this.qt === 0 && this.size > 30 * 1024 && e !== "body") {
|
|
2030
2347
|
this.emitQwikLoaderInline();
|
|
2031
2348
|
}
|
|
2032
2349
|
}
|
|
2033
|
-
let
|
|
2350
|
+
let c = void 0;
|
|
2034
2351
|
this.lastNode = null;
|
|
2035
2352
|
if (!a && this.currentElementFrame) {
|
|
2036
2353
|
vNodeData_incrementElementCount(this.currentElementFrame.vNodeData);
|
|
@@ -2042,31 +2359,31 @@ var SSRContainer = class extends Ou {
|
|
|
2042
2359
|
vNodeData_openElement(this.currentElementFrame.vNodeData);
|
|
2043
2360
|
this.write(LT);
|
|
2044
2361
|
this.write(e);
|
|
2045
|
-
const
|
|
2362
|
+
const l = this.getOrCreateLastNode();
|
|
2046
2363
|
if (n) {
|
|
2047
|
-
|
|
2364
|
+
c = this.writeAttrs(e, n, false, s, i, o);
|
|
2048
2365
|
}
|
|
2049
|
-
this.write(" " +
|
|
2366
|
+
this.write(" " + Es);
|
|
2050
2367
|
if (t !== null) {
|
|
2051
2368
|
this.write(`="${t}"`);
|
|
2052
|
-
} else if (
|
|
2369
|
+
} else if (qTest) {
|
|
2053
2370
|
this.write(EMPTY_ATTR);
|
|
2054
2371
|
}
|
|
2055
|
-
if (r && !
|
|
2056
|
-
|
|
2372
|
+
if (r && !hr(r)) {
|
|
2373
|
+
c = this.writeAttrs(e, r, true, s, i, o) || c;
|
|
2057
2374
|
}
|
|
2058
2375
|
this.write(GT);
|
|
2059
|
-
if (
|
|
2060
|
-
|
|
2376
|
+
if (l) {
|
|
2377
|
+
l.setTreeNonUpdatable();
|
|
2061
2378
|
}
|
|
2062
|
-
return
|
|
2379
|
+
return c;
|
|
2063
2380
|
}
|
|
2064
2381
|
/** Renders closing tag for DOM element */ closeElement() {
|
|
2065
2382
|
if (this.currentElementFrame === this.emitContainerDataFrame) {
|
|
2066
2383
|
this.emitContainerDataFrame = null;
|
|
2067
2384
|
this.onRenderDone();
|
|
2068
2385
|
const e = createTimer();
|
|
2069
|
-
return
|
|
2386
|
+
return qs(qs(this.emitContainerData(), () => this._closeElement()), () => {
|
|
2070
2387
|
this.timing.snapshot = e();
|
|
2071
2388
|
});
|
|
2072
2389
|
}
|
|
@@ -2082,7 +2399,7 @@ var SSRContainer = class extends Ou {
|
|
|
2082
2399
|
for (let t = 0; t < e.length; t++) {
|
|
2083
2400
|
const n = e[t];
|
|
2084
2401
|
if (hasDestroy(n)) {
|
|
2085
|
-
n.
|
|
2402
|
+
n.Tn();
|
|
2086
2403
|
}
|
|
2087
2404
|
}
|
|
2088
2405
|
e = this.cleanupQueue.pop();
|
|
@@ -2097,8 +2414,8 @@ var SSRContainer = class extends Ou {
|
|
|
2097
2414
|
this.write(GT);
|
|
2098
2415
|
}
|
|
2099
2416
|
this.lastNode = null;
|
|
2100
|
-
if (t
|
|
2101
|
-
this.
|
|
2417
|
+
if (NO_SCRIPT_HERE_ELEMENTS.has(t)) {
|
|
2418
|
+
this.qt--;
|
|
2102
2419
|
}
|
|
2103
2420
|
}
|
|
2104
2421
|
/** Writes opening data to vNodeData for fragment boundaries */ openFragment(e) {
|
|
@@ -2117,7 +2434,13 @@ var SSRContainer = class extends Ou {
|
|
|
2117
2434
|
this.openFragment(e);
|
|
2118
2435
|
const t = this.getComponentFrame();
|
|
2119
2436
|
if (t) {
|
|
2120
|
-
this.
|
|
2437
|
+
const e = this.getOrCreateLastNode();
|
|
2438
|
+
this.markVNodeRefForSerialization(e);
|
|
2439
|
+
if (!this.vnodeSegment) {
|
|
2440
|
+
this.addRoot(t.componentNode);
|
|
2441
|
+
} else {
|
|
2442
|
+
this.markVNodeRefForSerialization(t.componentNode);
|
|
2443
|
+
}
|
|
2121
2444
|
t.projectionDepth++;
|
|
2122
2445
|
}
|
|
2123
2446
|
}
|
|
@@ -2158,21 +2481,24 @@ var SSRContainer = class extends Ou {
|
|
|
2158
2481
|
if (e.slots.length === 0) {
|
|
2159
2482
|
return;
|
|
2160
2483
|
}
|
|
2161
|
-
this.openElement(
|
|
2484
|
+
this.openElement(is, null, QTemplateProps, null);
|
|
2162
2485
|
const t = e.projectionScopedStyle;
|
|
2163
2486
|
for (let n = 0; n < e.slots.length; n += 2) {
|
|
2164
2487
|
const r = e.slots[n];
|
|
2165
2488
|
const s = e.slots[n + 1];
|
|
2166
|
-
this.
|
|
2167
|
-
|
|
2168
|
-
|
|
2489
|
+
if (this.vnodeSegment) {
|
|
2490
|
+
this.markVNodeRefForSerialization(e.componentNode);
|
|
2491
|
+
}
|
|
2492
|
+
this.openFragment(isDev8 ? {
|
|
2493
|
+
[xe]: "P" /* Projection */ ,
|
|
2494
|
+
[QSlotParent]: e.componentNode.id,
|
|
2495
|
+
[De]: r
|
|
2169
2496
|
} : {
|
|
2170
|
-
[QSlotParent]: e.componentNode.id
|
|
2497
|
+
[QSlotParent]: e.componentNode.id,
|
|
2498
|
+
[De]: r
|
|
2171
2499
|
});
|
|
2172
2500
|
const i = this.getOrCreateLastNode();
|
|
2173
|
-
|
|
2174
|
-
i.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
2175
|
-
}
|
|
2501
|
+
i.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
2176
2502
|
e.componentNode.setProp(r, i.id);
|
|
2177
2503
|
await this.renderJSX(s, {
|
|
2178
2504
|
currentStyleScoped: t,
|
|
@@ -2195,29 +2521,31 @@ var SSRContainer = class extends Ou {
|
|
|
2195
2521
|
}
|
|
2196
2522
|
addRoot(e) {
|
|
2197
2523
|
if (this.t) {
|
|
2198
|
-
|
|
2524
|
+
const t = this.serializationCtx.ge(e);
|
|
2525
|
+
return t;
|
|
2199
2526
|
}
|
|
2200
|
-
return this.serializationCtx.
|
|
2527
|
+
return this.serializationCtx.St(e);
|
|
2201
2528
|
}
|
|
2202
2529
|
getOrCreateLastNode() {
|
|
2203
2530
|
if (!this.lastNode) {
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
this.
|
|
2531
|
+
const e = this.currentElementFrame;
|
|
2532
|
+
const t = e.depthFirstElementIdx + 1;
|
|
2533
|
+
const n = e.refBase ?? (this.vnodeSegment ? je(this.vnodeSegment, t) : t + this.vNodeDataOffset);
|
|
2534
|
+
this.lastNode = vNodeData_createSsrNodeReference(this.currentComponentNode, e.vNodeData, n, this.cleanupQueue, e.currentFile);
|
|
2207
2535
|
}
|
|
2208
2536
|
return this.lastNode;
|
|
2209
2537
|
}
|
|
2210
2538
|
addUnclaimedProjection(e, t, n) {
|
|
2211
2539
|
e.slots.push(t, n);
|
|
2212
2540
|
}
|
|
2213
|
-
|
|
2541
|
+
v() {
|
|
2214
2542
|
const e = this.resolvedManifest.manifest.injections;
|
|
2215
2543
|
if (!e) {
|
|
2216
2544
|
return;
|
|
2217
2545
|
}
|
|
2218
2546
|
for (let t = 0; t < e.length; t++) {
|
|
2219
2547
|
const n = e[t];
|
|
2220
|
-
const r =
|
|
2548
|
+
const r = Xi(n.tag, null, n.attributes || {}, null, 0, null);
|
|
2221
2549
|
if (n.location === "head") {
|
|
2222
2550
|
this.additionalHeadNodes.push(r);
|
|
2223
2551
|
} else {
|
|
@@ -2225,19 +2553,19 @@ var SSRContainer = class extends Ou {
|
|
|
2225
2553
|
}
|
|
2226
2554
|
}
|
|
2227
2555
|
}
|
|
2228
|
-
|
|
2556
|
+
Xe(e, t, n, r) {
|
|
2229
2557
|
if (r) {
|
|
2230
2558
|
const e = this.getComponentFrame(0);
|
|
2231
2559
|
e.scopedStyleIds.add(t);
|
|
2232
2560
|
const r = convertStyleIdsToString(e.scopedStyleIds);
|
|
2233
|
-
this.setHostProp(n,
|
|
2561
|
+
this.setHostProp(n, He, r);
|
|
2234
2562
|
}
|
|
2235
2563
|
if (!this.styleIds.has(t)) {
|
|
2236
2564
|
this.styleIds.add(t);
|
|
2237
2565
|
if (this.currentElementFrame?.elementName === "html") {
|
|
2238
|
-
this.additionalHeadNodes.push(
|
|
2566
|
+
this.additionalHeadNodes.push(Fi("style", null, {
|
|
2239
2567
|
dangerouslySetInnerHTML: e,
|
|
2240
|
-
[
|
|
2568
|
+
[Ue]: t
|
|
2241
2569
|
}, null, 0, t));
|
|
2242
2570
|
} else {
|
|
2243
2571
|
this._styleNode(t, e);
|
|
@@ -2246,22 +2574,65 @@ var SSRContainer = class extends Ou {
|
|
|
2246
2574
|
}
|
|
2247
2575
|
_styleNode(e, t) {
|
|
2248
2576
|
this.openElement("style", null, {
|
|
2249
|
-
[
|
|
2577
|
+
[Ue]: e
|
|
2250
2578
|
});
|
|
2251
2579
|
this.write(t);
|
|
2252
2580
|
this.closeElement();
|
|
2253
2581
|
}
|
|
2582
|
+
ut(e) {
|
|
2583
|
+
if (this.isHtml && this.currentElementFrame?.elementName === "html") {
|
|
2584
|
+
this.additionalHeadNodes.push(e);
|
|
2585
|
+
return true;
|
|
2586
|
+
}
|
|
2587
|
+
return false;
|
|
2588
|
+
}
|
|
2254
2589
|
////////////////////////////////////
|
|
2255
2590
|
emitContainerData() {
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2591
|
+
const e = this.renderOptions.streaming?.inOrder?.strategy === "disabled";
|
|
2592
|
+
const t = !e || __EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed;
|
|
2593
|
+
return qs(qs(t ? this.streamHandler.flush() : void 0, () => this.resolvePromiseAttributes()), () => {
|
|
2594
|
+
this.i = 1 /* DataStreamStarted */;
|
|
2595
|
+
return qs(this.emitStateData(), () => {
|
|
2596
|
+
this.t = true;
|
|
2597
|
+
return qs(this.emitRestStateData(), () => this.emitOutOfOrderSegmentsAndData());
|
|
2598
|
+
});
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
emitRestStateData() {
|
|
2602
|
+
this.emitVNodeData();
|
|
2603
|
+
this.emitDelayedOutOfOrderSegmentVNodeData();
|
|
2604
|
+
if (!isDev8) {
|
|
2259
2605
|
preloaderPost(this, this.renderOptions, this.Dt?.nonce);
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2606
|
+
}
|
|
2607
|
+
this.emitSyncFnsData();
|
|
2608
|
+
this.emitPatchDataIfNeeded();
|
|
2609
|
+
this.emitExecutorIfNeeded();
|
|
2610
|
+
this.emitQwikLoaderAtBottomIfNeeded();
|
|
2611
|
+
this.emitContainerReadyEventIfNeeded();
|
|
2612
|
+
}
|
|
2613
|
+
emitDelayedOutOfOrderSegmentVNodeData() {
|
|
2614
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
2615
|
+
return;
|
|
2616
|
+
}
|
|
2617
|
+
for (let e = 0; e < this.outOfOrderSegments.length; e++) {
|
|
2618
|
+
const t = this.outOfOrderSegments[e];
|
|
2619
|
+
if (t.Qe === 1 /* EarlyFinalized */) {
|
|
2620
|
+
t.He();
|
|
2621
|
+
e--;
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
emitOutOfOrderSegmentsAndData() {
|
|
2626
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
2627
|
+
return;
|
|
2628
|
+
}
|
|
2629
|
+
this.emitOutOfOrderExecutorIfNeeded();
|
|
2630
|
+
return qs(this.streamHandler.flush(), async () => {
|
|
2631
|
+
this.I();
|
|
2632
|
+
if (this.outOfOrderPendingSegments.length) {
|
|
2633
|
+
await Promise.all(this.outOfOrderPendingSegments);
|
|
2634
|
+
}
|
|
2635
|
+
});
|
|
2265
2636
|
}
|
|
2266
2637
|
/**
|
|
2267
2638
|
* Serialize the vNodeData into a string and emit it as a script tag.
|
|
@@ -2280,50 +2651,59 @@ var SSRContainer = class extends Ou {
|
|
|
2280
2651
|
*
|
|
2281
2652
|
* NOTE: Not every element will need vNodeData. So we need to encode how many elements should be
|
|
2282
2653
|
* skipped. By choosing different separators we can encode different numbers of elements to skip.
|
|
2283
|
-
*/ emitVNodeData() {
|
|
2284
|
-
|
|
2654
|
+
*/ emitVNodeData(e) {
|
|
2655
|
+
this.F().markVNodeDataOwnerEmitted(e);
|
|
2656
|
+
if (!e && !this.serializationCtx.Yn.length && !this.hasVNodeRefsForSerialization) {
|
|
2285
2657
|
return;
|
|
2286
2658
|
}
|
|
2287
|
-
this.
|
|
2659
|
+
this.emitVNodeDataScript(e, this.vNodeDatas.entries());
|
|
2660
|
+
}
|
|
2661
|
+
emitVNodeDataScript(e, t, n = false) {
|
|
2662
|
+
const r = {
|
|
2288
2663
|
type: "qwik/vnode"
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2664
|
+
};
|
|
2665
|
+
if (__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && e) {
|
|
2666
|
+
r[kh] = e;
|
|
2667
|
+
}
|
|
2668
|
+
if (n) {
|
|
2669
|
+
r[QStatePatchAttr] = true;
|
|
2670
|
+
}
|
|
2671
|
+
this.openScript(r);
|
|
2672
|
+
const s = [];
|
|
2673
|
+
let i = 0;
|
|
2674
|
+
for (const [e, n] of t) {
|
|
2675
|
+
const t = n[0];
|
|
2676
|
+
if (t & 16 /* SERIALIZE */) {
|
|
2677
|
+
i = this.emitVNodeSeparators(i, e);
|
|
2678
|
+
if (t & 8 /* REFERENCE */) {
|
|
2299
2679
|
this.write(VNodeDataSeparator.REFERENCE_CH);
|
|
2300
2680
|
}
|
|
2301
|
-
if (
|
|
2302
|
-
let
|
|
2303
|
-
let
|
|
2304
|
-
for (let r = 1; r <
|
|
2305
|
-
const i =
|
|
2681
|
+
if (t & (1 /* TEXT_DATA */ | 2 /* VIRTUAL_NODE */ | 4 /* ELEMENT_NODE */)) {
|
|
2682
|
+
let e = null;
|
|
2683
|
+
let t = 0;
|
|
2684
|
+
for (let r = 1; r < n.length; r++) {
|
|
2685
|
+
const i = n[r];
|
|
2306
2686
|
if (typeof i === "object" && i !== null) {
|
|
2307
|
-
|
|
2308
|
-
|
|
2687
|
+
s.push(e);
|
|
2688
|
+
e = i;
|
|
2309
2689
|
} else if (i === OPEN_FRAGMENT) {
|
|
2310
|
-
|
|
2690
|
+
t++;
|
|
2311
2691
|
this.write(VNodeDataChar.OPEN_CHAR);
|
|
2312
2692
|
} else if (i === CLOSE_FRAGMENT) {
|
|
2313
|
-
if (
|
|
2314
|
-
this.writeFragmentAttrs(
|
|
2315
|
-
|
|
2693
|
+
if (e) {
|
|
2694
|
+
this.writeFragmentAttrs(e);
|
|
2695
|
+
e = s.pop();
|
|
2316
2696
|
}
|
|
2317
|
-
|
|
2697
|
+
t--;
|
|
2318
2698
|
this.write(VNodeDataChar.CLOSE_CHAR);
|
|
2319
2699
|
} else if (i === WRITE_ELEMENT_ATTRS) {
|
|
2320
|
-
if (
|
|
2700
|
+
if (e && !hr(e)) {
|
|
2321
2701
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2322
2702
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2323
|
-
this.writeFragmentAttrs(
|
|
2703
|
+
this.writeFragmentAttrs(e);
|
|
2324
2704
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2325
2705
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2326
|
-
|
|
2706
|
+
e = s.pop();
|
|
2327
2707
|
}
|
|
2328
2708
|
} else if (i >= 0) {
|
|
2329
2709
|
this.write(encodeAsAlphanumeric(i));
|
|
@@ -2331,60 +2711,101 @@ var SSRContainer = class extends Ou {
|
|
|
2331
2711
|
this.write(String(0 - i));
|
|
2332
2712
|
}
|
|
2333
2713
|
}
|
|
2334
|
-
while (
|
|
2335
|
-
if (
|
|
2336
|
-
this.writeFragmentAttrs(
|
|
2337
|
-
|
|
2714
|
+
while (t-- > 0) {
|
|
2715
|
+
if (e) {
|
|
2716
|
+
this.writeFragmentAttrs(e);
|
|
2717
|
+
e = s.pop();
|
|
2338
2718
|
}
|
|
2339
2719
|
this.write(VNodeDataChar.CLOSE_CHAR);
|
|
2340
2720
|
}
|
|
2341
2721
|
}
|
|
2342
2722
|
}
|
|
2343
2723
|
}
|
|
2344
|
-
this.
|
|
2724
|
+
this.closeScript();
|
|
2725
|
+
if (n && !e) {
|
|
2726
|
+
this.emitInlineScript("document.qProcessVNodeDataPatch&&document.qProcessVNodeDataPatch(document.currentScript.previousElementSibling)");
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
markVNodeRefForSerialization(e) {
|
|
2730
|
+
if (e) {
|
|
2731
|
+
this.hasVNodeRefsForSerialization = true;
|
|
2732
|
+
e.vnodeData[0] |= 16 /* SERIALIZE */ | 8 /* REFERENCE */;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
markVNodeDataOwnerEmitted(e) {
|
|
2736
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
(this.emittedVNodeDataOwners ||= /* @__PURE__ */ new Set).add(e);
|
|
2740
|
+
}
|
|
2741
|
+
isVNodeDataOwnerEmitted(e) {
|
|
2742
|
+
return this.emittedVNodeDataOwners?.has(e) === true;
|
|
2743
|
+
}
|
|
2744
|
+
getVNodeDataOwnerFromNodeId(e) {
|
|
2745
|
+
const t = parseInt(e, 10);
|
|
2746
|
+
if (t >= 0) {
|
|
2747
|
+
return {
|
|
2748
|
+
owner: void 0,
|
|
2749
|
+
localIndex: t
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2752
|
+
const n = -t - 1;
|
|
2753
|
+
const r = Math.floor((Math.sqrt(8 * n + 1) - 1) / 2);
|
|
2754
|
+
const s = r * (r + 1) / 2;
|
|
2755
|
+
const i = n - s;
|
|
2756
|
+
const o = r - i;
|
|
2757
|
+
return {
|
|
2758
|
+
owner: String(o + 1),
|
|
2759
|
+
localIndex: i
|
|
2760
|
+
};
|
|
2345
2761
|
}
|
|
2346
2762
|
writeFragmentAttrs(e) {
|
|
2347
2763
|
for (const t in e) {
|
|
2348
|
-
|
|
2349
|
-
let r =
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2764
|
+
const n = e[t];
|
|
2765
|
+
let r = n;
|
|
2766
|
+
let s;
|
|
2767
|
+
let i = null;
|
|
2768
|
+
if (t === as && typeof n === "number") {
|
|
2769
|
+
s = n;
|
|
2770
|
+
r = String(n);
|
|
2771
|
+
} else if (typeof n !== "string") {
|
|
2772
|
+
s = this.addRoot(n);
|
|
2773
|
+
if (s === void 0) {
|
|
2353
2774
|
continue;
|
|
2354
2775
|
}
|
|
2355
|
-
|
|
2776
|
+
r = String(s);
|
|
2356
2777
|
}
|
|
2357
2778
|
switch (t) {
|
|
2358
|
-
case
|
|
2779
|
+
case He:
|
|
2359
2780
|
this.write(VNodeDataChar.SCOPED_STYLE_CHAR);
|
|
2360
2781
|
break;
|
|
2361
2782
|
|
|
2362
|
-
case
|
|
2783
|
+
case Le:
|
|
2363
2784
|
this.write(VNodeDataChar.RENDER_FN_CHAR);
|
|
2364
2785
|
break;
|
|
2365
2786
|
|
|
2366
|
-
case
|
|
2787
|
+
case as:
|
|
2367
2788
|
this.write(VNodeDataChar.ID_CHAR);
|
|
2368
2789
|
break;
|
|
2369
2790
|
|
|
2370
|
-
case
|
|
2791
|
+
case ds:
|
|
2371
2792
|
this.write(VNodeDataChar.PROPS_CHAR);
|
|
2372
2793
|
break;
|
|
2373
2794
|
|
|
2374
|
-
case
|
|
2375
|
-
|
|
2795
|
+
case hs:
|
|
2796
|
+
i = encodeVNodeDataKey;
|
|
2376
2797
|
this.write(VNodeDataChar.KEY_CHAR);
|
|
2377
2798
|
break;
|
|
2378
2799
|
|
|
2379
|
-
case
|
|
2800
|
+
case ps:
|
|
2380
2801
|
this.write(VNodeDataChar.SEQ_CHAR);
|
|
2381
2802
|
break;
|
|
2382
2803
|
|
|
2383
|
-
case
|
|
2804
|
+
case $s:
|
|
2384
2805
|
this.write(VNodeDataChar.SEQ_IDX_CHAR);
|
|
2385
2806
|
break;
|
|
2386
2807
|
|
|
2387
|
-
case
|
|
2808
|
+
case Qe:
|
|
2388
2809
|
this.write(VNodeDataChar.BACK_REFS_CHAR);
|
|
2389
2810
|
break;
|
|
2390
2811
|
|
|
@@ -2393,68 +2814,86 @@ var SSRContainer = class extends Ou {
|
|
|
2393
2814
|
break;
|
|
2394
2815
|
|
|
2395
2816
|
// Skipping `\` character for now because it is used for escaping.
|
|
2396
|
-
case
|
|
2817
|
+
case Je:
|
|
2397
2818
|
this.write(VNodeDataChar.CONTEXT_CHAR);
|
|
2398
2819
|
break;
|
|
2399
2820
|
|
|
2400
|
-
case
|
|
2821
|
+
case De:
|
|
2401
2822
|
this.write(VNodeDataChar.SLOT_CHAR);
|
|
2402
2823
|
break;
|
|
2403
2824
|
|
|
2404
2825
|
default:
|
|
2405
2826
|
{
|
|
2406
|
-
|
|
2827
|
+
i = encodeURI;
|
|
2407
2828
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2408
2829
|
this.write(encodeVNodeDataString(t));
|
|
2409
2830
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2410
2831
|
}
|
|
2411
2832
|
}
|
|
2412
|
-
const
|
|
2413
|
-
const
|
|
2414
|
-
if (
|
|
2833
|
+
const o = encodeVNodeDataString(i ? i(r) : r);
|
|
2834
|
+
const a = i ? o !== r : false;
|
|
2835
|
+
if (a) {
|
|
2415
2836
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2416
|
-
this.write(
|
|
2837
|
+
this.write(o);
|
|
2417
2838
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2839
|
+
} else if (typeof s === "number") {
|
|
2840
|
+
this.writeRootRef(s);
|
|
2418
2841
|
} else {
|
|
2419
|
-
this.write(
|
|
2842
|
+
this.write(r);
|
|
2420
2843
|
}
|
|
2421
2844
|
}
|
|
2422
2845
|
}
|
|
2423
2846
|
emitStateData() {
|
|
2424
|
-
if (!this.serializationCtx.
|
|
2847
|
+
if (!this.serializationCtx.Yn.length) {
|
|
2425
2848
|
return;
|
|
2426
2849
|
}
|
|
2427
2850
|
const e = this.stateScriptAttrs();
|
|
2428
|
-
this.
|
|
2429
|
-
|
|
2430
|
-
|
|
2851
|
+
this.openScript(e);
|
|
2852
|
+
this.serializationCtx.Bn(this.writer);
|
|
2853
|
+
return qs(this.serializationCtx.It(), () => {
|
|
2854
|
+
this.closeScript();
|
|
2431
2855
|
});
|
|
2432
2856
|
}
|
|
2433
2857
|
/** Add q-d:qidle attribute to eagerly resume some state if needed */ stateScriptAttrs() {
|
|
2434
2858
|
const e = {
|
|
2435
|
-
type: "qwik/state"
|
|
2859
|
+
type: "qwik/state",
|
|
2860
|
+
[QInstanceAttr]: this.Te
|
|
2436
2861
|
};
|
|
2437
|
-
const t = this.serializationCtx.
|
|
2862
|
+
const t = this.serializationCtx.Tt;
|
|
2438
2863
|
if (t.size > 0) {
|
|
2439
|
-
e["q-d:qidle"] =
|
|
2864
|
+
e["q-d:qidle"] = Mf(null, "_res", _, null, [ ...t ]);
|
|
2440
2865
|
}
|
|
2441
2866
|
return e;
|
|
2442
2867
|
}
|
|
2443
|
-
emitSyncFnsData() {
|
|
2444
|
-
const
|
|
2445
|
-
|
|
2446
|
-
|
|
2868
|
+
emitSyncFnsData(e = false) {
|
|
2869
|
+
const t = this.serializationCtx.$e;
|
|
2870
|
+
const n = e ? this.emittedSyncFnCount : 0;
|
|
2871
|
+
if (t.length > n) {
|
|
2872
|
+
const r = {
|
|
2447
2873
|
"q:func": "qwik/json"
|
|
2448
2874
|
};
|
|
2449
2875
|
if (this.renderOptions.serverData?.nonce) {
|
|
2450
|
-
|
|
2876
|
+
r["nonce"] = this.renderOptions.serverData.nonce;
|
|
2451
2877
|
}
|
|
2452
|
-
this.
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2878
|
+
this.openScript(r);
|
|
2879
|
+
if (e) {
|
|
2880
|
+
const e = Q_FUNCS_PREFIX.replace("HASH", this.Te).slice(0, -1);
|
|
2881
|
+
this.write(`(${e}||(${e}=[])).push(`);
|
|
2882
|
+
} else {
|
|
2883
|
+
this.write(Q_FUNCS_PREFIX.replace("HASH", this.Te));
|
|
2884
|
+
}
|
|
2885
|
+
if (!e) {
|
|
2886
|
+
this.write($r);
|
|
2887
|
+
}
|
|
2888
|
+
this.writeArray(e ? t.slice(n) : t, mr);
|
|
2889
|
+
if (!e) {
|
|
2890
|
+
this.write(yr);
|
|
2891
|
+
}
|
|
2892
|
+
if (e) {
|
|
2893
|
+
this.write(")");
|
|
2894
|
+
}
|
|
2895
|
+
this.closeScript();
|
|
2896
|
+
this.emittedSyncFnCount = t.length;
|
|
2458
2897
|
}
|
|
2459
2898
|
}
|
|
2460
2899
|
emitPatchDataIfNeeded() {
|
|
@@ -2462,7 +2901,7 @@ var SSRContainer = class extends Ou {
|
|
|
2462
2901
|
for (const [t, n] of this.backpatchMap) {
|
|
2463
2902
|
for (let r = 0; r < n.length; r++) {
|
|
2464
2903
|
const s = n[r];
|
|
2465
|
-
e.push(t, s.attrName,
|
|
2904
|
+
e.push(t, s.attrName, iu(s.value) ? s.value.untrackedValue : s.value);
|
|
2466
2905
|
}
|
|
2467
2906
|
}
|
|
2468
2907
|
this.backpatchMap.clear();
|
|
@@ -2474,38 +2913,86 @@ var SSRContainer = class extends Ou {
|
|
|
2474
2913
|
if (this.renderOptions.serverData?.nonce) {
|
|
2475
2914
|
t["nonce"] = this.renderOptions.serverData.nonce;
|
|
2476
2915
|
}
|
|
2477
|
-
this.
|
|
2478
|
-
this.write(JSON.stringify(e));
|
|
2479
|
-
this.closeElement();
|
|
2916
|
+
this.writeScript(t, JSON.stringify(e));
|
|
2480
2917
|
}
|
|
2481
2918
|
}
|
|
2919
|
+
emitBackpatchDataAndExecutorIfNeeded() {
|
|
2920
|
+
if (this.backpatchMap.size === 0) {
|
|
2921
|
+
return;
|
|
2922
|
+
}
|
|
2923
|
+
this.emitPatchDataIfNeeded();
|
|
2924
|
+
this.emitExecutorIfNeeded();
|
|
2925
|
+
}
|
|
2482
2926
|
emitExecutorIfNeeded() {
|
|
2483
2927
|
if (!this.isBackpatchExecutorEmitted) {
|
|
2484
2928
|
return;
|
|
2485
2929
|
}
|
|
2930
|
+
this.isBackpatchExecutorEmitted = false;
|
|
2486
2931
|
const e = {
|
|
2487
2932
|
type: "text/javascript"
|
|
2488
2933
|
};
|
|
2489
2934
|
if (this.renderOptions.serverData?.nonce) {
|
|
2490
2935
|
e["nonce"] = this.renderOptions.serverData.nonce;
|
|
2491
2936
|
}
|
|
2492
|
-
this.openElement("script", null, e);
|
|
2493
2937
|
const t = getQwikBackpatchExecutorScript({
|
|
2494
|
-
debug:
|
|
2938
|
+
debug: isDev8
|
|
2495
2939
|
});
|
|
2496
|
-
this.
|
|
2497
|
-
|
|
2940
|
+
this.writeScript(e, t);
|
|
2941
|
+
}
|
|
2942
|
+
emitOutOfOrderExecutorIfNeeded() {
|
|
2943
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed || this.isOutOfOrderExecutorEmitted) {
|
|
2944
|
+
return;
|
|
2945
|
+
}
|
|
2946
|
+
this.isOutOfOrderExecutorEmitted = true;
|
|
2947
|
+
this.writeScript({
|
|
2948
|
+
type: "text/javascript",
|
|
2949
|
+
nonce: this.renderOptions.serverData?.nonce
|
|
2950
|
+
}, getQwikOutOfOrderExecutorScript({
|
|
2951
|
+
debug: isDev8
|
|
2952
|
+
}));
|
|
2953
|
+
}
|
|
2954
|
+
emitInlineScript(e) {
|
|
2955
|
+
const t = {
|
|
2956
|
+
type: "text/javascript"
|
|
2957
|
+
};
|
|
2958
|
+
if (this.renderOptions.serverData?.nonce) {
|
|
2959
|
+
t["nonce"] = this.renderOptions.serverData.nonce;
|
|
2960
|
+
}
|
|
2961
|
+
this.writeScript(t, e);
|
|
2962
|
+
}
|
|
2963
|
+
emitContainerReadyEventIfNeeded() {
|
|
2964
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
this.emitInlineScript(`document.qready||(document.qready={});document.qready["${this.Te}"]=1;try{document.dispatchEvent(new CustomEvent("qready",{detail:"${this.Te}"}))}catch(e){}`);
|
|
2968
|
+
}
|
|
2969
|
+
writeScript(e, t) {
|
|
2970
|
+
this.openScript(e);
|
|
2971
|
+
if (t) {
|
|
2972
|
+
this.write(t);
|
|
2973
|
+
}
|
|
2974
|
+
this.closeScript();
|
|
2975
|
+
}
|
|
2976
|
+
openScript(e) {
|
|
2977
|
+
this.write("<script");
|
|
2978
|
+
this.writeAttrs("script", e, true, null, null, true);
|
|
2979
|
+
this.write(GT);
|
|
2980
|
+
}
|
|
2981
|
+
closeScript() {
|
|
2982
|
+
this.write("<\/script>");
|
|
2498
2983
|
}
|
|
2499
2984
|
emitPreloaderPre() {
|
|
2500
|
-
|
|
2985
|
+
if (!isDev8) {
|
|
2986
|
+
preloaderPre(this, this.renderOptions.preloader, this.renderOptions.serverData?.nonce);
|
|
2987
|
+
}
|
|
2501
2988
|
}
|
|
2502
2989
|
isStatic() {
|
|
2503
|
-
return this.serializationCtx.
|
|
2990
|
+
return !(__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed) && this.serializationCtx.xt.size === 0;
|
|
2504
2991
|
}
|
|
2505
2992
|
emitQwikLoaderAtTopIfNeeded() {
|
|
2506
2993
|
if (this.qlInclude === 0 /* Module */) {
|
|
2507
2994
|
this.qlInclude = 2 /* Done */;
|
|
2508
|
-
const e = this.
|
|
2995
|
+
const e = this.qe + this.resolvedManifest.manifest.qwikLoader;
|
|
2509
2996
|
const t = {
|
|
2510
2997
|
rel: "modulepreload",
|
|
2511
2998
|
href: e
|
|
@@ -2524,8 +3011,7 @@ var SSRContainer = class extends Ou {
|
|
|
2524
3011
|
if (n) {
|
|
2525
3012
|
r["nonce"] = n;
|
|
2526
3013
|
}
|
|
2527
|
-
this.
|
|
2528
|
-
this.closeElement();
|
|
3014
|
+
this.writeScript(r);
|
|
2529
3015
|
}
|
|
2530
3016
|
}
|
|
2531
3017
|
emitQwikLoaderInline() {
|
|
@@ -2541,18 +3027,26 @@ var SSRContainer = class extends Ou {
|
|
|
2541
3027
|
if (this.renderOptions.serverData?.nonce) {
|
|
2542
3028
|
t["nonce"] = this.renderOptions.serverData.nonce;
|
|
2543
3029
|
}
|
|
2544
|
-
this.
|
|
2545
|
-
this.write(e);
|
|
2546
|
-
this.closeElement();
|
|
3030
|
+
this.writeScript(t, e);
|
|
2547
3031
|
}
|
|
2548
3032
|
emitQwikLoaderAtBottomIfNeeded() {
|
|
2549
3033
|
if (!this.isStatic()) {
|
|
2550
3034
|
if (this.qlInclude !== 2 /* Done */) {
|
|
2551
3035
|
this.emitQwikLoaderInline();
|
|
2552
3036
|
}
|
|
2553
|
-
this.
|
|
3037
|
+
this.emitNewQwikEvents();
|
|
2554
3038
|
}
|
|
2555
3039
|
}
|
|
3040
|
+
emitNewQwikEvents() {
|
|
3041
|
+
const e = [];
|
|
3042
|
+
for (const t of this.serializationCtx.At) {
|
|
3043
|
+
if (!this.emittedQwikEventNames.has(t)) {
|
|
3044
|
+
this.emittedQwikEventNames.add(t);
|
|
3045
|
+
e.push(JSON.stringify(t));
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
this.emitQwikEvents(e);
|
|
3049
|
+
}
|
|
2556
3050
|
emitQwikEvents(e) {
|
|
2557
3051
|
if (e.length > 0) {
|
|
2558
3052
|
const t = {};
|
|
@@ -2560,11 +3054,11 @@ var SSRContainer = class extends Ou {
|
|
|
2560
3054
|
if (n) {
|
|
2561
3055
|
t["nonce"] = n;
|
|
2562
3056
|
}
|
|
2563
|
-
this.
|
|
3057
|
+
this.openScript(t);
|
|
2564
3058
|
this.write(`(window._qwikEv||(window._qwikEv=[])).push(`);
|
|
2565
|
-
this.writeArray(e,
|
|
3059
|
+
this.writeArray(e, mr);
|
|
2566
3060
|
this.write(PAREN_CLOSE);
|
|
2567
|
-
this.
|
|
3061
|
+
this.closeScript();
|
|
2568
3062
|
}
|
|
2569
3063
|
}
|
|
2570
3064
|
// Keep in sync with process-vnode-data.unit.ts
|
|
@@ -2595,7 +3089,7 @@ var SSRContainer = class extends Ou {
|
|
|
2595
3089
|
}
|
|
2596
3090
|
createAndPushFrame(e, t, n) {
|
|
2597
3091
|
let r = 10 /* ANYTHING */;
|
|
2598
|
-
if (
|
|
3092
|
+
if (isDev8) {
|
|
2599
3093
|
if (!this.currentElementFrame) {
|
|
2600
3094
|
r = initialTag(e);
|
|
2601
3095
|
} else {
|
|
@@ -2623,7 +3117,7 @@ var SSRContainer = class extends Ou {
|
|
|
2623
3117
|
o += " ";
|
|
2624
3118
|
}
|
|
2625
3119
|
i.push(`${o}<${e}> <= is not allowed as a child of ${allowedContent(s)[0]}.`);
|
|
2626
|
-
throw newTagError(i.
|
|
3120
|
+
throw newTagError(i.join("\n"));
|
|
2627
3121
|
}
|
|
2628
3122
|
}
|
|
2629
3123
|
}
|
|
@@ -2633,7 +3127,8 @@ var SSRContainer = class extends Ou {
|
|
|
2633
3127
|
elementName: e,
|
|
2634
3128
|
depthFirstElementIdx: t,
|
|
2635
3129
|
vNodeData: [ 0 /* NONE */ ],
|
|
2636
|
-
currentFile:
|
|
3130
|
+
currentFile: isDev8 ? n || null : null,
|
|
3131
|
+
refBase: null
|
|
2637
3132
|
};
|
|
2638
3133
|
this.currentElementFrame = s;
|
|
2639
3134
|
this.vNodeDatas.push(s.vNodeData);
|
|
@@ -2648,6 +3143,17 @@ var SSRContainer = class extends Ou {
|
|
|
2648
3143
|
this.size += e.length;
|
|
2649
3144
|
this.writer.write(e);
|
|
2650
3145
|
}
|
|
3146
|
+
writeRootRef(e) {
|
|
3147
|
+
this.size += String(e).length;
|
|
3148
|
+
this.writer.writeRootRef(e);
|
|
3149
|
+
}
|
|
3150
|
+
writeRootRefPath(e) {
|
|
3151
|
+
this.size += String(e[0]).length;
|
|
3152
|
+
this.writer.writeRootRefPath(e);
|
|
3153
|
+
for (let t = 1; t < e.length; t++) {
|
|
3154
|
+
this.size += 1 + String(e[t]).length;
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
2651
3157
|
writeArray(e, t) {
|
|
2652
3158
|
for (let n = 0; n < e.length; n++) {
|
|
2653
3159
|
const r = e[n];
|
|
@@ -2657,22 +3163,22 @@ var SSRContainer = class extends Ou {
|
|
|
2657
3163
|
this.write(r);
|
|
2658
3164
|
}
|
|
2659
3165
|
}
|
|
2660
|
-
writeAttrs(e, t,
|
|
2661
|
-
let
|
|
2662
|
-
for (let
|
|
2663
|
-
let u = t[
|
|
2664
|
-
if (isSSRUnsafeAttr(
|
|
2665
|
-
if (
|
|
2666
|
-
throw
|
|
3166
|
+
writeAttrs(e, t, r, i, o, a) {
|
|
3167
|
+
let c = void 0;
|
|
3168
|
+
for (let l in t) {
|
|
3169
|
+
let u = t[l];
|
|
3170
|
+
if (isSSRUnsafeAttr(l)) {
|
|
3171
|
+
if (isDev8) {
|
|
3172
|
+
throw qe(32 /* unsafeAttr */ , [ l ]);
|
|
2667
3173
|
}
|
|
2668
3174
|
continue;
|
|
2669
3175
|
}
|
|
2670
|
-
if (
|
|
2671
|
-
u = _setEvent(this.serializationCtx,
|
|
2672
|
-
} else if (
|
|
3176
|
+
if (Is(l)) {
|
|
3177
|
+
u = _setEvent(this.serializationCtx, l, u, a);
|
|
3178
|
+
} else if (l === "ref") {
|
|
2673
3179
|
const e = this.getOrCreateLastNode();
|
|
2674
|
-
if (
|
|
2675
|
-
u.
|
|
3180
|
+
if (iu(u)) {
|
|
3181
|
+
u.Zt = new DomRef(e);
|
|
2676
3182
|
continue;
|
|
2677
3183
|
} else if (typeof u === "function") {
|
|
2678
3184
|
u(new DomRef(e));
|
|
@@ -2680,63 +3186,83 @@ var SSRContainer = class extends Ou {
|
|
|
2680
3186
|
} else if (u == null) {
|
|
2681
3187
|
continue;
|
|
2682
3188
|
} else {
|
|
2683
|
-
throw
|
|
3189
|
+
throw qe(15 /* invalidRefValue */ , [ o ]);
|
|
3190
|
+
}
|
|
3191
|
+
} else if (l === ys || l === ms) {
|
|
3192
|
+
const e = this.addRoot(u);
|
|
3193
|
+
if (e === void 0) {
|
|
3194
|
+
continue;
|
|
2684
3195
|
}
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
} else if (Fl(u)) {
|
|
3196
|
+
u = typeof e === "number" ? [ e ] : String(e);
|
|
3197
|
+
} else if (iu(u)) {
|
|
2688
3198
|
const e = this.getOrCreateLastNode();
|
|
2689
|
-
const t = new
|
|
2690
|
-
|
|
2691
|
-
et:
|
|
3199
|
+
const t = new Ri({
|
|
3200
|
+
O: i,
|
|
3201
|
+
et: r
|
|
2692
3202
|
});
|
|
2693
|
-
const
|
|
2694
|
-
u = n(() => this.trackSignalValue(
|
|
3203
|
+
const s = u;
|
|
3204
|
+
u = n(() => this.trackSignalValue(s, e, l, t));
|
|
2695
3205
|
}
|
|
2696
|
-
if (
|
|
3206
|
+
if (Ps(u)) {
|
|
2697
3207
|
const e = this.getOrCreateLastNode();
|
|
2698
3208
|
this.addPromiseAttribute(u);
|
|
2699
3209
|
u.then(t => {
|
|
2700
|
-
this.addBackpatchEntry(e.id,
|
|
3210
|
+
this.addBackpatchEntry(e.id, l, s(l, t, i));
|
|
2701
3211
|
});
|
|
2702
3212
|
continue;
|
|
2703
3213
|
}
|
|
2704
|
-
if (
|
|
3214
|
+
if (l === Ss) {
|
|
2705
3215
|
if (u) {
|
|
2706
|
-
|
|
2707
|
-
|
|
3216
|
+
c = String(u);
|
|
3217
|
+
l = es;
|
|
2708
3218
|
u = "html" /* HTML */;
|
|
2709
3219
|
}
|
|
2710
3220
|
if (e === "style") {
|
|
2711
3221
|
continue;
|
|
2712
3222
|
}
|
|
2713
|
-
} else if (isPreventDefault(
|
|
2714
|
-
addPreventDefaultEventToSerializationContext(this.serializationCtx,
|
|
3223
|
+
} else if (isPreventDefault(l)) {
|
|
3224
|
+
addPreventDefaultEventToSerializationContext(this.serializationCtx, l);
|
|
2715
3225
|
}
|
|
2716
|
-
if (e === "textarea" &&
|
|
3226
|
+
if (e === "textarea" && l === "value") {
|
|
2717
3227
|
if (u && typeof u !== "string") {
|
|
2718
|
-
if (
|
|
2719
|
-
throw
|
|
3228
|
+
if (isDev8) {
|
|
3229
|
+
throw qe(23 /* wrongTextareaValue */ , [ o, u ]);
|
|
2720
3230
|
}
|
|
2721
3231
|
continue;
|
|
2722
3232
|
}
|
|
2723
|
-
|
|
2724
|
-
|
|
3233
|
+
c = escapeHTML(u || "");
|
|
3234
|
+
l = es;
|
|
2725
3235
|
u = "text" /* TEXT */;
|
|
2726
3236
|
}
|
|
2727
|
-
const h =
|
|
3237
|
+
const h = s(l, u, i);
|
|
2728
3238
|
if (h != null && h !== false) {
|
|
2729
|
-
this.write(
|
|
2730
|
-
this.write(
|
|
3239
|
+
this.write(va);
|
|
3240
|
+
this.write(l);
|
|
2731
3241
|
if (h !== true) {
|
|
2732
3242
|
this.write(ATTR_EQUALS_QUOTE);
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
3243
|
+
if (Array.isArray(h)) {
|
|
3244
|
+
this.writeEscapedChunks(h);
|
|
3245
|
+
} else {
|
|
3246
|
+
const e = escapeHTML(String(h));
|
|
3247
|
+
this.write(e);
|
|
3248
|
+
}
|
|
3249
|
+
this.write(pr);
|
|
2736
3250
|
}
|
|
2737
3251
|
}
|
|
2738
3252
|
}
|
|
2739
|
-
return
|
|
3253
|
+
return c;
|
|
3254
|
+
}
|
|
3255
|
+
writeEscapedChunks(e) {
|
|
3256
|
+
for (let t = 0; t < e.length; t++) {
|
|
3257
|
+
const n = e[t];
|
|
3258
|
+
if (typeof n === "string") {
|
|
3259
|
+
this.write(escapeHTML(n));
|
|
3260
|
+
} else if (typeof n === "number") {
|
|
3261
|
+
this.writeRootRef(n);
|
|
3262
|
+
} else {
|
|
3263
|
+
this.writeRootRefPath(n.path);
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
2740
3266
|
}
|
|
2741
3267
|
addPromiseAttribute(e) {
|
|
2742
3268
|
this.promiseAttributes ||= [];
|
|
@@ -2750,19 +3276,261 @@ var SSRContainer = class extends Ou {
|
|
|
2750
3276
|
}
|
|
2751
3277
|
};
|
|
2752
3278
|
|
|
3279
|
+
var SSRSegmentContainer = class extends SSRContainer {
|
|
3280
|
+
constructor(e, t) {
|
|
3281
|
+
super(e);
|
|
3282
|
+
this.Re = t;
|
|
3283
|
+
}
|
|
3284
|
+
Qe=0 /* Rendering */;
|
|
3285
|
+
Ke=null;
|
|
3286
|
+
subscriptionPatchRecords=[];
|
|
3287
|
+
pendingVNodeDataPatches=null;
|
|
3288
|
+
nextOutOfOrderId() {
|
|
3289
|
+
return this.Re.nextOutOfOrderId();
|
|
3290
|
+
}
|
|
3291
|
+
S(e) {
|
|
3292
|
+
return this.Re.S(e);
|
|
3293
|
+
}
|
|
3294
|
+
queueOutOfOrderSegment(e) {
|
|
3295
|
+
this.Re.queueOutOfOrderSegment(e);
|
|
3296
|
+
}
|
|
3297
|
+
emitOutOfOrderSegmentScripts(e) {
|
|
3298
|
+
this.Re.emitOutOfOrderSegmentScripts(e);
|
|
3299
|
+
}
|
|
3300
|
+
emitOutOfOrderExecutorIfNeeded() {
|
|
3301
|
+
this.Re.emitOutOfOrderExecutorIfNeeded();
|
|
3302
|
+
}
|
|
3303
|
+
nn(e, t, n, r) {
|
|
3304
|
+
recordExternalRootEffect(this.Re.serializationCtx, this.serializationCtx, this.Re.dt, this.subscriptionPatchRecords, e, t, n, r);
|
|
3305
|
+
}
|
|
3306
|
+
async P(e, t) {
|
|
3307
|
+
const n = this.Re;
|
|
3308
|
+
const r = n.A();
|
|
3309
|
+
const s = this.serializationCtx;
|
|
3310
|
+
try {
|
|
3311
|
+
const i = this.Ge(n, s);
|
|
3312
|
+
this.Je(n, s);
|
|
3313
|
+
this.Ye(n, s);
|
|
3314
|
+
const o = this.Ze(n, r, s);
|
|
3315
|
+
if (r && (i.newRootLocalIds.length > 0 || o !== void 0)) {
|
|
3316
|
+
s.ue = n.serializationCtx.zn;
|
|
3317
|
+
await this.emitStatePatchData(e, i.newRootStart, i.newRootLocalIds, o);
|
|
3318
|
+
n.serializationCtx.ae = n.serializationCtx.Yn.length + (n.serializationCtx.fe ? 1 : 0);
|
|
3319
|
+
n.serializationCtx.zn += s.zn;
|
|
3320
|
+
}
|
|
3321
|
+
this.emitPendingVNodeDataPatches();
|
|
3322
|
+
if (r) {
|
|
3323
|
+
this.t = true;
|
|
3324
|
+
this.emitVNodeData(e);
|
|
3325
|
+
const t = this.serializationCtx;
|
|
3326
|
+
this.serializationCtx = n.serializationCtx;
|
|
3327
|
+
this.emittedSyncFnCount = n.emittedSyncFnCount;
|
|
3328
|
+
this.emitSyncFnsData(true);
|
|
3329
|
+
n.emittedSyncFnCount = this.emittedSyncFnCount;
|
|
3330
|
+
this.serializationCtx = t;
|
|
3331
|
+
this.emitNewQwikEvents();
|
|
3332
|
+
}
|
|
3333
|
+
this.emitPatchDataIfNeeded();
|
|
3334
|
+
this.drainCleanupQueue();
|
|
3335
|
+
const a = i.rootIdMap;
|
|
3336
|
+
if (r) {
|
|
3337
|
+
this.Qe = 2 /* Done */;
|
|
3338
|
+
} else {
|
|
3339
|
+
this.Ke = a;
|
|
3340
|
+
this.Qe = 1 /* EarlyFinalized */;
|
|
3341
|
+
}
|
|
3342
|
+
return {
|
|
3343
|
+
html: renderSSRChunks(t.htmlChunks, a),
|
|
3344
|
+
scripts: t.writer.toString(a)
|
|
3345
|
+
};
|
|
3346
|
+
} finally {
|
|
3347
|
+
if (this.Qe !== 1 /* EarlyFinalized */) {
|
|
3348
|
+
s.me = void 0;
|
|
3349
|
+
n.removeOutOfOrderSegment(this);
|
|
3350
|
+
}
|
|
3351
|
+
n.serializationCtx.Bn(n.writer);
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
He() {
|
|
3355
|
+
try {
|
|
3356
|
+
this.emitVNodeData(this.vnodeSegment);
|
|
3357
|
+
this.emitPendingVNodeDataPatches();
|
|
3358
|
+
this.Re.emitOutOfOrderSegmentScripts(this.writer.toString(this.Ke));
|
|
3359
|
+
this.Qe = 2 /* Done */;
|
|
3360
|
+
this.Re.removeOutOfOrderSegment(this);
|
|
3361
|
+
} finally {
|
|
3362
|
+
this.serializationCtx.me = void 0;
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
markVNodeDataForSerialization(e, t = 16 /* SERIALIZE */) {
|
|
3366
|
+
const n = e.vnodeData[0];
|
|
3367
|
+
const r = n | t;
|
|
3368
|
+
if (r !== n) {
|
|
3369
|
+
e.vnodeData[0] = r;
|
|
3370
|
+
this.queueLateVNodeDataPatch(e, r & ~n);
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
queueLateVNodeDataPatch(e, t) {
|
|
3374
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !(t & (16 /* SERIALIZE */ | 8 /* REFERENCE */))) {
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3377
|
+
const n = this.getVNodeDataOwnerFromNodeId(e.id);
|
|
3378
|
+
if (!this.F().isVNodeDataOwnerEmitted(n.owner)) {
|
|
3379
|
+
return;
|
|
3380
|
+
}
|
|
3381
|
+
let r = (this.pendingVNodeDataPatches ||= /* @__PURE__ */ new Map).get(n.owner);
|
|
3382
|
+
if (!r) {
|
|
3383
|
+
this.pendingVNodeDataPatches.set(n.owner, r = /* @__PURE__ */ new Map);
|
|
3384
|
+
}
|
|
3385
|
+
r.set(n.localIndex, e.vnodeData);
|
|
3386
|
+
}
|
|
3387
|
+
emitPendingVNodeDataPatches() {
|
|
3388
|
+
const e = this.pendingVNodeDataPatches;
|
|
3389
|
+
this.pendingVNodeDataPatches = null;
|
|
3390
|
+
if (!e) {
|
|
3391
|
+
return;
|
|
3392
|
+
}
|
|
3393
|
+
for (const [t, n] of e) {
|
|
3394
|
+
if (n.size === 0) {
|
|
3395
|
+
continue;
|
|
3396
|
+
}
|
|
3397
|
+
const e = Array.from(n).sort((e, t) => e[0] - t[0]);
|
|
3398
|
+
this.emitVNodeDataScript(t, e, true);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
Ge(e, t) {
|
|
3402
|
+
const n = this.commitSegmentRoots(e, t);
|
|
3403
|
+
t.me = (t, r, s) => {
|
|
3404
|
+
this.commitSegmentRoot(e, t, r, s, n);
|
|
3405
|
+
};
|
|
3406
|
+
return n;
|
|
3407
|
+
}
|
|
3408
|
+
Ze(e, t, n) {
|
|
3409
|
+
let r = void 0;
|
|
3410
|
+
const s = t ? this.collectSubscriptionPatches(e, e.rootContainerSerializedRootCount) : void 0;
|
|
3411
|
+
if (s) {
|
|
3412
|
+
r = n.St(s);
|
|
3413
|
+
}
|
|
3414
|
+
return r;
|
|
3415
|
+
}
|
|
3416
|
+
commitSegmentRoots(e, t) {
|
|
3417
|
+
const n = [];
|
|
3418
|
+
const r = e.A() ? e.serializationCtx.ae : e.serializationCtx.Yn.length;
|
|
3419
|
+
const s = [];
|
|
3420
|
+
const i = {
|
|
3421
|
+
rootIdMap: n,
|
|
3422
|
+
newRootStart: r,
|
|
3423
|
+
newRootLocalIds: s
|
|
3424
|
+
};
|
|
3425
|
+
this.promoteSharedSegmentRoots(e, t, i);
|
|
3426
|
+
const o = t.Yn;
|
|
3427
|
+
const a = t.ye;
|
|
3428
|
+
for (let t = 0; t < o.length; t++) {
|
|
3429
|
+
const n = a[t];
|
|
3430
|
+
this.commitSegmentRoot(e, t, o[t], n, i);
|
|
3431
|
+
}
|
|
3432
|
+
return i;
|
|
3433
|
+
}
|
|
3434
|
+
promoteSharedSegmentRoots(e, t, n) {
|
|
3435
|
+
const r = t.Yn;
|
|
3436
|
+
const s = t.ye;
|
|
3437
|
+
for (let t = 0; t < s.length; t++) {
|
|
3438
|
+
const i = s[t];
|
|
3439
|
+
if (this.isRootOrUsedByOtherLiveSegment(e, i)) {
|
|
3440
|
+
this.commitSegmentRoot(e, t, r[t], i, n);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
isRootOrUsedByOtherLiveSegment(e, t) {
|
|
3445
|
+
if (e.serializationCtx.ge(t) !== void 0) {
|
|
3446
|
+
return true;
|
|
3447
|
+
}
|
|
3448
|
+
const n = e.outOfOrderSegments;
|
|
3449
|
+
for (let e = 0; e < n.length; e++) {
|
|
3450
|
+
const r = n[e];
|
|
3451
|
+
if (r === this) {
|
|
3452
|
+
continue;
|
|
3453
|
+
}
|
|
3454
|
+
const s = r.serializationCtx.ye;
|
|
3455
|
+
for (let e = 0; e < s.length; e++) {
|
|
3456
|
+
if (s[e] === t) {
|
|
3457
|
+
return true;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
return false;
|
|
3462
|
+
}
|
|
3463
|
+
commitSegmentRoot(e, t, n, r, s) {
|
|
3464
|
+
if (s.rootIdMap[t] !== void 0) {
|
|
3465
|
+
return;
|
|
3466
|
+
}
|
|
3467
|
+
let i = e.serializationCtx.ge(r);
|
|
3468
|
+
if (i === void 0) {
|
|
3469
|
+
i = e.serializationCtx._e(n, r);
|
|
3470
|
+
s.newRootLocalIds.push(t);
|
|
3471
|
+
this.seedCommittedRootForLiveSegments(e, r);
|
|
3472
|
+
}
|
|
3473
|
+
const o = e.serializationCtx;
|
|
3474
|
+
s.rootIdMap[t] = e.A() && i >= o.ce ? i + (o.fe ? 1 : 0) : i;
|
|
3475
|
+
}
|
|
3476
|
+
seedCommittedRootForLiveSegments(e, t) {
|
|
3477
|
+
const n = e.outOfOrderSegments;
|
|
3478
|
+
for (let e = 0; e < n.length; e++) {
|
|
3479
|
+
const r = n[e];
|
|
3480
|
+
if (r !== this && r.Qe === 0 /* Rendering */) {
|
|
3481
|
+
r.serializationCtx.St(t);
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
Je(e, t) {
|
|
3486
|
+
for (const n of t.At) {
|
|
3487
|
+
e.serializationCtx.At.add(n);
|
|
3488
|
+
}
|
|
3489
|
+
for (const n of t.xt) {
|
|
3490
|
+
e.serializationCtx.xt.add(n);
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
Ye(e, t) {
|
|
3494
|
+
e.serializationCtx.$e.push(...t.$e);
|
|
3495
|
+
}
|
|
3496
|
+
collectSubscriptionPatches(e, t) {
|
|
3497
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
3498
|
+
return;
|
|
3499
|
+
}
|
|
3500
|
+
return collectSubscriptionPatches(e.serializationCtx, this.subscriptionPatchRecords, t);
|
|
3501
|
+
}
|
|
3502
|
+
emitStatePatchData(e, t, n, r) {
|
|
3503
|
+
const s = this.statePatchScriptAttrs(e);
|
|
3504
|
+
this.openScript(s);
|
|
3505
|
+
this.serializationCtx.Bn(this.writer);
|
|
3506
|
+
this.serializationCtx.te = this.markVNodeDataForSerialization.bind(this);
|
|
3507
|
+
return qs(this.serializationCtx.be(t, n, r, 0), () => {
|
|
3508
|
+
this.closeScript();
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
statePatchScriptAttrs(e) {
|
|
3512
|
+
const t = this.stateScriptAttrs();
|
|
3513
|
+
t[QStatePatchAttr] = true;
|
|
3514
|
+
if (e) {
|
|
3515
|
+
t[kh] = e;
|
|
3516
|
+
}
|
|
3517
|
+
return t;
|
|
3518
|
+
}
|
|
3519
|
+
};
|
|
3520
|
+
|
|
2753
3521
|
var isQwikStyleElement = (e, t) => {
|
|
2754
3522
|
if (e === "style" && t != null) {
|
|
2755
|
-
return Object.prototype.hasOwnProperty.call(t,
|
|
3523
|
+
return Object.prototype.hasOwnProperty.call(t, Ue) || Object.prototype.hasOwnProperty.call(t, He);
|
|
2756
3524
|
}
|
|
2757
3525
|
return false;
|
|
2758
3526
|
};
|
|
2759
3527
|
|
|
2760
3528
|
function newTagError(e) {
|
|
2761
|
-
return
|
|
3529
|
+
return qe(12 /* tagError */ , [ e ]);
|
|
2762
3530
|
}
|
|
2763
3531
|
|
|
2764
3532
|
function hasDestroy(e) {
|
|
2765
|
-
return e && typeof e === "object" && typeof e.
|
|
3533
|
+
return e && typeof e === "object" && typeof e.Tn === "function";
|
|
2766
3534
|
}
|
|
2767
3535
|
|
|
2768
3536
|
function isSSRUnsafeAttr(e) {
|
|
@@ -2782,13 +3550,10 @@ function randomStr() {
|
|
|
2782
3550
|
function addPreventDefaultEventToSerializationContext(e, t) {
|
|
2783
3551
|
const n = "e" + t.substring(14);
|
|
2784
3552
|
if (n) {
|
|
2785
|
-
e.
|
|
3553
|
+
e.At.add(n);
|
|
2786
3554
|
}
|
|
2787
3555
|
}
|
|
2788
3556
|
|
|
2789
|
-
// packages/qwik/src/server/ssr-render.ts
|
|
2790
|
-
import { manifest as builtManifest } from "@qwik-client-manifest";
|
|
2791
|
-
|
|
2792
3557
|
// packages/qwik/src/server/ssr-stream-handler.ts
|
|
2793
3558
|
var StreamHandler = class {
|
|
2794
3559
|
constructor(e, t) {
|
|
@@ -2819,37 +3584,27 @@ var StreamHandler = class {
|
|
|
2819
3584
|
let t;
|
|
2820
3585
|
switch (this.inOrderStreaming.strategy) {
|
|
2821
3586
|
case "disabled":
|
|
2822
|
-
t = {
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
return;
|
|
2826
|
-
}
|
|
2827
|
-
e.enqueue(t);
|
|
2828
|
-
},
|
|
2829
|
-
waitForDrain() {
|
|
2830
|
-
return e.waitForPendingFlush();
|
|
3587
|
+
t = dr(t => {
|
|
3588
|
+
if (t === void 0 || t === null) {
|
|
3589
|
+
return;
|
|
2831
3590
|
}
|
|
2832
|
-
|
|
3591
|
+
e.enqueue(t);
|
|
3592
|
+
});
|
|
2833
3593
|
break;
|
|
2834
3594
|
|
|
2835
3595
|
case "direct":
|
|
2836
3596
|
{
|
|
2837
3597
|
const n = this.nativeStream;
|
|
2838
|
-
t = {
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
return e.trackPendingFlush(r);
|
|
2846
|
-
}
|
|
2847
|
-
return e.trackPendingFlush(n.write(t));
|
|
2848
|
-
},
|
|
2849
|
-
waitForDrain() {
|
|
2850
|
-
return e.waitForPendingFlush();
|
|
3598
|
+
t = dr(t => {
|
|
3599
|
+
if (t === void 0 || t === null) {
|
|
3600
|
+
return;
|
|
3601
|
+
}
|
|
3602
|
+
if (e.pendingFlush) {
|
|
3603
|
+
const r = e.pendingFlush.then(() => n.write(t));
|
|
3604
|
+
return e.trackPendingFlush(r);
|
|
2851
3605
|
}
|
|
2852
|
-
|
|
3606
|
+
return e.trackPendingFlush(n.write(t));
|
|
3607
|
+
});
|
|
2853
3608
|
break;
|
|
2854
3609
|
}
|
|
2855
3610
|
|
|
@@ -2858,23 +3613,18 @@ var StreamHandler = class {
|
|
|
2858
3613
|
{
|
|
2859
3614
|
const n = this.inOrderStreaming.maximumChunk ?? 0;
|
|
2860
3615
|
const r = this.inOrderStreaming.maximumInitialChunk ?? 0;
|
|
2861
|
-
t = {
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
return e.flush();
|
|
2871
|
-
}
|
|
3616
|
+
t = dr(t => {
|
|
3617
|
+
if (t === void 0 || t === null) {
|
|
3618
|
+
return;
|
|
3619
|
+
}
|
|
3620
|
+
e.enqueue(t);
|
|
3621
|
+
if (e.streamBlockDepth === 0) {
|
|
3622
|
+
const t = e.networkFlushes === 0 ? r : n;
|
|
3623
|
+
if (e.bufferSize >= t) {
|
|
3624
|
+
return e.flush();
|
|
2872
3625
|
}
|
|
2873
|
-
},
|
|
2874
|
-
waitForDrain() {
|
|
2875
|
-
return e.waitForPendingFlush();
|
|
2876
3626
|
}
|
|
2877
|
-
};
|
|
3627
|
+
});
|
|
2878
3628
|
break;
|
|
2879
3629
|
}
|
|
2880
3630
|
}
|
|
@@ -2891,7 +3641,7 @@ var StreamHandler = class {
|
|
|
2891
3641
|
}
|
|
2892
3642
|
}
|
|
2893
3643
|
trackPendingFlush(e) {
|
|
2894
|
-
if (!
|
|
3644
|
+
if (!Ps(e)) {
|
|
2895
3645
|
return;
|
|
2896
3646
|
}
|
|
2897
3647
|
const t = Promise.resolve(e).finally(() => {
|
|
@@ -2954,26 +3704,30 @@ var StreamHandler = class {
|
|
|
2954
3704
|
|
|
2955
3705
|
// packages/qwik/src/server/ssr-render.ts
|
|
2956
3706
|
var renderToString = async (e, t = {}) => {
|
|
2957
|
-
const n =
|
|
2958
|
-
const r = {
|
|
2959
|
-
write(e) {
|
|
2960
|
-
n.push(e);
|
|
2961
|
-
}
|
|
2962
|
-
};
|
|
2963
|
-
const s = await renderToStream(e, {
|
|
3707
|
+
const n = new StringSSRWriter;
|
|
3708
|
+
const r = await renderToStream(e, {
|
|
2964
3709
|
...t,
|
|
2965
|
-
stream:
|
|
3710
|
+
stream: n
|
|
2966
3711
|
});
|
|
2967
3712
|
return {
|
|
2968
|
-
isStatic:
|
|
2969
|
-
timing:
|
|
2970
|
-
manifest:
|
|
2971
|
-
snapshotResult:
|
|
2972
|
-
html: n.
|
|
3713
|
+
isStatic: r.isStatic,
|
|
3714
|
+
timing: r.timing,
|
|
3715
|
+
manifest: r.manifest,
|
|
3716
|
+
snapshotResult: r.snapshotResult,
|
|
3717
|
+
html: n.toString()
|
|
2973
3718
|
};
|
|
2974
3719
|
};
|
|
2975
3720
|
|
|
2976
3721
|
var renderToStream = async (e, t) => {
|
|
3722
|
+
if (__EXPERIMENTAL__.suspense && t.streaming?.outOfOrder === void 0) {
|
|
3723
|
+
t = {
|
|
3724
|
+
...t,
|
|
3725
|
+
streaming: {
|
|
3726
|
+
...t.streaming,
|
|
3727
|
+
outOfOrder: true
|
|
3728
|
+
}
|
|
3729
|
+
};
|
|
3730
|
+
}
|
|
2977
3731
|
const n = {
|
|
2978
3732
|
firstFlush: 0,
|
|
2979
3733
|
render: 0,
|
|
@@ -2984,7 +3738,7 @@ var renderToStream = async (e, t) => {
|
|
|
2984
3738
|
const i = resolveManifest(t.manifest);
|
|
2985
3739
|
const o = typeof t.locale === "function" ? t.locale(t) : t.serverData?.locale || t.locale || t.containerAttributes?.locale || "";
|
|
2986
3740
|
const a = new StreamHandler(t, n);
|
|
2987
|
-
const
|
|
3741
|
+
const c = ssrCreateContainer({
|
|
2988
3742
|
tagName: r,
|
|
2989
3743
|
locale: o,
|
|
2990
3744
|
writer: a.stream,
|
|
@@ -2995,37 +3749,38 @@ var renderToStream = async (e, t) => {
|
|
|
2995
3749
|
renderOptions: t
|
|
2996
3750
|
});
|
|
2997
3751
|
await setServerPlatform(t, i);
|
|
2998
|
-
await
|
|
2999
|
-
await
|
|
3752
|
+
await c.render(e);
|
|
3753
|
+
await c.l;
|
|
3000
3754
|
await a.flush();
|
|
3001
|
-
const
|
|
3755
|
+
const l = {
|
|
3002
3756
|
flushes: a.networkFlushes,
|
|
3003
3757
|
manifest: i?.manifest,
|
|
3004
|
-
size:
|
|
3758
|
+
size: c.size,
|
|
3005
3759
|
isStatic: false,
|
|
3006
3760
|
timing: n
|
|
3007
3761
|
};
|
|
3008
|
-
return
|
|
3762
|
+
return l;
|
|
3009
3763
|
};
|
|
3010
3764
|
|
|
3011
3765
|
function resolveManifest(e) {
|
|
3012
|
-
const t =
|
|
3013
|
-
|
|
3766
|
+
const t = Hf();
|
|
3767
|
+
const n = e ? {
|
|
3768
|
+
...t,
|
|
3014
3769
|
...e
|
|
3015
|
-
} :
|
|
3016
|
-
if (!
|
|
3017
|
-
return
|
|
3770
|
+
} : t;
|
|
3771
|
+
if (!n || "mapper" in n) {
|
|
3772
|
+
return n;
|
|
3018
3773
|
}
|
|
3019
|
-
if (
|
|
3774
|
+
if (n.mapping) {
|
|
3020
3775
|
const e = {};
|
|
3021
|
-
for (const
|
|
3022
|
-
const r =
|
|
3023
|
-
e[
|
|
3776
|
+
for (const t in n.mapping) {
|
|
3777
|
+
const r = n.mapping[t];
|
|
3778
|
+
e[Sh(t)] = [ t, r ];
|
|
3024
3779
|
}
|
|
3025
3780
|
return {
|
|
3026
3781
|
mapper: e,
|
|
3027
|
-
manifest:
|
|
3028
|
-
injections:
|
|
3782
|
+
manifest: n,
|
|
3783
|
+
injections: n.injections || []
|
|
3029
3784
|
};
|
|
3030
3785
|
}
|
|
3031
3786
|
return void 0;
|
|
@@ -3035,7 +3790,7 @@ var Q_FUNCS_PREFIX = 'document["qFuncs_HASH"]=';
|
|
|
3035
3790
|
|
|
3036
3791
|
// packages/qwik/src/server/index.ts
|
|
3037
3792
|
async function setServerPlatform2(e) {
|
|
3038
|
-
const t =
|
|
3793
|
+
const t = Vs({
|
|
3039
3794
|
manifest: e
|
|
3040
3795
|
}, resolveManifest(e));
|
|
3041
3796
|
setPlatform2(t);
|