@edge-base/server 0.2.7 → 0.2.9

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 (65) hide show
  1. package/admin-build/_app/immutable/chunks/{CIOC1v_q.js → 0M5txo3l.js} +3 -3
  2. package/admin-build/_app/immutable/chunks/{ejoEf2I5.js → 39YMyjjq.js} +1 -1
  3. package/admin-build/_app/immutable/chunks/B0zJ5_Wk.js +1 -0
  4. package/admin-build/_app/immutable/chunks/{BhCO1Fpt.js → BN-pHKcH.js} +1 -1
  5. package/admin-build/_app/immutable/chunks/{BEM1BeVF.js → BfhqI0W8.js} +1 -1
  6. package/admin-build/_app/immutable/chunks/{DnpbvAPi.js → C5nMidnK.js} +1 -1
  7. package/admin-build/_app/immutable/chunks/{iEyeblJR.js → CI1lKBjB.js} +1 -1
  8. package/admin-build/_app/immutable/chunks/{Dz9cUCuv.js → CPLcjNR9.js} +1 -1
  9. package/admin-build/_app/immutable/chunks/{BfpUQYr3.js → DBkor_jM.js} +1 -1
  10. package/admin-build/_app/immutable/chunks/{Tea2dBJ8.js → DBniE7GN.js} +1 -1
  11. package/admin-build/_app/immutable/chunks/{BYyykAbh.js → DUhE3Ynq.js} +1 -1
  12. package/admin-build/_app/immutable/chunks/DZo4s3wn.js +1 -0
  13. package/admin-build/_app/immutable/chunks/{BDYewzou.js → DllVADtt.js} +1 -1
  14. package/admin-build/_app/immutable/chunks/{CvczjTXx.js → DncT8xH5.js} +1 -1
  15. package/admin-build/_app/immutable/chunks/{DaXO-sFP.js → YGUb3X-Q.js} +1 -1
  16. package/admin-build/_app/immutable/chunks/{D1u3u7xu.js → _xa30BOD.js} +1 -1
  17. package/admin-build/_app/immutable/entry/{app.DoUaxnew.js → app.BW-Ac3jY.js} +2 -2
  18. package/admin-build/_app/immutable/entry/start.Bcf0SjPV.js +1 -0
  19. package/admin-build/_app/immutable/nodes/{0.Dsxi8s7i.js → 0.CRSQPtos.js} +1 -1
  20. package/admin-build/_app/immutable/nodes/{1.Cp2l-hol.js → 1.HmStNbZP.js} +1 -1
  21. package/admin-build/_app/immutable/nodes/{10.4oY6m8Nz.js → 10.BVlz13nr.js} +1 -1
  22. package/admin-build/_app/immutable/nodes/{11.DfcozD4J.js → 11.VwQdbWwH.js} +1 -1
  23. package/admin-build/_app/immutable/nodes/{12.uJgZdCIA.js → 12.BFAAgi1f.js} +1 -1
  24. package/admin-build/_app/immutable/nodes/{13.CaN1kRev.js → 13.DDdauC84.js} +1 -1
  25. package/admin-build/_app/immutable/nodes/{14.DQ5xIi3s.js → 14.D_rXaafJ.js} +1 -1
  26. package/admin-build/_app/immutable/nodes/{15.B_EkebTJ.js → 15.rfFjjiZc.js} +1 -1
  27. package/admin-build/_app/immutable/nodes/{16.Tko1ZX8-.js → 16.DDEpGJ4Z.js} +1 -1
  28. package/admin-build/_app/immutable/nodes/{17.BCmWMJX9.js → 17.ChQWNtRN.js} +1 -1
  29. package/admin-build/_app/immutable/nodes/{18.hmGhl1O2.js → 18.Rir_JwlF.js} +1 -1
  30. package/admin-build/_app/immutable/nodes/{19.D-1infOo.js → 19.CF76nxk1.js} +1 -1
  31. package/admin-build/_app/immutable/nodes/{20.CY4KKcBL.js → 20.JQer3KPM.js} +1 -1
  32. package/admin-build/_app/immutable/nodes/21.CzGYxjpu.js +1 -0
  33. package/admin-build/_app/immutable/nodes/{22.14Vd7bnt.js → 22.DUw7X6z_.js} +1 -1
  34. package/admin-build/_app/immutable/nodes/{23.Be6jK77o.js → 23.DS3svA-a.js} +1 -1
  35. package/admin-build/_app/immutable/nodes/{24.CSTFkr6R.js → 24.BYOsQM6B.js} +1 -1
  36. package/admin-build/_app/immutable/nodes/{25.DRTg8fHc.js → 25.n0pyDBRv.js} +1 -1
  37. package/admin-build/_app/immutable/nodes/{26.DKt-9lwQ.js → 26.C-Oo8sYK.js} +1 -1
  38. package/admin-build/_app/immutable/nodes/{27.D5caPu0F.js → 27.BfxbFNkk.js} +1 -1
  39. package/admin-build/_app/immutable/nodes/{28.hJhlnlyY.js → 28.DyHSN1q7.js} +1 -1
  40. package/admin-build/_app/immutable/nodes/{29.CDYBzFyT.js → 29.CUAmZbCc.js} +1 -1
  41. package/admin-build/_app/immutable/nodes/{3.DMyKwkGn.js → 3.KQm4VJJg.js} +1 -1
  42. package/admin-build/_app/immutable/nodes/{30.BaHNeEmc.js → 30.CQdPre5F.js} +1 -1
  43. package/admin-build/_app/immutable/nodes/{31.C6PV5L-2.js → 31.BP6raetq.js} +1 -1
  44. package/admin-build/_app/immutable/nodes/{4.9E118Ftm.js → 4.Glf2jJHB.js} +1 -1
  45. package/admin-build/_app/immutable/nodes/{5.D8guAl3v.js → 5.BdFtj_-X.js} +1 -1
  46. package/admin-build/_app/immutable/nodes/{6.D1u__DtT.js → 6.JfnwWq8s.js} +1 -1
  47. package/admin-build/_app/immutable/nodes/{7.DWXHnRFf.js → 7.C-rw9qDh.js} +1 -1
  48. package/admin-build/_app/immutable/nodes/{8.Dojd8krc.js → 8.CA7r1Sjs.js} +1 -1
  49. package/admin-build/_app/immutable/nodes/{9.CLtrr0K_.js → 9.B2jgJDkH.js} +1 -1
  50. package/admin-build/_app/version.json +1 -1
  51. package/admin-build/index.html +7 -7
  52. package/package.json +3 -3
  53. package/src/__tests__/admin-assets.test.ts +7 -7
  54. package/src/__tests__/frontend-assets.test.ts +75 -0
  55. package/src/__tests__/frontend-config.test.ts +16 -0
  56. package/src/__tests__/frontend-routing.test.ts +200 -0
  57. package/src/durable-objects/room-runtime-base.ts +80 -6
  58. package/src/index.ts +97 -3
  59. package/src/lib/admin-assets.ts +5 -5
  60. package/src/lib/frontend-assets.ts +129 -0
  61. package/src/lib/frontend-config.ts +11 -0
  62. package/admin-build/_app/immutable/chunks/BaUG2TJ-.js +0 -1
  63. package/admin-build/_app/immutable/chunks/qKdzaeX3.js +0 -1
  64. package/admin-build/_app/immutable/entry/start.MmZh8oBH.js +0 -1
  65. package/admin-build/_app/immutable/nodes/21.B9lbNUQr.js +0 -1
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { HonoEnv } from './lib/hono.js';
2
2
  import type { OpenApiSpec } from './lib/openapi.js';
3
3
  import type { Env } from './types.js';
4
+ import type { FrontendConfigLike } from './lib/frontend-config.js';
4
5
  import { ensureServerStartup } from './lib/runtime-startup.js';
5
6
 
6
7
  // ─── DO Re-exports (wrangler needs exports from main entry) ───
@@ -11,12 +12,14 @@ export { RoomsDO } from './durable-objects/rooms-do.js';
11
12
  export { LogsDO } from './durable-objects/logs-do.js';
12
13
 
13
14
  let appPromise: Promise<Awaited<ReturnType<typeof buildApp>>> | null = null;
15
+ const FRONTEND_ASSET_REDIRECT_STATUSES = new Set([301, 302, 307, 308]);
16
+ const FRONTEND_ASSET_REDIRECT_LIMIT = 4;
14
17
 
15
18
  function assetUnavailableMessage(
16
- assetName: 'admin dashboard' | 'harness assets',
19
+ assetName: 'admin dashboard' | 'frontend bundle' | 'harness assets',
17
20
  ): string {
18
21
  const label = `${assetName[0].toUpperCase()}${assetName.slice(1)}`;
19
- const verb = assetName === 'admin dashboard' ? 'is' : 'are';
22
+ const verb = assetName === 'harness assets' ? 'are' : 'is';
20
23
  return `${label} ${verb} not deployed for this worker. Deploy the assets bundle or configure ADMIN_ORIGIN if they are hosted elsewhere.`;
21
24
  }
22
25
 
@@ -56,6 +59,7 @@ async function buildApp() {
56
59
  analyticsRouteModule,
57
60
  adminAssetsModule,
58
61
  adminRoutingModule,
62
+ frontendAssetsModule,
59
63
  schemasModule,
60
64
  pluginMigrationsModule,
61
65
  pluginMigrationRoutingModule,
@@ -95,6 +99,7 @@ async function buildApp() {
95
99
  import('./routes/analytics-api.js'),
96
100
  import('./lib/admin-assets.js'),
97
101
  import('./lib/admin-routing.js'),
102
+ import('./lib/frontend-assets.js'),
98
103
  import('./lib/schemas.js'),
99
104
  import('./lib/plugin-migrations.js'),
100
105
  import('./lib/plugin-migration-routing.js'),
@@ -116,6 +121,7 @@ async function buildApp() {
116
121
  const { SERVER_VERSION } = versionModule;
117
122
  const { createAdminAssetRequest } = adminAssetsModule;
118
123
  const { resolveAdminFaviconTarget, resolveAdminRedirectTarget } = adminRoutingModule;
124
+ const { applyFrontendAssetHeaders, createFrontendAssetRequest } = frontendAssetsModule;
119
125
  const { zodDefaultHook } = schemasModule;
120
126
  const { executePluginMigrations } = pluginMigrationsModule;
121
127
  const { shouldRunPluginMigrationsForRequestPath } = pluginMigrationRoutingModule;
@@ -163,8 +169,75 @@ async function buildApp() {
163
169
  app.route('/admin/api', adminRouteModule.adminRoute);
164
170
  app.route('/admin/api/backup', backupRouteModule.backupRoute);
165
171
 
166
- app.get('/', (c) => {
172
+ function getFrontendConfig(env: Env): FrontendConfigLike | undefined {
173
+ return (doRouterModule.parseConfig(env) as { frontend?: FrontendConfigLike } | undefined)?.frontend;
174
+ }
175
+
176
+ async function fetchFrontendAssetResponse(
177
+ assetsBinding: { fetch(request: Request): Promise<Response> },
178
+ assetRequest: Request,
179
+ ): Promise<Response> {
180
+ let currentRequest = assetRequest;
181
+ const visitedUrls = new Set<string>();
182
+
183
+ for (let attempt = 0; attempt <= FRONTEND_ASSET_REDIRECT_LIMIT; attempt += 1) {
184
+ visitedUrls.add(currentRequest.url);
185
+ const assetResponse = await assetsBinding.fetch(currentRequest);
186
+ if (!FRONTEND_ASSET_REDIRECT_STATUSES.has(assetResponse.status)) {
187
+ return assetResponse;
188
+ }
189
+
190
+ const location = assetResponse.headers.get('location');
191
+ if (!location) {
192
+ return assetResponse;
193
+ }
194
+
195
+ const nextUrl = new URL(location, currentRequest.url);
196
+ if (nextUrl.origin !== new URL(currentRequest.url).origin) {
197
+ return assetResponse;
198
+ }
199
+
200
+ if (visitedUrls.has(nextUrl.toString())) {
201
+ return assetResponse;
202
+ }
203
+
204
+ currentRequest = new Request(nextUrl.toString(), currentRequest);
205
+ }
206
+
207
+ return assetsBinding.fetch(currentRequest);
208
+ }
209
+
210
+ async function serveFrontendAsset(c: { env: Env; req: { raw: Request } }): Promise<Response | null> {
211
+ const frontend = getFrontendConfig(c.env);
212
+ if (!frontend) {
213
+ return null;
214
+ }
215
+
216
+ if (!c.env.ASSETS) {
217
+ return new Response(
218
+ JSON.stringify({ code: 404, message: assetUnavailableMessage('frontend bundle') }),
219
+ {
220
+ status: 404,
221
+ headers: { 'content-type': 'application/json; charset=UTF-8' },
222
+ },
223
+ );
224
+ }
225
+
226
+ const assetRequest = createFrontendAssetRequest(c.req.raw, frontend);
227
+ if (!assetRequest) {
228
+ return null;
229
+ }
230
+
231
+ const assetResponse = await fetchFrontendAssetResponse(c.env.ASSETS, assetRequest);
232
+ return applyFrontendAssetHeaders(assetResponse, new URL(assetRequest.url).pathname);
233
+ }
234
+
235
+ app.get('/', async (c) => {
167
236
  const env = c.env as Env;
237
+ const frontendResponse = await serveFrontendAsset({ env, req: c.req });
238
+ if (frontendResponse) {
239
+ return frontendResponse;
240
+ }
168
241
  const externalAdminUrl = resolveAdminRedirectTarget(c.req.url, env.ADMIN_ORIGIN);
169
242
  if (externalAdminUrl) {
170
243
  return c.redirect(externalAdminUrl, 302);
@@ -181,6 +254,10 @@ async function buildApp() {
181
254
 
182
255
  app.get('/favicon.ico', async (c) => {
183
256
  const env = c.env as Env;
257
+ const frontendResponse = await serveFrontendAsset({ env, req: c.req });
258
+ if (frontendResponse) {
259
+ return frontendResponse;
260
+ }
184
261
  const externalFaviconUrl = resolveAdminFaviconTarget(env.ADMIN_ORIGIN);
185
262
  if (externalFaviconUrl) {
186
263
  return c.redirect(externalFaviconUrl, 302);
@@ -197,6 +274,10 @@ async function buildApp() {
197
274
 
198
275
  app.get('/favicon.svg', async (c) => {
199
276
  const env = c.env as Env;
277
+ const frontendResponse = await serveFrontendAsset({ env, req: c.req });
278
+ if (frontendResponse) {
279
+ return frontendResponse;
280
+ }
200
281
  const externalFaviconUrl = resolveAdminFaviconTarget(env.ADMIN_ORIGIN);
201
282
  if (externalFaviconUrl) {
202
283
  return c.redirect(externalFaviconUrl, 302);
@@ -275,6 +356,19 @@ async function buildApp() {
275
356
  return c.json(normalizeOpenApiDocument(spec as OpenApiSpec, new URL(c.req.url).origin));
276
357
  });
277
358
 
359
+ app.on(['GET', 'HEAD'], '*', async (c) => {
360
+ const env = c.env as Env;
361
+ const frontendResponse = await serveFrontendAsset({ env, req: c.req });
362
+ if (frontendResponse) {
363
+ return frontendResponse;
364
+ }
365
+
366
+ return c.json({
367
+ code: 404,
368
+ message: `Path '${new URL(c.req.url).pathname}' was not found on this EdgeBase server.`,
369
+ }, 404);
370
+ });
371
+
278
372
  app.notFound((c) => {
279
373
  return c.json({
280
374
  code: 404,
@@ -1,6 +1,6 @@
1
1
  export function resolveAdminAssetPath(pathname: string): string {
2
2
  if (pathname === '/admin' || pathname === '/admin/') {
3
- return '/';
3
+ return '/admin/index.html';
4
4
  }
5
5
 
6
6
  if (!pathname.startsWith('/admin/')) {
@@ -9,19 +9,19 @@ export function resolveAdminAssetPath(pathname: string): string {
9
9
 
10
10
  const assetPath = pathname.slice('/admin'.length) || '/';
11
11
  if (assetPath === '/' || assetPath === '') {
12
- return '/';
12
+ return '/admin/index.html';
13
13
  }
14
14
 
15
15
  if (assetPath.startsWith('/_app/')) {
16
- return assetPath;
16
+ return `/admin${assetPath}`;
17
17
  }
18
18
 
19
19
  const lastSegment = assetPath.split('/').pop() ?? '';
20
20
  if (lastSegment.includes('.')) {
21
- return assetPath;
21
+ return `/admin${assetPath}`;
22
22
  }
23
23
 
24
- return '/';
24
+ return '/admin/index.html';
25
25
  }
26
26
 
27
27
  export function createAdminAssetRequest(request: Request): Request {
@@ -0,0 +1,129 @@
1
+ import { normalizeFrontendMountPath, type FrontendConfigLike } from './frontend-config.js';
2
+
3
+ interface ResolveFrontendAssetPathOptions {
4
+ method?: string;
5
+ accept?: string | null;
6
+ mountPath?: string;
7
+ spaFallback?: boolean;
8
+ }
9
+
10
+ const HTML_ACCEPT_MARKERS = ['text/html', 'application/xhtml+xml'];
11
+ const HASHED_ASSET_PATTERN = /(?:^|[-._])[A-Za-z0-9]{8,}\.[A-Za-z0-9]+$/;
12
+
13
+ function isExplicitAssetPath(pathname: string): boolean {
14
+ const lastSegment = pathname.split('/').pop() ?? '';
15
+ return lastSegment.includes('.');
16
+ }
17
+
18
+ function isHtmlNavigationRequest(method: string | undefined, accept: string | null | undefined): boolean {
19
+ if (method && method !== 'GET' && method !== 'HEAD') {
20
+ return false;
21
+ }
22
+
23
+ if (!accept) {
24
+ return false;
25
+ }
26
+
27
+ return HTML_ACCEPT_MARKERS.some((marker) => accept.includes(marker));
28
+ }
29
+
30
+ function stripMountPath(pathname: string, mountPath: string): string | null {
31
+ if (mountPath === '/') {
32
+ return pathname || '/';
33
+ }
34
+
35
+ if (pathname === mountPath || pathname === `${mountPath}/`) {
36
+ return '/';
37
+ }
38
+
39
+ if (!pathname.startsWith(`${mountPath}/`)) {
40
+ return null;
41
+ }
42
+
43
+ return pathname.slice(mountPath.length) || '/';
44
+ }
45
+
46
+ export function resolveFrontendAssetPath(
47
+ pathname: string,
48
+ options: ResolveFrontendAssetPathOptions = {},
49
+ ): string | null {
50
+ const mountPath = normalizeFrontendMountPath(options.mountPath);
51
+ const relativePath = stripMountPath(pathname || '/', mountPath);
52
+ if (relativePath === null) {
53
+ return null;
54
+ }
55
+
56
+ const assetPrefix = mountPath === '/' ? '' : mountPath;
57
+
58
+ if (relativePath === '/' || relativePath === '') {
59
+ return `${assetPrefix}/index.html`;
60
+ }
61
+
62
+ const explicitAssetPath = `${assetPrefix}${relativePath}`;
63
+ if (isExplicitAssetPath(relativePath)) {
64
+ return explicitAssetPath;
65
+ }
66
+
67
+ if (options.spaFallback && isHtmlNavigationRequest(options.method, options.accept)) {
68
+ return `${assetPrefix}/index.html`;
69
+ }
70
+
71
+ return explicitAssetPath;
72
+ }
73
+
74
+ export function createFrontendAssetRequest(
75
+ request: Request,
76
+ config: FrontendConfigLike,
77
+ ): Request | null {
78
+ const url = new URL(request.url);
79
+ const pathname = resolveFrontendAssetPath(url.pathname, {
80
+ method: request.method,
81
+ accept: request.headers.get('accept'),
82
+ mountPath: config.mountPath,
83
+ spaFallback: config.spaFallback,
84
+ });
85
+
86
+ if (!pathname) {
87
+ return null;
88
+ }
89
+
90
+ url.pathname = pathname;
91
+ return new Request(url.toString(), request);
92
+ }
93
+
94
+ function getFrontendCacheControl(pathname: string): string | null {
95
+ const assetName = pathname.split('/').pop() ?? '';
96
+
97
+ if (assetName === 'index.html' || assetName === 'manifest.webmanifest' || assetName === 'sw.js') {
98
+ return 'no-cache';
99
+ }
100
+
101
+ if (HASHED_ASSET_PATTERN.test(assetName)) {
102
+ return 'public, max-age=31536000, immutable';
103
+ }
104
+
105
+ if (isExplicitAssetPath(pathname)) {
106
+ return 'public, max-age=300';
107
+ }
108
+
109
+ return null;
110
+ }
111
+
112
+ export function applyFrontendAssetHeaders(response: Response, pathname: string): Response {
113
+ if (!response.ok) {
114
+ return response;
115
+ }
116
+
117
+ const cacheControl = getFrontendCacheControl(pathname);
118
+ if (!cacheControl) {
119
+ return response;
120
+ }
121
+
122
+ const headers = new Headers(response.headers);
123
+ headers.set('Cache-Control', cacheControl);
124
+ return new Response(response.body, {
125
+ status: response.status,
126
+ statusText: response.statusText,
127
+ headers,
128
+ });
129
+ }
@@ -0,0 +1,11 @@
1
+ export interface FrontendConfigLike {
2
+ directory: string;
3
+ mountPath?: string;
4
+ spaFallback?: boolean;
5
+ }
6
+
7
+ export function normalizeFrontendMountPath(mountPath: string | undefined): string {
8
+ if (!mountPath) return '/';
9
+ if (mountPath === '/') return '/';
10
+ return mountPath.endsWith('/') ? mountPath.slice(0, -1) : mountPath;
11
+ }
@@ -1 +0,0 @@
1
- import{ab as J,bm as ee}from"./BdTBlfLy.js";import{w as ae}from"./Bn2NtlTj.js";import{H as N,N as M,r as mt,o as $t,i as _t,b as L,s as j,p as x,n as ft,f as Nt,g as ut,a as X,c as it,S as Dt,P as ne,d as re,e as oe,h as se,j as Pt,k as q,l as ie,m as qt,q as ce,t as le,u as Kt,v as fe}from"./qKdzaeX3.js";class wt{constructor(a,e){this.status=a,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${a}`}}toString(){return JSON.stringify(this.body)}}class vt{constructor(a,e){this.status=a,this.location=e}}class yt extends Error{constructor(a,e,r){super(r),this.status=a,this.text=e}}const ue=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function he(t){const a=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${pe(t).map(r=>{const n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(n)return a.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return a.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return ct(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ct(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const h=ue.exec(c),[,u,w,f,d]=h;return a.push({name:f,matcher:d,optional:!!u,rest:!!w,chained:w?l===1&&s[0]==="":!1}),w?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return ct(c)}).join("")}).join("")}/?$`),params:a}}function de(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function pe(t){return t.slice(1).split("/").filter(de)}function ge(t,a,e){const r={},n=t.slice(1),o=n.filter(i=>i!==void 0);let s=0;for(let i=0;i<a.length;i+=1){const c=a[i];let l=n[i-s];if(c.chained&&c.rest&&s&&(l=n.slice(i-s,i+1).filter(h=>h).join("/"),s=0),l===void 0)if(c.rest)l="";else continue;if(!c.matcher||e[c.matcher](l)){r[c.name]=l;const h=a[i+1],u=n[i+1];h&&!h.rest&&h.optional&&u&&c.chained&&(s=0),!h&&!u&&Object.keys(r).length===o.length&&(s=0);continue}if(c.optional&&c.chained){s++;continue}return}if(!s)return r}function ct(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function me({nodes:t,server_loads:a,dictionary:e,matchers:r}){const n=new Set(a);return Object.entries(e).map(([i,[c,l,h]])=>{const{pattern:u,params:w}=he(i),f={id:i,exec:d=>{const _=u.exec(d);if(_)return ge(_,w,r)},errors:[1,...h||[]].map(d=>t[d]),layouts:[0,...l||[]].map(s),leaf:o(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(i){const c=i<0;return c&&(i=~i),[c,t[i]]}function s(i){return i===void 0?i:[n.has(i),t[i]]}}function Ft(t,a=JSON.parse){try{return a(sessionStorage[t])}catch{}}function It(t,a,e=JSON.stringify){const r=e(a);try{sessionStorage[t]=r}catch{}}function _e(t){return t.filter(a=>a!=null)}function bt(t){return t instanceof wt||t instanceof yt?t.status:500}function we(t){return t instanceof yt?t.text:"Internal Error"}const ve=new Set(["icon","shortcut icon","apple-touch-icon"]),I=Ft(Kt)??{},V=Ft(qt)??{},P={url:Pt({}),page:Pt({}),navigating:ae(null),updated:se()};function Et(t){I[t]=j()}function ye(t,a){let e=t+1;for(;I[e];)delete I[e],e+=1;for(e=a+1;V[e];)delete V[e],e+=1}function B(t,a=!1){return a?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function Mt(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(L||"/");t&&await t.update()}}function Tt(){}let kt,ht,Q,U,dt,E;const Z=[],tt=[];let v=null;function pt(){var t;(t=v==null?void 0:v.fork)==null||t.then(a=>a==null?void 0:a.discard()),v=null}const G=new Map,Vt=new Set,be=new Set,F=new Set;let m={branch:[],error:null,url:null},Bt=!1,et=!1,Ot=!0,H=!1,K=!1,Ht=!1,St=!1,Yt,b,R,O;const at=new Set,jt=new Map;async function Fe(t,a,e){var o,s,i,c,l;(o=globalThis.__sveltekit_jgts8u)!=null&&o.data&&globalThis.__sveltekit_jgts8u.data,document.URL!==location.href&&(location.href=location.href),E=t,await((i=(s=t.hooks).init)==null?void 0:i.call(s)),kt=me(t),U=document.documentElement,dt=a,ht=t.nodes[0],Q=t.nodes[1],ht(),Q(),b=(c=history.state)==null?void 0:c[N],R=(l=history.state)==null?void 0:l[M],b||(b=R=Date.now(),history.replaceState({...history.state,[N]:b,[M]:R},""));const r=I[b];function n(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}e?(n(),await je(dt,e)):(await D({type:"enter",url:mt(E.hash?Ne(new URL(location.href)):location.href),replace_state:!0}),n()),Oe()}function Ee(){Z.length=0,St=!1}function zt(t){tt.some(a=>a==null?void 0:a.snapshot)&&(V[t]=tt.map(a=>{var e;return(e=a==null?void 0:a.snapshot)==null?void 0:e.capture()}))}function Wt(t){var a;(a=V[t])==null||a.forEach((e,r)=>{var n,o;(o=(n=tt[r])==null?void 0:n.snapshot)==null||o.restore(e)})}function Ct(){Et(b),It(Kt,I),zt(R),It(qt,V)}async function Gt(t,a,e,r){let n;a.invalidateAll&&pt(),await D({type:"goto",url:mt(t),keepfocus:a.keepFocus,noscroll:a.noScroll,replace_state:a.replaceState,state:a.state,redirect_count:e,nav_token:r,accept:()=>{a.invalidateAll&&(St=!0,n=[...jt.keys()]),a.invalidate&&a.invalidate.forEach(Te)}}),a.invalidateAll&&J().then(J).then(()=>{jt.forEach(({resource:o},s)=>{var i;n!=null&&n.includes(s)&&((i=o.refresh)==null||i.call(o))})})}async function ke(t){if(t.id!==(v==null?void 0:v.id)){pt();const a={};at.add(a),v={id:t.id,token:a,promise:Xt({...t,preload:a}).then(e=>(at.delete(a),e.type==="loaded"&&e.state.error&&pt(),e)),fork:null}}return v.promise}async function lt(t){var e;const a=(e=await ot(t,!1))==null?void 0:e.route;a&&await Promise.all([...a.layouts,a.leaf].map(r=>r==null?void 0:r[1]()))}async function Jt(t,a,e){var n;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(x,t.props.page),Yt=new E.root({target:a,props:{...t.props,stores:P,components:tt},hydrate:e,sync:!1}),await Promise.resolve(),Wt(R),e){const o={from:null,to:{params:m.params,route:{id:((n=m.route)==null?void 0:n.id)??null},url:new URL(location.href),scroll:I[b]??j()},willUnload:!1,type:"enter",complete:Promise.resolve()};F.forEach(s=>s(o))}et=!0}function nt({url:t,params:a,branch:e,status:r,error:n,route:o,form:s}){let i="never";if(L&&(t.pathname===L||t.pathname===L+"/"))i="always";else for(const f of e)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=oe(t.pathname,i),t.search=t.search;const c={type:"loaded",state:{url:t,params:a,branch:e,error:n,route:o},props:{constructors:_e(e).map(f=>f.node.component),page:At(x)}};s!==void 0&&(c.props.form=s);let l={},h=!x,u=0;for(let f=0;f<Math.max(e.length,m.branch.length);f+=1){const d=e[f],_=m.branch[f];(d==null?void 0:d.data)!==(_==null?void 0:_.data)&&(h=!0),d&&(l={...l,...d.data},h&&(c.props[`data_${u}`]=l),u+=1)}return(!m.url||t.href!==m.url.href||m.error!==n||s!==void 0&&s!==x.form||h)&&(c.props.page={error:n,params:a,route:{id:(o==null?void 0:o.id)??null},state:{},status:r,url:new URL(t),form:s??null,data:h?l:x.data}),c}async function Rt({loader:t,parent:a,url:e,params:r,route:n,server_data_node:o}){var l,h;let s=null;const i={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await t();return{node:c,loader:t,server:o,universal:(l=c.universal)!=null&&l.load?{type:"data",data:s,uses:i}:null,data:s??(o==null?void 0:o.data)??null,slash:((h=c.universal)==null?void 0:h.trailingSlash)??(o==null?void 0:o.slash)}}function Se(t,a,e){let r=t instanceof Request?t.url:t;const n=new URL(r,e);n.origin===e.origin&&(r=n.href.slice(e.origin.length));const o=et?ce(r,n.href,a):le(r,a);return{resolved:n,promise:o}}function Re(t,a,e,r,n,o){if(St)return!0;if(!n)return!1;if(n.parent&&t||n.route&&a||n.url&&e)return!0;for(const s of n.search_params)if(r.has(s))return!0;for(const s of n.params)if(o[s]!==m.params[s])return!0;for(const s of n.dependencies)if(Z.some(i=>i(new URL(s))))return!0;return!1}function xt(t,a){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?a??null:null}function xe(t,a){if(!t)return new Set(a.searchParams.keys());const e=new Set([...t.searchParams.keys(),...a.searchParams.keys()]);for(const r of e){const n=t.searchParams.getAll(r),o=a.searchParams.getAll(r);n.every(s=>o.includes(s))&&o.every(s=>n.includes(s))&&e.delete(r)}return e}function Le({error:t,url:a,route:e,params:r}){return{type:"loaded",state:{error:t,url:a,route:e,params:r,branch:[]},props:{page:At(x),constructors:[]}}}async function Xt({id:t,invalidating:a,url:e,params:r,route:n,preload:o}){if((v==null?void 0:v.id)===t)return at.delete(v.token),v.promise;const{errors:s,layouts:i,leaf:c}=n,l=[...i,c];s.forEach(g=>g==null?void 0:g().catch(()=>{})),l.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const h=m.url?t!==rt(m.url):!1,u=m.route?n.id!==m.route.id:!1,w=xe(m.url,e);let f=!1;const d=l.map(async(g,p)=>{var A;if(!g)return;const y=m.branch[p];return g[1]===(y==null?void 0:y.loader)&&!Re(f,u,h,w,(A=y.universal)==null?void 0:A.uses,r)?y:(f=!0,Rt({loader:g[1],url:e,params:r,route:n,parent:async()=>{var z;const T={};for(let C=0;C<p;C+=1)Object.assign(T,(z=await d[C])==null?void 0:z.data);return T},server_data_node:xt(g[0]?{type:"skip"}:null,g[0]?y==null?void 0:y.server:void 0)}))});for(const g of d)g.catch(()=>{});const _=[];for(let g=0;g<l.length;g+=1)if(l[g])try{_.push(await d[g])}catch(p){if(p instanceof vt)return{type:"redirect",location:p.location};if(at.has(o))return Le({error:await Y(p,{params:r,url:e,route:{id:n.id}}),url:e,params:r,route:n});let y=bt(p),S;if(p instanceof wt)S=p.body;else{if(await P.updated.check())return await Mt(),await B(e);S=await Y(p,{params:r,url:e,route:{id:n.id}})}const A=await Ue(g,_,s);return A?nt({url:e,params:r,branch:_.slice(0,A.idx).concat(A.node),status:y,error:S,route:n}):await Zt(e,{id:n.id},S,y)}else _.push(void 0);return nt({url:e,params:r,branch:_,status:200,error:null,route:n,form:a?void 0:null})}async function Ue(t,a,e){for(;t--;)if(e[t]){let r=t;for(;!a[r];)r-=1;try{return{idx:r+1,node:{node:await e[t](),loader:e[t],data:{},server:null,universal:null}}}catch{continue}}}async function Lt({status:t,error:a,url:e,route:r}){const n={};let o=null;try{const s=await Rt({loader:ht,url:e,params:n,route:r,parent:()=>Promise.resolve({}),server_data_node:xt(o)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return nt({url:e,params:n,branch:[s,i],status:t,error:a,route:null})}catch(s){if(s instanceof vt)return Gt(new URL(s.location,location.href),{},0);throw s}}async function Ae(t){const a=t.href;if(G.has(a))return G.get(a);let e;try{const r=(async()=>{let n=await E.hooks.reroute({url:new URL(t),fetch:async(o,s)=>Se(o,s,t).promise})??t;if(typeof n=="string"){const o=new URL(t);E.hash?o.hash=n:o.pathname=n,n=o}return n})();G.set(a,r),e=await r}catch{G.delete(a);return}return e}async function ot(t,a){if(t&&!_t(t,L,E.hash)){const e=await Ae(t);if(!e)return;const r=Pe(e);for(const n of kt){const o=n.exec(r);if(o)return{id:rt(t),invalidating:a,route:n,params:re(o),url:t}}}}function Pe(t){return ie(E.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(L.length))||"/"}function rt(t){return(E.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Qt({url:t,type:a,intent:e,delta:r,event:n,scroll:o}){let s=!1;const i=Ut(m,e,t,a,o??null);r!==void 0&&(i.navigation.delta=r),n!==void 0&&(i.navigation.event=n);const c={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return H||Vt.forEach(l=>l(c)),s?null:i}async function D({type:t,url:a,popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s={},redirect_count:i=0,nav_token:c={},accept:l=Tt,block:h=Tt,event:u}){var C;const w=O;O=c;const f=await ot(a,!1),d=t==="enter"?Ut(m,f,a,t):Qt({url:a,type:t,delta:e==null?void 0:e.delta,intent:f,scroll:e==null?void 0:e.scroll,event:u});if(!d){h(),O===c&&(O=w);return}const _=b,g=R;l(),H=!0,et&&d.navigation.type!=="enter"&&P.navigating.set(ft.current=d.navigation);let p=f&&await Xt(f);if(!p){if(_t(a,L,E.hash))return await B(a,o);p=await Zt(a,{id:null},await Y(new yt(404,"Not Found",`Not found: ${a.pathname}`),{url:a,params:{},route:{id:null}}),404,o)}if(a=(f==null?void 0:f.url)||a,O!==c)return d.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await D({type:t,url:new URL(p.location,a),popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s,redirect_count:i+1,nav_token:c}),d.fulfil(void 0);return}p=await Lt({status:500,error:await Y(new Error("Redirect loop"),{url:a,params:{},route:{id:null}}),url:a,route:{id:null}})}else p.props.page.status>=400&&await P.updated.check()&&(await Mt(),await B(a,o));if(Ee(),Et(_),zt(g),p.props.page.url.pathname!==a.pathname&&(a.pathname=p.props.page.url.pathname),s=e?e.state:s,!e){const k=o?0:1,W={[N]:b+=k,[M]:R+=k,[Dt]:s};(o?history.replaceState:history.pushState).call(history,W,"",a),o||ye(b,R)}const y=f&&(v==null?void 0:v.id)===f.id?v.fork:null;v=null,p.props.page.state=s;let S;if(et){const k=(await Promise.all(Array.from(be,$=>$(d.navigation)))).filter($=>typeof $=="function");if(k.length>0){let $=function(){k.forEach(st=>{F.delete(st)})};k.push($),k.forEach(st=>{F.add(st)})}m=p.state,p.props.page&&(p.props.page.url=a);const W=y&&await y;W?S=W.commit():(Yt.$set(p.props),fe(p.props.page),S=(C=ee)==null?void 0:C()),Ht=!0}else await Jt(p,dt,!1);const{activeElement:A}=document;await S,await J(),await J();let T=null;if(Ot){const k=e?e.scroll:n?j():null;k?scrollTo(k.x,k.y):(T=a.hash&&document.getElementById(te(a)))?T.scrollIntoView():scrollTo(0,0)}const z=document.activeElement!==A&&document.activeElement!==document.body;!r&&!z&&$e(a,!T),Ot=!0,p.props.page&&Object.assign(x,p.props.page),H=!1,t==="popstate"&&Wt(R),d.fulfil(void 0),d.navigation.to&&(d.navigation.to.scroll=j()),F.forEach(k=>k(d.navigation)),P.navigating.set(ft.current=null)}async function Zt(t,a,e,r,n){return t.origin===$t&&t.pathname===location.pathname&&!Bt?await Lt({status:r,error:e,url:t,route:a}):await B(t,n)}function Ie(){let t,a={element:void 0,href:void 0},e;U.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(t),t=setTimeout(()=>{o(c,q.hover)},20)});function r(i){i.defaultPrevented||o(i.composedPath()[0],q.tap)}U.addEventListener("mousedown",r),U.addEventListener("touchstart",r,{passive:!0});const n=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(lt(new URL(c.target.href)),n.unobserve(c.target))},{threshold:0});async function o(i,c){const l=Nt(i,U),h=l===a.element&&(l==null?void 0:l.href)===a.href&&c>=e;if(!l||h)return;const{url:u,external:w,download:f}=ut(l,L,E.hash);if(w||f)return;const d=X(l),_=u&&rt(m.url)===rt(u);if(!(d.reload||_))if(c<=d.preload_data){a={element:l,href:l.href},e=q.tap;const g=await ot(u,!1);if(!g)return;ke(g)}else c<=d.preload_code&&(a={element:l,href:l.href},e=c,lt(u))}function s(){n.disconnect();for(const i of U.querySelectorAll("a")){const{url:c,external:l,download:h}=ut(i,L,E.hash);if(l||h)continue;const u=X(i);u.reload||(u.preload_code===q.viewport&&n.observe(i),u.preload_code===q.eager&&lt(c))}}F.add(s),s()}function Y(t,a){if(t instanceof wt)return t.body;const e=bt(t),r=we(t);return E.hooks.handleError({error:t,event:a,status:e,message:r})??{message:r}}function Me(t,a={}){return t=new URL(mt(t)),t.origin!==$t?Promise.reject(new Error("goto: invalid URL")):Gt(t,a,0)}function Te(t){if(typeof t=="function")Z.push(t);else{const{href:a}=new URL(t,location.href);Z.push(e=>e.href===a)}}function Oe(){var a;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Ct(),!H){const n=Ut(m,void 0,null,"leave"),o={...n.navigation,cancel:()=>{r=!0,n.reject(new Error("navigation cancelled"))}};Vt.forEach(s=>s(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ct()}),(a=navigator.connection)!=null&&a.saveData||Ie(),U.addEventListener("click",async e=>{if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Nt(e.composedPath()[0],U);if(!r)return;const{url:n,external:o,target:s,download:i}=ut(r,L,E.hash);if(!n)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=X(r);if(!(r instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[h,u]=(E.hash?n.hash.replace(/^#/,""):n.href).split("#"),w=h===it(location);if(o||c.reload&&(!w||!u)){Qt({url:n,type:"link",event:e})?H=!0:e.preventDefault();return}if(u!==void 0&&w){const[,f]=m.url.href.split("#");if(f===u){if(e.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(K=!0,Et(b),t(n),!c.replace_state)return;K=!1}e.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await D({type:"link",url:n,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??n.href===location.href,event:e})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if(((n==null?void 0:n.formTarget)||r.target)==="_blank"||((n==null?void 0:n.formMethod)||r.method)!=="get")return;const i=new URL((n==null?void 0:n.hasAttribute("formaction"))&&(n==null?void 0:n.formAction)||r.action);if(_t(i,L,!1))return;const c=e.target,l=X(c);if(l.reload)return;e.preventDefault(),e.stopPropagation();const h=new FormData(c,n);i.search=new URLSearchParams(h).toString(),D({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:e})}),addEventListener("popstate",async e=>{var r;if(!gt){if((r=e.state)!=null&&r[N]){const n=e.state[N];if(O={},n===b)return;const o=I[n],s=e.state[Dt]??{},i=new URL(e.state[ne]??location.href),c=e.state[M],l=m.url?it(location)===it(m.url):!1;if(c===R&&(Ht||l)){s!==x.state&&(x.state=s),t(i),I[b]=j(),o&&scrollTo(o.x,o.y),b=n;return}const u=n-b;await D({type:"popstate",url:i,popped:{state:s,scroll:o,delta:u},accept:()=>{b=n,R=c},block:()=>{history.go(-u)},nav_token:O,event:e})}else if(!K){const n=new URL(location.href);t(n),E.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[N]:++b,[M]:R},"",location.href))});for(const e of document.querySelectorAll("link"))ve.has(e.rel)&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&P.navigating.set(ft.current=null)});function t(e){m.url=x.url=e,P.page.set(At(x)),P.page.notify()}}async function je(t,{status:a=200,error:e,node_ids:r,params:n,route:o,server_route:s,data:i,form:c}){Bt=!0;const l=new URL(location.href);let h;({params:n={},route:o={id:null}}=await ot(l,!1)||{}),h=kt.find(({id:f})=>f===o.id);let u,w=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=Ce(p.uses)),Rt({loader:E.nodes[_],url:l,params:n,route:o,parent:async()=>{const y={};for(let S=0;S<g;S+=1)Object.assign(y,(await f[S]).data);return y},server_data_node:xt(p)})}),d=await Promise.all(f);if(h){const _=h.layouts;for(let g=0;g<_.length;g++)_[g]||d.splice(g,0,void 0)}u=nt({url:l,params:n,branch:d,status:a,error:e,form:c,route:h??null})}catch(f){if(f instanceof vt){await B(new URL(f.location,location.href));return}u=await Lt({status:bt(f),error:await Y(f,{url:l,params:n,route:o}),url:l,route:o}),t.textContent="",w=!1}u.props.page&&(u.props.page.state={}),await Jt(u,t,w)}function Ce(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}let gt=!1;function $e(t,a=!0){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const r=te(t);if(r&&document.getElementById(r)){const{x:o,y:s}=j();setTimeout(()=>{const i=history.state;gt=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),a&&scrollTo(o,s),gt=!1})}else{const o=document.body,s=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),s!==null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex")}const n=getSelection();if(n&&n.type!=="None"){const o=[];for(let s=0;s<n.rangeCount;s+=1)o.push(n.getRangeAt(s));setTimeout(()=>{if(n.rangeCount===o.length){for(let s=0;s<n.rangeCount;s+=1){const i=o[s],c=n.getRangeAt(s);if(i.commonAncestorContainer!==c.commonAncestorContainer||i.startContainer!==c.startContainer||i.endContainer!==c.endContainer||i.startOffset!==c.startOffset||i.endOffset!==c.endOffset)return}n.removeAllRanges()}})}}}function Ut(t,a,e,r,n=null){var l,h;let o,s;const i=new Promise((u,w)=>{o=u,s=w});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:t.url,scroll:j()},to:e&&{params:(a==null?void 0:a.params)??null,route:{id:((h=a==null?void 0:a.route)==null?void 0:h.id)??null},url:e,scroll:n},willUnload:!a,type:r,complete:i},fulfil:o,reject:s}}function At(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function Ne(t){const a=new URL(t);return a.hash=decodeURIComponent(t.hash),a}function te(t){let a;if(E.hash){const[,,e]=t.hash.split("#",3);a=e??""}else a=t.hash.slice(1);return decodeURIComponent(a)}export{Fe as a,Me as g,P as s};
@@ -1 +0,0 @@
1
- var x=t=>{throw TypeError(t)};var B=(t,e,n)=>e.has(t)||x("Cannot "+n);var a=(t,e,n)=>(B(t,e,"read from private field"),n?n.call(t):e.get(t)),c=(t,e,n)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{w as G,o as I}from"./Bn2NtlTj.js";import{d as u,g as f,b as d}from"./BdTBlfLy.js";new URL("sveltekit-internal://");function se(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function ae(t){return t.split("%25").map(decodeURI).join("%25")}function oe(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function ie({href:t}){return t.split("#")[0]}function W(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let s=r.length;for(;s;)e=e*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function X(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}const z=window.fetch;window.fetch=(t,e)=>((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&b.delete(U(t)),z(t,e));const b=new Map;function le(t,e){const n=U(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:s,...l}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&b.set(n,{body:s,init:l,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(s=X(s)),Promise.resolve(new Response(s,l))}return window.fetch(t,e)}function ce(t,e,n){if(b.size>0){const r=U(t,n),s=b.get(r);if(s){if(performance.now()<s.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(s.body,s.init);b.delete(r)}}return window.fetch(e,n)}function U(t,e){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(t instanceof Request?t.url:t)}]`;if(e!=null&&e.headers||e!=null&&e.body){const s=[];e.headers&&s.push([...new Headers(e.headers)].join(",")),e.body&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&s.push(e.body),r+=`[data-hash="${W(...s)}"]`}return r}var $;const J=(($=globalThis.__sveltekit_jgts8u)==null?void 0:$.base)??"/admin";var j;const M=((j=globalThis.__sveltekit_jgts8u)==null?void 0:j.assets)??J??"",F="1774791730603",ue="sveltekit:snapshot",fe="sveltekit:scroll",de="sveltekit:states",he="sveltekit:pageurl",ge="sveltekit:history",be="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Y=location.origin;function _e(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function we(){return{x:pageXOffset,y:pageYOffset}}function g(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const L={...N,"":N.hover};function q(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function me(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=q(t)}}function pe(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const s=t instanceof SVGAElement?t.target.baseVal:t.target,l=!r||!!s||Q(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===Y&&t.hasAttribute("download");return{url:r,external:l,target:s,download:o}}function ve(t){let e=null,n=null,r=null,s=null,l=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=g(i,"preload-code")),s===null&&(s=g(i,"preload-data")),e===null&&(e=g(i,"keepfocus")),n===null&&(n=g(i,"noscroll")),l===null&&(l=g(i,"reload")),o===null&&(o=g(i,"replacestate")),i=q(i);function h(K){switch(K){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:L[r??"off"],preload_data:L[s??"off"],keepfocus:h(e),noscroll:h(n),reload:h(l),replace_state:h(o)}}function ye(t){const e=G(t);let n=!0;function r(){n=!0,e.update(o=>o)}function s(o){n=!1,e.set(o)}function l(o){let i;return e.subscribe(h=>{(i===void 0||n&&h!==i)&&o(i=h)})}return{notify:r,set:s,subscribe:l}}const D={v:()=>{}};function Ae(){const{set:t,subscribe:e}=G(!1);let n;async function r(){clearTimeout(n);try{const s=await fetch(`${M}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!s.ok)return!1;const o=(await s.json()).version!==F;return o&&(t(!0),D.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function Q(t,e,n){return t.origin!==Y||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Re(t){}const H=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...H];const Z=new Set([...H]);[...Z];let E,O,T;const ee=I.toString().includes("$$")||/function \w+\(\) \{\}/.test(I.toString());var _,w,m,p,v,y,A,R,C,S,P,k,V;ee?(E={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},O={current:null},T={current:!1}):(E=new(C=class{constructor(){c(this,_,u({}));c(this,w,u(null));c(this,m,u(null));c(this,p,u({}));c(this,v,u({id:null}));c(this,y,u({}));c(this,A,u(-1));c(this,R,u(new URL("https://example.com")))}get data(){return f(a(this,_))}set data(e){d(a(this,_),e)}get form(){return f(a(this,w))}set form(e){d(a(this,w),e)}get error(){return f(a(this,m))}set error(e){d(a(this,m),e)}get params(){return f(a(this,p))}set params(e){d(a(this,p),e)}get route(){return f(a(this,v))}set route(e){d(a(this,v),e)}get state(){return f(a(this,y))}set state(e){d(a(this,y),e)}get status(){return f(a(this,A))}set status(e){d(a(this,A),e)}get url(){return f(a(this,R))}set url(e){d(a(this,R),e)}},_=new WeakMap,w=new WeakMap,m=new WeakMap,p=new WeakMap,v=new WeakMap,y=new WeakMap,A=new WeakMap,R=new WeakMap,C),O=new(P=class{constructor(){c(this,S,u(null))}get current(){return f(a(this,S))}set current(e){d(a(this,S),e)}},S=new WeakMap,P),T=new(V=class{constructor(){c(this,k,u(!1))}get current(){return f(a(this,k))}set current(e){d(a(this,k),e)}},k=new WeakMap,V),D.v=()=>T.current=!0);function Ee(t){Object.assign(E,t)}export{ge as H,be as N,he as P,de as S,ve as a,J as b,ie as c,oe as d,se as e,me as f,pe as g,Ae as h,Q as i,ye as j,N as k,ae as l,ue as m,O as n,Y as o,E as p,ce as q,_e as r,we as s,le as t,fe as u,Ee as v,Re as w};
@@ -1 +0,0 @@
1
- import{a as r}from"../chunks/BaUG2TJ-.js";import{w as t}from"../chunks/qKdzaeX3.js";export{t as load_css,r as start};
@@ -1 +0,0 @@
1
- import{_ as m}from"../chunks/CIOC1v_q.js";export{m as component};