@omerdlw/base-framework 3.0.1 → 3.2.0

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 (1132) hide show
  1. package/MIGRATION.md +75 -0
  2. package/README.md +33 -25
  3. package/dist/ambient/index.d.ts +1 -0
  4. package/dist/ambient/index.js +14 -0
  5. package/dist/ambient/server/index.d.ts +1 -0
  6. package/dist/ambient/server/index.js +238 -0
  7. package/dist/ambient/server/index.js.map +1 -0
  8. package/dist/ambient/worker/index.d.ts +1 -0
  9. package/dist/ambient/worker/index.js +143 -0
  10. package/dist/ambient/worker/index.js.map +1 -0
  11. package/dist/background/index.d.ts +1 -0
  12. package/dist/background/index.js +13 -0
  13. package/dist/chunk-2223J34C.js +850 -0
  14. package/dist/chunk-2223J34C.js.map +1 -0
  15. package/dist/chunk-2LGI33JP.js +832 -0
  16. package/dist/chunk-2LGI33JP.js.map +1 -0
  17. package/dist/chunk-37OBXNEO.js +116 -0
  18. package/dist/chunk-37OBXNEO.js.map +1 -0
  19. package/dist/chunk-4OQGXZIH.js +1435 -0
  20. package/dist/chunk-4OQGXZIH.js.map +1 -0
  21. package/dist/chunk-5H6FZW3N.js +535 -0
  22. package/dist/chunk-5H6FZW3N.js.map +1 -0
  23. package/dist/chunk-7RSRDKYE.js +22 -0
  24. package/dist/chunk-7RSRDKYE.js.map +1 -0
  25. package/dist/chunk-AYUEZPAN.js +15762 -0
  26. package/dist/chunk-AYUEZPAN.js.map +1 -0
  27. package/dist/chunk-BCFJSPTI.js +261 -0
  28. package/dist/chunk-BCFJSPTI.js.map +1 -0
  29. package/dist/chunk-BMFHS3GV.js +118 -0
  30. package/dist/chunk-BMFHS3GV.js.map +1 -0
  31. package/dist/chunk-CRKJAACG.js +81 -0
  32. package/dist/chunk-CRKJAACG.js.map +1 -0
  33. package/dist/chunk-CT4UILO2.js +537 -0
  34. package/dist/chunk-CT4UILO2.js.map +1 -0
  35. package/dist/chunk-ESD5EQ5H.js +178 -0
  36. package/dist/chunk-ESD5EQ5H.js.map +1 -0
  37. package/dist/chunk-GCHQ5OC4.js +460 -0
  38. package/dist/chunk-GCHQ5OC4.js.map +1 -0
  39. package/dist/chunk-GT4COZI7.js +110 -0
  40. package/dist/chunk-GT4COZI7.js.map +1 -0
  41. package/dist/chunk-H6HRU3XN.js +567 -0
  42. package/dist/chunk-H6HRU3XN.js.map +1 -0
  43. package/dist/chunk-J3VTDBC6.js +14 -0
  44. package/dist/chunk-J3VTDBC6.js.map +1 -0
  45. package/dist/chunk-LTO77WSO.js +140 -0
  46. package/dist/chunk-LTO77WSO.js.map +1 -0
  47. package/dist/chunk-MCYHKFZL.js +17 -0
  48. package/dist/chunk-MCYHKFZL.js.map +1 -0
  49. package/dist/chunk-NHOJWICA.js +2367 -0
  50. package/dist/chunk-NHOJWICA.js.map +1 -0
  51. package/dist/chunk-QMFV53PP.js +1766 -0
  52. package/dist/chunk-QMFV53PP.js.map +1 -0
  53. package/dist/chunk-RDYYP36I.js +27 -0
  54. package/dist/chunk-RDYYP36I.js.map +1 -0
  55. package/dist/chunk-RF2YGILF.js +656 -0
  56. package/dist/chunk-RF2YGILF.js.map +1 -0
  57. package/dist/chunk-RTCJ35UC.js +825 -0
  58. package/dist/chunk-RTCJ35UC.js.map +1 -0
  59. package/dist/chunk-TUUGWQY5.js +3488 -0
  60. package/dist/chunk-TUUGWQY5.js.map +1 -0
  61. package/dist/chunk-WXEOP6Z4.js +577 -0
  62. package/dist/chunk-WXEOP6Z4.js.map +1 -0
  63. package/dist/chunk-WYVA6AN5.js +590 -0
  64. package/dist/chunk-WYVA6AN5.js.map +1 -0
  65. package/dist/chunk-Y2Q74PJP.js +537 -0
  66. package/dist/chunk-Y2Q74PJP.js.map +1 -0
  67. package/dist/chunk-ZFTQY7OF.js +139 -0
  68. package/dist/chunk-ZFTQY7OF.js.map +1 -0
  69. package/dist/chunk-ZSNP26VU.js +493 -0
  70. package/dist/chunk-ZSNP26VU.js.map +1 -0
  71. package/dist/context-menu/index.d.ts +1 -0
  72. package/dist/context-menu/index.js +19 -0
  73. package/dist/controls/index.d.ts +1 -0
  74. package/dist/controls/index.js +10 -0
  75. package/dist/core/error/boundary.d.ts +27 -0
  76. package/dist/core/error/boundary.d.ts.map +1 -0
  77. package/dist/core/error/constants.d.ts +33 -0
  78. package/dist/core/error/constants.d.ts.map +1 -0
  79. package/dist/core/error/index.d.ts +9 -0
  80. package/dist/core/error/index.d.ts.map +1 -0
  81. package/dist/core/error/listener.d.ts +6 -0
  82. package/dist/core/error/listener.d.ts.map +1 -0
  83. package/dist/core/error/reporter.d.ts +49 -0
  84. package/dist/core/error/reporter.d.ts.map +1 -0
  85. package/dist/core/error/theme.d.ts +10 -0
  86. package/dist/core/error/theme.d.ts.map +1 -0
  87. package/dist/core/error/types.d.ts +128 -0
  88. package/dist/core/error/types.d.ts.map +1 -0
  89. package/dist/core/error/utils.d.ts +55 -0
  90. package/dist/core/error/utils.d.ts.map +1 -0
  91. package/dist/core/kernel/adapters.d.ts +9 -0
  92. package/dist/core/kernel/adapters.d.ts.map +1 -0
  93. package/dist/core/kernel/compose.d.ts +21 -0
  94. package/dist/core/kernel/compose.d.ts.map +1 -0
  95. package/dist/core/kernel/constants.d.ts +42 -0
  96. package/dist/core/kernel/constants.d.ts.map +1 -0
  97. package/dist/core/kernel/handlers.d.ts +7 -0
  98. package/dist/core/kernel/handlers.d.ts.map +1 -0
  99. package/dist/core/kernel/hooks.d.ts +13 -0
  100. package/dist/core/kernel/hooks.d.ts.map +1 -0
  101. package/dist/core/kernel/index.d.ts +15 -0
  102. package/dist/core/kernel/index.d.ts.map +1 -0
  103. package/dist/core/kernel/installed.d.ts +28 -0
  104. package/dist/core/kernel/installed.d.ts.map +1 -0
  105. package/dist/core/kernel/module.d.ts +57 -0
  106. package/dist/core/kernel/module.d.ts.map +1 -0
  107. package/dist/core/kernel/operations-records.d.ts +25 -0
  108. package/dist/core/kernel/operations-records.d.ts.map +1 -0
  109. package/dist/core/kernel/operations-resolve.d.ts +5 -0
  110. package/dist/core/kernel/operations-resolve.d.ts.map +1 -0
  111. package/dist/core/kernel/operations.d.ts +23 -0
  112. package/dist/core/kernel/operations.d.ts.map +1 -0
  113. package/dist/core/kernel/page-controller.d.ts +20 -0
  114. package/dist/core/kernel/page-controller.d.ts.map +1 -0
  115. package/dist/core/kernel/provider.d.ts +29 -0
  116. package/dist/core/kernel/provider.d.ts.map +1 -0
  117. package/dist/core/kernel/runtime.d.ts.map +1 -0
  118. package/dist/core/kernel/schema.d.ts +13 -0
  119. package/dist/core/kernel/schema.d.ts.map +1 -0
  120. package/dist/core/kernel/stabilize.d.ts +13 -0
  121. package/dist/core/kernel/stabilize.d.ts.map +1 -0
  122. package/dist/core/kernel/store-batch.d.ts +17 -0
  123. package/dist/core/kernel/store-batch.d.ts.map +1 -0
  124. package/dist/core/kernel/store-entries.d.ts +6 -0
  125. package/dist/core/kernel/store-entries.d.ts.map +1 -0
  126. package/dist/core/kernel/store-handles.d.ts +4 -0
  127. package/dist/core/kernel/store-handles.d.ts.map +1 -0
  128. package/dist/core/kernel/store-registration.d.ts +14 -0
  129. package/dist/core/kernel/store-registration.d.ts.map +1 -0
  130. package/dist/core/kernel/store-snapshots.d.ts +14 -0
  131. package/dist/core/kernel/store-snapshots.d.ts.map +1 -0
  132. package/dist/core/kernel/store-subscriptions.d.ts +16 -0
  133. package/dist/core/kernel/store-subscriptions.d.ts.map +1 -0
  134. package/dist/core/kernel/store.d.ts +8 -0
  135. package/dist/core/kernel/store.d.ts.map +1 -0
  136. package/dist/core/kernel/types-modules.d.ts +82 -0
  137. package/dist/core/kernel/types-modules.d.ts.map +1 -0
  138. package/dist/core/kernel/types-page.d.ts +67 -0
  139. package/dist/core/kernel/types-page.d.ts.map +1 -0
  140. package/dist/core/kernel/types-store.d.ts +71 -0
  141. package/dist/core/kernel/types-store.d.ts.map +1 -0
  142. package/dist/core/kernel/types.d.ts +169 -0
  143. package/dist/core/kernel/types.d.ts.map +1 -0
  144. package/dist/core/kernel/utils.d.ts +21 -0
  145. package/dist/core/kernel/utils.d.ts.map +1 -0
  146. package/dist/core/navigation/constants.d.ts +48 -0
  147. package/dist/core/navigation/constants.d.ts.map +1 -0
  148. package/dist/core/navigation/navigator-defaults.d.ts +4 -0
  149. package/dist/core/navigation/navigator-defaults.d.ts.map +1 -0
  150. package/dist/core/navigation/navigator-holds.d.ts +8 -0
  151. package/dist/core/navigation/navigator-holds.d.ts.map +1 -0
  152. package/dist/core/navigation/navigator-patience.d.ts +15 -0
  153. package/dist/core/navigation/navigator-patience.d.ts.map +1 -0
  154. package/dist/core/navigation/navigator-payload.d.ts +6 -0
  155. package/dist/core/navigation/navigator-payload.d.ts.map +1 -0
  156. package/dist/core/navigation/navigator-prefetch.d.ts +13 -0
  157. package/dist/core/navigation/navigator-prefetch.d.ts.map +1 -0
  158. package/dist/core/navigation/navigator.d.ts +7 -0
  159. package/dist/core/navigation/navigator.d.ts.map +1 -0
  160. package/dist/core/navigation/settings.d.ts +12 -0
  161. package/dist/core/navigation/settings.d.ts.map +1 -0
  162. package/dist/core/navigation/state.d.ts +26 -0
  163. package/dist/core/navigation/state.d.ts.map +1 -0
  164. package/dist/core/navigation/types.d.ts +194 -0
  165. package/dist/core/navigation/types.d.ts.map +1 -0
  166. package/dist/core/navigation/utils.d.ts +18 -0
  167. package/dist/core/navigation/utils.d.ts.map +1 -0
  168. package/dist/core/provider/index.d.ts +31 -0
  169. package/dist/core/provider/index.d.ts.map +1 -0
  170. package/dist/dock/index.d.ts +1 -0
  171. package/dist/dock/index.js +18 -0
  172. package/dist/error/index.d.ts +1 -9
  173. package/dist/error/index.js +8 -5
  174. package/dist/events/index.d.ts +1 -0
  175. package/dist/events/index.js +83 -0
  176. package/dist/events/index.js.map +1 -0
  177. package/dist/foundation/events/index.d.ts +67 -0
  178. package/dist/foundation/events/index.d.ts.map +1 -0
  179. package/dist/foundation/recipes/anatomy.d.ts +139 -0
  180. package/dist/foundation/recipes/anatomy.d.ts.map +1 -0
  181. package/dist/foundation/recipes/cn.d.ts +17 -0
  182. package/dist/foundation/recipes/cn.d.ts.map +1 -0
  183. package/dist/foundation/recipes/define.d.ts +134 -0
  184. package/dist/foundation/recipes/define.d.ts.map +1 -0
  185. package/dist/foundation/recipes/index.d.ts +11 -0
  186. package/dist/foundation/recipes/index.d.ts.map +1 -0
  187. package/dist/foundation/recipes/recipe.d.ts +97 -0
  188. package/dist/foundation/recipes/recipe.d.ts.map +1 -0
  189. package/dist/foundation/recipes/split.d.ts +10 -0
  190. package/dist/foundation/recipes/split.d.ts.map +1 -0
  191. package/dist/foundation/result/index.d.ts +98 -0
  192. package/dist/foundation/result/index.d.ts.map +1 -0
  193. package/dist/foundation/utils/dom.d.ts +19 -0
  194. package/dist/foundation/utils/dom.d.ts.map +1 -0
  195. package/dist/foundation/utils/index.d.ts +17 -0
  196. package/dist/foundation/utils/index.d.ts.map +1 -0
  197. package/dist/foundation/utils/number.d.ts +9 -0
  198. package/dist/foundation/utils/number.d.ts.map +1 -0
  199. package/dist/foundation/utils/object.d.ts +17 -0
  200. package/dist/foundation/utils/object.d.ts.map +1 -0
  201. package/dist/foundation/utils/report.d.ts +18 -0
  202. package/dist/foundation/utils/report.d.ts.map +1 -0
  203. package/dist/foundation/utils/scheduler.d.ts +52 -0
  204. package/dist/foundation/utils/scheduler.d.ts.map +1 -0
  205. package/dist/foundation/utils/store.d.ts +21 -0
  206. package/dist/foundation/utils/store.d.ts.map +1 -0
  207. package/dist/foundation/utils/string.d.ts +18 -0
  208. package/dist/foundation/utils/string.d.ts.map +1 -0
  209. package/dist/foundation/utils/tempo.d.ts +61 -0
  210. package/dist/foundation/utils/tempo.d.ts.map +1 -0
  211. package/dist/foundation/utils/timing.d.ts +13 -0
  212. package/dist/foundation/utils/timing.d.ts.map +1 -0
  213. package/dist/foundation/utils/transform.d.ts +17 -0
  214. package/dist/foundation/utils/transform.d.ts.map +1 -0
  215. package/dist/foundation/utils/user-message.d.ts +32 -0
  216. package/dist/foundation/utils/user-message.d.ts.map +1 -0
  217. package/dist/hooks/index.d.ts +1 -10
  218. package/dist/hooks/index.js +3 -1
  219. package/dist/index.d.ts +8 -10
  220. package/dist/index.d.ts.map +1 -1
  221. package/dist/index.js +25 -20
  222. package/dist/kernel/index.d.ts +1 -15
  223. package/dist/kernel/index.js +5 -2
  224. package/dist/loading/index.d.ts +1 -0
  225. package/dist/loading/index.js +12 -0
  226. package/dist/media/index.d.ts +1 -0
  227. package/dist/media/index.js +9 -0
  228. package/dist/modal/index.d.ts +1 -0
  229. package/dist/modal/index.js +310 -0
  230. package/dist/modal/index.js.map +1 -0
  231. package/dist/modules/ambient/analyze-bounds.d.ts +12 -0
  232. package/dist/modules/ambient/analyze-bounds.d.ts.map +1 -0
  233. package/dist/modules/ambient/analyze-clusters.d.ts +14 -0
  234. package/dist/modules/ambient/analyze-clusters.d.ts.map +1 -0
  235. package/dist/modules/ambient/analyze-measures.d.ts +22 -0
  236. package/dist/modules/ambient/analyze-measures.d.ts.map +1 -0
  237. package/dist/modules/ambient/analyze-swatches.d.ts +16 -0
  238. package/dist/modules/ambient/analyze-swatches.d.ts.map +1 -0
  239. package/dist/modules/ambient/analyze.d.ts +9 -49
  240. package/dist/modules/ambient/analyze.d.ts.map +1 -1
  241. package/dist/modules/ambient/constants.d.ts +4 -1
  242. package/dist/modules/ambient/constants.d.ts.map +1 -1
  243. package/dist/modules/ambient/context.d.ts +6 -0
  244. package/dist/modules/ambient/context.d.ts.map +1 -1
  245. package/dist/modules/ambient/dom.d.ts +23 -12
  246. package/dist/modules/ambient/dom.d.ts.map +1 -1
  247. package/dist/modules/ambient/extractor.d.ts +6 -4
  248. package/dist/modules/ambient/extractor.d.ts.map +1 -1
  249. package/dist/modules/ambient/hooks.d.ts +12 -0
  250. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  251. package/dist/modules/ambient/index.d.ts +2 -2
  252. package/dist/modules/ambient/index.d.ts.map +1 -1
  253. package/dist/modules/ambient/module.d.ts +12 -1
  254. package/dist/modules/ambient/module.d.ts.map +1 -1
  255. package/dist/modules/ambient/oklab.d.ts +18 -13
  256. package/dist/modules/ambient/oklab.d.ts.map +1 -1
  257. package/dist/modules/ambient/pipeline.d.ts +0 -7
  258. package/dist/modules/ambient/pipeline.d.ts.map +1 -1
  259. package/dist/modules/ambient/quantize.d.ts +2 -9
  260. package/dist/modules/ambient/quantize.d.ts.map +1 -1
  261. package/dist/modules/ambient/server/address.d.ts +8 -3
  262. package/dist/modules/ambient/server/address.d.ts.map +1 -1
  263. package/dist/modules/ambient/server/index.d.ts +20 -23
  264. package/dist/modules/ambient/server/index.d.ts.map +1 -1
  265. package/dist/modules/ambient/settings.d.ts +23 -3
  266. package/dist/modules/ambient/settings.d.ts.map +1 -1
  267. package/dist/modules/ambient/types.d.ts +98 -36
  268. package/dist/modules/ambient/types.d.ts.map +1 -1
  269. package/dist/modules/ambient/worker/index.d.ts +16 -1
  270. package/dist/modules/ambient/worker/index.d.ts.map +1 -1
  271. package/dist/modules/background/components/background-gradients.d.ts +8 -0
  272. package/dist/modules/background/components/background-gradients.d.ts.map +1 -0
  273. package/dist/modules/background/components/edge-gradient.d.ts +9 -0
  274. package/dist/modules/background/components/edge-gradient.d.ts.map +1 -0
  275. package/dist/modules/background/components/native-video.d.ts +4 -0
  276. package/dist/modules/background/components/native-video.d.ts.map +1 -0
  277. package/dist/modules/background/components/noise-overlay.d.ts +11 -0
  278. package/dist/modules/background/components/noise-overlay.d.ts.map +1 -0
  279. package/dist/modules/background/components/overlay.d.ts +6 -0
  280. package/dist/modules/background/components/overlay.d.ts.map +1 -0
  281. package/dist/modules/background/components/solid-overlay.d.ts +10 -0
  282. package/dist/modules/background/components/solid-overlay.d.ts.map +1 -0
  283. package/dist/modules/background/constants.d.ts +14 -1
  284. package/dist/modules/background/constants.d.ts.map +1 -1
  285. package/dist/modules/background/context.d.ts +7 -0
  286. package/dist/modules/background/context.d.ts.map +1 -1
  287. package/dist/modules/background/hooks/use-background-media-source.d.ts +4 -0
  288. package/dist/modules/background/hooks/use-background-media-source.d.ts.map +1 -0
  289. package/dist/modules/background/hooks/use-background-motion-model.d.ts +15 -0
  290. package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +1 -0
  291. package/dist/modules/background/hooks/use-background-overlay-model.d.ts +929 -0
  292. package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +1 -0
  293. package/dist/modules/background/hooks/use-native-video-model.d.ts +22 -0
  294. package/dist/modules/background/hooks/use-native-video-model.d.ts.map +1 -0
  295. package/dist/modules/background/hooks.d.ts +20 -1
  296. package/dist/modules/background/hooks.d.ts.map +1 -1
  297. package/dist/modules/background/index.d.ts +7 -7
  298. package/dist/modules/background/index.d.ts.map +1 -1
  299. package/dist/modules/background/lib/theme.d.ts +4 -0
  300. package/dist/modules/background/lib/theme.d.ts.map +1 -0
  301. package/dist/modules/background/model/override.d.ts +14 -0
  302. package/dist/modules/background/model/override.d.ts.map +1 -0
  303. package/dist/modules/background/model/playback.d.ts +25 -0
  304. package/dist/modules/background/model/playback.d.ts.map +1 -0
  305. package/dist/modules/background/model/state.d.ts +31 -0
  306. package/dist/modules/background/model/state.d.ts.map +1 -0
  307. package/dist/modules/background/model/video-frame.d.ts +31 -0
  308. package/dist/modules/background/model/video-frame.d.ts.map +1 -0
  309. package/dist/modules/background/model/visual.d.ts +932 -0
  310. package/dist/modules/background/model/visual.d.ts.map +1 -0
  311. package/dist/modules/background/module.d.ts +11 -0
  312. package/dist/modules/background/module.d.ts.map +1 -1
  313. package/dist/modules/background/motion.d.ts.map +1 -1
  314. package/dist/modules/background/types.d.ts +66 -10
  315. package/dist/modules/background/types.d.ts.map +1 -1
  316. package/dist/modules/background/youtube/components/player.d.ts +7 -0
  317. package/dist/modules/background/youtube/components/player.d.ts.map +1 -0
  318. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts +27 -0
  319. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +1 -0
  320. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +20 -0
  321. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +1 -0
  322. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +8 -0
  323. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +1 -0
  324. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts +16 -0
  325. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +1 -0
  326. package/dist/modules/background/youtube/lib/audio.d.ts +17 -0
  327. package/dist/modules/background/youtube/lib/audio.d.ts.map +1 -0
  328. package/dist/modules/background/youtube/lib/iframe-engine.d.ts +29 -0
  329. package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +1 -0
  330. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +47 -0
  331. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +1 -0
  332. package/dist/modules/background/youtube/lib/iframe.d.ts +47 -0
  333. package/dist/modules/background/youtube/lib/iframe.d.ts.map +1 -0
  334. package/dist/modules/background/youtube/lib/parse.d.ts +36 -0
  335. package/dist/modules/background/youtube/lib/parse.d.ts.map +1 -0
  336. package/dist/modules/background/youtube/lib/timing.d.ts +11 -0
  337. package/dist/modules/background/youtube/lib/timing.d.ts.map +1 -0
  338. package/dist/modules/background/youtube/lib/video-events.d.ts +53 -0
  339. package/dist/modules/background/youtube/lib/video-events.d.ts.map +1 -0
  340. package/dist/modules/context-menu/constants.d.ts +30 -1
  341. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  342. package/dist/modules/context-menu/context.d.ts +10 -2
  343. package/dist/modules/context-menu/context.d.ts.map +1 -1
  344. package/dist/modules/context-menu/dom.d.ts +13 -0
  345. package/dist/modules/context-menu/dom.d.ts.map +1 -1
  346. package/dist/modules/context-menu/hooks.d.ts +32 -5
  347. package/dist/modules/context-menu/hooks.d.ts.map +1 -1
  348. package/dist/modules/context-menu/index.d.ts +1 -1
  349. package/dist/modules/context-menu/index.d.ts.map +1 -1
  350. package/dist/modules/context-menu/items.d.ts +25 -0
  351. package/dist/modules/context-menu/items.d.ts.map +1 -1
  352. package/dist/modules/context-menu/module.d.ts +6 -0
  353. package/dist/modules/context-menu/module.d.ts.map +1 -1
  354. package/dist/modules/context-menu/motion.d.ts.map +1 -1
  355. package/dist/modules/context-menu/overlay.d.ts +30 -8
  356. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  357. package/dist/modules/context-menu/resolver.d.ts +8 -0
  358. package/dist/modules/context-menu/resolver.d.ts.map +1 -1
  359. package/dist/modules/context-menu/state.d.ts +9 -0
  360. package/dist/modules/context-menu/state.d.ts.map +1 -1
  361. package/dist/modules/context-menu/types.d.ts +85 -9
  362. package/dist/modules/context-menu/types.d.ts.map +1 -1
  363. package/dist/modules/controls/constants.d.ts +18 -1
  364. package/dist/modules/controls/constants.d.ts.map +1 -1
  365. package/dist/modules/controls/entries.d.ts +23 -1
  366. package/dist/modules/controls/entries.d.ts.map +1 -1
  367. package/dist/modules/controls/hooks.d.ts +11 -1
  368. package/dist/modules/controls/hooks.d.ts.map +1 -1
  369. package/dist/modules/controls/layout.d.ts +17 -0
  370. package/dist/modules/controls/layout.d.ts.map +1 -1
  371. package/dist/modules/controls/module.d.ts +7 -1
  372. package/dist/modules/controls/module.d.ts.map +1 -1
  373. package/dist/modules/controls/overlay.d.ts +11 -1
  374. package/dist/modules/controls/overlay.d.ts.map +1 -1
  375. package/dist/modules/controls/types.d.ts +51 -2
  376. package/dist/modules/controls/types.d.ts.map +1 -1
  377. package/dist/modules/dock/components/badge.d.ts +5 -0
  378. package/dist/modules/dock/components/badge.d.ts.map +1 -0
  379. package/dist/modules/dock/components/breadcrumbs-card.d.ts +6 -0
  380. package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +1 -0
  381. package/dist/modules/dock/components/card-banner.d.ts +4 -0
  382. package/dist/modules/dock/components/card-banner.d.ts.map +1 -0
  383. package/dist/modules/dock/components/card-header.d.ts +4 -0
  384. package/dist/modules/dock/components/card-header.d.ts.map +1 -0
  385. package/dist/modules/dock/components/card-item.d.ts +3 -0
  386. package/dist/modules/dock/components/card-item.d.ts.map +1 -0
  387. package/dist/modules/dock/components/command-bar.d.ts +7 -0
  388. package/dist/modules/dock/components/command-bar.d.ts.map +1 -0
  389. package/dist/modules/dock/components/description.d.ts +4 -0
  390. package/dist/modules/dock/components/description.d.ts.map +1 -0
  391. package/dist/modules/dock/components/dock.d.ts +4 -0
  392. package/dist/modules/dock/components/dock.d.ts.map +1 -0
  393. package/dist/modules/dock/components/hud-view.d.ts +7 -0
  394. package/dist/modules/dock/components/hud-view.d.ts.map +1 -0
  395. package/dist/modules/dock/components/icon.d.ts +6 -0
  396. package/dist/modules/dock/components/icon.d.ts.map +1 -0
  397. package/dist/modules/dock/components/item-content.d.ts +4 -0
  398. package/dist/modules/dock/components/item-content.d.ts.map +1 -0
  399. package/dist/modules/dock/components/media-action.d.ts +4 -0
  400. package/dist/modules/dock/components/media-action.d.ts.map +1 -0
  401. package/dist/modules/dock/components/media-controls.d.ts +4 -0
  402. package/dist/modules/dock/components/media-controls.d.ts.map +1 -0
  403. package/dist/modules/dock/components/media-scrubber.d.ts +5 -0
  404. package/dist/modules/dock/components/media-scrubber.d.ts.map +1 -0
  405. package/dist/modules/dock/components/status-actions.d.ts +10 -0
  406. package/dist/modules/dock/components/status-actions.d.ts.map +1 -0
  407. package/dist/modules/dock/components/surface/action.d.ts +17 -0
  408. package/dist/modules/dock/components/surface/action.d.ts.map +1 -0
  409. package/dist/modules/dock/components/surface/controls.d.ts +12 -0
  410. package/dist/modules/dock/components/surface/controls.d.ts.map +1 -0
  411. package/dist/modules/dock/components/surface/extensions-bar.d.ts +5 -0
  412. package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +1 -0
  413. package/dist/modules/dock/components/surface/header-button.d.ts +14 -0
  414. package/dist/modules/dock/components/surface/header-button.d.ts.map +1 -0
  415. package/dist/modules/dock/components/surface/item-content.d.ts +6 -0
  416. package/dist/modules/dock/components/surface/item-content.d.ts.map +1 -0
  417. package/dist/modules/dock/components/surface/shell.d.ts +3 -0
  418. package/dist/modules/dock/components/surface/shell.d.ts.map +1 -0
  419. package/dist/modules/dock/components/title.d.ts +4 -0
  420. package/dist/modules/dock/components/title.d.ts.map +1 -0
  421. package/dist/modules/dock/constants.d.ts +11 -2
  422. package/dist/modules/dock/constants.d.ts.map +1 -1
  423. package/dist/modules/dock/context.d.ts +8 -2
  424. package/dist/modules/dock/context.d.ts.map +1 -1
  425. package/dist/modules/dock/hooks/use-action-slot.d.ts +6 -0
  426. package/dist/modules/dock/hooks/use-action-slot.d.ts.map +1 -0
  427. package/dist/modules/dock/hooks/use-badge.d.ts +4 -0
  428. package/dist/modules/dock/hooks/use-badge.d.ts.map +1 -0
  429. package/dist/modules/dock/hooks/use-card-banner-model.d.ts +18 -0
  430. package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +1 -0
  431. package/dist/modules/dock/hooks/use-card-header-model.d.ts +7 -0
  432. package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +1 -0
  433. package/dist/modules/dock/hooks/use-card-item-model.d.ts +1612 -0
  434. package/dist/modules/dock/hooks/use-card-item-model.d.ts.map +1 -0
  435. package/dist/modules/dock/hooks/use-command-bar-model.d.ts +12 -0
  436. package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +1 -0
  437. package/dist/modules/dock/hooks/use-dock-banner.d.ts +11 -0
  438. package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +1 -0
  439. package/dist/modules/dock/hooks/use-dock-config.d.ts +19 -0
  440. package/dist/modules/dock/hooks/use-dock-config.d.ts.map +1 -0
  441. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +7 -0
  442. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +1 -0
  443. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +7 -0
  444. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +1 -0
  445. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +6 -0
  446. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -0
  447. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +11 -0
  448. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +1 -0
  449. package/dist/modules/dock/hooks/use-dock-registration.d.ts +8 -0
  450. package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +1 -0
  451. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +2 -0
  452. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +1 -0
  453. package/dist/modules/dock/hooks/use-dock-theme.d.ts +6 -0
  454. package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +1 -0
  455. package/dist/modules/dock/hooks/use-dock-viewport.d.ts +6 -0
  456. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -0
  457. package/dist/modules/dock/hooks/use-element-height.d.ts +3 -0
  458. package/dist/modules/dock/hooks/use-element-height.d.ts.map +1 -0
  459. package/dist/modules/dock/hooks/use-hud-registry.d.ts +16 -0
  460. package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +1 -0
  461. package/dist/modules/dock/hooks/use-hud-view-model.d.ts +9 -0
  462. package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +1 -0
  463. package/dist/modules/dock/hooks/use-media-controls-model.d.ts +27 -0
  464. package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +1 -0
  465. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +27 -0
  466. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +1 -0
  467. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +12 -0
  468. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +1 -0
  469. package/dist/modules/dock/hooks/use-surface-return.d.ts +8 -0
  470. package/dist/modules/dock/hooks/use-surface-return.d.ts.map +1 -0
  471. package/dist/modules/dock/hud.d.ts +8 -34
  472. package/dist/modules/dock/hud.d.ts.map +1 -1
  473. package/dist/modules/dock/index.d.ts +18 -12
  474. package/dist/modules/dock/index.d.ts.map +1 -1
  475. package/dist/modules/dock/lib/banner.d.ts +43 -0
  476. package/dist/modules/dock/lib/banner.d.ts.map +1 -0
  477. package/dist/modules/dock/lib/card-item.d.ts +46 -0
  478. package/dist/modules/dock/lib/card-item.d.ts.map +1 -0
  479. package/dist/modules/dock/lib/card.d.ts +20 -0
  480. package/dist/modules/dock/lib/card.d.ts.map +1 -0
  481. package/dist/modules/dock/lib/command-bar.d.ts +8 -0
  482. package/dist/modules/dock/lib/command-bar.d.ts.map +1 -0
  483. package/dist/modules/dock/lib/dom.d.ts +7 -0
  484. package/dist/modules/dock/lib/dom.d.ts.map +1 -0
  485. package/dist/modules/dock/lib/element-helpers.d.ts +8 -0
  486. package/dist/modules/dock/lib/element-helpers.d.ts.map +1 -0
  487. package/dist/modules/dock/lib/helpers.d.ts +19 -0
  488. package/dist/modules/dock/lib/helpers.d.ts.map +1 -0
  489. package/dist/modules/dock/lib/media.d.ts +35 -0
  490. package/dist/modules/dock/lib/media.d.ts.map +1 -0
  491. package/dist/modules/dock/lib/styles.d.ts +902 -0
  492. package/dist/modules/dock/lib/styles.d.ts.map +1 -0
  493. package/dist/modules/dock/model/hud-definition.d.ts +13 -0
  494. package/dist/modules/dock/model/hud-definition.d.ts.map +1 -0
  495. package/dist/modules/dock/model/hud.d.ts +10 -0
  496. package/dist/modules/dock/model/hud.d.ts.map +1 -0
  497. package/dist/modules/dock/model/layout.d.ts +28 -0
  498. package/dist/modules/dock/model/layout.d.ts.map +1 -0
  499. package/dist/modules/dock/model/page-entry.d.ts +11 -0
  500. package/dist/modules/dock/model/page-entry.d.ts.map +1 -0
  501. package/dist/modules/dock/model/page-surface.d.ts +4 -0
  502. package/dist/modules/dock/model/page-surface.d.ts.map +1 -0
  503. package/dist/modules/dock/model/paths.d.ts +15 -0
  504. package/dist/modules/dock/model/paths.d.ts.map +1 -0
  505. package/dist/modules/dock/model/state.d.ts +28 -0
  506. package/dist/modules/dock/model/state.d.ts.map +1 -0
  507. package/dist/modules/dock/model/surface-return.d.ts +14 -0
  508. package/dist/modules/dock/model/surface-return.d.ts.map +1 -0
  509. package/dist/modules/dock/module.d.ts +5 -7
  510. package/dist/modules/dock/module.d.ts.map +1 -1
  511. package/dist/modules/dock/motion.d.ts +716 -11
  512. package/dist/modules/dock/motion.d.ts.map +1 -1
  513. package/dist/modules/dock/provider.d.ts +2 -1
  514. package/dist/modules/dock/provider.d.ts.map +1 -1
  515. package/dist/modules/dock/routing/breadcrumbs.d.ts +6 -2
  516. package/dist/modules/dock/routing/breadcrumbs.d.ts.map +1 -1
  517. package/dist/modules/dock/routing/continuity.d.ts +46 -14
  518. package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
  519. package/dist/modules/dock/routing/guards.d.ts +10 -1
  520. package/dist/modules/dock/routing/guards.d.ts.map +1 -1
  521. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts +12 -0
  522. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +1 -0
  523. package/dist/modules/dock/routing/lib/restore.d.ts +7 -0
  524. package/dist/modules/dock/routing/lib/restore.d.ts.map +1 -0
  525. package/dist/modules/dock/routing/model/continuity.d.ts +21 -0
  526. package/dist/modules/dock/routing/model/continuity.d.ts.map +1 -0
  527. package/dist/modules/dock/routing/model/policy.d.ts +7 -0
  528. package/dist/modules/dock/routing/model/policy.d.ts.map +1 -0
  529. package/dist/modules/dock/routing/model/topology.d.ts +5 -0
  530. package/dist/modules/dock/routing/model/topology.d.ts.map +1 -0
  531. package/dist/modules/dock/routing/navigation.d.ts +10 -23
  532. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  533. package/dist/modules/dock/runtime/commands.d.ts +10 -1
  534. package/dist/modules/dock/runtime/commands.d.ts.map +1 -1
  535. package/dist/modules/dock/runtime/display.d.ts +9 -48
  536. package/dist/modules/dock/runtime/display.d.ts.map +1 -1
  537. package/dist/modules/dock/runtime/dock.d.ts +11 -70
  538. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  539. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +10 -0
  540. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +1 -0
  541. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +10 -0
  542. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +1 -0
  543. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +14 -0
  544. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +1 -0
  545. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +7 -0
  546. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +1 -0
  547. package/dist/modules/dock/runtime/hooks/use-dock.d.ts +30 -0
  548. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -0
  549. package/dist/modules/dock/runtime/model/attention.d.ts +25 -0
  550. package/dist/modules/dock/runtime/model/attention.d.ts.map +1 -0
  551. package/dist/modules/dock/runtime/model/cards.d.ts +64 -0
  552. package/dist/modules/dock/runtime/model/cards.d.ts.map +1 -0
  553. package/dist/modules/dock/runtime/model/items.d.ts +31 -0
  554. package/dist/modules/dock/runtime/model/items.d.ts.map +1 -0
  555. package/dist/modules/dock/runtime/model/layout.d.ts +10 -0
  556. package/dist/modules/dock/runtime/model/layout.d.ts.map +1 -0
  557. package/dist/modules/dock/runtime/pipeline.d.ts +1 -1
  558. package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -1
  559. package/dist/modules/dock/runtime/provider-actions.d.ts +38 -0
  560. package/dist/modules/dock/runtime/provider-actions.d.ts.map +1 -0
  561. package/dist/modules/dock/status/action-options.d.ts +35 -0
  562. package/dist/modules/dock/status/action-options.d.ts.map +1 -0
  563. package/dist/modules/dock/status/events.d.ts +2 -2
  564. package/dist/modules/dock/status/events.d.ts.map +1 -1
  565. package/dist/modules/dock/status/hooks.d.ts +1 -1
  566. package/dist/modules/dock/status/hooks.d.ts.map +1 -1
  567. package/dist/modules/dock/status/model.d.ts +12 -32
  568. package/dist/modules/dock/status/model.d.ts.map +1 -1
  569. package/dist/modules/dock/status/state.d.ts +12 -0
  570. package/dist/modules/dock/status/state.d.ts.map +1 -0
  571. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +5 -0
  572. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +1 -0
  573. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +7 -0
  574. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +1 -0
  575. package/dist/modules/dock/surface/constants.d.ts +5 -0
  576. package/dist/modules/dock/surface/constants.d.ts.map +1 -0
  577. package/dist/modules/dock/surface/context.d.ts +14 -1
  578. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  579. package/dist/modules/dock/surface/definition.d.ts +28 -2
  580. package/dist/modules/dock/surface/definition.d.ts.map +1 -1
  581. package/dist/modules/dock/surface/helpers.d.ts +2 -1
  582. package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
  583. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +15 -0
  584. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +1 -0
  585. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +7 -0
  586. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +1 -0
  587. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +14 -0
  588. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +1 -0
  589. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts +20 -0
  590. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +1 -0
  591. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +13 -0
  592. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +1 -0
  593. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts +28 -0
  594. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +1 -0
  595. package/dist/modules/dock/surface/lib/drag.d.ts +9 -0
  596. package/dist/modules/dock/surface/lib/drag.d.ts.map +1 -0
  597. package/dist/modules/dock/surface/lib/target.d.ts +8 -0
  598. package/dist/modules/dock/surface/lib/target.d.ts.map +1 -0
  599. package/dist/modules/dock/surface/machine.d.ts +17 -62
  600. package/dist/modules/dock/surface/machine.d.ts.map +1 -1
  601. package/dist/modules/dock/surface/model/builder.d.ts +39 -0
  602. package/dist/modules/dock/surface/model/builder.d.ts.map +1 -0
  603. package/dist/modules/dock/surface/model/normalize.d.ts +13 -0
  604. package/dist/modules/dock/surface/model/normalize.d.ts.map +1 -0
  605. package/dist/modules/dock/surface/model/open.d.ts +26 -0
  606. package/dist/modules/dock/surface/model/open.d.ts.map +1 -0
  607. package/dist/modules/dock/surface/model/records.d.ts +45 -0
  608. package/dist/modules/dock/surface/model/records.d.ts.map +1 -0
  609. package/dist/modules/dock/surface/model/steps.d.ts +9 -0
  610. package/dist/modules/dock/surface/model/steps.d.ts.map +1 -0
  611. package/dist/modules/dock/surface/model/transition-state.d.ts +23 -0
  612. package/dist/modules/dock/surface/model/transition-state.d.ts.map +1 -0
  613. package/dist/modules/dock/surface/model/url.d.ts +14 -0
  614. package/dist/modules/dock/surface/model/url.d.ts.map +1 -0
  615. package/dist/modules/dock/surface/runtime/choreography.d.ts +22 -0
  616. package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -0
  617. package/dist/modules/dock/surface/runtime/context.d.ts +29 -0
  618. package/dist/modules/dock/surface/runtime/context.d.ts.map +1 -0
  619. package/dist/modules/dock/surface/runtime/flows.d.ts +21 -0
  620. package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -0
  621. package/dist/modules/dock/surface/runtime/open.d.ts +6 -0
  622. package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -0
  623. package/dist/modules/dock/surface/runtime/release.d.ts +9 -0
  624. package/dist/modules/dock/surface/runtime/release.d.ts.map +1 -0
  625. package/dist/modules/dock/surface/runtime/steps.d.ts +10 -0
  626. package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -0
  627. package/dist/modules/dock/surface/stack.d.ts +20 -11
  628. package/dist/modules/dock/surface/stack.d.ts.map +1 -1
  629. package/dist/modules/dock/surface/view-model.d.ts +5 -1
  630. package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
  631. package/dist/modules/dock/types/card.d.ts +297 -0
  632. package/dist/modules/dock/types/card.d.ts.map +1 -0
  633. package/dist/modules/dock/types/hud.d.ts +142 -0
  634. package/dist/modules/dock/types/hud.d.ts.map +1 -0
  635. package/dist/modules/dock/types/index.d.ts +8 -0
  636. package/dist/modules/dock/types/index.d.ts.map +1 -0
  637. package/dist/modules/dock/types/media.d.ts +66 -0
  638. package/dist/modules/dock/types/media.d.ts.map +1 -0
  639. package/dist/modules/dock/types/routing.d.ts +336 -0
  640. package/dist/modules/dock/types/routing.d.ts.map +1 -0
  641. package/dist/modules/dock/types/surface-flow.d.ts +231 -0
  642. package/dist/modules/dock/types/surface-flow.d.ts.map +1 -0
  643. package/dist/modules/dock/types/surface.d.ts +194 -0
  644. package/dist/modules/dock/types/surface.d.ts.map +1 -0
  645. package/dist/modules/dock/types/theme.d.ts +201 -0
  646. package/dist/modules/dock/types/theme.d.ts.map +1 -0
  647. package/dist/modules/index.d.ts +4 -0
  648. package/dist/modules/index.d.ts.map +1 -1
  649. package/dist/modules/index.js +23 -18
  650. package/dist/modules/loading/constants.d.ts +18 -1
  651. package/dist/modules/loading/constants.d.ts.map +1 -1
  652. package/dist/modules/loading/context.d.ts +11 -1
  653. package/dist/modules/loading/context.d.ts.map +1 -1
  654. package/dist/modules/loading/hooks.d.ts +24 -1
  655. package/dist/modules/loading/hooks.d.ts.map +1 -1
  656. package/dist/modules/loading/index.d.ts +1 -1
  657. package/dist/modules/loading/index.d.ts.map +1 -1
  658. package/dist/modules/loading/module.d.ts +6 -0
  659. package/dist/modules/loading/module.d.ts.map +1 -1
  660. package/dist/modules/loading/overlay.d.ts +3 -0
  661. package/dist/modules/loading/overlay.d.ts.map +1 -1
  662. package/dist/modules/loading/state.d.ts +13 -0
  663. package/dist/modules/loading/state.d.ts.map +1 -1
  664. package/dist/modules/loading/types.d.ts +42 -2
  665. package/dist/modules/loading/types.d.ts.map +1 -1
  666. package/dist/modules/media/constants.d.ts +19 -0
  667. package/dist/modules/media/constants.d.ts.map +1 -1
  668. package/dist/modules/media/context.d.ts +11 -1
  669. package/dist/modules/media/context.d.ts.map +1 -1
  670. package/dist/modules/media/hooks.d.ts +17 -0
  671. package/dist/modules/media/hooks.d.ts.map +1 -1
  672. package/dist/modules/media/index.d.ts +1 -1
  673. package/dist/modules/media/index.d.ts.map +1 -1
  674. package/dist/modules/media/module.d.ts +4 -0
  675. package/dist/modules/media/module.d.ts.map +1 -1
  676. package/dist/modules/media/overlay.d.ts +7 -0
  677. package/dist/modules/media/overlay.d.ts.map +1 -1
  678. package/dist/modules/media/playback.d.ts +13 -0
  679. package/dist/modules/media/playback.d.ts.map +1 -1
  680. package/dist/modules/media/session.d.ts +20 -0
  681. package/dist/modules/media/session.d.ts.map +1 -1
  682. package/dist/modules/media/types.d.ts +49 -2
  683. package/dist/modules/media/types.d.ts.map +1 -1
  684. package/dist/modules/modal/components/close-button.d.ts +6 -0
  685. package/dist/modules/modal/components/close-button.d.ts.map +1 -0
  686. package/dist/modules/modal/components/modal-container.d.ts +7 -0
  687. package/dist/modules/modal/components/modal-container.d.ts.map +1 -0
  688. package/dist/modules/modal/components/modal-layer-switcher.d.ts +9 -0
  689. package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +1 -0
  690. package/dist/modules/modal/components/modal-layer.d.ts +17 -0
  691. package/dist/modules/modal/components/modal-layer.d.ts.map +1 -0
  692. package/dist/modules/modal/components/overlay.d.ts +6 -0
  693. package/dist/modules/modal/components/overlay.d.ts.map +1 -0
  694. package/dist/modules/modal/components/resolve-header.d.ts +10 -0
  695. package/dist/modules/modal/components/resolve-header.d.ts.map +1 -0
  696. package/dist/modules/modal/components/slot-row.d.ts +12 -0
  697. package/dist/modules/modal/components/slot-row.d.ts.map +1 -0
  698. package/dist/modules/modal/constants.d.ts +16 -1
  699. package/dist/modules/modal/constants.d.ts.map +1 -1
  700. package/dist/modules/modal/context.d.ts +7 -1
  701. package/dist/modules/modal/context.d.ts.map +1 -1
  702. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +3 -0
  703. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +1 -0
  704. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +12 -0
  705. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +1 -0
  706. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +3 -0
  707. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +1 -0
  708. package/dist/modules/modal/hooks.d.ts +30 -4
  709. package/dist/modules/modal/hooks.d.ts.map +1 -1
  710. package/dist/modules/modal/index.d.ts +8 -7
  711. package/dist/modules/modal/index.d.ts.map +1 -1
  712. package/dist/modules/modal/lib/dom.d.ts +13 -0
  713. package/dist/modules/modal/lib/dom.d.ts.map +1 -0
  714. package/dist/modules/modal/lib/theme.d.ts +4 -0
  715. package/dist/modules/modal/lib/theme.d.ts.map +1 -0
  716. package/dist/modules/modal/model/entry.d.ts +18 -0
  717. package/dist/modules/modal/model/entry.d.ts.map +1 -0
  718. package/dist/modules/modal/model/header.d.ts +16 -0
  719. package/dist/modules/modal/model/header.d.ts.map +1 -0
  720. package/dist/modules/modal/model/identity.d.ts +13 -0
  721. package/dist/modules/modal/model/identity.d.ts.map +1 -0
  722. package/dist/modules/modal/model/layout.d.ts +37 -0
  723. package/dist/modules/modal/model/layout.d.ts.map +1 -0
  724. package/dist/modules/modal/model/state.d.ts +10 -0
  725. package/dist/modules/modal/model/state.d.ts.map +1 -0
  726. package/dist/modules/modal/module.d.ts +7 -0
  727. package/dist/modules/modal/module.d.ts.map +1 -1
  728. package/dist/modules/modal/motion.d.ts.map +1 -1
  729. package/dist/modules/modal/types.d.ts +73 -10
  730. package/dist/modules/modal/types.d.ts.map +1 -1
  731. package/dist/modules/navigation/context.d.ts +16 -5
  732. package/dist/modules/navigation/context.d.ts.map +1 -1
  733. package/dist/modules/navigation/hooks.d.ts +22 -13
  734. package/dist/modules/navigation/hooks.d.ts.map +1 -1
  735. package/dist/modules/navigation/index.d.ts +5 -5
  736. package/dist/modules/navigation/index.d.ts.map +1 -1
  737. package/dist/modules/navigation/listeners.d.ts +6 -8
  738. package/dist/modules/navigation/listeners.d.ts.map +1 -1
  739. package/dist/modules/navigation/module.d.ts +5 -2
  740. package/dist/modules/navigation/module.d.ts.map +1 -1
  741. package/dist/modules/notification/constants.d.ts +22 -2
  742. package/dist/modules/notification/constants.d.ts.map +1 -1
  743. package/dist/modules/notification/context.d.ts +12 -2
  744. package/dist/modules/notification/context.d.ts.map +1 -1
  745. package/dist/modules/notification/hooks.d.ts +32 -1
  746. package/dist/modules/notification/hooks.d.ts.map +1 -1
  747. package/dist/modules/notification/module.d.ts +3 -0
  748. package/dist/modules/notification/module.d.ts.map +1 -1
  749. package/dist/modules/notification/motion.d.ts.map +1 -1
  750. package/dist/modules/notification/overlay.d.ts.map +1 -1
  751. package/dist/modules/notification/state.d.ts +28 -0
  752. package/dist/modules/notification/state.d.ts.map +1 -1
  753. package/dist/modules/notification/types.d.ts +48 -5
  754. package/dist/modules/notification/types.d.ts.map +1 -1
  755. package/dist/navigation/index.d.ts +1 -0
  756. package/dist/navigation/index.js +189 -0
  757. package/dist/navigation/index.js.map +1 -0
  758. package/dist/notification/index.d.ts +1 -0
  759. package/dist/notification/index.js +11 -0
  760. package/dist/overlay-QHSJBV3O.js +13 -0
  761. package/dist/overlay-QHSJBV3O.js.map +1 -0
  762. package/dist/provider/index.d.ts +1 -0
  763. package/dist/provider/index.js +14 -0
  764. package/dist/react/context/index.d.ts +4 -0
  765. package/dist/react/context/index.d.ts.map +1 -0
  766. package/dist/react/hooks/index.d.ts +10 -0
  767. package/dist/react/hooks/index.d.ts.map +1 -0
  768. package/dist/react/hooks/types.d.ts +25 -0
  769. package/dist/react/hooks/types.d.ts.map +1 -0
  770. package/dist/react/hooks/use-click-outside.d.ts +6 -0
  771. package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
  772. package/dist/react/hooks/use-controllable-state.d.ts +7 -0
  773. package/dist/react/hooks/use-controllable-state.d.ts.map +1 -0
  774. package/dist/react/hooks/use-fullscreen-state.d.ts +7 -0
  775. package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -0
  776. package/dist/react/hooks/use-global-event.d.ts +9 -0
  777. package/dist/react/hooks/use-global-event.d.ts.map +1 -0
  778. package/dist/react/hooks/use-hotkey.d.ts +10 -0
  779. package/dist/react/hooks/use-hotkey.d.ts.map +1 -0
  780. package/dist/react/hooks/use-required-context.d.ts +6 -0
  781. package/dist/react/hooks/use-required-context.d.ts.map +1 -0
  782. package/dist/react/hooks/use-scroll-lock.d.ts +9 -0
  783. package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -0
  784. package/dist/react/hooks/use-store.d.ts +3 -0
  785. package/dist/react/hooks/use-store.d.ts.map +1 -0
  786. package/dist/react/theme/index.d.ts +82 -0
  787. package/dist/react/theme/index.d.ts.map +1 -0
  788. package/dist/react/ui/components/avatar.d.ts +6 -0
  789. package/dist/react/ui/components/avatar.d.ts.map +1 -0
  790. package/dist/react/ui/components/button.d.ts +6 -0
  791. package/dist/react/ui/components/button.d.ts.map +1 -0
  792. package/dist/react/ui/components/carousel.d.ts +6 -0
  793. package/dist/react/ui/components/carousel.d.ts.map +1 -0
  794. package/dist/react/ui/components/checkbox.d.ts +10 -0
  795. package/dist/react/ui/components/checkbox.d.ts.map +1 -0
  796. package/dist/react/ui/components/icon.d.ts +6 -0
  797. package/dist/react/ui/components/icon.d.ts.map +1 -0
  798. package/dist/react/ui/components/image.d.ts +6 -0
  799. package/dist/react/ui/components/image.d.ts.map +1 -0
  800. package/dist/react/ui/components/indicator.d.ts +45 -0
  801. package/dist/react/ui/components/indicator.d.ts.map +1 -0
  802. package/dist/react/ui/components/input.d.ts +10 -0
  803. package/dist/react/ui/components/input.d.ts.map +1 -0
  804. package/dist/react/ui/components/loader.d.ts +10 -0
  805. package/dist/react/ui/components/loader.d.ts.map +1 -0
  806. package/dist/react/ui/components/segmented.d.ts +6 -0
  807. package/dist/react/ui/components/segmented.d.ts.map +1 -0
  808. package/dist/react/ui/components/select-parts.d.ts +22 -0
  809. package/dist/react/ui/components/select-parts.d.ts.map +1 -0
  810. package/dist/react/ui/components/select.d.ts +6 -0
  811. package/dist/react/ui/components/select.d.ts.map +1 -0
  812. package/dist/react/ui/components/skeleton.d.ts +10 -0
  813. package/dist/react/ui/components/skeleton.d.ts.map +1 -0
  814. package/dist/react/ui/components/switch.d.ts +6 -0
  815. package/dist/react/ui/components/switch.d.ts.map +1 -0
  816. package/dist/react/ui/components/tooltip.d.ts +11 -0
  817. package/dist/react/ui/components/tooltip.d.ts.map +1 -0
  818. package/dist/react/ui/index.d.ts +19 -0
  819. package/dist/react/ui/index.d.ts.map +1 -0
  820. package/dist/react/ui/provider.d.ts +22 -0
  821. package/dist/react/ui/provider.d.ts.map +1 -0
  822. package/dist/react/ui/types-controls.d.ts +133 -0
  823. package/dist/react/ui/types-controls.d.ts.map +1 -0
  824. package/dist/react/ui/types.d.ts +192 -0
  825. package/dist/react/ui/types.d.ts.map +1 -0
  826. package/dist/react/ui/utils.d.ts +65 -0
  827. package/dist/react/ui/utils.d.ts.map +1 -0
  828. package/dist/recipes/index.d.ts +1 -0
  829. package/dist/recipes/index.js +233 -0
  830. package/dist/recipes/index.js.map +1 -0
  831. package/dist/result/index.d.ts +1 -0
  832. package/dist/result/index.js +98 -0
  833. package/dist/result/index.js.map +1 -0
  834. package/dist/theme/index.d.ts +1 -0
  835. package/dist/theme/index.js +6 -0
  836. package/dist/ui/index.d.ts +1 -0
  837. package/dist/ui/index.js +2268 -0
  838. package/dist/ui/index.js.map +1 -0
  839. package/dist/utils/index.d.ts +1 -15
  840. package/dist/utils/index.js +194 -71
  841. package/dist/utils/index.js.map +1 -1
  842. package/docs/README.md +58 -57
  843. package/docs/architecture-and-rules.md +133 -58
  844. package/docs/core-engine.md +36 -52
  845. package/docs/custom-modules.md +43 -32
  846. package/docs/design.md +185 -0
  847. package/docs/getting-started.md +49 -57
  848. package/docs/modules/README.md +50 -61
  849. package/docs/modules/ambient.md +95 -87
  850. package/docs/modules/background.md +39 -36
  851. package/docs/modules/context-menu.md +19 -18
  852. package/docs/modules/controls.md +13 -13
  853. package/docs/modules/dock.md +74 -93
  854. package/docs/modules/error-boundary.md +2 -2
  855. package/docs/modules/kernel.md +38 -26
  856. package/docs/modules/loading.md +14 -14
  857. package/docs/modules/media.md +13 -13
  858. package/docs/modules/modal.md +14 -14
  859. package/docs/modules/navigation.md +87 -84
  860. package/docs/modules/notification.md +13 -13
  861. package/docs/modules/result.md +22 -22
  862. package/docs/proposals/navigation.md +32 -31
  863. package/docs/testing.md +34 -28
  864. package/docs/theming.md +67 -44
  865. package/package.json +106 -88
  866. package/templates/AGENTS.md +35 -25
  867. package/dist/atoms/button.d.ts +0 -11
  868. package/dist/atoms/button.d.ts.map +0 -1
  869. package/dist/atoms/icon.d.ts +0 -15
  870. package/dist/atoms/icon.d.ts.map +0 -1
  871. package/dist/atoms/index.d.ts +0 -5
  872. package/dist/atoms/index.d.ts.map +0 -1
  873. package/dist/atoms/index.js +0 -4
  874. package/dist/atoms/spinner.d.ts +0 -9
  875. package/dist/atoms/spinner.d.ts.map +0 -1
  876. package/dist/atoms/tooltip.d.ts +0 -18
  877. package/dist/atoms/tooltip.d.ts.map +0 -1
  878. package/dist/chunk-3BUP64Q6.js +0 -105
  879. package/dist/chunk-3BUP64Q6.js.map +0 -1
  880. package/dist/chunk-4GMQKD6F.js +0 -353
  881. package/dist/chunk-4GMQKD6F.js.map +0 -1
  882. package/dist/chunk-66EYJBIP.js +0 -300
  883. package/dist/chunk-66EYJBIP.js.map +0 -1
  884. package/dist/chunk-7HQMXTNP.js +0 -419
  885. package/dist/chunk-7HQMXTNP.js.map +0 -1
  886. package/dist/chunk-7TAVYJ3A.js +0 -371
  887. package/dist/chunk-7TAVYJ3A.js.map +0 -1
  888. package/dist/chunk-AQ4BNXA2.js +0 -349
  889. package/dist/chunk-AQ4BNXA2.js.map +0 -1
  890. package/dist/chunk-CGHZSSFR.js +0 -2166
  891. package/dist/chunk-CGHZSSFR.js.map +0 -1
  892. package/dist/chunk-DGCQWQLZ.js +0 -61
  893. package/dist/chunk-DGCQWQLZ.js.map +0 -1
  894. package/dist/chunk-FIMPHODX.js +0 -67
  895. package/dist/chunk-FIMPHODX.js.map +0 -1
  896. package/dist/chunk-GF7TUX5I.js +0 -1889
  897. package/dist/chunk-GF7TUX5I.js.map +0 -1
  898. package/dist/chunk-HHWRTQKQ.js +0 -610
  899. package/dist/chunk-HHWRTQKQ.js.map +0 -1
  900. package/dist/chunk-HLL5EHXC.js +0 -485
  901. package/dist/chunk-HLL5EHXC.js.map +0 -1
  902. package/dist/chunk-I5GK7VOV.js +0 -28
  903. package/dist/chunk-I5GK7VOV.js.map +0 -1
  904. package/dist/chunk-JELG4JLT.js +0 -454
  905. package/dist/chunk-JELG4JLT.js.map +0 -1
  906. package/dist/chunk-K676GL7Z.js +0 -51
  907. package/dist/chunk-K676GL7Z.js.map +0 -1
  908. package/dist/chunk-QI3ALLIB.js +0 -38
  909. package/dist/chunk-QI3ALLIB.js.map +0 -1
  910. package/dist/chunk-R2YGFJDJ.js +0 -408
  911. package/dist/chunk-R2YGFJDJ.js.map +0 -1
  912. package/dist/chunk-RFZQWLC5.js +0 -27
  913. package/dist/chunk-RFZQWLC5.js.map +0 -1
  914. package/dist/chunk-RIOKLMYM.js +0 -145
  915. package/dist/chunk-RIOKLMYM.js.map +0 -1
  916. package/dist/chunk-RRAZKP3J.js +0 -888
  917. package/dist/chunk-RRAZKP3J.js.map +0 -1
  918. package/dist/chunk-SYAVGTOX.js +0 -521
  919. package/dist/chunk-SYAVGTOX.js.map +0 -1
  920. package/dist/chunk-TG6NMHXI.js +0 -1218
  921. package/dist/chunk-TG6NMHXI.js.map +0 -1
  922. package/dist/chunk-TV3WEF5G.js +0 -784
  923. package/dist/chunk-TV3WEF5G.js.map +0 -1
  924. package/dist/chunk-WVRMABDN.js +0 -9727
  925. package/dist/chunk-WVRMABDN.js.map +0 -1
  926. package/dist/error/boundary.d.ts +0 -14
  927. package/dist/error/boundary.d.ts.map +0 -1
  928. package/dist/error/constants.d.ts +0 -18
  929. package/dist/error/constants.d.ts.map +0 -1
  930. package/dist/error/index.d.ts.map +0 -1
  931. package/dist/error/listener.d.ts +0 -2
  932. package/dist/error/listener.d.ts.map +0 -1
  933. package/dist/error/reporter.d.ts +0 -32
  934. package/dist/error/reporter.d.ts.map +0 -1
  935. package/dist/error/theme.d.ts +0 -3
  936. package/dist/error/theme.d.ts.map +0 -1
  937. package/dist/error/types.d.ts +0 -91
  938. package/dist/error/types.d.ts.map +0 -1
  939. package/dist/error/utils.d.ts +0 -21
  940. package/dist/error/utils.d.ts.map +0 -1
  941. package/dist/events.d.ts +0 -51
  942. package/dist/events.d.ts.map +0 -1
  943. package/dist/events.js +0 -82
  944. package/dist/events.js.map +0 -1
  945. package/dist/hooks/index.d.ts.map +0 -1
  946. package/dist/hooks/types.d.ts +0 -16
  947. package/dist/hooks/types.d.ts.map +0 -1
  948. package/dist/hooks/use-click-outside.d.ts +0 -3
  949. package/dist/hooks/use-click-outside.d.ts.map +0 -1
  950. package/dist/hooks/use-controllable-state.d.ts +0 -3
  951. package/dist/hooks/use-controllable-state.d.ts.map +0 -1
  952. package/dist/hooks/use-fullscreen-state.d.ts +0 -4
  953. package/dist/hooks/use-fullscreen-state.d.ts.map +0 -1
  954. package/dist/hooks/use-global-event.d.ts +0 -5
  955. package/dist/hooks/use-global-event.d.ts.map +0 -1
  956. package/dist/hooks/use-hotkey.d.ts +0 -4
  957. package/dist/hooks/use-hotkey.d.ts.map +0 -1
  958. package/dist/hooks/use-isomorphic-layout-effect.d.ts +0 -3
  959. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +0 -1
  960. package/dist/hooks/use-required-context.d.ts +0 -3
  961. package/dist/hooks/use-required-context.d.ts.map +0 -1
  962. package/dist/hooks/use-store.d.ts +0 -3
  963. package/dist/hooks/use-store.d.ts.map +0 -1
  964. package/dist/kernel/adapters.d.ts +0 -5
  965. package/dist/kernel/adapters.d.ts.map +0 -1
  966. package/dist/kernel/compose.d.ts +0 -15
  967. package/dist/kernel/compose.d.ts.map +0 -1
  968. package/dist/kernel/constants.d.ts +0 -12
  969. package/dist/kernel/constants.d.ts.map +0 -1
  970. package/dist/kernel/context-registry.d.ts +0 -3
  971. package/dist/kernel/context-registry.d.ts.map +0 -1
  972. package/dist/kernel/handlers.d.ts +0 -3
  973. package/dist/kernel/handlers.d.ts.map +0 -1
  974. package/dist/kernel/hooks.d.ts +0 -7
  975. package/dist/kernel/hooks.d.ts.map +0 -1
  976. package/dist/kernel/index.d.ts.map +0 -1
  977. package/dist/kernel/installed.d.ts +0 -21
  978. package/dist/kernel/installed.d.ts.map +0 -1
  979. package/dist/kernel/module.d.ts +0 -32
  980. package/dist/kernel/module.d.ts.map +0 -1
  981. package/dist/kernel/operations.d.ts +0 -21
  982. package/dist/kernel/operations.d.ts.map +0 -1
  983. package/dist/kernel/page-controller.d.ts +0 -8
  984. package/dist/kernel/page-controller.d.ts.map +0 -1
  985. package/dist/kernel/provider.d.ts +0 -18
  986. package/dist/kernel/provider.d.ts.map +0 -1
  987. package/dist/kernel/runtime.d.ts.map +0 -1
  988. package/dist/kernel/schema.d.ts +0 -11
  989. package/dist/kernel/schema.d.ts.map +0 -1
  990. package/dist/kernel/store.d.ts +0 -4
  991. package/dist/kernel/store.d.ts.map +0 -1
  992. package/dist/kernel/types.d.ts +0 -233
  993. package/dist/kernel/types.d.ts.map +0 -1
  994. package/dist/kernel/utils.d.ts +0 -18
  995. package/dist/kernel/utils.d.ts.map +0 -1
  996. package/dist/modules/ambient/index.js +0 -10
  997. package/dist/modules/ambient/server/index.js +0 -221
  998. package/dist/modules/ambient/server/index.js.map +0 -1
  999. package/dist/modules/ambient/worker/index.js +0 -114
  1000. package/dist/modules/ambient/worker/index.js.map +0 -1
  1001. package/dist/modules/background/index.js +0 -9
  1002. package/dist/modules/background/overlay.d.ts +0 -135
  1003. package/dist/modules/background/overlay.d.ts.map +0 -1
  1004. package/dist/modules/background/playback.d.ts +0 -10
  1005. package/dist/modules/background/playback.d.ts.map +0 -1
  1006. package/dist/modules/background/state.d.ts +0 -9
  1007. package/dist/modules/background/state.d.ts.map +0 -1
  1008. package/dist/modules/background/visual.d.ts +0 -48
  1009. package/dist/modules/background/visual.d.ts.map +0 -1
  1010. package/dist/modules/background/youtube/iframe.d.ts +0 -52
  1011. package/dist/modules/background/youtube/iframe.d.ts.map +0 -1
  1012. package/dist/modules/background/youtube/parse.d.ts +0 -17
  1013. package/dist/modules/background/youtube/parse.d.ts.map +0 -1
  1014. package/dist/modules/background/youtube/player.d.ts +0 -28
  1015. package/dist/modules/background/youtube/player.d.ts.map +0 -1
  1016. package/dist/modules/context-menu/index.js +0 -14
  1017. package/dist/modules/controls/index.js +0 -7
  1018. package/dist/modules/dock/cards.d.ts +0 -1722
  1019. package/dist/modules/dock/cards.d.ts.map +0 -1
  1020. package/dist/modules/dock/dom.d.ts +0 -24
  1021. package/dist/modules/dock/dom.d.ts.map +0 -1
  1022. package/dist/modules/dock/helpers.d.ts +0 -25
  1023. package/dist/modules/dock/helpers.d.ts.map +0 -1
  1024. package/dist/modules/dock/hooks.d.ts +0 -42
  1025. package/dist/modules/dock/hooks.d.ts.map +0 -1
  1026. package/dist/modules/dock/index.js +0 -13
  1027. package/dist/modules/dock/layout.d.ts +0 -26
  1028. package/dist/modules/dock/layout.d.ts.map +0 -1
  1029. package/dist/modules/dock/overlay.d.ts +0 -79
  1030. package/dist/modules/dock/overlay.d.ts.map +0 -1
  1031. package/dist/modules/dock/paths.d.ts +0 -10
  1032. package/dist/modules/dock/paths.d.ts.map +0 -1
  1033. package/dist/modules/dock/state.d.ts +0 -22
  1034. package/dist/modules/dock/state.d.ts.map +0 -1
  1035. package/dist/modules/dock/styles.d.ts +0 -900
  1036. package/dist/modules/dock/styles.d.ts.map +0 -1
  1037. package/dist/modules/dock/surface/hooks.d.ts +0 -110
  1038. package/dist/modules/dock/surface/hooks.d.ts.map +0 -1
  1039. package/dist/modules/dock/types.d.ts +0 -1362
  1040. package/dist/modules/dock/types.d.ts.map +0 -1
  1041. package/dist/modules/loading/index.js +0 -8
  1042. package/dist/modules/media/index.js +0 -6
  1043. package/dist/modules/modal/dom.d.ts +0 -4
  1044. package/dist/modules/modal/dom.d.ts.map +0 -1
  1045. package/dist/modules/modal/header.d.ts +0 -7
  1046. package/dist/modules/modal/header.d.ts.map +0 -1
  1047. package/dist/modules/modal/identity.d.ts +0 -7
  1048. package/dist/modules/modal/identity.d.ts.map +0 -1
  1049. package/dist/modules/modal/index.js +0 -11
  1050. package/dist/modules/modal/layout.d.ts +0 -13
  1051. package/dist/modules/modal/layout.d.ts.map +0 -1
  1052. package/dist/modules/modal/overlay.d.ts +0 -4
  1053. package/dist/modules/modal/overlay.d.ts.map +0 -1
  1054. package/dist/modules/modal/state.d.ts +0 -4
  1055. package/dist/modules/modal/state.d.ts.map +0 -1
  1056. package/dist/modules/navigation/constants.d.ts +0 -37
  1057. package/dist/modules/navigation/constants.d.ts.map +0 -1
  1058. package/dist/modules/navigation/index.js +0 -81
  1059. package/dist/modules/navigation/index.js.map +0 -1
  1060. package/dist/modules/navigation/navigator.d.ts +0 -8
  1061. package/dist/modules/navigation/navigator.d.ts.map +0 -1
  1062. package/dist/modules/navigation/settings.d.ts +0 -10
  1063. package/dist/modules/navigation/settings.d.ts.map +0 -1
  1064. package/dist/modules/navigation/state.d.ts +0 -20
  1065. package/dist/modules/navigation/state.d.ts.map +0 -1
  1066. package/dist/modules/navigation/types.d.ts +0 -168
  1067. package/dist/modules/navigation/types.d.ts.map +0 -1
  1068. package/dist/modules/navigation/utils.d.ts +0 -11
  1069. package/dist/modules/navigation/utils.d.ts.map +0 -1
  1070. package/dist/modules/notification/index.js +0 -7
  1071. package/dist/overlay-TZ6L52A5.js +0 -9
  1072. package/dist/overlay-TZ6L52A5.js.map +0 -1
  1073. package/dist/provider.d.ts +0 -23
  1074. package/dist/provider.d.ts.map +0 -1
  1075. package/dist/provider.js +0 -9
  1076. package/dist/provider.js.map +0 -1
  1077. package/dist/result.d.ts +0 -50
  1078. package/dist/result.d.ts.map +0 -1
  1079. package/dist/result.js +0 -102
  1080. package/dist/result.js.map +0 -1
  1081. package/dist/theme.d.ts +0 -63
  1082. package/dist/theme.d.ts.map +0 -1
  1083. package/dist/theme.js +0 -6
  1084. package/dist/theme.js.map +0 -1
  1085. package/dist/tokens/index.d.ts +0 -4
  1086. package/dist/tokens/index.d.ts.map +0 -1
  1087. package/dist/tokens/index.js +0 -296
  1088. package/dist/tokens/index.js.map +0 -1
  1089. package/dist/tokens/motion-config.d.ts +0 -44
  1090. package/dist/tokens/motion-config.d.ts.map +0 -1
  1091. package/dist/tokens/motion.d.ts +0 -164
  1092. package/dist/tokens/motion.d.ts.map +0 -1
  1093. package/dist/tokens/tokens.d.ts +0 -34
  1094. package/dist/tokens/tokens.d.ts.map +0 -1
  1095. package/dist/utils/cn.d.ts +0 -3
  1096. package/dist/utils/cn.d.ts.map +0 -1
  1097. package/dist/utils/dom.d.ts +0 -5
  1098. package/dist/utils/dom.d.ts.map +0 -1
  1099. package/dist/utils/index.d.ts.map +0 -1
  1100. package/dist/utils/number.d.ts +0 -3
  1101. package/dist/utils/number.d.ts.map +0 -1
  1102. package/dist/utils/object.d.ts +0 -5
  1103. package/dist/utils/object.d.ts.map +0 -1
  1104. package/dist/utils/report.d.ts +0 -5
  1105. package/dist/utils/report.d.ts.map +0 -1
  1106. package/dist/utils/scheduler.d.ts +0 -34
  1107. package/dist/utils/scheduler.d.ts.map +0 -1
  1108. package/dist/utils/store.d.ts +0 -11
  1109. package/dist/utils/store.d.ts.map +0 -1
  1110. package/dist/utils/string.d.ts +0 -5
  1111. package/dist/utils/string.d.ts.map +0 -1
  1112. package/dist/utils/timing.d.ts +0 -7
  1113. package/dist/utils/timing.d.ts.map +0 -1
  1114. package/dist/utils/user-message.d.ts +0 -20
  1115. package/dist/utils/user-message.d.ts.map +0 -1
  1116. package/templates/motion/background.ts +0 -17
  1117. package/templates/motion/context-menu.ts +0 -63
  1118. package/templates/motion/dock.ts +0 -395
  1119. package/templates/motion/modal.ts +0 -79
  1120. package/templates/motion/notification.ts +0 -27
  1121. package/templates/motion/tokens.ts +0 -47
  1122. /package/dist/{atoms → ambient}/index.js.map +0 -0
  1123. /package/dist/{modules/ambient → background}/index.js.map +0 -0
  1124. /package/dist/{modules/background → context-menu}/index.js.map +0 -0
  1125. /package/dist/{modules/context-menu → controls}/index.js.map +0 -0
  1126. /package/dist/{kernel → core/kernel}/runtime.d.ts +0 -0
  1127. /package/dist/{modules/controls → dock}/index.js.map +0 -0
  1128. /package/dist/{modules/dock → loading}/index.js.map +0 -0
  1129. /package/dist/{modules/loading → media}/index.js.map +0 -0
  1130. /package/dist/{modules/media → notification}/index.js.map +0 -0
  1131. /package/dist/{modules/modal → provider}/index.js.map +0 -0
  1132. /package/dist/{modules/notification → theme}/index.js.map +0 -0
@@ -0,0 +1,2367 @@
1
+ import { useStore, useRequiredContext } from './chunk-Y2Q74PJP.js';
2
+ import { createStore, report, trimToNull } from './chunk-5H6FZW3N.js';
3
+ import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
4
+ import { isObject, shallowEqual, isPlainObject } from './chunk-BMFHS3GV.js';
5
+ import { c } from 'react/compiler-runtime';
6
+ import { useState, useSyncExternalStore, use, useId, useRef, useLayoutEffect, useEffect, createElement, Fragment, isValidElement, cloneElement, Children } from 'react';
7
+ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
8
+ import { usePathname } from 'next/navigation';
9
+
10
+ // src/core/kernel/constants.ts
11
+ var DEFAULT_SOURCE = "dynamic";
12
+ var REGISTRY_SOURCES = Object.freeze({
13
+ STATIC: "static",
14
+ DYNAMIC: "dynamic",
15
+ USER: "user"
16
+ });
17
+ var REGISTRY_LIFECYCLES = Object.freeze({
18
+ IMMEDIATE: "immediate",
19
+ GRACEFUL: "graceful",
20
+ PERSISTENT: "persistent",
21
+ ROUTE: "route"
22
+ });
23
+ var REGISTRY_VALIDATION_MODES = Object.freeze({
24
+ WARN: "warn",
25
+ STRICT: "strict"
26
+ });
27
+ var REGISTRY_METADATA_KEYS = Object.freeze(["cleanup", "cleanupDelayMs", "instanceId", "lifecycle", "priority", "source", "scope", "validation"]);
28
+ var REGISTRY_SOURCE_PRIORITY = Object.freeze({
29
+ [REGISTRY_SOURCES.STATIC]: 100,
30
+ [REGISTRY_SOURCES.DYNAMIC]: 200,
31
+ [REGISTRY_SOURCES.USER]: 300
32
+ });
33
+ var REGISTRY_SOURCE_RANK = Object.freeze({
34
+ [REGISTRY_SOURCES.STATIC]: 10,
35
+ [REGISTRY_SOURCES.DYNAMIC]: 20,
36
+ [REGISTRY_SOURCES.USER]: 30
37
+ });
38
+ var REGISTRY_LIFECYCLE_VALUES = new Set(Object.values(REGISTRY_LIFECYCLES));
39
+ var REGISTRY_METADATA_KEY_SET = new Set(REGISTRY_METADATA_KEYS);
40
+ var REGISTRY_SCOPE_KINDS = Object.freeze({
41
+ APP: "app",
42
+ SESSION: "session",
43
+ ROUTE: "route",
44
+ INSTANCE: "instance",
45
+ WORKSPACE: "workspace"
46
+ });
47
+ var DEFAULT_REGISTRY_SCOPE = REGISTRY_SCOPE_KINDS.APP;
48
+
49
+ // src/core/kernel/utils.ts
50
+ function hasOwnProperty(target, key) {
51
+ return Object.prototype.hasOwnProperty.call(target, key);
52
+ }
53
+ function parseFiniteNumber(value) {
54
+ const parsed = Number(value);
55
+ return Number.isFinite(parsed) ? parsed : null;
56
+ }
57
+ function getValidString(value, fallback = null) {
58
+ return trimToNull(value) ?? fallback;
59
+ }
60
+ function resolveInstanceId(value) {
61
+ return isObject(value) && typeof value.instanceId === "string" ? value.instanceId : null;
62
+ }
63
+ function getSourceRank(source) {
64
+ return REGISTRY_SOURCE_RANK[source] ?? 0;
65
+ }
66
+ function resolveRegisterInput(sourceOrOptions, optionsArg) {
67
+ if (typeof sourceOrOptions === "string") {
68
+ return {
69
+ source: sourceOrOptions,
70
+ options: isObject(optionsArg) ? optionsArg : {}
71
+ };
72
+ }
73
+ if (isObject(sourceOrOptions)) {
74
+ return {
75
+ source: typeof sourceOrOptions.source === "string" ? sourceOrOptions.source : DEFAULT_SOURCE,
76
+ options: sourceOrOptions
77
+ };
78
+ }
79
+ return {
80
+ source: DEFAULT_SOURCE,
81
+ options: isObject(optionsArg) ? optionsArg : {}
82
+ };
83
+ }
84
+ function resolveScope(options) {
85
+ return typeof options?.scope === "string" && options.scope.trim() ? options.scope.trim() : DEFAULT_REGISTRY_SCOPE;
86
+ }
87
+ function resolveUnregisterInput(sourceOrOptions) {
88
+ if (typeof sourceOrOptions === "string") {
89
+ return {
90
+ instanceId: null,
91
+ scope: null,
92
+ source: sourceOrOptions
93
+ };
94
+ }
95
+ if (isObject(sourceOrOptions)) {
96
+ return {
97
+ instanceId: resolveInstanceId(sourceOrOptions),
98
+ scope: typeof sourceOrOptions.scope === "string" && sourceOrOptions.scope.trim() ? sourceOrOptions.scope.trim() : null,
99
+ source: typeof sourceOrOptions.source === "string" ? sourceOrOptions.source : DEFAULT_SOURCE
100
+ };
101
+ }
102
+ return {
103
+ instanceId: null,
104
+ scope: null,
105
+ source: DEFAULT_SOURCE
106
+ };
107
+ }
108
+ function mergeModuleConfigs(base, patch) {
109
+ const source = base;
110
+ const changes = patch;
111
+ const result = {
112
+ ...source
113
+ };
114
+ Object.keys(changes).forEach((key) => {
115
+ const baseVal = source[key];
116
+ const patchVal = changes[key];
117
+ if (baseVal && typeof baseVal === "object" && !Array.isArray(baseVal) && patchVal && typeof patchVal === "object" && !Array.isArray(patchVal)) {
118
+ result[key] = {
119
+ ...baseVal,
120
+ ...patchVal
121
+ };
122
+ } else {
123
+ result[key] = patchVal;
124
+ }
125
+ });
126
+ return result;
127
+ }
128
+
129
+ // src/core/kernel/operations-records.ts
130
+ function createInitialRegistriesFor(definitions) {
131
+ return Object.fromEntries(Array.from(definitions.keys(), (type) => [type, {}]));
132
+ }
133
+ function buildSourceRecord({
134
+ source,
135
+ value,
136
+ instanceId = null,
137
+ priority,
138
+ timestamp,
139
+ sequence,
140
+ scope = DEFAULT_REGISTRY_SCOPE
141
+ }) {
142
+ return {
143
+ updatedAt: timestamp,
144
+ sequence: Number.isFinite(sequence) ? sequence : timestamp,
145
+ instanceId: typeof instanceId === "string" ? instanceId : null,
146
+ priority,
147
+ value,
148
+ source,
149
+ scope
150
+ };
151
+ }
152
+ function createRecordKey(source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
153
+ if (scope === DEFAULT_REGISTRY_SCOPE) {
154
+ if (typeof instanceId === "string" && instanceId.length > 0) {
155
+ return `instance:${JSON.stringify([source, instanceId])}`;
156
+ }
157
+ return `source:${JSON.stringify(source)}`;
158
+ }
159
+ if (typeof instanceId === "string" && instanceId.length > 0) {
160
+ return `instance:${JSON.stringify([scope, source, instanceId])}`;
161
+ }
162
+ return `source:${JSON.stringify([scope, source])}`;
163
+ }
164
+ function getSourceRecords(entry, source, scope = null) {
165
+ if (!entry) return [];
166
+ return Object.entries(entry).map(([recordKey, rawRecord]) => ({
167
+ recordKey,
168
+ record: toSourceRecord(rawRecord, recordKey)
169
+ })).filter(({
170
+ record
171
+ }) => record?.source === source && (scope === null || record.scope === scope));
172
+ }
173
+ function getSourceRecord(entry, source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
174
+ const recordKey = createRecordKey(source, instanceId, scope);
175
+ return toSourceRecord(entry?.[recordKey], source);
176
+ }
177
+ function resolveRecordPriority(options, source) {
178
+ if (isObject(options) && hasOwnProperty(options, "priority")) {
179
+ const parsedPriority = Number(options.priority);
180
+ if (Number.isFinite(parsedPriority)) return parsedPriority;
181
+ }
182
+ return REGISTRY_SOURCE_PRIORITY[source] ?? 0;
183
+ }
184
+ function toSourceRecord(rawValue, source = DEFAULT_SOURCE) {
185
+ if (rawValue === void 0) return null;
186
+ const rawRecord = rawValue;
187
+ const isWrappedRecord = isObject(rawValue) && hasOwnProperty(rawRecord, "value") && hasOwnProperty(rawRecord, "updatedAt") && hasOwnProperty(rawRecord, "priority") && hasOwnProperty(rawRecord, "source");
188
+ if (isWrappedRecord) {
189
+ const parsedPriority = Number(rawRecord.priority);
190
+ return {
191
+ updatedAt: Number(rawRecord.updatedAt) || 0,
192
+ sequence: Number(rawRecord.sequence) || Number(rawRecord.updatedAt) || 0,
193
+ instanceId: typeof rawRecord.instanceId === "string" ? rawRecord.instanceId : null,
194
+ priority: Number.isFinite(parsedPriority) ? parsedPriority : REGISTRY_SOURCE_PRIORITY[source] ?? 0,
195
+ source: typeof rawRecord.source === "string" ? rawRecord.source : source,
196
+ scope: typeof rawRecord.scope === "string" ? rawRecord.scope : DEFAULT_REGISTRY_SCOPE,
197
+ value: rawRecord.value
198
+ };
199
+ }
200
+ return {
201
+ updatedAt: 0,
202
+ sequence: 0,
203
+ instanceId: null,
204
+ priority: REGISTRY_SOURCE_PRIORITY[source] ?? 0,
205
+ source,
206
+ scope: DEFAULT_REGISTRY_SCOPE,
207
+ value: rawValue
208
+ };
209
+ }
210
+ function compareRecords(a, b) {
211
+ if (a.priority !== b.priority) return a.priority - b.priority;
212
+ const rankDiff = getSourceRank(a.source) - getSourceRank(b.source);
213
+ if (rankDiff !== 0) return rankDiff;
214
+ return (a.sequence ?? a.updatedAt) - (b.sequence ?? b.updatedAt);
215
+ }
216
+ function recordsHaveSameValue(prevRecord, nextRecord) {
217
+ if (Object.is(prevRecord?.value, nextRecord?.value)) return true;
218
+ if (isObject(prevRecord?.value) && isObject(nextRecord?.value)) {
219
+ return shallowEqual(prevRecord.value, nextRecord.value);
220
+ }
221
+ return false;
222
+ }
223
+ function hasRecordChanged(prevRecord, nextRecord) {
224
+ if (!prevRecord) return true;
225
+ return prevRecord.priority !== nextRecord.priority || prevRecord.source !== nextRecord.source || prevRecord.instanceId !== nextRecord.instanceId || prevRecord.scope !== nextRecord.scope || !recordsHaveSameValue(prevRecord, nextRecord);
226
+ }
227
+ function hasAnySourceRecord(entry) {
228
+ return Object.values(entry || {}).some((rawRecord) => rawRecord !== void 0);
229
+ }
230
+ function setSourceRecord(state, type, key, source, record) {
231
+ const typeRegistry = state[type] || {};
232
+ const currentEntry = typeRegistry[key] || {};
233
+ const recordKey = createRecordKey(source, record.instanceId, record.scope);
234
+ const prevRecord = toSourceRecord(currentEntry[recordKey], source);
235
+ if (!hasRecordChanged(prevRecord, record)) {
236
+ return state;
237
+ }
238
+ return {
239
+ ...state,
240
+ [type]: {
241
+ ...typeRegistry,
242
+ [key]: {
243
+ ...currentEntry,
244
+ [recordKey]: record
245
+ }
246
+ }
247
+ };
248
+ }
249
+ function findRecordsToRemove(entry, source, instanceId, scope) {
250
+ if (typeof instanceId === "string" && instanceId.length > 0 && scope !== null) {
251
+ const safeScope = scope || DEFAULT_REGISTRY_SCOPE;
252
+ const record = getSourceRecord(entry, source, instanceId, safeScope);
253
+ if (!record) return [];
254
+ return [{
255
+ recordKey: createRecordKey(source, instanceId, safeScope),
256
+ record
257
+ }];
258
+ }
259
+ return getSourceRecords(entry, source, scope).filter(({
260
+ record
261
+ }) => !instanceId || record?.instanceId === instanceId).filter((candidate) => Boolean(candidate.record));
262
+ }
263
+ function removeSourceRecord(state, type, key, source, instanceId = null, scope = null) {
264
+ const typeRegistry = state[type];
265
+ const currentEntry = typeRegistry?.[key];
266
+ if (!typeRegistry || !currentEntry) return state;
267
+ const activeRecords = findRecordsToRemove(currentEntry, source, instanceId, scope);
268
+ if (activeRecords.length === 0) return state;
269
+ const nextEntry = {
270
+ ...currentEntry
271
+ };
272
+ activeRecords.forEach(({
273
+ recordKey
274
+ }) => {
275
+ delete nextEntry[recordKey];
276
+ });
277
+ if (!hasAnySourceRecord(nextEntry)) {
278
+ const nextTypeRegistry = {
279
+ ...typeRegistry
280
+ };
281
+ delete nextTypeRegistry[key];
282
+ return {
283
+ ...state,
284
+ [type]: nextTypeRegistry
285
+ };
286
+ }
287
+ return {
288
+ ...state,
289
+ [type]: {
290
+ ...typeRegistry,
291
+ [key]: nextEntry
292
+ }
293
+ };
294
+ }
295
+
296
+ // src/core/kernel/operations-resolve.ts
297
+ function resolveEntryValueFor(definitions, type, entry, scope = null) {
298
+ if (!entry) return void 0;
299
+ const activeRecords = Object.entries(entry).map(([source, rawRecord]) => toSourceRecord(rawRecord, source)).filter((record) => record !== null && (scope === null || record.scope === scope));
300
+ if (activeRecords.length === 0) return void 0;
301
+ const merge = definitions.get(type)?.merge;
302
+ if (merge) {
303
+ const sortedRecords = [...activeRecords].sort(compareRecords);
304
+ const mergeCandidate = sortedRecords.every((record) => isObject(record.value));
305
+ if (mergeCandidate) {
306
+ const values = sortedRecords.map((record) => record.value);
307
+ return merge(values);
308
+ }
309
+ return sortedRecords[sortedRecords.length - 1].value;
310
+ }
311
+ return activeRecords.reduce((winner, current) => compareRecords(current, winner) > 0 ? current : winner).value;
312
+ }
313
+ function createResolverCacheFor(definitions) {
314
+ const entryCache = /* @__PURE__ */ new WeakMap();
315
+ return (type, entry, scope = null) => {
316
+ if (!entry || typeof entry !== "object") {
317
+ return resolveEntryValueFor(definitions, type, entry, scope);
318
+ }
319
+ let typeCache = entryCache.get(entry);
320
+ if (!typeCache) {
321
+ typeCache = /* @__PURE__ */ new Map();
322
+ entryCache.set(entry, typeCache);
323
+ }
324
+ const cacheKey = scope || "default";
325
+ if (typeCache.has(cacheKey)) return typeCache.get(cacheKey);
326
+ const value = resolveEntryValueFor(definitions, type, entry, scope);
327
+ typeCache.set(cacheKey, value);
328
+ return value;
329
+ };
330
+ }
331
+
332
+ // src/core/kernel/schema.ts
333
+ function resolveLifecycle(metadata, fallback) {
334
+ const lifecycle = metadata?.lifecycle ?? metadata?.cleanup;
335
+ return lifecycle && REGISTRY_LIFECYCLE_VALUES.has(lifecycle) ? lifecycle : fallback;
336
+ }
337
+ function checkNonEmptyStrings(metadata, issues) {
338
+ for (const field of ["source", "instanceId", "scope"]) {
339
+ if (metadata[field] !== void 0 && !getValidString(metadata[field])) issues.push(`${field} must be a non-empty string`);
340
+ }
341
+ }
342
+ function checkNumbers(metadata, issues) {
343
+ if (metadata.priority !== void 0 && parseFiniteNumber(metadata.priority) === null) issues.push("priority must be a finite number");
344
+ if (metadata.cleanupDelayMs !== void 0) {
345
+ const delay = parseFiniteNumber(metadata.cleanupDelayMs);
346
+ if (delay === null || delay < 0) issues.push("cleanupDelayMs must be a non-negative finite number");
347
+ }
348
+ }
349
+ function checkEnums(metadata, issues) {
350
+ const lifecycle = metadata.lifecycle ?? metadata.cleanup;
351
+ if (lifecycle !== void 0 && // eslint-disable-next-line @typescript-eslint/no-base-to-string -- lifecycle comes from unvalidated metadata; an object stringifies to "[object Object]" and fails the membership check, which is the intended rejection
352
+ !REGISTRY_LIFECYCLE_VALUES.has(String(lifecycle))) {
353
+ issues.push(`lifecycle must be one of: ${[...REGISTRY_LIFECYCLE_VALUES].join(", ")}`);
354
+ }
355
+ if (metadata.validation !== void 0 && !Object.values(REGISTRY_VALIDATION_MODES).includes(metadata.validation)) {
356
+ issues.push(`validation must be one of: ${Object.values(REGISTRY_VALIDATION_MODES).join(", ")}`);
357
+ }
358
+ }
359
+ function validateRegistryMetadata(metadata) {
360
+ if (metadata === void 0 || metadata === null) return {
361
+ issues: [],
362
+ valid: true
363
+ };
364
+ if (!isObject(metadata)) return {
365
+ issues: ["registry metadata must be an object"],
366
+ valid: false
367
+ };
368
+ const issues = [];
369
+ Object.keys(metadata).forEach((key) => {
370
+ if (!REGISTRY_METADATA_KEY_SET.has(key)) issues.push(`unknown registry metadata field: ${key}`);
371
+ });
372
+ checkNonEmptyStrings(metadata, issues);
373
+ checkNumbers(metadata, issues);
374
+ checkEnums(metadata, issues);
375
+ return {
376
+ issues,
377
+ valid: issues.length === 0
378
+ };
379
+ }
380
+ function validateRegistryKey(type, key, definitions) {
381
+ const definition = definitions.get(type);
382
+ const issues = [];
383
+ if (!definition) issues.push(`unknown registry type: ${String(type)}`);
384
+ if (!getValidString(key)) return {
385
+ issues: [...issues, "key must be a non-empty string"],
386
+ valid: false
387
+ };
388
+ const normalizedKey = String(key).trim();
389
+ if (definition?.keyPolicy === "singleton") {
390
+ const expectedKey = definition.singletonKey;
391
+ if (expectedKey && normalizedKey !== expectedKey) issues.push(`${type} key must be ${expectedKey}`);
392
+ } else if (definition?.keyPolicy === "path") {
393
+ if (!normalizedKey.startsWith("/")) issues.push(`${type} key must be an absolute path`);
394
+ } else if (definition?.keyPolicy === "route") {
395
+ if (!normalizedKey.startsWith("/") && !definition.reservedKeys?.includes(normalizedKey)) {
396
+ issues.push(`${type} key must be a route path or a reserved route key`);
397
+ }
398
+ }
399
+ return {
400
+ issues,
401
+ valid: issues.length === 0
402
+ };
403
+ }
404
+ function validateRegistryValue(type, key, value, definitions) {
405
+ const definition = definitions.get(type);
406
+ const issues = [...validateRegistryKey(type, key, definitions).issues];
407
+ const valueKind = definition?.valueKind ?? "object";
408
+ if (definition && valueKind === "object" && !isPlainObject(value)) {
409
+ issues.push(`${type} values must be plain objects`);
410
+ }
411
+ if (definition && valueKind === "component" && typeof value !== "function" && !isPlainObject(value)) {
412
+ issues.push(`${type} values must be component functions or component objects`);
413
+ }
414
+ const validation = definition?.validate?.(value);
415
+ if (validation && !validation.valid && Array.isArray(validation.issues)) {
416
+ issues.push(...validation.issues);
417
+ }
418
+ return {
419
+ issues,
420
+ valid: issues.length === 0
421
+ };
422
+ }
423
+ function resolveCleanupDelay(lifecycle, candidate, fallback) {
424
+ if (lifecycle === REGISTRY_LIFECYCLES.IMMEDIATE) return 0;
425
+ return candidate !== null && candidate >= 0 ? candidate : fallback;
426
+ }
427
+ function normalizeRegistryMetadata(metadata, {
428
+ defaultCleanupDelayMs = null,
429
+ defaultLifecycle = null,
430
+ defaultSource = DEFAULT_SOURCE
431
+ } = {}) {
432
+ const registryMeta = isObject(metadata) ? metadata : {};
433
+ const normalizedDefaultDelay = parseFiniteNumber(defaultCleanupDelayMs);
434
+ const fallbackCleanupDelayMs = normalizedDefaultDelay !== null && normalizedDefaultDelay >= 0 ? normalizedDefaultDelay : null;
435
+ const fallbackLifecycle = defaultLifecycle && REGISTRY_LIFECYCLE_VALUES.has(defaultLifecycle) ? defaultLifecycle : null;
436
+ const source = getValidString(registryMeta.source) || getValidString(defaultSource, DEFAULT_SOURCE) || DEFAULT_SOURCE;
437
+ const scope = getValidString(registryMeta.scope);
438
+ const priority = parseFiniteNumber(registryMeta.priority);
439
+ const lifecycle = resolveLifecycle(registryMeta, fallbackLifecycle);
440
+ const validation = isValidationMode(registryMeta.validation) ? registryMeta.validation : null;
441
+ const cleanupDelayMs = resolveCleanupDelay(lifecycle, parseFiniteNumber(registryMeta.cleanupDelayMs), fallbackCleanupDelayMs);
442
+ return {
443
+ cleanupDelayMs,
444
+ lifecycle,
445
+ priority,
446
+ registerOptions: {
447
+ ...priority !== null && {
448
+ priority
449
+ },
450
+ ...validation === REGISTRY_VALIDATION_MODES.STRICT && {
451
+ validation
452
+ },
453
+ ...scope && {
454
+ scope
455
+ }
456
+ },
457
+ source,
458
+ ...scope && {
459
+ scope
460
+ },
461
+ ...validation && {
462
+ validation
463
+ }
464
+ };
465
+ }
466
+ function isValidationMode(value) {
467
+ return Object.values(REGISTRY_VALIDATION_MODES).includes(value);
468
+ }
469
+ function pickRegistryMetadata(options) {
470
+ if (!isObject(options)) return {};
471
+ return Object.fromEntries(REGISTRY_METADATA_KEYS.filter((key) => options[key] !== void 0).map((key) => [key, options[key]]));
472
+ }
473
+
474
+ // src/core/kernel/operations.ts
475
+ function createRegisterOperation(type, key, item, sourceOrOptions, optionsArg, timestamp, sequence = timestamp) {
476
+ const {
477
+ source,
478
+ options
479
+ } = resolveRegisterInput(sourceOrOptions, optionsArg);
480
+ const instanceId = resolveInstanceId(options);
481
+ const scope = resolveScope(options);
482
+ return {
483
+ kind: "register",
484
+ validation: options.validation,
485
+ source,
486
+ scope,
487
+ record: buildSourceRecord({
488
+ source,
489
+ value: item,
490
+ instanceId,
491
+ priority: resolveRecordPriority(options, source),
492
+ scope,
493
+ timestamp,
494
+ sequence
495
+ }),
496
+ instanceId,
497
+ type,
498
+ key: typeof key === "string" ? key.trim() : key
499
+ };
500
+ }
501
+ function createUnregisterOperation(type, key, sourceOrOptions) {
502
+ const {
503
+ scope,
504
+ source,
505
+ instanceId
506
+ } = resolveUnregisterInput(sourceOrOptions);
507
+ return {
508
+ kind: "unregister",
509
+ instanceId,
510
+ scope,
511
+ source,
512
+ type,
513
+ key: typeof key === "string" ? key.trim() : key
514
+ };
515
+ }
516
+ function isValidRegistryTargetFor(definitions, type, key) {
517
+ return validateRegistryKey(type, key, definitions).valid;
518
+ }
519
+ function applyOperationFor(definitions, state, operation) {
520
+ if (!isValidRegistryTargetFor(definitions, operation?.type, operation?.key)) return state;
521
+ if (operation.kind === "register") {
522
+ return setSourceRecord(state, operation.type, operation.key, operation.source, operation.record);
523
+ }
524
+ if (operation.kind === "unregister") {
525
+ return removeSourceRecord(state, operation.type, operation.key, operation.source, operation.instanceId, operation.scope);
526
+ }
527
+ return state;
528
+ }
529
+ function unregisterHasEffect(entry, operation) {
530
+ const {
531
+ instanceId,
532
+ scope,
533
+ source
534
+ } = operation;
535
+ if (typeof instanceId !== "string" || instanceId.length === 0) {
536
+ return getSourceRecords(entry, source, scope).length > 0;
537
+ }
538
+ if (scope === null) {
539
+ return getSourceRecords(entry, source).some(({
540
+ record
541
+ }) => record?.instanceId === instanceId);
542
+ }
543
+ return Boolean(getSourceRecord(entry, source, instanceId, scope));
544
+ }
545
+ function hasOperationEffectFor(definitions, state, operation) {
546
+ if (!isValidRegistryTargetFor(definitions, operation?.type, operation?.key)) return false;
547
+ if (operation.kind === "register") {
548
+ const currentRecord = getSourceRecord(state[operation.type]?.[operation.key], operation.source, operation.instanceId, operation.scope);
549
+ return hasRecordChanged(currentRecord, operation.record);
550
+ }
551
+ if (operation.kind === "unregister") {
552
+ return unregisterHasEffect(state[operation.type]?.[operation.key], operation);
553
+ }
554
+ return false;
555
+ }
556
+ function resolveEffectiveOperationsFor(definitions, state, operations) {
557
+ const effectiveOperations = [];
558
+ let nextState = state;
559
+ operations.forEach((operation) => {
560
+ if (!hasOperationEffectFor(definitions, nextState, operation)) return;
561
+ effectiveOperations.push(operation);
562
+ nextState = applyOperationFor(definitions, nextState, operation);
563
+ });
564
+ return {
565
+ effectiveOperations,
566
+ nextState
567
+ };
568
+ }
569
+ function createRegistryOperations(definitions) {
570
+ return Object.freeze({
571
+ applyOperation: (state, operation) => applyOperationFor(definitions, state, operation),
572
+ createInitialRegistries: () => createInitialRegistriesFor(definitions),
573
+ createResolverCache: () => createResolverCacheFor(definitions),
574
+ hasOperationEffect: (state, operation) => hasOperationEffectFor(definitions, state, operation),
575
+ isRegistryType: (type) => definitions.get(type) !== void 0,
576
+ isValidRegistryTarget: (type, key) => isValidRegistryTargetFor(definitions, type, key),
577
+ resolveEffectiveOperations: (state, operations) => resolveEffectiveOperationsFor(definitions, state, operations),
578
+ resolveEntryValue: (type, entry, scope = null) => resolveEntryValueFor(definitions, type, entry, scope)
579
+ });
580
+ }
581
+
582
+ // src/core/kernel/runtime.ts
583
+ var TRACE_RADIX = 36;
584
+ var TRACE_SUFFIX_LENGTH = 6;
585
+ function createTraceId() {
586
+ const time = Date.now().toString(TRACE_RADIX);
587
+ const suffix = Math.random().toString(TRACE_RADIX).slice(2, 2 + TRACE_SUFFIX_LENGTH);
588
+ return `tx-${time}-${suffix}`;
589
+ }
590
+ function withTransactionDefaults(metadata, options) {
591
+ const baseOpts = options && typeof options === "object" ? options : {};
592
+ const needsSource = metadata.source && !baseOpts.source;
593
+ const needsScope = metadata.scope && !baseOpts.scope;
594
+ if (!needsSource && !needsScope) return baseOpts;
595
+ return {
596
+ ...baseOpts,
597
+ ...needsSource ? {
598
+ source: metadata.source
599
+ } : {},
600
+ ...needsScope ? {
601
+ scope: metadata.scope
602
+ } : {}
603
+ };
604
+ }
605
+ function createRegistryTransaction(store, metadata = {}) {
606
+ const operations = [];
607
+ let status = "open";
608
+ const traceId = metadata.traceId || createTraceId();
609
+ const ensureOpen = () => status === "open";
610
+ const mergeOptions = (options) => withTransactionDefaults(metadata, options);
611
+ const register = (type, key, value, sourceOrOptions, optionsArg) => {
612
+ if (!ensureOpen()) return {
613
+ index: -1,
614
+ status,
615
+ traceId
616
+ };
617
+ const options = typeof sourceOrOptions === "string" ? mergeOptions({
618
+ ...optionsArg || {},
619
+ source: sourceOrOptions
620
+ }) : mergeOptions(sourceOrOptions);
621
+ operations.push({
622
+ key,
623
+ item: value,
624
+ options,
625
+ type
626
+ });
627
+ return {
628
+ index: operations.length - 1,
629
+ status: "queued",
630
+ traceId
631
+ };
632
+ };
633
+ const unregister = (type, key, sourceOrOptions) => {
634
+ if (!ensureOpen()) return {
635
+ index: -1,
636
+ status,
637
+ traceId
638
+ };
639
+ const options = mergeOptions(typeof sourceOrOptions === "string" ? {
640
+ source: sourceOrOptions
641
+ } : sourceOrOptions);
642
+ operations.push({
643
+ key,
644
+ options,
645
+ type,
646
+ unregister: true
647
+ });
648
+ return {
649
+ index: operations.length - 1,
650
+ status: "queued",
651
+ traceId
652
+ };
653
+ };
654
+ const rollback = (_reason = "manual") => {
655
+ if (!ensureOpen()) return {
656
+ index: -1,
657
+ status,
658
+ traceId
659
+ };
660
+ status = "rolled-back";
661
+ operations.length = 0;
662
+ return {
663
+ index: -1,
664
+ status,
665
+ traceId
666
+ };
667
+ };
668
+ const commit = () => {
669
+ if (!ensureOpen()) return {
670
+ status,
671
+ traceId
672
+ };
673
+ status = "committed";
674
+ const result = store.batch((queue) => {
675
+ operations.forEach((op) => {
676
+ if (op.unregister) queue.unregister(op.type, op.key, op.options);
677
+ else queue.register(op.type, op.key, op.item, op.options);
678
+ });
679
+ });
680
+ const applied = typeof result === "number" && Number.isFinite(result) ? result : 0;
681
+ return {
682
+ applied,
683
+ queued: operations.length,
684
+ status,
685
+ traceId
686
+ };
687
+ };
688
+ const run = (executor) => {
689
+ if (typeof executor !== "function") {
690
+ rollback("invalid-executor");
691
+ return {
692
+ status,
693
+ traceId
694
+ };
695
+ }
696
+ try {
697
+ executor({
698
+ register,
699
+ unregister
700
+ });
701
+ return commit();
702
+ } catch (error) {
703
+ rollback(error instanceof Error ? error.message : String(error));
704
+ throw error;
705
+ }
706
+ };
707
+ return {
708
+ commit,
709
+ get operations() {
710
+ return operations.slice();
711
+ },
712
+ register,
713
+ rollback,
714
+ run,
715
+ get status() {
716
+ return status;
717
+ },
718
+ traceId,
719
+ unregister
720
+ };
721
+ }
722
+
723
+ // src/core/kernel/store-handles.ts
724
+ var DEFAULT_VALIDATION = REGISTRY_VALIDATION_MODES.WARN;
725
+ function createNoopHandle(status = "rejected", reason = "unknown") {
726
+ const handle = Object.assign(() => false, {
727
+ active: false,
728
+ dispose: () => false,
729
+ instanceId: null,
730
+ key: "",
731
+ priority: 0,
732
+ reason,
733
+ source: "",
734
+ status,
735
+ type: "",
736
+ update: () => handle,
737
+ updatedAt: 0,
738
+ validation: DEFAULT_VALIDATION
739
+ });
740
+ return handle;
741
+ }
742
+ var NOOP_HANDLE = createNoopHandle();
743
+ function isNoopHandle(handle) {
744
+ return handle === NOOP_HANDLE || handle?.status === "rejected" || handle?.status === "ignored";
745
+ }
746
+ function createRegistrationHandle(store, operation) {
747
+ let disposed = false;
748
+ const dispose = (reason = "manual") => {
749
+ if (disposed) return false;
750
+ disposed = true;
751
+ return store.dispose(operation, reason);
752
+ };
753
+ const handle = (reason) => dispose(reason);
754
+ handle.dispose = dispose;
755
+ handle.update = (value, options = {}) => {
756
+ if (disposed || !store.isCurrent(operation)) return NOOP_HANDLE;
757
+ const nextHandle = store.register(operation.type, operation.key, value, operation.source, {
758
+ ...typeof options === "object" ? options : {},
759
+ instanceId: operation.instanceId,
760
+ priority: operation.record.priority,
761
+ ...operation.scope ? {
762
+ scope: operation.scope
763
+ } : {},
764
+ ...operation.validation ? {
765
+ validation: operation.validation
766
+ } : {}
767
+ });
768
+ if (isNoopHandle(nextHandle)) return handle;
769
+ disposed = true;
770
+ return nextHandle;
771
+ };
772
+ Object.defineProperties(handle, {
773
+ active: {
774
+ enumerable: true,
775
+ get: () => !disposed && store.isCurrent(operation)
776
+ },
777
+ instanceId: {
778
+ enumerable: true,
779
+ value: operation.instanceId
780
+ },
781
+ key: {
782
+ enumerable: true,
783
+ value: operation.key
784
+ },
785
+ priority: {
786
+ enumerable: true,
787
+ value: operation.record.priority
788
+ },
789
+ source: {
790
+ enumerable: true,
791
+ value: operation.source
792
+ },
793
+ status: {
794
+ enumerable: true,
795
+ get: () => {
796
+ if (disposed) return "disposed";
797
+ return store.isCurrent(operation) ? "active" : "superseded";
798
+ }
799
+ },
800
+ type: {
801
+ enumerable: true,
802
+ value: operation.type
803
+ },
804
+ updatedAt: {
805
+ enumerable: true,
806
+ value: operation.record.updatedAt
807
+ },
808
+ validation: {
809
+ enumerable: true,
810
+ value: operation.validation || DEFAULT_VALIDATION
811
+ }
812
+ });
813
+ return handle;
814
+ }
815
+ function cloneRegistryValue(value, seen = /* @__PURE__ */ new WeakMap()) {
816
+ if (value === null || typeof value !== "object" || isValidElement(value)) {
817
+ return value;
818
+ }
819
+ const prototype = Object.getPrototypeOf(value);
820
+ const isPlainObject2 = !Array.isArray(value) && (prototype === Object.prototype || prototype === null);
821
+ if (!Array.isArray(value) && !isPlainObject2) return value;
822
+ if (seen.has(value)) return seen.get(value);
823
+ const source = value;
824
+ const clone = Array.isArray(value) ? [] : {};
825
+ seen.set(value, clone);
826
+ for (const key in source) {
827
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
828
+ clone[key] = cloneRegistryValue(source[key], seen);
829
+ }
830
+ }
831
+ return clone;
832
+ }
833
+ function resolveRegistrationOptions(sourceOrOptions, optionsArg) {
834
+ if (sourceOrOptions && typeof sourceOrOptions === "object") return sourceOrOptions;
835
+ return optionsArg && typeof optionsArg === "object" ? optionsArg : {};
836
+ }
837
+ function validateRegistration(definitions, type, key, value, sourceOrOptions, optionsArg) {
838
+ const options = resolveRegistrationOptions(sourceOrOptions, optionsArg);
839
+ const metadataValidation = validateRegistryMetadata(options);
840
+ const isStrict = options.validation === REGISTRY_VALIDATION_MODES.STRICT;
841
+ if (!metadataValidation.valid && isStrict) {
842
+ return {
843
+ issues: metadataValidation.issues,
844
+ reason: "invalid-metadata",
845
+ valid: false
846
+ };
847
+ }
848
+ const validation = validateRegistryValue(type, key, value, definitions);
849
+ if (validation.valid) return {
850
+ valid: true
851
+ };
852
+ if (!isStrict) {
853
+ report(`Registry ${type} "${key}" is invalid`, validation.issues, "warn");
854
+ }
855
+ return {
856
+ issues: validation.issues,
857
+ reason: "invalid-value",
858
+ valid: !isStrict
859
+ };
860
+ }
861
+ function prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, timestamp, sequence) {
862
+ if (!ops.isValidRegistryTarget(type, key)) {
863
+ return {
864
+ rejected: createNoopHandle("rejected", "invalid-target")
865
+ };
866
+ }
867
+ const validation = validateRegistration(definitions, type, key, item, sourceOrOptions, optionsArg);
868
+ if (!validation.valid) {
869
+ return {
870
+ rejected: createNoopHandle("rejected", validation.reason)
871
+ };
872
+ }
873
+ return {
874
+ operation: createRegisterOperation(type, key, cloneRegistryValue(item), sourceOrOptions, optionsArg, timestamp, sequence)
875
+ };
876
+ }
877
+
878
+ // src/core/kernel/store-batch.ts
879
+ function createBatchQueue({
880
+ definitions,
881
+ getStore,
882
+ nextSequence,
883
+ operations,
884
+ ops,
885
+ timestamp
886
+ }) {
887
+ return {
888
+ register: (type, key, item, sourceOrOptions = DEFAULT_SOURCE, optionsArg = {}) => {
889
+ const prepared = prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, timestamp, nextSequence());
890
+ if ("rejected" in prepared) return prepared.rejected;
891
+ operations.push(prepared.operation);
892
+ return createRegistrationHandle(getStore(), prepared.operation);
893
+ },
894
+ unregister: (type, key, sourceOrOptions = DEFAULT_SOURCE) => {
895
+ if (!ops.isValidRegistryTarget(type, key)) return;
896
+ operations.push(createUnregisterOperation(type, key, sourceOrOptions));
897
+ }
898
+ };
899
+ }
900
+
901
+ // src/core/kernel/store-entries.ts
902
+ function normalizeInitialEntries(entries) {
903
+ return (Array.isArray(entries) ? entries : []).filter((entry) => Boolean(entry?.type && entry?.items && typeof entry.items === "object"));
904
+ }
905
+ function createInitialState(ops, definitions, entries) {
906
+ const normalizedEntries = normalizeInitialEntries(entries);
907
+ if (normalizedEntries.length === 0) return ops.createInitialRegistries();
908
+ const timestamp = Date.now();
909
+ let sequence = 0;
910
+ let state = ops.createInitialRegistries();
911
+ normalizedEntries.forEach((entry) => {
912
+ const source = entry.source || REGISTRY_SOURCES.STATIC;
913
+ const options = {
914
+ ...entry.options || {},
915
+ instanceId: entry.instanceId || entry.options?.instanceId || "registry-initial"
916
+ };
917
+ Object.entries(entry.items).forEach(([key, value]) => {
918
+ const validation = validateRegistration(definitions, entry.type, key, value, source, options);
919
+ if (!validation.valid) return;
920
+ const operation = createRegisterOperation(entry.type, key, cloneRegistryValue(value), source, options, timestamp, ++sequence);
921
+ if (ops.hasOperationEffect(state, operation)) {
922
+ state = ops.applyOperation(state, operation);
923
+ }
924
+ });
925
+ });
926
+ return state;
927
+ }
928
+
929
+ // src/core/kernel/store-snapshots.ts
930
+ var SCOPE_KEY_SEPARATOR = "\0";
931
+ function createSnapshotReaders(getState, resolveValue) {
932
+ const entrySnapshots = /* @__PURE__ */ new Map();
933
+ const valueSnapshots = /* @__PURE__ */ new Map();
934
+ const getSnapshot = (type, key, scope = null) => {
935
+ const entry = getState()[type]?.[key];
936
+ let snapshots = valueSnapshots.get(type);
937
+ if (!snapshots) {
938
+ snapshots = /* @__PURE__ */ new Map();
939
+ valueSnapshots.set(type, snapshots);
940
+ }
941
+ const cacheKey = scope === null ? key : `${scope}${SCOPE_KEY_SEPARATOR}${key}`;
942
+ if (entry === void 0) {
943
+ snapshots.delete(cacheKey);
944
+ return void 0;
945
+ }
946
+ const cached = snapshots.get(cacheKey);
947
+ if (cached && cached.entry === entry) return cached.value;
948
+ const value = resolveValue(type, entry, scope);
949
+ snapshots.set(cacheKey, {
950
+ entry,
951
+ value
952
+ });
953
+ return value;
954
+ };
955
+ const getEntriesSnapshot = (type, scope = null) => {
956
+ const typeRegistry = getState()[type] || {};
957
+ const cacheKey = `${type}::${scope ?? "null"}`;
958
+ const cached = entrySnapshots.get(cacheKey);
959
+ if (cached?.typeRegistry === typeRegistry) return cached.value;
960
+ const resolved = {};
961
+ for (const key in typeRegistry) {
962
+ if (Object.prototype.hasOwnProperty.call(typeRegistry, key)) {
963
+ const value = resolveValue(type, typeRegistry[key], scope);
964
+ if (value !== void 0) resolved[key] = value;
965
+ }
966
+ }
967
+ const finalValue = Object.freeze(resolved);
968
+ entrySnapshots.set(cacheKey, {
969
+ typeRegistry,
970
+ value: finalValue
971
+ });
972
+ return finalValue;
973
+ };
974
+ return {
975
+ getEntriesSnapshot,
976
+ getSnapshot
977
+ };
978
+ }
979
+
980
+ // src/core/kernel/store-subscriptions.ts
981
+ function notifyListeners(listeners) {
982
+ if (!listeners) return;
983
+ for (const listener of listeners) {
984
+ try {
985
+ listener();
986
+ } catch (error) {
987
+ report("Registry listener", error);
988
+ }
989
+ }
990
+ }
991
+ function getOrCreateKeyListeners(listenersByType, type, key) {
992
+ let listeners = listenersByType.get(type);
993
+ if (!listeners) {
994
+ listeners = /* @__PURE__ */ new Map();
995
+ listenersByType.set(type, listeners);
996
+ }
997
+ let keyListeners = listeners.get(key);
998
+ if (!keyListeners) {
999
+ keyListeners = /* @__PURE__ */ new Set();
1000
+ listeners.set(key, keyListeners);
1001
+ }
1002
+ return keyListeners;
1003
+ }
1004
+ function collectChangedKeys(operations, isValidTarget) {
1005
+ const changedKeysByType = /* @__PURE__ */ new Map();
1006
+ for (const operation of operations) {
1007
+ if (!isValidTarget(operation?.type, operation?.key)) continue;
1008
+ let keys = changedKeysByType.get(operation.type);
1009
+ if (!keys) {
1010
+ keys = /* @__PURE__ */ new Set();
1011
+ changedKeysByType.set(operation.type, keys);
1012
+ }
1013
+ keys.add(operation.key);
1014
+ }
1015
+ return changedKeysByType;
1016
+ }
1017
+ function createListenerRegistry() {
1018
+ const listenersByType = /* @__PURE__ */ new Map();
1019
+ function subscribe(type, key, listener) {
1020
+ const keyListeners = getOrCreateKeyListeners(listenersByType, type, key ?? null);
1021
+ keyListeners.add(listener);
1022
+ return () => {
1023
+ keyListeners.delete(listener);
1024
+ if (keyListeners.size > 0) return;
1025
+ const listeners = listenersByType.get(type);
1026
+ if (listeners) {
1027
+ listeners.delete(key ?? null);
1028
+ if (listeners.size === 0) listenersByType.delete(type);
1029
+ }
1030
+ };
1031
+ }
1032
+ function notifyChanged(previousState, nextState, changedKeysByType) {
1033
+ for (const [type, changedKeys] of changedKeysByType) {
1034
+ const previousRegistry = previousState[type] || {};
1035
+ const nextRegistry = nextState[type] || {};
1036
+ const typeListeners = listenersByType.get(type);
1037
+ let typeChanged = false;
1038
+ if (!typeListeners) continue;
1039
+ for (const key of changedKeys) {
1040
+ if (previousRegistry[key] === nextRegistry[key]) continue;
1041
+ typeChanged = true;
1042
+ notifyListeners(typeListeners.get(key));
1043
+ }
1044
+ if (typeChanged) {
1045
+ notifyListeners(typeListeners.get(null));
1046
+ }
1047
+ }
1048
+ }
1049
+ return {
1050
+ notifyChanged,
1051
+ subscribe
1052
+ };
1053
+ }
1054
+
1055
+ // src/core/kernel/store.ts
1056
+ var NO_DEFINITIONS = /* @__PURE__ */ new Map();
1057
+ function createRegistryStore(initialEntries = [], definitions = NO_DEFINITIONS) {
1058
+ const ops = createRegistryOperations(definitions);
1059
+ let registries = createInitialState(ops, definitions, initialEntries);
1060
+ let sequence = normalizeInitialEntries(initialEntries).reduce((count, entry) => count + Object.keys(entry.items).length, 0);
1061
+ const listeners = createListenerRegistry();
1062
+ const resolveCachedValue = ops.createResolverCache();
1063
+ const {
1064
+ getEntriesSnapshot,
1065
+ getSnapshot
1066
+ } = createSnapshotReaders(() => registries, resolveCachedValue);
1067
+ const commit = (nextState, operations = []) => {
1068
+ if (registries === nextState) return;
1069
+ const previousState = registries;
1070
+ registries = nextState;
1071
+ listeners.notifyChanged(previousState, nextState, collectChangedKeys(operations, ops.isValidRegistryTarget));
1072
+ };
1073
+ const isCurrent = (operation) => {
1074
+ const entry = registries[operation.type]?.[operation.key];
1075
+ const recordKey = createRecordKey(operation.source, operation.instanceId, operation.scope);
1076
+ return entry?.[recordKey] === operation.record;
1077
+ };
1078
+ const dispose = (operation, _reason = "manual") => {
1079
+ if (!isCurrent(operation)) return false;
1080
+ const unregisterOperation = createUnregisterOperation(operation.type, operation.key, {
1081
+ source: operation.source,
1082
+ instanceId: operation.instanceId,
1083
+ scope: operation.scope
1084
+ });
1085
+ if (!ops.hasOperationEffect(registries, unregisterOperation)) return false;
1086
+ commit(ops.applyOperation(registries, unregisterOperation), [unregisterOperation]);
1087
+ return true;
1088
+ };
1089
+ const register = (type, key, item, sourceOrOptions = DEFAULT_SOURCE, optionsArg = {}) => {
1090
+ const prepared = prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, Date.now(), ++sequence);
1091
+ if ("rejected" in prepared) return prepared.rejected;
1092
+ const {
1093
+ operation
1094
+ } = prepared;
1095
+ if (!ops.hasOperationEffect(registries, operation)) {
1096
+ return createNoopHandle("ignored", "unchanged");
1097
+ }
1098
+ commit(ops.applyOperation(registries, operation), [operation]);
1099
+ return createRegistrationHandle(store, operation);
1100
+ };
1101
+ const unregister = (type, key, sourceOrOptions = DEFAULT_SOURCE) => {
1102
+ if (!ops.isValidRegistryTarget(type, key)) return;
1103
+ const operation = createUnregisterOperation(type, key, sourceOrOptions);
1104
+ if (!ops.hasOperationEffect(registries, operation)) return;
1105
+ commit(ops.applyOperation(registries, operation), [operation]);
1106
+ };
1107
+ const batch = (executor) => {
1108
+ if (typeof executor !== "function") return 0;
1109
+ const operations = [];
1110
+ executor(createBatchQueue({
1111
+ definitions,
1112
+ getStore: () => store,
1113
+ nextSequence: () => ++sequence,
1114
+ operations,
1115
+ ops,
1116
+ timestamp: Date.now()
1117
+ }));
1118
+ if (operations.length === 0) return 0;
1119
+ const {
1120
+ effectiveOperations,
1121
+ nextState
1122
+ } = ops.resolveEffectiveOperations(registries, operations);
1123
+ if (effectiveOperations.length === 0) return 0;
1124
+ commit(nextState, effectiveOperations);
1125
+ return effectiveOperations.length;
1126
+ };
1127
+ const store = {
1128
+ batch,
1129
+ dispose,
1130
+ getEntriesSnapshot,
1131
+ getSnapshot,
1132
+ isCurrent,
1133
+ register,
1134
+ subscribe: listeners.subscribe,
1135
+ transaction: (executor, metadata = {}) => createRegistryTransaction(store, metadata).run(executor),
1136
+ unregister
1137
+ };
1138
+ return store;
1139
+ }
1140
+ var keyedSubscriptions = /* @__PURE__ */ new WeakMap();
1141
+ function keyedSubscription(subscription, id, create) {
1142
+ let byId = keyedSubscriptions.get(subscription);
1143
+ if (!byId) {
1144
+ byId = /* @__PURE__ */ new Map();
1145
+ keyedSubscriptions.set(subscription, byId);
1146
+ }
1147
+ let entry = byId.get(id);
1148
+ if (!entry) {
1149
+ entry = create();
1150
+ byId.set(id, entry);
1151
+ }
1152
+ return entry;
1153
+ }
1154
+ function createRegistryContextValue(store) {
1155
+ return {
1156
+ actions: {
1157
+ batch: store.batch,
1158
+ register: store.register,
1159
+ transaction: store.transaction,
1160
+ unregister: store.unregister
1161
+ },
1162
+ subscription: {
1163
+ getEntriesSnapshot: store.getEntriesSnapshot,
1164
+ getSnapshot: store.getSnapshot,
1165
+ subscribe: store.subscribe
1166
+ }
1167
+ };
1168
+ }
1169
+ var RegistryContext = getOrCreateGlobalContext("RegistryContext", null);
1170
+ function RegistryProvider(t0) {
1171
+ const $ = c(8);
1172
+ const {
1173
+ children,
1174
+ definitions,
1175
+ initialEntries: t1
1176
+ } = t0;
1177
+ let t2;
1178
+ if ($[0] !== t1) {
1179
+ t2 = t1 === void 0 ? [] : t1;
1180
+ $[0] = t1;
1181
+ $[1] = t2;
1182
+ } else {
1183
+ t2 = $[1];
1184
+ }
1185
+ const initialEntries = t2;
1186
+ let t3;
1187
+ if ($[2] !== definitions || $[3] !== initialEntries) {
1188
+ t3 = () => createRegistryContextValue(createRegistryStore(initialEntries, definitions));
1189
+ $[2] = definitions;
1190
+ $[3] = initialEntries;
1191
+ $[4] = t3;
1192
+ } else {
1193
+ t3 = $[4];
1194
+ }
1195
+ const [contextValue] = useState(t3);
1196
+ let t4;
1197
+ if ($[5] !== children || $[6] !== contextValue) {
1198
+ t4 = /* @__PURE__ */ jsx(RegistryContext, { value: contextValue, children });
1199
+ $[5] = children;
1200
+ $[6] = contextValue;
1201
+ $[7] = t4;
1202
+ } else {
1203
+ t4 = $[7];
1204
+ }
1205
+ return t4;
1206
+ }
1207
+ function useRegistryActions() {
1208
+ return useRequiredContext(RegistryContext, "useRegistryActions", "RegistryProvider").actions;
1209
+ }
1210
+ function useRegistrySubscription() {
1211
+ return useRequiredContext(RegistryContext, "useRegistrySubscription", "RegistryProvider").subscription;
1212
+ }
1213
+ function useRegistryValue(type, key) {
1214
+ const $ = c(8);
1215
+ const subscription = useRegistrySubscription();
1216
+ const t0 = `value\0${type}\0${key}`;
1217
+ let t1;
1218
+ if ($[0] !== key || $[1] !== subscription || $[2] !== type) {
1219
+ t1 = () => ({
1220
+ getSnapshot: () => subscription.getSnapshot(type, key),
1221
+ subscribe: (listener) => subscription.subscribe(type, key, listener)
1222
+ });
1223
+ $[0] = key;
1224
+ $[1] = subscription;
1225
+ $[2] = type;
1226
+ $[3] = t1;
1227
+ } else {
1228
+ t1 = $[3];
1229
+ }
1230
+ let t2;
1231
+ if ($[4] !== subscription || $[5] !== t0 || $[6] !== t1) {
1232
+ t2 = keyedSubscription(subscription, t0, t1);
1233
+ $[4] = subscription;
1234
+ $[5] = t0;
1235
+ $[6] = t1;
1236
+ $[7] = t2;
1237
+ } else {
1238
+ t2 = $[7];
1239
+ }
1240
+ const {
1241
+ getSnapshot,
1242
+ subscribe
1243
+ } = t2;
1244
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
1245
+ }
1246
+ function useRegistryEntries(type) {
1247
+ const $ = c(7);
1248
+ const subscription = useRegistrySubscription();
1249
+ const t0 = `entries\0${type}`;
1250
+ let t1;
1251
+ if ($[0] !== subscription || $[1] !== type) {
1252
+ t1 = () => ({
1253
+ getSnapshot: () => subscription.getEntriesSnapshot(type),
1254
+ subscribe: (listener) => subscription.subscribe(type, null, listener)
1255
+ });
1256
+ $[0] = subscription;
1257
+ $[1] = type;
1258
+ $[2] = t1;
1259
+ } else {
1260
+ t1 = $[2];
1261
+ }
1262
+ let t2;
1263
+ if ($[3] !== subscription || $[4] !== t0 || $[5] !== t1) {
1264
+ t2 = keyedSubscription(subscription, t0, t1);
1265
+ $[3] = subscription;
1266
+ $[4] = t0;
1267
+ $[5] = t1;
1268
+ $[6] = t2;
1269
+ } else {
1270
+ t2 = $[6];
1271
+ }
1272
+ const {
1273
+ getSnapshot,
1274
+ subscribe
1275
+ } = t2;
1276
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
1277
+ }
1278
+ var EMPTY_MODULES = Object.freeze([]);
1279
+ var PassthroughBoundary = ({
1280
+ children
1281
+ }) => children;
1282
+ var ModuleHostContext = getOrCreateGlobalContext("ModuleHostContext", null);
1283
+ function selectModuleSlice(coreModule, config) {
1284
+ const slice = coreModule.page?.select ? coreModule.page.select(config) : config[coreModule.id];
1285
+ return slice ?? null;
1286
+ }
1287
+ function createModulePayload(modules, config, metadata = {}) {
1288
+ const payload = {};
1289
+ let hasSlices = false;
1290
+ for (const coreModule of modules) {
1291
+ if (!coreModule.page?.entries) continue;
1292
+ const slice = selectModuleSlice(coreModule, config);
1293
+ if (slice === null) continue;
1294
+ payload[coreModule.id] = slice;
1295
+ hasSlices = true;
1296
+ }
1297
+ if (!hasSlices) return null;
1298
+ return {
1299
+ ...payload,
1300
+ registry: {
1301
+ ...metadata,
1302
+ ...isObject(config.registry) ? config.registry : {}
1303
+ }
1304
+ };
1305
+ }
1306
+ var MODULE_ID_PATTERN = /^[a-z][a-zA-Z0-9]*$/;
1307
+ function sortModules(modules) {
1308
+ const byId = /* @__PURE__ */ new Map();
1309
+ for (const coreModule of modules) {
1310
+ if (!MODULE_ID_PATTERN.test(coreModule.id)) {
1311
+ throw new Error(`[Core] Invalid module id "${coreModule.id}": use a camelCase name such as "contextMenu".`);
1312
+ }
1313
+ if (byId.has(coreModule.id)) {
1314
+ throw new Error(`[Core] Module "${coreModule.id}" is installed twice.`);
1315
+ }
1316
+ byId.set(coreModule.id, coreModule);
1317
+ }
1318
+ const sorted = [];
1319
+ const state = /* @__PURE__ */ new Map();
1320
+ const visit = (coreModule, path) => {
1321
+ const current = state.get(coreModule.id);
1322
+ if (current === "done") return;
1323
+ if (current === "visiting") {
1324
+ throw new Error(`[Core] Module dependency cycle: ${[...path, coreModule.id].join(" -> ")}`);
1325
+ }
1326
+ state.set(coreModule.id, "visiting");
1327
+ for (const id of coreModule.uses ?? []) {
1328
+ const dependency = byId.get(id);
1329
+ if (dependency) visit(dependency, [...path, coreModule.id]);
1330
+ }
1331
+ state.set(coreModule.id, "done");
1332
+ sorted.push(coreModule);
1333
+ };
1334
+ modules.forEach((coreModule) => visit(coreModule, []));
1335
+ return sorted;
1336
+ }
1337
+ function createModuleRegistryDefinitions(modules) {
1338
+ const definitions = /* @__PURE__ */ new Map();
1339
+ for (const coreModule of modules) {
1340
+ if (coreModule.registry) definitions.set(coreModule.id, coreModule.registry);
1341
+ }
1342
+ return definitions;
1343
+ }
1344
+ function useInstalledModules() {
1345
+ return use(ModuleHostContext)?.modules ?? EMPTY_MODULES;
1346
+ }
1347
+
1348
+ // src/core/kernel/handlers.ts
1349
+ function isPersistentLifecycle(lifecycle) {
1350
+ return lifecycle === REGISTRY_LIFECYCLES.PERSISTENT;
1351
+ }
1352
+ function runRegistrationBatch(context, executor) {
1353
+ return typeof context.batch === "function" ? context.batch(executor) : executor(context);
1354
+ }
1355
+ function createEntryCleanupKey(type, key, source, instanceId, scope) {
1356
+ return JSON.stringify(["entry", type, key, scope ?? null, source, instanceId]);
1357
+ }
1358
+ function getCleanupScope(context) {
1359
+ return context?.cleanupScope || /* @__PURE__ */ new Map();
1360
+ }
1361
+ function clearCleanupTimer(scope, cleanupKey) {
1362
+ const lifecycle = scope.get(cleanupKey);
1363
+ if (!lifecycle) return;
1364
+ lifecycle.cancelled = true;
1365
+ if (lifecycle.timerId !== null) clearTimeout(lifecycle.timerId);
1366
+ scope.delete(cleanupKey);
1367
+ }
1368
+ function scheduleCleanup(scope, cleanupKey, callback, delayMs) {
1369
+ clearCleanupTimer(scope, cleanupKey);
1370
+ const lifecycle = {
1371
+ cancelled: false,
1372
+ timerId: null
1373
+ };
1374
+ lifecycle.timerId = setTimeout(() => {
1375
+ if (lifecycle.cancelled || scope.get(cleanupKey) !== lifecycle) return;
1376
+ scope.delete(cleanupKey);
1377
+ callback();
1378
+ }, delayMs);
1379
+ scope.set(cleanupKey, lifecycle);
1380
+ }
1381
+ function resolveItemMetadata(item, pageMetadata) {
1382
+ const itemMetadata = isObject(item) && isObject(item.registry) ? item.registry : {};
1383
+ return {
1384
+ ...pageMetadata,
1385
+ ...itemMetadata
1386
+ };
1387
+ }
1388
+ function stripRegistryKey(item) {
1389
+ if (!isObject(item)) return item;
1390
+ return Object.fromEntries(Object.entries(item).filter(([key]) => key !== "registry"));
1391
+ }
1392
+ function collectModuleRegistrations(coreModule, slice, pageMetadata, context) {
1393
+ const definition = coreModule.registry;
1394
+ const toEntries = coreModule.page?.entries;
1395
+ if (!definition || !toEntries || slice == null || slice === false) return [];
1396
+ const type = coreModule.id;
1397
+ const items = Array.isArray(slice) ? slice : [slice];
1398
+ const registrations = [];
1399
+ for (const item of items) {
1400
+ if (item == null || item === false) continue;
1401
+ const metadata = resolveItemMetadata(item, pageMetadata);
1402
+ if (metadata.validation === REGISTRY_VALIDATION_MODES.STRICT && !validateRegistryMetadata(metadata).valid) {
1403
+ continue;
1404
+ }
1405
+ const payload = stripRegistryKey(item);
1406
+ const {
1407
+ cleanupDelayMs,
1408
+ lifecycle,
1409
+ registerOptions,
1410
+ scope,
1411
+ source
1412
+ } = normalizeRegistryMetadata(metadata, {
1413
+ defaultCleanupDelayMs: definition.cleanupDelayMs ?? null,
1414
+ defaultLifecycle: definition.lifecycle,
1415
+ defaultSource: DEFAULT_SOURCE
1416
+ });
1417
+ for (const {
1418
+ key,
1419
+ value
1420
+ } of toEntries(payload, context) ?? []) {
1421
+ const validation = definition.validate?.(value);
1422
+ if (validation && !validation.valid) {
1423
+ report(`Registry ${type} config is invalid`, validation.issues, "warn");
1424
+ continue;
1425
+ }
1426
+ registrations.push({
1427
+ cleanupDelayMs,
1428
+ cleanupKey: createEntryCleanupKey(type, key, source, context.instanceId, scope),
1429
+ key,
1430
+ lifecycle,
1431
+ registerOptions,
1432
+ scope,
1433
+ source,
1434
+ type,
1435
+ value
1436
+ });
1437
+ }
1438
+ }
1439
+ return registrations;
1440
+ }
1441
+ function collectRegistrations(modules, config, context) {
1442
+ const pageMetadata = isObject(config.registry) ? config.registry : {};
1443
+ const slices = config;
1444
+ return modules.flatMap((coreModule) => {
1445
+ try {
1446
+ return collectModuleRegistrations(coreModule, slices[coreModule.id], pageMetadata, context);
1447
+ } catch (error) {
1448
+ report(`Registry apply (${coreModule.id})`, error);
1449
+ return [];
1450
+ }
1451
+ });
1452
+ }
1453
+ function hasCleanupDelay(delayMs) {
1454
+ return typeof delayMs === "number" && delayMs > 0;
1455
+ }
1456
+ function createTeardown(registrations, context, cleanupScope) {
1457
+ const owner = (registration) => ({
1458
+ instanceId: context.instanceId,
1459
+ scope: registration.scope,
1460
+ source: registration.source
1461
+ });
1462
+ return () => {
1463
+ const immediate = [];
1464
+ registrations.forEach((registration) => {
1465
+ if (isPersistentLifecycle(registration.lifecycle)) return;
1466
+ const {
1467
+ cleanupDelayMs,
1468
+ cleanupKey,
1469
+ key,
1470
+ type
1471
+ } = registration;
1472
+ if (hasCleanupDelay(cleanupDelayMs)) {
1473
+ scheduleCleanup(cleanupScope, cleanupKey, () => context.unregister(type, key, owner(registration)), cleanupDelayMs);
1474
+ } else {
1475
+ immediate.push(registration);
1476
+ }
1477
+ });
1478
+ if (immediate.length === 0) return;
1479
+ runRegistrationBatch(context, (queue) => {
1480
+ immediate.forEach((registration) => queue.unregister(registration.type, registration.key, owner(registration)));
1481
+ });
1482
+ };
1483
+ }
1484
+ var NO_CLEANUP = () => {
1485
+ };
1486
+ function applyRegistryConfig(config, context) {
1487
+ const modules = context.modules ?? [];
1488
+ if (!config || modules.length === 0) return NO_CLEANUP;
1489
+ const registrations = collectRegistrations(modules, config, context);
1490
+ if (registrations.length === 0) return NO_CLEANUP;
1491
+ const cleanupScope = getCleanupScope(context);
1492
+ runRegistrationBatch(context, (queue) => {
1493
+ registrations.forEach(({
1494
+ cleanupKey,
1495
+ key,
1496
+ registerOptions,
1497
+ source,
1498
+ type,
1499
+ value
1500
+ }) => {
1501
+ clearCleanupTimer(cleanupScope, cleanupKey);
1502
+ queue.register(type, key, value, source, registerOptions);
1503
+ });
1504
+ });
1505
+ return createTeardown(registrations, context, cleanupScope);
1506
+ }
1507
+ var MAX_STABILIZATION_DEPTH = 64;
1508
+ function createStableFunctionEntry(fn) {
1509
+ const entry = {
1510
+ current: fn,
1511
+ stable(...args) {
1512
+ return entry.current?.apply(this, args);
1513
+ }
1514
+ };
1515
+ return entry;
1516
+ }
1517
+ function isDirectRegistryComponentPath(path, componentSlices) {
1518
+ const match = /^config\.([^.[]+)\.[^.[]+$/.exec(path);
1519
+ return Boolean(match && componentSlices.has(match[1]));
1520
+ }
1521
+ function isReactNodeLike(value) {
1522
+ return value === null || value === void 0 || typeof value === "boolean" || typeof value === "string" || typeof value === "number" || isValidElement(value);
1523
+ }
1524
+ function isStabilizableObject(value) {
1525
+ return typeof value === "object" && value !== null && !Array.isArray(value) && !isValidElement(value);
1526
+ }
1527
+ function hasSameObjectKeys(previousValue, nextValue) {
1528
+ if (!isStabilizableObject(previousValue) || !isStabilizableObject(nextValue)) {
1529
+ return false;
1530
+ }
1531
+ const previousKeys = Object.keys(previousValue);
1532
+ const nextKeys = Object.keys(nextValue);
1533
+ if (previousKeys.length !== nextKeys.length) return false;
1534
+ return nextKeys.every((key) => Object.prototype.hasOwnProperty.call(previousValue, key));
1535
+ }
1536
+ function stabilizeFunction(fn, path, scope) {
1537
+ const isComponent = fn.name && /^[A-Z]/.test(fn.name);
1538
+ if (isComponent || isDirectRegistryComponentPath(path, scope.componentSlices)) {
1539
+ return fn;
1540
+ }
1541
+ scope.usedPaths.add(path);
1542
+ let entry = scope.functionEntries.get(path);
1543
+ if (!entry) {
1544
+ entry = createStableFunctionEntry(fn);
1545
+ scope.functionEntries.set(path, entry);
1546
+ } else {
1547
+ entry.current = fn;
1548
+ }
1549
+ return entry.stable;
1550
+ }
1551
+ function stabilizeElement(element, path, previousValue, state) {
1552
+ const nextProps = stabilizeNested(element.props, `${path}.props`, isValidElement(previousValue) ? previousValue.props : void 0, state);
1553
+ if (isValidElement(previousValue) && previousValue.type === element.type && previousValue.key === element.key && previousValue.props === nextProps) {
1554
+ return previousValue;
1555
+ }
1556
+ return cloneElement(element, nextProps);
1557
+ }
1558
+ function stabilizeArray(array, path, previousValue, state) {
1559
+ const nextValue = array.every(isReactNodeLike) ? Children.toArray(array) : array;
1560
+ const previousArray = Array.isArray(previousValue) ? previousValue : null;
1561
+ let hasChanged = !previousArray || previousArray.length !== nextValue.length;
1562
+ const stabilizedValue = nextValue.map((item, index) => {
1563
+ const nextItem = stabilizeNested(item, `${path}[${index}]`, previousArray?.[index], state);
1564
+ if (!previousArray || nextItem !== previousArray[index]) {
1565
+ hasChanged = true;
1566
+ }
1567
+ return nextItem;
1568
+ });
1569
+ return !hasChanged ? previousArray : stabilizedValue;
1570
+ }
1571
+ function stabilizeObject(source, path, previousValue, state) {
1572
+ const previousRecord = previousValue;
1573
+ const stabilizedValue = {};
1574
+ const canReusePrevious = hasSameObjectKeys(previousValue, source);
1575
+ let hasChanged = !canReusePrevious;
1576
+ Object.keys(source).forEach((key) => {
1577
+ const nextValue = stabilizeNested(source[key], `${path}.${key}`, previousRecord?.[key], state);
1578
+ stabilizedValue[key] = nextValue;
1579
+ if (!canReusePrevious || nextValue !== previousRecord?.[key]) {
1580
+ hasChanged = true;
1581
+ }
1582
+ });
1583
+ return !hasChanged ? previousValue : stabilizedValue;
1584
+ }
1585
+ function stabilizeNested(value, path, previousValue, state) {
1586
+ return stabilize(value, path, previousValue, {
1587
+ ...state,
1588
+ depth: state.depth + 1
1589
+ });
1590
+ }
1591
+ function stabilize(value, path, previousValue, state) {
1592
+ if (state.depth > MAX_STABILIZATION_DEPTH) return value;
1593
+ if (typeof value === "function") {
1594
+ return stabilizeFunction(value, path, state.scope);
1595
+ }
1596
+ if (value && typeof value === "object") {
1597
+ if (state.seen.has(value)) return value;
1598
+ state.seen.add(value);
1599
+ }
1600
+ if (isValidElement(value)) {
1601
+ return stabilizeElement(value, path, previousValue, state);
1602
+ }
1603
+ if (Array.isArray(value)) {
1604
+ return stabilizeArray(value, path, previousValue, state);
1605
+ }
1606
+ if (typeof value !== "object" || value === null) return value;
1607
+ return stabilizeObject(value, path, previousValue, state);
1608
+ }
1609
+ function stabilizeRegistryValue(value, path, scope, previousValue, seen = /* @__PURE__ */ new WeakSet(), depth = 0) {
1610
+ return stabilize(value, path, previousValue, {
1611
+ depth,
1612
+ scope,
1613
+ seen
1614
+ });
1615
+ }
1616
+
1617
+ // src/core/kernel/hooks.ts
1618
+ function withInstanceId(instanceId, sourceOrOptions, optionsArg) {
1619
+ if (typeof sourceOrOptions === "string") {
1620
+ return {
1621
+ optionsArg: {
1622
+ ...isObject(optionsArg) ? optionsArg : {},
1623
+ instanceId
1624
+ },
1625
+ sourceOrOptions
1626
+ };
1627
+ }
1628
+ if (isObject(sourceOrOptions)) {
1629
+ return {
1630
+ optionsArg,
1631
+ sourceOrOptions: {
1632
+ ...sourceOrOptions,
1633
+ instanceId
1634
+ }
1635
+ };
1636
+ }
1637
+ return {
1638
+ optionsArg: void 0,
1639
+ sourceOrOptions: {
1640
+ ...isObject(optionsArg) ? optionsArg : {},
1641
+ instanceId
1642
+ }
1643
+ };
1644
+ }
1645
+ function withInstanceIdForUnregister(instanceId, sourceOrOptions) {
1646
+ if (typeof sourceOrOptions === "string") {
1647
+ return {
1648
+ instanceId,
1649
+ source: sourceOrOptions
1650
+ };
1651
+ }
1652
+ if (isObject(sourceOrOptions)) {
1653
+ return {
1654
+ ...sourceOrOptions,
1655
+ instanceId
1656
+ };
1657
+ }
1658
+ return {
1659
+ instanceId
1660
+ };
1661
+ }
1662
+ function resolveRegisterArgsWithInstance(instanceId, sourceOrOptions, optionsArg) {
1663
+ const input = withInstanceId(instanceId, sourceOrOptions, optionsArg);
1664
+ return [input.sourceOrOptions, input.optionsArg];
1665
+ }
1666
+ function useShallowStable(value) {
1667
+ const ref = useRef(value);
1668
+ if (ref.current !== value && !shallowEqual(ref.current, value)) {
1669
+ ref.current = value;
1670
+ }
1671
+ return ref.current;
1672
+ }
1673
+ var NO_METADATA = Object.freeze({});
1674
+ function sameContextInputs(a, b) {
1675
+ return a.actions.batch === b.actions.batch && a.actions.register === b.actions.register && a.actions.unregister === b.actions.unregister && a.cleanupScope === b.cleanupScope && a.instanceId === b.instanceId && a.modules === b.modules && a.pathname === b.pathname;
1676
+ }
1677
+ function samePayloadInputs(a, b) {
1678
+ return a.config === b.config && a.modules === b.modules && shallowEqual(a.metadata ?? NO_METADATA, b.metadata ?? NO_METADATA);
1679
+ }
1680
+ function componentSliceIds(modules) {
1681
+ return new Set(modules.filter((coreModule) => coreModule.registry?.valueKind === "component").map((coreModule) => coreModule.id));
1682
+ }
1683
+ function useAppliedRegistryConfig(inputs) {
1684
+ const $ = c(5);
1685
+ let t0;
1686
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1687
+ t0 = /* @__PURE__ */ new Map();
1688
+ $[0] = t0;
1689
+ } else {
1690
+ t0 = $[0];
1691
+ }
1692
+ const functionEntriesRef = useRef(t0);
1693
+ const appliedRef = useRef(null);
1694
+ let t1;
1695
+ if ($[1] !== inputs) {
1696
+ t1 = () => {
1697
+ const previous = appliedRef.current;
1698
+ const sameContext = previous !== null && sameContextInputs(previous.inputs, inputs);
1699
+ if (previous && sameContext && samePayloadInputs(previous.inputs, inputs)) {
1700
+ return;
1701
+ }
1702
+ const context = previous && sameContext ? previous.context : createRegistryApplyContext(inputs.actions, inputs);
1703
+ const payload = inputs.config ? createModulePayload(inputs.modules, inputs.config, inputs.metadata) : null;
1704
+ const componentSlices = componentSliceIds(inputs.modules);
1705
+ const functionEntries = functionEntriesRef.current;
1706
+ const usedPaths = /* @__PURE__ */ new Set();
1707
+ const config = stabilizeRegistryValue(payload, "config", {
1708
+ componentSlices,
1709
+ functionEntries,
1710
+ usedPaths
1711
+ }, previous?.config);
1712
+ functionEntries.forEach((_entry, path) => {
1713
+ if (!usedPaths.has(path)) {
1714
+ functionEntries.delete(path);
1715
+ }
1716
+ });
1717
+ if (previous && previous.config === config && sameContext) {
1718
+ previous.inputs = inputs;
1719
+ return;
1720
+ }
1721
+ previous?.cleanup();
1722
+ appliedRef.current = {
1723
+ cleanup: applyRegistryConfig(config, context),
1724
+ config,
1725
+ context,
1726
+ inputs
1727
+ };
1728
+ };
1729
+ $[1] = inputs;
1730
+ $[2] = t1;
1731
+ } else {
1732
+ t1 = $[2];
1733
+ }
1734
+ useLayoutEffect(t1);
1735
+ let t2;
1736
+ let t3;
1737
+ if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1738
+ t2 = () => () => {
1739
+ appliedRef.current?.cleanup();
1740
+ appliedRef.current = null;
1741
+ };
1742
+ t3 = [];
1743
+ $[3] = t2;
1744
+ $[4] = t3;
1745
+ } else {
1746
+ t2 = $[3];
1747
+ t3 = $[4];
1748
+ }
1749
+ useLayoutEffect(t2, t3);
1750
+ }
1751
+ function stampQueue(queue, instanceId) {
1752
+ return {
1753
+ register: (type, key, item, sourceOrOptions, optionsArg) => queue.register(type, key, item, ...resolveRegisterArgsWithInstance(instanceId, sourceOrOptions, optionsArg)),
1754
+ unregister: (type, key, sourceOrOptions) => queue.unregister(type, key, withInstanceIdForUnregister(instanceId, sourceOrOptions))
1755
+ };
1756
+ }
1757
+ function createRegistryApplyContext(actions, {
1758
+ cleanupScope = /* @__PURE__ */ new Map(),
1759
+ instanceId,
1760
+ modules = [],
1761
+ pathname
1762
+ }) {
1763
+ return {
1764
+ ...stampQueue(actions, instanceId),
1765
+ batch: (executor) => typeof executor === "function" ? actions.batch((queue) => executor(stampQueue(queue, instanceId))) : 0,
1766
+ cleanupScope,
1767
+ instanceId,
1768
+ modules,
1769
+ pathname
1770
+ };
1771
+ }
1772
+ function useRegistry(config, metadata) {
1773
+ const $ = c(12);
1774
+ const {
1775
+ batch,
1776
+ register,
1777
+ unregister
1778
+ } = useRegistryActions();
1779
+ const pathname = usePathname();
1780
+ const modules = useInstalledModules();
1781
+ const instanceId = `registry-instance-${useId()}`;
1782
+ const [cleanupScope] = useState(_temp);
1783
+ let t0;
1784
+ if ($[0] !== batch || $[1] !== register || $[2] !== unregister) {
1785
+ t0 = {
1786
+ batch,
1787
+ register,
1788
+ unregister
1789
+ };
1790
+ $[0] = batch;
1791
+ $[1] = register;
1792
+ $[2] = unregister;
1793
+ $[3] = t0;
1794
+ } else {
1795
+ t0 = $[3];
1796
+ }
1797
+ let t1;
1798
+ if ($[4] !== cleanupScope || $[5] !== config || $[6] !== instanceId || $[7] !== metadata || $[8] !== modules || $[9] !== pathname || $[10] !== t0) {
1799
+ t1 = {
1800
+ actions: t0,
1801
+ cleanupScope,
1802
+ config,
1803
+ instanceId,
1804
+ metadata,
1805
+ modules,
1806
+ pathname
1807
+ };
1808
+ $[4] = cleanupScope;
1809
+ $[5] = config;
1810
+ $[6] = instanceId;
1811
+ $[7] = metadata;
1812
+ $[8] = modules;
1813
+ $[9] = pathname;
1814
+ $[10] = t0;
1815
+ $[11] = t1;
1816
+ } else {
1817
+ t1 = $[11];
1818
+ }
1819
+ useAppliedRegistryConfig(t1);
1820
+ }
1821
+ function _temp() {
1822
+ return /* @__PURE__ */ new Map();
1823
+ }
1824
+ var EMPTY_OBJECT = Object.freeze({});
1825
+ function createPageControllerStore() {
1826
+ const listeners = /* @__PURE__ */ new Set();
1827
+ let stack = [];
1828
+ const notify = () => {
1829
+ listeners.forEach((listener) => {
1830
+ try {
1831
+ listener();
1832
+ } catch (error) {
1833
+ report("Page controller listener", error);
1834
+ }
1835
+ });
1836
+ };
1837
+ return {
1838
+ getSnapshot() {
1839
+ const top = stack[stack.length - 1];
1840
+ return top?.controllerRef?.current || null;
1841
+ },
1842
+ notify,
1843
+ register(id, controllerRef) {
1844
+ stack = stack.filter((item) => item.id !== id);
1845
+ stack.push({
1846
+ controllerRef,
1847
+ id
1848
+ });
1849
+ notify();
1850
+ },
1851
+ subscribe(listener) {
1852
+ listeners.add(listener);
1853
+ return () => {
1854
+ listeners.delete(listener);
1855
+ };
1856
+ },
1857
+ unregister(id) {
1858
+ stack = stack.filter((item) => item.id !== id);
1859
+ notify();
1860
+ }
1861
+ };
1862
+ }
1863
+ function createControllerScope() {
1864
+ const listeners = /* @__PURE__ */ new Set();
1865
+ let current = null;
1866
+ const subscribe = (listener) => {
1867
+ listeners.add(listener);
1868
+ return () => {
1869
+ listeners.delete(listener);
1870
+ };
1871
+ };
1872
+ const getSnapshot = () => current;
1873
+ function PageProvider(t0) {
1874
+ const $ = c(3);
1875
+ const {
1876
+ children
1877
+ } = t0;
1878
+ const controller = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
1879
+ let t1;
1880
+ if ($[0] !== children || $[1] !== controller) {
1881
+ t1 = /* @__PURE__ */ jsx(PageControllerContext, { value: controller, children });
1882
+ $[0] = children;
1883
+ $[1] = controller;
1884
+ $[2] = t1;
1885
+ } else {
1886
+ t1 = $[2];
1887
+ }
1888
+ return t1;
1889
+ }
1890
+ return {
1891
+ Provider: PageProvider,
1892
+ publish(controller) {
1893
+ if (current === controller) return;
1894
+ current = controller;
1895
+ listeners.forEach((listener) => listener());
1896
+ }
1897
+ };
1898
+ }
1899
+ var fallbackStandaloneStore = createPageControllerStore();
1900
+ var noopHook = () => {
1901
+ };
1902
+ var PassthroughProvider = ({
1903
+ children
1904
+ }) => children;
1905
+ var PageControllerContext = getOrCreateGlobalContext("PageControllerContext", null);
1906
+ var PageControllerStoreContext = getOrCreateGlobalContext("PageControllerStoreContext", fallbackStandaloneStore);
1907
+ function PageControllerProvider(t0) {
1908
+ const $ = c(3);
1909
+ const {
1910
+ children
1911
+ } = t0;
1912
+ const [store] = useState(_temp2);
1913
+ let t1;
1914
+ if ($[0] !== children || $[1] !== store) {
1915
+ t1 = /* @__PURE__ */ jsx(PageControllerStoreContext, { value: store, children });
1916
+ $[0] = children;
1917
+ $[1] = store;
1918
+ $[2] = t1;
1919
+ } else {
1920
+ t1 = $[2];
1921
+ }
1922
+ return t1;
1923
+ }
1924
+ function _temp2() {
1925
+ return createPageControllerStore();
1926
+ }
1927
+ var emptySubscribe = () => () => {
1928
+ };
1929
+ var getNullSnapshot = () => null;
1930
+ var FALLBACK_PAGE_CONTROLLER = Object.freeze({
1931
+ Provider: PassthroughProvider,
1932
+ config: EMPTY_OBJECT,
1933
+ modules: Object.freeze({}),
1934
+ reset: noopHook,
1935
+ set: noopHook
1936
+ });
1937
+ function usePageController() {
1938
+ const scopedContext = use(PageControllerContext);
1939
+ const controllerStore = use(PageControllerStoreContext);
1940
+ const storeSubscribe = scopedContext ? emptySubscribe : controllerStore.subscribe;
1941
+ const storeSnapshot = scopedContext ? getNullSnapshot : controllerStore.getSnapshot;
1942
+ const storeController = useSyncExternalStore(storeSubscribe, storeSnapshot, getNullSnapshot);
1943
+ return scopedContext ?? storeController ?? FALLBACK_PAGE_CONTROLLER;
1944
+ }
1945
+ function createOverrideApi(setOverrides) {
1946
+ const set = (partial) => {
1947
+ if (!partial || typeof partial !== "object") return;
1948
+ setOverrides((prev) => mergeModuleConfigs(prev, partial));
1949
+ };
1950
+ const reset = () => setOverrides(EMPTY_OBJECT);
1951
+ return {
1952
+ page: {
1953
+ set
1954
+ },
1955
+ reset,
1956
+ set
1957
+ };
1958
+ }
1959
+ function usePageOverrides(pageConfig) {
1960
+ const $ = c(7);
1961
+ const [overrides, setOverrides] = useState(EMPTY_OBJECT);
1962
+ let t0;
1963
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1964
+ t0 = () => createOverrideApi(setOverrides);
1965
+ $[0] = t0;
1966
+ } else {
1967
+ t0 = $[0];
1968
+ }
1969
+ const [api] = useState(t0);
1970
+ let t1;
1971
+ bb0: {
1972
+ const base = pageConfig || EMPTY_OBJECT;
1973
+ if (Object.keys(overrides).length === 0) {
1974
+ t1 = base;
1975
+ break bb0;
1976
+ }
1977
+ let t22;
1978
+ if ($[1] !== base || $[2] !== overrides) {
1979
+ t22 = mergeModuleConfigs(base, overrides);
1980
+ $[1] = base;
1981
+ $[2] = overrides;
1982
+ $[3] = t22;
1983
+ } else {
1984
+ t22 = $[3];
1985
+ }
1986
+ t1 = t22;
1987
+ }
1988
+ const effectiveConfig = t1;
1989
+ let t2;
1990
+ if ($[4] !== api || $[5] !== effectiveConfig) {
1991
+ t2 = {
1992
+ api,
1993
+ effectiveConfig
1994
+ };
1995
+ $[4] = api;
1996
+ $[5] = effectiveConfig;
1997
+ $[6] = t2;
1998
+ } else {
1999
+ t2 = $[6];
2000
+ }
2001
+ return t2;
2002
+ }
2003
+ function useModuleControllers(modules, effectiveConfig, pageApi) {
2004
+ const $ = c(9);
2005
+ let t0;
2006
+ if ($[0] !== effectiveConfig || $[1] !== modules) {
2007
+ let t1;
2008
+ if ($[3] !== effectiveConfig) {
2009
+ t1 = (coreModule) => selectModuleSlice(coreModule, effectiveConfig);
2010
+ $[3] = effectiveConfig;
2011
+ $[4] = t1;
2012
+ } else {
2013
+ t1 = $[4];
2014
+ }
2015
+ t0 = modules.map(t1);
2016
+ $[0] = effectiveConfig;
2017
+ $[1] = modules;
2018
+ $[2] = t0;
2019
+ } else {
2020
+ t0 = $[2];
2021
+ }
2022
+ const moduleSlices = t0;
2023
+ let moduleControllers;
2024
+ if ($[5] !== moduleSlices || $[6] !== modules || $[7] !== pageApi) {
2025
+ moduleControllers = {};
2026
+ for (let index = 0; index < modules.length; index = index + 1, index) {
2027
+ const coreModule_0 = modules[index];
2028
+ if (coreModule_0.page?.use) {
2029
+ moduleControllers[coreModule_0.id] = coreModule_0.page.use(moduleSlices[index], pageApi);
2030
+ }
2031
+ }
2032
+ $[5] = moduleSlices;
2033
+ $[6] = modules;
2034
+ $[7] = pageApi;
2035
+ $[8] = moduleControllers;
2036
+ } else {
2037
+ moduleControllers = $[8];
2038
+ }
2039
+ return useShallowStable(moduleControllers);
2040
+ }
2041
+ function usePage(t0, options) {
2042
+ const $ = c(17);
2043
+ const pageConfig = t0 === void 0 ? EMPTY_OBJECT : t0;
2044
+ const instanceId = useId();
2045
+ const controllerStore = use(PageControllerStoreContext);
2046
+ const modules = useInstalledModules();
2047
+ const {
2048
+ api,
2049
+ effectiveConfig
2050
+ } = usePageOverrides(pageConfig);
2051
+ const {
2052
+ reset,
2053
+ set
2054
+ } = api;
2055
+ let t1;
2056
+ if ($[0] !== options) {
2057
+ t1 = pickRegistryMetadata(options);
2058
+ $[0] = options;
2059
+ $[1] = t1;
2060
+ } else {
2061
+ t1 = $[1];
2062
+ }
2063
+ useRegistry(effectiveConfig, t1);
2064
+ const pageModules = useModuleControllers(modules, effectiveConfig, api.page);
2065
+ const [scope] = useState(createControllerScope);
2066
+ let t2;
2067
+ if ($[2] !== effectiveConfig || $[3] !== pageModules || $[4] !== reset || $[5] !== scope.Provider || $[6] !== set) {
2068
+ t2 = {
2069
+ Provider: scope.Provider,
2070
+ config: effectiveConfig,
2071
+ modules: pageModules,
2072
+ reset,
2073
+ set
2074
+ };
2075
+ $[2] = effectiveConfig;
2076
+ $[3] = pageModules;
2077
+ $[4] = reset;
2078
+ $[5] = scope.Provider;
2079
+ $[6] = set;
2080
+ $[7] = t2;
2081
+ } else {
2082
+ t2 = $[7];
2083
+ }
2084
+ const controller = t2;
2085
+ const controllerRef = useRef(controller);
2086
+ let t3;
2087
+ let t4;
2088
+ if ($[8] !== controller || $[9] !== controllerStore || $[10] !== scope) {
2089
+ t3 = () => {
2090
+ controllerRef.current = controller;
2091
+ scope.publish(controller);
2092
+ controllerStore.notify();
2093
+ };
2094
+ t4 = [controller, controllerStore, scope];
2095
+ $[8] = controller;
2096
+ $[9] = controllerStore;
2097
+ $[10] = scope;
2098
+ $[11] = t3;
2099
+ $[12] = t4;
2100
+ } else {
2101
+ t3 = $[11];
2102
+ t4 = $[12];
2103
+ }
2104
+ useLayoutEffect(t3, t4);
2105
+ let t5;
2106
+ let t6;
2107
+ if ($[13] !== controllerStore || $[14] !== instanceId) {
2108
+ t5 = () => {
2109
+ controllerStore.register(instanceId, controllerRef);
2110
+ return () => {
2111
+ controllerStore.unregister(instanceId);
2112
+ };
2113
+ };
2114
+ t6 = [controllerStore, instanceId];
2115
+ $[13] = controllerStore;
2116
+ $[14] = instanceId;
2117
+ $[15] = t5;
2118
+ $[16] = t6;
2119
+ } else {
2120
+ t5 = $[15];
2121
+ t6 = $[16];
2122
+ }
2123
+ useEffect(t5, t6);
2124
+ return controller;
2125
+ }
2126
+ function defineModule(coreModule) {
2127
+ return Object.freeze({
2128
+ ...coreModule
2129
+ });
2130
+ }
2131
+ function warnMissingPeers(modules) {
2132
+ const installed = new Set(modules.map((coreModule) => coreModule.id));
2133
+ for (const {
2134
+ id,
2135
+ uses
2136
+ } of modules) {
2137
+ const missing = (uses ?? []).filter((peer) => !installed.has(peer));
2138
+ if (missing.length > 0) {
2139
+ report(`Module "${id}" runs without its optional peers`, missing.join(", "), "warn");
2140
+ }
2141
+ }
2142
+ }
2143
+ function createModuleHost(modules, Boundary) {
2144
+ const sorted = sortModules(modules);
2145
+ if (process.env.NODE_ENV !== "production") warnMissingPeers(sorted);
2146
+ return {
2147
+ Boundary,
2148
+ byId: new Map(sorted.map((coreModule) => [coreModule.id, coreModule])),
2149
+ definitions: createModuleRegistryDefinitions(sorted),
2150
+ modules: Object.freeze(sorted)
2151
+ };
2152
+ }
2153
+ function renderModuleSlots(modules, slot, Boundary) {
2154
+ return modules.map((coreModule) => {
2155
+ const Slot = coreModule[slot];
2156
+ if (!Slot) return null;
2157
+ return /* @__PURE__ */ jsx(Boundary, { name: coreModule.id, children: /* @__PURE__ */ jsx(Slot, {}) }, coreModule.id);
2158
+ });
2159
+ }
2160
+ function ModuleHost(t0) {
2161
+ const $ = c(25);
2162
+ const {
2163
+ boundary: t1,
2164
+ children,
2165
+ modules: t2,
2166
+ registryEntries
2167
+ } = t0;
2168
+ const boundary = t1 === void 0 ? PassthroughBoundary : t1;
2169
+ const modules = t2 === void 0 ? EMPTY_MODULES : t2;
2170
+ let t3;
2171
+ if ($[0] !== boundary || $[1] !== modules) {
2172
+ t3 = () => createModuleHost(modules, boundary);
2173
+ $[0] = boundary;
2174
+ $[1] = modules;
2175
+ $[2] = t3;
2176
+ } else {
2177
+ t3 = $[2];
2178
+ }
2179
+ const [host] = useState(t3);
2180
+ const {
2181
+ Boundary
2182
+ } = host;
2183
+ let t4;
2184
+ if ($[3] !== Boundary || $[4] !== host.modules) {
2185
+ t4 = renderModuleSlots(host.modules, "Backdrop", Boundary);
2186
+ $[3] = Boundary;
2187
+ $[4] = host.modules;
2188
+ $[5] = t4;
2189
+ } else {
2190
+ t4 = $[5];
2191
+ }
2192
+ const backdrops = t4;
2193
+ let t5;
2194
+ if ($[6] !== Boundary || $[7] !== host.modules) {
2195
+ t5 = renderModuleSlots(host.modules, "Overlay", Boundary);
2196
+ $[6] = Boundary;
2197
+ $[7] = host.modules;
2198
+ $[8] = t5;
2199
+ } else {
2200
+ t5 = $[8];
2201
+ }
2202
+ const overlays = t5;
2203
+ let t6;
2204
+ if ($[9] !== backdrops || $[10] !== children || $[11] !== overlays) {
2205
+ t6 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
2206
+ backdrops,
2207
+ children,
2208
+ overlays
2209
+ ] });
2210
+ $[9] = backdrops;
2211
+ $[10] = children;
2212
+ $[11] = overlays;
2213
+ $[12] = t6;
2214
+ } else {
2215
+ t6 = $[12];
2216
+ }
2217
+ const content = t6;
2218
+ let t7;
2219
+ if ($[13] !== content || $[14] !== host.modules) {
2220
+ t7 = host.modules.reduceRight(_temp3, content);
2221
+ $[13] = content;
2222
+ $[14] = host.modules;
2223
+ $[15] = t7;
2224
+ } else {
2225
+ t7 = $[15];
2226
+ }
2227
+ const tree = t7;
2228
+ let t8;
2229
+ if ($[16] !== tree) {
2230
+ t8 = /* @__PURE__ */ jsx(PageControllerProvider, { children: tree });
2231
+ $[16] = tree;
2232
+ $[17] = t8;
2233
+ } else {
2234
+ t8 = $[17];
2235
+ }
2236
+ let t9;
2237
+ if ($[18] !== host || $[19] !== t8) {
2238
+ t9 = /* @__PURE__ */ jsx(ModuleHostContext, { value: host, children: t8 });
2239
+ $[18] = host;
2240
+ $[19] = t8;
2241
+ $[20] = t9;
2242
+ } else {
2243
+ t9 = $[20];
2244
+ }
2245
+ let t10;
2246
+ if ($[21] !== host.definitions || $[22] !== registryEntries || $[23] !== t9) {
2247
+ t10 = /* @__PURE__ */ jsx(RegistryProvider, { definitions: host.definitions, initialEntries: registryEntries, children: t9 });
2248
+ $[21] = host.definitions;
2249
+ $[22] = registryEntries;
2250
+ $[23] = t9;
2251
+ $[24] = t10;
2252
+ } else {
2253
+ t10 = $[24];
2254
+ }
2255
+ return t10;
2256
+ }
2257
+ function _temp3(inner, t0) {
2258
+ const {
2259
+ Provider
2260
+ } = t0;
2261
+ return Provider ? /* @__PURE__ */ jsx(Provider, { children: inner }) : inner;
2262
+ }
2263
+ function useModule(id) {
2264
+ const coreModule = use(ModuleHostContext)?.byId.get(id);
2265
+ return coreModule?.context ? use(coreModule.context) ?? null : null;
2266
+ }
2267
+ function definePeer(id, inert) {
2268
+ const useRuntime = () => {
2269
+ return useModule(id) ?? inert;
2270
+ };
2271
+ return {
2272
+ useRuntime,
2273
+ useActions: () => useRuntime().actions,
2274
+ useState: (selector, isEqual) => useStore(useRuntime().store, selector, isEqual)
2275
+ };
2276
+ }
2277
+ var NO_MODULE_STORE = createStore(void 0);
2278
+ function useModuleState(id, selector, fallback, t0) {
2279
+ const $ = c(4);
2280
+ const isEqual = t0 === void 0 ? Object.is : t0;
2281
+ const runtime = useModule(id);
2282
+ let t1;
2283
+ if ($[0] !== fallback || $[1] !== runtime || $[2] !== selector) {
2284
+ t1 = (state) => runtime ? selector(state) : fallback;
2285
+ $[0] = fallback;
2286
+ $[1] = runtime;
2287
+ $[2] = selector;
2288
+ $[3] = t1;
2289
+ } else {
2290
+ t1 = $[3];
2291
+ }
2292
+ return useStore(runtime?.store ?? NO_MODULE_STORE, t1, isEqual);
2293
+ }
2294
+ function ModuleBoundary({
2295
+ children,
2296
+ name
2297
+ }) {
2298
+ const Boundary = use(ModuleHostContext)?.Boundary ?? PassthroughBoundary;
2299
+ return createElement(Boundary, {
2300
+ name
2301
+ }, children);
2302
+ }
2303
+ function useIsModuleInstalled(id) {
2304
+ return use(ModuleHostContext)?.byId.has(id) ?? false;
2305
+ }
2306
+ function useModuleRegistration(id, value, options) {
2307
+ const $ = c(12);
2308
+ const t0 = useInstalledModules();
2309
+ let t1;
2310
+ if ($[0] !== id || $[1] !== t0) {
2311
+ let t22;
2312
+ if ($[3] !== id) {
2313
+ t22 = (candidate) => candidate.id === id;
2314
+ $[3] = id;
2315
+ $[4] = t22;
2316
+ } else {
2317
+ t22 = $[4];
2318
+ }
2319
+ t1 = t0.find(t22);
2320
+ $[0] = id;
2321
+ $[1] = t0;
2322
+ $[2] = t1;
2323
+ } else {
2324
+ t1 = $[2];
2325
+ }
2326
+ const coreModule = t1;
2327
+ let t2;
2328
+ if ($[5] !== coreModule || $[6] !== id || $[7] !== options?.enabled || $[8] !== value) {
2329
+ t2 = coreModule && options?.enabled !== false && value != null ? {
2330
+ [id]: value
2331
+ } : null;
2332
+ $[5] = coreModule;
2333
+ $[6] = id;
2334
+ $[7] = options?.enabled;
2335
+ $[8] = value;
2336
+ $[9] = t2;
2337
+ } else {
2338
+ t2 = $[9];
2339
+ }
2340
+ const config = t2;
2341
+ let t3;
2342
+ if ($[10] !== options) {
2343
+ t3 = pickRegistryMetadata(options);
2344
+ $[10] = options;
2345
+ $[11] = t3;
2346
+ } else {
2347
+ t3 = $[11];
2348
+ }
2349
+ useRegistry(config, t3);
2350
+ }
2351
+ function Compose({
2352
+ providers,
2353
+ children
2354
+ }) {
2355
+ return providers.reduceRight((acc, entry) => {
2356
+ if (Array.isArray(entry)) {
2357
+ const [Component2, props] = entry;
2358
+ return createElement(Component2, props, acc);
2359
+ }
2360
+ const Component = entry;
2361
+ return createElement(Component, null, acc);
2362
+ }, createElement(Fragment, null, children));
2363
+ }
2364
+
2365
+ export { Compose, ModuleBoundary, ModuleHost, PageControllerProvider, REGISTRY_SOURCES, RegistryProvider, applyRegistryConfig, createModuleRegistryDefinitions, createRegistryApplyContext, createRegistryOperations, createRegistryStore, defineModule, definePeer, hasOwnProperty, sortModules, useIsModuleInstalled, useModule, useModuleRegistration, useModuleState, usePage, usePageController, useRegistryEntries, useRegistryValue };
2366
+ //# sourceMappingURL=chunk-NHOJWICA.js.map
2367
+ //# sourceMappingURL=chunk-NHOJWICA.js.map