@absolutejs/absolute 0.20.0-beta.180 → 0.20.0-beta.182

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 (129) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/changelog.json +70 -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 +349 -48
  9. package/dist/angular/index.js.map +11 -11
  10. package/dist/angular/server.js +349 -48
  11. package/dist/angular/server.js.map +11 -11
  12. package/dist/build.js +605 -114
  13. package/dist/build.js.map +20 -20
  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-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
  20. package/dist/cli/{build-fntmf42w.js → build-p3qra1nj.js} +65 -7
  21. package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
  22. package/dist/cli/{buildReactServerComponents-fq6mw10d.js → buildReactServerComponents-vc9hh2rd.js} +5 -5
  23. package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
  24. package/dist/cli/config/server.js +18 -17
  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-9djrap79.js → index-3pz5sjaz.js} +1 -1
  39. package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
  40. package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
  41. package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
  42. package/dist/cli/{index-w79snsxv.js → index-7zwzyymv.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-xf9sfr8a.js → index-fgqh48qr.js} +63 -1
  50. package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
  51. package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
  52. package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
  53. package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
  54. package/dist/cli/{index-x1vvn549.js → index-mmm6d3k5.js} +3 -3
  55. package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
  56. package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
  57. package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
  58. package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
  59. package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
  60. package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
  61. package/dist/cli/index.js +32 -32
  62. package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
  63. package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
  64. package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
  65. package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
  66. package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
  67. package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
  68. package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
  69. package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
  70. package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
  71. package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
  72. package/dist/cli/prerender-26pzynh4.js +13 -0
  73. package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
  74. package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
  75. package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
  76. package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
  77. package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
  78. package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
  79. package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
  80. package/dist/cli/{staticAnalyzeSpaRoutes-2nev05m1.js → staticAnalyzeSpaRoutes-rcc1d3az.js} +3 -1
  81. package/dist/cli/{typecheck-488txsfc.js → typecheck-yjme4fv1.js} +71 -35
  82. package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
  83. package/dist/index.js +620 -126
  84. package/dist/index.js.map +22 -22
  85. package/dist/islands/index.js +312 -23
  86. package/dist/islands/index.js.map +5 -5
  87. package/dist/mobile/index.js +2 -2
  88. package/dist/mobile/index.js.map +3 -3
  89. package/dist/react/browser.js +18 -1
  90. package/dist/react/browser.js.map +6 -4
  91. package/dist/react/components/index.js +2 -2
  92. package/dist/react/components/index.js.map +3 -3
  93. package/dist/react/index.js +366 -61
  94. package/dist/react/index.js.map +14 -13
  95. package/dist/react/server.js +47 -35
  96. package/dist/react/server.js.map +10 -10
  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/angular/staticAnalyzeSpaRoutes.d.ts +9 -0
  100. package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
  101. package/dist/src/cli/scripts/typecheck.d.ts +7 -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/spaRouteRefresh.d.ts +12 -5
  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 +2 -0
  110. package/dist/svelte/components/Image.svelte +1 -1
  111. package/dist/svelte/components/Island.svelte +1 -1
  112. package/dist/svelte/index.js +368 -68
  113. package/dist/svelte/index.js.map +11 -11
  114. package/dist/svelte/router/Router.svelte.d.ts +31 -1
  115. package/dist/svelte/server.js +359 -59
  116. package/dist/svelte/server.js.map +11 -11
  117. package/dist/types/manifest.d.ts +3 -2
  118. package/dist/types/svelte.d.ts +3 -0
  119. package/dist/vue/components/Image.js +2 -2
  120. package/dist/vue/components/Image.js.map +3 -3
  121. package/dist/vue/components/index.js +2 -2
  122. package/dist/vue/components/index.js.map +3 -3
  123. package/dist/vue/index.js +360 -60
  124. package/dist/vue/index.js.map +11 -11
  125. package/dist/vue/server.js +50 -39
  126. package/dist/vue/server.js.map +9 -9
  127. package/package.json +4 -1
  128. package/dist/cli/prerender-w65xp6h8.js +0 -11
  129. /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();
@@ -655,6 +676,11 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
655
676
  }, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
656
677
  const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
657
678
  return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
679
+ }, OBSERVED_SPA_ROUTES_KEY = "__absoluteObservedSpaRoutes", getObservedSpaRoutes = () => {
680
+ const value = Reflect.get(globalThis, OBSERVED_SPA_ROUTES_KEY);
681
+ return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
682
+ }, setObservedSpaRoutes = (hosts) => {
683
+ Reflect.set(globalThis, OBSERVED_SPA_ROUTES_KEY, hosts);
658
684
  }, normalizePath = (path) => {
659
685
  const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
660
686
  const trimmed = withLeadingSlash.replace(/\/+$/, "");
@@ -717,26 +743,6 @@ var init_spaRouteManifest = __esm(() => {
717
743
  init_resolveConvention();
718
744
  });
719
745
 
720
- // src/constants.ts
721
- 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;
722
- var init_constants = __esm(() => {
723
- TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
724
- IMAGE_DEFAULT_DEVICE_SIZES = [
725
- 640,
726
- 750,
727
- 828,
728
- 1080,
729
- 1200,
730
- 1920,
731
- 2048,
732
- 3840
733
- ];
734
- IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
735
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
736
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
737
- TWO_THIRDS = 2 / 3;
738
- });
739
-
740
746
  // src/utils/getDurationString.ts
741
747
  var getDurationString = (duration) => {
742
748
  let durationString;
@@ -1764,14 +1770,14 @@ var init_pageProtocol = __esm(() => {
1764
1770
 
1765
1771
  // src/core/pageResponseCache.ts
1766
1772
  import { createHash } from "crypto";
1767
- var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
1773
+ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
1768
1774
  const headers = new Headers(extra);
1769
1775
  headers.set("content-type", HTML_CONTENT_TYPE);
1770
1776
  headers.set(STREAMING_PAGE_HEADER, "1");
1771
1777
  return headers;
1772
1778
  }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
1773
1779
  const contentType = response.headers.get("content-type") ?? "";
1774
- if (!contentType.includes(HTML_CONTENT_TYPE))
1780
+ if (!contentType.includes(HTML_MEDIA_TYPE))
1775
1781
  return response;
1776
1782
  const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
1777
1783
  if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
@@ -1797,7 +1803,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
1797
1803
  statusText: response.statusText
1798
1804
  });
1799
1805
  };
1800
- var init_pageResponseCache = () => {};
1806
+ var init_pageResponseCache = __esm(() => {
1807
+ init_constants();
1808
+ });
1801
1809
 
1802
1810
  // src/client/streamSwap.ts
1803
1811
  var streamSwapRuntime = () => {
@@ -2249,9 +2257,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
2249
2257
  tail: ""
2250
2258
  };
2251
2259
  };
2252
- const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
2260
+ const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
2253
2261
  if (winner.kind !== "base") {
2254
- return { baseDone: false, baseRead, footer, handled: false, tail };
2262
+ return { baseDone, baseRead, footer, handled: false, tail };
2255
2263
  }
2256
2264
  if (winner.done) {
2257
2265
  return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
@@ -2294,7 +2302,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
2294
2302
  return footer;
2295
2303
  }
2296
2304
  const winner = await Promise.race(racers);
2297
- const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
2305
+ const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
2298
2306
  handleResolvedSlot(controller, slotWinner);
2299
2307
  });
2300
2308
  ({ baseDone, baseRead, footer, tail } = baseWinnerState);
@@ -4033,23 +4041,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4033
4041
  index = markup.indexOf("{", end);
4034
4042
  }
4035
4043
  return tags;
4036
- }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), markupToTemplateLiteral = (markup) => {
4037
- const parts = topLevelTags(markup.trim());
4038
- const trimmed = markup.trim();
4039
- let cursor = 0;
4040
- let literal = "";
4041
- for (const { end, start, text } of parts) {
4042
- literal += escapeTemplateLiteral(trimmed.slice(cursor, start));
4043
- literal += `\${${text.slice(1, -1).trim()}}`;
4044
- cursor = end;
4044
+ }, 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 = () => {
4045
+ let scopeClass = "";
4046
+ const cssHash = ({ css, filename, hash }) => {
4047
+ scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
4048
+ return scopeClass;
4049
+ };
4050
+ const apply = (code) => applyAwaitScopeClass(code, scopeClass);
4051
+ return { apply, cssHash };
4052
+ }, 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) => {
4053
+ scan.literal += escapeTemplateLiteral(text);
4054
+ }, readExpressionTag = (scan) => {
4055
+ const end = findTagEnd(scan.source, scan.index);
4056
+ if (end === -1) {
4057
+ fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
4058
+ }
4059
+ const inner = scan.source.slice(scan.index + 1, end - 1).trim();
4060
+ scan.index = end;
4061
+ return inner;
4062
+ }, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
4063
+ const char = scan.source[scan.index] ?? "";
4064
+ if (quote)
4065
+ return char === quote;
4066
+ return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
4067
+ }, readValueText = (scan, quote) => {
4068
+ const start = scan.index;
4069
+ while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
4070
+ scan.index += 1;
4071
+ }
4072
+ return scan.source.slice(start, scan.index);
4073
+ }, readAttributeValue = (scan) => {
4074
+ const { source } = scan;
4075
+ const quote = source[scan.index];
4076
+ const chunks = [];
4077
+ const isQuoted = quote === '"' || quote === "'";
4078
+ if (isQuoted)
4079
+ scan.index += 1;
4080
+ if (!isQuoted && source[scan.index] === "{") {
4081
+ chunks.push({ code: readExpressionTag(scan) });
4082
+ return chunks;
4083
+ }
4084
+ const valueQuote = isQuoted ? quote : undefined;
4085
+ while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
4086
+ chunks.push({ text: readValueText(scan, valueQuote) });
4087
+ if (source[scan.index] === "{")
4088
+ chunks.push({ code: readExpressionTag(scan) });
4089
+ }
4090
+ if (isQuoted)
4091
+ scan.index += 1;
4092
+ return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
4093
+ }, pushDynamicAttribute = (scan, name, chunks) => {
4094
+ if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
4095
+ failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
4096
+ }
4097
+ const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
4098
+ if (tag && "code" in tag) {
4099
+ failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
4100
+ }
4101
+ if (isShadowAttribute(name))
4102
+ scan.shadow += ` ${name}=${SHADOW_VALUE}`;
4103
+ const isClass = name === "class";
4104
+ if (isClass)
4105
+ scan.hasClass = true;
4106
+ const [only] = chunks;
4107
+ const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
4108
+ if (isClass && chunks.length > 1 && codes.length === chunks.length) {
4109
+ scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
4110
+ return;
4111
+ }
4112
+ if (chunks.length === 1 && only && "code" in only) {
4113
+ const value = `(${only.code})`;
4114
+ if (name === "class")
4115
+ scan.literal += helperCall("class", value);
4116
+ else if (name === "style")
4117
+ scan.literal += helperCall("style", value);
4118
+ else
4119
+ scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
4120
+ return;
4121
+ }
4122
+ pushText(scan, ` ${name}="`);
4123
+ for (const chunk of chunks) {
4124
+ if ("code" in chunk)
4125
+ scan.literal += helperCall("part", `(${chunk.code})`);
4126
+ else
4127
+ pushText(scan, chunk.text.replaceAll('"', "&quot;"));
4128
+ }
4129
+ if (isClass)
4130
+ scan.literal += helperCall("scoped");
4131
+ pushText(scan, '"');
4132
+ }, pushStaticAttribute = (scan, whitespace, name, value) => {
4133
+ if (isShadowAttribute(name))
4134
+ scan.shadow += `${whitespace}${name}=${value}`;
4135
+ if (name !== "class") {
4136
+ pushText(scan, `${whitespace}${name}=${value}`);
4137
+ return;
4138
+ }
4139
+ scan.hasClass = true;
4140
+ const [first = ""] = value;
4141
+ const isQuoted = first === '"' || first === "'";
4142
+ const quote = isQuoted ? first : '"';
4143
+ const classes = isQuoted ? value.slice(1, -1) : value;
4144
+ if (classes === "") {
4145
+ scan.literal += helperCall("class", "''");
4146
+ return;
4147
+ }
4148
+ pushText(scan, `${whitespace}${name}=${quote}${classes}`);
4149
+ scan.literal += helperCall("scoped");
4150
+ pushText(scan, quote);
4151
+ }, readAttributeName = (scan) => {
4152
+ const { source } = scan;
4153
+ const start = scan.index;
4154
+ while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
4155
+ scan.index += 1;
4156
+ }
4157
+ return source.slice(start, scan.index);
4158
+ }, skipWhitespace = (scan) => {
4159
+ const start = scan.index;
4160
+ while (/\s/.test(scan.source[scan.index] ?? ""))
4161
+ scan.index += 1;
4162
+ return scan.source.slice(start, scan.index);
4163
+ }, pushTagExpression = (scan) => {
4164
+ const inner = readExpressionTag(scan);
4165
+ if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
4166
+ failAttribute(scan, `{${inner}} in a start tag`);
4167
+ }
4168
+ pushDynamicAttribute(scan, inner, [{ code: inner }]);
4169
+ }, pushAttribute = (scan) => {
4170
+ const { source } = scan;
4171
+ const whitespace = skipWhitespace(scan);
4172
+ const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
4173
+ const isEnd = scan.index >= source.length;
4174
+ if (isEnd || source.startsWith(closing, scan.index)) {
4175
+ if (!scan.hasClass)
4176
+ scan.literal += helperCall("scope");
4177
+ const tagEnd = isEnd ? "" : closing;
4178
+ pushText(scan, whitespace + tagEnd);
4179
+ scan.shadow += whitespace + (isEnd ? ">" : closing);
4180
+ scan.index += tagEnd.length;
4181
+ return false;
4182
+ }
4183
+ if (source[scan.index] === "{") {
4184
+ pushTagExpression(scan);
4185
+ return true;
4186
+ }
4187
+ const name = readAttributeName(scan);
4188
+ if (!name) {
4189
+ pushText(scan, whitespace + (source[scan.index] ?? ""));
4190
+ scan.index += 1;
4191
+ return true;
4192
+ }
4193
+ const beforeEquals = scan.index;
4194
+ skipWhitespace(scan);
4195
+ if (source[scan.index] !== "=") {
4196
+ scan.index = beforeEquals;
4197
+ pushText(scan, whitespace + name);
4198
+ if (isShadowAttribute(name))
4199
+ scan.shadow += whitespace + name;
4200
+ return true;
4201
+ }
4202
+ scan.index += 1;
4203
+ skipWhitespace(scan);
4204
+ const valueStart = scan.index;
4205
+ const chunks = readAttributeValue(scan);
4206
+ if (chunks.some((chunk) => ("code" in chunk))) {
4207
+ pushDynamicAttribute(scan, name, chunks);
4208
+ return true;
4209
+ }
4210
+ pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
4211
+ return true;
4212
+ }, pushStartTag = (scan) => {
4213
+ const { source } = scan;
4214
+ const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
4215
+ const tagName = nameMatch?.[0] ?? "";
4216
+ pushText(scan, `<${tagName}`);
4217
+ scan.shadow += `<${tagName}`;
4218
+ scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
4219
+ scan.index += 1 + tagName.length;
4220
+ while (pushAttribute(scan))
4221
+ ;
4222
+ return tagName.toLowerCase();
4223
+ }, pushRawText = (scan, tagName, shadowStart) => {
4224
+ const { source } = scan;
4225
+ const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
4226
+ const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
4227
+ const end = closeEnd === -1 ? source.length : closeEnd + 1;
4228
+ pushText(scan, source.slice(scan.index, end));
4229
+ scan.shadow = scan.shadow.slice(0, shadowStart);
4230
+ scan.index = end;
4231
+ }, pushTextExpression = (scan) => {
4232
+ const inner = readExpressionTag(scan);
4233
+ const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
4234
+ if (rawHtml) {
4235
+ scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
4236
+ return;
4237
+ }
4238
+ scan.literal += helperCall("text", `(${inner})`);
4239
+ }, pushComment = (scan) => {
4240
+ const close = scan.source.indexOf("-->", scan.index + "<!--".length);
4241
+ const end = close === -1 ? scan.source.length : close + "-->".length;
4242
+ pushText(scan, scan.source.slice(scan.index, end));
4243
+ scan.index = end;
4244
+ }, scanTextPosition = (scan) => {
4245
+ const { index, source } = scan;
4246
+ if (source.startsWith("<!--", index)) {
4247
+ pushComment(scan);
4248
+ return;
4249
+ }
4250
+ if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
4251
+ const shadowStart = scan.shadow.length;
4252
+ const tagName = pushStartTag(scan);
4253
+ if (RAW_TEXT_ELEMENTS.has(tagName))
4254
+ pushRawText(scan, tagName, shadowStart);
4255
+ return;
4045
4256
  }
4046
- literal += escapeTemplateLiteral(trimmed.slice(cursor));
4047
- return `\`${literal}\``;
4257
+ if (source[index] === "{") {
4258
+ pushTextExpression(scan);
4259
+ return;
4260
+ }
4261
+ const next = source.slice(index + 1).search(/[<{]/);
4262
+ const end = next === -1 ? source.length : index + 1 + next;
4263
+ const text = source.slice(index, end);
4264
+ pushText(scan, text);
4265
+ scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
4266
+ scan.index = end;
4267
+ }, lowerBranch = (markup, branch, filePath) => {
4268
+ const scan = {
4269
+ branch,
4270
+ filePath,
4271
+ hasClass: false,
4272
+ index: 0,
4273
+ literal: "",
4274
+ shadow: "",
4275
+ source: markup.trim()
4276
+ };
4277
+ while (scan.index < scan.source.length)
4278
+ scanTextPosition(scan);
4279
+ return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
4048
4280
  }, fail = (filePath, message) => {
4049
4281
  throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
4050
4282
  }, assertPlainHtml = (markup, branch, filePath) => {
4051
4283
  const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
4052
- const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[#:/@]/.test(text));
4284
+ const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
4053
4285
  if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
4054
4286
  fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
4055
4287
  }
@@ -4093,12 +4325,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4093
4325
  thenIdentifier: thenMatch?.[2],
4094
4326
  thenMarkup
4095
4327
  };
4096
- }, renderSlot = (block, slotId, dynamic) => {
4328
+ }, renderSlot = (block, slotId, dynamic, filePath) => {
4097
4329
  const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
4098
4330
  const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
4099
- const catchBranch = block.catchMarkup === undefined ? "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }" : `catch (${catchValueIdentifier}) { return ${markupToTemplateLiteral(block.catchMarkup)}; }`;
4100
- return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${markupToTemplateLiteral(block.pendingMarkup)}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${markupToTemplateLiteral(block.thenMarkup)}; } ${catchBranch} }} />`;
4101
- }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', lowerSvelteAwaitSlotSyntax = (source, filePath) => {
4331
+ const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
4332
+ const then = lowerBranch(block.thenMarkup, "then", filePath);
4333
+ const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
4334
+ const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
4335
+ const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
4336
+ 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}`;
4337
+ }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
4102
4338
  if (!source.includes("absolute:stream")) {
4103
4339
  return { code: source, transformed: false };
4104
4340
  }
@@ -4113,7 +4349,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4113
4349
  const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
4114
4350
  awaitIndex += 1;
4115
4351
  lowered += source.slice(cursor, directive.index);
4116
- lowered += renderSlot(block, slotId, directive[1] !== undefined);
4352
+ lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
4117
4353
  cursor = block.end;
4118
4354
  }
4119
4355
  if (awaitIndex === 0) {
@@ -4123,14 +4359,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
4123
4359
  if (lowered.includes("<script")) {
4124
4360
  return {
4125
4361
  code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
4126
- ${IMPORT_LINE}
4362
+ ${INJECTED_SCRIPT}
4127
4363
  `),
4128
4364
  transformed: true
4129
4365
  };
4130
4366
  }
4131
4367
  return {
4132
4368
  code: `<script lang="ts">
4133
- ${IMPORT_LINE}
4369
+ ${INJECTED_SCRIPT}
4134
4370
  </script>
4135
4371
  ${lowered}`,
4136
4372
  transformed: true
@@ -4142,6 +4378,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
4142
4378
  BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
4143
4379
  SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
4144
4380
  QUOTES = new Set(['"', "'", "`"]);
4381
+ AWAIT_HTML_HELPERS_SOURCE = [
4382
+ `const ${HTML_HELPERS} = (() => {`,
4383
+ ` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
4384
+ ` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&amp;' : char === '"' ? '&quot;' : '&lt;');`,
4385
+ "\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
4386
+ "\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) : ''; };",
4387
+ "\treturn {",
4388
+ ` 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) + '"'; },`,
4389
+ ` 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) + '"' : ''; },`,
4390
+ "\t\thtml: (value) => String(value ?? ''),",
4391
+ "\t\tjoin: (...values) => values.map(stringify).join(''),",
4392
+ "\t\tpart: (value) => escape(stringify(value), true),",
4393
+ ` scope: () => scope ? ' class="' + scope + '"' : '',`,
4394
+ "\t\tscoped: () => scope ? ' ' + scope : '',",
4395
+ "\t\tshadow: false,",
4396
+ ` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
4397
+ "\t\ttext: (value) => escape(value, false)",
4398
+ "\t};",
4399
+ "})();"
4400
+ ].join(`
4401
+ `);
4402
+ BOOLEAN_ATTRIBUTES = new Set([
4403
+ "allowfullscreen",
4404
+ "async",
4405
+ "autofocus",
4406
+ "autoplay",
4407
+ "checked",
4408
+ "controls",
4409
+ "default",
4410
+ "defer",
4411
+ "disabled",
4412
+ "disablepictureinpicture",
4413
+ "disableremoteplayback",
4414
+ "formnovalidate",
4415
+ "indeterminate",
4416
+ "inert",
4417
+ "ismap",
4418
+ "loop",
4419
+ "multiple",
4420
+ "muted",
4421
+ "nomodule",
4422
+ "novalidate",
4423
+ "open",
4424
+ "playsinline",
4425
+ "readonly",
4426
+ "required",
4427
+ "reversed",
4428
+ "seamless",
4429
+ "selected",
4430
+ "webkitdirectory"
4431
+ ]);
4432
+ DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
4433
+ ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
4434
+ RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
4435
+ SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
4436
+ END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
4437
+ INJECTED_SCRIPT = `${IMPORT_LINE}
4438
+ ${AWAIT_HTML_HELPERS_SOURCE}`;
4145
4439
  });
4146
4440
 
4147
4441
  // src/build/stylePreprocessor.ts
@@ -4913,15 +5207,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
4913
5207
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
4914
5208
  transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
4915
5209
  }
4916
- let compiledCode = compile(transpiled, {
5210
+ const scopeClass = createAwaitScopeClassCapture();
5211
+ const compiledServer = compile(transpiled, {
4917
5212
  css: "injected",
5213
+ cssHash: scopeClass.cssHash,
4918
5214
  experimental: {
4919
5215
  async: loweredAwaitSource.transformed || loweredSource.transformed
4920
5216
  },
4921
5217
  filename: resolutionSourcePath,
4922
5218
  generate: "server",
4923
5219
  hmr: isDevelopmentRuntime()
4924
- }).js.code;
5220
+ });
5221
+ let compiledCode = scopeClass.apply(compiledServer.js.code);
4925
5222
  for (const [spec, compiledChildPath] of childModulePaths) {
4926
5223
  compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
4927
5224
  }
@@ -5267,6 +5564,9 @@ var init_renderIslandMarkup = __esm(() => {
5267
5564
  });
5268
5565
  });
5269
5566
 
5567
+ // src/vue/pageHandler.ts
5568
+ init_constants();
5569
+
5270
5570
  // src/utils/requestRenderUrl.ts
5271
5571
  var requestRenderUrl = (request) => {
5272
5572
  if (!request)
@@ -5871,7 +6171,7 @@ var handleVuePageRequest = async (input) => {
5871
6171
  };
5872
6172
  if (resolvedPage.hasSpaRoutes && clientMode === "auto") {
5873
6173
  return new Response(`${head}${buildTail()}`, {
5874
- headers: { "Content-Type": "text/html" }
6174
+ headers: { "Content-Type": HTML_CONTENT_TYPE }
5875
6175
  });
5876
6176
  }
5877
6177
  if (resolvedOptions?.collectStreamingSlots !== true) {
@@ -5925,7 +6225,7 @@ var handleVuePageRequest = async (input) => {
5925
6225
  return withPageCacheHeaders(conventionResponse, request);
5926
6226
  }
5927
6227
  return withPageCacheHeaders(new Response(ssrErrorPage("vue", error), {
5928
- headers: { "Content-Type": "text/html" },
6228
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
5929
6229
  status: 500
5930
6230
  }), request);
5931
6231
  }
@@ -7578,5 +7878,5 @@ export {
7578
7878
  useServerData
7579
7879
  };
7580
7880
 
7581
- //# debugId=FFAF290D59A1320F64756E2164756E21
7881
+ //# debugId=C1A0F198C7E0FB4A64756E2164756E21
7582
7882
  //# sourceMappingURL=index.js.map