@demiurgejs/core 0.2.0-beta.5 → 0.2.0-beta.7
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/README.md +14 -0
- package/bin/demiurge.mjs +6 -0
- package/dist/browser/file-router.d.ts +1 -0
- package/dist/browser/file-router.d.ts.map +1 -1
- package/dist/chunks/{document-shell-9GPwtcTt.js → document-shell-C0aPrkhd.js} +2 -2
- package/dist/chunks/{document-shell-9GPwtcTt.js.map → document-shell-C0aPrkhd.js.map} +1 -1
- package/dist/chunks/image-CRerJ5BY.js +145 -0
- package/dist/chunks/image-CRerJ5BY.js.map +1 -0
- package/dist/chunks/{image-codec-Dh1POFhE.js → image-codec-CQ8Cwxwb.js} +2 -2
- package/dist/chunks/{image-codec-Dh1POFhE.js.map → image-codec-CQ8Cwxwb.js.map} +1 -1
- package/dist/chunks/{images-CG7ZzayG.js → images-QgdmLyQ3.js} +11 -11
- package/dist/chunks/{images-CG7ZzayG.js.map → images-QgdmLyQ3.js.map} +1 -1
- package/dist/chunks/{index-0MNiR_wo.js → index-LYve1rQp.js} +286 -351
- package/dist/chunks/index-LYve1rQp.js.map +1 -0
- package/dist/chunks/links-iU22QkCE.js +68 -0
- package/dist/chunks/links-iU22QkCE.js.map +1 -0
- package/dist/chunks/{plugin-BZauDxRY.js → plugin-bkP6WwrS.js} +13 -12
- package/dist/chunks/{plugin-BZauDxRY.js.map → plugin-bkP6WwrS.js.map} +1 -1
- package/dist/chunks/runtime-BH519j2t.js +294 -0
- package/dist/chunks/runtime-BH519j2t.js.map +1 -0
- package/dist/chunks/streaming-BlKlC3nw.js +427 -0
- package/dist/chunks/streaming-BlKlC3nw.js.map +1 -0
- package/dist/chunks/{testing-CUwGj2ie.js → testing-BEW1nchS.js} +645 -630
- package/dist/chunks/testing-BEW1nchS.js.map +1 -0
- package/dist/chunks/{vite-QoqrGl6f.js → vite-BADZA8Fl.js} +73 -70
- package/dist/chunks/vite-BADZA8Fl.js.map +1 -0
- package/dist/cli.d.ts +8 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +186 -122
- package/dist/cli.js.map +1 -1
- package/dist/config/index.js +2 -2
- package/dist/config/types.d.ts +3 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/validate.d.ts.map +1 -1
- package/dist/data/cache.d.ts +5 -0
- package/dist/data/cache.d.ts.map +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/testing.d.ts.map +1 -1
- package/dist/data/testing.js +101 -67
- package/dist/data/testing.js.map +1 -1
- package/dist/data/tiered.d.ts.map +1 -1
- package/dist/edge/index.js +27 -26
- package/dist/edge/index.js.map +1 -1
- package/dist/edge/stores.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +910 -891
- package/dist/index.js.map +1 -1
- package/dist/internal/testing.js +2 -2
- package/dist/kv/index.js +7 -6
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/store.d.ts.map +1 -1
- package/dist/node/http.d.ts +2 -0
- package/dist/node/http.d.ts.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +12 -11
- package/dist/node/index.js.map +1 -1
- package/dist/node/serve.d.ts +4 -0
- package/dist/node/serve.d.ts.map +1 -1
- package/dist/redis/index.js +29 -28
- package/dist/redis/index.js.map +1 -1
- package/dist/redis/store.d.ts.map +1 -1
- package/dist/route/serialization.d.ts +4 -4
- package/dist/route/serialization.d.ts.map +1 -1
- package/dist/static/index.d.ts.map +1 -1
- package/dist/static/index.js +255 -255
- package/dist/static/index.js.map +1 -1
- package/dist/static/testing.d.ts +26 -0
- package/dist/static/testing.d.ts.map +1 -0
- package/dist/static/testing.js +76 -0
- package/dist/static/testing.js.map +1 -0
- package/dist/testing/index.d.ts +47 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +99 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/vercel/build.d.ts +31 -0
- package/dist/vercel/build.d.ts.map +1 -0
- package/dist/vercel/config.d.ts +15 -0
- package/dist/vercel/config.d.ts.map +1 -0
- package/dist/vercel/index.d.ts +7 -0
- package/dist/vercel/index.d.ts.map +1 -0
- package/dist/vercel/index.js +11 -0
- package/dist/vercel/index.js.map +1 -0
- package/dist/vercel/runtime.d.ts +29 -0
- package/dist/vercel/runtime.d.ts.map +1 -0
- package/dist/vite/index.js +1 -1
- package/package.json +13 -1
- package/dist/chunks/index-0MNiR_wo.js.map +0 -1
- package/dist/chunks/streaming-GYIsVTQH.js +0 -560
- package/dist/chunks/streaming-GYIsVTQH.js.map +0 -1
- package/dist/chunks/testing-CUwGj2ie.js.map +0 -1
- package/dist/chunks/vite-QoqrGl6f.js.map +0 -1
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
import { renderToString as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { renderToString as X } from "react-dom/server";
|
|
2
|
+
import { createContext as Z, useContext as ee, useEffect as te, createElement as g } from "react";
|
|
3
|
+
const L = "__demiurge_data", re = "data-demiurge-hydrate", ne = "data-demiurge-fallback";
|
|
4
|
+
function ie(e, t = {}) {
|
|
5
|
+
return oe(
|
|
6
6
|
JSON.stringify({ data: e, hasData: !0, ...t })
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const t = e.getElementById(
|
|
11
|
-
if (
|
|
9
|
+
function Xe(e) {
|
|
10
|
+
const t = e.getElementById(L), r = t?.tagName === "TEMPLATE" ? t.content.textContent : t?.textContent;
|
|
11
|
+
if (r)
|
|
12
12
|
try {
|
|
13
|
-
return JSON.parse(
|
|
14
|
-
} catch (
|
|
13
|
+
return JSON.parse(r);
|
|
14
|
+
} catch (n) {
|
|
15
15
|
throw new Error(
|
|
16
16
|
"Demiurge could not parse the initial route data payload.",
|
|
17
|
-
{ cause:
|
|
17
|
+
{ cause: n }
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function oe(e) {
|
|
22
22
|
return e.replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const k = "demiurge", N = /* @__PURE__ */ new WeakMap();
|
|
25
25
|
function C(e, t) {
|
|
26
|
-
return
|
|
26
|
+
return ce(e)?.createScriptURL(t) ?? t;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ce(e) {
|
|
29
29
|
if (!e)
|
|
30
30
|
return null;
|
|
31
31
|
const t = N.get(e);
|
|
32
32
|
if (t !== void 0)
|
|
33
33
|
return t;
|
|
34
|
-
const
|
|
35
|
-
return N.set(e,
|
|
34
|
+
const r = ae(e);
|
|
35
|
+
return N.set(e, r), r;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ae(e) {
|
|
38
38
|
const t = e.trustedTypes;
|
|
39
39
|
if (!t || typeof t.createPolicy != "function")
|
|
40
40
|
return null;
|
|
41
41
|
try {
|
|
42
|
-
return t.createPolicy(
|
|
42
|
+
return t.createPolicy(k, {
|
|
43
43
|
// The framework passes only a URL that the server rendered into its own
|
|
44
44
|
// placeholder attribute. `script-src` and `worker-src` still govern that
|
|
45
45
|
// URL, so this policy adds a type without widening the source rules.
|
|
46
|
-
createScriptURL: (
|
|
46
|
+
createScriptURL: (r) => r
|
|
47
47
|
});
|
|
48
|
-
} catch (
|
|
48
|
+
} catch (r) {
|
|
49
49
|
return console.error(
|
|
50
|
-
`Demiurge could not create the ${JSON.stringify(
|
|
51
|
-
|
|
50
|
+
`Demiurge could not create the ${JSON.stringify(k)} Trusted Types policy. Add ${JSON.stringify(k)} to the document trusted-types directive.`,
|
|
51
|
+
r
|
|
52
52
|
), null;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const v = "text/demiurge-script", f = "data-demiurge-script", p = "data-demiurge-script-src", A = "data-demiurge-script-type", P = "data-demiurge-script-started", se = 2e3, ue = [
|
|
56
56
|
"data-api",
|
|
57
57
|
"data-demiurge-script-placement",
|
|
58
58
|
"data-domain",
|
|
59
59
|
"id",
|
|
60
60
|
"integrity",
|
|
61
61
|
"referrerpolicy"
|
|
62
|
-
],
|
|
62
|
+
], F = /* @__PURE__ */ new Map();
|
|
63
63
|
function S(e) {
|
|
64
64
|
return e === "idle" || e === "worker";
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function G(e) {
|
|
67
67
|
const t = e ?? (typeof document > "u" ? void 0 : document);
|
|
68
68
|
if (!t)
|
|
69
69
|
return;
|
|
70
|
-
const
|
|
70
|
+
const r = t.querySelectorAll(
|
|
71
71
|
`script[${f}]:not([${P}])`
|
|
72
72
|
);
|
|
73
|
-
for (const
|
|
74
|
-
const i =
|
|
73
|
+
for (const n of [...r]) {
|
|
74
|
+
const i = n.getAttribute(f);
|
|
75
75
|
if (!(i !== "idle" && i !== "worker")) {
|
|
76
|
-
if (
|
|
77
|
-
|
|
76
|
+
if (n.setAttribute(P, ""), i === "worker") {
|
|
77
|
+
fe(n);
|
|
78
78
|
continue;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
de(n, () => le(n));
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
84
|
+
function Ze(e) {
|
|
85
|
+
return F.get(e);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
|
|
87
|
+
function de(e, t) {
|
|
88
|
+
const r = e.ownerDocument.defaultView;
|
|
89
|
+
if (r && typeof r.requestIdleCallback == "function") {
|
|
90
|
+
r.requestIdleCallback(() => t(), { timeout: se });
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
(
|
|
93
|
+
(r ?? globalThis).setTimeout(t, 1);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
const t = e.ownerDocument,
|
|
97
|
-
if (!
|
|
95
|
+
function le(e) {
|
|
96
|
+
const t = e.ownerDocument, r = e.getAttribute(p);
|
|
97
|
+
if (!r)
|
|
98
98
|
return;
|
|
99
|
-
const
|
|
100
|
-
for (const a of
|
|
99
|
+
const n = t.createElement("script"), i = e.getAttribute(A);
|
|
100
|
+
for (const a of ue) {
|
|
101
101
|
const c = e.getAttribute(a);
|
|
102
|
-
c !== null &&
|
|
102
|
+
c !== null && n.setAttribute(a, c);
|
|
103
103
|
}
|
|
104
|
-
e.removeAttribute("id"), i && (
|
|
104
|
+
e.removeAttribute("id"), i && (n.type = i), n.async = !0, n.nonce = e.nonce, n.src = C(t.defaultView, r), t.head.appendChild(n);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
const t = e.getAttribute(p),
|
|
106
|
+
function fe(e) {
|
|
107
|
+
const t = e.getAttribute(p), r = e.ownerDocument.defaultView;
|
|
108
108
|
if (!t)
|
|
109
109
|
return;
|
|
110
|
-
if (!
|
|
110
|
+
if (!r || typeof r.Worker != "function") {
|
|
111
111
|
console.error(
|
|
112
112
|
`Demiurge could not start the worker script ${JSON.stringify(t)}. This runtime has no Worker constructor.`
|
|
113
113
|
);
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const n = e.getAttribute(A);
|
|
117
117
|
try {
|
|
118
|
-
|
|
118
|
+
F.set(
|
|
119
119
|
t,
|
|
120
|
-
new
|
|
121
|
-
type:
|
|
120
|
+
new r.Worker(C(r, t), {
|
|
121
|
+
type: n === "module" ? "module" : "classic"
|
|
122
122
|
})
|
|
123
123
|
);
|
|
124
124
|
} catch (i) {
|
|
@@ -128,95 +128,35 @@ function ye(e) {
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
function ot(e, t = {}) {
|
|
135
|
-
return {
|
|
136
|
-
...t,
|
|
137
|
-
href: e,
|
|
138
|
-
kind: "link",
|
|
139
|
-
rel: "preconnect"
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function ct(e, t) {
|
|
143
|
-
return {
|
|
144
|
-
...t,
|
|
145
|
-
href: e,
|
|
146
|
-
kind: "link",
|
|
147
|
-
rel: "preload"
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
function at(e) {
|
|
151
|
-
return {
|
|
152
|
-
href: e,
|
|
153
|
-
kind: "link",
|
|
154
|
-
rel: "modulepreload"
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
async function st(e, t) {
|
|
158
|
-
const n = [];
|
|
159
|
-
for (const r of e) {
|
|
160
|
-
if (!r)
|
|
161
|
-
continue;
|
|
162
|
-
const i = typeof r == "function" ? await r(t) : r;
|
|
163
|
-
n.push(...i);
|
|
164
|
-
}
|
|
165
|
-
return me(n).sort(ge);
|
|
166
|
-
}
|
|
167
|
-
function me(e) {
|
|
168
|
-
const t = /* @__PURE__ */ new Map();
|
|
169
|
-
for (const n of e)
|
|
170
|
-
t.set(U(n), {
|
|
171
|
-
...t.get(U(n)),
|
|
172
|
-
...n
|
|
173
|
-
});
|
|
174
|
-
return [...t.values()];
|
|
175
|
-
}
|
|
176
|
-
function U(e) {
|
|
177
|
-
return [
|
|
178
|
-
e.rel,
|
|
179
|
-
e.href,
|
|
180
|
-
e.as ?? "",
|
|
181
|
-
e.type ?? "",
|
|
182
|
-
e.crossOrigin ?? ""
|
|
183
|
-
].join("\0");
|
|
184
|
-
}
|
|
185
|
-
function ge(e, t) {
|
|
186
|
-
return M(e.rel) - M(t.rel) || e.href.localeCompare(t.href);
|
|
187
|
-
}
|
|
188
|
-
function M(e) {
|
|
189
|
-
return e === "preconnect" ? 0 : e === "preload" ? 1 : e === "modulepreload" ? 2 : 3;
|
|
190
|
-
}
|
|
191
|
-
const l = "data-demiurge-document-contribution", b = "data-demiurge-script-strategy", m = "data-demiurge-navigation-status", Y = "__demiurge_navigation_status", V = "data-demiurge-navigation-status-style", he = "demiurge-navigation-status", Ae = ".demiurge-navigation-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}";
|
|
192
|
-
function ut(e) {
|
|
131
|
+
const l = "data-demiurge-document-contribution", b = "data-demiurge-script-strategy", m = "data-demiurge-navigation-status", j = "__demiurge_navigation_status", J = "data-demiurge-navigation-status-style", pe = "demiurge-navigation-status", ye = ".demiurge-navigation-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}";
|
|
132
|
+
function et(e) {
|
|
193
133
|
const t = typeof document > "u" ? void 0 : document;
|
|
194
134
|
if (!t || t.querySelector(`[${m}]`))
|
|
195
135
|
return t?.querySelector(`[${m}]`);
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
136
|
+
const r = t.createElement("style");
|
|
137
|
+
r.setAttribute(J, ""), r.textContent = ye;
|
|
138
|
+
const n = [...t.scripts].reverse().find((a) => a.nonce)?.nonce;
|
|
139
|
+
n && (r.nonce = n), t.head.append(r);
|
|
200
140
|
const i = t.createElement("div");
|
|
201
|
-
return i.id =
|
|
141
|
+
return i.id = j, i.setAttribute(m, ""), i.className = pe, i.setAttribute("role", "status"), i.setAttribute("aria-live", "polite"), i.setAttribute("aria-atomic", "true"), t.body.prepend(i), i;
|
|
202
142
|
}
|
|
203
|
-
function
|
|
204
|
-
const
|
|
143
|
+
function tt(e, t) {
|
|
144
|
+
const n = (typeof document > "u" ? void 0 : document)?.querySelector(
|
|
205
145
|
`[${m}]`
|
|
206
146
|
);
|
|
207
|
-
|
|
147
|
+
n && (n.textContent = e);
|
|
208
148
|
}
|
|
209
|
-
function
|
|
149
|
+
function rt(e) {
|
|
210
150
|
return {
|
|
211
151
|
dir: e.dir,
|
|
212
152
|
lang: e.lang,
|
|
213
153
|
links: [...e.links ?? []],
|
|
214
154
|
metadata: e.metadata,
|
|
215
|
-
scripts: (e.scripts ?? []).map(
|
|
155
|
+
scripts: (e.scripts ?? []).map(me),
|
|
216
156
|
title: e.metadata.title ?? e.title ?? "Demiurge App"
|
|
217
157
|
};
|
|
218
158
|
}
|
|
219
|
-
function
|
|
159
|
+
function me(e) {
|
|
220
160
|
return {
|
|
221
161
|
async: e.async,
|
|
222
162
|
crossOrigin: e.crossOrigin,
|
|
@@ -232,108 +172,108 @@ function Se(e) {
|
|
|
232
172
|
type: e.type
|
|
233
173
|
};
|
|
234
174
|
}
|
|
235
|
-
function
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
for (const
|
|
175
|
+
function nt(e, t) {
|
|
176
|
+
const r = typeof document > "u" ? void 0 : document;
|
|
177
|
+
if (r) {
|
|
178
|
+
r.title = e.title, e.lang && (r.documentElement.lang = e.lang), e.dir && (r.documentElement.dir = e.dir), he(r, e.scripts);
|
|
179
|
+
for (const n of r.head.querySelectorAll(
|
|
240
180
|
`[${l}]:not(script)`
|
|
241
181
|
))
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
for (const
|
|
245
|
-
|
|
246
|
-
|
|
182
|
+
n.remove();
|
|
183
|
+
ge(r, e.metadata);
|
|
184
|
+
for (const n of e.links)
|
|
185
|
+
r.head.append(_(r, n));
|
|
186
|
+
G(r);
|
|
247
187
|
}
|
|
248
188
|
}
|
|
249
|
-
function
|
|
250
|
-
t.description && e.head.append(
|
|
189
|
+
function ge(e, t) {
|
|
190
|
+
t.description && e.head.append(E(e, {
|
|
251
191
|
content: t.description,
|
|
252
192
|
name: "description"
|
|
253
193
|
})), t.canonical && e.head.append(_(e, {
|
|
254
194
|
href: t.canonical,
|
|
255
195
|
rel: "canonical"
|
|
256
|
-
})), t.robots && e.head.append(
|
|
196
|
+
})), t.robots && e.head.append(E(e, {
|
|
257
197
|
content: [
|
|
258
198
|
t.robots.index === !1 ? "noindex" : "index",
|
|
259
199
|
t.robots.follow === !1 ? "nofollow" : "follow"
|
|
260
200
|
].join(", "),
|
|
261
201
|
name: "robots"
|
|
262
202
|
}));
|
|
263
|
-
const
|
|
264
|
-
for (const [
|
|
265
|
-
["og:title",
|
|
266
|
-
["og:description",
|
|
267
|
-
["og:image",
|
|
203
|
+
const r = t.openGraph;
|
|
204
|
+
for (const [n, i] of [
|
|
205
|
+
["og:title", r?.title],
|
|
206
|
+
["og:description", r?.description],
|
|
207
|
+
["og:image", r?.image]
|
|
268
208
|
])
|
|
269
|
-
i && e.head.append(
|
|
270
|
-
for (const
|
|
209
|
+
i && e.head.append(E(e, { content: i, property: n }));
|
|
210
|
+
for (const n of t.custom)
|
|
271
211
|
e.head.append(
|
|
272
|
-
|
|
212
|
+
n.kind === "link" ? _(e, n) : E(e, n)
|
|
273
213
|
);
|
|
274
|
-
for (const
|
|
214
|
+
for (const n of t.structuredData) {
|
|
275
215
|
const i = e.createElement("script");
|
|
276
|
-
i.type = "application/ld+json", i.textContent = JSON.stringify(
|
|
216
|
+
i.type = "application/ld+json", i.textContent = JSON.stringify(n.value), w(i), Y(i, e), e.head.append(i);
|
|
277
217
|
}
|
|
278
218
|
}
|
|
279
|
-
function
|
|
280
|
-
const
|
|
281
|
-
return
|
|
219
|
+
function E(e, t) {
|
|
220
|
+
const r = e.createElement("meta");
|
|
221
|
+
return r.content = t.content, t.name && (r.name = t.name), t.property && r.setAttribute("property", t.property), w(r), r;
|
|
282
222
|
}
|
|
283
223
|
function _(e, t) {
|
|
284
|
-
const
|
|
285
|
-
return
|
|
224
|
+
const r = e.createElement("link");
|
|
225
|
+
return r.rel = t.rel, r.href = t.href, t.as && (r.as = t.as), t.type && (r.type = t.type), t.crossOrigin && (r.crossOrigin = t.crossOrigin), t.hrefLang && (r.hreflang = t.hrefLang), w(r), r;
|
|
286
226
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
289
|
-
for (const
|
|
227
|
+
function he(e, t) {
|
|
228
|
+
const r = /* @__PURE__ */ new Map();
|
|
229
|
+
for (const n of e.querySelectorAll(
|
|
290
230
|
`script[${l}]`
|
|
291
231
|
))
|
|
292
|
-
|
|
293
|
-
for (const
|
|
294
|
-
const i =
|
|
295
|
-
|
|
232
|
+
r.set(Se(n), n);
|
|
233
|
+
for (const n of t) {
|
|
234
|
+
const i = $e(n);
|
|
235
|
+
r.delete(i) || e.head.append(Ae(e, n));
|
|
296
236
|
}
|
|
297
|
-
for (const
|
|
298
|
-
|
|
237
|
+
for (const n of r.values())
|
|
238
|
+
n.remove();
|
|
299
239
|
}
|
|
300
|
-
function
|
|
301
|
-
const
|
|
302
|
-
return w(
|
|
240
|
+
function Ae(e, t) {
|
|
241
|
+
const r = e.createElement("script");
|
|
242
|
+
return w(r), r.setAttribute(b, t.strategy), Y(r, e), t.id && (r.id = t.id), t.integrity && (r.integrity = t.integrity), t.crossOrigin && (r.crossOrigin = t.crossOrigin), t.referrerPolicy && (r.referrerPolicy = t.referrerPolicy), t.dataApi && (r.dataset.api = t.dataApi), t.dataDomain && (r.dataset.domain = t.dataDomain), S(t.strategy) ? (r.type = v, r.setAttribute(f, t.strategy), r.setAttribute(p, t.src), t.type && r.setAttribute(A, t.type), r) : (r.async = t.async ?? !1, r.defer = t.defer ?? !1, r.type = t.type ?? V(t.strategy), r.src = C(e.defaultView, t.src), r);
|
|
303
243
|
}
|
|
304
|
-
function
|
|
305
|
-
const
|
|
306
|
-
|
|
244
|
+
function Y(e, t) {
|
|
245
|
+
const r = [...t.scripts].reverse().find((n) => n.nonce)?.nonce;
|
|
246
|
+
r && (e.nonce = r);
|
|
307
247
|
}
|
|
308
248
|
function w(e) {
|
|
309
249
|
e.setAttribute(l, "");
|
|
310
250
|
}
|
|
311
|
-
function
|
|
312
|
-
const t = e.getAttribute(b) ?? e.getAttribute(f) ??
|
|
251
|
+
function Se(e) {
|
|
252
|
+
const t = e.getAttribute(b) ?? e.getAttribute(f) ?? Ee(e);
|
|
313
253
|
return [e.getAttribute(p) ?? e.getAttribute("src") ?? "", e.getAttribute("type") ?? "", e.integrity, t].join("\0");
|
|
314
254
|
}
|
|
315
|
-
function
|
|
316
|
-
const t = S(e.strategy) ?
|
|
255
|
+
function $e(e) {
|
|
256
|
+
const t = S(e.strategy) ? v : e.type ?? V(e.strategy);
|
|
317
257
|
return [e.src, t, e.integrity ?? "", e.strategy].join("\0");
|
|
318
258
|
}
|
|
319
|
-
function
|
|
259
|
+
function Ee(e) {
|
|
320
260
|
return e.type === "module" ? "module" : "afterInteractive";
|
|
321
261
|
}
|
|
322
|
-
function
|
|
262
|
+
function V(e) {
|
|
323
263
|
return e === "module" ? "module" : "";
|
|
324
264
|
}
|
|
325
|
-
const
|
|
265
|
+
const ve = /* @__PURE__ */ new Set([
|
|
326
266
|
"afterInteractive",
|
|
327
267
|
"beforeInteractive",
|
|
328
268
|
"idle",
|
|
329
269
|
"module",
|
|
330
270
|
"worker"
|
|
331
|
-
]), u = Symbol("demiurge.scriptPlacement"),
|
|
271
|
+
]), u = Symbol("demiurge.scriptPlacement"), W = Z(
|
|
332
272
|
void 0
|
|
333
273
|
);
|
|
334
|
-
function
|
|
274
|
+
function be(e = {}) {
|
|
335
275
|
let t = !1;
|
|
336
|
-
const
|
|
276
|
+
const r = [...e.scripts ?? []], n = new Set(r.map((c) => c.src)), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
|
|
337
277
|
return {
|
|
338
278
|
get dev() {
|
|
339
279
|
return e.dev ?? !1;
|
|
@@ -346,7 +286,7 @@ function De(e = {}) {
|
|
|
346
286
|
},
|
|
347
287
|
nonce: e.nonce,
|
|
348
288
|
register(c) {
|
|
349
|
-
if (
|
|
289
|
+
if (n.has(c.src) || i.has(c.src))
|
|
350
290
|
return "skip";
|
|
351
291
|
if (i.add(c.src), !t)
|
|
352
292
|
return a.set(c.src, {
|
|
@@ -360,30 +300,30 @@ function De(e = {}) {
|
|
|
360
300
|
return "render";
|
|
361
301
|
},
|
|
362
302
|
scripts() {
|
|
363
|
-
return
|
|
303
|
+
return H([...r, ...a.values()]);
|
|
364
304
|
}
|
|
365
305
|
};
|
|
366
306
|
}
|
|
367
|
-
function
|
|
368
|
-
const t =
|
|
369
|
-
if (
|
|
370
|
-
S(
|
|
307
|
+
function it(e) {
|
|
308
|
+
const t = ee(W), r = De(e);
|
|
309
|
+
if (te(() => {
|
|
310
|
+
S(r.strategy) && G();
|
|
371
311
|
}), !t) {
|
|
372
312
|
if (typeof document > "u")
|
|
373
313
|
throw new Error(
|
|
374
|
-
`The script ${JSON.stringify(
|
|
314
|
+
`The script ${JSON.stringify(r.src)} rendered outside a Demiurge document render context. A server render must wrap its component tree with the script render context.`
|
|
375
315
|
);
|
|
376
|
-
return
|
|
377
|
-
...
|
|
316
|
+
return we(r.src) ? null : U({
|
|
317
|
+
...r,
|
|
378
318
|
[u]: "in-place"
|
|
379
|
-
},
|
|
319
|
+
}, Re());
|
|
380
320
|
}
|
|
381
|
-
return t.register(
|
|
382
|
-
...
|
|
321
|
+
return t.register(r) !== "render" ? null : U({
|
|
322
|
+
...r,
|
|
383
323
|
[u]: "in-place"
|
|
384
324
|
}, t.nonce);
|
|
385
325
|
}
|
|
386
|
-
function
|
|
326
|
+
function U(e, t) {
|
|
387
327
|
return S(e.strategy) ? g("script", {
|
|
388
328
|
"data-api": e.dataApi,
|
|
389
329
|
[f]: e.strategy,
|
|
@@ -395,7 +335,7 @@ function L(e, t) {
|
|
|
395
335
|
integrity: e.integrity,
|
|
396
336
|
nonce: e.nonce ?? t,
|
|
397
337
|
referrerPolicy: e.referrerPolicy,
|
|
398
|
-
type:
|
|
338
|
+
type: v
|
|
399
339
|
}) : g("script", {
|
|
400
340
|
async: e.async,
|
|
401
341
|
crossOrigin: e.crossOrigin,
|
|
@@ -408,27 +348,27 @@ function L(e, t) {
|
|
|
408
348
|
nonce: e.nonce ?? t,
|
|
409
349
|
referrerPolicy: e.referrerPolicy,
|
|
410
350
|
src: e.src,
|
|
411
|
-
type: e.type ??
|
|
351
|
+
type: e.type ?? _e(e.strategy)
|
|
412
352
|
});
|
|
413
353
|
}
|
|
414
|
-
function
|
|
354
|
+
function we(e) {
|
|
415
355
|
if (typeof document > "u")
|
|
416
356
|
return !1;
|
|
417
357
|
const t = new URL(e, document.baseURI).href;
|
|
418
358
|
return [...document.scripts].some(
|
|
419
|
-
(
|
|
359
|
+
(r) => r.src === t && r.dataset.demiurgeScriptPlacement !== "in-place"
|
|
420
360
|
);
|
|
421
361
|
}
|
|
422
|
-
function
|
|
362
|
+
function Re() {
|
|
423
363
|
if (!(typeof document > "u"))
|
|
424
364
|
return [...document.scripts].reverse().find((e) => e.nonce)?.nonce;
|
|
425
365
|
}
|
|
426
|
-
function
|
|
366
|
+
function ot(e) {
|
|
427
367
|
return e;
|
|
428
368
|
}
|
|
429
|
-
function
|
|
369
|
+
function De(e) {
|
|
430
370
|
const t = e.strategy ?? "afterInteractive";
|
|
431
|
-
if (!
|
|
371
|
+
if (!ve.has(t))
|
|
432
372
|
throw new Error(
|
|
433
373
|
`Unsupported script strategy ${JSON.stringify(t)}. Demiurge supports "beforeInteractive", "module", "afterInteractive", "idle", and "worker".`
|
|
434
374
|
);
|
|
@@ -446,29 +386,29 @@ function _e(e) {
|
|
|
446
386
|
strategy: t
|
|
447
387
|
};
|
|
448
388
|
}
|
|
449
|
-
function
|
|
450
|
-
return g(
|
|
389
|
+
function Ie(e, t) {
|
|
390
|
+
return g(W.Provider, { value: e, children: t });
|
|
451
391
|
}
|
|
452
|
-
async function
|
|
453
|
-
const
|
|
454
|
-
for (const
|
|
455
|
-
if (!
|
|
392
|
+
async function ct(e, t) {
|
|
393
|
+
const r = [];
|
|
394
|
+
for (const n of e) {
|
|
395
|
+
if (!n)
|
|
456
396
|
continue;
|
|
457
|
-
const i = typeof
|
|
458
|
-
|
|
397
|
+
const i = typeof n == "function" ? await n(t) : n;
|
|
398
|
+
r.push(...i);
|
|
459
399
|
}
|
|
460
|
-
return
|
|
400
|
+
return H(Te(r));
|
|
461
401
|
}
|
|
462
|
-
function
|
|
402
|
+
function Te(e) {
|
|
463
403
|
const t = /* @__PURE__ */ new Map();
|
|
464
|
-
for (const
|
|
465
|
-
t.set(
|
|
466
|
-
...t.get(
|
|
467
|
-
...
|
|
404
|
+
for (const r of e)
|
|
405
|
+
t.set(M(r), {
|
|
406
|
+
...t.get(M(r)),
|
|
407
|
+
...r
|
|
468
408
|
});
|
|
469
409
|
return [...t.values()];
|
|
470
410
|
}
|
|
471
|
-
function
|
|
411
|
+
function M(e) {
|
|
472
412
|
return [
|
|
473
413
|
e.src,
|
|
474
414
|
e.type ?? "",
|
|
@@ -476,53 +416,53 @@ function B(e) {
|
|
|
476
416
|
e.strategy
|
|
477
417
|
].join("\0");
|
|
478
418
|
}
|
|
479
|
-
function
|
|
480
|
-
return
|
|
419
|
+
function ke(e, t) {
|
|
420
|
+
return B(e.strategy) - B(t.strategy) || e.src.localeCompare(t.src);
|
|
481
421
|
}
|
|
482
|
-
function
|
|
483
|
-
return e.sort(
|
|
422
|
+
function H(e) {
|
|
423
|
+
return e.sort(ke);
|
|
484
424
|
}
|
|
485
|
-
function
|
|
425
|
+
function _e(e) {
|
|
486
426
|
return e === "module" ? "module" : void 0;
|
|
487
427
|
}
|
|
488
|
-
function
|
|
428
|
+
function B(e) {
|
|
489
429
|
return e === "beforeInteractive" ? 0 : e === "module" ? 1 : e === "afterInteractive" ? 2 : e === "idle" ? 3 : 4;
|
|
490
430
|
}
|
|
491
|
-
const
|
|
492
|
-
function
|
|
431
|
+
const Oe = "data-demiurge-structured-data";
|
|
432
|
+
function Ce(e) {
|
|
493
433
|
if (e.body) {
|
|
494
|
-
const { html: t, ...
|
|
495
|
-
return `${
|
|
434
|
+
const { html: t, ...r } = e.body, { prefix: n, suffix: i } = xe({ ...e, body: r });
|
|
435
|
+
return `${n}${t}${i}`;
|
|
496
436
|
}
|
|
497
|
-
return
|
|
437
|
+
return Ne(e);
|
|
498
438
|
}
|
|
499
|
-
function
|
|
439
|
+
function xe({
|
|
500
440
|
body: e,
|
|
501
441
|
dir: t,
|
|
502
|
-
entrySrc:
|
|
503
|
-
lang:
|
|
442
|
+
entrySrc: r,
|
|
443
|
+
lang: n = "en",
|
|
504
444
|
links: i = [],
|
|
505
445
|
metadata: a,
|
|
506
446
|
nonce: c,
|
|
507
447
|
scripts: $ = [],
|
|
508
448
|
styles: R = [],
|
|
509
|
-
title:
|
|
449
|
+
title: D = "Demiurge App"
|
|
510
450
|
}) {
|
|
511
|
-
const
|
|
512
|
-
...$.filter((
|
|
513
|
-
|
|
514
|
-
...
|
|
451
|
+
const I = a?.title ?? D, y = [
|
|
452
|
+
...$.filter((T) => T[u] !== "hoisted").map((T) => ` ${x(T, c)}`),
|
|
453
|
+
Me(e.data, e.navigation, e.locale),
|
|
454
|
+
...r ? [z(r, c)] : []
|
|
515
455
|
].join(`
|
|
516
456
|
`);
|
|
517
457
|
return {
|
|
518
458
|
prefix: `<!doctype html>
|
|
519
|
-
<html lang="${s(
|
|
459
|
+
<html lang="${s(n)}"${o("dir", t)}>
|
|
520
460
|
<head>
|
|
521
|
-
${
|
|
461
|
+
${Q({ links: i, metadata: a, nonce: c, scripts: $, styles: R, title: I })}
|
|
522
462
|
</head>
|
|
523
463
|
<body>
|
|
524
|
-
${e.navigation === "document" ? "" :
|
|
525
|
-
${
|
|
464
|
+
${e.navigation === "document" ? "" : K(c)}
|
|
465
|
+
${Ue(e)}`,
|
|
526
466
|
suffix: `</div>
|
|
527
467
|
${y}
|
|
528
468
|
</body>
|
|
@@ -530,57 +470,57 @@ ${y}
|
|
|
530
470
|
`
|
|
531
471
|
};
|
|
532
472
|
}
|
|
533
|
-
function
|
|
473
|
+
function Ne({
|
|
534
474
|
dir: e,
|
|
535
475
|
entrySrc: t,
|
|
536
|
-
lang:
|
|
537
|
-
links:
|
|
476
|
+
lang: r = "en",
|
|
477
|
+
links: n = [],
|
|
538
478
|
metadata: i,
|
|
539
479
|
nonce: a,
|
|
540
480
|
scripts: c = [],
|
|
541
481
|
styles: $ = [],
|
|
542
482
|
title: R = "Demiurge App"
|
|
543
483
|
}) {
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
484
|
+
const D = i?.title ?? R, I = [
|
|
485
|
+
K(a),
|
|
486
|
+
Pe(),
|
|
547
487
|
...c.filter((y) => y[u] !== "hoisted").map((y) => ` ${x(y, a)}`),
|
|
548
|
-
...t ? [
|
|
488
|
+
...t ? [z(t, a)] : []
|
|
549
489
|
].join(`
|
|
550
490
|
`);
|
|
551
491
|
return `<!doctype html>
|
|
552
|
-
<html lang="${s(
|
|
492
|
+
<html lang="${s(r)}"${o("dir", e)}>
|
|
553
493
|
<head>
|
|
554
|
-
${
|
|
494
|
+
${Q({ links: n, metadata: i, nonce: a, scripts: c, styles: $, title: D })}
|
|
555
495
|
</head>
|
|
556
496
|
<body>
|
|
557
|
-
${
|
|
497
|
+
${I}
|
|
558
498
|
</body>
|
|
559
499
|
</html>
|
|
560
500
|
`;
|
|
561
501
|
}
|
|
562
|
-
function
|
|
563
|
-
return " <style " +
|
|
564
|
-
<div id="` +
|
|
502
|
+
function K(e) {
|
|
503
|
+
return " <style " + J + o("nonce", e) + `>.demiurge-navigation-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}</style>
|
|
504
|
+
<div id="` + j + '" ' + m + ' class="demiurge-navigation-status" role="status" aria-live="polite" aria-atomic="true"></div>';
|
|
565
505
|
}
|
|
566
|
-
function
|
|
506
|
+
function Pe(e) {
|
|
567
507
|
return ' <div id="root"></div>';
|
|
568
508
|
}
|
|
569
|
-
function
|
|
570
|
-
const t = e.fallback ? ` ${
|
|
571
|
-
return ` <div id="root" ${
|
|
509
|
+
function Ue(e) {
|
|
510
|
+
const t = e.fallback ? ` ${ne}="${s(e.fallback)}"` : "";
|
|
511
|
+
return ` <div id="root" ${re}=""${t}>`;
|
|
572
512
|
}
|
|
573
|
-
function
|
|
574
|
-
return ` <template id="${
|
|
513
|
+
function Me(e, t, r) {
|
|
514
|
+
return ` <template id="${L}">${ie(e, { locale: r, navigation: t })}</template>`;
|
|
575
515
|
}
|
|
576
|
-
function
|
|
516
|
+
function z(e, t) {
|
|
577
517
|
return ` <script type="module" src="${s(e)}"${o("nonce", t)}><\/script>`;
|
|
578
518
|
}
|
|
579
|
-
function
|
|
519
|
+
function Q({
|
|
580
520
|
links: e,
|
|
581
521
|
metadata: t,
|
|
582
|
-
nonce:
|
|
583
|
-
scripts:
|
|
522
|
+
nonce: r,
|
|
523
|
+
scripts: n,
|
|
584
524
|
styles: i,
|
|
585
525
|
title: a
|
|
586
526
|
}) {
|
|
@@ -606,21 +546,21 @@ function Z({
|
|
|
606
546
|
rel: "canonical"
|
|
607
547
|
}, !0)
|
|
608
548
|
] : [],
|
|
609
|
-
...
|
|
610
|
-
...
|
|
611
|
-
...(t?.custom ?? []).map(
|
|
549
|
+
...Be(t),
|
|
550
|
+
...qe(t),
|
|
551
|
+
...(t?.custom ?? []).map(Le),
|
|
612
552
|
...(t?.structuredData ?? []).map(
|
|
613
|
-
(c) =>
|
|
553
|
+
(c) => Fe(c, r)
|
|
614
554
|
),
|
|
615
555
|
...i.map(
|
|
616
556
|
(c) => ` <link rel="stylesheet" href="${s(c)}" />`
|
|
617
557
|
),
|
|
618
558
|
...e.map((c) => O(c, !0)),
|
|
619
|
-
...
|
|
559
|
+
...n.filter((c) => c[u] === "hoisted").map((c) => ` ${x(c, r)}`)
|
|
620
560
|
].join(`
|
|
621
561
|
`);
|
|
622
562
|
}
|
|
623
|
-
function
|
|
563
|
+
function Be(e) {
|
|
624
564
|
if (!e?.robots)
|
|
625
565
|
return [];
|
|
626
566
|
const t = [
|
|
@@ -634,7 +574,7 @@ function Fe(e) {
|
|
|
634
574
|
}, !0)
|
|
635
575
|
];
|
|
636
576
|
}
|
|
637
|
-
function
|
|
577
|
+
function qe(e) {
|
|
638
578
|
return e?.openGraph ? [
|
|
639
579
|
e.openGraph.title ? d({
|
|
640
580
|
content: e.openGraph.title,
|
|
@@ -650,73 +590,73 @@ function je(e) {
|
|
|
650
590
|
}, !0) : null
|
|
651
591
|
].filter((t) => !!t) : [];
|
|
652
592
|
}
|
|
653
|
-
function
|
|
593
|
+
function Le(e) {
|
|
654
594
|
return e.kind === "link" ? O(e, !0) : d(e, !0);
|
|
655
595
|
}
|
|
656
|
-
function
|
|
657
|
-
return ` <script type="application/ld+json"${` ${l}` + (t ? "" : ` ${
|
|
596
|
+
function Fe(e, t) {
|
|
597
|
+
return ` <script type="application/ld+json"${` ${l}` + (t ? "" : ` ${Oe}`)}${o("nonce", t)}>${Je(JSON.stringify(e.value))}<\/script>`;
|
|
658
598
|
}
|
|
659
599
|
function d(e, t = !1) {
|
|
660
|
-
const
|
|
600
|
+
const r = t ? ` ${l}` : "";
|
|
661
601
|
if (e.name === "charset")
|
|
662
|
-
return ` <meta${
|
|
663
|
-
const
|
|
664
|
-
return ` <meta${
|
|
602
|
+
return ` <meta${r} charset="${s(e.content)}" />`;
|
|
603
|
+
const n = e.name ? ` name="${s(e.name)}"` : "", i = e.property ? ` property="${s(e.property)}"` : "";
|
|
604
|
+
return ` <meta${r}${n}${i} content="${s(e.content)}" />`;
|
|
665
605
|
}
|
|
666
606
|
function O(e, t = !1) {
|
|
667
607
|
return ` <link${t ? ` ${l}` : ""}${o("rel", e.rel)}${o("href", e.href)}${o("as", e.as)}${o("type", e.type)}${o("crossorigin", e.crossOrigin)}${o("hreflang", e.hrefLang)} />`;
|
|
668
608
|
}
|
|
669
609
|
function x(e, t) {
|
|
670
|
-
return S(e.strategy) ?
|
|
610
|
+
return S(e.strategy) ? Ge(e, t) : `<script ${l}${o(b, e.strategy)}${o("id", e.id)}${o("src", e.src)}${o("type", e.type ?? je(e.strategy))}${o("nonce", e.nonce ?? t)}${o("integrity", e.integrity)}${o("crossorigin", e.crossOrigin)}${o("referrerpolicy", e.referrerPolicy)}${o("data-api", e.dataApi)}${o("data-domain", e.dataDomain)}${o("data-demiurge-script-placement", e[u])}${q("async", e.async)}${q("defer", e.defer)}><\/script>`;
|
|
671
611
|
}
|
|
672
|
-
function
|
|
673
|
-
return `<script ${l}${o(b, e.strategy)}${o("id", e.id)}${o("type",
|
|
612
|
+
function Ge(e, t) {
|
|
613
|
+
return `<script ${l}${o(b, e.strategy)}${o("id", e.id)}${o("type", v)}${o("nonce", e.nonce ?? t)}${o("integrity", e.integrity)}${o("crossorigin", e.crossOrigin)}${o("referrerpolicy", e.referrerPolicy)}${o("data-api", e.dataApi)}${o("data-domain", e.dataDomain)}${o(f, e.strategy)}${o(p, e.src)}${o(A, e.type)}${o("data-demiurge-script-placement", e[u])}><\/script>`;
|
|
674
614
|
}
|
|
675
|
-
function
|
|
615
|
+
function je(e) {
|
|
676
616
|
return e === "module" ? "module" : void 0;
|
|
677
617
|
}
|
|
678
618
|
function o(e, t) {
|
|
679
619
|
return t ? ` ${e}="${s(t)}"` : "";
|
|
680
620
|
}
|
|
681
|
-
function
|
|
621
|
+
function q(e, t) {
|
|
682
622
|
return t ? ` ${e}` : "";
|
|
683
623
|
}
|
|
684
624
|
function s(e) {
|
|
685
625
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
686
626
|
}
|
|
687
|
-
function
|
|
627
|
+
function Je(e) {
|
|
688
628
|
return e.replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
|
|
689
629
|
}
|
|
690
|
-
function
|
|
691
|
-
const
|
|
630
|
+
function Ye(e, t) {
|
|
631
|
+
const r = g(e.page, {
|
|
692
632
|
data: e.data,
|
|
693
633
|
locale: e.locale,
|
|
694
634
|
path: e.path,
|
|
695
635
|
pathname: e.pathname
|
|
696
|
-
}),
|
|
636
|
+
}), n = e.layouts.reduceRight(
|
|
697
637
|
(i, a) => g(a, {
|
|
698
638
|
children: i,
|
|
699
639
|
locale: e.locale,
|
|
700
640
|
path: e.path,
|
|
701
641
|
pathname: e.pathname
|
|
702
642
|
}),
|
|
703
|
-
|
|
643
|
+
r
|
|
704
644
|
);
|
|
705
|
-
return t ?
|
|
645
|
+
return t ? Ie(t, n) : n;
|
|
706
646
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
647
|
+
function Ve(e, t = {}) {
|
|
648
|
+
return be({
|
|
709
649
|
dev: t.dev,
|
|
710
650
|
nonce: t.nonce,
|
|
711
651
|
scripts: e.scripts
|
|
712
652
|
});
|
|
713
653
|
}
|
|
714
|
-
function
|
|
715
|
-
const
|
|
716
|
-
return
|
|
654
|
+
function We(e, t = {}) {
|
|
655
|
+
const r = Ve(e, t), n = X(Ye(e, r));
|
|
656
|
+
return Ce({
|
|
717
657
|
body: {
|
|
718
658
|
data: e.data,
|
|
719
|
-
html:
|
|
659
|
+
html: n,
|
|
720
660
|
locale: t.locale,
|
|
721
661
|
navigation: e.render.mode === "static" ? "document" : t.navigation
|
|
722
662
|
},
|
|
@@ -726,34 +666,34 @@ function Qe(e, t = {}) {
|
|
|
726
666
|
links: e.links,
|
|
727
667
|
metadata: e.metadata,
|
|
728
668
|
nonce: t.nonce,
|
|
729
|
-
scripts:
|
|
669
|
+
scripts: r.scripts(),
|
|
730
670
|
styles: t.styles,
|
|
731
671
|
title: t.title
|
|
732
672
|
});
|
|
733
673
|
}
|
|
734
|
-
function
|
|
735
|
-
const
|
|
736
|
-
return new Response(
|
|
674
|
+
function at(e, t = {}) {
|
|
675
|
+
const r = We(e, t);
|
|
676
|
+
return new Response(r, {
|
|
737
677
|
headers: {
|
|
738
678
|
"content-type": "text/html; charset=utf-8"
|
|
739
679
|
}
|
|
740
680
|
});
|
|
741
681
|
}
|
|
742
682
|
const h = /* @__PURE__ */ new WeakMap();
|
|
743
|
-
function
|
|
683
|
+
function st(e) {
|
|
744
684
|
return h.get(e);
|
|
745
685
|
}
|
|
746
|
-
function
|
|
686
|
+
function ut(e) {
|
|
747
687
|
return h.get(e)?.clientIp;
|
|
748
688
|
}
|
|
749
|
-
function
|
|
689
|
+
function dt(e, t) {
|
|
750
690
|
h.set(e, t);
|
|
751
691
|
}
|
|
752
|
-
function
|
|
753
|
-
const
|
|
754
|
-
|
|
692
|
+
function lt(e, t) {
|
|
693
|
+
const r = h.get(e);
|
|
694
|
+
r && h.set(t, r);
|
|
755
695
|
}
|
|
756
|
-
const
|
|
696
|
+
const He = {
|
|
757
697
|
backgroundLifetime: !1,
|
|
758
698
|
crossOriginIsolationHeaders: !1,
|
|
759
699
|
nonceInjection: !1,
|
|
@@ -764,70 +704,65 @@ const Xe = {
|
|
|
764
704
|
webSocket: !1,
|
|
765
705
|
webTransport: !1
|
|
766
706
|
};
|
|
767
|
-
function
|
|
707
|
+
function ft(e) {
|
|
768
708
|
return {
|
|
769
709
|
capabilities: {
|
|
770
|
-
...
|
|
710
|
+
...He,
|
|
771
711
|
...e.capabilities
|
|
772
712
|
},
|
|
773
713
|
name: e.name
|
|
774
714
|
};
|
|
775
715
|
}
|
|
776
|
-
function
|
|
777
|
-
const
|
|
716
|
+
function Ke(e, t) {
|
|
717
|
+
const r = [...new Set(t)], n = r.filter(
|
|
778
718
|
(i) => !e.capabilities[i]
|
|
779
719
|
);
|
|
780
720
|
return {
|
|
781
721
|
adapter: e.name,
|
|
782
|
-
missing:
|
|
783
|
-
ok:
|
|
784
|
-
required:
|
|
722
|
+
missing: n,
|
|
723
|
+
ok: n.length === 0,
|
|
724
|
+
required: r
|
|
785
725
|
};
|
|
786
726
|
}
|
|
787
|
-
function
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
727
|
+
function pt(e, t) {
|
|
728
|
+
const r = Ke(e, t);
|
|
729
|
+
if (!r.ok)
|
|
790
730
|
throw new Error(
|
|
791
|
-
`Adapter "${e.name}" does not support required capabilities: ${
|
|
731
|
+
`Adapter "${e.name}" does not support required capabilities: ${r.missing.join(", ")}.`
|
|
792
732
|
);
|
|
793
|
-
return
|
|
733
|
+
return r;
|
|
794
734
|
}
|
|
795
735
|
export {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
Oe as
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
Ze as
|
|
823
|
-
|
|
824
|
-
St as s,
|
|
825
|
-
C as t,
|
|
826
|
-
it as u,
|
|
827
|
-
yt as v,
|
|
828
|
-
At as w,
|
|
736
|
+
lt as A,
|
|
737
|
+
st as B,
|
|
738
|
+
k as F,
|
|
739
|
+
re as H,
|
|
740
|
+
Oe as S,
|
|
741
|
+
at as a,
|
|
742
|
+
Ye as b,
|
|
743
|
+
Ve as c,
|
|
744
|
+
ft as d,
|
|
745
|
+
Ce as e,
|
|
746
|
+
We as f,
|
|
747
|
+
et as g,
|
|
748
|
+
nt as h,
|
|
749
|
+
Xe as i,
|
|
750
|
+
G as j,
|
|
751
|
+
ne as k,
|
|
752
|
+
tt as l,
|
|
753
|
+
De as m,
|
|
754
|
+
it as n,
|
|
755
|
+
pt as o,
|
|
756
|
+
Ke as p,
|
|
757
|
+
C as q,
|
|
758
|
+
xe as r,
|
|
759
|
+
dt as s,
|
|
760
|
+
ot as t,
|
|
761
|
+
ut as u,
|
|
762
|
+
Ze as v,
|
|
763
|
+
ct as w,
|
|
829
764
|
rt as x,
|
|
830
|
-
|
|
831
|
-
|
|
765
|
+
be as y,
|
|
766
|
+
Ie as z
|
|
832
767
|
};
|
|
833
|
-
//# sourceMappingURL=index-
|
|
768
|
+
//# sourceMappingURL=index-LYve1rQp.js.map
|