@absolutejs/absolute 0.20.0-beta.181 → 0.20.0-beta.183

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 (126) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/changelog.json +75 -0
  3. package/dist/angular/browser.js +2 -2
  4. package/dist/angular/browser.js.map +4 -4
  5. package/dist/angular/components/constants.js +4 -0
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  7. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  8. package/dist/angular/index.js +520 -84
  9. package/dist/angular/index.js.map +13 -12
  10. package/dist/angular/server.js +520 -84
  11. package/dist/angular/server.js.map +13 -12
  12. package/dist/build.js +452 -85
  13. package/dist/build.js.map +18 -18
  14. package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
  15. package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
  16. package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
  17. package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
  18. package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
  19. package/dist/cli/{build-ptx5a72p.js → build-df81wh71.js} +67 -6
  20. package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
  21. package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
  22. package/dist/cli/{buildReactServerComponents-01s87hnk.js → buildReactServerComponents-k6amghrj.js} +5 -5
  23. package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
  24. package/dist/cli/config/server.js +37 -18
  25. package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
  26. package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
  27. package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
  28. package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
  29. package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
  30. package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
  31. package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
  32. package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
  33. package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
  34. package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
  35. package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
  36. package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
  37. package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
  38. package/dist/cli/{index-jkg2h10c.js → index-3dz754hk.js} +3 -3
  39. package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
  40. package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
  41. package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
  42. package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
  43. package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
  44. package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
  45. package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
  46. package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
  47. package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
  48. package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
  49. package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
  50. package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
  51. package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
  52. package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
  53. package/dist/cli/{index-5w8arh3m.js → index-pq4qqz0r.js} +2 -2
  54. package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
  55. package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
  56. package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
  57. package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
  58. package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
  59. package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
  60. package/dist/cli/index.js +32 -32
  61. package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
  62. package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
  63. package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
  64. package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
  65. package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
  66. package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
  67. package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
  68. package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
  69. package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
  70. package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
  71. package/dist/cli/prerender-26pzynh4.js +13 -0
  72. package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
  73. package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
  74. package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
  75. package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
  76. package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
  77. package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
  78. package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
  79. package/dist/cli/{typecheck-ynzw2eep.js → typecheck-bvm0ndq4.js} +188 -75
  80. package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
  81. package/dist/dev/serverBootstrap.js +8 -2
  82. package/dist/index.js +469 -99
  83. package/dist/index.js.map +20 -20
  84. package/dist/islands/index.js +312 -23
  85. package/dist/islands/index.js.map +5 -5
  86. package/dist/mobile/index.js +2 -2
  87. package/dist/mobile/index.js.map +3 -3
  88. package/dist/react/browser.js +18 -1
  89. package/dist/react/browser.js.map +6 -4
  90. package/dist/react/components/index.js +2 -2
  91. package/dist/react/components/index.js.map +3 -3
  92. package/dist/react/index.js +370 -62
  93. package/dist/react/index.js.map +14 -13
  94. package/dist/react/server.js +51 -36
  95. package/dist/react/server.js.map +10 -10
  96. package/dist/src/angular/colocatedRouteMatch.d.ts +23 -0
  97. package/dist/src/angular/components/constants.d.ts +1 -0
  98. package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
  99. package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
  100. package/dist/src/cli/scripts/typecheck.d.ts +1 -0
  101. package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +41 -0
  102. package/dist/src/constants.d.ts +1 -0
  103. package/dist/src/core/prerender.d.ts +10 -0
  104. package/dist/src/dev/hot/analyze.d.ts +1 -1
  105. package/dist/src/react/browser.d.ts +1 -0
  106. package/dist/src/react/index.d.ts +1 -0
  107. package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
  108. package/dist/src/utils/pageCspNonce.d.ts +14 -0
  109. package/dist/src/utils/spaRouteManifest.d.ts +1 -0
  110. package/dist/svelte/index.js +372 -69
  111. package/dist/svelte/index.js.map +11 -11
  112. package/dist/svelte/server.js +363 -60
  113. package/dist/svelte/server.js.map +11 -11
  114. package/dist/types/manifest.d.ts +3 -2
  115. package/dist/types/svelte.d.ts +3 -0
  116. package/dist/vue/components/Image.js +2 -2
  117. package/dist/vue/components/Image.js.map +3 -3
  118. package/dist/vue/components/index.js +2 -2
  119. package/dist/vue/components/index.js.map +3 -3
  120. package/dist/vue/index.js +364 -61
  121. package/dist/vue/index.js.map +11 -11
  122. package/dist/vue/server.js +54 -40
  123. package/dist/vue/server.js.map +9 -9
  124. package/package.json +1 -1
  125. package/dist/cli/prerender-w65xp6h8.js +0 -11
  126. /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
package/dist/vue/index.js CHANGED
@@ -72,6 +72,26 @@ var __esm = (fn, res, err) => () => {
72
72
  };
73
73
  var __require = import.meta.require;
74
74
 
75
+ // src/constants.ts
76
+ var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTML_CONTENT_TYPE = "text/html; charset=utf-8", HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
77
+ var init_constants = __esm(() => {
78
+ TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
79
+ IMAGE_DEFAULT_DEVICE_SIZES = [
80
+ 640,
81
+ 750,
82
+ 828,
83
+ 1080,
84
+ 1200,
85
+ 1920,
86
+ 2048,
87
+ 3840
88
+ ];
89
+ IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
90
+ MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
91
+ MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
92
+ TWO_THIRDS = 2 / 3;
93
+ });
94
+
75
95
  // src/utils/escapeScriptContent.ts
76
96
  var ESCAPE_LOOKUP, ESCAPE_REGEX, escapeScriptContent = (content) => content.replace(ESCAPE_REGEX, (char) => {
77
97
  const escaped = ESCAPE_LOOKUP[char];
@@ -401,7 +421,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
401
421
  nonce: readCspNonce()
402
422
  });
403
423
  return new Response(stream, {
404
- headers: { "Content-Type": "text/html" },
424
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
405
425
  status: 500
406
426
  });
407
427
  }, renderSvelteError = async (conventionPath, errorProps) => {
@@ -417,7 +437,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
417
437
  });
418
438
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
419
439
  return new Response(html, {
420
- headers: { "Content-Type": "text/html" },
440
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
421
441
  status: 500
422
442
  });
423
443
  }, unescapeVueStyles = (ssrBody) => {
@@ -441,7 +461,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
441
461
  const { styles, body } = unescapeVueStyles(rawBody);
442
462
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
443
463
  return new Response(html, {
444
- headers: { "Content-Type": "text/html" },
464
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
445
465
  status: 500
446
466
  });
447
467
  }, renderAngularError = async (conventionPath, errorProps) => {
@@ -451,14 +471,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
451
471
  return null;
452
472
  const html = renderFn(errorProps);
453
473
  return new Response(html, {
454
- headers: { "Content-Type": "text/html" },
474
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
455
475
  status: 500
456
476
  });
457
477
  }, escapeHtml = (value) => value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), replaceErrorTokens = (template, errorProps) => template.replace(/\{\{\s*name\s*\}\}/g, escapeHtml(errorProps.name)).replace(/\{\{\s*message\s*\}\}/g, escapeHtml(errorProps.message)).replace(/\{\{\s*stack\s*\}\}/g, errorProps.stack ? escapeHtml(errorProps.stack) : ""), renderHtmlError = async (conventionPath, errorProps) => {
458
478
  const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
459
479
  const html = replaceErrorTokens(template, errorProps);
460
480
  return new Response(html, {
461
- headers: { "Content-Type": "text/html" },
481
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
462
482
  status: 500
463
483
  });
464
484
  }, logConventionRenderError = (framework, label, renderError) => {
@@ -537,7 +557,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
537
557
  nonce: readCspNonce()
538
558
  });
539
559
  return new Response(stream, {
540
- headers: { "Content-Type": "text/html" },
560
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
541
561
  status: 404
542
562
  });
543
563
  }, renderSvelteNotFound = async (conventionPath) => {
@@ -550,7 +570,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
550
570
  const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
551
571
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
552
572
  return new Response(html, {
553
- headers: { "Content-Type": "text/html" },
573
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
554
574
  status: 404
555
575
  });
556
576
  }, renderVueNotFound = async (conventionPath) => {
@@ -567,7 +587,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
567
587
  const { styles, body } = unescapeVueStyles(rawBody);
568
588
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
569
589
  return new Response(html, {
570
- headers: { "Content-Type": "text/html" },
590
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
571
591
  status: 404
572
592
  });
573
593
  }, renderAngularNotFound = async (conventionPath) => {
@@ -577,13 +597,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
577
597
  return null;
578
598
  const html = renderFn();
579
599
  return new Response(html, {
580
- headers: { "Content-Type": "text/html" },
600
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
581
601
  status: 404
582
602
  });
583
603
  }, renderHtmlNotFound = async (conventionPath) => {
584
604
  const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
585
605
  return new Response(html, {
586
- headers: { "Content-Type": "text/html" },
606
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
587
607
  status: 404
588
608
  });
589
609
  }, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
@@ -617,6 +637,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
617
637
  return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
618
638
  };
619
639
  var init_resolveConvention = __esm(() => {
640
+ init_constants();
620
641
  init_cspNonceRef();
621
642
  init_staticHtmlNonce();
622
643
  init_ssrErrorPage();
@@ -649,6 +670,7 @@ var init_resolveConvention = __esm(() => {
649
670
  });
650
671
 
651
672
  // src/utils/spaRouteManifest.ts
673
+ import { NotFound } from "elysia";
652
674
  import { basename as basename2 } from "path";
653
675
  var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
654
676
  Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
@@ -713,7 +735,14 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
713
735
  }, renderSpaNotFound = async (framework, pageName, request) => {
714
736
  if (isKnownSpaRoute(framework, pageName, request))
715
737
  return null;
716
- return await renderFirstNotFound() ?? new Response("Not found", {
738
+ return renderSpaNotFoundResponse(request);
739
+ }, renderSpaNotFoundResponse = async (request) => {
740
+ if (request && !isPageRequest(request)) {
741
+ return new NotFound().toResponse();
742
+ }
743
+ return await renderFirstNotFound({
744
+ preferHtmx: request?.headers.get("hx-request") === "true"
745
+ }) ?? new Response("Not found", {
717
746
  headers: { "Content-Type": "text/plain" },
718
747
  status: 404
719
748
  });
@@ -722,26 +751,6 @@ var init_spaRouteManifest = __esm(() => {
722
751
  init_resolveConvention();
723
752
  });
724
753
 
725
- // src/constants.ts
726
- var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
727
- var init_constants = __esm(() => {
728
- TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
729
- IMAGE_DEFAULT_DEVICE_SIZES = [
730
- 640,
731
- 750,
732
- 828,
733
- 1080,
734
- 1200,
735
- 1920,
736
- 2048,
737
- 3840
738
- ];
739
- IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
740
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
741
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
742
- TWO_THIRDS = 2 / 3;
743
- });
744
-
745
754
  // src/utils/getDurationString.ts
746
755
  var getDurationString = (duration) => {
747
756
  let durationString;
@@ -1769,14 +1778,14 @@ var init_pageProtocol = __esm(() => {
1769
1778
 
1770
1779
  // src/core/pageResponseCache.ts
1771
1780
  import { createHash } from "crypto";
1772
- var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
1781
+ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
1773
1782
  const headers = new Headers(extra);
1774
1783
  headers.set("content-type", HTML_CONTENT_TYPE);
1775
1784
  headers.set(STREAMING_PAGE_HEADER, "1");
1776
1785
  return headers;
1777
1786
  }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
1778
1787
  const contentType = response.headers.get("content-type") ?? "";
1779
- if (!contentType.includes(HTML_CONTENT_TYPE))
1788
+ if (!contentType.includes(HTML_MEDIA_TYPE))
1780
1789
  return response;
1781
1790
  const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
1782
1791
  if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
@@ -1802,7 +1811,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
1802
1811
  statusText: response.statusText
1803
1812
  });
1804
1813
  };
1805
- var init_pageResponseCache = () => {};
1814
+ var init_pageResponseCache = __esm(() => {
1815
+ init_constants();
1816
+ });
1806
1817
 
1807
1818
  // src/client/streamSwap.ts
1808
1819
  var streamSwapRuntime = () => {
@@ -2254,9 +2265,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
2254
2265
  tail: ""
2255
2266
  };
2256
2267
  };
2257
- const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
2268
+ const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
2258
2269
  if (winner.kind !== "base") {
2259
- return { baseDone: false, baseRead, footer, handled: false, tail };
2270
+ return { baseDone, baseRead, footer, handled: false, tail };
2260
2271
  }
2261
2272
  if (winner.done) {
2262
2273
  return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
@@ -2299,7 +2310,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
2299
2310
  return footer;
2300
2311
  }
2301
2312
  const winner = await Promise.race(racers);
2302
- const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
2313
+ const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
2303
2314
  handleResolvedSlot(controller, slotWinner);
2304
2315
  });
2305
2316
  ({ baseDone, baseRead, footer, tail } = baseWinnerState);
@@ -4038,23 +4049,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4038
4049
  index = markup.indexOf("{", end);
4039
4050
  }
4040
4051
  return tags;
4041
- }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), markupToTemplateLiteral = (markup) => {
4042
- const parts = topLevelTags(markup.trim());
4043
- const trimmed = markup.trim();
4044
- let cursor = 0;
4045
- let literal = "";
4046
- for (const { end, start, text } of parts) {
4047
- literal += escapeTemplateLiteral(trimmed.slice(cursor, start));
4048
- literal += `\${${text.slice(1, -1).trim()}}`;
4049
- cursor = end;
4052
+ }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), HTML_HELPERS = "__absoluteAwaitHtml", AWAIT_SCOPE_CLASS_PLACEHOLDER = "__absoluteAwaitScopeClass__", AWAIT_HTML_HELPERS_SOURCE, applyAwaitScopeClass = (code, scopeClass) => code.replaceAll(AWAIT_SCOPE_CLASS_PLACEHOLDER, scopeClass), createAwaitScopeClassCapture = () => {
4053
+ let scopeClass = "";
4054
+ const cssHash = ({ css, filename, hash }) => {
4055
+ scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
4056
+ return scopeClass;
4057
+ };
4058
+ const apply = (code) => applyAwaitScopeClass(code, scopeClass);
4059
+ return { apply, cssHash };
4060
+ }, BOOLEAN_ATTRIBUTES, DIRECTIVE_ATTRIBUTE_RE, ATTRIBUTE_NAME_END_RE, RAW_TEXT_ELEMENTS, helperCall = (name, ...args) => `\${${HTML_HELPERS}.${name}(${args.join(", ")})}`, SHADOW_VALUE, END_TAG_RE, isShadowAttribute = (name) => !DIRECTIVE_ATTRIBUTE_RE.test(name) && !/^on/i.test(name), pushText = (scan, text) => {
4061
+ scan.literal += escapeTemplateLiteral(text);
4062
+ }, readExpressionTag = (scan) => {
4063
+ const end = findTagEnd(scan.source, scan.index);
4064
+ if (end === -1) {
4065
+ fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
4066
+ }
4067
+ const inner = scan.source.slice(scan.index + 1, end - 1).trim();
4068
+ scan.index = end;
4069
+ return inner;
4070
+ }, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
4071
+ const char = scan.source[scan.index] ?? "";
4072
+ if (quote)
4073
+ return char === quote;
4074
+ return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
4075
+ }, readValueText = (scan, quote) => {
4076
+ const start = scan.index;
4077
+ while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
4078
+ scan.index += 1;
4079
+ }
4080
+ return scan.source.slice(start, scan.index);
4081
+ }, readAttributeValue = (scan) => {
4082
+ const { source } = scan;
4083
+ const quote = source[scan.index];
4084
+ const chunks = [];
4085
+ const isQuoted = quote === '"' || quote === "'";
4086
+ if (isQuoted)
4087
+ scan.index += 1;
4088
+ if (!isQuoted && source[scan.index] === "{") {
4089
+ chunks.push({ code: readExpressionTag(scan) });
4090
+ return chunks;
4091
+ }
4092
+ const valueQuote = isQuoted ? quote : undefined;
4093
+ while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
4094
+ chunks.push({ text: readValueText(scan, valueQuote) });
4095
+ if (source[scan.index] === "{")
4096
+ chunks.push({ code: readExpressionTag(scan) });
4097
+ }
4098
+ if (isQuoted)
4099
+ scan.index += 1;
4100
+ return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
4101
+ }, pushDynamicAttribute = (scan, name, chunks) => {
4102
+ if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
4103
+ failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
4104
+ }
4105
+ const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
4106
+ if (tag && "code" in tag) {
4107
+ failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
4108
+ }
4109
+ if (isShadowAttribute(name))
4110
+ scan.shadow += ` ${name}=${SHADOW_VALUE}`;
4111
+ const isClass = name === "class";
4112
+ if (isClass)
4113
+ scan.hasClass = true;
4114
+ const [only] = chunks;
4115
+ const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
4116
+ if (isClass && chunks.length > 1 && codes.length === chunks.length) {
4117
+ scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
4118
+ return;
4119
+ }
4120
+ if (chunks.length === 1 && only && "code" in only) {
4121
+ const value = `(${only.code})`;
4122
+ if (name === "class")
4123
+ scan.literal += helperCall("class", value);
4124
+ else if (name === "style")
4125
+ scan.literal += helperCall("style", value);
4126
+ else
4127
+ scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
4128
+ return;
4129
+ }
4130
+ pushText(scan, ` ${name}="`);
4131
+ for (const chunk of chunks) {
4132
+ if ("code" in chunk)
4133
+ scan.literal += helperCall("part", `(${chunk.code})`);
4134
+ else
4135
+ pushText(scan, chunk.text.replaceAll('"', "&quot;"));
4136
+ }
4137
+ if (isClass)
4138
+ scan.literal += helperCall("scoped");
4139
+ pushText(scan, '"');
4140
+ }, pushStaticAttribute = (scan, whitespace, name, value) => {
4141
+ if (isShadowAttribute(name))
4142
+ scan.shadow += `${whitespace}${name}=${value}`;
4143
+ if (name !== "class") {
4144
+ pushText(scan, `${whitespace}${name}=${value}`);
4145
+ return;
4146
+ }
4147
+ scan.hasClass = true;
4148
+ const [first = ""] = value;
4149
+ const isQuoted = first === '"' || first === "'";
4150
+ const quote = isQuoted ? first : '"';
4151
+ const classes = isQuoted ? value.slice(1, -1) : value;
4152
+ if (classes === "") {
4153
+ scan.literal += helperCall("class", "''");
4154
+ return;
4155
+ }
4156
+ pushText(scan, `${whitespace}${name}=${quote}${classes}`);
4157
+ scan.literal += helperCall("scoped");
4158
+ pushText(scan, quote);
4159
+ }, readAttributeName = (scan) => {
4160
+ const { source } = scan;
4161
+ const start = scan.index;
4162
+ while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
4163
+ scan.index += 1;
4164
+ }
4165
+ return source.slice(start, scan.index);
4166
+ }, skipWhitespace = (scan) => {
4167
+ const start = scan.index;
4168
+ while (/\s/.test(scan.source[scan.index] ?? ""))
4169
+ scan.index += 1;
4170
+ return scan.source.slice(start, scan.index);
4171
+ }, pushTagExpression = (scan) => {
4172
+ const inner = readExpressionTag(scan);
4173
+ if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
4174
+ failAttribute(scan, `{${inner}} in a start tag`);
4175
+ }
4176
+ pushDynamicAttribute(scan, inner, [{ code: inner }]);
4177
+ }, pushAttribute = (scan) => {
4178
+ const { source } = scan;
4179
+ const whitespace = skipWhitespace(scan);
4180
+ const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
4181
+ const isEnd = scan.index >= source.length;
4182
+ if (isEnd || source.startsWith(closing, scan.index)) {
4183
+ if (!scan.hasClass)
4184
+ scan.literal += helperCall("scope");
4185
+ const tagEnd = isEnd ? "" : closing;
4186
+ pushText(scan, whitespace + tagEnd);
4187
+ scan.shadow += whitespace + (isEnd ? ">" : closing);
4188
+ scan.index += tagEnd.length;
4189
+ return false;
4190
+ }
4191
+ if (source[scan.index] === "{") {
4192
+ pushTagExpression(scan);
4193
+ return true;
4194
+ }
4195
+ const name = readAttributeName(scan);
4196
+ if (!name) {
4197
+ pushText(scan, whitespace + (source[scan.index] ?? ""));
4198
+ scan.index += 1;
4199
+ return true;
4200
+ }
4201
+ const beforeEquals = scan.index;
4202
+ skipWhitespace(scan);
4203
+ if (source[scan.index] !== "=") {
4204
+ scan.index = beforeEquals;
4205
+ pushText(scan, whitespace + name);
4206
+ if (isShadowAttribute(name))
4207
+ scan.shadow += whitespace + name;
4208
+ return true;
4209
+ }
4210
+ scan.index += 1;
4211
+ skipWhitespace(scan);
4212
+ const valueStart = scan.index;
4213
+ const chunks = readAttributeValue(scan);
4214
+ if (chunks.some((chunk) => ("code" in chunk))) {
4215
+ pushDynamicAttribute(scan, name, chunks);
4216
+ return true;
4217
+ }
4218
+ pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
4219
+ return true;
4220
+ }, pushStartTag = (scan) => {
4221
+ const { source } = scan;
4222
+ const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
4223
+ const tagName = nameMatch?.[0] ?? "";
4224
+ pushText(scan, `<${tagName}`);
4225
+ scan.shadow += `<${tagName}`;
4226
+ scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
4227
+ scan.index += 1 + tagName.length;
4228
+ while (pushAttribute(scan))
4229
+ ;
4230
+ return tagName.toLowerCase();
4231
+ }, pushRawText = (scan, tagName, shadowStart) => {
4232
+ const { source } = scan;
4233
+ const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
4234
+ const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
4235
+ const end = closeEnd === -1 ? source.length : closeEnd + 1;
4236
+ pushText(scan, source.slice(scan.index, end));
4237
+ scan.shadow = scan.shadow.slice(0, shadowStart);
4238
+ scan.index = end;
4239
+ }, pushTextExpression = (scan) => {
4240
+ const inner = readExpressionTag(scan);
4241
+ const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
4242
+ if (rawHtml) {
4243
+ scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
4244
+ return;
4245
+ }
4246
+ scan.literal += helperCall("text", `(${inner})`);
4247
+ }, pushComment = (scan) => {
4248
+ const close = scan.source.indexOf("-->", scan.index + "<!--".length);
4249
+ const end = close === -1 ? scan.source.length : close + "-->".length;
4250
+ pushText(scan, scan.source.slice(scan.index, end));
4251
+ scan.index = end;
4252
+ }, scanTextPosition = (scan) => {
4253
+ const { index, source } = scan;
4254
+ if (source.startsWith("<!--", index)) {
4255
+ pushComment(scan);
4256
+ return;
4257
+ }
4258
+ if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
4259
+ const shadowStart = scan.shadow.length;
4260
+ const tagName = pushStartTag(scan);
4261
+ if (RAW_TEXT_ELEMENTS.has(tagName))
4262
+ pushRawText(scan, tagName, shadowStart);
4263
+ return;
4050
4264
  }
4051
- literal += escapeTemplateLiteral(trimmed.slice(cursor));
4052
- return `\`${literal}\``;
4265
+ if (source[index] === "{") {
4266
+ pushTextExpression(scan);
4267
+ return;
4268
+ }
4269
+ const next = source.slice(index + 1).search(/[<{]/);
4270
+ const end = next === -1 ? source.length : index + 1 + next;
4271
+ const text = source.slice(index, end);
4272
+ pushText(scan, text);
4273
+ scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
4274
+ scan.index = end;
4275
+ }, lowerBranch = (markup, branch, filePath) => {
4276
+ const scan = {
4277
+ branch,
4278
+ filePath,
4279
+ hasClass: false,
4280
+ index: 0,
4281
+ literal: "",
4282
+ shadow: "",
4283
+ source: markup.trim()
4284
+ };
4285
+ while (scan.index < scan.source.length)
4286
+ scanTextPosition(scan);
4287
+ return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
4053
4288
  }, fail = (filePath, message) => {
4054
4289
  throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
4055
4290
  }, assertPlainHtml = (markup, branch, filePath) => {
4056
4291
  const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
4057
- const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[#:/@]/.test(text));
4292
+ const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
4058
4293
  if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
4059
4294
  fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
4060
4295
  }
@@ -4098,12 +4333,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4098
4333
  thenIdentifier: thenMatch?.[2],
4099
4334
  thenMarkup
4100
4335
  };
4101
- }, renderSlot = (block, slotId, dynamic) => {
4336
+ }, renderSlot = (block, slotId, dynamic, filePath) => {
4102
4337
  const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
4103
4338
  const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
4104
- const catchBranch = block.catchMarkup === undefined ? "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }" : `catch (${catchValueIdentifier}) { return ${markupToTemplateLiteral(block.catchMarkup)}; }`;
4105
- return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${markupToTemplateLiteral(block.pendingMarkup)}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${markupToTemplateLiteral(block.thenMarkup)}; } ${catchBranch} }} />`;
4106
- }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', lowerSvelteAwaitSlotSyntax = (source, filePath) => {
4339
+ const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
4340
+ const then = lowerBranch(block.thenMarkup, "then", filePath);
4341
+ const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
4342
+ const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
4343
+ const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
4344
+ return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${pending.literal}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${then.literal}; } ${catchBranch} }} />{#if ${HTML_HELPERS}.shadow}${shadows}{/if}`;
4345
+ }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
4107
4346
  if (!source.includes("absolute:stream")) {
4108
4347
  return { code: source, transformed: false };
4109
4348
  }
@@ -4118,7 +4357,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4118
4357
  const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
4119
4358
  awaitIndex += 1;
4120
4359
  lowered += source.slice(cursor, directive.index);
4121
- lowered += renderSlot(block, slotId, directive[1] !== undefined);
4360
+ lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
4122
4361
  cursor = block.end;
4123
4362
  }
4124
4363
  if (awaitIndex === 0) {
@@ -4128,14 +4367,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4128
4367
  if (lowered.includes("<script")) {
4129
4368
  return {
4130
4369
  code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
4131
- ${IMPORT_LINE}
4370
+ ${INJECTED_SCRIPT}
4132
4371
  `),
4133
4372
  transformed: true
4134
4373
  };
4135
4374
  }
4136
4375
  return {
4137
4376
  code: `<script lang="ts">
4138
- ${IMPORT_LINE}
4377
+ ${INJECTED_SCRIPT}
4139
4378
  </script>
4140
4379
  ${lowered}`,
4141
4380
  transformed: true
@@ -4147,6 +4386,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
4147
4386
  BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
4148
4387
  SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
4149
4388
  QUOTES = new Set(['"', "'", "`"]);
4389
+ AWAIT_HTML_HELPERS_SOURCE = [
4390
+ `const ${HTML_HELPERS} = (() => {`,
4391
+ ` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
4392
+ ` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&amp;' : char === '"' ? '&quot;' : '&lt;');`,
4393
+ "\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
4394
+ "\tconst classNames = (value) => { if (Array.isArray(value)) return value.filter(Boolean).map(classNames).filter(Boolean).join(' '); if (value && typeof value === 'object') return Object.keys(value).filter((key) => value[key]).join(' '); return typeof value === 'string' || typeof value === 'number' ? String(value) : ''; };",
4395
+ "\treturn {",
4396
+ ` attr: (name, value, isBoolean) => { const boolean = isBoolean || (name === 'hidden' && value !== 'until-found'); if (value == null || (!value && boolean)) return ''; const normalized = name === 'translate' && typeof value === 'boolean' ? (value ? 'yes' : 'no') : value; return boolean ? ' ' + name + '=""' : ' ' + name + '="' + escape(normalized, true) + '"'; },`,
4397
+ ` class: (value) => { const resolved = typeof value === 'object' ? classNames(value) : value ?? ''; let name = '' + resolved; if (scope) name = name ? name + ' ' + scope : scope; return name ? ' class="' + escape(name, true) + '"' : ''; },`,
4398
+ "\t\thtml: (value) => String(value ?? ''),",
4399
+ "\t\tjoin: (...values) => values.map(stringify).join(''),",
4400
+ "\t\tpart: (value) => escape(stringify(value), true),",
4401
+ ` scope: () => scope ? ' class="' + scope + '"' : '',`,
4402
+ "\t\tscoped: () => scope ? ' ' + scope : '',",
4403
+ "\t\tshadow: false,",
4404
+ ` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
4405
+ "\t\ttext: (value) => escape(value, false)",
4406
+ "\t};",
4407
+ "})();"
4408
+ ].join(`
4409
+ `);
4410
+ BOOLEAN_ATTRIBUTES = new Set([
4411
+ "allowfullscreen",
4412
+ "async",
4413
+ "autofocus",
4414
+ "autoplay",
4415
+ "checked",
4416
+ "controls",
4417
+ "default",
4418
+ "defer",
4419
+ "disabled",
4420
+ "disablepictureinpicture",
4421
+ "disableremoteplayback",
4422
+ "formnovalidate",
4423
+ "indeterminate",
4424
+ "inert",
4425
+ "ismap",
4426
+ "loop",
4427
+ "multiple",
4428
+ "muted",
4429
+ "nomodule",
4430
+ "novalidate",
4431
+ "open",
4432
+ "playsinline",
4433
+ "readonly",
4434
+ "required",
4435
+ "reversed",
4436
+ "seamless",
4437
+ "selected",
4438
+ "webkitdirectory"
4439
+ ]);
4440
+ DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
4441
+ ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
4442
+ RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
4443
+ SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
4444
+ END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
4445
+ INJECTED_SCRIPT = `${IMPORT_LINE}
4446
+ ${AWAIT_HTML_HELPERS_SOURCE}`;
4150
4447
  });
4151
4448
 
4152
4449
  // src/build/stylePreprocessor.ts
@@ -4918,15 +5215,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
4918
5215
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
4919
5216
  transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
4920
5217
  }
4921
- let compiledCode = compile(transpiled, {
5218
+ const scopeClass = createAwaitScopeClassCapture();
5219
+ const compiledServer = compile(transpiled, {
4922
5220
  css: "injected",
5221
+ cssHash: scopeClass.cssHash,
4923
5222
  experimental: {
4924
5223
  async: loweredAwaitSource.transformed || loweredSource.transformed
4925
5224
  },
4926
5225
  filename: resolutionSourcePath,
4927
5226
  generate: "server",
4928
5227
  hmr: isDevelopmentRuntime()
4929
- }).js.code;
5228
+ });
5229
+ let compiledCode = scopeClass.apply(compiledServer.js.code);
4930
5230
  for (const [spec, compiledChildPath] of childModulePaths) {
4931
5231
  compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
4932
5232
  }
@@ -5272,6 +5572,9 @@ var init_renderIslandMarkup = __esm(() => {
5272
5572
  });
5273
5573
  });
5274
5574
 
5575
+ // src/vue/pageHandler.ts
5576
+ init_constants();
5577
+
5275
5578
  // src/utils/requestRenderUrl.ts
5276
5579
  var requestRenderUrl = (request) => {
5277
5580
  if (!request)
@@ -5876,7 +6179,7 @@ var handleVuePageRequest = async (input) => {
5876
6179
  };
5877
6180
  if (resolvedPage.hasSpaRoutes && clientMode === "auto") {
5878
6181
  return new Response(`${head}${buildTail()}`, {
5879
- headers: { "Content-Type": "text/html" }
6182
+ headers: { "Content-Type": HTML_CONTENT_TYPE }
5880
6183
  });
5881
6184
  }
5882
6185
  if (resolvedOptions?.collectStreamingSlots !== true) {
@@ -5930,7 +6233,7 @@ var handleVuePageRequest = async (input) => {
5930
6233
  return withPageCacheHeaders(conventionResponse, request);
5931
6234
  }
5932
6235
  return withPageCacheHeaders(new Response(ssrErrorPage("vue", error), {
5933
- headers: { "Content-Type": "text/html" },
6236
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
5934
6237
  status: 500
5935
6238
  }), request);
5936
6239
  }
@@ -7583,5 +7886,5 @@ export {
7583
7886
  useServerData
7584
7887
  };
7585
7888
 
7586
- //# debugId=4BFA73132BAB08F564756E2164756E21
7889
+ //# debugId=0BEAFA186F762F8164756E2164756E21
7587
7890
  //# sourceMappingURL=index.js.map