unspaghettit 0.2.0 → 0.3.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 (270) hide show
  1. package/build/client/_app/immutable/assets/0.DSctqr5I.css +1 -0
  2. package/build/client/_app/immutable/assets/0.DSctqr5I.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.DSctqr5I.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/BehaviorGraph.Bk0xQRZk.css +1 -0
  5. package/build/client/_app/immutable/assets/BehaviorGraph.Bk0xQRZk.css.br +0 -0
  6. package/build/client/_app/immutable/assets/BehaviorGraph.Bk0xQRZk.css.gz +0 -0
  7. package/build/client/_app/immutable/chunks/9nXQ5qrY2.js +1 -0
  8. package/build/client/_app/immutable/chunks/9nXQ5qrY2.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/9nXQ5qrY2.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/B439_FLv.js +1 -0
  11. package/build/client/_app/immutable/chunks/B439_FLv.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/B439_FLv.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/BCEY79Dw.js +1 -0
  14. package/build/client/_app/immutable/chunks/BCEY79Dw.js.br +2 -0
  15. package/build/client/_app/immutable/chunks/BCEY79Dw.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/{DBJWcC6Y.js → BYIrIC5L.js} +1 -1
  17. package/build/client/_app/immutable/chunks/BYIrIC5L.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/BYIrIC5L.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/B_9TWPrx2.js +1 -0
  20. package/build/client/_app/immutable/chunks/B_9TWPrx2.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/B_9TWPrx2.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/BvOhVtZg.js +1 -0
  23. package/build/client/_app/immutable/chunks/BvOhVtZg.js.br +1 -0
  24. package/build/client/_app/immutable/chunks/BvOhVtZg.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/CY3em1ma2.js +1 -0
  26. package/build/client/_app/immutable/chunks/CY3em1ma2.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/CY3em1ma2.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/CgdRZPgI.js +1 -0
  29. package/build/client/_app/immutable/chunks/CgdRZPgI.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CgdRZPgI.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/D5speDV82.js +908 -0
  32. package/build/client/_app/immutable/chunks/D5speDV82.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/D5speDV82.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/DkxwAIfJ2.js +1 -0
  35. package/build/client/_app/immutable/chunks/DkxwAIfJ2.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/DkxwAIfJ2.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/{DatGSObE.js → OJscNS3T.js} +1 -1
  38. package/build/client/_app/immutable/chunks/OJscNS3T.js.br +0 -0
  39. package/build/client/_app/immutable/chunks/OJscNS3T.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/U9p9CtKG2.js +2 -0
  41. package/build/client/_app/immutable/chunks/U9p9CtKG2.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/U9p9CtKG2.js.gz +0 -0
  43. package/build/client/_app/immutable/entry/app.Cd4S3giu.js +2 -0
  44. package/build/client/_app/immutable/entry/app.Cd4S3giu.js.br +0 -0
  45. package/build/client/_app/immutable/entry/app.Cd4S3giu.js.gz +0 -0
  46. package/build/client/_app/immutable/entry/start.C3xXQVkq.js +1 -0
  47. package/build/client/_app/immutable/entry/start.C3xXQVkq.js.br +0 -0
  48. package/build/client/_app/immutable/entry/start.C3xXQVkq.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/0.dIOlQ-0y.js +4 -0
  50. package/build/client/_app/immutable/nodes/0.dIOlQ-0y.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/0.dIOlQ-0y.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/{1.KYdA6ppX.js → 1.Dyte3Ggf.js} +1 -1
  53. package/build/client/_app/immutable/nodes/1.Dyte3Ggf.js.br +2 -0
  54. package/build/client/_app/immutable/nodes/1.Dyte3Ggf.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/10.ivxAosDg.js +2 -0
  56. package/build/client/_app/immutable/nodes/10.ivxAosDg.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/10.ivxAosDg.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/{9.CMW6a2Lg.js → 11.wvMfJKC2.js} +1 -1
  59. package/build/client/_app/immutable/nodes/11.wvMfJKC2.js.br +0 -0
  60. package/build/client/_app/immutable/nodes/11.wvMfJKC2.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{2.DBz20KgG.js → 2.CmPPom9Z.js} +1 -1
  62. package/build/client/_app/immutable/nodes/2.CmPPom9Z.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/2.CmPPom9Z.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/3.D-iCGCEx.js +1 -0
  65. package/build/client/_app/immutable/nodes/3.D-iCGCEx.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/3.D-iCGCEx.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{4.BvMzqBJj.js → 4.DbfAvO8Z.js} +1 -1
  68. package/build/client/_app/immutable/nodes/4.DbfAvO8Z.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/4.DbfAvO8Z.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/5.CC5Q7lVw.js +42 -0
  71. package/build/client/_app/immutable/nodes/5.CC5Q7lVw.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/5.CC5Q7lVw.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/6.CHIjlzpO.js +1 -0
  74. package/build/client/_app/immutable/nodes/6.CHIjlzpO.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/6.CHIjlzpO.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{6.BOHISqs-.js → 7.Ejs18ZUc.js} +1 -1
  77. package/build/client/_app/immutable/nodes/7.Ejs18ZUc.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/7.Ejs18ZUc.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{7.CemgNJfw.js → 8.B-HweAc8.js} +1 -1
  80. package/build/client/_app/immutable/nodes/8.B-HweAc8.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/8.B-HweAc8.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/9.CKPeM6tx.js +5 -0
  83. package/build/client/_app/immutable/nodes/9.CKPeM6tx.js.br +0 -0
  84. package/build/client/_app/immutable/nodes/9.CKPeM6tx.js.gz +0 -0
  85. package/build/client/_app/version.json +1 -1
  86. package/build/client/_app/version.json.br +0 -0
  87. package/build/client/_app/version.json.gz +0 -0
  88. package/build/client/lyriks_logo.svg +148 -0
  89. package/build/client/lyriks_logo.svg.br +0 -0
  90. package/build/client/lyriks_logo.svg.gz +0 -0
  91. package/build/server/chunks/{0-C_o0oz-N.js → 0-Co8kcANG.js} +4 -4
  92. package/build/server/chunks/{0-C_o0oz-N.js.map → 0-Co8kcANG.js.map} +1 -1
  93. package/build/server/chunks/1-BSUItTig.js +9 -0
  94. package/build/server/chunks/{1-DPpKAKXV.js.map → 1-BSUItTig.js.map} +1 -1
  95. package/build/server/chunks/10-BygvxrZp.js +9 -0
  96. package/build/server/chunks/10-BygvxrZp.js.map +1 -0
  97. package/build/server/chunks/11-DRx0tRx2.js +9 -0
  98. package/build/server/chunks/11-DRx0tRx2.js.map +1 -0
  99. package/build/server/chunks/{2-AlfFqtL1.js → 2-BQT3m1vc.js} +3 -3
  100. package/build/server/chunks/{2-AlfFqtL1.js.map → 2-BQT3m1vc.js.map} +1 -1
  101. package/build/server/chunks/{3-vbjUt_51.js → 3-DPZ9BquJ.js} +3 -3
  102. package/build/server/chunks/{3-vbjUt_51.js.map → 3-DPZ9BquJ.js.map} +1 -1
  103. package/build/server/chunks/{4-BNow4x6D.js → 4-DHo47YX6.js} +3 -3
  104. package/build/server/chunks/{4-BNow4x6D.js.map → 4-DHo47YX6.js.map} +1 -1
  105. package/build/server/chunks/5-Cp9evBAG.js +9 -0
  106. package/build/server/chunks/5-Cp9evBAG.js.map +1 -0
  107. package/build/server/chunks/6-DiBq3bOV.js +9 -0
  108. package/build/server/chunks/6-DiBq3bOV.js.map +1 -0
  109. package/build/server/chunks/{6-QQ7r8Rd5.js → 7-C4hmS0dG.js} +3 -3
  110. package/build/server/chunks/{6-QQ7r8Rd5.js.map → 7-C4hmS0dG.js.map} +1 -1
  111. package/build/server/chunks/{7-CbPLGaIG.js → 8-CFFuDzBC.js} +4 -4
  112. package/build/server/chunks/{7-CbPLGaIG.js.map → 8-CFFuDzBC.js.map} +1 -1
  113. package/build/server/chunks/9-nhhKZJrs.js +9 -0
  114. package/build/server/chunks/9-nhhKZJrs.js.map +1 -0
  115. package/build/server/chunks/BehaviorGraph-m5kYj5HH.js +757 -0
  116. package/build/server/chunks/BehaviorGraph-m5kYj5HH.js.map +1 -0
  117. package/build/server/chunks/{FeatureCard-BQOY6gJQ.js → FeatureCard-CfbXNYe8.js} +2 -2
  118. package/build/server/chunks/{FeatureCard-BQOY6gJQ.js.map → FeatureCard-CfbXNYe8.js.map} +1 -1
  119. package/build/server/chunks/{ProgressBar-CfhccQ83.js → ProgressBar-DDoQJ_C9.js} +2 -2
  120. package/build/server/chunks/ProgressBar-DDoQJ_C9.js.map +1 -0
  121. package/build/server/chunks/{ProjectsIndex-CoDrvRya.js → ProjectsIndex-DUVJ3hyL.js} +2 -2
  122. package/build/server/chunks/{ProjectsIndex-CoDrvRya.js.map → ProjectsIndex-DUVJ3hyL.js.map} +1 -1
  123. package/build/server/chunks/TransitionCatalog-B8zHs-2E.js +271 -0
  124. package/build/server/chunks/TransitionCatalog-B8zHs-2E.js.map +1 -0
  125. package/build/server/chunks/{_layout.svelte-BREws55o.js → _layout.svelte-CLTmk0xU.js} +66 -15
  126. package/build/server/chunks/_layout.svelte-CLTmk0xU.js.map +1 -0
  127. package/build/server/chunks/{_page.svelte-De508ek8.js → _page.svelte-B1nG3PKn.js} +4 -4
  128. package/build/server/chunks/{_page.svelte-De508ek8.js.map → _page.svelte-B1nG3PKn.js.map} +1 -1
  129. package/build/server/chunks/{_page.svelte-Zf9H4KOP.js → _page.svelte-BW_nbAAH.js} +11 -315
  130. package/build/server/chunks/_page.svelte-BW_nbAAH.js.map +1 -0
  131. package/build/server/chunks/{_page.svelte-BqSC-1vK.js → _page.svelte-Caq7J0jU.js} +91 -47
  132. package/build/server/chunks/_page.svelte-Caq7J0jU.js.map +1 -0
  133. package/build/server/chunks/{_page.svelte-B7hT3P8E.js → _page.svelte-Cham-dsM.js} +4 -4
  134. package/build/server/chunks/{_page.svelte-B7hT3P8E.js.map → _page.svelte-Cham-dsM.js.map} +1 -1
  135. package/build/server/chunks/_page.svelte-Dhwjwph_.js +41 -0
  136. package/build/server/chunks/_page.svelte-Dhwjwph_.js.map +1 -0
  137. package/build/server/chunks/{_page.svelte-BKKCa9H5.js → _page.svelte-DlFVT40-.js} +3 -3
  138. package/build/server/chunks/{_page.svelte-BKKCa9H5.js.map → _page.svelte-DlFVT40-.js.map} +1 -1
  139. package/build/server/chunks/{_page.svelte-BtI2zZ_Z.js → _page.svelte-NVT2dzpG.js} +176 -327
  140. package/build/server/chunks/_page.svelte-NVT2dzpG.js.map +1 -0
  141. package/build/server/chunks/{_page.svelte-BKTveFAj.js → _page.svelte-Oj-W7G5s.js} +5 -5
  142. package/build/server/chunks/{_page.svelte-BKTveFAj.js.map → _page.svelte-Oj-W7G5s.js.map} +1 -1
  143. package/build/server/chunks/_page.svelte-Z_kK2lHY.js +68 -0
  144. package/build/server/chunks/_page.svelte-Z_kK2lHY.js.map +1 -0
  145. package/build/server/chunks/{builderModeStore.svelte-ihupr-3p.js → builderModeStore.svelte-BpRIU_zP.js} +217 -6
  146. package/build/server/chunks/builderModeStore.svelte-BpRIU_zP.js.map +1 -0
  147. package/build/server/chunks/client-DeX3TC3s.js +51 -0
  148. package/build/server/chunks/{client-DfpLcAZ9.js.map → client-DeX3TC3s.js.map} +1 -1
  149. package/build/server/chunks/{error.svelte-C35KOpru.js → error.svelte-Cdjeq3L2.js} +4 -4
  150. package/build/server/chunks/{error.svelte-C35KOpru.js.map → error.svelte-Cdjeq3L2.js.map} +1 -1
  151. package/build/server/chunks/featureStore.svelte-DIYgPBVm.js +161 -0
  152. package/build/server/chunks/featureStore.svelte-DIYgPBVm.js.map +1 -0
  153. package/build/server/chunks/{hooks.server-Rv301GTB.js → hooks.server-y3jdg_sB.js} +6 -2
  154. package/build/server/chunks/hooks.server-y3jdg_sB.js.map +1 -0
  155. package/build/server/chunks/{internal-BPKrFkK1.js → internal-KYK0WpL7.js} +4 -4
  156. package/build/server/chunks/{internal-BPKrFkK1.js.map → internal-KYK0WpL7.js.map} +1 -1
  157. package/build/server/chunks/projectFeaturesStore.svelte-2o-72_vr.js +313 -0
  158. package/build/server/chunks/projectFeaturesStore.svelte-2o-72_vr.js.map +1 -0
  159. package/build/server/chunks/{reconcile-Dv7jS3C8.js → reconcile-B5xqb6-s.js} +3 -272
  160. package/build/server/chunks/reconcile-B5xqb6-s.js.map +1 -0
  161. package/build/server/chunks/registry-DqAn_hVE.js +21 -0
  162. package/build/server/chunks/registry-DqAn_hVE.js.map +1 -0
  163. package/build/server/chunks/{state-CpLVNZq7.js → state-DBjl9lhV.js} +2 -2
  164. package/build/server/chunks/{state-CpLVNZq7.js.map → state-DBjl9lhV.js.map} +1 -1
  165. package/build/server/index.js +1 -1
  166. package/build/server/index.js.map +1 -1
  167. package/build/server/manifest.js +33 -17
  168. package/build/server/manifest.js.map +1 -1
  169. package/cli/commands/dashboard.ts +14 -0
  170. package/cli/commands/init.ts +26 -0
  171. package/cli/commands/theme.ts +62 -0
  172. package/cli/unspa.ts +38 -2
  173. package/cli/util/context-files.ts +5 -0
  174. package/cli/util/theme.ts +34 -0
  175. package/mcp-server/sync-notifier.ts +88 -35
  176. package/package.json +2 -1
  177. package/src/app.css +187 -0
  178. package/src/app.html +15 -1
  179. package/src/features/behavior-model/domain/services/BehaviorGraphModel.ts +531 -0
  180. package/src/features/behavior-model/presentation/adapters/VisBehaviorGraphRenderer.ts +492 -0
  181. package/src/features/behavior-model/presentation/components/BehaviorGraph.svelte +370 -0
  182. package/src/features/behavior-model/presentation/components/FeatureHeader.svelte +13 -5
  183. package/src/features/behavior-model/presentation/view-models/BehaviorGraphTheme.ts +43 -0
  184. package/src/features/builder-mode/domain/BuilderModeDashboard.ts +7 -1
  185. package/src/features/builder-mode/presentation/components/BuilderModeDashboard.svelte +78 -16
  186. package/src/features/builder-mode/presentation/components/BuilderTagChips.svelte +25 -0
  187. package/src/features/builder-mode/presentation/stores/builderModeStore.svelte.ts +247 -3
  188. package/src/features/projects/presentation/components/ProjectEditor.svelte +7 -0
  189. package/src/features/simulator/application/use-cases/RunScenarios.ts +15 -1
  190. package/src/hooks.server.ts +11 -1
  191. package/src/lib/theme/registry.ts +77 -0
  192. package/src/lib/theme/themeStore.svelte.ts +64 -0
  193. package/src/routes/+layout.svelte +184 -30
  194. package/src/routes/features/[id]/graph/+page.svelte +34 -0
  195. package/src/routes/projects/[id]/graph/+page.svelte +79 -0
  196. package/src/shared/presentation/components/ProgressBar.svelte +1 -1
  197. package/src/shared/presentation/toast/SyncToast.svelte +14 -3
  198. package/src/shared/presentation/toast/viewLinkResolver.ts +32 -0
  199. package/static/lyriks_logo.svg +148 -0
  200. package/build/client/_app/immutable/assets/0.DFMDYAU9.css +0 -1
  201. package/build/client/_app/immutable/assets/0.DFMDYAU9.css.br +0 -0
  202. package/build/client/_app/immutable/assets/0.DFMDYAU9.css.gz +0 -0
  203. package/build/client/_app/immutable/chunks/BO66rBOa2.js +0 -1
  204. package/build/client/_app/immutable/chunks/BO66rBOa2.js.br +0 -0
  205. package/build/client/_app/immutable/chunks/BO66rBOa2.js.gz +0 -0
  206. package/build/client/_app/immutable/chunks/DBJWcC6Y.js.br +0 -0
  207. package/build/client/_app/immutable/chunks/DBJWcC6Y.js.gz +0 -0
  208. package/build/client/_app/immutable/chunks/DHoA038D.js +0 -1
  209. package/build/client/_app/immutable/chunks/DHoA038D.js.br +0 -2
  210. package/build/client/_app/immutable/chunks/DHoA038D.js.gz +0 -0
  211. package/build/client/_app/immutable/chunks/DatGSObE.js.br +0 -0
  212. package/build/client/_app/immutable/chunks/DatGSObE.js.gz +0 -0
  213. package/build/client/_app/immutable/chunks/DjWKKtqp.js +0 -1
  214. package/build/client/_app/immutable/chunks/DjWKKtqp.js.br +0 -1
  215. package/build/client/_app/immutable/chunks/DjWKKtqp.js.gz +0 -0
  216. package/build/client/_app/immutable/chunks/Dq0DUAz1.js +0 -1
  217. package/build/client/_app/immutable/chunks/Dq0DUAz1.js.br +0 -0
  218. package/build/client/_app/immutable/chunks/Dq0DUAz1.js.gz +0 -0
  219. package/build/client/_app/immutable/chunks/iQu0D9Ux.js +0 -1
  220. package/build/client/_app/immutable/chunks/iQu0D9Ux.js.br +0 -0
  221. package/build/client/_app/immutable/chunks/iQu0D9Ux.js.gz +0 -0
  222. package/build/client/_app/immutable/entry/app.CLgh6Mx_.js +0 -2
  223. package/build/client/_app/immutable/entry/app.CLgh6Mx_.js.br +0 -0
  224. package/build/client/_app/immutable/entry/app.CLgh6Mx_.js.gz +0 -0
  225. package/build/client/_app/immutable/entry/start.D5GPCQZD.js +0 -1
  226. package/build/client/_app/immutable/entry/start.D5GPCQZD.js.br +0 -0
  227. package/build/client/_app/immutable/entry/start.D5GPCQZD.js.gz +0 -0
  228. package/build/client/_app/immutable/nodes/0.BOoI-hsu.js +0 -4
  229. package/build/client/_app/immutable/nodes/0.BOoI-hsu.js.br +0 -0
  230. package/build/client/_app/immutable/nodes/0.BOoI-hsu.js.gz +0 -0
  231. package/build/client/_app/immutable/nodes/1.KYdA6ppX.js.br +0 -2
  232. package/build/client/_app/immutable/nodes/1.KYdA6ppX.js.gz +0 -0
  233. package/build/client/_app/immutable/nodes/2.DBz20KgG.js.br +0 -0
  234. package/build/client/_app/immutable/nodes/2.DBz20KgG.js.gz +0 -0
  235. package/build/client/_app/immutable/nodes/3.19DIoFtw.js +0 -1
  236. package/build/client/_app/immutable/nodes/3.19DIoFtw.js.br +0 -0
  237. package/build/client/_app/immutable/nodes/3.19DIoFtw.js.gz +0 -0
  238. package/build/client/_app/immutable/nodes/4.BvMzqBJj.js.br +0 -0
  239. package/build/client/_app/immutable/nodes/4.BvMzqBJj.js.gz +0 -0
  240. package/build/client/_app/immutable/nodes/5.Dq6obSGG.js +0 -42
  241. package/build/client/_app/immutable/nodes/5.Dq6obSGG.js.br +0 -0
  242. package/build/client/_app/immutable/nodes/5.Dq6obSGG.js.gz +0 -0
  243. package/build/client/_app/immutable/nodes/6.BOHISqs-.js.br +0 -0
  244. package/build/client/_app/immutable/nodes/6.BOHISqs-.js.gz +0 -0
  245. package/build/client/_app/immutable/nodes/7.CemgNJfw.js.br +0 -0
  246. package/build/client/_app/immutable/nodes/7.CemgNJfw.js.gz +0 -0
  247. package/build/client/_app/immutable/nodes/8.DejSfIYh.js +0 -5
  248. package/build/client/_app/immutable/nodes/8.DejSfIYh.js.br +0 -0
  249. package/build/client/_app/immutable/nodes/8.DejSfIYh.js.gz +0 -0
  250. package/build/client/_app/immutable/nodes/9.CMW6a2Lg.js.br +0 -0
  251. package/build/client/_app/immutable/nodes/9.CMW6a2Lg.js.gz +0 -0
  252. package/build/server/chunks/1-DPpKAKXV.js +0 -9
  253. package/build/server/chunks/5-D7OCJpxD.js +0 -9
  254. package/build/server/chunks/5-D7OCJpxD.js.map +0 -1
  255. package/build/server/chunks/8-CVO-E-sf.js +0 -9
  256. package/build/server/chunks/8-CVO-E-sf.js.map +0 -1
  257. package/build/server/chunks/9-DxT1baO5.js +0 -9
  258. package/build/server/chunks/9-DxT1baO5.js.map +0 -1
  259. package/build/server/chunks/ProgressBar-CfhccQ83.js.map +0 -1
  260. package/build/server/chunks/_layout.svelte-BREws55o.js.map +0 -1
  261. package/build/server/chunks/_page.svelte-BqSC-1vK.js.map +0 -1
  262. package/build/server/chunks/_page.svelte-BtI2zZ_Z.js.map +0 -1
  263. package/build/server/chunks/_page.svelte-Zf9H4KOP.js.map +0 -1
  264. package/build/server/chunks/builderModeStore.svelte-ihupr-3p.js.map +0 -1
  265. package/build/server/chunks/client-DfpLcAZ9.js +0 -24
  266. package/build/server/chunks/hooks.server-Rv301GTB.js.map +0 -1
  267. package/build/server/chunks/reconcile-Dv7jS3C8.js.map +0 -1
  268. /package/build/client/_app/immutable/assets/{9.nv0I59TU.css → 11.nv0I59TU.css} +0 -0
  269. /package/build/client/_app/immutable/assets/{9.nv0I59TU.css.br → 11.nv0I59TU.css.br} +0 -0
  270. /package/build/client/_app/immutable/assets/{9.nv0I59TU.css.gz → 11.nv0I59TU.css.gz} +0 -0
@@ -0,0 +1,757 @@
1
+ import { W as onDestroy, t as escape_html, g as attr, h as attr_class, r as ensure_array_like, i as attr_style, q as derived } from './index-server-7H0jzj0M.js';
2
+ import { w as flattenLeafConditions, E as isParamLeft } from './TagPalette-CtMNYCmu.js';
3
+
4
+ //#region src/features/behavior-model/domain/services/BehaviorGraphModel.ts
5
+ var ALL_BEHAVIOR_GRAPH_EDGE_KINDS = [
6
+ "contains",
7
+ "reads",
8
+ "writes",
9
+ "emits",
10
+ "transitions",
11
+ "asserts",
12
+ "uses",
13
+ "handles"
14
+ ];
15
+ var ALL_BEHAVIOR_GRAPH_NODE_TYPES = [
16
+ "feature",
17
+ "surface",
18
+ "action",
19
+ "state",
20
+ "event",
21
+ "parameter",
22
+ "rule",
23
+ "effect",
24
+ "invariant",
25
+ "scenario",
26
+ "persona",
27
+ "resource",
28
+ "entity",
29
+ "valueSet"
30
+ ];
31
+ var effectLabel = (effect) => {
32
+ switch (effect.type) {
33
+ case "set_state": return `set ${effect.path}`;
34
+ case "show_message": return effect.tone ? `${effect.tone} message` : "message";
35
+ case "emit_event": return `emit ${effect.event}`;
36
+ case "block_action": return "block";
37
+ case "allow_action": return "allow";
38
+ case "transition_surface": return "transition";
39
+ }
40
+ };
41
+ var leafStatePaths = (condition) => {
42
+ const paths = /* @__PURE__ */ new Set();
43
+ for (const leaf of flattenLeafConditions(condition)) if (!isParamLeft(leaf.left)) paths.add(String(leaf.left));
44
+ return [...paths];
45
+ };
46
+ var buildBehaviorGraph = (sourceFeatures, sourceProject) => {
47
+ const nodes = /* @__PURE__ */ new Map();
48
+ const edges = /* @__PURE__ */ new Map();
49
+ const addNode = (node) => {
50
+ if (!nodes.has(node.id)) nodes.set(node.id, node);
51
+ };
52
+ const addEdge = (edge) => {
53
+ if (!nodes.has(edge.from) || !nodes.has(edge.to)) return;
54
+ const id = `${edge.from}->${edge.to}:${edge.kind}:${edge.label ?? ""}`;
55
+ if (!edges.has(id)) edges.set(id, {
56
+ ...edge,
57
+ id
58
+ });
59
+ };
60
+ const ensureState = (feature, path, detail) => {
61
+ addNode({
62
+ id: `feature:${feature.id}:state:${path}`,
63
+ type: "state",
64
+ label: path,
65
+ detail,
66
+ layer: 3
67
+ });
68
+ };
69
+ const surfaceIdFor = (feature, id) => `feature:${feature.id}:surface:${id}`;
70
+ const actionIdFor = (feature, id) => `feature:${feature.id}:action:${id}`;
71
+ const stateIdFor = (feature, path) => `feature:${feature.id}:state:${path}`;
72
+ const valueSetIdFor = (feature, id) => `feature:${feature.id}:valueSet:${id}`;
73
+ const addEffectLinks = (feature, ownerId, effect, relation) => {
74
+ const effectId = `feature:${feature.id}:effect:${effect.id}`;
75
+ addNode({
76
+ id: effectId,
77
+ type: "effect",
78
+ label: effectLabel(effect),
79
+ detail: effect.description ?? effect.type,
80
+ layer: 5
81
+ });
82
+ addEdge({
83
+ from: ownerId,
84
+ to: effectId,
85
+ kind: relation
86
+ });
87
+ if (effect.type === "set_state") {
88
+ ensureState(feature, String(effect.path));
89
+ addEdge({
90
+ from: effectId,
91
+ to: stateIdFor(feature, effect.path),
92
+ kind: "writes"
93
+ });
94
+ } else if (effect.type === "emit_event") {
95
+ const eventId = `event:${effect.event}`;
96
+ addNode({
97
+ id: eventId,
98
+ type: "event",
99
+ label: String(effect.event),
100
+ layer: 3
101
+ });
102
+ addEdge({
103
+ from: effectId,
104
+ to: eventId,
105
+ kind: "emits"
106
+ });
107
+ } else if (effect.type === "transition_surface") addEdge({
108
+ from: effectId,
109
+ to: surfaceIdFor(feature, effect.target),
110
+ kind: "transitions"
111
+ });
112
+ };
113
+ const projectId = sourceProject ? `project:${sourceProject.id}` : null;
114
+ if (sourceProject && projectId) addNode({
115
+ id: projectId,
116
+ type: "feature",
117
+ label: sourceProject.name,
118
+ detail: sourceProject.description ?? "Project",
119
+ layer: 0
120
+ });
121
+ for (const feature of sourceFeatures) {
122
+ const featureId = `feature:${feature.id}`;
123
+ addNode({
124
+ id: featureId,
125
+ type: "feature",
126
+ label: feature.name,
127
+ detail: feature.description,
128
+ layer: sourceProject ? 1 : 0,
129
+ href: `/features/${feature.id}`
130
+ });
131
+ if (projectId) addEdge({
132
+ from: projectId,
133
+ to: featureId,
134
+ kind: "contains"
135
+ });
136
+ for (const persona of feature.personas) {
137
+ const id = `feature:${feature.id}:persona:${persona.id}`;
138
+ addNode({
139
+ id,
140
+ type: "persona",
141
+ label: persona.name,
142
+ detail: persona.description,
143
+ layer: sourceProject ? 2 : 1
144
+ });
145
+ addEdge({
146
+ from: featureId,
147
+ to: id,
148
+ kind: "contains"
149
+ });
150
+ }
151
+ for (const resource of feature.resources) {
152
+ const id = `resource:${resource.id}`;
153
+ addNode({
154
+ id,
155
+ type: "resource",
156
+ label: resource.name,
157
+ detail: resource.description ?? resource.kind,
158
+ layer: sourceProject ? 2 : 1
159
+ });
160
+ addEdge({
161
+ from: featureId,
162
+ to: id,
163
+ kind: "contains"
164
+ });
165
+ }
166
+ for (const entity of feature.entities) {
167
+ const id = `entity:${entity.id}`;
168
+ addNode({
169
+ id,
170
+ type: "entity",
171
+ label: entity.namespace,
172
+ detail: entity.description,
173
+ layer: sourceProject ? 2 : 1
174
+ });
175
+ addEdge({
176
+ from: featureId,
177
+ to: id,
178
+ kind: "contains"
179
+ });
180
+ if (entity.resourceId) addEdge({
181
+ from: id,
182
+ to: `resource:${entity.resourceId}`,
183
+ kind: "uses"
184
+ });
185
+ }
186
+ for (const valueSet of feature.valueSets ?? []) {
187
+ const id = valueSetIdFor(feature, valueSet.id);
188
+ addNode({
189
+ id,
190
+ type: "valueSet",
191
+ label: valueSet.name,
192
+ detail: `${valueSet.values.length} values`,
193
+ layer: sourceProject ? 2 : 1
194
+ });
195
+ addEdge({
196
+ from: featureId,
197
+ to: id,
198
+ kind: "contains"
199
+ });
200
+ }
201
+ for (const event of feature.events ?? []) {
202
+ const id = `event:${event.name}`;
203
+ addNode({
204
+ id,
205
+ type: "event",
206
+ label: String(event.name),
207
+ detail: event.description,
208
+ layer: 3
209
+ });
210
+ addEdge({
211
+ from: featureId,
212
+ to: id,
213
+ kind: "contains"
214
+ });
215
+ }
216
+ for (const invariant of feature.featureInvariants ?? []) {
217
+ const id = `feature:${feature.id}:invariant:${invariant.id}`;
218
+ addNode({
219
+ id,
220
+ type: "invariant",
221
+ label: invariant.name,
222
+ detail: invariant.description ?? invariant.message,
223
+ layer: 6
224
+ });
225
+ addEdge({
226
+ from: featureId,
227
+ to: id,
228
+ kind: "contains"
229
+ });
230
+ for (const path of leafStatePaths(invariant.condition)) {
231
+ ensureState(feature, path);
232
+ addEdge({
233
+ from: id,
234
+ to: stateIdFor(feature, path),
235
+ kind: "reads"
236
+ });
237
+ }
238
+ }
239
+ for (const surface of feature.surfaces) {
240
+ const surfaceId = surfaceIdFor(feature, surface.id);
241
+ addNode({
242
+ id: surfaceId,
243
+ type: "surface",
244
+ label: surface.name,
245
+ detail: surface.description ?? surface.type,
246
+ layer: sourceProject ? 2 : 1,
247
+ href: `/features/${feature.id}?surface=${surface.id}`
248
+ });
249
+ addEdge({
250
+ from: featureId,
251
+ to: surfaceId,
252
+ kind: "contains"
253
+ });
254
+ if (surface.parentSurfaceId) addEdge({
255
+ from: surfaceIdFor(feature, surface.parentSurfaceId),
256
+ to: surfaceId,
257
+ kind: "contains"
258
+ });
259
+ for (const def of surface.stateDefinitions) {
260
+ ensureState(feature, String(def.path), def.description ?? def.type);
261
+ addEdge({
262
+ from: surfaceId,
263
+ to: stateIdFor(feature, def.path),
264
+ kind: "contains"
265
+ });
266
+ if (def.valueSetId) addEdge({
267
+ from: stateIdFor(feature, def.path),
268
+ to: valueSetIdFor(feature, def.valueSetId),
269
+ kind: "uses"
270
+ });
271
+ }
272
+ for (const transition of surface.transitions) {
273
+ const id = `feature:${feature.id}:transition:${transition.id}`;
274
+ addNode({
275
+ id,
276
+ type: "effect",
277
+ label: transition.label ?? "transition",
278
+ detail: transition.description,
279
+ layer: 6
280
+ });
281
+ addEdge({
282
+ from: surfaceId,
283
+ to: id,
284
+ kind: "contains"
285
+ });
286
+ addEdge({
287
+ from: id,
288
+ to: surfaceIdFor(feature, transition.target),
289
+ kind: "transitions"
290
+ });
291
+ }
292
+ for (const rule of surface.rules) {
293
+ const id = `feature:${feature.id}:rule:${rule.id}`;
294
+ addNode({
295
+ id,
296
+ type: "rule",
297
+ label: rule.category,
298
+ detail: rule.description,
299
+ layer: 6
300
+ });
301
+ addEdge({
302
+ from: surfaceId,
303
+ to: id,
304
+ kind: "contains"
305
+ });
306
+ for (const path of leafStatePaths(rule.condition)) {
307
+ ensureState(feature, path);
308
+ addEdge({
309
+ from: id,
310
+ to: stateIdFor(feature, path),
311
+ kind: "reads"
312
+ });
313
+ }
314
+ addEffectLinks(feature, id, rule.effect, "writes");
315
+ }
316
+ for (const invariant of surface.invariants) {
317
+ const id = `feature:${feature.id}:invariant:${invariant.id}`;
318
+ addNode({
319
+ id,
320
+ type: "invariant",
321
+ label: invariant.name,
322
+ detail: invariant.description ?? invariant.message,
323
+ layer: 6
324
+ });
325
+ addEdge({
326
+ from: surfaceId,
327
+ to: id,
328
+ kind: "contains"
329
+ });
330
+ for (const path of leafStatePaths(invariant.condition)) {
331
+ ensureState(feature, path);
332
+ addEdge({
333
+ from: id,
334
+ to: stateIdFor(feature, path),
335
+ kind: "reads"
336
+ });
337
+ }
338
+ }
339
+ for (const action of surface.actions) {
340
+ const actionId = actionIdFor(feature, action.id);
341
+ addNode({
342
+ id: actionId,
343
+ type: "action",
344
+ label: action.name,
345
+ detail: action.intent,
346
+ layer: sourceProject ? 3 : 2,
347
+ href: `/features/${feature.id}?surface=${surface.id}&panel=actions`
348
+ });
349
+ addEdge({
350
+ from: surfaceId,
351
+ to: actionId,
352
+ kind: "contains"
353
+ });
354
+ if (action.triggeredByEvent) {
355
+ const eventId = `event:${action.triggeredByEvent}`;
356
+ addNode({
357
+ id: eventId,
358
+ type: "event",
359
+ label: String(action.triggeredByEvent),
360
+ layer: 3
361
+ });
362
+ addEdge({
363
+ from: eventId,
364
+ to: actionId,
365
+ kind: "handles"
366
+ });
367
+ }
368
+ for (const path of action.requiredStates) {
369
+ ensureState(feature, String(path));
370
+ addEdge({
371
+ from: stateIdFor(feature, path),
372
+ to: actionId,
373
+ kind: "reads"
374
+ });
375
+ }
376
+ for (const parameter of action.parameters) {
377
+ const id = `feature:${feature.id}:parameter:${parameter.id}`;
378
+ addNode({
379
+ id,
380
+ type: "parameter",
381
+ label: parameter.name,
382
+ detail: parameter.description ?? parameter.type,
383
+ layer: sourceProject ? 5 : 4
384
+ });
385
+ addEdge({
386
+ from: actionId,
387
+ to: id,
388
+ kind: "contains"
389
+ });
390
+ if (parameter.bindToStatePath) {
391
+ ensureState(feature, String(parameter.bindToStatePath));
392
+ addEdge({
393
+ from: id,
394
+ to: stateIdFor(feature, parameter.bindToStatePath),
395
+ kind: "writes"
396
+ });
397
+ }
398
+ if (parameter.resourceId) addEdge({
399
+ from: id,
400
+ to: `resource:${parameter.resourceId}`,
401
+ kind: "uses"
402
+ });
403
+ if (parameter.valueSetId) addEdge({
404
+ from: id,
405
+ to: valueSetIdFor(feature, parameter.valueSetId),
406
+ kind: "uses"
407
+ });
408
+ }
409
+ for (const rule of action.rules) {
410
+ const id = `feature:${feature.id}:rule:${rule.id}`;
411
+ addNode({
412
+ id,
413
+ type: "rule",
414
+ label: rule.category,
415
+ detail: rule.description,
416
+ layer: 6
417
+ });
418
+ addEdge({
419
+ from: actionId,
420
+ to: id,
421
+ kind: "contains"
422
+ });
423
+ for (const path of leafStatePaths(rule.condition)) {
424
+ ensureState(feature, path);
425
+ addEdge({
426
+ from: id,
427
+ to: stateIdFor(feature, path),
428
+ kind: "reads"
429
+ });
430
+ }
431
+ addEffectLinks(feature, id, rule.effect, "writes");
432
+ }
433
+ for (const invariant of action.invariants) {
434
+ const id = `feature:${feature.id}:invariant:${invariant.id}`;
435
+ addNode({
436
+ id,
437
+ type: "invariant",
438
+ label: invariant.name,
439
+ detail: invariant.description ?? invariant.message,
440
+ layer: 6
441
+ });
442
+ addEdge({
443
+ from: actionId,
444
+ to: id,
445
+ kind: "contains"
446
+ });
447
+ for (const path of leafStatePaths(invariant.condition)) {
448
+ ensureState(feature, path);
449
+ addEdge({
450
+ from: id,
451
+ to: stateIdFor(feature, path),
452
+ kind: "reads"
453
+ });
454
+ }
455
+ }
456
+ for (const effect of action.effects) addEffectLinks(feature, actionId, effect, "contains");
457
+ for (const effect of action.onBlockedEffects ?? []) addEffectLinks(feature, actionId, effect, "contains");
458
+ for (const event of action.emittedEvents) {
459
+ const eventId = `event:${event}`;
460
+ addNode({
461
+ id: eventId,
462
+ type: "event",
463
+ label: String(event),
464
+ layer: 3
465
+ });
466
+ addEdge({
467
+ from: actionId,
468
+ to: eventId,
469
+ kind: "emits"
470
+ });
471
+ }
472
+ for (const transition of action.transitions) {
473
+ const id = `feature:${feature.id}:transition:${transition.id}`;
474
+ addNode({
475
+ id,
476
+ type: "effect",
477
+ label: transition.label ?? "transition",
478
+ detail: transition.description,
479
+ layer: 6
480
+ });
481
+ addEdge({
482
+ from: actionId,
483
+ to: id,
484
+ kind: "contains"
485
+ });
486
+ addEdge({
487
+ from: id,
488
+ to: surfaceIdFor(feature, transition.target),
489
+ kind: "transitions"
490
+ });
491
+ }
492
+ for (const scenario of action.scenarios ?? []) {
493
+ const id = `feature:${feature.id}:scenario:${scenario.id}`;
494
+ addNode({
495
+ id,
496
+ type: "scenario",
497
+ label: scenario.name,
498
+ detail: scenario.description ?? scenario.expectedStatus,
499
+ layer: 6
500
+ });
501
+ addEdge({
502
+ from: actionId,
503
+ to: id,
504
+ kind: "asserts"
505
+ });
506
+ if (scenario.personaId) addEdge({
507
+ from: id,
508
+ to: `feature:${feature.id}:persona:${scenario.personaId}`,
509
+ kind: "uses"
510
+ });
511
+ for (const override of scenario.stateOverrides) {
512
+ ensureState(feature, String(override.path));
513
+ addEdge({
514
+ from: id,
515
+ to: stateIdFor(feature, override.path),
516
+ kind: "writes"
517
+ });
518
+ }
519
+ for (const assertion of scenario.expectedAssertions ?? []) {
520
+ ensureState(feature, String(assertion.path));
521
+ addEdge({
522
+ from: id,
523
+ to: stateIdFor(feature, assertion.path),
524
+ kind: "asserts"
525
+ });
526
+ }
527
+ if (scenario.expectedTransition) addEdge({
528
+ from: id,
529
+ to: surfaceIdFor(feature, scenario.expectedTransition),
530
+ kind: "transitions"
531
+ });
532
+ }
533
+ }
534
+ }
535
+ }
536
+ return {
537
+ nodes: [...nodes.values()],
538
+ edges: [...edges.values()]
539
+ };
540
+ };
541
+ var deriveBehaviorGraphView = (graph) => {
542
+ const degree = /* @__PURE__ */ new Map();
543
+ for (const node of graph.nodes) degree.set(node.id, 0);
544
+ for (const edge of graph.edges) {
545
+ degree.set(edge.from, (degree.get(edge.from) ?? 0) + 1);
546
+ degree.set(edge.to, (degree.get(edge.to) ?? 0) + 1);
547
+ }
548
+ const nodes = graph.nodes.map((node) => ({
549
+ ...node,
550
+ degree: degree.get(node.id) ?? 0
551
+ }));
552
+ return {
553
+ nodes,
554
+ edges: graph.edges,
555
+ nodeById: new Map(nodes.map((node) => [node.id, node]))
556
+ };
557
+ };
558
+ //#endregion
559
+ //#region src/features/behavior-model/presentation/view-models/BehaviorGraphTheme.ts
560
+ var behaviorGraphNodeTheme = {
561
+ feature: {
562
+ label: "Feature",
563
+ fill: "#0f172a",
564
+ stroke: "#020617"
565
+ },
566
+ surface: {
567
+ label: "Surface",
568
+ fill: "#0e7490",
569
+ stroke: "#155e75"
570
+ },
571
+ action: {
572
+ label: "Action",
573
+ fill: "#2563eb",
574
+ stroke: "#1d4ed8"
575
+ },
576
+ state: {
577
+ label: "State",
578
+ fill: "#7c3aed",
579
+ stroke: "#6d28d9"
580
+ },
581
+ event: {
582
+ label: "Event",
583
+ fill: "#db2777",
584
+ stroke: "#be185d"
585
+ },
586
+ parameter: {
587
+ label: "Parameter",
588
+ fill: "#0891b2",
589
+ stroke: "#0e7490"
590
+ },
591
+ rule: {
592
+ label: "Rule",
593
+ fill: "#ea580c",
594
+ stroke: "#c2410c"
595
+ },
596
+ effect: {
597
+ label: "Effect",
598
+ fill: "#16a34a",
599
+ stroke: "#15803d"
600
+ },
601
+ invariant: {
602
+ label: "Invariant",
603
+ fill: "#ca8a04",
604
+ stroke: "#a16207"
605
+ },
606
+ scenario: {
607
+ label: "Scenario",
608
+ fill: "#475569",
609
+ stroke: "#334155"
610
+ },
611
+ persona: {
612
+ label: "Persona",
613
+ fill: "#0f766e",
614
+ stroke: "#115e59"
615
+ },
616
+ resource: {
617
+ label: "Resource",
618
+ fill: "#4f46e5",
619
+ stroke: "#4338ca"
620
+ },
621
+ entity: {
622
+ label: "Entity",
623
+ fill: "#9333ea",
624
+ stroke: "#7e22ce"
625
+ },
626
+ valueSet: {
627
+ label: "Value set",
628
+ fill: "#64748b",
629
+ stroke: "#475569"
630
+ }
631
+ };
632
+ var behaviorGraphEdgeTheme = {
633
+ contains: {
634
+ label: "Contains",
635
+ color: "#94a3b8"
636
+ },
637
+ reads: {
638
+ label: "Reads",
639
+ color: "#7c3aed"
640
+ },
641
+ writes: {
642
+ label: "Writes",
643
+ color: "#16a34a"
644
+ },
645
+ emits: {
646
+ label: "Emits",
647
+ color: "#db2777"
648
+ },
649
+ transitions: {
650
+ label: "Transitions",
651
+ color: "#0891b2"
652
+ },
653
+ asserts: {
654
+ label: "Asserts",
655
+ color: "#ca8a04"
656
+ },
657
+ uses: {
658
+ label: "Uses",
659
+ color: "#475569"
660
+ },
661
+ handles: {
662
+ label: "Handles",
663
+ color: "#2563eb"
664
+ }
665
+ };
666
+ //#endregion
667
+ //#region src/features/behavior-model/presentation/components/BehaviorGraph.svelte
668
+ function BehaviorGraph($$renderer, $$props) {
669
+ $$renderer.component(($$renderer) => {
670
+ let { feature, features, project } = $$props;
671
+ let search = "";
672
+ let stabilizationProgress = 0;
673
+ let renderer = null;
674
+ let enabledKinds = {
675
+ contains: true,
676
+ reads: true,
677
+ writes: true,
678
+ emits: true,
679
+ transitions: true,
680
+ asserts: true,
681
+ uses: true,
682
+ handles: true
683
+ };
684
+ const sourceFeatures = derived(() => features ?? (feature ? [feature] : []));
685
+ const graphTitle = derived(() => project?.name ?? feature?.name ?? "Behavior graph");
686
+ const graphSubtitle = derived(() => project ? `The whole project behavior map across ${sourceFeatures().length} feature${sourceFeatures().length === 1 ? "" : "s"} from the shared Unspa hub.` : "A connected map of the executable behavior model from the shared Unspa hub.");
687
+ const backHref = derived(() => project ? `/projects/${project.id}` : feature ? `/features/${feature.id}` : "/projects");
688
+ const backLabel = derived(() => project ? "Back to project" : "Back to editor");
689
+ const rawGraph = derived(() => buildBehaviorGraph(sourceFeatures(), project));
690
+ const graph = derived(() => deriveBehaviorGraphView(rawGraph()));
691
+ const selectedNode = derived(() => null);
692
+ const selectedEdge = derived(() => null);
693
+ const selectedEdgeFrom = derived(() => selectedEdge() ? graph().nodeById.get(selectedEdge().from) ?? null : null);
694
+ const selectedEdgeTo = derived(() => selectedEdge() ? graph().nodeById.get(selectedEdge().to) ?? null : null);
695
+ const centralNodes = derived(() => [...graph().nodes].sort((a, b) => b.degree - a.degree).slice(0, 6));
696
+ const countsByType = derived(() => {
697
+ const counts = /* @__PURE__ */ new Map();
698
+ for (const node of graph().nodes) counts.set(node.type, (counts.get(node.type) ?? 0) + 1);
699
+ return counts;
700
+ });
701
+ onDestroy(() => {
702
+ renderer?.destroy();
703
+ renderer = null;
704
+ });
705
+ $$renderer.push(`<section class="space-y-4"><div class="overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm shadow-slate-950/5"><div class="border-b border-slate-200 bg-slate-950 px-4 py-4 text-white"><div class="flex flex-wrap items-start justify-between gap-4"><div class="min-w-0"><p class="text-xs font-semibold uppercase tracking-wide text-cyan-200">Behavior Graph</p> <h2 class="mt-1 truncate text-2xl font-semibold">${escape_html(graphTitle())}</h2> <p class="mt-1 max-w-3xl text-sm leading-6 text-slate-300">${escape_html(graphSubtitle())}</p></div> <a${attr("href", backHref())} class="rounded-md border border-white/20 px-3 py-2 text-sm font-medium text-white hover:bg-white/10">${escape_html(backLabel())}</a></div></div> <div class="grid gap-0 lg:grid-cols-[minmax(0,1fr)_320px]"><div class="min-w-0 border-b border-slate-200 lg:border-b-0 lg:border-r"><div class="flex flex-wrap items-center gap-3 border-b border-slate-200 bg-slate-50 px-4 py-3"><input type="search"${attr("value", search)} placeholder="Search nodes" class="w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm outline-none focus:border-brand-700 sm:w-64"/> <button type="button" class="rounded-md border border-slate-300 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-white">Re-layout</button> <button type="button" class="rounded-md border border-slate-300 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-white">Fit</button> <div class="flex rounded-md border border-slate-300 bg-white p-1"><button type="button" class="rounded px-2.5 py-1 text-sm font-semibold text-slate-700 hover:bg-slate-50" aria-label="Zoom out">-</button> <button type="button" class="rounded px-2.5 py-1 text-sm font-semibold text-slate-700 hover:bg-slate-50" aria-label="Zoom in">+</button></div> <button type="button" class="rounded-md border border-slate-300 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-white">Reset</button> <button type="button"${attr_class(`rounded-md border border-slate-300 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-white`)}>Labels</button> <div class="flex flex-wrap gap-1"><!--[-->`);
706
+ const each_array = ensure_array_like(ALL_BEHAVIOR_GRAPH_EDGE_KINDS);
707
+ for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
708
+ let kind = each_array[$$index];
709
+ $$renderer.push(`<button type="button"${attr_class(`rounded-full border px-2.5 py-1 text-xs font-medium ${enabledKinds[kind] ? "border-slate-300 bg-white text-slate-800" : "border-slate-200 bg-slate-100 text-slate-400"}`)}>${escape_html(behaviorGraphEdgeTheme[kind].label)}</button>`);
710
+ }
711
+ $$renderer.push(`<!--]--></div></div> <div class="graph-canvas relative svelte-1wx4hks"><div class="h-[76vh] min-h-[720px] w-full"${attr("aria-label", `Interactive behavior graph for ${graphTitle()}`)}></div> <div class="pointer-events-none absolute bottom-3 left-3 rounded-md border border-slate-200 bg-white/88 px-3 py-2 text-xs text-slate-600 shadow-sm backdrop-blur">ForceAtlas2 settles the graph, then physics stops for smooth panning. Wheel, pinch, or +/- to zoom.</div> `);
712
+ $$renderer.push("<!--[0-->");
713
+ $$renderer.push(`<div class="pointer-events-none absolute left-1/2 top-3 w-64 -translate-x-1/2 rounded-md border border-slate-200 bg-white/90 p-3 text-xs text-slate-600 shadow-sm backdrop-blur"><div class="flex justify-between font-medium text-slate-800"><span>Stabilizing layout</span> <span>${escape_html(stabilizationProgress)}%</span></div> <div class="mt-2 h-1.5 overflow-hidden rounded-full bg-slate-200"><div class="h-full rounded-full bg-brand-500 transition-all"${attr_style(`width:${stabilizationProgress}%`)}></div></div></div>`);
714
+ $$renderer.push(`<!--]--></div></div> <aside class="space-y-4 p-4"><div><h3 class="text-sm font-semibold text-slate-950">Graph Summary</h3> <div class="mt-3 grid grid-cols-2 gap-2 text-sm"><div class="rounded-md bg-slate-100 p-3"><div class="text-2xl font-semibold text-slate-950">${escape_html(graph().nodes.length)}</div> <div class="text-xs text-slate-500">nodes</div></div> <div class="rounded-md bg-slate-100 p-3"><div class="text-2xl font-semibold text-slate-950">${escape_html(graph().edges.length)}</div> <div class="text-xs text-slate-500">edges</div></div></div></div> <div><h3 class="text-sm font-semibold text-slate-950">Node Types</h3> <div class="mt-2 flex flex-wrap gap-1.5"><!--[-->`);
715
+ const each_array_1 = ensure_array_like(ALL_BEHAVIOR_GRAPH_NODE_TYPES);
716
+ for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
717
+ let type = each_array_1[$$index_1];
718
+ if (countsByType().get(type)) {
719
+ $$renderer.push("<!--[0-->");
720
+ $$renderer.push(`<span class="inline-flex items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-1 text-xs text-slate-700"><span class="h-2 w-2 rounded-full"${attr_style(`background:${behaviorGraphNodeTheme[type].fill}`)}></span> ${escape_html(behaviorGraphNodeTheme[type].label)} ${escape_html(countsByType().get(type))}</span>`);
721
+ } else $$renderer.push("<!--[-1-->");
722
+ $$renderer.push(`<!--]-->`);
723
+ }
724
+ $$renderer.push(`<!--]--></div></div> <div><h3 class="text-sm font-semibold text-slate-950">Central Nodes</h3> <div class="mt-2 space-y-2"><!--[-->`);
725
+ const each_array_2 = ensure_array_like(centralNodes());
726
+ for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
727
+ let node = each_array_2[$$index_2];
728
+ $$renderer.push(`<button type="button" class="w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-left hover:border-brand-300 hover:bg-brand-50"><span class="block truncate text-sm font-medium text-slate-900">${escape_html(node.label)}</span> <span class="text-xs text-slate-500">${escape_html(behaviorGraphNodeTheme[node.type].label)} / ${escape_html(node.degree)} links</span></button>`);
729
+ }
730
+ $$renderer.push(`<!--]--></div></div> <div class="rounded-md border border-slate-200 bg-slate-50 p-3">`);
731
+ if (selectedNode()) {
732
+ $$renderer.push("<!--[0-->");
733
+ $$renderer.push(`<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">${escape_html(behaviorGraphNodeTheme[selectedNode().type].label)}</p> <h3 class="mt-1 text-base font-semibold text-slate-950">${escape_html(selectedNode().label)}</h3> `);
734
+ if (selectedNode().detail) {
735
+ $$renderer.push("<!--[0-->");
736
+ $$renderer.push(`<p class="mt-2 text-sm leading-6 text-slate-600">${escape_html(selectedNode().detail)}</p>`);
737
+ } else $$renderer.push("<!--[-1-->");
738
+ $$renderer.push(`<!--]--> <p class="mt-2 text-xs text-slate-500">${escape_html(selectedNode().degree)} graph links</p> `);
739
+ if (selectedNode().href) {
740
+ $$renderer.push("<!--[0-->");
741
+ $$renderer.push(`<a class="mt-3 inline-flex text-sm font-medium text-brand-700 hover:underline"${attr("href", selectedNode().href)}>Open in editor</a>`);
742
+ } else $$renderer.push("<!--[-1-->");
743
+ $$renderer.push(`<!--]-->`);
744
+ } else if (selectedEdge()) {
745
+ $$renderer.push("<!--[1-->");
746
+ $$renderer.push(`<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">${escape_html(behaviorGraphEdgeTheme[selectedEdge().kind].label)}</p> <h3 class="mt-1 text-base font-semibold text-slate-950">${escape_html(selectedEdge().label ?? "Behavior link")}</h3> <p class="mt-2 text-sm leading-6 text-slate-600">${escape_html(selectedEdgeFrom()?.label ?? selectedEdge().from)} -> ${escape_html(selectedEdgeTo()?.label ?? selectedEdge().to)}</p> <p class="mt-2 text-xs text-slate-500">Click another node or edge to move the highlighted neighborhood.</p>`);
747
+ } else {
748
+ $$renderer.push("<!--[-1-->");
749
+ $$renderer.push(`<h3 class="text-sm font-semibold text-slate-950">Explore the Map</h3> <p class="mt-2 text-sm leading-6 text-slate-600">Click a node or edge to highlight its linked behavior. Hover highlighting is disabled so
750
+ the canvas stays lighter on slower laptops.</p>`);
751
+ }
752
+ $$renderer.push(`<!--]--></div></aside></div></div></section>`);
753
+ });
754
+ }
755
+
756
+ export { BehaviorGraph as B };
757
+ //# sourceMappingURL=BehaviorGraph-m5kYj5HH.js.map