@absolutejs/absolute 0.20.0-beta.181 → 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 (120) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/changelog.json +54 -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 +344 -48
  9. package/dist/angular/index.js.map +10 -10
  10. package/dist/angular/server.js +344 -48
  11. package/dist/angular/server.js.map +10 -10
  12. package/dist/build.js +431 -78
  13. package/dist/build.js.map +15 -15
  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-ptx5a72p.js → build-p3qra1nj.js} +64 -6
  21. package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
  22. package/dist/cli/{buildReactServerComponents-01s87hnk.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-5w8arh3m.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-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-jkg2h10c.js → index-mmm6d3k5.js} +3 -3
  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-yjme4fv1.js} +36 -14
  80. package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
  81. package/dist/index.js +446 -90
  82. package/dist/index.js.map +17 -17
  83. package/dist/islands/index.js +312 -23
  84. package/dist/islands/index.js.map +5 -5
  85. package/dist/mobile/index.js +2 -2
  86. package/dist/mobile/index.js.map +3 -3
  87. package/dist/react/browser.js +18 -1
  88. package/dist/react/browser.js.map +6 -4
  89. package/dist/react/components/index.js +2 -2
  90. package/dist/react/components/index.js.map +3 -3
  91. package/dist/react/index.js +361 -61
  92. package/dist/react/index.js.map +13 -12
  93. package/dist/react/server.js +42 -35
  94. package/dist/react/server.js.map +9 -9
  95. package/dist/src/angular/components/constants.d.ts +1 -0
  96. package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
  97. package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
  98. package/dist/src/constants.d.ts +1 -0
  99. package/dist/src/core/prerender.d.ts +10 -0
  100. package/dist/src/react/browser.d.ts +1 -0
  101. package/dist/src/react/index.d.ts +1 -0
  102. package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
  103. package/dist/src/utils/pageCspNonce.d.ts +14 -0
  104. package/dist/svelte/index.js +363 -68
  105. package/dist/svelte/index.js.map +10 -10
  106. package/dist/svelte/server.js +354 -59
  107. package/dist/svelte/server.js.map +10 -10
  108. package/dist/types/manifest.d.ts +3 -2
  109. package/dist/types/svelte.d.ts +3 -0
  110. package/dist/vue/components/Image.js +2 -2
  111. package/dist/vue/components/Image.js.map +3 -3
  112. package/dist/vue/components/index.js +2 -2
  113. package/dist/vue/components/index.js.map +3 -3
  114. package/dist/vue/index.js +355 -60
  115. package/dist/vue/index.js.map +10 -10
  116. package/dist/vue/server.js +45 -39
  117. package/dist/vue/server.js.map +8 -8
  118. package/package.json +1 -1
  119. package/dist/cli/prerender-w65xp6h8.js +0 -11
  120. /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
@@ -88,7 +88,7 @@ var ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = "x-skip-transfer-cache", buildAbs
88
88
  };
89
89
 
90
90
  // src/constants.ts
91
- 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;
91
+ 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;
92
92
  var init_constants = __esm(() => {
93
93
  TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
94
94
  IMAGE_DEFAULT_DEVICE_SIZES = [
@@ -865,7 +865,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
865
865
  nonce: readCspNonce()
866
866
  });
867
867
  return new Response(stream, {
868
- headers: { "Content-Type": "text/html" },
868
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
869
869
  status: 500
870
870
  });
871
871
  }, renderSvelteError = async (conventionPath, errorProps) => {
@@ -881,7 +881,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
881
881
  });
882
882
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
883
883
  return new Response(html, {
884
- headers: { "Content-Type": "text/html" },
884
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
885
885
  status: 500
886
886
  });
887
887
  }, unescapeVueStyles = (ssrBody) => {
@@ -905,7 +905,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
905
905
  const { styles, body } = unescapeVueStyles(rawBody);
906
906
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
907
907
  return new Response(html, {
908
- headers: { "Content-Type": "text/html" },
908
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
909
909
  status: 500
910
910
  });
911
911
  }, renderAngularError = async (conventionPath, errorProps) => {
@@ -915,14 +915,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
915
915
  return null;
916
916
  const html = renderFn(errorProps);
917
917
  return new Response(html, {
918
- headers: { "Content-Type": "text/html" },
918
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
919
919
  status: 500
920
920
  });
921
921
  }, 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) => {
922
922
  const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
923
923
  const html = replaceErrorTokens(template, errorProps);
924
924
  return new Response(html, {
925
- headers: { "Content-Type": "text/html" },
925
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
926
926
  status: 500
927
927
  });
928
928
  }, logConventionRenderError = (framework, label, renderError) => {
@@ -1001,7 +1001,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1001
1001
  nonce: readCspNonce()
1002
1002
  });
1003
1003
  return new Response(stream, {
1004
- headers: { "Content-Type": "text/html" },
1004
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
1005
1005
  status: 404
1006
1006
  });
1007
1007
  }, renderSvelteNotFound = async (conventionPath) => {
@@ -1014,7 +1014,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1014
1014
  const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
1015
1015
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
1016
1016
  return new Response(html, {
1017
- headers: { "Content-Type": "text/html" },
1017
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
1018
1018
  status: 404
1019
1019
  });
1020
1020
  }, renderVueNotFound = async (conventionPath) => {
@@ -1031,7 +1031,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1031
1031
  const { styles, body } = unescapeVueStyles(rawBody);
1032
1032
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
1033
1033
  return new Response(html, {
1034
- headers: { "Content-Type": "text/html" },
1034
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
1035
1035
  status: 404
1036
1036
  });
1037
1037
  }, renderAngularNotFound = async (conventionPath) => {
@@ -1041,13 +1041,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1041
1041
  return null;
1042
1042
  const html = renderFn();
1043
1043
  return new Response(html, {
1044
- headers: { "Content-Type": "text/html" },
1044
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
1045
1045
  status: 404
1046
1046
  });
1047
1047
  }, renderHtmlNotFound = async (conventionPath) => {
1048
1048
  const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
1049
1049
  return new Response(html, {
1050
- headers: { "Content-Type": "text/html" },
1050
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
1051
1051
  status: 404
1052
1052
  });
1053
1053
  }, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
@@ -1081,6 +1081,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1081
1081
  return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
1082
1082
  };
1083
1083
  var init_resolveConvention = __esm(() => {
1084
+ init_constants();
1084
1085
  init_cspNonceRef();
1085
1086
  init_staticHtmlNonce();
1086
1087
  init_ssrErrorPage();
@@ -2500,23 +2501,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
2500
2501
  index = markup.indexOf("{", end);
2501
2502
  }
2502
2503
  return tags;
2503
- }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), markupToTemplateLiteral = (markup) => {
2504
- const parts = topLevelTags(markup.trim());
2505
- const trimmed = markup.trim();
2506
- let cursor = 0;
2507
- let literal = "";
2508
- for (const { end, start, text } of parts) {
2509
- literal += escapeTemplateLiteral(trimmed.slice(cursor, start));
2510
- literal += `\${${text.slice(1, -1).trim()}}`;
2511
- cursor = end;
2504
+ }, 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 = () => {
2505
+ let scopeClass = "";
2506
+ const cssHash = ({ css, filename, hash }) => {
2507
+ scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
2508
+ return scopeClass;
2509
+ };
2510
+ const apply = (code) => applyAwaitScopeClass(code, scopeClass);
2511
+ return { apply, cssHash };
2512
+ }, 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) => {
2513
+ scan.literal += escapeTemplateLiteral(text);
2514
+ }, readExpressionTag = (scan) => {
2515
+ const end = findTagEnd(scan.source, scan.index);
2516
+ if (end === -1) {
2517
+ fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
2518
+ }
2519
+ const inner = scan.source.slice(scan.index + 1, end - 1).trim();
2520
+ scan.index = end;
2521
+ return inner;
2522
+ }, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
2523
+ const char = scan.source[scan.index] ?? "";
2524
+ if (quote)
2525
+ return char === quote;
2526
+ return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
2527
+ }, readValueText = (scan, quote) => {
2528
+ const start = scan.index;
2529
+ while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
2530
+ scan.index += 1;
2531
+ }
2532
+ return scan.source.slice(start, scan.index);
2533
+ }, readAttributeValue = (scan) => {
2534
+ const { source } = scan;
2535
+ const quote = source[scan.index];
2536
+ const chunks = [];
2537
+ const isQuoted = quote === '"' || quote === "'";
2538
+ if (isQuoted)
2539
+ scan.index += 1;
2540
+ if (!isQuoted && source[scan.index] === "{") {
2541
+ chunks.push({ code: readExpressionTag(scan) });
2542
+ return chunks;
2543
+ }
2544
+ const valueQuote = isQuoted ? quote : undefined;
2545
+ while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
2546
+ chunks.push({ text: readValueText(scan, valueQuote) });
2547
+ if (source[scan.index] === "{")
2548
+ chunks.push({ code: readExpressionTag(scan) });
2549
+ }
2550
+ if (isQuoted)
2551
+ scan.index += 1;
2552
+ return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
2553
+ }, pushDynamicAttribute = (scan, name, chunks) => {
2554
+ if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
2555
+ failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
2556
+ }
2557
+ const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
2558
+ if (tag && "code" in tag) {
2559
+ failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
2560
+ }
2561
+ if (isShadowAttribute(name))
2562
+ scan.shadow += ` ${name}=${SHADOW_VALUE}`;
2563
+ const isClass = name === "class";
2564
+ if (isClass)
2565
+ scan.hasClass = true;
2566
+ const [only] = chunks;
2567
+ const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
2568
+ if (isClass && chunks.length > 1 && codes.length === chunks.length) {
2569
+ scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
2570
+ return;
2571
+ }
2572
+ if (chunks.length === 1 && only && "code" in only) {
2573
+ const value = `(${only.code})`;
2574
+ if (name === "class")
2575
+ scan.literal += helperCall("class", value);
2576
+ else if (name === "style")
2577
+ scan.literal += helperCall("style", value);
2578
+ else
2579
+ scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
2580
+ return;
2581
+ }
2582
+ pushText(scan, ` ${name}="`);
2583
+ for (const chunk of chunks) {
2584
+ if ("code" in chunk)
2585
+ scan.literal += helperCall("part", `(${chunk.code})`);
2586
+ else
2587
+ pushText(scan, chunk.text.replaceAll('"', "&quot;"));
2588
+ }
2589
+ if (isClass)
2590
+ scan.literal += helperCall("scoped");
2591
+ pushText(scan, '"');
2592
+ }, pushStaticAttribute = (scan, whitespace, name, value) => {
2593
+ if (isShadowAttribute(name))
2594
+ scan.shadow += `${whitespace}${name}=${value}`;
2595
+ if (name !== "class") {
2596
+ pushText(scan, `${whitespace}${name}=${value}`);
2597
+ return;
2598
+ }
2599
+ scan.hasClass = true;
2600
+ const [first = ""] = value;
2601
+ const isQuoted = first === '"' || first === "'";
2602
+ const quote = isQuoted ? first : '"';
2603
+ const classes = isQuoted ? value.slice(1, -1) : value;
2604
+ if (classes === "") {
2605
+ scan.literal += helperCall("class", "''");
2606
+ return;
2607
+ }
2608
+ pushText(scan, `${whitespace}${name}=${quote}${classes}`);
2609
+ scan.literal += helperCall("scoped");
2610
+ pushText(scan, quote);
2611
+ }, readAttributeName = (scan) => {
2612
+ const { source } = scan;
2613
+ const start = scan.index;
2614
+ while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
2615
+ scan.index += 1;
2616
+ }
2617
+ return source.slice(start, scan.index);
2618
+ }, skipWhitespace = (scan) => {
2619
+ const start = scan.index;
2620
+ while (/\s/.test(scan.source[scan.index] ?? ""))
2621
+ scan.index += 1;
2622
+ return scan.source.slice(start, scan.index);
2623
+ }, pushTagExpression = (scan) => {
2624
+ const inner = readExpressionTag(scan);
2625
+ if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
2626
+ failAttribute(scan, `{${inner}} in a start tag`);
2627
+ }
2628
+ pushDynamicAttribute(scan, inner, [{ code: inner }]);
2629
+ }, pushAttribute = (scan) => {
2630
+ const { source } = scan;
2631
+ const whitespace = skipWhitespace(scan);
2632
+ const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
2633
+ const isEnd = scan.index >= source.length;
2634
+ if (isEnd || source.startsWith(closing, scan.index)) {
2635
+ if (!scan.hasClass)
2636
+ scan.literal += helperCall("scope");
2637
+ const tagEnd = isEnd ? "" : closing;
2638
+ pushText(scan, whitespace + tagEnd);
2639
+ scan.shadow += whitespace + (isEnd ? ">" : closing);
2640
+ scan.index += tagEnd.length;
2641
+ return false;
2642
+ }
2643
+ if (source[scan.index] === "{") {
2644
+ pushTagExpression(scan);
2645
+ return true;
2646
+ }
2647
+ const name = readAttributeName(scan);
2648
+ if (!name) {
2649
+ pushText(scan, whitespace + (source[scan.index] ?? ""));
2650
+ scan.index += 1;
2651
+ return true;
2652
+ }
2653
+ const beforeEquals = scan.index;
2654
+ skipWhitespace(scan);
2655
+ if (source[scan.index] !== "=") {
2656
+ scan.index = beforeEquals;
2657
+ pushText(scan, whitespace + name);
2658
+ if (isShadowAttribute(name))
2659
+ scan.shadow += whitespace + name;
2660
+ return true;
2512
2661
  }
2513
- literal += escapeTemplateLiteral(trimmed.slice(cursor));
2514
- return `\`${literal}\``;
2662
+ scan.index += 1;
2663
+ skipWhitespace(scan);
2664
+ const valueStart = scan.index;
2665
+ const chunks = readAttributeValue(scan);
2666
+ if (chunks.some((chunk) => ("code" in chunk))) {
2667
+ pushDynamicAttribute(scan, name, chunks);
2668
+ return true;
2669
+ }
2670
+ pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
2671
+ return true;
2672
+ }, pushStartTag = (scan) => {
2673
+ const { source } = scan;
2674
+ const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
2675
+ const tagName = nameMatch?.[0] ?? "";
2676
+ pushText(scan, `<${tagName}`);
2677
+ scan.shadow += `<${tagName}`;
2678
+ scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
2679
+ scan.index += 1 + tagName.length;
2680
+ while (pushAttribute(scan))
2681
+ ;
2682
+ return tagName.toLowerCase();
2683
+ }, pushRawText = (scan, tagName, shadowStart) => {
2684
+ const { source } = scan;
2685
+ const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
2686
+ const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
2687
+ const end = closeEnd === -1 ? source.length : closeEnd + 1;
2688
+ pushText(scan, source.slice(scan.index, end));
2689
+ scan.shadow = scan.shadow.slice(0, shadowStart);
2690
+ scan.index = end;
2691
+ }, pushTextExpression = (scan) => {
2692
+ const inner = readExpressionTag(scan);
2693
+ const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
2694
+ if (rawHtml) {
2695
+ scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
2696
+ return;
2697
+ }
2698
+ scan.literal += helperCall("text", `(${inner})`);
2699
+ }, pushComment = (scan) => {
2700
+ const close = scan.source.indexOf("-->", scan.index + "<!--".length);
2701
+ const end = close === -1 ? scan.source.length : close + "-->".length;
2702
+ pushText(scan, scan.source.slice(scan.index, end));
2703
+ scan.index = end;
2704
+ }, scanTextPosition = (scan) => {
2705
+ const { index, source } = scan;
2706
+ if (source.startsWith("<!--", index)) {
2707
+ pushComment(scan);
2708
+ return;
2709
+ }
2710
+ if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
2711
+ const shadowStart = scan.shadow.length;
2712
+ const tagName = pushStartTag(scan);
2713
+ if (RAW_TEXT_ELEMENTS.has(tagName))
2714
+ pushRawText(scan, tagName, shadowStart);
2715
+ return;
2716
+ }
2717
+ if (source[index] === "{") {
2718
+ pushTextExpression(scan);
2719
+ return;
2720
+ }
2721
+ const next = source.slice(index + 1).search(/[<{]/);
2722
+ const end = next === -1 ? source.length : index + 1 + next;
2723
+ const text = source.slice(index, end);
2724
+ pushText(scan, text);
2725
+ scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
2726
+ scan.index = end;
2727
+ }, lowerBranch = (markup, branch, filePath) => {
2728
+ const scan = {
2729
+ branch,
2730
+ filePath,
2731
+ hasClass: false,
2732
+ index: 0,
2733
+ literal: "",
2734
+ shadow: "",
2735
+ source: markup.trim()
2736
+ };
2737
+ while (scan.index < scan.source.length)
2738
+ scanTextPosition(scan);
2739
+ return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
2515
2740
  }, fail = (filePath, message) => {
2516
2741
  throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
2517
2742
  }, assertPlainHtml = (markup, branch, filePath) => {
2518
2743
  const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
2519
- const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[#:/@]/.test(text));
2744
+ const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
2520
2745
  if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
2521
2746
  fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
2522
2747
  }
@@ -2560,12 +2785,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
2560
2785
  thenIdentifier: thenMatch?.[2],
2561
2786
  thenMarkup
2562
2787
  };
2563
- }, renderSlot = (block, slotId, dynamic) => {
2788
+ }, renderSlot = (block, slotId, dynamic, filePath) => {
2564
2789
  const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
2565
2790
  const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
2566
- const catchBranch = block.catchMarkup === undefined ? "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }" : `catch (${catchValueIdentifier}) { return ${markupToTemplateLiteral(block.catchMarkup)}; }`;
2567
- return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${markupToTemplateLiteral(block.pendingMarkup)}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${markupToTemplateLiteral(block.thenMarkup)}; } ${catchBranch} }} />`;
2568
- }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', lowerSvelteAwaitSlotSyntax = (source, filePath) => {
2791
+ const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
2792
+ const then = lowerBranch(block.thenMarkup, "then", filePath);
2793
+ const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
2794
+ const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
2795
+ const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
2796
+ 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}`;
2797
+ }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
2569
2798
  if (!source.includes("absolute:stream")) {
2570
2799
  return { code: source, transformed: false };
2571
2800
  }
@@ -2580,7 +2809,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
2580
2809
  const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
2581
2810
  awaitIndex += 1;
2582
2811
  lowered += source.slice(cursor, directive.index);
2583
- lowered += renderSlot(block, slotId, directive[1] !== undefined);
2812
+ lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
2584
2813
  cursor = block.end;
2585
2814
  }
2586
2815
  if (awaitIndex === 0) {
@@ -2590,14 +2819,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
2590
2819
  if (lowered.includes("<script")) {
2591
2820
  return {
2592
2821
  code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
2593
- ${IMPORT_LINE}
2822
+ ${INJECTED_SCRIPT}
2594
2823
  `),
2595
2824
  transformed: true
2596
2825
  };
2597
2826
  }
2598
2827
  return {
2599
2828
  code: `<script lang="ts">
2600
- ${IMPORT_LINE}
2829
+ ${INJECTED_SCRIPT}
2601
2830
  </script>
2602
2831
  ${lowered}`,
2603
2832
  transformed: true
@@ -2609,6 +2838,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
2609
2838
  BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
2610
2839
  SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
2611
2840
  QUOTES = new Set(['"', "'", "`"]);
2841
+ AWAIT_HTML_HELPERS_SOURCE = [
2842
+ `const ${HTML_HELPERS} = (() => {`,
2843
+ ` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
2844
+ ` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&amp;' : char === '"' ? '&quot;' : '&lt;');`,
2845
+ "\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
2846
+ "\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) : ''; };",
2847
+ "\treturn {",
2848
+ ` 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) + '"'; },`,
2849
+ ` 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) + '"' : ''; },`,
2850
+ "\t\thtml: (value) => String(value ?? ''),",
2851
+ "\t\tjoin: (...values) => values.map(stringify).join(''),",
2852
+ "\t\tpart: (value) => escape(stringify(value), true),",
2853
+ ` scope: () => scope ? ' class="' + scope + '"' : '',`,
2854
+ "\t\tscoped: () => scope ? ' ' + scope : '',",
2855
+ "\t\tshadow: false,",
2856
+ ` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
2857
+ "\t\ttext: (value) => escape(value, false)",
2858
+ "\t};",
2859
+ "})();"
2860
+ ].join(`
2861
+ `);
2862
+ BOOLEAN_ATTRIBUTES = new Set([
2863
+ "allowfullscreen",
2864
+ "async",
2865
+ "autofocus",
2866
+ "autoplay",
2867
+ "checked",
2868
+ "controls",
2869
+ "default",
2870
+ "defer",
2871
+ "disabled",
2872
+ "disablepictureinpicture",
2873
+ "disableremoteplayback",
2874
+ "formnovalidate",
2875
+ "indeterminate",
2876
+ "inert",
2877
+ "ismap",
2878
+ "loop",
2879
+ "multiple",
2880
+ "muted",
2881
+ "nomodule",
2882
+ "novalidate",
2883
+ "open",
2884
+ "playsinline",
2885
+ "readonly",
2886
+ "required",
2887
+ "reversed",
2888
+ "seamless",
2889
+ "selected",
2890
+ "webkitdirectory"
2891
+ ]);
2892
+ DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
2893
+ ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
2894
+ RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
2895
+ SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
2896
+ END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
2897
+ INJECTED_SCRIPT = `${IMPORT_LINE}
2898
+ ${AWAIT_HTML_HELPERS_SOURCE}`;
2612
2899
  });
2613
2900
 
2614
2901
  // src/build/stylePreprocessor.ts
@@ -3380,15 +3667,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
3380
3667
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
3381
3668
  transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
3382
3669
  }
3383
- let compiledCode = compile(transpiled, {
3670
+ const scopeClass = createAwaitScopeClassCapture();
3671
+ const compiledServer = compile(transpiled, {
3384
3672
  css: "injected",
3673
+ cssHash: scopeClass.cssHash,
3385
3674
  experimental: {
3386
3675
  async: loweredAwaitSource.transformed || loweredSource.transformed
3387
3676
  },
3388
3677
  filename: resolutionSourcePath,
3389
3678
  generate: "server",
3390
3679
  hmr: isDevelopmentRuntime()
3391
- }).js.code;
3680
+ });
3681
+ let compiledCode = scopeClass.apply(compiledServer.js.code);
3392
3682
  for (const [spec, compiledChildPath] of childModulePaths) {
3393
3683
  compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
3394
3684
  }
@@ -4322,14 +4612,14 @@ var init_pageProtocol = __esm(() => {
4322
4612
 
4323
4613
  // src/core/pageResponseCache.ts
4324
4614
  import { createHash } from "crypto";
4325
- var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
4615
+ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
4326
4616
  const headers = new Headers(extra);
4327
4617
  headers.set("content-type", HTML_CONTENT_TYPE);
4328
4618
  headers.set(STREAMING_PAGE_HEADER, "1");
4329
4619
  return headers;
4330
4620
  }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
4331
4621
  const contentType = response.headers.get("content-type") ?? "";
4332
- if (!contentType.includes(HTML_CONTENT_TYPE))
4622
+ if (!contentType.includes(HTML_MEDIA_TYPE))
4333
4623
  return response;
4334
4624
  const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
4335
4625
  if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
@@ -4355,7 +4645,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
4355
4645
  statusText: response.statusText
4356
4646
  });
4357
4647
  };
4358
- var init_pageResponseCache = () => {};
4648
+ var init_pageResponseCache = __esm(() => {
4649
+ init_constants();
4650
+ });
4359
4651
 
4360
4652
  // src/client/streamSwap.ts
4361
4653
  var streamSwapRuntime = () => {
@@ -4807,9 +5099,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
4807
5099
  tail: ""
4808
5100
  };
4809
5101
  };
4810
- const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
5102
+ const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
4811
5103
  if (winner.kind !== "base") {
4812
- return { baseDone: false, baseRead, footer, handled: false, tail };
5104
+ return { baseDone, baseRead, footer, handled: false, tail };
4813
5105
  }
4814
5106
  if (winner.done) {
4815
5107
  return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
@@ -4852,7 +5144,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
4852
5144
  return footer;
4853
5145
  }
4854
5146
  const winner = await Promise.race(racers);
4855
- const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
5147
+ const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
4856
5148
  handleResolvedSlot(controller, slotWinner);
4857
5149
  });
4858
5150
  ({ baseDone, baseRead, footer, tail } = baseWinnerState);
@@ -5215,10 +5507,10 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
5215
5507
  }
5216
5508
  return {
5217
5509
  content: parsedBlock.content.trim(),
5218
- nextIndex: input.keyword === "@placeholder" ? skipWhitespace(input.template, parsedBlock.nextIndex) : parsedBlock.nextIndex
5510
+ nextIndex: input.keyword === "@placeholder" ? skipWhitespace2(input.template, parsedBlock.nextIndex) : parsedBlock.nextIndex
5219
5511
  };
5220
5512
  }, resolveDeferSlotStart = (template, deferIndex, markerCursor) => {
5221
- const nextMarkerCursor = skipWhitespace(template, markerCursor);
5513
+ const nextMarkerCursor = skipWhitespace2(template, markerCursor);
5222
5514
  if (template[nextMarkerCursor] === "{") {
5223
5515
  return {
5224
5516
  changed: false,
@@ -5443,7 +5735,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
5443
5735
  template: resolvedBlockState.template
5444
5736
  };
5445
5737
  }
5446
- const blockContent = parsePlaceholderAndErrorBlocks(template, skipWhitespace(template, resolvedBlock.nextIndex));
5738
+ const blockContent = parsePlaceholderAndErrorBlocks(template, skipWhitespace2(template, resolvedBlock.nextIndex));
5447
5739
  const builtSlot = buildDeferredSlot({
5448
5740
  cursorAfterResolved: blockContent.cursorAfterResolved,
5449
5741
  errorHtml: blockContent.errorHtml,
@@ -5473,14 +5765,14 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
5473
5765
  ({ cursor, depth } = consumed);
5474
5766
  }
5475
5767
  return { content: value.slice(start + 1), nextIndex: value.length };
5476
- }, skipWhitespace = (value, index) => {
5768
+ }, skipWhitespace2 = (value, index) => {
5477
5769
  let cursor = index;
5478
5770
  while (cursor < value.length && /\s/.test(value[cursor] ?? "")) {
5479
5771
  cursor += 1;
5480
5772
  }
5481
5773
  return cursor;
5482
5774
  }, parseOptionalParenthesizedBlock = (value, index) => {
5483
- let cursor = skipWhitespace(value, index);
5775
+ let cursor = skipWhitespace2(value, index);
5484
5776
  if (value[cursor] !== "(") {
5485
5777
  return null;
5486
5778
  }
@@ -5544,7 +5836,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
5544
5836
  return null;
5545
5837
  }
5546
5838
  const blockKeywordCursor = cursorAfterResolved + keyword.length;
5547
- const blockStart = skipWhitespace(template, blockKeywordCursor);
5839
+ const blockStart = skipWhitespace2(template, blockKeywordCursor);
5548
5840
  if (template[blockStart] !== "{") {
5549
5841
  return null;
5550
5842
  }
@@ -6216,7 +6508,7 @@ ${importLine}${source.slice(insertAt)}`;
6216
6508
  const rawExpression = value.slice(interpolationStart + 2, nextCursor - 2).trim();
6217
6509
  const expression = rawExpression.length === 0 ? "''" : rawExpression;
6218
6510
  const expressionLiteral = JSON.stringify(expression);
6219
- parts.push(`\${this.__absoluteDeferResolveTemplateExpression(${expressionLiteral})}`);
6511
+ parts.push(`\${this.__absoluteDeferEscapeHtml(this.__absoluteDeferResolveTemplateExpression(${expressionLiteral}))}`);
6220
6512
  cursor = nextCursor;
6221
6513
  }
6222
6514
  return parts.join("");
@@ -6247,6 +6539,10 @@ ${importLine}${source.slice(insertAt)}`;
6247
6539
  ` + ` return value;
6248
6540
  ` + ` }
6249
6541
 
6542
+ ` + ` __absoluteDeferEscapeHtml(value: string) {
6543
+ ` + ` return value.replace(/[&<>"']/g, (char) => char === '&' ? '&amp;' : char === '<' ? '&lt;' : char === '>' ? '&gt;' : char === '"' ? '&quot;' : '&#39;');
6544
+ ` + ` }
6545
+
6250
6546
  `, buildDeferSlotFields = (slots) => [
6251
6547
  buildDeferSlotTemplateResolver(),
6252
6548
  ...slots.map((slot, index) => {
@@ -7819,7 +8115,7 @@ var buildRuntimeModuleSpecifier = (modulePath, cacheBuster) => {
7819
8115
  var withHtmlContentType = (responseInit = {}) => {
7820
8116
  const headers = new Headers(responseInit.headers);
7821
8117
  if (!headers.has("Content-Type")) {
7822
- headers.set("Content-Type", "text/html");
8118
+ headers.set("Content-Type", HTML_CONTENT_TYPE);
7823
8119
  }
7824
8120
  return { ...responseInit, headers };
7825
8121
  };
@@ -7940,7 +8236,7 @@ var handleAngularPageRequest = async (input) => {
7940
8236
  return withPageCacheHeaders(conventionResponse, request);
7941
8237
  }
7942
8238
  return withPageCacheHeaders(new Response(ssrErrorPage("angular", error), {
7943
- headers: { "Content-Type": "text/html" },
8239
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
7944
8240
  status: 500
7945
8241
  }), request);
7946
8242
  }
@@ -7968,5 +8264,5 @@ export {
7968
8264
  withPendingTask
7969
8265
  };
7970
8266
 
7971
- //# debugId=CF431FA646A483F064756E2164756E21
8267
+ //# debugId=5A89E04D00718BF264756E2164756E21
7972
8268
  //# sourceMappingURL=server.js.map