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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/changelog.json +75 -0
  3. package/dist/angular/browser.js +2 -2
  4. package/dist/angular/browser.js.map +4 -4
  5. package/dist/angular/components/constants.js +4 -0
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  7. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  8. package/dist/angular/index.js +520 -84
  9. package/dist/angular/index.js.map +13 -12
  10. package/dist/angular/server.js +520 -84
  11. package/dist/angular/server.js.map +13 -12
  12. package/dist/build.js +452 -85
  13. package/dist/build.js.map +18 -18
  14. package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
  15. package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
  16. package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
  17. package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
  18. package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
  19. package/dist/cli/{build-ptx5a72p.js → build-df81wh71.js} +67 -6
  20. package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
  21. package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
  22. package/dist/cli/{buildReactServerComponents-01s87hnk.js → buildReactServerComponents-k6amghrj.js} +5 -5
  23. package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
  24. package/dist/cli/config/server.js +37 -18
  25. package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
  26. package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
  27. package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
  28. package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
  29. package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
  30. package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
  31. package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
  32. package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
  33. package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
  34. package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
  35. package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
  36. package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
  37. package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
  38. package/dist/cli/{index-jkg2h10c.js → index-3dz754hk.js} +3 -3
  39. package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
  40. package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
  41. package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
  42. package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
  43. package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
  44. package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
  45. package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
  46. package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
  47. package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
  48. package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
  49. package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
  50. package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
  51. package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
  52. package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
  53. package/dist/cli/{index-5w8arh3m.js → index-pq4qqz0r.js} +2 -2
  54. package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
  55. package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
  56. package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
  57. package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
  58. package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
  59. package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
  60. package/dist/cli/index.js +32 -32
  61. package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
  62. package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
  63. package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
  64. package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
  65. package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
  66. package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
  67. package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
  68. package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
  69. package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
  70. package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
  71. package/dist/cli/prerender-26pzynh4.js +13 -0
  72. package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
  73. package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
  74. package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
  75. package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
  76. package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
  77. package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
  78. package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
  79. package/dist/cli/{typecheck-ynzw2eep.js → typecheck-bvm0ndq4.js} +188 -75
  80. package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
  81. package/dist/dev/serverBootstrap.js +8 -2
  82. package/dist/index.js +469 -99
  83. package/dist/index.js.map +20 -20
  84. package/dist/islands/index.js +312 -23
  85. package/dist/islands/index.js.map +5 -5
  86. package/dist/mobile/index.js +2 -2
  87. package/dist/mobile/index.js.map +3 -3
  88. package/dist/react/browser.js +18 -1
  89. package/dist/react/browser.js.map +6 -4
  90. package/dist/react/components/index.js +2 -2
  91. package/dist/react/components/index.js.map +3 -3
  92. package/dist/react/index.js +370 -62
  93. package/dist/react/index.js.map +14 -13
  94. package/dist/react/server.js +51 -36
  95. package/dist/react/server.js.map +10 -10
  96. package/dist/src/angular/colocatedRouteMatch.d.ts +23 -0
  97. package/dist/src/angular/components/constants.d.ts +1 -0
  98. package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
  99. package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
  100. package/dist/src/cli/scripts/typecheck.d.ts +1 -0
  101. package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +41 -0
  102. package/dist/src/constants.d.ts +1 -0
  103. package/dist/src/core/prerender.d.ts +10 -0
  104. package/dist/src/dev/hot/analyze.d.ts +1 -1
  105. package/dist/src/react/browser.d.ts +1 -0
  106. package/dist/src/react/index.d.ts +1 -0
  107. package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
  108. package/dist/src/utils/pageCspNonce.d.ts +14 -0
  109. package/dist/src/utils/spaRouteManifest.d.ts +1 -0
  110. package/dist/svelte/index.js +372 -69
  111. package/dist/svelte/index.js.map +11 -11
  112. package/dist/svelte/server.js +363 -60
  113. package/dist/svelte/server.js.map +11 -11
  114. package/dist/types/manifest.d.ts +3 -2
  115. package/dist/types/svelte.d.ts +3 -0
  116. package/dist/vue/components/Image.js +2 -2
  117. package/dist/vue/components/Image.js.map +3 -3
  118. package/dist/vue/components/index.js +2 -2
  119. package/dist/vue/components/index.js.map +3 -3
  120. package/dist/vue/index.js +364 -61
  121. package/dist/vue/index.js.map +11 -11
  122. package/dist/vue/server.js +54 -40
  123. package/dist/vue/server.js.map +9 -9
  124. package/package.json +1 -1
  125. package/dist/cli/prerender-w65xp6h8.js +0 -11
  126. /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
@@ -258,6 +258,26 @@ var init_requestContext = __esm(() => {
258
258
  CSS_KEY_RE = /(?:CSS|Css)$/;
259
259
  });
260
260
 
261
+ // src/constants.ts
262
+ 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;
263
+ var init_constants = __esm(() => {
264
+ TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
265
+ IMAGE_DEFAULT_DEVICE_SIZES = [
266
+ 640,
267
+ 750,
268
+ 828,
269
+ 1080,
270
+ 1200,
271
+ 1920,
272
+ 2048,
273
+ 3840
274
+ ];
275
+ IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
276
+ MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
277
+ MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
278
+ TWO_THIRDS = 2 / 3;
279
+ });
280
+
261
281
  // src/build/resolvePackageImport.ts
262
282
  import { resolve, join } from "path";
263
283
  import { existsSync, readFileSync } from "fs";
@@ -313,26 +333,6 @@ var resolveExportPath = (entry, conditions) => {
313
333
  };
314
334
  var init_resolvePackageImport = () => {};
315
335
 
316
- // src/constants.ts
317
- 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;
318
- var init_constants = __esm(() => {
319
- TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
320
- IMAGE_DEFAULT_DEVICE_SIZES = [
321
- 640,
322
- 750,
323
- 828,
324
- 1080,
325
- 1200,
326
- 1920,
327
- 2048,
328
- 3840
329
- ];
330
- IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
331
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
332
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
333
- TWO_THIRDS = 2 / 3;
334
- });
335
-
336
336
  // src/svelte/lowerIslandSyntax.ts
337
337
  var ISLAND_TAG_RE, extractBracedExpression = (text, braceStart) => {
338
338
  let depth = 0;
@@ -442,23 +442,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
442
442
  index = markup.indexOf("{", end);
443
443
  }
444
444
  return tags;
445
- }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), markupToTemplateLiteral = (markup) => {
446
- const parts = topLevelTags(markup.trim());
447
- const trimmed = markup.trim();
448
- let cursor = 0;
449
- let literal = "";
450
- for (const { end, start, text } of parts) {
451
- literal += escapeTemplateLiteral(trimmed.slice(cursor, start));
452
- literal += `\${${text.slice(1, -1).trim()}}`;
453
- cursor = end;
445
+ }, 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 = () => {
446
+ let scopeClass = "";
447
+ const cssHash = ({ css, filename, hash }) => {
448
+ scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
449
+ return scopeClass;
450
+ };
451
+ const apply = (code) => applyAwaitScopeClass(code, scopeClass);
452
+ return { apply, cssHash };
453
+ }, 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) => {
454
+ scan.literal += escapeTemplateLiteral(text);
455
+ }, readExpressionTag = (scan) => {
456
+ const end = findTagEnd(scan.source, scan.index);
457
+ if (end === -1) {
458
+ fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
459
+ }
460
+ const inner = scan.source.slice(scan.index + 1, end - 1).trim();
461
+ scan.index = end;
462
+ return inner;
463
+ }, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
464
+ const char = scan.source[scan.index] ?? "";
465
+ if (quote)
466
+ return char === quote;
467
+ return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
468
+ }, readValueText = (scan, quote) => {
469
+ const start = scan.index;
470
+ while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
471
+ scan.index += 1;
472
+ }
473
+ return scan.source.slice(start, scan.index);
474
+ }, readAttributeValue = (scan) => {
475
+ const { source } = scan;
476
+ const quote = source[scan.index];
477
+ const chunks = [];
478
+ const isQuoted = quote === '"' || quote === "'";
479
+ if (isQuoted)
480
+ scan.index += 1;
481
+ if (!isQuoted && source[scan.index] === "{") {
482
+ chunks.push({ code: readExpressionTag(scan) });
483
+ return chunks;
484
+ }
485
+ const valueQuote = isQuoted ? quote : undefined;
486
+ while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
487
+ chunks.push({ text: readValueText(scan, valueQuote) });
488
+ if (source[scan.index] === "{")
489
+ chunks.push({ code: readExpressionTag(scan) });
490
+ }
491
+ if (isQuoted)
492
+ scan.index += 1;
493
+ return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
494
+ }, pushDynamicAttribute = (scan, name, chunks) => {
495
+ if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
496
+ failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
497
+ }
498
+ const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
499
+ if (tag && "code" in tag) {
500
+ failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
501
+ }
502
+ if (isShadowAttribute(name))
503
+ scan.shadow += ` ${name}=${SHADOW_VALUE}`;
504
+ const isClass = name === "class";
505
+ if (isClass)
506
+ scan.hasClass = true;
507
+ const [only] = chunks;
508
+ const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
509
+ if (isClass && chunks.length > 1 && codes.length === chunks.length) {
510
+ scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
511
+ return;
512
+ }
513
+ if (chunks.length === 1 && only && "code" in only) {
514
+ const value = `(${only.code})`;
515
+ if (name === "class")
516
+ scan.literal += helperCall("class", value);
517
+ else if (name === "style")
518
+ scan.literal += helperCall("style", value);
519
+ else
520
+ scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
521
+ return;
522
+ }
523
+ pushText(scan, ` ${name}="`);
524
+ for (const chunk of chunks) {
525
+ if ("code" in chunk)
526
+ scan.literal += helperCall("part", `(${chunk.code})`);
527
+ else
528
+ pushText(scan, chunk.text.replaceAll('"', "&quot;"));
529
+ }
530
+ if (isClass)
531
+ scan.literal += helperCall("scoped");
532
+ pushText(scan, '"');
533
+ }, pushStaticAttribute = (scan, whitespace, name, value) => {
534
+ if (isShadowAttribute(name))
535
+ scan.shadow += `${whitespace}${name}=${value}`;
536
+ if (name !== "class") {
537
+ pushText(scan, `${whitespace}${name}=${value}`);
538
+ return;
539
+ }
540
+ scan.hasClass = true;
541
+ const [first = ""] = value;
542
+ const isQuoted = first === '"' || first === "'";
543
+ const quote = isQuoted ? first : '"';
544
+ const classes = isQuoted ? value.slice(1, -1) : value;
545
+ if (classes === "") {
546
+ scan.literal += helperCall("class", "''");
547
+ return;
454
548
  }
455
- literal += escapeTemplateLiteral(trimmed.slice(cursor));
456
- return `\`${literal}\``;
549
+ pushText(scan, `${whitespace}${name}=${quote}${classes}`);
550
+ scan.literal += helperCall("scoped");
551
+ pushText(scan, quote);
552
+ }, readAttributeName = (scan) => {
553
+ const { source } = scan;
554
+ const start = scan.index;
555
+ while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
556
+ scan.index += 1;
557
+ }
558
+ return source.slice(start, scan.index);
559
+ }, skipWhitespace = (scan) => {
560
+ const start = scan.index;
561
+ while (/\s/.test(scan.source[scan.index] ?? ""))
562
+ scan.index += 1;
563
+ return scan.source.slice(start, scan.index);
564
+ }, pushTagExpression = (scan) => {
565
+ const inner = readExpressionTag(scan);
566
+ if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
567
+ failAttribute(scan, `{${inner}} in a start tag`);
568
+ }
569
+ pushDynamicAttribute(scan, inner, [{ code: inner }]);
570
+ }, pushAttribute = (scan) => {
571
+ const { source } = scan;
572
+ const whitespace = skipWhitespace(scan);
573
+ const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
574
+ const isEnd = scan.index >= source.length;
575
+ if (isEnd || source.startsWith(closing, scan.index)) {
576
+ if (!scan.hasClass)
577
+ scan.literal += helperCall("scope");
578
+ const tagEnd = isEnd ? "" : closing;
579
+ pushText(scan, whitespace + tagEnd);
580
+ scan.shadow += whitespace + (isEnd ? ">" : closing);
581
+ scan.index += tagEnd.length;
582
+ return false;
583
+ }
584
+ if (source[scan.index] === "{") {
585
+ pushTagExpression(scan);
586
+ return true;
587
+ }
588
+ const name = readAttributeName(scan);
589
+ if (!name) {
590
+ pushText(scan, whitespace + (source[scan.index] ?? ""));
591
+ scan.index += 1;
592
+ return true;
593
+ }
594
+ const beforeEquals = scan.index;
595
+ skipWhitespace(scan);
596
+ if (source[scan.index] !== "=") {
597
+ scan.index = beforeEquals;
598
+ pushText(scan, whitespace + name);
599
+ if (isShadowAttribute(name))
600
+ scan.shadow += whitespace + name;
601
+ return true;
602
+ }
603
+ scan.index += 1;
604
+ skipWhitespace(scan);
605
+ const valueStart = scan.index;
606
+ const chunks = readAttributeValue(scan);
607
+ if (chunks.some((chunk) => ("code" in chunk))) {
608
+ pushDynamicAttribute(scan, name, chunks);
609
+ return true;
610
+ }
611
+ pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
612
+ return true;
613
+ }, pushStartTag = (scan) => {
614
+ const { source } = scan;
615
+ const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
616
+ const tagName = nameMatch?.[0] ?? "";
617
+ pushText(scan, `<${tagName}`);
618
+ scan.shadow += `<${tagName}`;
619
+ scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
620
+ scan.index += 1 + tagName.length;
621
+ while (pushAttribute(scan))
622
+ ;
623
+ return tagName.toLowerCase();
624
+ }, pushRawText = (scan, tagName, shadowStart) => {
625
+ const { source } = scan;
626
+ const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
627
+ const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
628
+ const end = closeEnd === -1 ? source.length : closeEnd + 1;
629
+ pushText(scan, source.slice(scan.index, end));
630
+ scan.shadow = scan.shadow.slice(0, shadowStart);
631
+ scan.index = end;
632
+ }, pushTextExpression = (scan) => {
633
+ const inner = readExpressionTag(scan);
634
+ const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
635
+ if (rawHtml) {
636
+ scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
637
+ return;
638
+ }
639
+ scan.literal += helperCall("text", `(${inner})`);
640
+ }, pushComment = (scan) => {
641
+ const close = scan.source.indexOf("-->", scan.index + "<!--".length);
642
+ const end = close === -1 ? scan.source.length : close + "-->".length;
643
+ pushText(scan, scan.source.slice(scan.index, end));
644
+ scan.index = end;
645
+ }, scanTextPosition = (scan) => {
646
+ const { index, source } = scan;
647
+ if (source.startsWith("<!--", index)) {
648
+ pushComment(scan);
649
+ return;
650
+ }
651
+ if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
652
+ const shadowStart = scan.shadow.length;
653
+ const tagName = pushStartTag(scan);
654
+ if (RAW_TEXT_ELEMENTS.has(tagName))
655
+ pushRawText(scan, tagName, shadowStart);
656
+ return;
657
+ }
658
+ if (source[index] === "{") {
659
+ pushTextExpression(scan);
660
+ return;
661
+ }
662
+ const next = source.slice(index + 1).search(/[<{]/);
663
+ const end = next === -1 ? source.length : index + 1 + next;
664
+ const text = source.slice(index, end);
665
+ pushText(scan, text);
666
+ scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
667
+ scan.index = end;
668
+ }, lowerBranch = (markup, branch, filePath) => {
669
+ const scan = {
670
+ branch,
671
+ filePath,
672
+ hasClass: false,
673
+ index: 0,
674
+ literal: "",
675
+ shadow: "",
676
+ source: markup.trim()
677
+ };
678
+ while (scan.index < scan.source.length)
679
+ scanTextPosition(scan);
680
+ return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
457
681
  }, fail = (filePath, message) => {
458
682
  throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
459
683
  }, assertPlainHtml = (markup, branch, filePath) => {
460
684
  const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
461
- const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[#:/@]/.test(text));
685
+ const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
462
686
  if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
463
687
  fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
464
688
  }
@@ -502,12 +726,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
502
726
  thenIdentifier: thenMatch?.[2],
503
727
  thenMarkup
504
728
  };
505
- }, renderSlot = (block, slotId, dynamic) => {
729
+ }, renderSlot = (block, slotId, dynamic, filePath) => {
506
730
  const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
507
731
  const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
508
- const catchBranch = block.catchMarkup === undefined ? "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }" : `catch (${catchValueIdentifier}) { return ${markupToTemplateLiteral(block.catchMarkup)}; }`;
509
- return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${markupToTemplateLiteral(block.pendingMarkup)}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${markupToTemplateLiteral(block.thenMarkup)}; } ${catchBranch} }} />`;
510
- }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', lowerSvelteAwaitSlotSyntax = (source, filePath) => {
732
+ const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
733
+ const then = lowerBranch(block.thenMarkup, "then", filePath);
734
+ const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
735
+ const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
736
+ const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
737
+ 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}`;
738
+ }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
511
739
  if (!source.includes("absolute:stream")) {
512
740
  return { code: source, transformed: false };
513
741
  }
@@ -522,7 +750,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
522
750
  const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
523
751
  awaitIndex += 1;
524
752
  lowered += source.slice(cursor, directive.index);
525
- lowered += renderSlot(block, slotId, directive[1] !== undefined);
753
+ lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
526
754
  cursor = block.end;
527
755
  }
528
756
  if (awaitIndex === 0) {
@@ -532,14 +760,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
532
760
  if (lowered.includes("<script")) {
533
761
  return {
534
762
  code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
535
- ${IMPORT_LINE}
763
+ ${INJECTED_SCRIPT}
536
764
  `),
537
765
  transformed: true
538
766
  };
539
767
  }
540
768
  return {
541
769
  code: `<script lang="ts">
542
- ${IMPORT_LINE}
770
+ ${INJECTED_SCRIPT}
543
771
  </script>
544
772
  ${lowered}`,
545
773
  transformed: true
@@ -551,6 +779,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
551
779
  BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
552
780
  SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
553
781
  QUOTES = new Set(['"', "'", "`"]);
782
+ AWAIT_HTML_HELPERS_SOURCE = [
783
+ `const ${HTML_HELPERS} = (() => {`,
784
+ ` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
785
+ ` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&amp;' : char === '"' ? '&quot;' : '&lt;');`,
786
+ "\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
787
+ "\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) : ''; };",
788
+ "\treturn {",
789
+ ` 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) + '"'; },`,
790
+ ` 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) + '"' : ''; },`,
791
+ "\t\thtml: (value) => String(value ?? ''),",
792
+ "\t\tjoin: (...values) => values.map(stringify).join(''),",
793
+ "\t\tpart: (value) => escape(stringify(value), true),",
794
+ ` scope: () => scope ? ' class="' + scope + '"' : '',`,
795
+ "\t\tscoped: () => scope ? ' ' + scope : '',",
796
+ "\t\tshadow: false,",
797
+ ` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
798
+ "\t\ttext: (value) => escape(value, false)",
799
+ "\t};",
800
+ "})();"
801
+ ].join(`
802
+ `);
803
+ BOOLEAN_ATTRIBUTES = new Set([
804
+ "allowfullscreen",
805
+ "async",
806
+ "autofocus",
807
+ "autoplay",
808
+ "checked",
809
+ "controls",
810
+ "default",
811
+ "defer",
812
+ "disabled",
813
+ "disablepictureinpicture",
814
+ "disableremoteplayback",
815
+ "formnovalidate",
816
+ "indeterminate",
817
+ "inert",
818
+ "ismap",
819
+ "loop",
820
+ "multiple",
821
+ "muted",
822
+ "nomodule",
823
+ "novalidate",
824
+ "open",
825
+ "playsinline",
826
+ "readonly",
827
+ "required",
828
+ "reversed",
829
+ "seamless",
830
+ "selected",
831
+ "webkitdirectory"
832
+ ]);
833
+ DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
834
+ ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
835
+ RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
836
+ SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
837
+ END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
838
+ INJECTED_SCRIPT = `${IMPORT_LINE}
839
+ ${AWAIT_HTML_HELPERS_SOURCE}`;
554
840
  });
555
841
 
556
842
  // src/build/stylePreprocessor.ts
@@ -1322,15 +1608,18 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, syncIslandGen
1322
1608
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
1323
1609
  transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
1324
1610
  }
1325
- let compiledCode = compile(transpiled, {
1611
+ const scopeClass = createAwaitScopeClassCapture();
1612
+ const compiledServer = compile(transpiled, {
1326
1613
  css: "injected",
1614
+ cssHash: scopeClass.cssHash,
1327
1615
  experimental: {
1328
1616
  async: loweredAwaitSource.transformed || loweredSource.transformed
1329
1617
  },
1330
1618
  filename: resolutionSourcePath,
1331
1619
  generate: "server",
1332
1620
  hmr: isDevelopmentRuntime()
1333
- }).js.code;
1621
+ });
1622
+ let compiledCode = scopeClass.apply(compiledServer.js.code);
1334
1623
  for (const [spec, compiledChildPath] of childModulePaths) {
1335
1624
  compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
1336
1625
  }
@@ -2316,14 +2605,14 @@ var init_pageProtocol = __esm(() => {
2316
2605
 
2317
2606
  // src/core/pageResponseCache.ts
2318
2607
  import { createHash } from "crypto";
2319
- var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
2608
+ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
2320
2609
  const headers = new Headers(extra);
2321
2610
  headers.set("content-type", HTML_CONTENT_TYPE);
2322
2611
  headers.set(STREAMING_PAGE_HEADER, "1");
2323
2612
  return headers;
2324
2613
  }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
2325
2614
  const contentType = response.headers.get("content-type") ?? "";
2326
- if (!contentType.includes(HTML_CONTENT_TYPE))
2615
+ if (!contentType.includes(HTML_MEDIA_TYPE))
2327
2616
  return response;
2328
2617
  const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
2329
2618
  if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
@@ -2349,7 +2638,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
2349
2638
  statusText: response.statusText
2350
2639
  });
2351
2640
  };
2352
- var init_pageResponseCache = () => {};
2641
+ var init_pageResponseCache = __esm(() => {
2642
+ init_constants();
2643
+ });
2353
2644
 
2354
2645
  // src/client/streamSwap.ts
2355
2646
  var streamSwapRuntime = () => {
@@ -2801,9 +3092,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
2801
3092
  tail: ""
2802
3093
  };
2803
3094
  };
2804
- const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
3095
+ const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
2805
3096
  if (winner.kind !== "base") {
2806
- return { baseDone: false, baseRead, footer, handled: false, tail };
3097
+ return { baseDone, baseRead, footer, handled: false, tail };
2807
3098
  }
2808
3099
  if (winner.done) {
2809
3100
  return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
@@ -2846,7 +3137,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
2846
3137
  return footer;
2847
3138
  }
2848
3139
  const winner = await Promise.race(racers);
2849
- const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
3140
+ const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
2850
3141
  handleResolvedSlot(controller, slotWinner);
2851
3142
  });
2852
3143
  ({ baseDone, baseRead, footer, tail } = baseWinnerState);
@@ -3236,7 +3527,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3236
3527
  nonce: readCspNonce()
3237
3528
  });
3238
3529
  return new Response(stream, {
3239
- headers: { "Content-Type": "text/html" },
3530
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3240
3531
  status: 500
3241
3532
  });
3242
3533
  }, renderSvelteError = async (conventionPath, errorProps) => {
@@ -3252,7 +3543,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3252
3543
  });
3253
3544
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
3254
3545
  return new Response(html, {
3255
- headers: { "Content-Type": "text/html" },
3546
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3256
3547
  status: 500
3257
3548
  });
3258
3549
  }, unescapeVueStyles = (ssrBody) => {
@@ -3276,7 +3567,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3276
3567
  const { styles, body } = unescapeVueStyles(rawBody);
3277
3568
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
3278
3569
  return new Response(html, {
3279
- headers: { "Content-Type": "text/html" },
3570
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3280
3571
  status: 500
3281
3572
  });
3282
3573
  }, renderAngularError = async (conventionPath, errorProps) => {
@@ -3286,14 +3577,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3286
3577
  return null;
3287
3578
  const html = renderFn(errorProps);
3288
3579
  return new Response(html, {
3289
- headers: { "Content-Type": "text/html" },
3580
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3290
3581
  status: 500
3291
3582
  });
3292
3583
  }, 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) => {
3293
3584
  const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
3294
3585
  const html = replaceErrorTokens(template, errorProps);
3295
3586
  return new Response(html, {
3296
- headers: { "Content-Type": "text/html" },
3587
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3297
3588
  status: 500
3298
3589
  });
3299
3590
  }, logConventionRenderError = (framework, label, renderError) => {
@@ -3372,7 +3663,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3372
3663
  nonce: readCspNonce()
3373
3664
  });
3374
3665
  return new Response(stream, {
3375
- headers: { "Content-Type": "text/html" },
3666
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3376
3667
  status: 404
3377
3668
  });
3378
3669
  }, renderSvelteNotFound = async (conventionPath) => {
@@ -3385,7 +3676,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3385
3676
  const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
3386
3677
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
3387
3678
  return new Response(html, {
3388
- headers: { "Content-Type": "text/html" },
3679
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3389
3680
  status: 404
3390
3681
  });
3391
3682
  }, renderVueNotFound = async (conventionPath) => {
@@ -3402,7 +3693,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3402
3693
  const { styles, body } = unescapeVueStyles(rawBody);
3403
3694
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
3404
3695
  return new Response(html, {
3405
- headers: { "Content-Type": "text/html" },
3696
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3406
3697
  status: 404
3407
3698
  });
3408
3699
  }, renderAngularNotFound = async (conventionPath) => {
@@ -3412,13 +3703,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3412
3703
  return null;
3413
3704
  const html = renderFn();
3414
3705
  return new Response(html, {
3415
- headers: { "Content-Type": "text/html" },
3706
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3416
3707
  status: 404
3417
3708
  });
3418
3709
  }, renderHtmlNotFound = async (conventionPath) => {
3419
3710
  const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
3420
3711
  return new Response(html, {
3421
- headers: { "Content-Type": "text/html" },
3712
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
3422
3713
  status: 404
3423
3714
  });
3424
3715
  }, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
@@ -3452,6 +3743,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
3452
3743
  return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
3453
3744
  };
3454
3745
  var init_resolveConvention = __esm(() => {
3746
+ init_constants();
3455
3747
  init_cspNonceRef();
3456
3748
  init_staticHtmlNonce();
3457
3749
  init_ssrErrorPage();
@@ -3484,6 +3776,7 @@ var init_resolveConvention = __esm(() => {
3484
3776
  });
3485
3777
 
3486
3778
  // src/utils/spaRouteManifest.ts
3779
+ import { NotFound } from "elysia";
3487
3780
  import { basename as basename3 } from "path";
3488
3781
  var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
3489
3782
  Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
@@ -3548,7 +3841,14 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
3548
3841
  }, renderSpaNotFound = async (framework, pageName, request) => {
3549
3842
  if (isKnownSpaRoute(framework, pageName, request))
3550
3843
  return null;
3551
- return await renderFirstNotFound() ?? new Response("Not found", {
3844
+ return renderSpaNotFoundResponse(request);
3845
+ }, renderSpaNotFoundResponse = async (request) => {
3846
+ if (request && !isPageRequest(request)) {
3847
+ return new NotFound().toResponse();
3848
+ }
3849
+ return await renderFirstNotFound({
3850
+ preferHtmx: request?.headers.get("hx-request") === "true"
3851
+ }) ?? new Response("Not found", {
3552
3852
  headers: { "Content-Type": "text/plain" },
3553
3853
  status: 404
3554
3854
  });
@@ -3742,6 +4042,9 @@ var assetUnchecked = (source, name) => {
3742
4042
  return assetPath;
3743
4043
  };
3744
4044
 
4045
+ // src/svelte/pageHandler.ts
4046
+ init_constants();
4047
+
3745
4048
  // src/utils/requestRenderUrl.ts
3746
4049
  var requestRenderUrl = (request) => {
3747
4050
  if (!request)
@@ -4259,7 +4562,7 @@ var handleSveltePageRequest = async (input) => {
4259
4562
  return withPageCacheHeaders(conventionResponse, request);
4260
4563
  }
4261
4564
  return withPageCacheHeaders(new Response(ssrErrorPage("svelte", error), {
4262
- headers: { "Content-Type": "text/html" },
4565
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
4263
4566
  status: 500
4264
4567
  }), request);
4265
4568
  }
@@ -4277,5 +4580,5 @@ export {
4277
4580
  svelteFileRoute
4278
4581
  };
4279
4582
 
4280
- //# debugId=73C832E2BF65309C64756E2164756E21
4583
+ //# debugId=A81D9E1FFC4D2B8E64756E2164756E21
4281
4584
  //# sourceMappingURL=server.js.map