@oktis-works/admin 0.4.5 → 0.4.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.
Files changed (46) hide show
  1. package/dist/client/_astro/{ActivityWidget.B1PK1jNM.js → ActivityWidget.CSfbsvBc.js} +1 -1
  2. package/dist/client/_astro/{AdminBar.DGqkNINI.js → AdminBar.CUVES5PS.js} +1 -1
  3. package/dist/client/_astro/{AtGlanceWidget.BgJ5h99N.js → AtGlanceWidget.Csh6O1qC.js} +1 -1
  4. package/dist/client/_astro/{ContentEditor.BG7DWach.js → ContentEditor.uJ5F6gSs.js} +1 -1
  5. package/dist/client/_astro/{ContentList.CfGc6HN5.js → ContentList.CVy_dKZZ.js} +1 -1
  6. package/dist/client/_astro/{DashboardHome._7yIrBzf.js → DashboardHome.DZVGJl33.js} +1 -1
  7. package/dist/client/_astro/{Footer.DNygiGaK.js → Footer.B45KEgQC.js} +1 -1
  8. package/dist/client/_astro/{GeneralSettings.BwnPXbvc.js → GeneralSettings.BS1F1fbv.js} +1 -1
  9. package/dist/client/_astro/{HelpTabs.Ddud8gs3.js → HelpTabs.CHwVYwbx.js} +1 -1
  10. package/dist/client/_astro/{LanguageSelector.Dx6zaHYm.js → LanguageSelector.Q7Z9r8MH.js} +1 -1
  11. package/dist/client/_astro/{MediaLibrary.BXUJ5yFA.js → MediaLibrary.BG_XuGSC.js} +1 -1
  12. package/dist/client/_astro/{PostTypesManager.CA2yTVB_.js → PostTypesManager.kgLZEJjr.js} +1 -1
  13. package/dist/client/_astro/{QuickDraftWidget.mGSPvuO1.js → QuickDraftWidget.DsmDxcjM.js} +1 -1
  14. package/dist/client/_astro/{ScreenOptions.Dgiw-9ow.js → ScreenOptions.CtkDOZLA.js} +1 -1
  15. package/dist/client/_astro/{TaxonomiesManager.D3HNo_oM.js → TaxonomiesManager.BBL0hyRa.js} +1 -1
  16. package/dist/client/_astro/{UserCreateForm.CTv1Gd43.js → UserCreateForm.PVLoPXwZ.js} +1 -1
  17. package/dist/client/_astro/{UsersManager.DPpSVGNe.js → UsersManager.CG61mqGd.js} +1 -1
  18. package/dist/client/_astro/i18n.DJXYgZ8Z.js +1 -0
  19. package/dist/client/_astro/{version.Nb2oYOEv.js → version.DLKCNYBX.js} +1 -1
  20. package/dist/server/chunks/{ContentEditor_BBRShWen.mjs → ContentEditor_DYVCMTXI.mjs} +2 -1
  21. package/dist/server/chunks/{DashboardLayout_Bovvwryd.mjs → DashboardLayout_BSI1WOi6.mjs} +3 -520
  22. package/dist/server/chunks/{MediaLibrary_D642tNJW.mjs → MediaLibrary_DZjpMXgK.mjs} +2 -1
  23. package/dist/server/chunks/{_slug__1wjjnCET.mjs → _slug__CT9lqK13.mjs} +1 -1
  24. package/dist/server/chunks/{edit_CwcI7ktp.mjs → edit_BUOEvmvl.mjs} +2 -2
  25. package/dist/server/chunks/{general_BaDbl4Wr.mjs → general_pGxOJQzX.mjs} +2 -1
  26. package/dist/server/chunks/i18n_DnHqy5K-.mjs +527 -0
  27. package/dist/server/chunks/{index_BhiDsMlY.mjs → index_BSxjpQXZ.mjs} +2 -1
  28. package/dist/server/chunks/{index_BFkdbwIy.mjs → index_CHL9vq3T.mjs} +2 -1
  29. package/dist/server/chunks/{index_H2pEVNWz.mjs → index_DgL2eLJu.mjs} +2 -1
  30. package/dist/server/chunks/{index_DJR3_bFr.mjs → index_IW6nshbT.mjs} +2 -2
  31. package/dist/server/chunks/{index_C1QI7FxU.mjs → index_YwwAn3Lb.mjs} +1 -1
  32. package/dist/server/chunks/{new_gSlSMkHz.mjs → new_BfiBbnro.mjs} +2 -2
  33. package/dist/server/chunks/{new_IQ6j1Io5.mjs → new_D1aZllsr.mjs} +2 -1
  34. package/dist/server/chunks/{node_BafXIcNi.mjs → node_kWZa8y--.mjs} +3 -3
  35. package/dist/server/chunks/{post-types_DRyuljL7.mjs → post-types_76cyJz6s.mjs} +2 -1
  36. package/dist/server/chunks/remote_ByPF9VwL.mjs +49 -0
  37. package/dist/server/chunks/sequence_CQpaaIXP.mjs +1420 -0
  38. package/dist/server/chunks/{sharp_C91d8fsK.mjs → sharp_37gnUicY.mjs} +1 -1
  39. package/dist/server/chunks/{taxonomies_R8eUe0nJ.mjs → taxonomies_DFQu9XsS.mjs} +2 -1
  40. package/dist/server/chunks/{upload_BOeG_XAR.mjs → upload_39j7H3EB.mjs} +2 -2
  41. package/dist/server/entry.mjs +23 -1151
  42. package/dist/server/virtual_astro_middleware.mjs +56 -2
  43. package/package.json +1 -1
  44. package/dist/client/_astro/i18n.CLOpd2JA.js +0 -1
  45. package/dist/server/chunks/console_B_CnzVJ2.mjs +0 -170
  46. package/dist/server/chunks/remote_DUw5DMmE.mjs +0 -169
@@ -0,0 +1,1420 @@
1
+ import { C as InvalidGetStaticPathsReturn, S as InvalidGetStaticPathsEntry, U as PrerenderDynamicEndpointPathCollide, V as PageNumberParamNotFound, _ as GetStaticPathsInvalidRouteParam, g as GetStaticPathsExpectedParams, h as ForbiddenRewrite, q as RewriteWithBodyUsed, t as AstroError, v as GetStaticPathsRequired, z as NoMatchingStaticPathFound } from "./errors_Bf5VCr3E.mjs";
2
+ import { C as isRoute404, L as decryptString, M as fetchStateSymbol, O as DEFAULT_404_COMPONENT, P as originPathnameSymbol, T as s, i as renderComponent, o as createSlotValueFromString, u as renderTemplate, v as isAstroComponentFactory, w as isRoute500, y as markHTMLString } from "./server_B5N27szj.mjs";
3
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/middleware/defineMiddleware.js
4
+ function defineMiddleware(fn) {
5
+ return fn;
6
+ }
7
+ //#endregion
8
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/build/util.js
9
+ function shouldAppendForwardSlash(trailingSlash, buildFormat) {
10
+ switch (trailingSlash) {
11
+ case "always": return true;
12
+ case "never": return false;
13
+ case "ignore": switch (buildFormat) {
14
+ case "directory": return true;
15
+ case "preserve":
16
+ case "file": return false;
17
+ }
18
+ }
19
+ }
20
+ //#endregion
21
+ //#region ../../node_modules/.bun/@astrojs+internal-helpers@0.11.0/node_modules/@astrojs/internal-helpers/dist/path.js
22
+ function appendForwardSlash(path) {
23
+ return path.endsWith("/") ? path : path + "/";
24
+ }
25
+ function prependForwardSlash(path) {
26
+ return path[0] === "/" ? path : "/" + path;
27
+ }
28
+ var MANY_LEADING_SLASHES = /^\/{2,}/;
29
+ function collapseDuplicateLeadingSlashes(path) {
30
+ if (!path) return path;
31
+ return path.replace(MANY_LEADING_SLASHES, "/");
32
+ }
33
+ var MANY_SLASHES = /\/{2,}/g;
34
+ function collapseDuplicateSlashes(path) {
35
+ if (!path) return path;
36
+ return path.replace(MANY_SLASHES, "/");
37
+ }
38
+ var MANY_TRAILING_SLASHES = /\/{2,}$/g;
39
+ function collapseDuplicateTrailingSlashes(path, trailingSlash) {
40
+ if (!path) return path;
41
+ return path.replace(MANY_TRAILING_SLASHES, trailingSlash ? "/" : "") || "/";
42
+ }
43
+ function removeTrailingForwardSlash(path) {
44
+ return path.endsWith("/") ? path.slice(0, path.length - 1) : path;
45
+ }
46
+ function removeLeadingForwardSlash(path) {
47
+ return path.startsWith("/") ? path.substring(1) : path;
48
+ }
49
+ function trimSlashes(path) {
50
+ return path.replace(/^\/|\/$/g, "");
51
+ }
52
+ function isString(path) {
53
+ return typeof path === "string" || path instanceof String;
54
+ }
55
+ var INTERNAL_PREFIXES = /* @__PURE__ */ new Set([
56
+ "/_",
57
+ "/@",
58
+ "/.",
59
+ "//"
60
+ ]);
61
+ var JUST_SLASHES = /^\/{2,}$/;
62
+ function isInternalPath(path) {
63
+ const prefix = path.slice(0, 2).replace(/\\/g, "/");
64
+ return INTERNAL_PREFIXES.has(prefix) && !JUST_SLASHES.test(path);
65
+ }
66
+ function joinPaths(...paths) {
67
+ return paths.filter(isString).map((path, i) => {
68
+ if (i === 0) return removeTrailingForwardSlash(path);
69
+ else if (i === paths.length - 1) return removeLeadingForwardSlash(path);
70
+ else return trimSlashes(path);
71
+ }).join("/");
72
+ }
73
+ function removeQueryString(path) {
74
+ const index = path.lastIndexOf("?");
75
+ return index > 0 ? path.substring(0, index) : path;
76
+ }
77
+ function isRemotePath(src) {
78
+ if (!src) return false;
79
+ const trimmed = src.trim();
80
+ if (!trimmed) return false;
81
+ let decoded = trimmed;
82
+ let previousDecoded = "";
83
+ let maxIterations = 10;
84
+ while (decoded !== previousDecoded && maxIterations > 0) {
85
+ previousDecoded = decoded;
86
+ try {
87
+ decoded = decodeURIComponent(decoded);
88
+ } catch {
89
+ break;
90
+ }
91
+ maxIterations--;
92
+ }
93
+ if (/^[a-zA-Z]:/.test(decoded)) return false;
94
+ if (decoded[0] === "/" && /^\/[\w.@-]/.test(decoded)) return false;
95
+ if (decoded[0] === "\\") return true;
96
+ if (decoded.startsWith("//")) return true;
97
+ try {
98
+ const url = new URL(decoded, "http://n");
99
+ if (url.username || url.password) return true;
100
+ if (decoded.includes("@") && !url.pathname.includes("@") && !url.search.includes("@")) return true;
101
+ if (url.origin !== "http://n") {
102
+ if (url.protocol.toLowerCase() === "file:") return false;
103
+ return true;
104
+ }
105
+ if (URL.canParse(decoded)) return true;
106
+ return false;
107
+ } catch {
108
+ return true;
109
+ }
110
+ }
111
+ function isParentDirectory(parentPath, childPath) {
112
+ if (!parentPath || !childPath) return false;
113
+ if (parentPath.includes("://") || childPath.includes("://")) return false;
114
+ if (isRemotePath(parentPath) || isRemotePath(childPath)) return false;
115
+ if (parentPath.includes("..") || childPath.includes("..")) return false;
116
+ if (parentPath.includes("\0") || childPath.includes("\0")) return false;
117
+ const normalizedParent = appendForwardSlash(slash(parentPath).toLowerCase());
118
+ const normalizedChild = slash(childPath).toLowerCase();
119
+ if (normalizedParent === normalizedChild || normalizedParent === normalizedChild + "/") return false;
120
+ return normalizedChild.startsWith(normalizedParent);
121
+ }
122
+ function slash(path) {
123
+ return path.replace(/\\/g, "/");
124
+ }
125
+ function fileExtension(path) {
126
+ const ext = path.split(".").pop();
127
+ return ext !== path ? `.${ext}` : "";
128
+ }
129
+ function stripRequestBase(pathname, base) {
130
+ pathname = collapseDuplicateLeadingSlashes(pathname);
131
+ const baseWithoutTrailingSlash = removeTrailingForwardSlash(base);
132
+ if (pathname === baseWithoutTrailingSlash) return "/";
133
+ if (pathname.startsWith(baseWithoutTrailingSlash + "/")) return pathname.slice(baseWithoutTrailingSlash.length);
134
+ return pathname;
135
+ }
136
+ var WITH_FILE_EXT = /\/[^/]+\.\w+$/;
137
+ function hasFileExtension(path) {
138
+ return WITH_FILE_EXT.test(path);
139
+ }
140
+ //#endregion
141
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/i18n/path.js
142
+ function pathHasLocale(path, locales) {
143
+ const segments = path.split("/").map(normalizeThePath);
144
+ for (const segment of segments) for (const locale of locales) if (typeof locale === "string") {
145
+ if (normalizeTheLocale(segment) === normalizeTheLocale(locale)) return true;
146
+ } else if (segment === locale.path) return true;
147
+ return false;
148
+ }
149
+ function normalizeTheLocale(locale) {
150
+ return locale.replaceAll("_", "-").toLowerCase();
151
+ }
152
+ function normalizeThePath(path) {
153
+ return path.endsWith(".html") ? path.slice(0, -5) : path;
154
+ }
155
+ //#endregion
156
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/i18n/error-routes.js
157
+ function isLocalizedErrorRoute(route, status, locales) {
158
+ if (!locales) return false;
159
+ const suffix = `/${status}`;
160
+ if (!route.endsWith(suffix)) return false;
161
+ const localeSegment = route.slice(0, -suffix.length);
162
+ if (!localeSegment || localeSegment.includes("/", 1)) return false;
163
+ return pathHasLocale(localeSegment, locales);
164
+ }
165
+ function getErrorRoutePath(pathname, status, routes, locales, appendTrailingSlash = false) {
166
+ const suffix = appendTrailingSlash ? "/" : "";
167
+ if (locales) {
168
+ const firstSegment = pathname.split("/").find(Boolean);
169
+ if (firstSegment && pathHasLocale(`/${firstSegment}`, locales)) {
170
+ const localized = `/${firstSegment}/${status}`;
171
+ if (routes.some((route) => route.route === localized)) return `${localized}${suffix}`;
172
+ }
173
+ }
174
+ return `/${status}${suffix}`;
175
+ }
176
+ //#endregion
177
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/helpers.js
178
+ function routeIsRedirect(route) {
179
+ return route?.type === "redirect";
180
+ }
181
+ function routeIsFallback(route) {
182
+ return route?.type === "fallback";
183
+ }
184
+ function getFallbackRoute(route, routeList) {
185
+ const fallbackRoute = routeList.find((r) => {
186
+ if (route.route === "/" && r.routeData.route === "/") return true;
187
+ return r.routeData.fallbackRoutes.find((f) => {
188
+ return f.route === route.route;
189
+ });
190
+ });
191
+ if (!fallbackRoute) throw new Error(`No fallback route found for route ${route.route}`);
192
+ return fallbackRoute.routeData;
193
+ }
194
+ function getCustom404Route(manifestData) {
195
+ return manifestData.routes.find((r) => isRoute404(r.route));
196
+ }
197
+ function getCustom500Route(manifestData) {
198
+ return manifestData.routes.find((r) => isRoute500(r.route));
199
+ }
200
+ function getDefaultStatusCode(manifest, routeData, pathname) {
201
+ if (!routeData.pattern.test(pathname)) {
202
+ for (const fallbackRoute of routeData.fallbackRoutes) if (fallbackRoute.pattern.test(pathname)) return 302;
203
+ }
204
+ const route = removeTrailingForwardSlash(routeData.route);
205
+ const locales = manifest.i18n?.locales;
206
+ if (isRoute404(route) || isLocalizedErrorRoute(route, 404, locales)) return 404;
207
+ if (isRoute500(route) || isLocalizedErrorRoute(route, 500, locales)) return 500;
208
+ return 200;
209
+ }
210
+ function routeHasHtmlExtension(route) {
211
+ return route.segments.some((segment) => segment.some((part) => !part.dynamic && part.content.includes(".html")));
212
+ }
213
+ //#endregion
214
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/redirects/component.js
215
+ var RedirectComponentInstance = { default() {
216
+ return new Response(null, { status: 301 });
217
+ } };
218
+ var RedirectSinglePageBuiltModule = {
219
+ page: () => Promise.resolve(RedirectComponentInstance),
220
+ onRequest: (_, next) => next()
221
+ };
222
+ //#endregion
223
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/assets/utils/getAssetsPrefix.js
224
+ function getAssetsPrefix(fileExtension, assetsPrefix) {
225
+ let prefix = "";
226
+ if (!assetsPrefix) prefix = "";
227
+ else if (typeof assetsPrefix === "string") prefix = assetsPrefix;
228
+ else prefix = assetsPrefix[fileExtension.slice(1)] || assetsPrefix.fallback;
229
+ return prefix;
230
+ }
231
+ //#endregion
232
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/render/ssr-element.js
233
+ var URL_PARSE_BASE = "https://astro.build";
234
+ function splitAssetPath(path) {
235
+ const parsed = new URL(path, URL_PARSE_BASE);
236
+ return {
237
+ pathname: !URL.canParse(path) && !path.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname,
238
+ suffix: `${parsed.search}${parsed.hash}`
239
+ };
240
+ }
241
+ function appendQueryParams(path, queryParams) {
242
+ const queryString = queryParams.toString();
243
+ if (!queryString) return path;
244
+ const hashIndex = path.indexOf("#");
245
+ const basePath = hashIndex === -1 ? path : path.slice(0, hashIndex);
246
+ const hash = hashIndex === -1 ? "" : path.slice(hashIndex);
247
+ return `${basePath}${basePath.includes("?") ? "&" : "?"}${queryString}${hash}`;
248
+ }
249
+ function createAssetLink(href, base, assetsPrefix, queryParams) {
250
+ const { pathname, suffix } = splitAssetPath(href);
251
+ let url = "";
252
+ if (assetsPrefix) url = joinPaths(getAssetsPrefix(fileExtension(pathname), assetsPrefix), slash(pathname)) + suffix;
253
+ else if (base) url = prependForwardSlash(joinPaths(base, slash(pathname))) + suffix;
254
+ else url = href;
255
+ if (queryParams) url = appendQueryParams(url, queryParams);
256
+ return url;
257
+ }
258
+ function createStylesheetElement(stylesheet, base, assetsPrefix, queryParams) {
259
+ if (stylesheet.type === "inline") return {
260
+ props: {},
261
+ children: stylesheet.content
262
+ };
263
+ else return {
264
+ props: {
265
+ rel: "stylesheet",
266
+ href: createAssetLink(stylesheet.src, base, assetsPrefix, queryParams)
267
+ },
268
+ children: ""
269
+ };
270
+ }
271
+ function createStylesheetElementSet(stylesheets, base, assetsPrefix, queryParams) {
272
+ return new Set(stylesheets.map((s) => createStylesheetElement(s, base, assetsPrefix, queryParams)));
273
+ }
274
+ function createModuleScriptElement(script, base, assetsPrefix, queryParams) {
275
+ if (script.type === "external") return createModuleScriptElementWithSrc(script.value, base, assetsPrefix, queryParams);
276
+ else return {
277
+ props: { type: "module" },
278
+ children: script.value
279
+ };
280
+ }
281
+ function createModuleScriptElementWithSrc(src, base, assetsPrefix, queryParams) {
282
+ return {
283
+ props: {
284
+ type: "module",
285
+ src: createAssetLink(src, base, assetsPrefix, queryParams)
286
+ },
287
+ children: ""
288
+ };
289
+ }
290
+ //#endregion
291
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/manifest/memo.js
292
+ function createManifestMemo(derive) {
293
+ const cache = /* @__PURE__ */ new WeakMap();
294
+ return {
295
+ get(manifest) {
296
+ if (cache.has(manifest)) return cache.get(manifest);
297
+ const value = derive(manifest);
298
+ cache.set(manifest, value);
299
+ return value;
300
+ },
301
+ has(manifest) {
302
+ return cache.has(manifest);
303
+ },
304
+ set(manifest, value) {
305
+ cache.set(manifest, value);
306
+ },
307
+ invalidate(manifest) {
308
+ cache.delete(manifest);
309
+ }
310
+ };
311
+ }
312
+ function createAsyncManifestMemo(derive) {
313
+ const cache = /* @__PURE__ */ new WeakMap();
314
+ return {
315
+ get(manifest) {
316
+ let promise = cache.get(manifest);
317
+ if (!promise) {
318
+ promise = derive(manifest);
319
+ cache.set(manifest, promise);
320
+ promise.catch(() => {
321
+ if (cache.get(manifest) === promise) cache.delete(manifest);
322
+ });
323
+ }
324
+ return promise;
325
+ },
326
+ invalidate(manifest) {
327
+ cache.delete(manifest);
328
+ }
329
+ };
330
+ }
331
+ //#endregion
332
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/request-body.js
333
+ async function readBodyWithLimit(request, limit) {
334
+ const contentLengthHeader = request.headers.get("content-length");
335
+ if (contentLengthHeader) {
336
+ const contentLength = Number.parseInt(contentLengthHeader, 10);
337
+ if (Number.isFinite(contentLength) && contentLength > limit) throw new BodySizeLimitError(limit);
338
+ }
339
+ if (!request.body) return /* @__PURE__ */ new Uint8Array();
340
+ const reader = request.body.getReader();
341
+ const chunks = [];
342
+ let received = 0;
343
+ while (true) {
344
+ const { done, value } = await reader.read();
345
+ if (done) break;
346
+ if (value) {
347
+ received += value.byteLength;
348
+ if (received > limit) throw new BodySizeLimitError(limit);
349
+ chunks.push(value);
350
+ }
351
+ }
352
+ const buffer = new Uint8Array(received);
353
+ let offset = 0;
354
+ for (const chunk of chunks) {
355
+ buffer.set(chunk, offset);
356
+ offset += chunk.byteLength;
357
+ }
358
+ return buffer;
359
+ }
360
+ var BodySizeLimitError = class extends Error {
361
+ limit;
362
+ constructor(limit) {
363
+ super(`Request body exceeds the configured limit of ${limit} bytes`);
364
+ this.name = "BodySizeLimitError";
365
+ this.limit = limit;
366
+ }
367
+ };
368
+ //#endregion
369
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/server-islands/endpoint.js
370
+ var SERVER_ISLAND_ROUTE = "/_server-islands/[name]";
371
+ var SERVER_ISLAND_COMPONENT = "_server-islands.astro";
372
+ function badRequest(reason) {
373
+ return new Response(null, {
374
+ status: 400,
375
+ statusText: "Bad request: " + reason
376
+ });
377
+ }
378
+ var DEFAULT_BODY_SIZE_LIMIT = 1048576;
379
+ async function getRequestData(request, bodySizeLimit = DEFAULT_BODY_SIZE_LIMIT) {
380
+ switch (request.method) {
381
+ case "GET": {
382
+ const params = new URL(request.url).searchParams;
383
+ if (!params.has("s") || !params.has("e") || !params.has("p")) return badRequest("Missing required query parameters.");
384
+ const encryptedSlots = params.get("s");
385
+ return {
386
+ encryptedComponentExport: params.get("e"),
387
+ encryptedProps: params.get("p"),
388
+ encryptedSlots
389
+ };
390
+ }
391
+ case "POST": try {
392
+ const body = await readBodyWithLimit(request, bodySizeLimit);
393
+ const raw = new TextDecoder().decode(body);
394
+ const data = JSON.parse(raw);
395
+ if (Object.hasOwn(data, "slots") && typeof data.slots === "object") return badRequest("Plaintext slots are not allowed. Slots must be encrypted.");
396
+ if (Object.hasOwn(data, "componentExport") && typeof data.componentExport === "string") return badRequest("Plaintext componentExport is not allowed. componentExport must be encrypted.");
397
+ return data;
398
+ } catch (e) {
399
+ if (e instanceof BodySizeLimitError) return new Response(null, {
400
+ status: 413,
401
+ statusText: e.message
402
+ });
403
+ if (e instanceof SyntaxError) return badRequest("Request format is invalid.");
404
+ throw e;
405
+ }
406
+ default: return new Response(null, { status: 405 });
407
+ }
408
+ }
409
+ function createEndpoint(manifest) {
410
+ const page = async (result) => {
411
+ const params = result.params;
412
+ if (!params.name) return new Response(null, {
413
+ status: 400,
414
+ statusText: "Bad request"
415
+ });
416
+ const componentId = params.name;
417
+ const data = await getRequestData(result.request, manifest.serverIslandBodySizeLimit);
418
+ if (data instanceof Response) return data;
419
+ let imp = (await (await manifest.serverIslandMappings?.())?.serverIslandMap)?.get(componentId);
420
+ if (!imp) return new Response(null, {
421
+ status: 404,
422
+ statusText: "Not found"
423
+ });
424
+ const key = await manifest.key;
425
+ let componentExport;
426
+ try {
427
+ componentExport = await decryptString(key, data.encryptedComponentExport, `export:${componentId}`);
428
+ } catch (_e) {
429
+ return badRequest("Encrypted componentExport value is invalid.");
430
+ }
431
+ const encryptedProps = data.encryptedProps;
432
+ let props = {};
433
+ if (encryptedProps !== "") try {
434
+ const propString = await decryptString(key, encryptedProps, `props:${componentId}`);
435
+ props = JSON.parse(propString);
436
+ } catch (_e) {
437
+ return badRequest("Encrypted props value is invalid.");
438
+ }
439
+ let decryptedSlots = {};
440
+ const encryptedSlots = data.encryptedSlots;
441
+ if (encryptedSlots !== "") try {
442
+ const slotsString = await decryptString(key, encryptedSlots, `slots:${componentId}`);
443
+ decryptedSlots = JSON.parse(slotsString);
444
+ } catch (_e) {
445
+ return badRequest("Encrypted slots value is invalid.");
446
+ }
447
+ let Component = (await imp())[componentExport];
448
+ const slots = {};
449
+ for (const prop in decryptedSlots) slots[prop] = createSlotValueFromString(decryptedSlots[prop]);
450
+ result.response.headers.set("X-Robots-Tag", "noindex");
451
+ if (isAstroComponentFactory(Component)) {
452
+ const ServerIsland = Component;
453
+ Component = function(...args) {
454
+ return ServerIsland.apply(this, args);
455
+ };
456
+ Object.assign(Component, ServerIsland);
457
+ Component.propagation = "self";
458
+ }
459
+ result._metadata.routeHasPropagation = true;
460
+ const renderPropagatedHead = () => markHTMLString(result._metadata.extraHead.join(""));
461
+ return renderTemplate`${renderPropagatedHead}${renderComponent(result, "Component", Component, props, slots)}`;
462
+ };
463
+ page.isAstroComponentFactory = true;
464
+ return {
465
+ default: page,
466
+ partial: true
467
+ };
468
+ }
469
+ //#endregion
470
+ //#region ../../node_modules/.bun/html-escaper@3.0.3/node_modules/html-escaper/esm/index.js
471
+ /**
472
+ * Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection
473
+ *
474
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
475
+ * of this software and associated documentation files (the "Software"), to deal
476
+ * in the Software without restriction, including without limitation the rights
477
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
478
+ * copies of the Software, and to permit persons to whom the Software is
479
+ * furnished to do so, subject to the following conditions:
480
+ *
481
+ * The above copyright notice and this permission notice shall be included in
482
+ * all copies or substantial portions of the Software.
483
+ *
484
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
485
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
486
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
487
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
488
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
489
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
490
+ * THE SOFTWARE.
491
+ */
492
+ var { replace } = "";
493
+ var ca = /[&<>'"]/g;
494
+ var esca = {
495
+ "&": "&amp;",
496
+ "<": "&lt;",
497
+ ">": "&gt;",
498
+ "'": "&#39;",
499
+ "\"": "&quot;"
500
+ };
501
+ var pe = (m) => esca[m];
502
+ /**
503
+ * Safely escape HTML entities such as `&`, `<`, `>`, `"`, and `'`.
504
+ * @param {string} es the input to safely escape
505
+ * @returns {string} the escaped input, and it **throws** an error if
506
+ * the input type is unexpected, except for boolean and numbers,
507
+ * converted as string.
508
+ */
509
+ var escape = (es) => replace.call(es, ca, pe);
510
+ //#endregion
511
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/template/4xx.js
512
+ function template({ title, pathname, statusCode = 404, tabTitle, body }) {
513
+ return `<!doctype html>
514
+ <html lang="en">
515
+ <head>
516
+ <meta charset="utf-8">
517
+ <title>${tabTitle}</title>
518
+ <style>
519
+ :root {
520
+ --gray-10: hsl(258, 7%, 10%);
521
+ --gray-20: hsl(258, 7%, 20%);
522
+ --gray-30: hsl(258, 7%, 30%);
523
+ --gray-40: hsl(258, 7%, 40%);
524
+ --gray-50: hsl(258, 7%, 50%);
525
+ --gray-60: hsl(258, 7%, 60%);
526
+ --gray-70: hsl(258, 7%, 70%);
527
+ --gray-80: hsl(258, 7%, 80%);
528
+ --gray-90: hsl(258, 7%, 90%);
529
+ --black: #13151A;
530
+ --accent-light: #E0CCFA;
531
+ }
532
+
533
+ * {
534
+ box-sizing: border-box;
535
+ }
536
+
537
+ html {
538
+ background: var(--black);
539
+ color-scheme: dark;
540
+ accent-color: var(--accent-light);
541
+ }
542
+
543
+ body {
544
+ background-color: var(--gray-10);
545
+ color: var(--gray-80);
546
+ font-family: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
547
+ line-height: 1.5;
548
+ margin: 0;
549
+ }
550
+
551
+ a {
552
+ color: var(--accent-light);
553
+ }
554
+
555
+ .center {
556
+ display: flex;
557
+ flex-direction: column;
558
+ justify-content: center;
559
+ align-items: center;
560
+ height: 100vh;
561
+ width: 100vw;
562
+ }
563
+
564
+ h1 {
565
+ margin-bottom: 8px;
566
+ color: white;
567
+ font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
568
+ font-weight: 700;
569
+ margin-top: 1rem;
570
+ margin-bottom: 0;
571
+ }
572
+
573
+ .statusCode {
574
+ color: var(--accent-light);
575
+ }
576
+
577
+ .astro-icon {
578
+ height: 124px;
579
+ width: 124px;
580
+ }
581
+
582
+ pre, code {
583
+ padding: 2px 8px;
584
+ background: rgba(0,0,0, 0.25);
585
+ border: 1px solid rgba(255,255,255, 0.25);
586
+ border-radius: 4px;
587
+ font-size: 1.2em;
588
+ margin-top: 0;
589
+ max-width: 60em;
590
+ }
591
+ </style>
592
+ </head>
593
+ <body>
594
+ <main class="center">
595
+ <svg class="astro-icon" xmlns="http://www.w3.org/2000/svg" width="64" height="80" viewBox="0 0 64 80" fill="none"> <path d="M20.5253 67.6322C16.9291 64.3531 15.8793 57.4632 17.3776 52.4717C19.9755 55.6188 23.575 56.6157 27.3035 57.1784C33.0594 58.0468 38.7122 57.722 44.0592 55.0977C44.6709 54.7972 45.2362 54.3978 45.9045 53.9931C46.4062 55.4451 46.5368 56.9109 46.3616 58.4028C45.9355 62.0362 44.1228 64.8429 41.2397 66.9705C40.0868 67.8215 38.8669 68.5822 37.6762 69.3846C34.0181 71.8508 33.0285 74.7426 34.403 78.9491C34.4357 79.0516 34.4649 79.1541 34.5388 79.4042C32.6711 78.5705 31.3069 77.3565 30.2674 75.7604C29.1694 74.0757 28.6471 72.2121 28.6196 70.1957C28.6059 69.2144 28.6059 68.2244 28.4736 67.257C28.1506 64.8985 27.0406 63.8425 24.9496 63.7817C22.8036 63.7192 21.106 65.0426 20.6559 67.1268C20.6215 67.2865 20.5717 67.4446 20.5218 67.6304L20.5253 67.6322Z" fill="white"/> <path d="M20.5253 67.6322C16.9291 64.3531 15.8793 57.4632 17.3776 52.4717C19.9755 55.6188 23.575 56.6157 27.3035 57.1784C33.0594 58.0468 38.7122 57.722 44.0592 55.0977C44.6709 54.7972 45.2362 54.3978 45.9045 53.9931C46.4062 55.4451 46.5368 56.9109 46.3616 58.4028C45.9355 62.0362 44.1228 64.8429 41.2397 66.9705C40.0868 67.8215 38.8669 68.5822 37.6762 69.3846C34.0181 71.8508 33.0285 74.7426 34.403 78.9491C34.4357 79.0516 34.4649 79.1541 34.5388 79.4042C32.6711 78.5705 31.3069 77.3565 30.2674 75.7604C29.1694 74.0757 28.6471 72.2121 28.6196 70.1957C28.6059 69.2144 28.6059 68.2244 28.4736 67.257C28.1506 64.8985 27.0406 63.8425 24.9496 63.7817C22.8036 63.7192 21.106 65.0426 20.6559 67.1268C20.6215 67.2865 20.5717 67.4446 20.5218 67.6304L20.5253 67.6322Z" fill="url(#paint0_linear_738_686)"/> <path d="M0 51.6401C0 51.6401 10.6488 46.4654 21.3274 46.4654L29.3786 21.6102C29.6801 20.4082 30.5602 19.5913 31.5538 19.5913C32.5474 19.5913 33.4275 20.4082 33.7289 21.6102L41.7802 46.4654C54.4274 46.4654 63.1076 51.6401 63.1076 51.6401C63.1076 51.6401 45.0197 2.48776 44.9843 2.38914C44.4652 0.935933 43.5888 0 42.4073 0H20.7022C19.5206 0 18.6796 0.935933 18.1251 2.38914C18.086 2.4859 0 51.6401 0 51.6401Z" fill="white"/> <defs> <linearGradient id="paint0_linear_738_686" x1="31.554" y1="75.4423" x2="39.7462" y2="48.376" gradientUnits="userSpaceOnUse"> <stop stop-color="#D83333"/> <stop offset="1" stop-color="#F041FF"/> </linearGradient> </defs> </svg>
596
+ <h1>${statusCode ? `<span class="statusCode">${statusCode}: </span> ` : ""}<span class="statusMessage">${title}</span></h1>
597
+ ${body || `
598
+ <pre>Path: ${escape(pathname)}</pre>
599
+ `}
600
+ </main>
601
+ </body>
602
+ </html>`;
603
+ }
604
+ //#endregion
605
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/internal/astro-designed-error-pages.js
606
+ var DEFAULT_404_ROUTE = {
607
+ component: DEFAULT_404_COMPONENT,
608
+ params: [],
609
+ pattern: /^\/404\/?$/,
610
+ prerender: false,
611
+ pathname: "/404",
612
+ segments: [[{
613
+ content: "404",
614
+ dynamic: false,
615
+ spread: false
616
+ }]],
617
+ type: "page",
618
+ route: "/404",
619
+ fallbackRoutes: [],
620
+ isIndex: false,
621
+ origin: "internal",
622
+ distURL: []
623
+ };
624
+ async function default404Page({ pathname }) {
625
+ return new Response(template({
626
+ statusCode: 404,
627
+ title: "Not found",
628
+ tabTitle: "404: Not Found",
629
+ pathname
630
+ }), {
631
+ status: 404,
632
+ headers: { "Content-Type": "text/html" }
633
+ });
634
+ }
635
+ default404Page.isAstroComponentFactory = true;
636
+ var default404Instance = { default: default404Page };
637
+ //#endregion
638
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/default.js
639
+ function createDefaultRoutes(manifest) {
640
+ const root = new URL(manifest.rootDir);
641
+ return [{
642
+ instance: default404Instance,
643
+ matchesComponent: (filePath) => filePath.href === new URL(DEFAULT_404_COMPONENT, root).href,
644
+ route: DEFAULT_404_ROUTE.route,
645
+ component: DEFAULT_404_COMPONENT
646
+ }, {
647
+ instance: createEndpoint(manifest),
648
+ matchesComponent: (filePath) => filePath.href === new URL(SERVER_ISLAND_COMPONENT, root).href,
649
+ route: SERVER_ISLAND_ROUTE,
650
+ component: SERVER_ISLAND_COMPONENT
651
+ }];
652
+ }
653
+ var defaultRoutesMemo = createManifestMemo(createDefaultRoutes);
654
+ function getDefaultRoutes(manifest) {
655
+ return defaultRoutesMemo.get(manifest);
656
+ }
657
+ //#endregion
658
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/request.js
659
+ function createRequest({ url, headers, method = "GET", body = void 0, logger, isPrerendered = false, routePattern, init }) {
660
+ const headersObj = isPrerendered ? void 0 : headers instanceof Headers ? headers : new Headers(Object.entries(headers).filter(([name]) => !name.startsWith(":")));
661
+ if (typeof url === "string") url = new URL(url);
662
+ if (isPrerendered) url.search = "";
663
+ const request = new Request(url, {
664
+ method,
665
+ headers: headersObj,
666
+ body: isPrerendered ? null : body,
667
+ ...init
668
+ });
669
+ if (isPrerendered) {
670
+ let _headers = request.headers;
671
+ const { value, writable, ...headersDesc } = Object.getOwnPropertyDescriptor(request, "headers") || {};
672
+ Object.defineProperty(request, "headers", {
673
+ ...headersDesc,
674
+ get() {
675
+ logger.warn(null, `\`Astro.request.headers\` was used when rendering the route \`${routePattern}'\`. \`Astro.request.headers\` is not available on prerendered pages. If you need access to request headers, make sure that the page is server-rendered using \`export const prerender = false;\` or by setting \`output\` to \`"server"\` in your Astro config to make all your pages server-rendered by default.`);
676
+ return _headers;
677
+ },
678
+ set(newHeaders) {
679
+ _headers = newHeaders;
680
+ }
681
+ });
682
+ }
683
+ return request;
684
+ }
685
+ //#endregion
686
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/util/pathname.js
687
+ var MultiLevelEncodingError = class extends Error {
688
+ constructor() {
689
+ super("URL encoding depth exceeded the maximum number of decode iterations");
690
+ this.name = "MultiLevelEncodingError";
691
+ }
692
+ };
693
+ var MAX_DECODE_ITERATIONS = 10;
694
+ function validateAndDecodePathname(pathname) {
695
+ let decoded;
696
+ try {
697
+ decoded = decodeURI(pathname);
698
+ } catch (_e) {
699
+ throw new Error("Invalid URL encoding");
700
+ }
701
+ let iterations = 0;
702
+ while (decoded !== pathname) {
703
+ if (iterations >= MAX_DECODE_ITERATIONS) throw new MultiLevelEncodingError();
704
+ pathname = decoded;
705
+ try {
706
+ decoded = decodeURI(pathname);
707
+ } catch {
708
+ break;
709
+ }
710
+ iterations++;
711
+ }
712
+ return decoded;
713
+ }
714
+ //#endregion
715
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/rewrite.js
716
+ function findRouteToRewrite({ payload, routes, request, trailingSlash, buildFormat, base, outDir }) {
717
+ let newUrl = void 0;
718
+ if (payload instanceof URL) newUrl = payload;
719
+ else if (payload instanceof Request) newUrl = new URL(payload.url);
720
+ else newUrl = new URL(collapseDuplicateSlashes(payload), new URL(request.url).origin);
721
+ const { pathname, resolvedUrlPathname } = normalizeRewritePathname(newUrl.pathname, base, trailingSlash, buildFormat);
722
+ newUrl.pathname = resolvedUrlPathname;
723
+ const decodedPathname = validateAndDecodePathname(pathname);
724
+ if (isRoute404(decodedPathname)) {
725
+ const errorRoute = routes.find((route) => route.route === "/404");
726
+ if (errorRoute) return {
727
+ routeData: errorRoute,
728
+ newUrl,
729
+ pathname: decodedPathname
730
+ };
731
+ }
732
+ if (isRoute500(decodedPathname)) {
733
+ const errorRoute = routes.find((route) => route.route === "/500");
734
+ if (errorRoute) return {
735
+ routeData: errorRoute,
736
+ newUrl,
737
+ pathname: decodedPathname
738
+ };
739
+ }
740
+ let foundRoute;
741
+ for (const route of routes) if (route.pattern.test(decodedPathname)) {
742
+ if (route.params && route.params.length !== 0 && route.distURL && route.distURL.length !== 0) {
743
+ if (!route.distURL.find((url) => url.href.replace(outDir.toString(), "").replace(/(?:\/index\.html|\.html)$/, "") === trimSlashes(pathname))) continue;
744
+ }
745
+ foundRoute = route;
746
+ break;
747
+ }
748
+ if (foundRoute) return {
749
+ routeData: foundRoute,
750
+ newUrl,
751
+ pathname: decodedPathname
752
+ };
753
+ else {
754
+ const custom404 = routes.find((route) => route.route === "/404");
755
+ if (custom404) return {
756
+ routeData: custom404,
757
+ newUrl,
758
+ pathname
759
+ };
760
+ else return {
761
+ routeData: DEFAULT_404_ROUTE,
762
+ newUrl,
763
+ pathname
764
+ };
765
+ }
766
+ }
767
+ function copyRequest(newUrl, oldRequest, isPrerendered, logger, routePattern) {
768
+ const canHaveBody = oldRequest.method !== "GET" && oldRequest.method !== "HEAD";
769
+ if (canHaveBody && oldRequest.bodyUsed) throw new AstroError(RewriteWithBodyUsed);
770
+ return createRequest({
771
+ url: newUrl,
772
+ method: oldRequest.method,
773
+ body: canHaveBody ? oldRequest.body : void 0,
774
+ isPrerendered,
775
+ logger,
776
+ headers: isPrerendered ? {} : oldRequest.headers,
777
+ routePattern,
778
+ init: {
779
+ referrer: oldRequest.referrer,
780
+ referrerPolicy: oldRequest.referrerPolicy,
781
+ mode: oldRequest.mode,
782
+ credentials: oldRequest.credentials,
783
+ cache: oldRequest.cache,
784
+ redirect: oldRequest.redirect,
785
+ integrity: oldRequest.integrity,
786
+ signal: oldRequest.signal,
787
+ keepalive: oldRequest.keepalive,
788
+ duplex: "half"
789
+ }
790
+ });
791
+ }
792
+ function setOriginPathname(request, pathname, trailingSlash, buildFormat) {
793
+ if (!pathname) pathname = "/";
794
+ const shouldAppendSlash = shouldAppendForwardSlash(trailingSlash, buildFormat);
795
+ let finalPathname;
796
+ if (pathname === "/") finalPathname = "/";
797
+ else if (shouldAppendSlash) finalPathname = appendForwardSlash(pathname);
798
+ else finalPathname = removeTrailingForwardSlash(pathname);
799
+ Reflect.set(request, originPathnameSymbol, encodeURIComponent(finalPathname));
800
+ }
801
+ function getOriginPathname(request) {
802
+ const origin = Reflect.get(request, originPathnameSymbol);
803
+ if (origin) return decodeURIComponent(origin);
804
+ return new URL(request.url).pathname;
805
+ }
806
+ function normalizeRewritePathname(urlPathname, base, trailingSlash, buildFormat) {
807
+ let pathname = collapseDuplicateSlashes(urlPathname);
808
+ const shouldAppendSlash = shouldAppendForwardSlash(trailingSlash, buildFormat);
809
+ if (base !== "/") {
810
+ if (urlPathname === base || urlPathname === removeTrailingForwardSlash(base)) pathname = "/";
811
+ else if (urlPathname.startsWith(base)) {
812
+ pathname = shouldAppendSlash ? appendForwardSlash(urlPathname) : removeTrailingForwardSlash(urlPathname);
813
+ pathname = pathname.slice(base.length);
814
+ }
815
+ }
816
+ if (!pathname.startsWith("/") && shouldAppendSlash && urlPathname.endsWith("/")) pathname = prependForwardSlash(pathname);
817
+ if (buildFormat === "file") pathname = pathname.replace(/\.html$/, "");
818
+ let resolvedUrlPathname;
819
+ if (base !== "/" && (pathname === "" || pathname === "/") && !shouldAppendSlash) resolvedUrlPathname = removeTrailingForwardSlash(base);
820
+ else resolvedUrlPathname = joinPaths(...[base, pathname].filter(Boolean));
821
+ return {
822
+ pathname,
823
+ resolvedUrlPathname
824
+ };
825
+ }
826
+ //#endregion
827
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/environment/production.js
828
+ async function getModuleForRoute(manifest, route) {
829
+ for (const defaultRoute of getDefaultRoutes(manifest)) if (route.component === defaultRoute.component) return { page: () => Promise.resolve(defaultRoute.instance) };
830
+ let routeToProcess = route;
831
+ if (routeIsRedirect(route)) {
832
+ if (route.redirectRoute) routeToProcess = route.redirectRoute;
833
+ else return RedirectSinglePageBuiltModule;
834
+ } else if (routeIsFallback(route)) routeToProcess = getFallbackRoute(route, manifest.routes);
835
+ if (manifest.pageMap) {
836
+ const importComponentInstance = manifest.pageMap.get(routeToProcess.component);
837
+ if (!importComponentInstance) throw new Error(`Unexpectedly unable to find a component instance for route ${route.route}`);
838
+ return await importComponentInstance();
839
+ } else if (manifest.pageModule) return manifest.pageModule;
840
+ throw new Error("Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage. This is an internal error, please file an issue.");
841
+ }
842
+ async function getComponentByRoute(manifest, routeData) {
843
+ return (await getModuleForRoute(manifest, routeData)).page();
844
+ }
845
+ var productionEnvironment = {
846
+ name: "production",
847
+ runtimeMode: "production",
848
+ defaultStreaming: () => true,
849
+ async resolve(manifest, specifier) {
850
+ if (!(specifier in manifest.entryModules)) throw new Error(`Unable to resolve [${specifier}]`);
851
+ const bundlePath = manifest.entryModules[specifier];
852
+ if (bundlePath.startsWith("data:") || bundlePath.length === 0) return bundlePath;
853
+ else return createAssetLink(bundlePath, manifest.base, manifest.assetsPrefix);
854
+ },
855
+ async headElements(manifest, routeData) {
856
+ const { assetsPrefix, base } = manifest;
857
+ const routeInfo = manifest.routes.find((route) => route.routeData.route === routeData.route);
858
+ const links = /* @__PURE__ */ new Set();
859
+ const scripts = /* @__PURE__ */ new Set();
860
+ const styles = createStylesheetElementSet(routeInfo?.styles ?? [], base, assetsPrefix);
861
+ for (const script of routeInfo?.scripts ?? []) if ("stage" in script) {
862
+ if (script.stage === "head-inline") scripts.add({
863
+ props: {},
864
+ children: script.children
865
+ });
866
+ } else scripts.add(createModuleScriptElement(script, base, assetsPrefix));
867
+ return {
868
+ links,
869
+ styles,
870
+ scripts
871
+ };
872
+ },
873
+ componentMetadata() {},
874
+ getComponentByRoute,
875
+ getModuleForRoute,
876
+ async tryRewrite(manifest, payload, request) {
877
+ const { newUrl, pathname, routeData } = findRouteToRewrite({
878
+ payload,
879
+ request,
880
+ routes: manifest.routes.map((r) => r.routeData),
881
+ trailingSlash: manifest.trailingSlash,
882
+ buildFormat: manifest.buildFormat,
883
+ base: manifest.base,
884
+ outDir: manifest.serverLike ? manifest.buildClientDir : manifest.outDir
885
+ });
886
+ return {
887
+ newUrl,
888
+ pathname,
889
+ componentInstance: await getComponentByRoute(manifest, routeData),
890
+ routeData
891
+ };
892
+ },
893
+ getRenderers(manifest) {
894
+ return manifest.renderers;
895
+ },
896
+ errorStrategy: "default",
897
+ injectCspMetaTagsOnErrorPages: false,
898
+ logRequest() {}
899
+ };
900
+ //#endregion
901
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/environment/index.js
902
+ var environments = /* @__PURE__ */ new WeakMap();
903
+ function getEnvironment(manifest) {
904
+ return environments.get(manifest) ?? productionEnvironment;
905
+ }
906
+ //#endregion
907
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/logger/core.js
908
+ var dateTimeFormat = new Intl.DateTimeFormat([], {
909
+ hour: "2-digit",
910
+ minute: "2-digit",
911
+ second: "2-digit",
912
+ hour12: false
913
+ });
914
+ var levels = {
915
+ debug: 20,
916
+ info: 30,
917
+ warn: 40,
918
+ error: 50,
919
+ silent: 90
920
+ };
921
+ function log(opts, level, label, message, newLine = true) {
922
+ const logLevel = opts.level;
923
+ const dest = opts.destination;
924
+ const event = {
925
+ label,
926
+ level,
927
+ message,
928
+ newLine
929
+ };
930
+ if (!isLogLevelEnabled(logLevel, level)) return;
931
+ dest.write(event);
932
+ }
933
+ function isLogLevelEnabled(configuredLogLevel, level) {
934
+ return levels[configuredLogLevel] <= levels[level];
935
+ }
936
+ function info(opts, label, message, newLine = true) {
937
+ return log(opts, "info", label, message, newLine);
938
+ }
939
+ function warn(opts, label, message, newLine = true) {
940
+ return log(opts, "warn", label, message, newLine);
941
+ }
942
+ function error(opts, label, message, newLine = true) {
943
+ return log(opts, "error", label, message, newLine);
944
+ }
945
+ function debug(...args) {
946
+ if ("_astroGlobalDebug" in globalThis) globalThis._astroGlobalDebug(...args);
947
+ }
948
+ function getEventPrefix({ level, label }) {
949
+ const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
950
+ const prefix = [];
951
+ if (level === "error" || level === "warn") {
952
+ prefix.push(s.bold(timestamp));
953
+ prefix.push(`[${level.toUpperCase()}]`);
954
+ } else prefix.push(timestamp);
955
+ if (label) prefix.push(`[${label}]`);
956
+ if (level === "error") return s.red(prefix.join(" "));
957
+ if (level === "warn") return s.yellow(prefix.join(" "));
958
+ if (prefix.length === 1) return s.dim(prefix[0]);
959
+ return s.dim(prefix[0]) + " " + s.blue(prefix.splice(1).join(" "));
960
+ }
961
+ var AstroLogger = class {
962
+ options;
963
+ constructor(options) {
964
+ this.options = options;
965
+ }
966
+ info(label, message, newLine = true) {
967
+ info(this.options, label, message, newLine);
968
+ }
969
+ warn(label, message, newLine = true) {
970
+ warn(this.options, label, message, newLine);
971
+ }
972
+ error(label, message, newLine = true) {
973
+ error(this.options, label, message, newLine);
974
+ }
975
+ debug(label, ...messages) {
976
+ debug(label, ...messages);
977
+ }
978
+ level() {
979
+ return this.options.level;
980
+ }
981
+ forkIntegrationLogger(label) {
982
+ return new AstroIntegrationLogger(this.options, label);
983
+ }
984
+ setDestination(destination) {
985
+ this.options.destination = destination;
986
+ }
987
+ /**
988
+ * It calls the `close` function of the provided destination, if it exists.
989
+ */
990
+ close() {
991
+ if (this.options.destination.close) this.options.destination.close();
992
+ }
993
+ /**
994
+ * It calls the `flush` function of the provided destination, if it exists.
995
+ */
996
+ flush() {
997
+ if (this.options.destination.flush) this.options.destination.flush();
998
+ }
999
+ };
1000
+ var AstroIntegrationLogger = class AstroIntegrationLogger {
1001
+ options;
1002
+ label;
1003
+ constructor(logging, label) {
1004
+ this.options = logging;
1005
+ this.label = label;
1006
+ }
1007
+ /**
1008
+ * Creates a new logger instance with a new label, but the same log options.
1009
+ */
1010
+ fork(label) {
1011
+ return new AstroIntegrationLogger(this.options, label);
1012
+ }
1013
+ info(message) {
1014
+ info(this.options, this.label, message);
1015
+ }
1016
+ warn(message) {
1017
+ warn(this.options, this.label, message);
1018
+ }
1019
+ error(message) {
1020
+ error(this.options, this.label, message);
1021
+ }
1022
+ debug(message) {
1023
+ debug(this.label, message);
1024
+ }
1025
+ /**
1026
+ * It calls the `flush` function of the provided destination, if it exists.
1027
+ */
1028
+ flush() {
1029
+ if (this.options.destination.flush) this.options.destination.flush();
1030
+ }
1031
+ /**
1032
+ * It calls the `close` function of the provided destination, if it exists.
1033
+ */
1034
+ close() {
1035
+ if (this.options.destination.close) this.options.destination.close();
1036
+ }
1037
+ };
1038
+ function astroToRuntimeLogger(logger) {
1039
+ return {
1040
+ info(msg) {
1041
+ logger.info(null, msg);
1042
+ },
1043
+ warn(msg) {
1044
+ logger.warn(null, msg);
1045
+ },
1046
+ error(msg) {
1047
+ logger.error(null, msg);
1048
+ }
1049
+ };
1050
+ }
1051
+ //#endregion
1052
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/logger/public.js
1053
+ function matchesLevel(messageLevel, configuredLevel) {
1054
+ return levels[messageLevel] >= levels[configuredLevel];
1055
+ }
1056
+ //#endregion
1057
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/logger/impls/console.js
1058
+ function consoleLogDestination(config = {}) {
1059
+ const { level = "info" } = config;
1060
+ return { write(event) {
1061
+ let dest = console.error;
1062
+ if (levels[event.level] < levels["error"]) dest = console.info;
1063
+ if (!matchesLevel(event.level, level)) return;
1064
+ if (event.label === "SKIP_FORMAT") dest(event.message);
1065
+ else dest(getEventPrefix(event) + " " + event.message);
1066
+ } };
1067
+ }
1068
+ function createConsoleLogger({ level }) {
1069
+ return new AstroLogger({
1070
+ level,
1071
+ destination: consoleLogDestination()
1072
+ });
1073
+ }
1074
+ //#endregion
1075
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/logger/manifest-logger.js
1076
+ var loggers = /* @__PURE__ */ new WeakMap();
1077
+ function getLogger(manifest) {
1078
+ let logger = loggers.get(manifest);
1079
+ if (!logger) {
1080
+ logger = createConsoleLogger({ level: manifest.logLevel });
1081
+ loggers.set(manifest, logger);
1082
+ }
1083
+ return logger;
1084
+ }
1085
+ var resolvedLogger = createAsyncManifestMemo(async (manifest) => {
1086
+ const logger = getLogger(manifest);
1087
+ try {
1088
+ const destination = (await manifest.logger?.())?.default;
1089
+ if (destination) logger.setDestination(destination);
1090
+ } catch (error) {
1091
+ logger.error("config", "Failed to load the configured logger destination; continuing with the console logger.\n" + (error instanceof Error ? error.stack ?? error.message : String(error)));
1092
+ }
1093
+ return logger;
1094
+ });
1095
+ function getResolvedLogger(manifest) {
1096
+ return resolvedLogger.get(manifest);
1097
+ }
1098
+ //#endregion
1099
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/generator.js
1100
+ function sanitizeParams(params) {
1101
+ return Object.fromEntries(Object.entries(params).map(([key, value]) => {
1102
+ if (typeof value === "string") return [key, value.normalize().replace(/#/g, "%23").replace(/\?/g, "%3F")];
1103
+ return [key, value];
1104
+ }));
1105
+ }
1106
+ function getParameter(part, params) {
1107
+ if (part.spread) return params[part.content.slice(3)] ?? "";
1108
+ if (part.dynamic) {
1109
+ if (params[part.content] === void 0) throw new TypeError(`Missing parameter: ${part.content}`);
1110
+ return params[part.content];
1111
+ }
1112
+ return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]");
1113
+ }
1114
+ function getSegment(segment, params) {
1115
+ const segmentPath = segment.map((part) => getParameter(part, params)).join("");
1116
+ return segmentPath ? collapseDuplicateLeadingSlashes("/" + segmentPath) : "";
1117
+ }
1118
+ function getRouteGenerator(segments, addTrailingSlash) {
1119
+ return (params) => {
1120
+ const sanitizedParams = sanitizeParams(params);
1121
+ let trailing = "";
1122
+ if (addTrailingSlash === "always" && segments.length) trailing = "/";
1123
+ return segments.map((segment) => getSegment(segment, sanitizedParams)).join("") + trailing || "/";
1124
+ };
1125
+ }
1126
+ //#endregion
1127
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/internal/validation.js
1128
+ var VALID_PARAM_TYPES = ["string", "undefined"];
1129
+ function validateGetStaticPathsParameter([key, value], route) {
1130
+ if (!VALID_PARAM_TYPES.includes(typeof value)) throw new AstroError({
1131
+ ...GetStaticPathsInvalidRouteParam,
1132
+ message: GetStaticPathsInvalidRouteParam.message(key, value, typeof value),
1133
+ location: { file: route }
1134
+ });
1135
+ }
1136
+ //#endregion
1137
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/params.js
1138
+ function stringifyParams(params, route, trailingSlash) {
1139
+ if (route.type === "endpoint" && hasFileExtension(route.route)) trailingSlash = "never";
1140
+ const validatedParams = {};
1141
+ for (const [key, value] of Object.entries(params)) {
1142
+ validateGetStaticPathsParameter([key, value], route.component);
1143
+ if (value !== void 0) validatedParams[key] = trimSlashes(value);
1144
+ }
1145
+ return getRouteGenerator(route.segments, trailingSlash)(validatedParams);
1146
+ }
1147
+ //#endregion
1148
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/routing/validation.js
1149
+ function validateDynamicRouteModule(mod, { ssr, route }) {
1150
+ if ((!ssr || route.prerender) && route.origin !== "internal" && !mod.getStaticPaths) throw new AstroError({
1151
+ ...GetStaticPathsRequired,
1152
+ location: { file: route.component }
1153
+ });
1154
+ }
1155
+ function validateGetStaticPathsResult(result, route) {
1156
+ if (!Array.isArray(result)) throw new AstroError({
1157
+ ...InvalidGetStaticPathsReturn,
1158
+ message: InvalidGetStaticPathsReturn.message(typeof result),
1159
+ location: { file: route.component }
1160
+ });
1161
+ result.forEach((pathObject) => {
1162
+ if (typeof pathObject === "object" && Array.isArray(pathObject) || pathObject === null) throw new AstroError({
1163
+ ...InvalidGetStaticPathsEntry,
1164
+ message: InvalidGetStaticPathsEntry.message(Array.isArray(pathObject) ? "array" : typeof pathObject)
1165
+ });
1166
+ if (pathObject.params === void 0 || pathObject.params === null || pathObject.params && Object.keys(pathObject.params).length === 0) throw new AstroError({
1167
+ ...GetStaticPathsExpectedParams,
1168
+ location: { file: route.component }
1169
+ });
1170
+ });
1171
+ }
1172
+ //#endregion
1173
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/render/paginate.js
1174
+ function generatePaginateFunction(routeMatch, base, trailingSlash) {
1175
+ return function paginateUtility(data, args = {}) {
1176
+ const generate = getRouteGenerator(routeMatch.segments, trailingSlash);
1177
+ let { pageSize: _pageSize, params: _params, props: _props, format: _format } = args;
1178
+ const pageSize = _pageSize || 10;
1179
+ const paramName = "page";
1180
+ const additionalParams = _params || {};
1181
+ const additionalProps = _props || {};
1182
+ const formatUrl = _format || ((url) => url);
1183
+ let includesFirstPageNumber;
1184
+ if (routeMatch.params.includes(`...${paramName}`)) includesFirstPageNumber = false;
1185
+ else if (routeMatch.params.includes(`${paramName}`)) includesFirstPageNumber = true;
1186
+ else throw new AstroError({
1187
+ ...PageNumberParamNotFound,
1188
+ message: PageNumberParamNotFound.message(paramName)
1189
+ });
1190
+ const lastPage = Math.max(1, Math.ceil(data.length / pageSize));
1191
+ return [...Array(lastPage).keys()].map((num) => {
1192
+ const pageNum = num + 1;
1193
+ const start = pageSize === Number.POSITIVE_INFINITY ? 0 : (pageNum - 1) * pageSize;
1194
+ const end = Math.min(start + pageSize, data.length);
1195
+ const params = {
1196
+ ...additionalParams,
1197
+ [paramName]: includesFirstPageNumber || pageNum > 1 ? String(pageNum) : void 0
1198
+ };
1199
+ const current = formatUrl(addRouteBase(generate({ ...params }), base));
1200
+ const next = pageNum === lastPage ? void 0 : formatUrl(addRouteBase(generate({
1201
+ ...params,
1202
+ page: String(pageNum + 1)
1203
+ }), base));
1204
+ const prev = pageNum === 1 ? void 0 : formatUrl(addRouteBase(generate({
1205
+ ...params,
1206
+ page: !includesFirstPageNumber && pageNum - 1 === 1 ? void 0 : String(pageNum - 1)
1207
+ }), base));
1208
+ const first = pageNum === 1 ? void 0 : formatUrl(addRouteBase(generate({
1209
+ ...params,
1210
+ page: includesFirstPageNumber ? "1" : void 0
1211
+ }), base));
1212
+ const last = pageNum === lastPage ? void 0 : formatUrl(addRouteBase(generate({
1213
+ ...params,
1214
+ page: String(lastPage)
1215
+ }), base));
1216
+ return {
1217
+ params,
1218
+ props: {
1219
+ ...additionalProps,
1220
+ page: {
1221
+ data: data.slice(start, end),
1222
+ start,
1223
+ end: end - 1,
1224
+ size: pageSize,
1225
+ total: data.length,
1226
+ currentPage: pageNum,
1227
+ lastPage,
1228
+ url: {
1229
+ current,
1230
+ next,
1231
+ prev,
1232
+ first,
1233
+ last
1234
+ }
1235
+ }
1236
+ }
1237
+ };
1238
+ });
1239
+ };
1240
+ }
1241
+ function addRouteBase(route, base) {
1242
+ let routeWithBase = joinPaths(base, route);
1243
+ if (routeWithBase === "") routeWithBase = "/";
1244
+ return routeWithBase;
1245
+ }
1246
+ //#endregion
1247
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/render/route-cache.js
1248
+ async function callGetStaticPaths({ mod, route, routeCache, ssr, base, trailingSlash }) {
1249
+ const cached = routeCache.get(route);
1250
+ if (!mod) throw new Error("This is an error caused by Astro and not your code. Please file an issue.");
1251
+ if (cached?.staticPaths && cached.mod === mod) return cached.staticPaths;
1252
+ validateDynamicRouteModule(mod, {
1253
+ ssr,
1254
+ route
1255
+ });
1256
+ if (ssr && !route.prerender || route.origin === "internal") {
1257
+ const entry = Object.assign([], { keyed: /* @__PURE__ */ new Map() });
1258
+ routeCache.set(route, {
1259
+ ...cached,
1260
+ mod,
1261
+ staticPaths: entry
1262
+ });
1263
+ return entry;
1264
+ }
1265
+ let staticPaths = [];
1266
+ if (!mod.getStaticPaths) throw new Error("Unexpected Error.");
1267
+ staticPaths = await mod.getStaticPaths({
1268
+ paginate: generatePaginateFunction(route, base, trailingSlash),
1269
+ routePattern: route.route
1270
+ });
1271
+ validateGetStaticPathsResult(staticPaths, route);
1272
+ const keyedStaticPaths = staticPaths;
1273
+ keyedStaticPaths.keyed = /* @__PURE__ */ new Map();
1274
+ for (const sp of keyedStaticPaths) {
1275
+ const paramsKey = stringifyParams(sp.params, route, trailingSlash);
1276
+ keyedStaticPaths.keyed.set(paramsKey, sp);
1277
+ }
1278
+ routeCache.set(route, {
1279
+ ...cached,
1280
+ mod,
1281
+ staticPaths: keyedStaticPaths
1282
+ });
1283
+ return keyedStaticPaths;
1284
+ }
1285
+ var RouteCache = class {
1286
+ logger;
1287
+ cache = {};
1288
+ runtimeMode;
1289
+ constructor(logger, runtimeMode = "production") {
1290
+ this.logger = logger;
1291
+ this.runtimeMode = runtimeMode;
1292
+ }
1293
+ /** Clear the cache. */
1294
+ clearAll() {
1295
+ this.cache = {};
1296
+ }
1297
+ set(route, entry) {
1298
+ const key = this.key(route);
1299
+ if (this.runtimeMode === "production" && this.cache[key]?.staticPaths) this.logger.warn(null, `Internal Warning: route cache overwritten. (${key})`);
1300
+ this.cache[key] = entry;
1301
+ }
1302
+ get(route) {
1303
+ return this.cache[this.key(route)];
1304
+ }
1305
+ key(route) {
1306
+ return `${route.route}_${route.component}`;
1307
+ }
1308
+ };
1309
+ var routeCaches = createManifestMemo((manifest) => new RouteCache(getLogger(manifest), getEnvironment(manifest).runtimeMode));
1310
+ function getRouteCache(manifest) {
1311
+ return routeCaches.get(manifest);
1312
+ }
1313
+ function findPathItemByKey(staticPaths, params, route, logger, trailingSlash) {
1314
+ const paramsKey = stringifyParams(params, route, trailingSlash);
1315
+ const matchedStaticPath = staticPaths.keyed.get(paramsKey);
1316
+ if (matchedStaticPath) return matchedStaticPath;
1317
+ logger.debug("router", `findPathItemByKey() - Unexpected cache miss looking for ${paramsKey}`);
1318
+ }
1319
+ //#endregion
1320
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/render/params-and-props.js
1321
+ async function getProps(opts) {
1322
+ const { logger, mod, routeData: route, routeCache, pathname, serverLike, base, trailingSlash } = opts;
1323
+ if (!route || route.pathname) return {};
1324
+ if (routeIsRedirect(route) || routeIsFallback(route) || route.component === "astro-default-404.astro") return {};
1325
+ const staticPaths = await callGetStaticPaths({
1326
+ mod,
1327
+ route,
1328
+ routeCache,
1329
+ ssr: serverLike,
1330
+ base,
1331
+ trailingSlash
1332
+ });
1333
+ const params = getParams(route, pathname);
1334
+ const matchedStaticPath = findPathItemByKey(staticPaths, params, route, logger, trailingSlash);
1335
+ if (!matchedStaticPath && route.origin !== "internal" && (serverLike ? route.prerender : true)) throw new AstroError({
1336
+ ...NoMatchingStaticPathFound,
1337
+ message: NoMatchingStaticPathFound.message(pathname),
1338
+ hint: NoMatchingStaticPathFound.hint([route.component])
1339
+ });
1340
+ if (mod) validatePrerenderEndpointCollision(route, mod, params);
1341
+ return matchedStaticPath?.props ? { ...matchedStaticPath.props } : {};
1342
+ }
1343
+ function getParams(route, pathname) {
1344
+ if (!route.params.length) return {};
1345
+ const hasHtmlSuffix = pathname.endsWith(".html") && !routeHasHtmlExtension(route);
1346
+ const path = hasHtmlSuffix && route.type === "page" ? pathname.slice(0, -5) : pathname;
1347
+ const allPatterns = [route, ...route.fallbackRoutes].map((r) => r.pattern);
1348
+ let paramsMatch = allPatterns.map((pattern) => pattern.exec(path)).find((x) => x);
1349
+ if (!paramsMatch && hasHtmlSuffix && route.type !== "page") {
1350
+ const strippedPath = pathname.endsWith("/index.html") ? pathname.slice(0, -11) || "/" : pathname.slice(0, -5);
1351
+ paramsMatch = allPatterns.map((pattern) => pattern.exec(strippedPath)).find((x) => x);
1352
+ }
1353
+ if (!paramsMatch) return {};
1354
+ const params = {};
1355
+ route.params.forEach((key, i) => {
1356
+ if (key.startsWith("...")) params[key.slice(3)] = paramsMatch[i + 1] ? paramsMatch[i + 1] : void 0;
1357
+ else params[key] = paramsMatch[i + 1];
1358
+ });
1359
+ return params;
1360
+ }
1361
+ function validatePrerenderEndpointCollision(route, mod, params) {
1362
+ if (route.type === "endpoint" && mod.getStaticPaths) {
1363
+ const lastSegment = route.segments[route.segments.length - 1];
1364
+ const paramValues = Object.values(params);
1365
+ const lastParam = paramValues[paramValues.length - 1];
1366
+ if (lastSegment.length === 1 && lastSegment[0].dynamic && lastParam === void 0) throw new AstroError({
1367
+ ...PrerenderDynamicEndpointPathCollide,
1368
+ message: PrerenderDynamicEndpointPathCollide.message(route.route),
1369
+ hint: PrerenderDynamicEndpointPathCollide.hint(route.component),
1370
+ location: { file: route.component }
1371
+ });
1372
+ }
1373
+ }
1374
+ //#endregion
1375
+ //#region ../../node_modules/.bun/astro@7.3.5+3335b8e0b249efdf/node_modules/astro/dist/core/middleware/sequence.js
1376
+ function sequence(...handlers) {
1377
+ const filtered = handlers.filter((h) => !!h);
1378
+ const length = filtered.length;
1379
+ if (!length) return defineMiddleware((_context, next) => {
1380
+ return next();
1381
+ });
1382
+ return defineMiddleware((context, next) => {
1383
+ let carriedPayload = void 0;
1384
+ return applyHandle(0, context);
1385
+ function applyHandle(i, handleContext) {
1386
+ const handle = filtered[i];
1387
+ return handle(handleContext, async (payload) => {
1388
+ if (i < length - 1) {
1389
+ if (payload) {
1390
+ const oldPathname = handleContext.url.pathname;
1391
+ const state = Reflect.get(handleContext, fetchStateSymbol);
1392
+ if (!state) throw new Error("FetchState not found on APIContext. `next(payload)` rewrites require a context created through Astro's request pipeline.");
1393
+ const manifest = state.manifest;
1394
+ const { routeData, pathname } = await getEnvironment(manifest).tryRewrite(manifest, payload, handleContext.request);
1395
+ let newRequest;
1396
+ if (payload instanceof Request) newRequest = payload;
1397
+ else {
1398
+ const request = handleContext.request.method === "GET" || handleContext.request.method === "HEAD" ? handleContext.request : handleContext.request.clone();
1399
+ newRequest = copyRequest(payload instanceof URL ? payload : new URL(payload, handleContext.url.origin), request, false, state.logger, routeData.route);
1400
+ }
1401
+ if (manifest.serverLike === true && handleContext.isPrerendered === false && routeData.prerender === true) throw new AstroError({
1402
+ ...ForbiddenRewrite,
1403
+ message: ForbiddenRewrite.message(handleContext.url.pathname, pathname, routeData.component),
1404
+ hint: ForbiddenRewrite.hint(routeData.component)
1405
+ });
1406
+ carriedPayload = payload;
1407
+ handleContext.request = newRequest;
1408
+ handleContext.url = new URL(newRequest.url);
1409
+ handleContext.params = getParams(routeData, pathname);
1410
+ handleContext.routePattern = routeData.route;
1411
+ setOriginPathname(handleContext.request, oldPathname, manifest.trailingSlash, manifest.buildFormat);
1412
+ }
1413
+ return applyHandle(i + 1, handleContext);
1414
+ } else return next(payload ?? carriedPayload);
1415
+ });
1416
+ }
1417
+ });
1418
+ }
1419
+ //#endregion
1420
+ export { normalizeThePath as A, prependForwardSlash as B, createManifestMemo as C, routeHasHtmlExtension as D, getDefaultStatusCode as E, hasFileExtension as F, shouldAppendForwardSlash as G, removeQueryString as H, isInternalPath as I, defineMiddleware as K, isParentDirectory as L, appendForwardSlash as M, collapseDuplicateSlashes as N, getErrorRoutePath as O, collapseDuplicateTrailingSlashes as P, isRemotePath as R, createAsyncManifestMemo as S, getCustom500Route as T, removeTrailingForwardSlash as U, removeLeadingForwardSlash as V, stripRequestBase as W, DEFAULT_404_ROUTE as _, getRouteGenerator as a, BodySizeLimitError as b, createConsoleLogger as c, getEnvironment as d, copyRequest as f, validateAndDecodePathname as g, MultiLevelEncodingError as h, getRouteCache as i, pathHasLocale as j, normalizeTheLocale as k, AstroIntegrationLogger as l, setOriginPathname as m, getParams as n, getLogger as o, getOriginPathname as p, getProps as r, getResolvedLogger as s, sequence as t, astroToRuntimeLogger as u, escape as v, getCustom404Route as w, readBodyWithLimit as x, SERVER_ISLAND_COMPONENT as y, joinPaths as z };