@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
@@ -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/cspNonceRef.ts
76
96
  var GETTER_KEY, nonceAttr = (nonce = readCspNonce()) => nonce ? ` nonce="${nonce}"` : "", nonceSvelteHeadStyles = (head, nonce = readCspNonce()) => nonce ? head.replace(/<style(?=\s+id="svelte-[^"]*")(?![^>]*\snonce=)/g, `<style nonce="${nonce}"`) : head, readCspNonce = () => {
77
97
  const getter = Reflect.get(globalThis, GETTER_KEY);
@@ -103,26 +123,6 @@ var init_escapeScriptContent = __esm(() => {
103
123
  ESCAPE_REGEX = /[<\u2028\u2029]/g;
104
124
  });
105
125
 
106
- // src/constants.ts
107
- 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;
108
- var init_constants = __esm(() => {
109
- TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
110
- IMAGE_DEFAULT_DEVICE_SIZES = [
111
- 640,
112
- 750,
113
- 828,
114
- 1080,
115
- 1200,
116
- 1920,
117
- 2048,
118
- 3840
119
- ];
120
- IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
121
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
122
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
123
- TWO_THIRDS = 2 / 3;
124
- });
125
-
126
126
  // src/utils/getDurationString.ts
127
127
  var getDurationString = (duration) => {
128
128
  let durationString;
@@ -1224,14 +1224,14 @@ var init_pageProtocol = __esm(() => {
1224
1224
 
1225
1225
  // src/core/pageResponseCache.ts
1226
1226
  import { createHash } from "crypto";
1227
- var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
1227
+ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
1228
1228
  const headers = new Headers(extra);
1229
1229
  headers.set("content-type", HTML_CONTENT_TYPE);
1230
1230
  headers.set(STREAMING_PAGE_HEADER, "1");
1231
1231
  return headers;
1232
1232
  }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
1233
1233
  const contentType = response.headers.get("content-type") ?? "";
1234
- if (!contentType.includes(HTML_CONTENT_TYPE))
1234
+ if (!contentType.includes(HTML_MEDIA_TYPE))
1235
1235
  return response;
1236
1236
  const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
1237
1237
  if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
@@ -1257,7 +1257,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
1257
1257
  statusText: response.statusText
1258
1258
  });
1259
1259
  };
1260
- var init_pageResponseCache = () => {};
1260
+ var init_pageResponseCache = __esm(() => {
1261
+ init_constants();
1262
+ });
1261
1263
 
1262
1264
  // src/client/streamSwap.ts
1263
1265
  var streamSwapRuntime = () => {
@@ -1709,9 +1711,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
1709
1711
  tail: ""
1710
1712
  };
1711
1713
  };
1712
- const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
1714
+ const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
1713
1715
  if (winner.kind !== "base") {
1714
- return { baseDone: false, baseRead, footer, handled: false, tail };
1716
+ return { baseDone, baseRead, footer, handled: false, tail };
1715
1717
  }
1716
1718
  if (winner.done) {
1717
1719
  return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
@@ -1754,7 +1756,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
1754
1756
  return footer;
1755
1757
  }
1756
1758
  const winner = await Promise.race(racers);
1757
- const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
1759
+ const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
1758
1760
  handleResolvedSlot(controller, slotWinner);
1759
1761
  });
1760
1762
  ({ baseDone, baseRead, footer, tail } = baseWinnerState);
@@ -2075,7 +2077,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2075
2077
  nonce: readCspNonce()
2076
2078
  });
2077
2079
  return new Response(stream, {
2078
- headers: { "Content-Type": "text/html" },
2080
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2079
2081
  status: 500
2080
2082
  });
2081
2083
  }, renderSvelteError = async (conventionPath, errorProps) => {
@@ -2091,7 +2093,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2091
2093
  });
2092
2094
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
2093
2095
  return new Response(html, {
2094
- headers: { "Content-Type": "text/html" },
2096
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2095
2097
  status: 500
2096
2098
  });
2097
2099
  }, unescapeVueStyles = (ssrBody) => {
@@ -2115,7 +2117,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2115
2117
  const { styles, body } = unescapeVueStyles(rawBody);
2116
2118
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
2117
2119
  return new Response(html, {
2118
- headers: { "Content-Type": "text/html" },
2120
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2119
2121
  status: 500
2120
2122
  });
2121
2123
  }, renderAngularError = async (conventionPath, errorProps) => {
@@ -2125,14 +2127,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2125
2127
  return null;
2126
2128
  const html = renderFn(errorProps);
2127
2129
  return new Response(html, {
2128
- headers: { "Content-Type": "text/html" },
2130
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2129
2131
  status: 500
2130
2132
  });
2131
2133
  }, 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) => {
2132
2134
  const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
2133
2135
  const html = replaceErrorTokens(template, errorProps);
2134
2136
  return new Response(html, {
2135
- headers: { "Content-Type": "text/html" },
2137
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2136
2138
  status: 500
2137
2139
  });
2138
2140
  }, logConventionRenderError = (framework, label, renderError) => {
@@ -2211,7 +2213,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2211
2213
  nonce: readCspNonce()
2212
2214
  });
2213
2215
  return new Response(stream, {
2214
- headers: { "Content-Type": "text/html" },
2216
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2215
2217
  status: 404
2216
2218
  });
2217
2219
  }, renderSvelteNotFound = async (conventionPath) => {
@@ -2224,7 +2226,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2224
2226
  const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
2225
2227
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
2226
2228
  return new Response(html, {
2227
- headers: { "Content-Type": "text/html" },
2229
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2228
2230
  status: 404
2229
2231
  });
2230
2232
  }, renderVueNotFound = async (conventionPath) => {
@@ -2241,7 +2243,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2241
2243
  const { styles, body } = unescapeVueStyles(rawBody);
2242
2244
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
2243
2245
  return new Response(html, {
2244
- headers: { "Content-Type": "text/html" },
2246
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2245
2247
  status: 404
2246
2248
  });
2247
2249
  }, renderAngularNotFound = async (conventionPath) => {
@@ -2251,13 +2253,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2251
2253
  return null;
2252
2254
  const html = renderFn();
2253
2255
  return new Response(html, {
2254
- headers: { "Content-Type": "text/html" },
2256
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2255
2257
  status: 404
2256
2258
  });
2257
2259
  }, renderHtmlNotFound = async (conventionPath) => {
2258
2260
  const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
2259
2261
  return new Response(html, {
2260
- headers: { "Content-Type": "text/html" },
2262
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
2261
2263
  status: 404
2262
2264
  });
2263
2265
  }, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
@@ -2291,6 +2293,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
2291
2293
  return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
2292
2294
  };
2293
2295
  var init_resolveConvention = __esm(() => {
2296
+ init_constants();
2294
2297
  init_cspNonceRef();
2295
2298
  init_staticHtmlNonce();
2296
2299
  init_ssrErrorPage();
@@ -2329,6 +2332,11 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
2329
2332
  }, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
2330
2333
  const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
2331
2334
  return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
2335
+ }, OBSERVED_SPA_ROUTES_KEY = "__absoluteObservedSpaRoutes", getObservedSpaRoutes = () => {
2336
+ const value = Reflect.get(globalThis, OBSERVED_SPA_ROUTES_KEY);
2337
+ return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
2338
+ }, setObservedSpaRoutes = (hosts) => {
2339
+ Reflect.set(globalThis, OBSERVED_SPA_ROUTES_KEY, hosts);
2332
2340
  }, normalizePath = (path) => {
2333
2341
  const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
2334
2342
  const trimmed = withLeadingSlash.replace(/\/+$/, "");
@@ -3761,23 +3769,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
3761
3769
  index = markup.indexOf("{", end);
3762
3770
  }
3763
3771
  return tags;
3764
- }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), markupToTemplateLiteral = (markup) => {
3765
- const parts = topLevelTags(markup.trim());
3766
- const trimmed = markup.trim();
3767
- let cursor = 0;
3768
- let literal = "";
3769
- for (const { end, start, text } of parts) {
3770
- literal += escapeTemplateLiteral(trimmed.slice(cursor, start));
3771
- literal += `\${${text.slice(1, -1).trim()}}`;
3772
- cursor = end;
3772
+ }, 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 = () => {
3773
+ let scopeClass = "";
3774
+ const cssHash = ({ css, filename, hash }) => {
3775
+ scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
3776
+ return scopeClass;
3777
+ };
3778
+ const apply = (code) => applyAwaitScopeClass(code, scopeClass);
3779
+ return { apply, cssHash };
3780
+ }, 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) => {
3781
+ scan.literal += escapeTemplateLiteral(text);
3782
+ }, readExpressionTag = (scan) => {
3783
+ const end = findTagEnd(scan.source, scan.index);
3784
+ if (end === -1) {
3785
+ fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
3786
+ }
3787
+ const inner = scan.source.slice(scan.index + 1, end - 1).trim();
3788
+ scan.index = end;
3789
+ return inner;
3790
+ }, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
3791
+ const char = scan.source[scan.index] ?? "";
3792
+ if (quote)
3793
+ return char === quote;
3794
+ return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
3795
+ }, readValueText = (scan, quote) => {
3796
+ const start = scan.index;
3797
+ while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
3798
+ scan.index += 1;
3799
+ }
3800
+ return scan.source.slice(start, scan.index);
3801
+ }, readAttributeValue = (scan) => {
3802
+ const { source } = scan;
3803
+ const quote = source[scan.index];
3804
+ const chunks = [];
3805
+ const isQuoted = quote === '"' || quote === "'";
3806
+ if (isQuoted)
3807
+ scan.index += 1;
3808
+ if (!isQuoted && source[scan.index] === "{") {
3809
+ chunks.push({ code: readExpressionTag(scan) });
3810
+ return chunks;
3811
+ }
3812
+ const valueQuote = isQuoted ? quote : undefined;
3813
+ while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
3814
+ chunks.push({ text: readValueText(scan, valueQuote) });
3815
+ if (source[scan.index] === "{")
3816
+ chunks.push({ code: readExpressionTag(scan) });
3817
+ }
3818
+ if (isQuoted)
3819
+ scan.index += 1;
3820
+ return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
3821
+ }, pushDynamicAttribute = (scan, name, chunks) => {
3822
+ if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
3823
+ failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
3824
+ }
3825
+ const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
3826
+ if (tag && "code" in tag) {
3827
+ failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
3828
+ }
3829
+ if (isShadowAttribute(name))
3830
+ scan.shadow += ` ${name}=${SHADOW_VALUE}`;
3831
+ const isClass = name === "class";
3832
+ if (isClass)
3833
+ scan.hasClass = true;
3834
+ const [only] = chunks;
3835
+ const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
3836
+ if (isClass && chunks.length > 1 && codes.length === chunks.length) {
3837
+ scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
3838
+ return;
3839
+ }
3840
+ if (chunks.length === 1 && only && "code" in only) {
3841
+ const value = `(${only.code})`;
3842
+ if (name === "class")
3843
+ scan.literal += helperCall("class", value);
3844
+ else if (name === "style")
3845
+ scan.literal += helperCall("style", value);
3846
+ else
3847
+ scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
3848
+ return;
3849
+ }
3850
+ pushText(scan, ` ${name}="`);
3851
+ for (const chunk of chunks) {
3852
+ if ("code" in chunk)
3853
+ scan.literal += helperCall("part", `(${chunk.code})`);
3854
+ else
3855
+ pushText(scan, chunk.text.replaceAll('"', "&quot;"));
3856
+ }
3857
+ if (isClass)
3858
+ scan.literal += helperCall("scoped");
3859
+ pushText(scan, '"');
3860
+ }, pushStaticAttribute = (scan, whitespace, name, value) => {
3861
+ if (isShadowAttribute(name))
3862
+ scan.shadow += `${whitespace}${name}=${value}`;
3863
+ if (name !== "class") {
3864
+ pushText(scan, `${whitespace}${name}=${value}`);
3865
+ return;
3866
+ }
3867
+ scan.hasClass = true;
3868
+ const [first = ""] = value;
3869
+ const isQuoted = first === '"' || first === "'";
3870
+ const quote = isQuoted ? first : '"';
3871
+ const classes = isQuoted ? value.slice(1, -1) : value;
3872
+ if (classes === "") {
3873
+ scan.literal += helperCall("class", "''");
3874
+ return;
3875
+ }
3876
+ pushText(scan, `${whitespace}${name}=${quote}${classes}`);
3877
+ scan.literal += helperCall("scoped");
3878
+ pushText(scan, quote);
3879
+ }, readAttributeName = (scan) => {
3880
+ const { source } = scan;
3881
+ const start = scan.index;
3882
+ while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
3883
+ scan.index += 1;
3884
+ }
3885
+ return source.slice(start, scan.index);
3886
+ }, skipWhitespace = (scan) => {
3887
+ const start = scan.index;
3888
+ while (/\s/.test(scan.source[scan.index] ?? ""))
3889
+ scan.index += 1;
3890
+ return scan.source.slice(start, scan.index);
3891
+ }, pushTagExpression = (scan) => {
3892
+ const inner = readExpressionTag(scan);
3893
+ if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
3894
+ failAttribute(scan, `{${inner}} in a start tag`);
3895
+ }
3896
+ pushDynamicAttribute(scan, inner, [{ code: inner }]);
3897
+ }, pushAttribute = (scan) => {
3898
+ const { source } = scan;
3899
+ const whitespace = skipWhitespace(scan);
3900
+ const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
3901
+ const isEnd = scan.index >= source.length;
3902
+ if (isEnd || source.startsWith(closing, scan.index)) {
3903
+ if (!scan.hasClass)
3904
+ scan.literal += helperCall("scope");
3905
+ const tagEnd = isEnd ? "" : closing;
3906
+ pushText(scan, whitespace + tagEnd);
3907
+ scan.shadow += whitespace + (isEnd ? ">" : closing);
3908
+ scan.index += tagEnd.length;
3909
+ return false;
3910
+ }
3911
+ if (source[scan.index] === "{") {
3912
+ pushTagExpression(scan);
3913
+ return true;
3914
+ }
3915
+ const name = readAttributeName(scan);
3916
+ if (!name) {
3917
+ pushText(scan, whitespace + (source[scan.index] ?? ""));
3918
+ scan.index += 1;
3919
+ return true;
3920
+ }
3921
+ const beforeEquals = scan.index;
3922
+ skipWhitespace(scan);
3923
+ if (source[scan.index] !== "=") {
3924
+ scan.index = beforeEquals;
3925
+ pushText(scan, whitespace + name);
3926
+ if (isShadowAttribute(name))
3927
+ scan.shadow += whitespace + name;
3928
+ return true;
3929
+ }
3930
+ scan.index += 1;
3931
+ skipWhitespace(scan);
3932
+ const valueStart = scan.index;
3933
+ const chunks = readAttributeValue(scan);
3934
+ if (chunks.some((chunk) => ("code" in chunk))) {
3935
+ pushDynamicAttribute(scan, name, chunks);
3936
+ return true;
3937
+ }
3938
+ pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
3939
+ return true;
3940
+ }, pushStartTag = (scan) => {
3941
+ const { source } = scan;
3942
+ const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
3943
+ const tagName = nameMatch?.[0] ?? "";
3944
+ pushText(scan, `<${tagName}`);
3945
+ scan.shadow += `<${tagName}`;
3946
+ scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
3947
+ scan.index += 1 + tagName.length;
3948
+ while (pushAttribute(scan))
3949
+ ;
3950
+ return tagName.toLowerCase();
3951
+ }, pushRawText = (scan, tagName, shadowStart) => {
3952
+ const { source } = scan;
3953
+ const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
3954
+ const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
3955
+ const end = closeEnd === -1 ? source.length : closeEnd + 1;
3956
+ pushText(scan, source.slice(scan.index, end));
3957
+ scan.shadow = scan.shadow.slice(0, shadowStart);
3958
+ scan.index = end;
3959
+ }, pushTextExpression = (scan) => {
3960
+ const inner = readExpressionTag(scan);
3961
+ const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
3962
+ if (rawHtml) {
3963
+ scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
3964
+ return;
3965
+ }
3966
+ scan.literal += helperCall("text", `(${inner})`);
3967
+ }, pushComment = (scan) => {
3968
+ const close = scan.source.indexOf("-->", scan.index + "<!--".length);
3969
+ const end = close === -1 ? scan.source.length : close + "-->".length;
3970
+ pushText(scan, scan.source.slice(scan.index, end));
3971
+ scan.index = end;
3972
+ }, scanTextPosition = (scan) => {
3973
+ const { index, source } = scan;
3974
+ if (source.startsWith("<!--", index)) {
3975
+ pushComment(scan);
3976
+ return;
3977
+ }
3978
+ if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
3979
+ const shadowStart = scan.shadow.length;
3980
+ const tagName = pushStartTag(scan);
3981
+ if (RAW_TEXT_ELEMENTS.has(tagName))
3982
+ pushRawText(scan, tagName, shadowStart);
3983
+ return;
3773
3984
  }
3774
- literal += escapeTemplateLiteral(trimmed.slice(cursor));
3775
- return `\`${literal}\``;
3985
+ if (source[index] === "{") {
3986
+ pushTextExpression(scan);
3987
+ return;
3988
+ }
3989
+ const next = source.slice(index + 1).search(/[<{]/);
3990
+ const end = next === -1 ? source.length : index + 1 + next;
3991
+ const text = source.slice(index, end);
3992
+ pushText(scan, text);
3993
+ scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
3994
+ scan.index = end;
3995
+ }, lowerBranch = (markup, branch, filePath) => {
3996
+ const scan = {
3997
+ branch,
3998
+ filePath,
3999
+ hasClass: false,
4000
+ index: 0,
4001
+ literal: "",
4002
+ shadow: "",
4003
+ source: markup.trim()
4004
+ };
4005
+ while (scan.index < scan.source.length)
4006
+ scanTextPosition(scan);
4007
+ return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
3776
4008
  }, fail = (filePath, message) => {
3777
4009
  throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
3778
4010
  }, assertPlainHtml = (markup, branch, filePath) => {
3779
4011
  const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
3780
- const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[#:/@]/.test(text));
4012
+ const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
3781
4013
  if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
3782
4014
  fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
3783
4015
  }
@@ -3821,12 +4053,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
3821
4053
  thenIdentifier: thenMatch?.[2],
3822
4054
  thenMarkup
3823
4055
  };
3824
- }, renderSlot = (block, slotId, dynamic) => {
4056
+ }, renderSlot = (block, slotId, dynamic, filePath) => {
3825
4057
  const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
3826
4058
  const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
3827
- const catchBranch = block.catchMarkup === undefined ? "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }" : `catch (${catchValueIdentifier}) { return ${markupToTemplateLiteral(block.catchMarkup)}; }`;
3828
- return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${markupToTemplateLiteral(block.pendingMarkup)}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${markupToTemplateLiteral(block.thenMarkup)}; } ${catchBranch} }} />`;
3829
- }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', lowerSvelteAwaitSlotSyntax = (source, filePath) => {
4059
+ const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
4060
+ const then = lowerBranch(block.thenMarkup, "then", filePath);
4061
+ const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
4062
+ const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
4063
+ const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
4064
+ 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}`;
4065
+ }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
3830
4066
  if (!source.includes("absolute:stream")) {
3831
4067
  return { code: source, transformed: false };
3832
4068
  }
@@ -3841,7 +4077,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
3841
4077
  const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
3842
4078
  awaitIndex += 1;
3843
4079
  lowered += source.slice(cursor, directive.index);
3844
- lowered += renderSlot(block, slotId, directive[1] !== undefined);
4080
+ lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
3845
4081
  cursor = block.end;
3846
4082
  }
3847
4083
  if (awaitIndex === 0) {
@@ -3851,14 +4087,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
3851
4087
  if (lowered.includes("<script")) {
3852
4088
  return {
3853
4089
  code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
3854
- ${IMPORT_LINE}
4090
+ ${INJECTED_SCRIPT}
3855
4091
  `),
3856
4092
  transformed: true
3857
4093
  };
3858
4094
  }
3859
4095
  return {
3860
4096
  code: `<script lang="ts">
3861
- ${IMPORT_LINE}
4097
+ ${INJECTED_SCRIPT}
3862
4098
  </script>
3863
4099
  ${lowered}`,
3864
4100
  transformed: true
@@ -3870,6 +4106,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
3870
4106
  BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
3871
4107
  SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
3872
4108
  QUOTES = new Set(['"', "'", "`"]);
4109
+ AWAIT_HTML_HELPERS_SOURCE = [
4110
+ `const ${HTML_HELPERS} = (() => {`,
4111
+ ` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
4112
+ ` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&amp;' : char === '"' ? '&quot;' : '&lt;');`,
4113
+ "\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
4114
+ "\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) : ''; };",
4115
+ "\treturn {",
4116
+ ` 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) + '"'; },`,
4117
+ ` 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) + '"' : ''; },`,
4118
+ "\t\thtml: (value) => String(value ?? ''),",
4119
+ "\t\tjoin: (...values) => values.map(stringify).join(''),",
4120
+ "\t\tpart: (value) => escape(stringify(value), true),",
4121
+ ` scope: () => scope ? ' class="' + scope + '"' : '',`,
4122
+ "\t\tscoped: () => scope ? ' ' + scope : '',",
4123
+ "\t\tshadow: false,",
4124
+ ` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
4125
+ "\t\ttext: (value) => escape(value, false)",
4126
+ "\t};",
4127
+ "})();"
4128
+ ].join(`
4129
+ `);
4130
+ BOOLEAN_ATTRIBUTES = new Set([
4131
+ "allowfullscreen",
4132
+ "async",
4133
+ "autofocus",
4134
+ "autoplay",
4135
+ "checked",
4136
+ "controls",
4137
+ "default",
4138
+ "defer",
4139
+ "disabled",
4140
+ "disablepictureinpicture",
4141
+ "disableremoteplayback",
4142
+ "formnovalidate",
4143
+ "indeterminate",
4144
+ "inert",
4145
+ "ismap",
4146
+ "loop",
4147
+ "multiple",
4148
+ "muted",
4149
+ "nomodule",
4150
+ "novalidate",
4151
+ "open",
4152
+ "playsinline",
4153
+ "readonly",
4154
+ "required",
4155
+ "reversed",
4156
+ "seamless",
4157
+ "selected",
4158
+ "webkitdirectory"
4159
+ ]);
4160
+ DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
4161
+ ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
4162
+ RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
4163
+ SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
4164
+ END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
4165
+ INJECTED_SCRIPT = `${IMPORT_LINE}
4166
+ ${AWAIT_HTML_HELPERS_SOURCE}`;
3873
4167
  });
3874
4168
 
3875
4169
  // src/build/stylePreprocessor.ts
@@ -4641,15 +4935,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
4641
4935
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
4642
4936
  transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
4643
4937
  }
4644
- let compiledCode = compile(transpiled, {
4938
+ const scopeClass = createAwaitScopeClassCapture();
4939
+ const compiledServer = compile(transpiled, {
4645
4940
  css: "injected",
4941
+ cssHash: scopeClass.cssHash,
4646
4942
  experimental: {
4647
4943
  async: loweredAwaitSource.transformed || loweredSource.transformed
4648
4944
  },
4649
4945
  filename: resolutionSourcePath,
4650
4946
  generate: "server",
4651
4947
  hmr: isDevelopmentRuntime()
4652
- }).js.code;
4948
+ });
4949
+ let compiledCode = scopeClass.apply(compiledServer.js.code);
4653
4950
  for (const [spec, compiledChildPath] of childModulePaths) {
4654
4951
  compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
4655
4952
  }
@@ -4995,6 +5292,9 @@ var init_renderIslandMarkup = __esm(() => {
4995
5292
  });
4996
5293
  });
4997
5294
 
5295
+ // src/react/pageHandler.ts
5296
+ init_constants();
5297
+
4998
5298
  // src/utils/requestRenderUrl.ts
4999
5299
  var requestRenderUrl = (request) => {
5000
5300
  if (!request)
@@ -5363,7 +5663,7 @@ var handleReactPageRequest = async (input) => {
5363
5663
  if (resolveErrorConventionPath("react", pageName) || hasErrorConvention("react")) {
5364
5664
  const html = await new Response(htmlStream).text();
5365
5665
  return new Response(html, {
5366
- headers: { "Content-Type": "text/html" }
5666
+ headers: { "Content-Type": HTML_CONTENT_TYPE }
5367
5667
  });
5368
5668
  }
5369
5669
  return new Response(htmlStream, {
@@ -5381,7 +5681,7 @@ var handleReactPageRequest = async (input) => {
5381
5681
  return withPageCacheHeaders(conventionResponse, request);
5382
5682
  }
5383
5683
  return withPageCacheHeaders(new Response(ssrErrorPage("react", error), {
5384
- headers: { "Content-Type": "text/html" },
5684
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
5385
5685
  status: 500
5386
5686
  }), request);
5387
5687
  }
@@ -5468,6 +5768,7 @@ var reactFileRoute = (route) => defineFileRouteWith("react", route, async ({ man
5468
5768
  });
5469
5769
  });
5470
5770
  // src/react/serverComponents/pageHandler.ts
5771
+ init_constants();
5471
5772
  init_cspNonceRef();
5472
5773
  init_requestContext();
5473
5774
  init_pageResponseCache();
@@ -5666,7 +5967,7 @@ var handleReactServerPageRequest = async (input) => {
5666
5967
  } catch (error) {
5667
5968
  logRenderError(error);
5668
5969
  return withPageCacheHeaders(new Response(ssrErrorPage("react", error), {
5669
- headers: { "Content-Type": "text/html" },
5970
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
5670
5971
  status: 500
5671
5972
  }), request);
5672
5973
  }
@@ -5898,14 +6199,18 @@ var subscribeIslandStore = (store, selector, listener) => {
5898
6199
  var useIslandStore = (store, selector) => useSyncExternalStore((listener) => subscribeIslandStore(store, selector, () => {
5899
6200
  listener();
5900
6201
  }), () => readIslandStore(store, selector), () => getIslandStoreServerSnapshot(store, selector));
6202
+ // src/utils/pageCspNonce.ts
6203
+ init_cspNonceRef();
6204
+ var getCspNonce = () => readCspNonce() ?? readPageNonce();
5901
6205
  export {
5902
6206
  Island,
5903
6207
  createTypedIsland,
6208
+ getCspNonce,
5904
6209
  handleReactPageRequest,
5905
6210
  handleReactServerPageRequest,
5906
6211
  reactFileRoute,
5907
6212
  useIslandStore
5908
6213
  };
5909
6214
 
5910
- //# debugId=A6A52A17EA97686064756E2164756E21
6215
+ //# debugId=CE591B7D2E42F7EC64756E2164756E21
5911
6216
  //# sourceMappingURL=index.js.map