@ogygia/core 0.0.0 → 0.11.1

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 (548) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -1
  3. package/ambient.d.ts +194 -0
  4. package/dist/ClientBindingStub.svelte +6 -0
  5. package/dist/ClientBindingStub.svelte.d.ts +26 -0
  6. package/dist/KeepHost.svelte +19 -0
  7. package/dist/KeepHost.svelte.d.ts +10 -0
  8. package/dist/LakeBoundary.svelte +16 -0
  9. package/dist/LakeBoundary.svelte.d.ts +11 -0
  10. package/dist/LateIsland.svelte +22 -0
  11. package/dist/LateIsland.svelte.d.ts +15 -0
  12. package/dist/LateIslandAwait.svelte +17 -0
  13. package/dist/LateIslandAwait.svelte.d.ts +15 -0
  14. package/dist/LiveHost.svelte +19 -0
  15. package/dist/LiveHost.svelte.d.ts +10 -0
  16. package/dist/NestedProvider.svelte +13 -0
  17. package/dist/NestedProvider.svelte.d.ts +8 -0
  18. package/dist/OgygiaBoundary.svelte +5 -0
  19. package/dist/OgygiaBoundary.svelte.d.ts +17 -0
  20. package/dist/PromiseRegion.svelte +40 -0
  21. package/dist/PromiseRegion.svelte.d.ts +15 -0
  22. package/dist/PromiseRegionAwait.svelte +27 -0
  23. package/dist/PromiseRegionAwait.svelte.d.ts +15 -0
  24. package/dist/Provide.svelte +27 -0
  25. package/dist/Provide.svelte.d.ts +8 -0
  26. package/dist/RawHtml.svelte +9 -0
  27. package/dist/RawHtml.svelte.d.ts +6 -0
  28. package/dist/Region.svelte +1173 -0
  29. package/dist/Region.svelte.d.ts +68 -0
  30. package/dist/SlotBoundary.svelte +13 -0
  31. package/dist/SlotBoundary.svelte.d.ts +7 -0
  32. package/dist/app.d.ts +4 -0
  33. package/dist/app.js +3 -0
  34. package/dist/boundary.d.ts +35 -0
  35. package/dist/boundary.js +127 -0
  36. package/dist/build-cache.d.ts +13 -0
  37. package/dist/build-cache.js +77 -0
  38. package/dist/compiler/blank-styles.d.ts +1 -0
  39. package/dist/compiler/blank-styles.js +63 -0
  40. package/dist/compiler/bom.d.ts +2 -0
  41. package/dist/compiler/bom.js +15 -0
  42. package/dist/compiler/browser-full.d.ts +8 -0
  43. package/dist/compiler/browser-full.js +8 -0
  44. package/dist/compiler/browser.d.ts +11 -0
  45. package/dist/compiler/browser.js +11 -0
  46. package/dist/compiler/content/transportables.d.ts +26 -0
  47. package/dist/compiler/content/transportables.js +219 -0
  48. package/dist/compiler/ctx.d.ts +185 -0
  49. package/dist/compiler/ctx.js +203 -0
  50. package/dist/compiler/debarrel/barrel.d.ts +55 -0
  51. package/dist/compiler/debarrel/barrel.js +248 -0
  52. package/dist/compiler/debarrel/options.d.ts +67 -0
  53. package/dist/compiler/debarrel/options.js +31 -0
  54. package/dist/compiler/debarrel/parse.d.ts +65 -0
  55. package/dist/compiler/debarrel/parse.js +256 -0
  56. package/dist/compiler/debarrel/plugin.d.ts +31 -0
  57. package/dist/compiler/debarrel/plugin.js +190 -0
  58. package/dist/compiler/debarrel/rewrite.d.ts +27 -0
  59. package/dist/compiler/debarrel/rewrite.js +118 -0
  60. package/dist/compiler/debarrel/svelte.d.ts +13 -0
  61. package/dist/compiler/debarrel/svelte.js +56 -0
  62. package/dist/compiler/dev/css-scope.d.ts +16 -0
  63. package/dist/compiler/dev/css-scope.js +38 -0
  64. package/dist/compiler/dev/dev-hmr.d.ts +25 -0
  65. package/dist/compiler/dev/dev-hmr.js +29 -0
  66. package/dist/compiler/dev/hmr.d.ts +34 -0
  67. package/dist/compiler/dev/hmr.js +57 -0
  68. package/dist/compiler/dev/region-bytes.d.ts +34 -0
  69. package/dist/compiler/dev/region-bytes.js +126 -0
  70. package/dist/compiler/driver.d.ts +280 -0
  71. package/dist/compiler/driver.js +1352 -0
  72. package/dist/compiler/flags.d.ts +16 -0
  73. package/dist/compiler/flags.js +101 -0
  74. package/dist/compiler/fouc-css.d.ts +97 -0
  75. package/dist/compiler/fouc-css.js +335 -0
  76. package/dist/compiler/free-vars.d.ts +20 -0
  77. package/dist/compiler/free-vars.js +327 -0
  78. package/dist/compiler/host.d.ts +65 -0
  79. package/dist/compiler/host.js +51 -0
  80. package/dist/compiler/ids.d.ts +84 -0
  81. package/dist/compiler/ids.js +86 -0
  82. package/dist/compiler/index.d.ts +11 -0
  83. package/dist/compiler/index.js +11 -0
  84. package/dist/compiler/kit.d.ts +129 -0
  85. package/dist/compiler/kit.js +563 -0
  86. package/dist/compiler/link/build-output.d.ts +44 -0
  87. package/dist/compiler/link/build-output.js +147 -0
  88. package/dist/compiler/link/caps.d.ts +48 -0
  89. package/dist/compiler/link/caps.js +64 -0
  90. package/dist/compiler/link/context-detect.d.ts +23 -0
  91. package/dist/compiler/link/context-detect.js +137 -0
  92. package/dist/compiler/link/emit-gate.d.ts +11 -0
  93. package/dist/compiler/link/emit-gate.js +40 -0
  94. package/dist/compiler/link/entry-shim.d.ts +4 -0
  95. package/dist/compiler/link/entry-shim.js +29 -0
  96. package/dist/compiler/link/island-deps.d.ts +142 -0
  97. package/dist/compiler/link/island-deps.js +525 -0
  98. package/dist/compiler/link/manifest.d.ts +5 -0
  99. package/dist/compiler/link/manifest.js +9 -0
  100. package/dist/compiler/link/page-keys.d.ts +64 -0
  101. package/dist/compiler/link/page-keys.js +683 -0
  102. package/dist/compiler/link/registry-stub.d.ts +41 -0
  103. package/dist/compiler/link/registry-stub.js +212 -0
  104. package/dist/compiler/link/router-config.d.ts +11 -0
  105. package/dist/compiler/link/router-config.js +15 -0
  106. package/dist/compiler/link/router-css.d.ts +22 -0
  107. package/dist/compiler/link/router-css.js +142 -0
  108. package/dist/compiler/link/runtime-entry.d.ts +71 -0
  109. package/dist/compiler/link/runtime-entry.js +132 -0
  110. package/dist/compiler/link/server-manifest.d.ts +12 -0
  111. package/dist/compiler/link/server-manifest.js +45 -0
  112. package/dist/compiler/link/speculation.d.ts +17 -0
  113. package/dist/compiler/link/speculation.js +36 -0
  114. package/dist/compiler/link/transport.d.ts +31 -0
  115. package/dist/compiler/link/transport.js +67 -0
  116. package/dist/compiler/macros/bake.d.ts +20 -0
  117. package/dist/compiler/macros/bake.js +317 -0
  118. package/dist/compiler/macros/browser.d.ts +11 -0
  119. package/dist/compiler/macros/browser.js +69 -0
  120. package/dist/compiler/macros/dedent.d.ts +12 -0
  121. package/dist/compiler/macros/dedent.js +36 -0
  122. package/dist/compiler/macros/dollar.d.ts +15 -0
  123. package/dist/compiler/macros/dollar.js +387 -0
  124. package/dist/compiler/macros/pipeline.d.ts +31 -0
  125. package/dist/compiler/macros/pipeline.js +106 -0
  126. package/dist/compiler/macros/source.d.ts +6 -0
  127. package/dist/compiler/macros/source.js +127 -0
  128. package/dist/compiler/macros/store.d.ts +17 -0
  129. package/dist/compiler/macros/store.js +244 -0
  130. package/dist/compiler/macros/wire.d.ts +14 -0
  131. package/dist/compiler/macros/wire.js +160 -0
  132. package/dist/compiler/ownership-stamps.d.ts +6 -0
  133. package/dist/compiler/ownership-stamps.js +144 -0
  134. package/dist/compiler/parse/oxc.d.ts +34 -0
  135. package/dist/compiler/parse/oxc.js +59 -0
  136. package/dist/compiler/parse/scan.d.ts +43 -0
  137. package/dist/compiler/parse/scan.js +232 -0
  138. package/dist/compiler/program.d.ts +140 -0
  139. package/dist/compiler/program.js +242 -0
  140. package/dist/compiler/region/emit.d.ts +169 -0
  141. package/dist/compiler/region/emit.js +286 -0
  142. package/dist/compiler/region/identity.d.ts +28 -0
  143. package/dist/compiler/region/identity.js +75 -0
  144. package/dist/compiler/region/ir.d.ts +65 -0
  145. package/dist/compiler/region/ir.js +0 -0
  146. package/dist/compiler/region/transform.d.ts +178 -0
  147. package/dist/compiler/region/transform.js +1933 -0
  148. package/dist/compiler/script-request.d.ts +1 -0
  149. package/dist/compiler/script-request.js +43 -0
  150. package/dist/context-bridge.d.ts +65 -0
  151. package/dist/context-bridge.js +217 -0
  152. package/dist/context-registry.d.ts +40 -0
  153. package/dist/context-registry.js +15 -0
  154. package/dist/context.d.ts +72 -0
  155. package/dist/context.js +158 -0
  156. package/dist/current-region.d.ts +14 -0
  157. package/dist/current-region.js +36 -0
  158. package/dist/document.d.ts +41 -0
  159. package/dist/document.js +125 -0
  160. package/dist/entry-hydrate.d.ts +5 -0
  161. package/dist/entry-hydrate.js +42 -0
  162. package/dist/escape.d.ts +18 -0
  163. package/dist/escape.js +37 -0
  164. package/dist/events/bus.d.ts +33 -0
  165. package/dist/events/bus.js +153 -0
  166. package/dist/events/index.d.ts +4 -0
  167. package/dist/events/index.js +4 -0
  168. package/dist/events/schema.d.ts +389 -0
  169. package/dist/events/schema.js +23 -0
  170. package/dist/events/server-registry.d.ts +7 -0
  171. package/dist/events/server-registry.js +13 -0
  172. package/dist/events/sinks.d.ts +64 -0
  173. package/dist/events/sinks.js +85 -0
  174. package/dist/fn-transport.d.ts +33 -0
  175. package/dist/fn-transport.js +140 -0
  176. package/dist/frame.d.ts +20 -0
  177. package/dist/frame.js +19 -0
  178. package/dist/holes-record.d.ts +6 -0
  179. package/dist/holes-record.js +8 -0
  180. package/dist/hooks.d.ts +43 -0
  181. package/dist/hooks.js +1191 -0
  182. package/dist/hydration-info.d.ts +1 -0
  183. package/dist/hydration-info.js +31 -0
  184. package/dist/index.d.ts +21 -0
  185. package/dist/index.js +17 -0
  186. package/dist/insights/attr-rules.d.ts +15 -0
  187. package/dist/insights/attr-rules.js +27 -0
  188. package/dist/insights/cpu.d.ts +82 -0
  189. package/dist/insights/cpu.js +177 -0
  190. package/dist/insights/fp-drift.d.ts +28 -0
  191. package/dist/insights/fp-drift.js +148 -0
  192. package/dist/insights/hole-segments.d.ts +26 -0
  193. package/dist/insights/hole-segments.js +50 -0
  194. package/dist/insights/html-diff.d.ts +25 -0
  195. package/dist/insights/html-diff.js +157 -0
  196. package/dist/insights/hydration-hazards.d.ts +36 -0
  197. package/dist/insights/hydration-hazards.js +136 -0
  198. package/dist/insights/hydration-status.d.ts +2 -0
  199. package/dist/insights/hydration-status.js +0 -0
  200. package/dist/insights/index.d.ts +14 -0
  201. package/dist/insights/index.js +12 -0
  202. package/dist/insights/page-assets.d.ts +211 -0
  203. package/dist/insights/page-assets.js +608 -0
  204. package/dist/insights/page-insights.d.ts +749 -0
  205. package/dist/insights/page-insights.js +2157 -0
  206. package/dist/insights/session-data.d.ts +108 -0
  207. package/dist/insights/session-data.js +0 -0
  208. package/dist/insights/session-insights.d.ts +121 -0
  209. package/dist/insights/session-insights.js +548 -0
  210. package/dist/insights/switch.d.ts +53 -0
  211. package/dist/insights/switch.js +91 -0
  212. package/dist/insights/testing-version.d.ts +19 -0
  213. package/dist/insights/testing-version.js +21 -0
  214. package/dist/insights/third-party.d.ts +75 -0
  215. package/dist/insights/third-party.js +160 -0
  216. package/dist/internal-instruments.d.ts +13 -0
  217. package/dist/internal-instruments.js +12 -0
  218. package/dist/internal-reconcile.d.ts +3 -0
  219. package/dist/internal-reconcile.js +3 -0
  220. package/dist/internal-register.d.ts +7 -0
  221. package/dist/internal-register.js +7 -0
  222. package/dist/internal-server.d.ts +7 -0
  223. package/dist/internal-server.js +7 -0
  224. package/dist/internal.d.ts +13 -0
  225. package/dist/internal.js +13 -0
  226. package/dist/island-graph.d.ts +36 -0
  227. package/dist/island-graph.js +89 -0
  228. package/dist/keep-fallback-marker.d.ts +7 -0
  229. package/dist/keep-fallback-marker.js +9 -0
  230. package/dist/keep-fallback.d.ts +13 -0
  231. package/dist/keep-fallback.js +39 -0
  232. package/dist/kit-paths.d.ts +2 -0
  233. package/dist/kit-paths.js +39 -0
  234. package/dist/late-region-registry.d.ts +40 -0
  235. package/dist/late-region-registry.js +36 -0
  236. package/dist/live-transport.d.ts +57 -0
  237. package/dist/live-transport.js +145 -0
  238. package/dist/markup.d.ts +4 -0
  239. package/dist/markup.js +4 -0
  240. package/dist/own-package.d.ts +15 -0
  241. package/dist/own-package.js +20 -0
  242. package/dist/page-defer.d.ts +33 -0
  243. package/dist/page-defer.js +35 -0
  244. package/dist/page-facts-script.d.ts +7 -0
  245. package/dist/page-facts-script.js +9 -0
  246. package/dist/page-seed-registry.d.ts +72 -0
  247. package/dist/page-seed-registry.js +31 -0
  248. package/dist/plugin/capability.d.ts +14 -0
  249. package/dist/plugin/capability.js +44 -0
  250. package/dist/plugin/client.d.ts +39 -0
  251. package/dist/plugin/client.js +6 -0
  252. package/dist/plugin/css.d.ts +3 -0
  253. package/dist/plugin/css.js +54 -0
  254. package/dist/plugin/facts.d.ts +42 -0
  255. package/dist/plugin/facts.js +37 -0
  256. package/dist/plugin/hooks.d.ts +33 -0
  257. package/dist/plugin/hooks.js +38 -0
  258. package/dist/plugin/index.d.ts +127 -0
  259. package/dist/plugin/index.js +26 -0
  260. package/dist/plugin/routes.d.ts +32 -0
  261. package/dist/plugin/routes.js +35 -0
  262. package/dist/plugin/server.d.ts +27 -0
  263. package/dist/plugin/server.js +92 -0
  264. package/dist/plugin/standard-schema.d.ts +27 -0
  265. package/dist/plugin/standard-schema.js +0 -0
  266. package/dist/plugin/testing.d.ts +13 -0
  267. package/dist/plugin/testing.js +54 -0
  268. package/dist/plugin/utils.d.ts +13 -0
  269. package/dist/plugin/utils.js +19 -0
  270. package/dist/portable-form.d.ts +22 -0
  271. package/dist/portable-form.js +52 -0
  272. package/dist/preference.d.ts +35 -0
  273. package/dist/preference.js +84 -0
  274. package/dist/preload.d.ts +1 -0
  275. package/dist/preload.js +21 -0
  276. package/dist/ref-watch.d.ts +31 -0
  277. package/dist/ref-watch.js +66 -0
  278. package/dist/ref.d.ts +124 -0
  279. package/dist/ref.js +272 -0
  280. package/dist/region-brand.d.ts +8 -0
  281. package/dist/region-brand.js +10 -0
  282. package/dist/region-core.d.ts +2 -0
  283. package/dist/region-core.js +1 -0
  284. package/dist/region-snippet.d.ts +73 -0
  285. package/dist/region-snippet.js +351 -0
  286. package/dist/region.d.ts +127 -0
  287. package/dist/region.js +162 -0
  288. package/dist/request-event.d.ts +1 -0
  289. package/dist/request-event.js +37 -0
  290. package/dist/router-css.d.ts +39 -0
  291. package/dist/router-css.js +66 -0
  292. package/dist/runtime/app-transport.d.ts +2 -0
  293. package/dist/runtime/app-transport.js +13 -0
  294. package/dist/runtime/beacon.d.ts +271 -0
  295. package/dist/runtime/beacon.js +2190 -0
  296. package/dist/runtime/boot-link.d.ts +1 -0
  297. package/dist/runtime/boot-link.js +44 -0
  298. package/dist/runtime/client-hooks.d.ts +5 -0
  299. package/dist/runtime/client-hooks.js +22 -0
  300. package/dist/runtime/client-plugins.d.ts +8 -0
  301. package/dist/runtime/client-plugins.js +34 -0
  302. package/dist/runtime/concurrency.d.ts +12 -0
  303. package/dist/runtime/concurrency.js +29 -0
  304. package/dist/runtime/connected.d.ts +12 -0
  305. package/dist/runtime/connected.js +16 -0
  306. package/dist/runtime/context.d.ts +1 -0
  307. package/dist/runtime/context.js +19 -0
  308. package/dist/runtime/core.d.ts +15 -0
  309. package/dist/runtime/core.js +1173 -0
  310. package/dist/runtime/drift-watch.d.ts +9 -0
  311. package/dist/runtime/drift-watch.js +60 -0
  312. package/dist/runtime/entry-locations.d.ts +33 -0
  313. package/dist/runtime/entry-locations.js +119 -0
  314. package/dist/runtime/foreign-props.d.ts +8 -0
  315. package/dist/runtime/foreign-props.js +14 -0
  316. package/dist/runtime/form-continuity.d.ts +10 -0
  317. package/dist/runtime/form-continuity.js +107 -0
  318. package/dist/runtime/frame-nav.d.ts +36 -0
  319. package/dist/runtime/frame-nav.js +225 -0
  320. package/dist/runtime/frame-store.d.ts +62 -0
  321. package/dist/runtime/frame-store.js +214 -0
  322. package/dist/runtime/frames.d.ts +1 -0
  323. package/dist/runtime/frames.js +25 -0
  324. package/dist/runtime/full.d.ts +4 -0
  325. package/dist/runtime/full.js +32 -0
  326. package/dist/runtime/hash.d.ts +41 -0
  327. package/dist/runtime/hash.js +79 -0
  328. package/dist/runtime/hole-facts.d.ts +8 -0
  329. package/dist/runtime/hole-facts.js +57 -0
  330. package/dist/runtime/host-classes.d.ts +24 -0
  331. package/dist/runtime/host-classes.js +43 -0
  332. package/dist/runtime/hydrate-core.d.ts +101 -0
  333. package/dist/runtime/hydrate-core.js +605 -0
  334. package/dist/runtime/index.d.ts +2 -0
  335. package/dist/runtime/index.js +1 -0
  336. package/dist/runtime/interaction-replay.d.ts +11 -0
  337. package/dist/runtime/interaction-replay.js +70 -0
  338. package/dist/runtime/interaction.d.ts +33 -0
  339. package/dist/runtime/interaction.js +217 -0
  340. package/dist/runtime/island-graph-preload.d.ts +13 -0
  341. package/dist/runtime/island-graph-preload.js +99 -0
  342. package/dist/runtime/kit-boot.d.ts +29 -0
  343. package/dist/runtime/kit-boot.js +60 -0
  344. package/dist/runtime/kit-page-thread.svelte.d.ts +1 -0
  345. package/dist/runtime/kit-page-thread.svelte.js +116 -0
  346. package/dist/runtime/lake-anchors.d.ts +13 -0
  347. package/dist/runtime/lake-anchors.js +19 -0
  348. package/dist/runtime/lakes.d.ts +15 -0
  349. package/dist/runtime/lakes.js +212 -0
  350. package/dist/runtime/live.d.ts +3 -0
  351. package/dist/runtime/live.js +17 -0
  352. package/dist/runtime/load-scheduler.d.ts +53 -0
  353. package/dist/runtime/load-scheduler.js +317 -0
  354. package/dist/runtime/morph.d.ts +42 -0
  355. package/dist/runtime/morph.js +671 -0
  356. package/dist/runtime/nav-handle.d.ts +25 -0
  357. package/dist/runtime/nav-handle.js +71 -0
  358. package/dist/runtime/nav-hooks.d.ts +2 -0
  359. package/dist/runtime/nav-hooks.js +23 -0
  360. package/dist/runtime/nearest-attr.d.ts +4 -0
  361. package/dist/runtime/nearest-attr.js +16 -0
  362. package/dist/runtime/observe.d.ts +27 -0
  363. package/dist/runtime/observe.js +63 -0
  364. package/dist/runtime/own-cost.d.ts +9 -0
  365. package/dist/runtime/own-cost.js +35 -0
  366. package/dist/runtime/ownership.d.ts +101 -0
  367. package/dist/runtime/ownership.js +115 -0
  368. package/dist/runtime/page-cache.d.ts +23 -0
  369. package/dist/runtime/page-cache.js +74 -0
  370. package/dist/runtime/page-defer.d.ts +14 -0
  371. package/dist/runtime/page-defer.js +103 -0
  372. package/dist/runtime/parse-html.d.ts +40 -0
  373. package/dist/runtime/parse-html.js +81 -0
  374. package/dist/runtime/reconcile.d.ts +41 -0
  375. package/dist/runtime/reconcile.js +194 -0
  376. package/dist/runtime/region-attrs.d.ts +95 -0
  377. package/dist/runtime/region-attrs.js +153 -0
  378. package/dist/runtime/region-endpoint-url.d.ts +76 -0
  379. package/dist/runtime/region-endpoint-url.js +169 -0
  380. package/dist/runtime/region-ids.d.ts +8 -0
  381. package/dist/runtime/region-ids.js +33 -0
  382. package/dist/runtime/remote-seeds.d.ts +2 -0
  383. package/dist/runtime/remote-seeds.js +21 -0
  384. package/dist/runtime/render-blocking.d.ts +2 -0
  385. package/dist/runtime/render-blocking.js +30 -0
  386. package/dist/runtime/restore.d.ts +34 -0
  387. package/dist/runtime/restore.js +390 -0
  388. package/dist/runtime/router-nav.d.ts +63 -0
  389. package/dist/runtime/router-nav.js +740 -0
  390. package/dist/runtime/router.d.ts +201 -0
  391. package/dist/runtime/router.js +593 -0
  392. package/dist/runtime/schedule.d.ts +49 -0
  393. package/dist/runtime/schedule.js +256 -0
  394. package/dist/runtime/seeds.d.ts +50 -0
  395. package/dist/runtime/seeds.js +208 -0
  396. package/dist/runtime/session.d.ts +52 -0
  397. package/dist/runtime/session.js +130 -0
  398. package/dist/runtime/sidecar.d.ts +3 -0
  399. package/dist/runtime/sidecar.js +56 -0
  400. package/dist/runtime/slots.d.ts +183 -0
  401. package/dist/runtime/slots.js +44 -0
  402. package/dist/runtime/spa-cacheable.d.ts +7 -0
  403. package/dist/runtime/spa-cacheable.js +18 -0
  404. package/dist/runtime/speculate-hint.d.ts +1 -0
  405. package/dist/runtime/speculate-hint.js +35 -0
  406. package/dist/runtime/svelte-warnings.d.ts +28 -0
  407. package/dist/runtime/svelte-warnings.js +71 -0
  408. package/dist/runtime/wire-classes.d.ts +3 -0
  409. package/dist/runtime/wire-classes.js +69 -0
  410. package/dist/runtime/wire-format.d.ts +7 -0
  411. package/dist/runtime/wire-format.js +22 -0
  412. package/dist/script.d.ts +134 -0
  413. package/dist/script.js +184 -0
  414. package/dist/seed-refs.d.ts +105 -0
  415. package/dist/seed-refs.js +487 -0
  416. package/dist/server/capability-lifetime.d.ts +28 -0
  417. package/dist/server/capability-lifetime.js +31 -0
  418. package/dist/server/dead-kit-resolves.d.ts +1 -0
  419. package/dist/server/dead-kit-resolves.js +39 -0
  420. package/dist/server/document-assembly.d.ts +30 -0
  421. package/dist/server/document-assembly.js +26 -0
  422. package/dist/server/document-tail.d.ts +113 -0
  423. package/dist/server/document-tail.js +208 -0
  424. package/dist/server/endpoint.d.ts +51 -0
  425. package/dist/server/endpoint.js +90 -0
  426. package/dist/server/entry-location.d.ts +8 -0
  427. package/dist/server/entry-location.js +29 -0
  428. package/dist/server/fingerprint.d.ts +1 -0
  429. package/dist/server/fingerprint.js +25 -0
  430. package/dist/server/head-presence.d.ts +45 -0
  431. package/dist/server/head-presence.js +156 -0
  432. package/dist/server/hmac.d.ts +38 -0
  433. package/dist/server/hmac.js +89 -0
  434. package/dist/server/hole-graph.d.ts +7 -0
  435. package/dist/server/hole-graph.js +71 -0
  436. package/dist/server/hole-urls.d.ts +3 -0
  437. package/dist/server/hole-urls.js +76 -0
  438. package/dist/server/html-scan.d.ts +19 -0
  439. package/dist/server/html-scan.js +60 -0
  440. package/dist/server/kit-context.d.ts +78 -0
  441. package/dist/server/kit-context.js +110 -0
  442. package/dist/server/late-wire.d.ts +22 -0
  443. package/dist/server/late-wire.js +28 -0
  444. package/dist/server/page-facts.d.ts +25 -0
  445. package/dist/server/page-facts.js +138 -0
  446. package/dist/server/page-seed.d.ts +33 -0
  447. package/dist/server/page-seed.js +60 -0
  448. package/dist/server/page-stream.d.ts +55 -0
  449. package/dist/server/page-stream.js +121 -0
  450. package/dist/server/payload.d.ts +6 -0
  451. package/dist/server/payload.js +22 -0
  452. package/dist/server/personal-response.d.ts +6 -0
  453. package/dist/server/personal-response.js +13 -0
  454. package/dist/server/props-wire.d.ts +56 -0
  455. package/dist/server/props-wire.js +178 -0
  456. package/dist/server/rate-limit.d.ts +22 -0
  457. package/dist/server/rate-limit.js +63 -0
  458. package/dist/server/region-css.d.ts +5 -0
  459. package/dist/server/region-css.js +30 -0
  460. package/dist/server/region-endpoint.d.ts +35 -0
  461. package/dist/server/region-endpoint.js +142 -0
  462. package/dist/server/region-props.d.ts +6 -0
  463. package/dist/server/region-props.js +44 -0
  464. package/dist/server/remote-seed-gate.d.ts +50 -0
  465. package/dist/server/remote-seed-gate.js +66 -0
  466. package/dist/server/render-cache.d.ts +26 -0
  467. package/dist/server/render-cache.js +51 -0
  468. package/dist/server/render-page.d.ts +51 -0
  469. package/dist/server/render-page.js +176 -0
  470. package/dist/server/render-region-html.d.ts +2 -0
  471. package/dist/server/render-region-html.js +19 -0
  472. package/dist/server/request-stats.d.ts +174 -0
  473. package/dist/server/request-stats.js +54 -0
  474. package/dist/server/reversible.d.ts +83 -0
  475. package/dist/server/reversible.js +994 -0
  476. package/dist/server/seed-shape.d.ts +22 -0
  477. package/dist/server/seed-shape.js +24 -0
  478. package/dist/server/shared-cache.d.ts +35 -0
  479. package/dist/server/shared-cache.js +104 -0
  480. package/dist/server/signing-key.d.ts +11 -0
  481. package/dist/server/signing-key.js +47 -0
  482. package/dist/server/sized-lru.d.ts +20 -0
  483. package/dist/server/sized-lru.js +68 -0
  484. package/dist/server/split-regions.d.ts +81 -0
  485. package/dist/server/split-regions.js +368 -0
  486. package/dist/server/stream-regions.d.ts +5 -0
  487. package/dist/server/stream-regions.js +36 -0
  488. package/dist/shared-state.d.ts +7 -0
  489. package/dist/shared-state.js +152 -0
  490. package/dist/shims/app-environment.d.ts +4 -0
  491. package/dist/shims/app-environment.js +6 -0
  492. package/dist/shims/app-navigation.d.ts +33 -0
  493. package/dist/shims/app-navigation.js +119 -0
  494. package/dist/shims/app-paths.d.ts +6 -0
  495. package/dist/shims/app-paths.js +18 -0
  496. package/dist/shims/app-state.svelte.d.ts +23 -0
  497. package/dist/shims/app-state.svelte.js +50 -0
  498. package/dist/shims/app-stores.d.ts +21 -0
  499. package/dist/shims/app-stores.js +54 -0
  500. package/dist/shims/kit-bridge.d.ts +29 -0
  501. package/dist/shims/kit-bridge.js +7 -0
  502. package/dist/shims/kit-remote/client-stub.d.ts +27 -0
  503. package/dist/shims/kit-remote/client-stub.js +43 -0
  504. package/dist/shims/kit-remote/paths-internal-stub.d.ts +3 -0
  505. package/dist/shims/kit-remote/paths-internal-stub.js +5 -0
  506. package/dist/shims/kit-remote/remote-cache.d.ts +49 -0
  507. package/dist/shims/kit-remote/remote-cache.js +73 -0
  508. package/dist/shims/kit-remote/state-stub.d.ts +8 -0
  509. package/dist/shims/kit-remote/state-stub.js +8 -0
  510. package/dist/shims/page-store.svelte.d.ts +39 -0
  511. package/dist/shims/page-store.svelte.js +77 -0
  512. package/dist/source.d.ts +29 -0
  513. package/dist/source.js +87 -0
  514. package/dist/store-transport.d.ts +86 -0
  515. package/dist/store-transport.js +229 -0
  516. package/dist/tool-fetches.d.ts +5 -0
  517. package/dist/tool-fetches.js +41 -0
  518. package/dist/transport.d.ts +48 -0
  519. package/dist/transport.js +181 -0
  520. package/dist/unscoped-css.d.ts +26 -0
  521. package/dist/unscoped-css.js +53 -0
  522. package/dist/vite/dev-maps.d.ts +33 -0
  523. package/dist/vite/dev-maps.js +140 -0
  524. package/dist/vite/index.d.ts +19 -0
  525. package/dist/vite/index.js +820 -0
  526. package/dist/vite/kit-dirs.d.ts +7 -0
  527. package/dist/vite/kit-dirs.js +67 -0
  528. package/dist/vite/late-island.d.ts +25 -0
  529. package/dist/vite/late-island.js +33 -0
  530. package/dist/vite/module-map.d.ts +8 -0
  531. package/dist/vite/module-map.js +144 -0
  532. package/dist/vite/options.d.ts +208 -0
  533. package/dist/vite/options.js +74 -0
  534. package/dist/vite/package-files.d.ts +3 -0
  535. package/dist/vite/package-files.js +84 -0
  536. package/dist/vite/paths.d.ts +45 -0
  537. package/dist/vite/paths.js +112 -0
  538. package/dist/vite/plugin-api.d.ts +166 -0
  539. package/dist/vite/plugin-api.js +212 -0
  540. package/dist/vite/profiler-maps.d.ts +23 -0
  541. package/dist/vite/profiler-maps.js +178 -0
  542. package/dist/vite/server-sourcemaps.d.ts +8 -0
  543. package/dist/vite/server-sourcemaps.js +80 -0
  544. package/dist/vite/sourcemaps.d.ts +18 -0
  545. package/dist/vite/sourcemaps.js +80 -0
  546. package/dist/vite/style-preprocess.d.ts +2 -0
  547. package/dist/vite/style-preprocess.js +96 -0
  548. package/package.json +180 -6
@@ -0,0 +1,605 @@
1
+ import { set_current_region, set_foreign_hydrate } from "../current-region.js";
2
+ import { capture_region_ids } from "./region-ids.js";
3
+ import { foreign_region_prop_revivers } from "./foreign-props.js";
4
+ import { SEED_REF_KEY, seed_ref_reviver } from "../seed-refs.js";
5
+ import { parse_sidecar_text, seed_data_of, seed_page_once, seed_remote_once } from "./seeds.js";
6
+ import { is_deferred, ours_on_kit_document, region_ssr_truncated } from "./region-attrs.js";
7
+ import { boot_link, slots } from "./slots.js";
8
+ import { keep_host_classes, note_host_classes } from "./host-classes.js";
9
+ import { emit } from "../events/bus.js";
10
+ import { kit_page_thread } from "./kit-page-thread.svelte.js";
11
+ import { hydrate, unmount } from "svelte";
12
+ import NestedProvider from "../NestedProvider.svelte";
13
+ import { install } from "virtual:ogygia/hydrate-features";
14
+ // src/runtime/hydrate-core.ts
15
+ /**
16
+ * THE HYDRATE CORE — everything an island needs only at the moment it hydrates: Svelte's
17
+ * `hydrate`/`unmount`, the `NestedProvider` host, the devalue props parse, the page seed, the
18
+ * DEV props guard. Loaded LAZILY by the region element on its first `#hydrate` (one dynamic
19
+ * import, shared by every island), so a page whose islands all wake on `visible` or `interaction`
20
+ * boots the runtime WITHOUT fetching Svelte's client runtime — that arrives with the first island
21
+ * that actually wakes, together with the island's own chunk. The always-on core (`core.ts`) keeps
22
+ * only what every region needs at connect: the schedule, the observers, the hole fetch.
23
+ *
24
+ * Stateless towards the element: the element owns its handle (`IslandHandle`) and its flags; this
25
+ * module owns the how.
26
+ */
27
+ install();
28
+ const kit_hydrates_page = () => boot_link().kit_hydrates_page();
29
+ const props_sidecar_of = (region) => boot_link().props_sidecar_of(region);
30
+ const parse_region_html = (html) => boot_link().parse_region_html(html);
31
+ const walk_enters = (el) => boot_link().walk_enters(el);
32
+ const is_self_owned = (el) => boot_link().is_self_owned(el);
33
+ const DEVTOOLS = typeof __OGYGIA_DEVTOOLS__ !== "undefined" ? __OGYGIA_DEVTOOLS__ : false;
34
+ /** The morph target for hydration repair: the server sequence Svelte's walk binds — see `repair_markup`. */
35
+ const REPAIR_MORPH = { target: "walk" };
36
+ /** The hydration ENVELOPE: `hydrate()` anchors on a top-level `<!--[-->` comment and then expects
37
+ * the component's OWN region envelope — but embedded SSR (Region.svelte) emits only the inner
38
+ * layer. Idempotent: the second attempt after a failed first one finds it in place. */
39
+ function ensure_envelope(region) {
40
+ if (has_envelope(region)) return;
41
+ region.insertBefore(document.createComment("["), region.firstChild);
42
+ region.appendChild(document.createComment("]"));
43
+ }
44
+ function has_envelope(region) {
45
+ const first = region.firstChild;
46
+ return !!first && first.nodeType === 8 && first.data === "[";
47
+ }
48
+ /** Set the first time {@link neutralize_head_hydration_markers} runs on this document (once per page). */
49
+ let head_markers_neutralized = false;
50
+ /**
51
+ * MAKE `<svelte:head>` HYDRATION SAFE on a csr=false document, before any island's head effect runs.
52
+ * The caller runs this once per document (see the `head_markers_neutralized` guard at its call site).
53
+ *
54
+ * Svelte renders a component's `<svelte:head>` into `document.head`, not into the component's own
55
+ * DOM, and delimits each block there as `<!--HASH-->` …content… `<!---->` (svelte/internal/server
56
+ * `head()`). Its CLIENT `head(HASH, …)` hydrates by scanning document.head for the comment whose data
57
+ * is HASH, then walking the nodes right after it as that block's content. That contract holds for a
58
+ * whole-page hydrate (csr=true — Kit owns it, and this function never runs), but an ogygia island
59
+ * hydrates in ISOLATION while that scan still reads the ONE shared document.head. By island-wake time
60
+ * a third party has usually mutated the head (a design-system/monitoring inject, a hoisted sheet); a
61
+ * foreign node landing in a block's range desyncs the walk into `set_attribute()` on a non-element,
62
+ * which throws and discards the ENTIRE island (it never wakes). Note ogygia already keeps its OWN
63
+ * head writes off this range by inserting region sheets at the head TOP (core.ts) — this closes the
64
+ * same hole for head writes ogygia does not control.
65
+ *
66
+ * The fix is Svelte's own documented fallback: when `head()` finds no matching HASH marker it flips
67
+ * out of hydration mode and RE-RENDERS the block fresh (svelte-head.js, `head_anchor === null`).
68
+ * Removing the open markers up front takes every island's head down that safe path instead of the
69
+ * fragile walk. The SSR-rendered head ELEMENTS stay (correct, already applied — sheets loaded, title
70
+ * set) until the island's own live copy exists; then the island owns its head content and the
71
+ * page's copy is retired (runtime/session.ts — who owns each node in <head>, and the one-copy rule).
72
+ *
73
+ * A head block is `<!--HASH-->` …content… `<!---->` — the HASH open and the empty close both sit at
74
+ * the head's TOP LEVEL, while the content in between may carry Svelte's own block anchors when the head
75
+ * is looped or branched: `{#if}`/`{#each}`/`{:else}` emit `<!--[-->` / `<!--[!-->` / `<!--[?-->` opens
76
+ * and `<!--]-->` closes (svelte constants HYDRATION_START… and HYDRATION_END). So the open markers are found
77
+ * by walking head's DIRECT children while tracking bracket depth: a comment whose data starts with `[`
78
+ * is a block open (depth+1), `]` is a block close (depth−1), and at depth 0 a non-bracket, non-empty
79
+ * comment is a head-block HASH open — confirmed when a depth-0 empty `<!---->` later closes its block.
80
+ * That confirmation is what tells a real head marker from a lone third-party head comment (which has no
81
+ * depth-0 empty close), so only genuine markers are removed; page/layout head blocks keep every rendered
82
+ * element (their inert markers go), and element children are never descended into.
83
+ */
84
+ function neutralize_head_hydration_markers() {
85
+ const head = typeof document !== "undefined" ? document.head : null;
86
+ if (!head) return;
87
+ let depth = 0;
88
+ let pending_open = null;
89
+ const to_remove = [];
90
+ for (let n = head.firstChild; n; n = n.nextSibling) {
91
+ if (n.nodeType !== 8) continue;
92
+ const data = n.data;
93
+ if (data[0] === "[") {
94
+ depth++;
95
+ continue;
96
+ }
97
+ if (data === "]") {
98
+ if (depth > 0) depth--;
99
+ continue;
100
+ }
101
+ if (depth !== 0) continue;
102
+ if (data === "") {
103
+ if (pending_open) {
104
+ to_remove.push(pending_open);
105
+ pending_open = null;
106
+ }
107
+ } else pending_open = n;
108
+ }
109
+ for (const m of to_remove) m.remove();
110
+ }
111
+ /**
112
+ * REPAIR the island's light DOM toward its server markup, keeping every element it still has.
113
+ *
114
+ * Svelte's walk cares about the node SEQUENCE (elements, text, comments), never about attributes.
115
+ * The edits sleeping islands actually receive keep the element skeleton and touch what is between
116
+ * the elements: a design-system runtime strips the whitespace text nodes, an A/B tool leaves a
117
+ * comment. So: match the live elements to the server markup's elements one to one (same count,
118
+ * same tags, recursively), and rebuild only the text and comment nodes around them from the server
119
+ * copy. No element is created, so no upgraded custom element reacts — the design-system element
120
+ * that re-strips the island on every connect (measured on a customer deploy) is left exactly where
121
+ * it is, and the walk that follows sees the server's sequence.
122
+ *
123
+ * Only when the element skeleton itself differs (an element removed or added) does the repair fall
124
+ * to the morph (existing nodes still keep their identity where the morph can match them), or to a
125
+ * plain `innerHTML` swap where the runtime has no morph. Those paths may re-create an element, and
126
+ * a re-created element may react once more; the second attempt tells.
127
+ *
128
+ * The morph runs in its STRICT contract here ({@link REPAIR_MORPH}): the target is the server's node
129
+ * sequence, exactly. The live morph's "a self-owned element keeps the children it gave itself" rule is
130
+ * right for a hole re-answer, but in a repair it is the residue that breaks the walk — a node a
131
+ * web-component runtime added inside a nested custom element is exactly what Svelte's cursor then
132
+ * lands on (`getAttribute is not a function`), and the island discards.
133
+ */
134
+ function repair_markup(region, want) {
135
+ if (align_to(region, want)) return;
136
+ const nodes = Array.from(want.childNodes);
137
+ const morph = slots.morph;
138
+ if (morph) morph(region, nodes, REPAIR_MORPH);
139
+ else region.replaceChildren(...nodes);
140
+ }
141
+ /**
142
+ * Does the live node SEQUENCE differ from the server's? Exactly what Svelte's walk reads: node
143
+ * types, element tags, text and comment data, recursively — never attributes (a custom element
144
+ * upgrading adds `tabindex`, `aria-*`, ids; the walk does not care, and neither does this).
145
+ *
146
+ * Asked BEFORE the first hydrate attempt, not after a failed one: Svelte's walk does not verify
147
+ * tags, so on a shifted sequence it writes attributes onto whatever node sits at its cursor —
148
+ * measured on a customer deploy, the login trigger's `id`/`class`/`text` landed on the dropdown's
149
+ * wrapper `<div>` — and only throws further down. A repair that came after would put the text
150
+ * nodes back and leave those attributes on the wrong elements (an unstyled dropdown). Repairing
151
+ * first, the walk never runs on the edited sequence.
152
+ */
153
+ function sequence_differs(live, want) {
154
+ const a = live.childNodes;
155
+ const b = want.childNodes;
156
+ if (a.length !== b.length) return true;
157
+ for (let i = 0; i < a.length; i++) {
158
+ const x = a[i];
159
+ const y = b[i];
160
+ if (x.nodeType !== y.nodeType) return true;
161
+ if (x.nodeType === 1) {
162
+ if (x.tagName !== y.tagName) return true;
163
+ if (walk_enters(x) && sequence_differs(x, y)) return true;
164
+ } else if (x.nodeValue !== y.nodeValue) return true;
165
+ }
166
+ return false;
167
+ }
168
+ /** Any non-whitespace char? A char-code scan, not `/\S/` — this walks on every drift check. */
169
+ function has_non_ws(s) {
170
+ if (!s) return false;
171
+ for (let i = 0; i < s.length; i++) {
172
+ const c = s.charCodeAt(i);
173
+ if (c !== 32 && c !== 9 && c !== 10 && c !== 12 && c !== 13) return true;
174
+ }
175
+ return false;
176
+ }
177
+ /** A short label for a node in a divergence message: the tag for an element, else its kind. */
178
+ function node_label(n) {
179
+ if (n.nodeType === 1) return `<${n.tagName.toLowerCase()}>`;
180
+ if (n.nodeType === 3) return has_non_ws(n.nodeValue) ? "a text node" : "whitespace";
181
+ if (n.nodeType === 8) return "a comment";
182
+ return "a node";
183
+ }
184
+ /** A guess at WHAT left a foreign node in the region's light DOM, read off the node's shape — the
185
+ * tell-tales of the passes that reshape a region between SSR and wake: a scoped-CSS or web-component
186
+ * runtime, a declarative-shadow-DOM injector, a whitespace normalizer. Names the observable evidence
187
+ * (a tag, an attribute pattern), never a specific tool. The "why" a recovery is otherwise silent
188
+ * about; empty when nothing recognizable. */
189
+ function culprit_hint(n) {
190
+ if (n.nodeType !== 1) return "";
191
+ const el = n;
192
+ const tag = el.tagName.toLowerCase();
193
+ if (tag === "style") return " — an injected <style> (scoped CSS from a component/design-system runtime)";
194
+ if (tag === "template" && el.hasAttribute("shadowrootmode")) return " — a declarative shadow-DOM template injected after SSR";
195
+ for (const a of el.attributes) if (a.name.startsWith("sc-") || a.name === "s-id" || a.name === "c-id" || a.name === "s-sn") return " — scoped web-component hydration marks (sc-*, s-id, c-id) a component runtime stamped over the island";
196
+ if (el.classList.contains("hydrated")) return " — a web-component runtime marked it `hydrated`";
197
+ return "";
198
+ }
199
+ /** Describe the FIRST place the live light DOM diverges from `want` (the server copy) — the specific
200
+ * reason an island drifted, for the DEV console + devtools (never a bare "it was recovered"). Mirrors
201
+ * {@link sequence_differs}' walk exactly, so it names the divergence that trips the repair. `null`
202
+ * when the sequences match. DEV / devtools only — prod DCEs the call site, so this never runs there. */
203
+ function describe_divergence(live, want, where = "the island") {
204
+ const a = live.childNodes;
205
+ const b = want.childNodes;
206
+ if (a.length !== b.length) {
207
+ const longer = a.length > b.length ? a : b;
208
+ const shorter = a.length > b.length ? b : a;
209
+ let i = 0;
210
+ while (i < shorter.length && longer[i].nodeType === shorter[i].nodeType && (longer[i].nodeType !== 1 || longer[i].tagName === shorter[i].tagName)) i++;
211
+ const node = longer[i] ?? longer[longer.length - 1];
212
+ if (a.length > b.length) return `${a.length - b.length} node(s) were inserted into ${where} — e.g. ${node_label(node)}${culprit_hint(node)}`;
213
+ const ws = node.nodeType === 3 && !has_non_ws(node.nodeValue);
214
+ return `${b.length - a.length} node(s) the server sent were removed from ${where} — e.g. ${node_label(node)}${ws ? " (whitespace stripped by a DOM-normalizing pass)" : ""}`;
215
+ }
216
+ for (let i = 0; i < a.length; i++) {
217
+ const x = a[i];
218
+ const y = b[i];
219
+ if (x.nodeType !== y.nodeType || x.nodeType === 1 && x.tagName !== y.tagName) return `${where}: the server sent ${node_label(y)} but the browser had ${node_label(x)}${culprit_hint(x)}`;
220
+ if (x.nodeType === 1) {
221
+ if (!walk_enters(x)) continue;
222
+ const deeper = describe_divergence(x, y, node_label(x));
223
+ if (deeper) return deeper;
224
+ } else if (x.nodeValue !== y.nodeValue) return `${where}: the text of ${node_label(y)} changed (a translator or text rewrite)`;
225
+ }
226
+ return null;
227
+ }
228
+ /** The first ownership conflict the current repair met (DEV / devtools read it), or `null`. */
229
+ let conflict = null;
230
+ function note_conflict(el) {
231
+ conflict ??= `${node_label(el)} is a web component that changed its own children in a position Svelte's hydration reads, so the repair had to remove the nodes it added. Render that subtree with {@html} or as static markup (Svelte never reads inside it), put it in a lake (wake: 'none'), or mark the element data-ogygia-keep.`;
232
+ }
233
+ /** Put the island's light DOM back to the server's node sequence when it drifted while the island
234
+ * slept. Returns whether a repair was made and, in DEV / devtools, WHY it drifted (the first
235
+ * divergence, named before the repair rewrites the sequence). Called with the island's lakes LIFTED
236
+ * (lakes.ts): a lake's content is never part of the walk, and it may legitimately differ from the
237
+ * server copy by now (a live lake refreshes itself to the visitor before its host wakes) — so the
238
+ * copy's direct lakes are emptied the same way before the comparison, and the repair never touches
239
+ * them. */
240
+ function repair_if_drifted(region, ssr_html) {
241
+ const content = parse_region_html(ssr_html);
242
+ const want = content.ownerDocument.createElement("ogygia-region");
243
+ want.appendChild(content);
244
+ slots.lakes.lift(want);
245
+ if (!sequence_differs(region, want)) return {
246
+ repaired: false,
247
+ reason: null,
248
+ conflict: null
249
+ };
250
+ const reason = import.meta.env.DEV || DEVTOOLS ? describe_divergence(region, want) : null;
251
+ conflict = null;
252
+ repair_markup(region, want);
253
+ const met = conflict;
254
+ conflict = null;
255
+ return {
256
+ repaired: true,
257
+ reason,
258
+ conflict: met
259
+ };
260
+ }
261
+ /** Make `live`'s child sequence the server's (`want`), keeping `live`'s elements. `false` when the
262
+ * element skeleton differs (no changes made at that level). */
263
+ function align_to(live, want) {
264
+ const live_elements = element_children(live);
265
+ const want_elements = element_children(want);
266
+ if (live_elements.length !== want_elements.length) return false;
267
+ for (let i = 0; i < live_elements.length; i++) if (live_elements[i].tagName !== want_elements[i].tagName) return false;
268
+ for (let i = 0; i < live_elements.length; i++) {
269
+ const child = live_elements[i];
270
+ if (!walk_enters(child)) continue;
271
+ if (!align_to(child, want_elements[i])) {
272
+ if (is_self_owned(child)) note_conflict(child);
273
+ const morph = slots.morph;
274
+ if (morph) morph(child, Array.from(want_elements[i].childNodes), REPAIR_MORPH);
275
+ else child.innerHTML = want_elements[i].innerHTML;
276
+ }
277
+ }
278
+ for (const node of Array.from(live.childNodes)) if (node.nodeType !== 1) node.remove();
279
+ let next = 0;
280
+ for (const node of Array.from(want.childNodes)) {
281
+ if (node.nodeType === 1) {
282
+ next++;
283
+ continue;
284
+ }
285
+ const before = live_elements[next] ?? null;
286
+ live.insertBefore(node.cloneNode(true), before);
287
+ }
288
+ return true;
289
+ }
290
+ function element_children(node) {
291
+ const out = [];
292
+ for (const child of node.childNodes) if (child.nodeType === 1) out.push(child);
293
+ return out;
294
+ }
295
+ /** Svelte's own line from inside its hydrate catch, printed BEFORE it throws `hydration_failed`
296
+ * to us. A speculative attempt (recovery off) is ours to report — healed, or handed to Svelte's
297
+ * recovery, which prints its own line then. Swallow exactly this message for the synchronous
298
+ * duration of such an attempt, nothing else. */
299
+ const SVELTE_FAILED_TO_HYDRATE = "Failed to hydrate";
300
+ function quietly(fn) {
301
+ const warn = console.warn;
302
+ console.warn = (...args) => {
303
+ if (typeof args[0] === "string" && args[0].startsWith(SVELTE_FAILED_TO_HYDRATE)) return;
304
+ warn.apply(console, args);
305
+ };
306
+ try {
307
+ return fn();
308
+ } finally {
309
+ console.warn = warn;
310
+ }
311
+ }
312
+ const HEALED_WARNING = "[ogygia] island \"%s\" was edited while it slept (its light DOM no longer matched the server render — a design-system runtime, an A/B tool, a translator), so its server HTML was put back and hydrated instead of re-rendering it client-side. Whatever the edit added is gone; the script that made it should leave <ogygia-region> subtrees alone.";
313
+ /** Is this entry another build's (fragment federation): absolute, different origin. */
314
+ function is_foreign_entry(entry) {
315
+ return boot_link().ABSOLUTE_URL_SCHEME.test(entry) && new URL(entry).origin !== location.origin;
316
+ }
317
+ let cached_wire;
318
+ let cached_revivers;
319
+ function region_prop_revivers() {
320
+ const wire = slots.wire;
321
+ if (wire === cached_wire) return cached_revivers;
322
+ cached_wire = wire;
323
+ cached_revivers = wire ? { [wire.REF_WIRE_KEY]: (d) => wire.resolve(d, true) } : { OgygiaRef: () => {
324
+ throw new Error("wired prop but no wire feature in this build — ogygia detection bug, please report");
325
+ } };
326
+ return cached_revivers;
327
+ }
328
+ /**
329
+ * Parse a region's `<script data-ogygia-props>` sidecar (keyed at the end of the body, or adjacent —
330
+ * runtime/sidecar.ts). Uses the client reviver (`remember: true`) so a named/shared transportable
331
+ * reunites with its live instance. Returns `{}` when there is no props sidecar.
332
+ */
333
+ function read_region_props(region, foreign = false) {
334
+ const sidecar = props_sidecar_of(region);
335
+ if (!sidecar) return {};
336
+ const base = foreign ? foreign_region_prop_revivers() : region_prop_revivers();
337
+ const doc = sidecar.ownerDocument;
338
+ const revivers = foreign ? base : {
339
+ ...base,
340
+ [SEED_REF_KEY]: seed_ref_reviver(() => seed_data_of(doc))
341
+ };
342
+ return parse_sidecar_text(sidecar, revivers);
343
+ }
344
+ /**
345
+ * DEV-ONLY props mutation guard. Island props cross the boundary as a serialized devalue snapshot
346
+ * of the host — or, for a seed REFERENCE, as the page seed's own node, shared by reference with
347
+ * `page.data` and every other island that references it. Writing to either inside the island is a
348
+ * bug: the snapshot updates nothing, the reference leaks into page.data.
349
+ */
350
+ var PropMutationGuard = class {
351
+ #warned = /* @__PURE__ */ new Set();
352
+ #warn(entry, prop_path) {
353
+ const key = entry + "" + prop_path;
354
+ if (this.#warned.has(key)) return;
355
+ this.#warned.add(key);
356
+ console.warn(`[ogygia] mutating prop '${prop_path}' inside island ${entry} — island props are a serialized snapshot of the host, or a reference into page.data shared with every island that reads it: the write updates nothing (or leaks into page.data). Move mutable state inside the island component.`);
357
+ }
358
+ #guard_map(map, entry, prop_path) {
359
+ const mutators = /* @__PURE__ */ new Set([
360
+ "set",
361
+ "delete",
362
+ "clear"
363
+ ]);
364
+ return new Proxy(map, { get: (target, prop) => {
365
+ const value = Reflect.get(target, prop);
366
+ if (typeof value !== "function") return value;
367
+ if (typeof prop === "string" && mutators.has(prop)) return (...args) => {
368
+ this.#warn(entry, `${prop_path}.${prop}()`);
369
+ return value.apply(target, args);
370
+ };
371
+ return value.bind(target);
372
+ } });
373
+ }
374
+ #guard_set(set, entry, prop_path) {
375
+ const mutators = /* @__PURE__ */ new Set([
376
+ "add",
377
+ "delete",
378
+ "clear"
379
+ ]);
380
+ return new Proxy(set, { get: (target, prop) => {
381
+ const value = Reflect.get(target, prop);
382
+ if (typeof value !== "function") return value;
383
+ if (typeof prop === "string" && mutators.has(prop)) return (...args) => {
384
+ this.#warn(entry, `${prop_path}.${prop}()`);
385
+ return value.apply(target, args);
386
+ };
387
+ return value.bind(target);
388
+ } });
389
+ }
390
+ #guard_value(value, entry, prop_path) {
391
+ if (value === null || typeof value !== "object") return value;
392
+ if (value instanceof Map) return this.#guard_map(value, entry, prop_path);
393
+ if (value instanceof Set) return this.#guard_set(value, entry, prop_path);
394
+ if (value instanceof Date || value instanceof RegExp || value instanceof URL) return value;
395
+ const proto = Object.getPrototypeOf(value);
396
+ if (!Array.isArray(value) && proto !== Object.prototype && proto !== null) return value;
397
+ return new Proxy(value, {
398
+ get: (target, prop, receiver) => {
399
+ const child = Reflect.get(target, prop, receiver);
400
+ if (typeof prop === "symbol") return child;
401
+ return this.#guard_value(child, entry, prop_path ? `${prop_path}.${String(prop)}` : String(prop));
402
+ },
403
+ set: (target, prop, next, receiver) => {
404
+ if (typeof prop !== "symbol") this.#warn(entry, prop_path ? `${prop_path}.${String(prop)}` : String(prop));
405
+ return Reflect.set(target, prop, next, receiver);
406
+ },
407
+ deleteProperty: (target, prop) => {
408
+ if (typeof prop !== "symbol") this.#warn(entry, prop_path ? `${prop_path}.${String(prop)}` : String(prop));
409
+ return Reflect.deleteProperty(target, prop);
410
+ },
411
+ defineProperty: (target, prop, descriptor) => {
412
+ if (typeof prop !== "symbol") this.#warn(entry, prop_path ? `${prop_path}.${String(prop)}` : String(prop));
413
+ return Reflect.defineProperty(target, prop, descriptor);
414
+ }
415
+ });
416
+ }
417
+ wrap(props, entry) {
418
+ if (!(import.meta.env && import.meta.env.DEV)) return props;
419
+ return this.#guard_value(props, entry, "");
420
+ }
421
+ };
422
+ const prop_guard = new PropMutationGuard();
423
+ /** Svelte's `unmount`, typed for the opaque app this module hands around. */
424
+ const unmount_app = (app) => void unmount(app);
425
+ /** A handle over a mounted Svelte app: dispose unmounts, `set_props` pushes through a host. */
426
+ function handle(app, dispose_with, entry, host) {
427
+ const h = { dispose() {
428
+ try {
429
+ dispose_with(app);
430
+ } catch {}
431
+ } };
432
+ if (host) {
433
+ const live = app;
434
+ h.set_props = (props) => live.setProps?.(prop_guard.wrap(props, entry));
435
+ }
436
+ return h;
437
+ }
438
+ /**
439
+ * THE island hydrate step — synchronous from here on (the element already awaited the module and
440
+ * its scheduler turn): seeds, props, envelope, `hydrate()` through the provider, lake restore,
441
+ * the mutation detector. Returns the handle, or `null` when the island is not ours to hydrate (a
442
+ * Kit-hydrated page — marked `data-kit-hydrated`). Throws on a failed hydrate; the element reports.
443
+ */
444
+ function hydrate_island(region, entry, mod, ssr_html = null, touched = true) {
445
+ seed_remote_once();
446
+ seed_page_once();
447
+ const Component = mod.default;
448
+ const foreign = is_foreign_entry(entry);
449
+ const props = capture_region_ids(region, () => read_region_props(region, foreign));
450
+ if (kit_hydrates_page() && !ours_on_kit_document(region)) {
451
+ region.setAttribute("data-kit-hydrated", "");
452
+ if (import.meta.env.DEV) console.warn(`[ogygia] island "${entry}" is on a csr=true page; Kit hydrates it, so the island directive is redundant here (it behaves as a normal component).`);
453
+ return null;
454
+ }
455
+ if (!kit_hydrates_page() && !head_markers_neutralized) {
456
+ head_markers_neutralized = true;
457
+ neutralize_head_hydration_markers();
458
+ }
459
+ if (import.meta.env.DEV && !is_deferred(region) && region_ssr_truncated(region)) console.warn(`[ogygia] island "${entry}" rendered a BLOCK element inline inside a <p> (or other phrasing-only context). The browser's HTML parser hoisted that block out of the paragraph before hydration, so this region is empty and a SECOND copy is about to mount here — the server-rendered copy is now an orphaned sibling of the paragraph. Fix: make the component render an inline element (e.g. <span> instead of <div>), or place the island on its own line (block context) rather than inside a sentence.`);
460
+ const head_before = new Set(document.head.children);
461
+ let lifted = slots.lakes.lift(region);
462
+ const drift = ssr_html !== null && touched && region.isConnected ? repair_if_drifted(region, ssr_html) : {
463
+ repaired: false,
464
+ reason: null,
465
+ conflict: null
466
+ };
467
+ const repaired = drift.repaired;
468
+ try {
469
+ if (!region.isConnected) return null;
470
+ const ssr_children = Array.from(region.children);
471
+ const foreign_delegate = foreign && typeof mod.__og_hydrate === "function";
472
+ const wrapped = foreign ? props : prop_guard.wrap(props, entry);
473
+ const KeepHost = slots.keep ?? slots.live;
474
+ const keep = region.hasAttribute("data-ogygia-keep") && !!KeepHost;
475
+ if (keep && import.meta.env.DEV && !document.querySelector("meta[name=\"ogygia-router\"]")) console.warn(`[ogygia] island "${entry}" has keep:'${region.getAttribute("data-ogygia-keep")}' but the SPA router is off (ogygia({ router: false })) — keep relies on SPA navigation; a full-page load replaces the DOM, so the attribute is a no-op here.`);
476
+ /**
477
+ * ONE hydrate attempt. `recover: false` makes Svelte THROW on a mismatch (`hydration_failed`)
478
+ * instead of silently discarding the server DOM and re-rendering — that silent path is what
479
+ * the self-heal below replaces; `recover: true` is that path, the last resort.
480
+ *
481
+ * Hydration envelope: `render()` (region endpoint / deferred swap) has BOTH anchor layers —
482
+ * do not wrap again or hydration mismatches. (Verified against svelte 5.56.) Hydrate through
483
+ * NestedProvider so descendants see the "inside a hydrated island" context — any nested
484
+ * island wrapper then degrades to a plain inline component (single hydration with this
485
+ * parent). The provider adds no DOM, so this matches SSR.
486
+ */
487
+ const attempt = (recover) => {
488
+ if (!is_deferred(region) && !foreign_delegate) ensure_envelope(region);
489
+ set_current_region(region);
490
+ try {
491
+ if (foreign_delegate) {
492
+ set_foreign_hydrate({
493
+ origin: new URL(entry).origin,
494
+ entry
495
+ });
496
+ return handle(mod.__og_hydrate(region, wrapped, recover ? void 0 : { recover: false }), mod.__og_unmount ?? (() => {}), entry, false);
497
+ }
498
+ const provided_ctx = capture_region_ids(region, () => slots.context?.(region));
499
+ const recovery = recover ? {} : { recover: false };
500
+ if (keep) return handle(hydrate(KeepHost, {
501
+ target: region,
502
+ props: {
503
+ component: Component,
504
+ initialProps: wrapped
505
+ },
506
+ ...provided_ctx ? { context: provided_ctx } : {},
507
+ ...recovery
508
+ }), unmount_app, entry, true);
509
+ return handle(hydrate(NestedProvider, {
510
+ target: region,
511
+ props: {
512
+ component: Component,
513
+ props: wrapped
514
+ },
515
+ ...provided_ctx ? { context: provided_ctx } : {},
516
+ ...recovery
517
+ }), unmount_app, entry, false);
518
+ } finally {
519
+ set_current_region(null);
520
+ set_foreign_hydrate(null);
521
+ }
522
+ };
523
+ let out;
524
+ let healed = false;
525
+ let strict_error = null;
526
+ const host_classes = note_host_classes(region);
527
+ try {
528
+ out = quietly(() => attempt(false));
529
+ healed = repaired;
530
+ } catch (err) {
531
+ strict_error = err;
532
+ out = attempt(true);
533
+ }
534
+ keep_host_classes(host_classes);
535
+ if (healed) {
536
+ region.setAttribute("data-og-healed", drift.reason || "");
537
+ if (DEVTOOLS) emit({
538
+ domain: "runtime",
539
+ name: "region.hydrate.healed",
540
+ entry,
541
+ fp: region.getAttribute("data-og-fp") || void 0,
542
+ reason: drift.reason || void 0
543
+ });
544
+ if (import.meta.env.DEV) console.warn(HEALED_WARNING + (drift.reason ? `\nWhat drifted: ${drift.reason}` : ""), entry);
545
+ }
546
+ if (drift.conflict) {
547
+ if (DEVTOOLS) emit({
548
+ domain: "runtime",
549
+ name: "region.hydrate.conflict",
550
+ entry,
551
+ fp: region.getAttribute("data-og-fp") || void 0,
552
+ reason: drift.conflict
553
+ });
554
+ if (import.meta.env.DEV) console.warn(`[ogygia] ${drift.conflict}`, entry);
555
+ }
556
+ slots.lakes.restore(region, lifted);
557
+ lifted = null;
558
+ if (!region.isConnected) {
559
+ out.dispose();
560
+ return null;
561
+ }
562
+ if (ssr_children.length > 0 && !ssr_children.some((el) => region.contains(el))) {
563
+ region.setAttribute("data-og-recovered", drift.reason || "");
564
+ if (DEVTOOLS) emit({
565
+ domain: "runtime",
566
+ name: "region.hydrate.recovered",
567
+ entry,
568
+ fp: region.getAttribute("data-og-fp") || void 0,
569
+ reason: drift.reason || void 0
570
+ });
571
+ console.warn(`[ogygia] island "${entry}" discarded its ENTIRE server-rendered DOM during hydration and re-rendered client-side (Svelte hydration-mismatch recovery). Three things cause this. (1) Something changed this region's HTML between SSR and wake — a post-SSR transform (transformPageChunk / an HTML-rewriting middleware), an A/B-testing snippet, or an edge rewriter; whatever it injected (e.g. declarative shadow DOM) was just destroyed, and the swap is timing-dependent, so symptoms look erratic. (2) A component in this island reads a page/layout CONTEXT via plain Svelte setContext — on csr=false that runs only on the server, so getContext returns undefined on the client and the island renders a different tree. (3) A block in this island ({#if} / {:else if} / {#each} / {#await}) took a DIFFERENT branch on the client than on the server — its condition reads something that differs between the two (a browser global, a store's client default, url/page state, a Date). Svelte recovers a branch mismatch SILENTLY (no throw); the walk is then off and the rest of the tree follows.` + (drift.reason ? `\nWhat changed: ${drift.reason}` : "") + (strict_error ? `\nSvelte threw on the strict attempt (after repair): ${strict_error instanceof Error ? strict_error.message : String(strict_error)}` : drift.reason ? `\nSvelte did not throw after the repair — the mismatch is one this walk does not model.` : "\nThe server node sequence was INTACT and Svelte did not throw: nothing mutated this region's DOM, so this is (3) (or (2)). Find the block whose branch differs: in the server markup its anchor reads <!--[N--> where N is the branch the SERVER chose.") + "\nFix: for (1) make the mutation invisible to hydration (mutate only <head>, attributes, or shadow templates — never the region's light DOM), or freeze the foreign-owned subtree with a wake:'none' (lake) boundary; for (2) provide the value with setContext / <Provide> / createContext imported from 'ogygia', read it with the same getContext(key); for (3) make the condition read the same value on both sides (a prop / page.data), or move the browser-only branch behind an $effect / hydratedBy().");
572
+ }
573
+ if (!kit_hydrates_page()) boot_link().runtime_session.record_island_head(head_before);
574
+ return out;
575
+ } finally {
576
+ if (lifted) slots.lakes.restore(region, lifted);
577
+ }
578
+ }
579
+ /**
580
+ * Hydrate a live region's swapped-in HTML through {@link LiveHost} (props-pushable). A live region's
581
+ * HTML comes from svelte `render()` (both envelope layers) — same as the deferred swap path, so it
582
+ * is NOT wrapped in extra `[..]` hydration comments. `null` when the live feature is absent.
583
+ */
584
+ function hydrate_live(region, entry, mod, props) {
585
+ seed_remote_once();
586
+ seed_page_once();
587
+ const LiveHost = slots.live;
588
+ if (!LiveHost) {
589
+ if (import.meta.env.DEV) console.warn("[ogygia] live region needs the live feature plugin (LiveHost missing)");
590
+ return null;
591
+ }
592
+ const provided_ctx = capture_region_ids(region, () => slots.context?.(region));
593
+ const host_classes = note_host_classes(region);
594
+ const app = hydrate(LiveHost, {
595
+ target: region,
596
+ props: {
597
+ component: mod.default,
598
+ initialProps: prop_guard.wrap(props, entry)
599
+ },
600
+ ...provided_ctx ? { context: provided_ctx } : {}
601
+ });
602
+ keep_host_classes(host_classes);
603
+ return handle(app, unmount_app, entry, true);
604
+ }
605
+ export { hydrate_island, hydrate_live, is_foreign_entry, kit_page_thread, neutralize_head_hydration_markers, read_region_props, repair_if_drifted, seed_page_once, seed_remote_once, sequence_differs };
@@ -0,0 +1,2 @@
1
+ import { bootDev } from "./full.js";
2
+ export { bootDev };
@@ -0,0 +1 @@
1
+ export { bootDev } from "./full.js";
@@ -0,0 +1,11 @@
1
+ import { FieldSnapshot, QueuedClick } from "./interaction.js";
2
+ /**
3
+ * Replay the queued clicks in arrival order at each click's address (tag-checked against drift).
4
+ * One frame later: hydration just (re)bound the island's web-component wiring (a dropdown web
5
+ * component's `target` element, set by a reactive statement) and many components apply such
6
+ * changes in their own render tick. A synchronous replay lands before that tick and toggles
7
+ * nothing; after a frame the component is settled.
8
+ */
9
+ export declare function replay_clicks(region: Element, queued: QueuedClick[]): void;
10
+ /** The island is live: fields back, focus back, clicks replayed. */
11
+ export declare function after_wake(region: Element, fields: FieldSnapshot[], active_addr: number[] | null, queued: QueuedClick[]): void;