@codeyam/codeyam-cli 0.1.7 → 0.1.9

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 (576) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +9 -9
  4. package/analyzer-template/packages/ai/package.json +1 -1
  5. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +34 -3
  6. package/analyzer-template/packages/ai/src/lib/completionCall.ts +14 -2
  7. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +27 -0
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
  9. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +78 -2
  10. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
  11. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +19 -7
  12. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  13. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +9 -1
  14. package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +0 -6
  15. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  16. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +65 -28
  17. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +83 -0
  18. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
  19. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
  20. package/analyzer-template/packages/aws/package.json +2 -2
  21. package/analyzer-template/packages/database/index.ts +1 -0
  22. package/analyzer-template/packages/database/package.json +3 -3
  23. package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -0
  24. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +93 -0
  25. package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
  26. package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
  27. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
  28. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +94 -143
  29. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  30. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  31. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  32. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  33. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  34. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  35. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  36. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  37. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
  38. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  39. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +5 -0
  40. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  41. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +25 -0
  42. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  43. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +76 -0
  44. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  45. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
  46. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  47. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  48. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
  49. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  50. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  51. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
  52. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  53. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  54. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  55. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  56. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  57. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +76 -90
  58. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  59. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  60. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  61. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  62. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  63. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  64. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  65. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  66. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  67. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  68. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  69. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  70. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  71. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  72. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  73. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  74. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  75. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  76. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  77. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +10 -0
  78. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  79. package/analyzer-template/packages/github/package.json +1 -1
  80. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  81. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -0
  82. package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
  83. package/analyzer-template/packages/ui-components/package.json +1 -1
  84. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  85. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  86. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  87. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  88. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  89. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  90. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +10 -0
  91. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  92. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  93. package/analyzer-template/project/constructMockCode.ts +136 -43
  94. package/analyzer-template/project/reconcileMockDataKeys.ts +19 -14
  95. package/analyzer-template/project/start.ts +3 -0
  96. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  97. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  98. package/analyzer-template/project/writeMockDataTsx.ts +17 -0
  99. package/analyzer-template/project/writeScenarioComponents.ts +36 -7
  100. package/analyzer-template/tsconfig.json +13 -1
  101. package/background/src/lib/virtualized/project/constructMockCode.js +115 -34
  102. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  103. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +17 -11
  104. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  105. package/background/src/lib/virtualized/project/start.js +2 -0
  106. package/background/src/lib/virtualized/project/start.js.map +1 -1
  107. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  108. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  109. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  110. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  111. package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -0
  112. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  113. package/background/src/lib/virtualized/project/writeScenarioComponents.js +29 -7
  114. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  115. package/codeyam-cli/scripts/apply-setup.js +208 -11
  116. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  117. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  118. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  119. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  120. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  121. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  122. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  123. package/codeyam-cli/src/cli.js +2 -0
  124. package/codeyam-cli/src/cli.js.map +1 -1
  125. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +45 -0
  126. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  127. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  128. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  129. package/codeyam-cli/src/commands/analyze.js +17 -7
  130. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  131. package/codeyam-cli/src/commands/default.js +14 -2
  132. package/codeyam-cli/src/commands/default.js.map +1 -1
  133. package/codeyam-cli/src/commands/editor.js +3215 -0
  134. package/codeyam-cli/src/commands/editor.js.map +1 -0
  135. package/codeyam-cli/src/commands/init.js +107 -45
  136. package/codeyam-cli/src/commands/init.js.map +1 -1
  137. package/codeyam-cli/src/data/techStacks.js +77 -0
  138. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  139. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +144 -0
  140. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  141. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  142. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  143. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  144. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  145. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +127 -0
  146. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  147. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +855 -0
  148. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  149. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  150. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  151. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
  152. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  153. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
  154. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  155. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  156. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  157. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
  158. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  159. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +520 -0
  160. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  161. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  162. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  163. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
  164. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  165. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +339 -0
  166. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  167. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  168. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  169. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  170. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  171. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  172. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  173. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +855 -0
  174. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  175. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
  176. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  177. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1742 -0
  178. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  179. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  180. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  181. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  182. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  183. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +101 -0
  184. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  185. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  186. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  187. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  188. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  189. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +227 -0
  190. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  191. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  192. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  193. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +300 -0
  194. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  195. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +50 -4
  196. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  197. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  198. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  199. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  200. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  201. package/codeyam-cli/src/utils/analyzer.js +9 -0
  202. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  203. package/codeyam-cli/src/utils/analyzerFinalization.js +96 -0
  204. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  205. package/codeyam-cli/src/utils/backgroundServer.js +104 -12
  206. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  207. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  208. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  209. package/codeyam-cli/src/utils/database.js +37 -2
  210. package/codeyam-cli/src/utils/database.js.map +1 -1
  211. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  212. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  213. package/codeyam-cli/src/utils/devServerState.js +71 -0
  214. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  215. package/codeyam-cli/src/utils/editorApi.js +73 -0
  216. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  217. package/codeyam-cli/src/utils/editorAudit.js +176 -0
  218. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  219. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  220. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  221. package/codeyam-cli/src/utils/editorDevServer.js +197 -0
  222. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  223. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
  224. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  225. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  226. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  227. package/codeyam-cli/src/utils/editorJournal.js +225 -0
  228. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  229. package/codeyam-cli/src/utils/editorLoaderHelpers.js +113 -0
  230. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  231. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  232. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  233. package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
  234. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  235. package/codeyam-cli/src/utils/editorPreview.js +132 -0
  236. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  237. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  238. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  239. package/codeyam-cli/src/utils/editorScenarios.js +332 -0
  240. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  241. package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
  242. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  243. package/codeyam-cli/src/utils/entityChangeStatus.js +349 -0
  244. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  245. package/codeyam-cli/src/utils/entityChangeStatus.server.js +158 -0
  246. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  247. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  248. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  249. package/codeyam-cli/src/utils/fileWatcher.js +25 -9
  250. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  251. package/codeyam-cli/src/utils/git.js +103 -0
  252. package/codeyam-cli/src/utils/git.js.map +1 -1
  253. package/codeyam-cli/src/utils/install-skills.js +55 -13
  254. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  255. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  256. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  257. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  258. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  259. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  260. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  261. package/codeyam-cli/src/utils/project.js +15 -5
  262. package/codeyam-cli/src/utils/project.js.map +1 -1
  263. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  264. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  265. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  266. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  267. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  268. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  269. package/codeyam-cli/src/utils/queue/job.js +70 -1
  270. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  271. package/codeyam-cli/src/utils/queue/manager.js +7 -6
  272. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  273. package/codeyam-cli/src/utils/scenarioCoverage.js +75 -0
  274. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  275. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  276. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  277. package/codeyam-cli/src/utils/scenariosManifest.js +159 -0
  278. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  279. package/codeyam-cli/src/utils/serverState.js +57 -2
  280. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  281. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +82 -11
  282. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  283. package/codeyam-cli/src/utils/simulationGateMiddleware.js +8 -1
  284. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
  285. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  286. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  287. package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
  288. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  289. package/codeyam-cli/src/utils/testRunner.js +158 -0
  290. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  291. package/codeyam-cli/src/utils/webappDetection.js +35 -2
  292. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  293. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +40 -0
  294. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  295. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +567 -0
  296. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  297. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +65 -0
  298. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  299. package/codeyam-cli/src/webserver/app/lib/database.js +41 -27
  300. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  301. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  302. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  303. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  304. package/codeyam-cli/src/webserver/backgroundServer.js +108 -18
  305. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  306. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CtmbP4Gl.js → CopyButton-BPXZwM4t.js} +1 -1
  307. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-DlMph_Hm.js → EntityItem-BcgbViKV.js} +3 -3
  308. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-B-0PjGOU.js → EntityTypeBadge-g3saevPb.js} +1 -1
  309. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-DN9eiJAO.js → EntityTypeIcon-CQIG2qda.js} +9 -9
  310. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
  311. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-rE_fI2h2.js → InteractivePreview-DYFW3lDD.js} +3 -3
  312. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CnatsCw2.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
  313. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-CSP6DZrh.js → LoadingDots-BU_OAEMP.js} +1 -1
  314. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CMK8Q7yk.js → LogViewer-ceAyBX-H.js} +1 -1
  315. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-TCV_HBjy.js → ReportIssueModal-BzHcG7SE.js} +3 -3
  316. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CG2uh31y.js → SafeScreenshot-BED4B6sP.js} +1 -1
  317. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CU_TDYd8.js → ScenarioViewer-Bd-hxofb.js} +3 -3
  318. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
  319. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-D7IoaWUW.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
  320. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
  321. package/codeyam-cli/src/webserver/build/client/assets/{_index-B8z7mjR-.js → _index-DLxKhri3.js} +3 -3
  322. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DZu78RI1.js → activity.(_tab)-BcY3q6nt.js} +6 -6
  323. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  324. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  325. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
  326. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  327. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-Dm5RS9il.js → agent-transcripts-Bni3iiUj.js} +5 -5
  328. package/codeyam-cli/src/webserver/build/client/assets/api.dev-mode-events-l0sNRNKZ.js +1 -0
  329. package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
  330. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  331. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  332. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  333. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  334. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  335. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  336. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  337. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  338. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  339. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  340. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  341. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  342. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  343. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  344. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  345. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  346. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  347. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  348. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  349. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  350. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  351. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  352. package/codeyam-cli/src/webserver/build/client/assets/{book-open-Bp5FLkd4.js → book-open-BYOypzCa.js} +2 -2
  353. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DQJA9f4o.js → chevron-down-C_Pmso5S.js} +2 -2
  354. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-7VptmeIr.js → chunk-JZWAC4HX-C4pqxYJB.js} +1 -1
  355. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-B6C4LY9o.js → circle-check-BVMi9VA5.js} +2 -2
  356. package/codeyam-cli/src/webserver/build/client/assets/{copy-6nzYCu0G.js → copy-n2FB0_Sw.js} +3 -3
  357. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CC6AbExI.js +41 -0
  358. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BsDh6TSF.js +1 -0
  359. package/codeyam-cli/src/webserver/build/client/assets/editor-PBc_6L9R.js +10 -0
  360. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-4FzHlcNn.js +41 -0
  361. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-C6PQhwY5.js → entity._sha._-BsDXNp45.js} +9 -9
  362. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-BgAqUtTZ.js +6 -0
  363. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-Bmshgrij.js +6 -0
  364. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
  365. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-C7ysA4Jq.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
  366. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CU6EUArK.js → entry.client-DTvKq3TY.js} +1 -1
  367. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-EWpfFU4X.js → fileTableUtils-cPo8LiG3.js} +1 -1
  368. package/codeyam-cli/src/webserver/build/client/assets/{files-CrxAoWIL.js → files-BZrlFE1F.js} +1 -1
  369. package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +1 -0
  370. package/codeyam-cli/src/webserver/build/client/assets/globals-B8vTTNy2.css +1 -0
  371. package/codeyam-cli/src/webserver/build/client/assets/{index-7-1FmlHo.js → index-10oVnAAH.js} +1 -1
  372. package/codeyam-cli/src/webserver/build/client/assets/{index-DuYcwYp_.js → index-BcvgDzbZ.js} +1 -1
  373. package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
  374. package/codeyam-cli/src/webserver/build/client/assets/{labs-CPPVOSWB.js → labs-Zk7ryIM1.js} +1 -1
  375. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BnDcD54R.js → loader-circle-DaAZ_H2w.js} +2 -2
  376. package/codeyam-cli/src/webserver/build/client/assets/manifest-65850841.js +1 -0
  377. package/codeyam-cli/src/webserver/build/client/assets/memory-9gnxSZlb.js +101 -0
  378. package/codeyam-cli/src/webserver/build/client/assets/{pause-DhQX2g22.js → pause-f5-1lKBt.js} +3 -3
  379. package/codeyam-cli/src/webserver/build/client/assets/root-BwX8YgFb.js +67 -0
  380. package/codeyam-cli/src/webserver/build/client/assets/{search-DborVoKD.js → search-Di64LWVb.js} +2 -2
  381. package/codeyam-cli/src/webserver/build/client/assets/{settings-BWunYSXt.js → settings-0OrEMU6J.js} +1 -1
  382. package/codeyam-cli/src/webserver/build/client/assets/{simulations-BtrtCYJg.js → simulations-DWT-CvLy.js} +1 -1
  383. package/codeyam-cli/src/webserver/build/client/assets/{terminal-Bs4NC-VZ.js → terminal-Br7MOqts.js} +3 -3
  384. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DTf3Jojp.js → triangle-alert-BLdiCuG-.js} +2 -2
  385. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BE43Hjti.js +1 -0
  386. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
  387. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-BsQb6rFd.js → useReportContext-O-jkvSPx.js} +1 -1
  388. package/codeyam-cli/src/webserver/build/client/assets/{useToast-BOur3mUv.js → useToast-9FIWuYfK.js} +1 -1
  389. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  390. package/codeyam-cli/src/webserver/build/server/assets/index-DEEQf4pi.js +1 -0
  391. package/codeyam-cli/src/webserver/build/server/assets/init-CkWmyFY2.js +10 -0
  392. package/codeyam-cli/src/webserver/build/server/assets/server-build-BHi-9O8W.js +439 -0
  393. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  394. package/codeyam-cli/src/webserver/build-info.json +5 -5
  395. package/codeyam-cli/src/webserver/devServer.js +39 -5
  396. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  397. package/codeyam-cli/src/webserver/editorProxy.js +877 -0
  398. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  399. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
  400. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +230 -0
  401. package/codeyam-cli/src/webserver/server.js +258 -1
  402. package/codeyam-cli/src/webserver/server.js.map +1 -1
  403. package/codeyam-cli/src/webserver/terminalServer.js +726 -0
  404. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  405. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  406. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  407. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  408. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  409. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  410. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  411. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  412. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  413. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  414. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  415. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  416. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  417. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  418. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  419. package/codeyam-cli/templates/codeyam-editor-claude.md +147 -0
  420. package/codeyam-cli/templates/editor-step-hook.py +236 -0
  421. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  422. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  423. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  424. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  425. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  426. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  427. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  428. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  429. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  430. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  431. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  432. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  433. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  434. package/codeyam-cli/templates/expo-react-native/package.json +38 -0
  435. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  436. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  437. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  438. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  439. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  440. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  441. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  442. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  443. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  444. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  445. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  446. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  447. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  448. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  449. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  450. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  451. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  452. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +24 -0
  453. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  454. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  455. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  456. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
  457. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  458. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +39 -0
  459. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  460. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  461. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +40 -0
  462. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  463. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +92 -0
  464. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  465. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  466. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  467. package/codeyam-cli/templates/nextjs-prisma-supabase/SUPABASE_SETUP.md +104 -0
  468. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  469. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  470. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  471. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  472. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  473. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  474. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  475. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  476. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  477. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  478. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  479. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  480. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  481. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  482. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  483. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  484. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  485. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +148 -0
  486. package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
  487. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  488. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  489. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  490. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  491. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  492. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  493. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  494. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  495. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  496. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  497. package/package.json +17 -10
  498. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +22 -4
  499. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  500. package/packages/ai/src/lib/completionCall.js +10 -2
  501. package/packages/ai/src/lib/completionCall.js.map +1 -1
  502. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +21 -0
  503. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  504. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  505. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  506. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  507. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  508. package/packages/ai/src/lib/generateEntityScenarioData.js +57 -2
  509. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  510. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  511. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  512. package/packages/analyze/src/lib/ProjectAnalyzer.js +13 -4
  513. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  514. package/packages/analyze/src/lib/asts/index.js +4 -2
  515. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  516. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +8 -1
  517. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  518. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +0 -5
  519. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
  520. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  521. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  522. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +54 -27
  523. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -1
  524. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +65 -0
  525. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  526. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  527. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  528. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +18 -4
  529. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  530. package/packages/database/index.js +1 -0
  531. package/packages/database/index.js.map +1 -1
  532. package/packages/database/src/lib/kysely/db.js +5 -0
  533. package/packages/database/src/lib/kysely/db.js.map +1 -1
  534. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +76 -0
  535. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  536. package/packages/database/src/lib/loadCommits.js +23 -13
  537. package/packages/database/src/lib/loadCommits.js.map +1 -1
  538. package/packages/database/src/lib/loadEntities.js +0 -6
  539. package/packages/database/src/lib/loadEntities.js.map +1 -1
  540. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  541. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  542. package/packages/database/src/lib/updateCommitMetadata.js +76 -90
  543. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  544. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  545. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  546. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  547. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  548. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  549. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  550. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  551. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  552. package/packages/types/src/enums/ProjectFramework.js +2 -0
  553. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  554. package/scripts/npm-post-install.cjs +34 -0
  555. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-C1rIyZdV.js +0 -34
  556. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-D-QUFOwe.js +0 -21
  557. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DmzSmblj.js +0 -1
  558. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DVTcUnur.js +0 -6
  559. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-BVgNO76F.js +0 -6
  560. package/codeyam-cli/src/webserver/build/client/assets/git-BldHtKeW.js +0 -15
  561. package/codeyam-cli/src/webserver/build/client/assets/globals-CLmFdUae.css +0 -1
  562. package/codeyam-cli/src/webserver/build/client/assets/manifest-717e346a.js +0 -1
  563. package/codeyam-cli/src/webserver/build/client/assets/memory-0wMU4KXe.js +0 -93
  564. package/codeyam-cli/src/webserver/build/client/assets/root-DqfSDjyQ.js +0 -62
  565. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-D_bDZyDU.js +0 -1
  566. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-DZp6rrQD.js +0 -2
  567. package/codeyam-cli/src/webserver/build/server/assets/index-B8jmgmn2.js +0 -1
  568. package/codeyam-cli/src/webserver/build/server/assets/server-build-9OU4lmvL.js +0 -285
  569. package/scripts/finalize-analyzer.cjs +0 -13
  570. /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
  571. /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
  572. /package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -0
  573. /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
  574. /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
  575. /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
  576. /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
@@ -87,8 +87,25 @@ export function ScenarioClientWrapper({
87
87
  return () => window.removeEventListener('message', eventListener);
88
88
  }, [respond, scenarioName]);
89
89
 
90
- // Console interception
90
+ // Console interception and client error reporting
91
91
  useEffect(() => {
92
+ function _codeyamReportToServer(type: string, message: string, stack?: string) {
93
+ try {
94
+ const body = JSON.stringify({
95
+ type,
96
+ message: String(message).slice(0, 2000),
97
+ stack: stack ? String(stack).slice(0, 3000) : undefined,
98
+ scenario: scenarioName,
99
+ url: window.location.href,
100
+ });
101
+ if (navigator.sendBeacon) {
102
+ navigator.sendBeacon('/api/client-log', new Blob([body], { type: 'application/json' }));
103
+ } else {
104
+ fetch('/api/client-log', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body }).catch(() => {});
105
+ }
106
+ } catch (e) {}
107
+ }
108
+
92
109
  const oldConsoleLog = console.log;
93
110
  console.log = function(...args: any[]) {
94
111
  oldConsoleLog(...args);
@@ -121,8 +138,19 @@ export function ScenarioClientWrapper({
121
138
  }
122
139
  }
123
140
  }, '*');
141
+ const message = args.map((a: any) => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' ');
142
+ _codeyamReportToServer('console.error', message);
124
143
  };
125
144
 
145
+ window.addEventListener('error', function(event: ErrorEvent) {
146
+ _codeyamReportToServer('error', event.message, (event.error as any)?.stack);
147
+ });
148
+
149
+ window.addEventListener('unhandledrejection', function(event: PromiseRejectionEvent) {
150
+ const reason = event.reason;
151
+ _codeyamReportToServer('unhandledrejection', reason?.message || String(reason), reason?.stack);
152
+ });
153
+
126
154
  return () => {
127
155
  console.log = oldConsoleLog;
128
156
  console.error = oldConsoleError;
@@ -1 +1 @@
1
- {"version":3,"file":"generateScenarioClientWrapper.js","sourceRoot":"","sources":["../../../../../../../packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,6BAA6B,CACnD,QAAkB;IAElB,MAAM,gBAAgB,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAErD,OAAO;;;;;;;;;;;wCAW+B,gBAAgB;;;EAGtD,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2GvB,yBAAyB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsD9B,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"generateScenarioClientWrapper.js","sourceRoot":"","sources":["../../../../../../../packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,6BAA6B,CACnD,QAAkB;IAElB,MAAM,gBAAgB,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAErD,OAAO;;;;;;;;;;;wCAW+B,gBAAgB;;;EAGtD,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuIvB,yBAAyB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsD9B,CAAC;AACF,CAAC"}
@@ -38,6 +38,23 @@ export default function getIFrameMessageListenerCode({ scenarioName, }) {
38
38
  }, [respond])
39
39
 
40
40
  useEffect(() => {
41
+ function _codeyamReportToServer(type, message, stack) {
42
+ try {
43
+ const body = JSON.stringify({
44
+ type,
45
+ message: String(message).slice(0, 2000),
46
+ stack: stack ? String(stack).slice(0, 3000) : undefined,
47
+ scenario: '${escapedScenarioName}',
48
+ url: window.location.href,
49
+ });
50
+ if (navigator.sendBeacon) {
51
+ navigator.sendBeacon('/api/client-log', new Blob([body], { type: 'application/json' }));
52
+ } else {
53
+ fetch('/api/client-log', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body }).catch(() => {});
54
+ }
55
+ } catch (e) {}
56
+ }
57
+
41
58
  const oldConsoleLog = console.log;
42
59
  console.log = function(...args) {
43
60
  oldConsoleLog(...args);
@@ -48,13 +65,13 @@ export default function getIFrameMessageListenerCode({ scenarioName, }) {
48
65
  data: {
49
66
  log: {
50
67
  name: "console.log",
51
- args
52
- }
68
+ args
69
+ }
53
70
  }
54
71
  }, '*');
55
72
  } catch (e) {
56
73
  oldConsoleLog('Error posting message to parent', e);
57
- }
74
+ }
58
75
  }
59
76
 
60
77
  const oldConsoleError = console.error;
@@ -66,12 +83,23 @@ export default function getIFrameMessageListenerCode({ scenarioName, }) {
66
83
  data: {
67
84
  log: {
68
85
  name: "console.log",
69
- args
70
- }
86
+ args
87
+ }
71
88
  }
72
89
  }, '*');
90
+ const message = args.map(a => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' ');
91
+ _codeyamReportToServer('console.error', message);
73
92
  }
74
93
 
94
+ window.addEventListener('error', function(event) {
95
+ _codeyamReportToServer('error', event.message, event.error?.stack);
96
+ });
97
+
98
+ window.addEventListener('unhandledrejection', function(event) {
99
+ const reason = event.reason;
100
+ _codeyamReportToServer('unhandledrejection', reason?.message || String(reason), reason?.stack);
101
+ });
102
+
75
103
  return () => {
76
104
  console.log = oldConsoleLog;
77
105
  console.error = oldConsoleError;
@@ -1 +1 @@
1
- {"version":3,"file":"getIFrameMessageListenerCode.js","sourceRoot":"","sources":["../../../../../../../packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,YAAY,GAGb;IACC,mFAAmF;IACnF,MAAM,mBAAmB,GAAG,YAAY;SACrC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAExB,OAAO;;;;;;;;;;;iBAWQ,mBAAmB;;;;;;;;;;;;;;kCAcF,mBAAmB;;;;;;;;;;;;;;;;mBAgBlC,mBAAmB;;;;;;;;;;;;;;;;;;iBAkBrB,mBAAmB;;;;;;;;;;;;;;;CAenC,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"getIFrameMessageListenerCode.js","sourceRoot":"","sources":["../../../../../../../packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,YAAY,GAGb;IACC,mFAAmF;IACnF,MAAM,mBAAmB,GAAG,YAAY;SACrC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAExB,OAAO;;;;;;;;;;;iBAWQ,mBAAmB;;;;;;;;;;;;;;kCAcF,mBAAmB;;;;;;;;;;;;;;;;uBAgB9B,mBAAmB;;;;;;;;;;;;;;;;;mBAiBvB,mBAAmB;;;;;;;;;;;;;;;;;;iBAkBrB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BnC,CAAC;AACF,CAAC"}
@@ -5,6 +5,8 @@ export var ProjectFramework;
5
5
  ProjectFramework["CRA"] = "CRA";
6
6
  ProjectFramework["Next"] = "Next";
7
7
  ProjectFramework["NextPages"] = "NextPages";
8
+ ProjectFramework["Vite"] = "Vite";
9
+ ProjectFramework["Expo"] = "Expo";
8
10
  ProjectFramework["Unknown"] = "Unknown";
9
11
  })(ProjectFramework || (ProjectFramework = {}));
10
12
  //# sourceMappingURL=ProjectFramework.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectFramework.js","sourceRoot":"","sources":["../../../../../../packages/types/src/enums/ProjectFramework.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACrB,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B"}
1
+ {"version":3,"file":"ProjectFramework.js","sourceRoot":"","sources":["../../../../../../packages/types/src/enums/ProjectFramework.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,iCAAa,CAAA;IACb,uCAAmB,CAAA;AACrB,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B"}
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install script — we used to finalize the CodeYam analyzer here,
5
+ * but that is now deferred to the `codeyam setup-simulations` step.
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+
11
+ // On macOS/Linux, ensure node-pty spawn-helper binaries are executable.
12
+ // This is a no-op on Windows where chmod isn't needed.
13
+ if (process.platform !== 'win32') {
14
+ const spawnHelpers = [
15
+ 'node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper',
16
+ 'node_modules/node-pty/prebuilds/darwin-x64/spawn-helper',
17
+ ];
18
+ for (const helper of spawnHelpers) {
19
+ const fullPath = path.join(__dirname, '..', helper);
20
+ if (fs.existsSync(fullPath)) {
21
+ try {
22
+ fs.chmodSync(fullPath, 0o755);
23
+ } catch {
24
+ // Best-effort — don't fail the install
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ console.error('');
31
+ console.error(' CodeYam CLI installed successfully!');
32
+ console.error('');
33
+ console.error(" Type 'codeyam' in your project directory to get started.");
34
+ console.error('');
@@ -1,34 +0,0 @@
1
- import{c as _,r as e,j as h}from"./chunk-JZWAC4HX-7VptmeIr.js";import{u as K}from"./useLastLogLine-DZp6rrQD.js";function U(s){const r=s.replace(/[^a-zA-Z0-9_]+/g,"_");return r.slice(0,1).toUpperCase()+r.slice(1)}function V({analysisId:s,scenarioId:r,scenarioName:a,projectSlug:i,enabled:g=!0,refreshTrigger:f=0}){const k=_(),[S,w]=e.useState(null),[A,E]=e.useState(!1),[B,c]=e.useState(!1),[q,l]=e.useState(!1),d=e.useRef(!1),x=e.useRef(null),I=e.useRef(null),[M,m]=e.useState(0),[z,R]=e.useState(0),n=e.useRef(null),u=e.useRef(!1),{interactiveUrl:b,resetLogs:L}=K(i,g),y=e.useRef(r),F=e.useRef(f);e.useEffect(()=>{F.current!==f&&(F.current=f,S&&(console.log("[useInteractiveMode] Manual refresh triggered"),c(!0),l(!1),m(0),R(t=>t+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null)))},[f,S]),e.useEffect(()=>{if(y.current!==r&&(y.current=r,x.current&&I.current&&a)){const t=U(I.current),o=U(a),p=x.current.replace(t,o);w(p),c(!0),l(!1),m(0),R(v=>v+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null);return}},[r,a]),e.useEffect(()=>{if(b){const t=b+"?width=600px";x.current=t,a&&(I.current=a),w(t),E(!1),c(!0)}},[b]),e.useEffect(()=>{const t=o=>{o.data.type==="codeyam-resize"&&(u.current||(u.current=!0,n.current&&(clearTimeout(n.current),n.current=null),m(0),l(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const j=()=>{u.current=!1,n.current&&clearTimeout(n.current);const t=500*Math.pow(2,M);n.current=setTimeout(()=>{u.current||(M<2?(m(o=>o+1),R(o=>o+1),c(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),l(!0),c(!1)))},t)};return e.useEffect(()=>{g&&!d.current&&r&&s&&(d.current=!0,E(!0),l(!1),w(null),(async()=>{if(i)try{await fetch(`/api/logs/${i}`,{method:"DELETE"})}catch(o){console.error("[useInteractiveMode] Failed to clear log file:",o)}L(),k.submit({action:"start",analysisId:s,scenarioId:r},{method:"post",action:"/api/interactive-mode"})})())},[g,r,s,L,i]),e.useEffect(()=>{const t=s,o=()=>{if(d.current&&t){const v=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",v);console.log("[useInteractiveMode] sendBeacon result:",T),T||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:v,keepalive:!0}).catch(D=>console.error("Failed to stop interactive mode:",D)))}},p=()=>{o()};return window.addEventListener("beforeunload",p),()=>{window.removeEventListener("beforeunload",p),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),o()}},[s]),{interactiveServerUrl:S,isStarting:A,isLoading:B,showIframe:q,iframeKey:z,onIframeLoad:j}}function Z(){return h.jsxs("div",{className:"spinner-container",children:[h.jsx("span",{className:"loader"}),h.jsx("style",{children:`
2
- .loader {
3
- width: 48px;
4
- height: 48px;
5
- border: 3px solid rgba(0, 92, 117, 0.2);
6
- border-radius: 50%;
7
- display: inline-block;
8
- position: relative;
9
- box-sizing: border-box;
10
- animation: rotation 1s linear infinite;
11
- }
12
- .loader::after {
13
- content: '';
14
- box-sizing: border-box;
15
- position: absolute;
16
- left: 50%;
17
- top: 50%;
18
- transform: translate(-50%, -50%);
19
- width: 56px;
20
- height: 56px;
21
- border-radius: 50%;
22
- border: 3px solid;
23
- border-color: #005c75 transparent;
24
- }
25
-
26
- @keyframes rotation {
27
- 0% {
28
- transform: rotate(0deg);
29
- }
30
- 100% {
31
- transform: rotate(360deg);
32
- }
33
- }
34
- `})]})}const C=["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"],N=80;function $(){const[s,r]=e.useState(0);return e.useEffect(()=>{const a=setInterval(()=>{r(i=>(i+1)%C.length)},N);return()=>clearInterval(a)},[]),h.jsx("span",{className:"inline-block mr-2",children:C[s]})}export{$ as I,Z as S,V as u};
@@ -1,21 +0,0 @@
1
- import{r as s}from"./chunk-JZWAC4HX-7VptmeIr.js";/**
2
- * @license lucide-react v0.556.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
7
- * @license lucide-react v0.556.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
- * @license lucide-react v0.556.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));/**
17
- * @license lucide-react v0.556.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
@@ -1 +0,0 @@
1
- import{w as t,c as r,j as e}from"./chunk-JZWAC4HX-7VptmeIr.js";import{S as i}from"./ScenarioViewer-CU_TDYd8.js";import{W as n}from"./InteractivePreview-rE_fI2h2.js";import"./useCustomSizes-D_bDZyDU.js";import"./LogViewer-CMK8Q7yk.js";import"./SafeScreenshot-CG2uh31y.js";import"./useLastLogLine-DZp6rrQD.js";import"./InlineSpinner-C1rIyZdV.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-TCV_HBjy.js";import"./createLucideIcon-D-QUFOwe.js";import"./circle-check-B6C4LY9o.js";import"./triangle-alert-DTf3Jojp.js";import"./copy-6nzYCu0G.js";import"./scenarioStatus-B_8jpV3e.js";const y=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],w=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{w as default,y as meta};
@@ -1,6 +0,0 @@
1
- import{w as Y,u as q,a as G,b as J,r as l,j as e}from"./chunk-JZWAC4HX-7VptmeIr.js";import{u as O,S as P,I as $}from"./InlineSpinner-C1rIyZdV.js";import{u as Q}from"./useLastLogLine-DZp6rrQD.js";import{u as X,V as Z,S as ee}from"./useCustomSizes-D_bDZyDU.js";import{c as te}from"./cy-logo-cli-DcX-ZS3p.js";const b=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],de=Y(function(){const{entity:i,scenario:s,analysis:r,projectSlug:m}=q(),u=G();J();const[ne,w]=l.useState(null),[_,N]=l.useState(1440),[a,g]=l.useState({name:"Desktop",width:1440,height:900}),[z,p]=l.useState(!1),[f,B]=l.useState(null),{customSizes:S,addCustomSize:D}=X(m),x=l.useMemo(()=>[...b,...S],[S]),{interactiveServerUrl:y,isStarting:k,isLoading:C,showIframe:I,iframeKey:W,onIframeLoad:E}=O({analysisId:r==null?void 0:r.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:!0}),{lastLine:h}=Q(m,k||C),U=()=>{u(`/entity/${i.sha}`)},V=(t,n)=>{N(t);const o=x.find(M=>M.width===t&&M.height===n);w(o||null),g({name:(o==null?void 0:o.name)||"Custom",width:t,height:n})},L=t=>{w(t),N(t.width),g({name:t.name,width:t.width,height:t.height})},R=t=>{D(t,a.width,a.height??900),p(!1),g(n=>({...n,name:t}))},c=((r==null?void 0:r.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),H=d+1,T=c.length,v=d>0,j=d<c.length-1,A=()=>{if(v){const t=c[d-1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},F=()=>{if(j){const t=c[d+1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},K=k||C||!I;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:te,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:A,disabled:!v,className:`${v?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[H,"/",T]}),e.jsx("button",{onClick:F,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:U,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${b[b.length-1].width}px`,width:"100%"},children:e.jsx(Z,{currentViewportWidth:_,currentPresetName:a.name,onDevicePresetClick:L,devicePresets:x,hideLabel:!0,onHoverChange:B,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(f==null?void 0:f.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=x.find(o=>o.name===t.target.value);n&&L(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[x.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&V(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>p(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
2
- linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
- linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
- linear-gradient(45deg, transparent 75%, #ebebeb 75%),
5
- linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
6
- `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:y?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${a.width}px`,maxHeight:`${a.height}px`},children:[K&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),e.jsx("iframe",{src:y,className:"w-full h-full border-none",title:`Interactive preview: ${s==null?void 0:s.name}`,onLoad:E,style:{opacity:I?1:0}},W)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),z&&e.jsx(ee,{width:a.width,height:a.height??900,onSave:R,onCancel:()=>p(!1)})]})});export{de as default};
@@ -1,6 +0,0 @@
1
- import{r as a,j as e,w as Z,u as ee,a as te,L as v}from"./chunk-JZWAC4HX-7VptmeIr.js";import{W as se,u as re,I as ae}from"./InteractivePreview-rE_fI2h2.js";import{u as ne}from"./InlineSpinner-C1rIyZdV.js";import{c as oe}from"./executionFlowCoverage-BWhdfn70.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-DZp6rrQD.js";function ie({executionFlows:t,selections:r,onChange:n,disabled:i=!1}){const x=a.useCallback(s=>r.some(o=>o.flowId===s),[r]),p=a.useCallback(s=>{x(s.id)?n(r.filter(o=>o.flowId!==s.id)):n([...r,{flowId:s.id,flowName:s.name}])},[r,n,x]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No execution flows found."}):e.jsx("div",{className:"space-y-3",children:t.map(s=>{const o=x(s.id),I=s.usedInScenarios.length>0;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(s),disabled:i,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:s.name}),!I&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"uncovered"}),s.blocksOtherFlows&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-100 text-purple-700 rounded",children:"blocking"}),s.impact==="high"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-100 text-red-700 rounded",children:"high impact"})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:s.description})]})]}),o&&s.requiredValues.length>0&&e.jsxs("div",{className:"ml-6 mt-2 p-2 bg-gray-50 rounded text-xs",children:[e.jsx("span",{className:"text-gray-700 font-medium",children:"Required values:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:s.requiredValues.map((h,E)=>e.jsxs("li",{className:"text-gray-600",children:[e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.attributePath})," ",e.jsx("span",{className:"text-gray-400",children:h.comparison})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.value})]},E))})]})]},s.id)})})}const he=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function ce(){var W;const{analysis:t,defaultScenario:r,entity:n,entitySha:i,projectSlug:x}=ee(),p=te(),{iframeRef:s}=re(),[o,I]=a.useState(""),[h,E]=a.useState(400),[b,P]=a.useState(!1),[U,R]=a.useState(!1),[G,$]=a.useState(!1),[M,L]=a.useState(null),[F,l]=a.useState(null),[d,H]=a.useState([]),D=a.useMemo(()=>{var c;return!((c=t==null?void 0:t.metadata)!=null&&c.executionFlows)||!(t!=null&&t.scenarios)?[]:oe(t.metadata.executionFlows,t.scenarios).executionFlows},[t]),{interactiveServerUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V}=ne({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),Y=a.useCallback(async()=>{var m,c,T,z;if(!o.trim()&&d.length===0){L("Please describe how you want to change the scenario or select execution flows");return}R(!0),L(null),l("Generating scenario with AI...");try{const u=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o,existingScenarios:t.scenarios,scenariosDataStructure:(m=t.metadata)==null?void 0:m.scenariosDataStructure,flowSelections:d.length>0?d:void 0})}),N=await u.json();if(!u.ok||!N.success)throw new Error(N.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",N.data);const g=N.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),$(!0);const X={name:g.name,description:g.description||o,metadata:{data:g.data,interactiveExamplePath:(c=r.metadata)==null?void 0:c.interactiveExamplePath}},Q=[...t.scenarios||[],X],O=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:Q})}),C=await O.json();if(!O.ok||!C.success)throw new Error(C.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",C);const f=(z=(T=C.analysis)==null?void 0:T.scenarios)==null?void 0:z.find(k=>k.name===g.name);if(!(f!=null&&f.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void p(`/entity/${i}`),1e3);return}if(y){l("Capturing screenshot...");const k=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:y,scenarioId:f.id,projectId:t.projectId,viewportWidth:1440})}),A=await k.json();!k.ok||!A.success?(console.error("[CreateScenario] Capture failed:",A),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{p(`/entity/${i}/scenarios/${f.id}`)},1e3)}catch(u){console.error("[CreateScenario] Error:",u),L(u instanceof Error?u.message:String(u)),l(null)}finally{R(!1),$(!1)}},[o,d,t,r,i,y,p]),j=U||G,K=a.useCallback(()=>{P(!0)},[]),w=a.useCallback(m=>{if(!b)return;const c=m.clientX;c>=250&&c<=600&&E(c)},[b]),S=a.useCallback(()=>{P(!1)},[]);return a.useEffect(()=>(b?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}),[b,w,S]),e.jsxs("div",{className:"h-screen bg-white flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-end h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 pb-[14px]",children:[e.jsx("button",{onClick:()=>void p(`/entity/${i}`),className:"no-underline shrink-0 bg-transparent border-none cursor-pointer p-0 flex items-center",title:"Back",children:e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h1",{className:"text-base font-semibold text-black m-0 leading-[20px] shrink-0",children:n==null?void 0:n.name}),e.jsx("span",{className:"text-xs text-[#9e9e9e] font-mono font-normal whitespace-nowrap overflow-hidden text-ellipsis min-w-0",title:n==null?void 0:n.filePath,children:n==null?void 0:n.filePath})]}),e.jsxs("div",{className:"flex items-end gap-8 shrink-0",children:[e.jsx(v,{to:`/entity/${i}/scenarios`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-medium border-b-2",style:{color:"#005C75",borderColor:"#005C75"},children:e.jsxs("span",{className:"flex items-center gap-2",children:["Scenarios",e.jsx("span",{className:"inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full bg-[#cbf3fa] text-[#005c75]",children:((W=t==null?void 0:t.scenarios)==null?void 0:W.length)||0})]})}),e.jsx(v,{to:`/entity/${i}/related`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Related Entities"}),e.jsx(v,{to:`/entity/${i}/code`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Code"}),e.jsx(v,{to:`/entity/${i}/data`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Data Structure"}),e.jsx(v,{to:`/entity/${i}/history`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"History"})]})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0 relative",children:[e.jsxs("aside",{className:"bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",style:{width:`${h}px`},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select execution flows and/or describe how you'd like to change it."})]}),D.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Execution Flows"," ",d.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",d.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ie,{executionFlows:D,selections:d,onChange:H,disabled:j})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"Describe your scenario"}),e.jsx("textarea",{id:"prompt",value:o,onChange:m=>I(m.target.value),placeholder:"e.g., Show an empty state with no items...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>void Y(),disabled:j||!o.trim()&&d.length===0,className:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium cursor-pointer transition-colors hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:j?"Creating...":"Create Scenario"}),F&&e.jsx("div",{className:"text-xs text-blue-600 bg-blue-50 px-2 py-1.5 rounded",children:F}),M&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded",children:M})]})]}),e.jsxs("div",{onMouseDown:K,style:{width:"20px",position:"absolute",top:0,left:`${h-10}px`,bottom:0,cursor:"col-resize",touchAction:"none",userSelect:"none",zIndex:100,pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",left:"10px",top:0,bottom:0,width:"1px",background:b?"#005c75":"rgba(0,0,0,0.1)",transition:"background 0.15s ease"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"10px",transform:"translate(-50%, -50%)",width:"8px",height:"40px",background:"#fff",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",cursor:"col-resize"}})]}),e.jsx("main",{className:"flex-1 overflow-auto flex items-center justify-center min-w-0",style:{backgroundImage:`
2
- linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
- linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
- linear-gradient(45deg, transparent 75%, #ebebeb 75%),
5
- linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
6
- `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:e.jsx(ae,{scenarioId:r.id||r.name,scenarioName:r.name,iframeUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V,projectSlug:x,defaultWidth:1440,defaultHeight:900})})]})]})}const ge=Z(function(){return e.jsx(se,{children:e.jsx(ce,{})})});export{ge as default,he as meta};
@@ -1,15 +0,0 @@
1
- var un=Object.defineProperty;var hn=(e,t,n)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var G=(e,t,n)=>hn(e,typeof t!="symbol"?t+"":t,n);import{r as R,c as $t,H as pn,j as l,w as mn,u as gn,b as xn}from"./chunk-JZWAC4HX-7VptmeIr.js";import{u as yn}from"./useReportContext-BsQb6rFd.js";import{F as Vt,b as zt,E as Pt,S as Gt,u as vn,C as bn,a as wn}from"./EntityItem-DlMph_Hm.js";import{L as Cn}from"./LogViewer-CMK8Q7yk.js";import{g as Ht}from"./fileTableUtils-EWpfFU4X.js";import"./createLucideIcon-D-QUFOwe.js";import"./useToast-BOur3mUv.js";import"./TruncatedFilePath-D7IoaWUW.js";import"./SafeScreenshot-CG2uh31y.js";import"./LibraryFunctionPreview-CnatsCw2.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-DTf3Jojp.js";import"./EntityTypeIcon-DN9eiJAO.js";import"./EntityTypeBadge-B-0PjGOU.js";function Nn(e,t,n=10){var c;const r=new Map,i=d=>d.entityType==="visual"||d.entityType==="library";for(const d of e)i(d)&&r.set(d.sha,{entity:d,depth:0});const s=new Map;for(const d of t){const f=(c=d.metadata)==null?void 0:c.importedBy;if(f)for(const u of Object.keys(f))for(const h of Object.keys(f[u])){const{shas:b}=f[u][h];for(const g of b)s.has(d.sha)||s.set(d.sha,new Set),s.get(d.sha).add(g)}}const o=[],a=new Set;for(const d of e)o.push({sha:d.sha,depth:0}),a.add(d.sha);for(;o.length>0;){const{sha:d,depth:f}=o.shift();if(f>=n)continue;const u=s.get(d);if(u)for(const h of u){if(a.has(h))continue;a.add(h);const b=t.find(g=>g.sha===h);if(b){if(i(b)){const g=f+1,p=r.get(h);(!p||g<p.depth)&&r.set(h,{entity:b,depth:g})}o.push({sha:h,depth:f+1})}}}return Array.from(r.values()).sort((d,f)=>d.depth!==f.depth?d.depth-f.depth:d.entity.name.localeCompare(f.entity.name))}function Le(e){const t=new Map;for(const r of e)t.has(r.name)||t.set(r.name,[]),t.get(r.name).push(r);const n=[];for(const r of t.values())if(r.length===1)n.push(r[0]);else{const i=r.sort((s,o)=>{var d,f;const a=((d=s.metadata)==null?void 0:d.editedAt)||s.createdAt||"";return(((f=o.metadata)==null?void 0:f.editedAt)||o.createdAt||"").localeCompare(a)});n.push(i[0])}return n}function jn(e,t){const n=new Map,r=new Set(e.map(i=>i.path));for(const i of e)i.status==="renamed"&&i.oldPath&&r.add(i.oldPath);for(const i of e){const s=t.filter(c=>c.filePath===i.path||i.status==="renamed"&&i.oldPath&&c.filePath===i.oldPath),o=s.filter(c=>{var d,f;return r.has(c.filePath)&&((d=c.metadata)==null?void 0:d.isUncommitted)&&!((f=c.metadata)!=null&&f.isSuperseded)}),a=Le(o);n.set(i.path,{status:i,entities:s,editedEntities:a})}return n}function Sn(e,t,n){const r=new Map;if(!n){for(const s of e)if(s.status==="deleted")r.set(s.path,{status:s,entities:[]});else{const o=t.filter(c=>c.filePath===s.path||s.status==="renamed"&&s.oldPath&&c.filePath===s.oldPath),a=Le(o);r.set(s.path,{status:s,entities:a})}return r}const i=new Map;for(const s of n.fileComparisons){const o=new Set;for(const a of s.newEntities)o.add(a.name);for(const a of s.modifiedEntities)o.add(a.name);for(const a of s.deletedEntities)o.add(a.name);o.size>0&&i.set(s.filePath,o)}for(const s of e){const o=i.get(s.path);if(s.status==="deleted")r.set(s.path,{status:s,entities:[]});else{const a=o?t.filter(d=>(d.filePath===s.path||s.status==="renamed"&&s.oldPath&&d.filePath===s.oldPath)&&o.has(d.name)):[],c=Le(a);r.set(s.path,{status:s,entities:c})}}return r}function kn(e,t){const n=new Map,r=Ln(e,t);for(const i of r){const o=Nn([i],t).filter(({depth:a})=>a>0);n.set(i.sha,o)}return n}function Ln(e,t){const n=new Set(e.map(i=>i.path));for(const i of e)i.status==="renamed"&&i.oldPath&&n.add(i.oldPath);const r=t.filter(i=>{var s,o;return n.has(i.filePath)&&((s=i.metadata)==null?void 0:s.isUncommitted)&&!((o=i.metadata)!=null&&o.isSuperseded)});return Le(r)}function An(e,t,n){const[r,i]=R.useState(()=>new Set),[s,o]=R.useState(()=>new Set),a=R.useRef([]),c=R.useRef([]);return R.useEffect(()=>{(t.length!==a.current.length||t.some((p,C)=>p!==a.current[C]))&&(a.current=t,i(p=>{const C=new Set;return t.forEach(w=>{p.has(w)&&C.add(w)}),C}))},[t]),R.useEffect(()=>{(n.length!==c.current.length||n.some((p,C)=>p!==c.current[C]))&&(c.current=n,o(p=>{const C=new Set;return n.forEach(w=>{p.has(w)&&C.add(w)}),C}))},[n]),{expandedUncommitted:r,expandedBranch:s,setExpandedUncommitted:i,setExpandedBranch:o,toggleFile:(g,p,C)=>{C(w=>{const N=new Set(w);return N.has(g)?N.delete(g):N.add(g),N})},expandAllUncommitted:()=>{i(new Set(t))},collapseAllUncommitted:()=>{i(new Set)},expandAllBranch:()=>{o(new Set(n))},collapseAllBranch:()=>{o(new Set)}}}function En(e,t,n){const[r,i]=R.useState(null),[s,o]=R.useState(null),a=$t();R.useEffect(()=>{var u,h;((u=a.data)==null?void 0:u.oldContent)!==void 0&&((h=a.data)==null?void 0:h.newContent)!==void 0&&o({oldContent:a.data.oldContent,newContent:a.data.newContent,fileName:a.data.fileName})},[a.data]);const c=u=>{i({type:"file",path:u}),o(null);const h=new FormData;h.append("actionType","getDiff"),h.append("filePath",u),h.append("diffType","branch"),h.append("baseBranch",e),h.append("currentBranch",t||""),a.submit(h,{method:"post"})},d=(u,h)=>{i({type:"entity",path:u,entitySha:h}),o(null);const b=new FormData;b.append("actionType","getDiff"),b.append("filePath",u),b.append("diffType","branch"),b.append("baseBranch",e),b.append("currentBranch",t||""),b.append("entitySha",h),a.submit(b,{method:"post"})},f=()=>{i(null),o(null)};return{diffView:r,diffContent:s,isLoading:a.state==="loading"||a.state==="submitting",handleShowFileDiff:c,handleShowEntityDiff:d,handleCloseDiff:f}}var Ge={exports:{}};/*!
2
- Copyright (c) 2018 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
5
- */var pt;function Bn(){return pt||(pt=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ge)),Ge.exports}var Fn=Bn();const U=pn(Fn);var mt=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Tn(e,t){return!!(e===t||mt(e)&&mt(t))}function Dn(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Tn(e[n],t[n]))return!1;return!0}function Mn(e,t){t===void 0&&(t=Dn);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}function Rn(e,t,n){let r=0,i;const s={},o=[];return e.forEach((a,c)=>{const d=t.some(f=>f>=c-n&&f<=c+n);!d&&i===void 0?(i={index:r,startLine:c,endLine:c,lines:1},o.push(i),s[c]=i.index,r++):!d&&i?(i.endLine=c,i.lines++,s[c]=i.index):i=void 0}),{lineBlocks:s,blocks:o}}function X(){}X.prototype={diff:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.callback;typeof i=="function"&&(s=i,i={}),this.options=i;var o=this;function a(x){return s?(setTimeout(function(){s(void 0,x)},0),!0):x}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var c=n.length,d=t.length,f=1,u=c+d;i.maxEditLength&&(u=Math.min(u,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,b=Date.now()+h,g=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(g[0],n,t,0);if(g[0].oldPos+1>=d&&p+1>=c)return a([{value:this.join(n),count:n.length}]);var C=-1/0,w=1/0;function N(){for(var x=Math.max(C,-f);x<=Math.min(w,f);x+=2){var v=void 0,y=g[x-1],m=g[x+1];y&&(g[x-1]=void 0);var A=!1;if(m){var E=m.oldPos-x;A=m&&0<=E&&E<c}var B=y&&y.oldPos+1<d;if(!A&&!B){g[x]=void 0;continue}if(!B||A&&y.oldPos+1<m.oldPos?v=o.addToPath(m,!0,void 0,0):v=o.addToPath(y,void 0,!0,1),p=o.extractCommon(v,n,t,x),v.oldPos+1>=d&&p+1>=c)return a(On(o,v.lastComponent,n,t,o.useLongestToken));g[x]=v,v.oldPos+1>=d&&(w=Math.min(w,x-1)),p+1>=c&&(C=Math.max(C,x+1))}f++}if(s)(function x(){setTimeout(function(){if(f>u||Date.now()>b)return s();N()||x()},0)})();else for(;f<=u&&Date.now()<=b;){var j=N();if(j)return j}},addToPath:function(t,n,r,i){var s=t.lastComponent;return s&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}},extractCommon:function(t,n,r,i){for(var s=n.length,o=r.length,a=t.oldPos,c=a-i,d=0;c+1<s&&a+1<o&&this.equals(n[c+1],r[a+1]);)c++,a++,d++;return d&&(t.lastComponent={count:d,previousComponent:t.lastComponent}),t.oldPos=a,c},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function On(e,t,n,r,i){for(var s=[],o;t;)s.push(t),o=t.previousComponent,delete t.previousComponent,t=o;s.reverse();for(var a=0,c=s.length,d=0,f=0;a<c;a++){var u=s[a];if(u.removed){if(u.value=e.join(r.slice(f,f+u.count)),f+=u.count,a&&s[a-1].added){var b=s[a-1];s[a-1]=s[a],s[a]=b}}else{if(!u.added&&i){var h=n.slice(d,d+u.count);h=h.map(function(p,C){var w=r[f+C];return w.length>p.length?w:p}),u.value=e.join(h)}else u.value=e.join(n.slice(d,d+u.count));d+=u.count,u.added||(f+=u.count)}}var g=s[c-1];return c>1&&typeof g.value=="string"&&(g.added||g.removed)&&e.equals("",g.value)&&(s[c-2].value+=g.value,s.pop()),s}var In=new X;function $n(e,t,n){return In.diff(e,t,n)}function Wt(e,t){if(typeof e=="function")t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var gt=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,xt=/\S/,Te=new X;Te.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!xt.test(e)&&!xt.test(t)};Te.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&gt.test(t[n])&&gt.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function Vn(e,t,n){return n=Wt(n,{ignoreWhitespace:!0}),Te.diff(e,t,n)}function zn(e,t,n){return Te.diff(e,t,n)}var De=new X;De.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
6
- `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function Ye(e,t,n){return De.diff(e,t,n)}function Pn(e,t,n){var r=Wt(n,{ignoreWhitespace:!0});return De.diff(e,t,r)}var Ut=new X;Ut.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};function Gn(e,t,n){return Ut.diff(e,t,n)}var qt=new X;qt.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Hn(e,t,n){return qt.diff(e,t,n)}function Ne(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ne=function(t){return typeof t}:Ne=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yt(Object(n),!0).forEach(function(r){Wn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ee(e){return Un(e)||qn(e)||Zn(e)||Jn()}function Un(e){if(Array.isArray(e))return Ue(e)}function qn(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Zn(e,t){if(e){if(typeof e=="string")return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}}function Ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
7
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _n=Object.prototype.toString,fe=new X;fe.useLongestToken=!0;fe.tokenize=De.tokenize;fe.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(s,o){return typeof o>"u"?n:o}:r;return typeof e=="string"?e:JSON.stringify(Ae(e,null,null,i),i," ")};fe.equals=function(e,t){return X.prototype.equals.call(fe,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Zt(e,t,n){return fe.diff(e,t,n)}function Ae(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(_n.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ae(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Ne(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],c;for(c in e)e.hasOwnProperty(c)&&a.push(c);for(a.sort(),s=0;s<a.length;s+=1)c=a[s],o[c]=Ae(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var Ee=new X;Ee.tokenize=function(e){return e.slice()};Ee.join=Ee.removeEmpty=function(e){return e};function Yn(e,t,n){return Ee.diff(e,t,n)}function Me(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),r=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],i=[],s=0;function o(){var d={};for(i.push(d);s<n.length;){var f=n[s];if(/^(\-\-\-|\+\+\+|@@)\s/.test(f))break;var u=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(f);u&&(d.index=u[1]),s++}for(a(d),a(d),d.hunks=[];s<n.length;){var h=n[s];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(h))break;if(/^@@/.test(h))d.hunks.push(c());else{if(h&&t.strict)throw new Error("Unknown line "+(s+1)+" "+JSON.stringify(h));s++}}}function a(d){var f=/^(---|\+\+\+)\s+(.*)$/.exec(n[s]);if(f){var u=f[1]==="---"?"old":"new",h=f[2].split(" ",2),b=h[0].replace(/\\\\/g,"\\");/^".*"$/.test(b)&&(b=b.substr(1,b.length-2)),d[u+"FileName"]=b,d[u+"Header"]=(h[1]||"").trim(),s++}}function c(){var d=s,f=n[s++],u=f.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),h={oldStart:+u[1],oldLines:typeof u[2]>"u"?1:+u[2],newStart:+u[3],newLines:typeof u[4]>"u"?1:+u[4],lines:[],linedelimiters:[]};h.oldLines===0&&(h.oldStart+=1),h.newLines===0&&(h.newStart+=1);for(var b=0,g=0;s<n.length&&!(n[s].indexOf("--- ")===0&&s+2<n.length&&n[s+1].indexOf("+++ ")===0&&n[s+2].indexOf("@@")===0);s++){var p=n[s].length==0&&s!=n.length-1?" ":n[s][0];if(p==="+"||p==="-"||p===" "||p==="\\")h.lines.push(n[s]),h.linedelimiters.push(r[s]||`
8
- `),p==="+"?b++:p==="-"?g++:p===" "&&(b++,g++);else break}if(!b&&h.newLines===1&&(h.newLines=0),!g&&h.oldLines===1&&(h.oldLines=0),t.strict){if(b!==h.newLines)throw new Error("Added line count did not match for hunk at line "+(d+1));if(g!==h.oldLines)throw new Error("Removed line count did not match for hunk at line "+(d+1))}return h}for(;s<n.length;)o();return i}function Xn(e,t,n){var r=!0,i=!1,s=!1,o=1;return function a(){if(r&&!s){if(i?o++:r=!1,e+o<=n)return o;s=!0}if(!i)return s||(r=!0),t<=e-o?-o++:(i=!0,a())}}function Jt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string"&&(t=Me(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var r=e.split(/\r\n|[\n\v\f\r\x85]/),i=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=t.hunks,o=n.compareLine||function(I,V,te,Z){return V===Z},a=0,c=n.fuzzFactor||0,d=0,f=0,u,h;function b(I,V){for(var te=0;te<I.lines.length;te++){var Z=I.lines[te],se=Z.length>0?Z[0]:" ",ae=Z.length>0?Z.substr(1):Z;if(se===" "||se==="-"){if(!o(V+1,r[V],se,ae)&&(a++,a>c))return!1;V++}}return!0}for(var g=0;g<s.length;g++){for(var p=s[g],C=r.length-p.oldLines,w=0,N=f+p.oldStart-1,j=Xn(N,d,C);w!==void 0;w=j())if(b(p,N+w)){p.offset=f+=w;break}if(w===void 0)return!1;d=p.offset+p.oldStart+p.oldLines}for(var x=0,v=0;v<s.length;v++){var y=s[v],m=y.oldStart+y.offset+x-1;x+=y.newLines-y.oldLines;for(var A=0;A<y.lines.length;A++){var E=y.lines[A],B=E.length>0?E[0]:" ",T=E.length>0?E.substr(1):E,F=y.linedelimiters&&y.linedelimiters[A]||`
9
- `;if(B===" ")m++;else if(B==="-")r.splice(m,1),i.splice(m,1);else if(B==="+")r.splice(m,0,T),i.splice(m,0,F),m++;else if(B==="\\"){var k=y.lines[A-1]?y.lines[A-1][0]:null;k==="+"?u=!0:k==="-"&&(h=!0)}}}if(u)for(;!r[r.length-1];)r.pop(),i.pop();else h&&(r.push(""),i.push(`
10
- `));for(var S=0;S<r.length-1;S++)r[S]=r[S]+i[S];return r.join("")}function Kn(e,t){typeof e=="string"&&(e=Me(e));var n=0;function r(){var i=e[n++];if(!i)return t.complete();t.loadFile(i,function(s,o){if(s)return t.complete(s);var a=Jt(o,i,t);t.patched(i,a,function(c){if(c)return t.complete(c);r()})})}r()}function Xe(e,t,n,r,i,s,o){o||(o={}),typeof o.context>"u"&&(o.context=4);var a=Ye(n,r,o);if(!a)return;a.push({value:"",lines:[]});function c(w){return w.map(function(N){return" "+N})}for(var d=[],f=0,u=0,h=[],b=1,g=1,p=function(N){var j=a[N],x=j.lines||j.value.replace(/\n$/,"").split(`
11
- `);if(j.lines=x,j.added||j.removed){var v;if(!f){var y=a[N-1];f=b,u=g,y&&(h=o.context>0?c(y.lines.slice(-o.context)):[],f-=h.length,u-=h.length)}(v=h).push.apply(v,ee(x.map(function(S){return(j.added?"+":"-")+S}))),j.added?g+=x.length:b+=x.length}else{if(f)if(x.length<=o.context*2&&N<a.length-2){var m;(m=h).push.apply(m,ee(c(x)))}else{var A,E=Math.min(x.length,o.context);(A=h).push.apply(A,ee(c(x.slice(0,E))));var B={oldStart:f,oldLines:b-f+E,newStart:u,newLines:g-u+E,lines:h};if(N>=a.length-2&&x.length<=o.context){var T=/\n$/.test(n),F=/\n$/.test(r),k=x.length==0&&h.length>B.oldLines;!T&&k&&n.length>0&&h.splice(B.oldLines,0,"\"),(!T&&!k||!F)&&h.push("\")}d.push(B),f=0,u=0,h=[]}b+=x.length,g+=x.length}},C=0;C<a.length;C++)p(C);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:d}}function Ke(e){if(Array.isArray(e))return e.map(Ke).join(`
12
- `);var t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),t.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader));for(var n=0;n<e.hunks.length;n++){var r=e.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),t.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@"),t.push.apply(t,r.lines)}return t.join(`
13
- `)+`
14
- `}function _t(e,t,n,r,i,s,o){return Ke(Xe(e,t,n,r,i,s,o))}function Qn(e,t,n,r,i,s){return _t(e,e,t,n,r,i,s)}function er(e,t){return e.length!==t.length?!1:qe(e,t)}function qe(e,t){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function tr(e){var t=Ze(e.lines),n=t.oldLines,r=t.newLines;n!==void 0?e.oldLines=n:delete e.oldLines,r!==void 0?e.newLines=r:delete e.newLines}function nr(e,t,n){e=bt(e,n),t=bt(t,n);var r={};(e.index||t.index)&&(r.index=e.index||t.index),(e.newFileName||t.newFileName)&&(wt(e)?wt(t)?(r.oldFileName=we(r,e.oldFileName,t.oldFileName),r.newFileName=we(r,e.newFileName,t.newFileName),r.oldHeader=we(r,e.oldHeader,t.oldHeader),r.newHeader=we(r,e.newHeader,t.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=t.oldFileName||e.oldFileName,r.newFileName=t.newFileName||e.newFileName,r.oldHeader=t.oldHeader||e.oldHeader,r.newHeader=t.newHeader||e.newHeader)),r.hunks=[];for(var i=0,s=0,o=0,a=0;i<e.hunks.length||s<t.hunks.length;){var c=e.hunks[i]||{oldStart:1/0},d=t.hunks[s]||{oldStart:1/0};if(Ct(c,d))r.hunks.push(Nt(c,o)),i++,a+=c.newLines-c.oldLines;else if(Ct(d,c))r.hunks.push(Nt(d,a)),s++,o+=d.newLines-d.oldLines;else{var f={oldStart:Math.min(c.oldStart,d.oldStart),oldLines:0,newStart:Math.min(c.newStart+o,d.oldStart+a),newLines:0,lines:[]};rr(f,c.oldStart,c.lines,d.oldStart,d.lines),s++,i++,r.hunks.push(f)}}return r}function bt(e,t){if(typeof e=="string"){if(/^@@/m.test(e)||/^Index:/m.test(e))return Me(e)[0];if(!t)throw new Error("Must provide a base reference or pass in a patch");return Xe(void 0,void 0,t,e)}return e}function wt(e){return e.newFileName&&e.newFileName!==e.oldFileName}function we(e,t,n){return t===n?t:(e.conflict=!0,{mine:t,theirs:n})}function Ct(e,t){return e.oldStart<t.oldStart&&e.oldStart+e.oldLines<t.oldStart}function Nt(e,t){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+t,newLines:e.newLines,lines:e.lines}}function rr(e,t,n,r,i){var s={offset:t,lines:n,index:0},o={offset:r,lines:i,index:0};for(St(e,s,o),St(e,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],c=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(c[0]==="-"||c[0]==="+"))sr(e,s,o);else if(a[0]==="+"&&c[0]===" "){var d;(d=e.lines).push.apply(d,ee(oe(s)))}else if(c[0]==="+"&&a[0]===" "){var f;(f=e.lines).push.apply(f,ee(oe(o)))}else a[0]==="-"&&c[0]===" "?jt(e,s,o):c[0]==="-"&&a[0]===" "?jt(e,o,s,!0):a===c?(e.lines.push(a),s.index++,o.index++):Qe(e,oe(s),oe(o))}kt(e,s),kt(e,o),tr(e)}function sr(e,t,n){var r=oe(t),i=oe(n);if(Lt(r)&&Lt(i)){if(qe(r,i)&&At(n,r,r.length-i.length)){var s;(s=e.lines).push.apply(s,ee(r));return}else if(qe(i,r)&&At(t,i,i.length-r.length)){var o;(o=e.lines).push.apply(o,ee(i));return}}else if(er(r,i)){var a;(a=e.lines).push.apply(a,ee(r));return}Qe(e,r,i)}function jt(e,t,n,r){var i=oe(t),s=ir(n,i);if(s.merged){var o;(o=e.lines).push.apply(o,ee(s.merged))}else Qe(e,r?s:i,r?i:s)}function Qe(e,t,n){e.conflict=!0,e.lines.push({conflict:!0,mine:t,theirs:n})}function St(e,t,n){for(;t.offset<n.offset&&t.index<t.lines.length;){var r=t.lines[t.index++];e.lines.push(r),t.offset++}}function kt(e,t){for(;t.index<t.lines.length;){var n=t.lines[t.index++];e.lines.push(n)}}function oe(e){for(var t=[],n=e.lines[e.index][0];e.index<e.lines.length;){var r=e.lines[e.index];if(n==="-"&&r[0]==="+"&&(n="+"),n===r[0])t.push(r),e.index++;else break}return t}function ir(e,t){for(var n=[],r=[],i=0,s=!1,o=!1;i<t.length&&e.index<e.lines.length;){var a=e.lines[e.index],c=t[i];if(c[0]==="+")break;if(s=s||a[0]!==" ",r.push(c),i++,a[0]==="+")for(o=!0;a[0]==="+";)n.push(a),a=e.lines[++e.index];c.substr(1)===a.substr(1)?(n.push(a),e.index++):o=!0}if((t[i]||"")[0]==="+"&&s&&(o=!0),o)return n;for(;i<t.length;)r.push(t[i++]);return{merged:r,changes:n}}function Lt(e){return e.reduce(function(t,n){return t&&n[0]==="-"},!0)}function At(e,t,n){for(var r=0;r<n;r++){var i=t[t.length-n+r].substr(1);if(e.lines[e.index+r]!==" "+i)return!1}return e.index+=n,!0}function Ze(e){var t=0,n=0;return e.forEach(function(r){if(typeof r!="string"){var i=Ze(r.mine),s=Ze(r.theirs);t!==void 0&&(i.oldLines===s.oldLines?t+=i.oldLines:t=void 0),n!==void 0&&(i.newLines===s.newLines?n+=i.newLines:n=void 0)}else n!==void 0&&(r[0]==="+"||r[0]===" ")&&n++,t!==void 0&&(r[0]==="-"||r[0]===" ")&&t++}),{oldLines:t,newLines:n}}function Yt(e){return Array.isArray(e)?e.map(Yt).reverse():vt(vt({},e),{},{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(function(t){return{oldLines:t.newLines,oldStart:t.newStart,newLines:t.oldLines,newStart:t.oldStart,linedelimiters:t.linedelimiters,lines:t.lines.map(function(n){return n.startsWith("-")?"+".concat(n.slice(1)):n.startsWith("+")?"-".concat(n.slice(1)):n})}})})}function or(e){for(var t=[],n,r,i=0;i<e.length;i++)n=e[i],n.added?r=1:n.removed?r=-1:r=0,t.push([r,n.value]);return t}function ar(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(lr(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function lr(e){var t=e;return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t=t.replace(/"/g,"&quot;"),t}const cr=Object.freeze(Object.defineProperty({__proto__:null,Diff:X,applyPatch:Jt,applyPatches:Kn,canonicalize:Ae,convertChangesToDMP:or,convertChangesToXML:ar,createPatch:Qn,createTwoFilesPatch:_t,diffArrays:Yn,diffChars:$n,diffCss:Hn,diffJson:Zt,diffLines:Ye,diffSentences:Gn,diffTrimmedLines:Pn,diffWords:Vn,diffWordsWithSpace:zn,formatPatch:Ke,merge:nr,parsePatch:Me,reversePatch:Yt,structuredPatch:Xe},Symbol.toStringTag,{value:"Module"})),dr=cr;var O;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ADDED=1]="ADDED",e[e.REMOVED=2]="REMOVED",e[e.CHANGED=3]="CHANGED"})(O||(O={}));var ue;(function(e){e.CHARS="diffChars",e.WORDS="diffWords",e.WORDS_WITH_SPACE="diffWordsWithSpace",e.LINES="diffLines",e.TRIMMED_LINES="diffTrimmedLines",e.SENTENCES="diffSentences",e.CSS="diffCss",e.JSON="diffJson"})(ue||(ue={}));const Et=e=>e===""?[]:e.replace(/\n$/,"").split(`
15
- `),fr=(e,t,n=ue.CHARS)=>{const i=(typeof n=="string"?dr[n]:n)(e,t),s={left:[],right:[]};return i.forEach(({added:o,removed:a,value:c})=>{const d={};return o&&(d.type=O.ADDED,d.value=c,s.right.push(d)),a&&(d.type=O.REMOVED,d.value=c,s.left.push(d)),!a&&!o&&(d.type=O.DEFAULT,d.value=c,s.right.push(d),s.left.push(d)),d}),s},ur=(e,t,n=!1,r=ue.CHARS,i=0,s=[])=>{let o=[];typeof e=="string"&&typeof t=="string"?o=Ye(e,t,{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):o=Zt(e,t);let a=i,c=i,d=[],f=0;const u=[],h=[],b=(g,p,C,w,N)=>Et(g).map((x,v)=>{const y={},m={};if(!(h.includes(`${p}-${v}`)||N&&v!==0)){if(C||w){let A=!0;if(w){c+=1,y.lineNumber=c,y.type=O.REMOVED,y.value=x||" ";const E=o[p+1];if(E!=null&&E.added){const B=Et(E.value)[v];if(B){const T=b(B,p,!0,!1,!0),{value:F,lineNumber:k,type:S}=T[0].right;if(h.push(`${p+1}-${v}`),m.lineNumber=k,y.value===F)A=!1,m.type=0,y.type=0,m.value=F;else if(m.type=S,n)m.value=F;else{const I=fr(x,F,r);m.value=I.right,y.value=I.left}}}}else a+=1,m.lineNumber=a,m.type=O.ADDED,m.value=x;A&&!N&&(u.includes(f)||u.push(f))}else c+=1,a+=1,y.lineNumber=c,y.type=O.DEFAULT,y.value=x,m.lineNumber=a,m.type=O.DEFAULT,m.value=x;return(s!=null&&s.includes(`L-${y.lineNumber}`)||s!=null&&s.includes(`R-${m.lineNumber}`)&&!u.includes(f))&&u.push(f),N||(f+=1),{right:m,left:y}}}).filter(Boolean);return o.forEach(({added:g,removed:p,value:C},w)=>{d=[...d,...b(C,w,g,p)]}),{lineInformation:d,diffLines:u}};function hr(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[l.jsx("title",{children:"expand"}),l.jsx("path",{d:"m8.177.677 2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25a.75.75 0 0 1-1.5 0V4H5.104a.25.25 0 0 1-.177-.427L7.823.677a.25.25 0 0 1 .354 0ZM7.25 10.75a.75.75 0 0 1 1.5 0V12h2.146a.25.25 0 0 1 .177.427l-2.896 2.896a.25.25 0 0 1-.354 0l-2.896-2.896A.25.25 0 0 1 5.104 12H7.25v-1.25Zm-5-2a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}function pr(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function mr(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var gr=(function(){function e(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(mr(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=pr(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e})(),P="-ms-",Be="-moz-",D="-webkit-",Xt="comm",et="rule",tt="decl",xr="@import",Kt="@keyframes",yr="@layer",vr=Math.abs,Re=String.fromCharCode,br=Object.assign;function wr(e,t){return z(e,0)^45?(((t<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3):0}function Qt(e){return e.trim()}function Cr(e,t){return(e=t.exec(e))?e[0]:e}function M(e,t,n){return e.replace(t,n)}function Je(e,t){return e.indexOf(t)}function z(e,t){return e.charCodeAt(t)|0}function ge(e,t,n){return e.slice(t,n)}function _(e){return e.length}function nt(e){return e.length}function Ce(e,t){return t.push(e),e}function Nr(e,t){return e.map(t).join("")}var Oe=1,he=1,en=0,W=0,$=0,pe="";function Ie(e,t,n,r,i,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:Oe,column:he,length:o,return:""}}function me(e,t){return br(Ie("",null,null,"",null,null,0),e,{length:-e.length},t)}function jr(){return $}function Sr(){return $=W>0?z(pe,--W):0,he--,$===10&&(he=1,Oe--),$}function q(){return $=W<en?z(pe,W++):0,he++,$===10&&(he=1,Oe++),$}function Y(){return z(pe,W)}function je(){return W}function ye(e,t){return ge(pe,e,t)}function xe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tn(e){return Oe=he=1,en=_(pe=e),W=0,[]}function nn(e){return pe="",e}function Se(e){return Qt(ye(W-1,_e(e===91?e+2:e===40?e+1:e)))}function kr(e){for(;($=Y())&&$<33;)q();return xe(e)>2||xe($)>3?"":" "}function Lr(e,t){for(;--t&&q()&&!($<48||$>102||$>57&&$<65||$>70&&$<97););return ye(e,je()+(t<6&&Y()==32&&q()==32))}function _e(e){for(;q();)switch($){case e:return W;case 34:case 39:e!==34&&e!==39&&_e($);break;case 40:e===41&&_e(e);break;case 92:q();break}return W}function Ar(e,t){for(;q()&&e+$!==57;)if(e+$===84&&Y()===47)break;return"/*"+ye(t,W-1)+"*"+Re(e===47?e:q())}function Er(e){for(;!xe(Y());)q();return ye(e,W)}function Br(e){return nn(ke("",null,null,null,[""],e=tn(e),0,[0],e))}function ke(e,t,n,r,i,s,o,a,c){for(var d=0,f=0,u=o,h=0,b=0,g=0,p=1,C=1,w=1,N=0,j="",x=i,v=s,y=r,m=j;C;)switch(g=N,N=q()){case 40:if(g!=108&&z(m,u-1)==58){Je(m+=M(Se(N),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:m+=Se(N);break;case 9:case 10:case 13:case 32:m+=kr(g);break;case 92:m+=Lr(je()-1,7);continue;case 47:switch(Y()){case 42:case 47:Ce(Fr(Ar(q(),je()),t,n),c);break;default:m+="/"}break;case 123*p:a[d++]=_(m)*w;case 125*p:case 59:case 0:switch(N){case 0:case 125:C=0;case 59+f:w==-1&&(m=M(m,/\f/g,"")),b>0&&_(m)-u&&Ce(b>32?Ft(m+";",r,n,u-1):Ft(M(m," ","")+";",r,n,u-2),c);break;case 59:m+=";";default:if(Ce(y=Bt(m,t,n,d,f,i,a,j,x=[],v=[],u),s),N===123)if(f===0)ke(m,t,y,y,x,s,u,a,v);else switch(h===99&&z(m,3)===110?100:h){case 100:case 108:case 109:case 115:ke(e,y,y,r&&Ce(Bt(e,y,y,0,0,i,a,j,i,x=[],u),v),i,v,u,a,r?x:v);break;default:ke(m,y,y,y,[""],v,0,a,v)}}d=f=b=0,p=w=1,j=m="",u=o;break;case 58:u=1+_(m),b=g;default:if(p<1){if(N==123)--p;else if(N==125&&p++==0&&Sr()==125)continue}switch(m+=Re(N),N*p){case 38:w=f>0?1:(m+="\f",-1);break;case 44:a[d++]=(_(m)-1)*w,w=1;break;case 64:Y()===45&&(m+=Se(q())),h=Y(),f=u=_(j=m+=Er(je())),N++;break;case 45:g===45&&_(m)==2&&(p=0)}}return s}function Bt(e,t,n,r,i,s,o,a,c,d,f){for(var u=i-1,h=i===0?s:[""],b=nt(h),g=0,p=0,C=0;g<r;++g)for(var w=0,N=ge(e,u+1,u=vr(p=o[g])),j=e;w<b;++w)(j=Qt(p>0?h[w]+" "+N:M(N,/&\f/g,h[w])))&&(c[C++]=j);return Ie(e,t,n,i===0?et:a,c,d,f)}function Fr(e,t,n){return Ie(e,t,n,Xt,Re(jr()),ge(e,2,-2),0)}function Ft(e,t,n,r){return Ie(e,t,n,tt,ge(e,0,r),ge(e,r+1,-1),r)}function de(e,t){for(var n="",r=nt(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Tr(e,t,n,r){switch(e.type){case yr:if(e.children.length)break;case xr:case tt:return e.return=e.return||e.value;case Xt:return"";case Kt:return e.return=e.value+"{"+de(e.children,r)+"}";case et:e.value=e.props.join(",")}return _(n=de(e.children,r))?e.return=e.value+"{"+n+"}":""}function Dr(e){var t=nt(e);return function(n,r,i,s){for(var o="",a=0;a<t;a++)o+=e[a](n,r,i,s)||"";return o}}function Mr(e){return function(t){t.root||(t=t.return)&&e(t)}}function Rr(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Or=function(t,n,r){for(var i=0,s=0;i=s,s=Y(),i===38&&s===12&&(n[r]=1),!xe(s);)q();return ye(t,W)},Ir=function(t,n){var r=-1,i=44;do switch(xe(i)){case 0:i===38&&Y()===12&&(n[r]=1),t[r]+=Or(W-1,n,r);break;case 2:t[r]+=Se(i);break;case 4:if(i===44){t[++r]=Y()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Re(i)}while(i=q());return t},$r=function(t,n){return nn(Ir(tn(t),n))},Tt=new WeakMap,Vr=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Tt.get(r))&&!i){Tt.set(t,!0);for(var s=[],o=$r(n,s),a=r.props,c=0,d=0;c<o.length;c++)for(var f=0;f<a.length;f++,d++)t.props[d]=s[c]?o[c].replace(/&\f/g,a[f]):a[f]+" "+o[c]}}},zr=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function rn(e,t){switch(wr(e,t)){case 5103:return D+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return D+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return D+e+Be+e+P+e+e;case 6828:case 4268:return D+e+P+e+e;case 6165:return D+e+P+"flex-"+e+e;case 5187:return D+e+M(e,/(\w+).+(:[^]+)/,D+"box-$1$2"+P+"flex-$1$2")+e;case 5443:return D+e+P+"flex-item-"+M(e,/flex-|-self/,"")+e;case 4675:return D+e+P+"flex-line-pack"+M(e,/align-content|flex-|-self/,"")+e;case 5548:return D+e+P+M(e,"shrink","negative")+e;case 5292:return D+e+P+M(e,"basis","preferred-size")+e;case 6060:return D+"box-"+M(e,"-grow","")+D+e+P+M(e,"grow","positive")+e;case 4554:return D+M(e,/([^-])(transform)/g,"$1"+D+"$2")+e;case 6187:return M(M(M(e,/(zoom-|grab)/,D+"$1"),/(image-set)/,D+"$1"),e,"")+e;case 5495:case 3959:return M(e,/(image-set\([^]*)/,D+"$1$`$1");case 4968:return M(M(e,/(.+:)(flex-)?(.*)/,D+"box-pack:$3"+P+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+D+e+e;case 4095:case 3583:case 4068:case 2532:return M(e,/(.+)-inline(.+)/,D+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_(e)-1-t>6)switch(z(e,t+1)){case 109:if(z(e,t+4)!==45)break;case 102:return M(e,/(.+:)(.+)-([^]+)/,"$1"+D+"$2-$3$1"+Be+(z(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Je(e,"stretch")?rn(M(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(z(e,t+1)!==115)break;case 6444:switch(z(e,_(e)-3-(~Je(e,"!important")&&10))){case 107:return M(e,":",":"+D)+e;case 101:return M(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+D+(z(e,14)===45?"inline-":"")+"box$3$1"+D+"$2$3$1"+P+"$2box$3")+e}break;case 5936:switch(z(e,t+11)){case 114:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return D+e+P+e+e}return e}var Pr=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case tt:t.return=rn(t.value,t.length);break;case Kt:return de([me(t,{value:M(t.value,"@","@"+D)})],i);case et:if(t.length)return Nr(t.props,function(s){switch(Cr(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return de([me(t,{props:[M(s,/:(read-\w+)/,":"+Be+"$1")]})],i);case"::placeholder":return de([me(t,{props:[M(s,/:(plac\w+)/,":"+D+"input-$1")]}),me(t,{props:[M(s,/:(plac\w+)/,":"+Be+"$1")]}),me(t,{props:[M(s,/:(plac\w+)/,P+"input-$1")]})],i)}return""})}},Gr=[Pr],Hr=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var C=p.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||Gr,s={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var C=p.getAttribute("data-emotion").split(" "),w=1;w<C.length;w++)s[C[w]]=!0;a.push(p)});var c,d=[Vr,zr];{var f,u=[Tr,Mr(function(p){f.insert(p)})],h=Dr(d.concat(i,u)),b=function(C){return de(Br(C),h)};c=function(C,w,N,j){f=N,b(C?C+"{"+w.styles+"}":w.styles),j&&(g.inserted[w.name]=!0)}}var g={key:n,sheet:new gr({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:c};return g.sheet.hydrate(a),g};function Wr(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ur={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},qr=/[A-Z]|^ms/g,Zr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sn=function(t){return t.charCodeAt(1)===45},Dt=function(t){return t!=null&&typeof t!="boolean"},He=Rr(function(e){return sn(e)?e:e.replace(qr,"-$&").toLowerCase()}),Mt=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Zr,function(r,i,s){return re={name:i,styles:s,next:re},i})}return Ur[t]!==1&&!sn(t)&&typeof n=="number"&&n!==0?n+"px":n};function Fe(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return re={name:i.name,styles:i.styles,next:re},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)re={name:o.name,styles:o.styles,next:re},o=o.next;var a=s.styles+";";return a}return Jr(e,t,n)}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function Jr(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Fe(e,t,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=s+"{"+t[a]+"}":Dt(a)&&(r+=He(s)+":"+Mt(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Dt(o[c])&&(r+=He(s)+":"+Mt(s,o[c])+";");else{var d=Fe(e,t,o);switch(s){case"animation":case"animationName":{r+=He(s)+":"+d+";";break}default:r+=s+"{"+d+"}"}}}return r}var Rt=/label:\s*([^\s;{]+)\s*(;|$)/g,re;function We(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";re=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,i+=Fe(n,t,s);else{var o=s;i+=o[0]}for(var a=1;a<e.length;a++)if(i+=Fe(n,t,e[a]),r){var c=s;i+=c[a]}Rt.lastIndex=0;for(var d="",f;(f=Rt.exec(i))!==null;)d+="-"+f[1];var u=Wr(i)+d;return{name:u,styles:i,next:re}}function on(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var _r=function(t,n,r){var i=t.key+"-"+n.name;t.registered[i]===void 0&&(t.registered[i]=n.styles)},Yr=function(t,n,r){_r(t,n);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+i:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function Ot(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function It(e,t,n){var r=[],i=on(e,r,n);return r.length<2?n:i+t(r)}var Xr=function(t){var n=Hr(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered,void 0);return Yr(n,u),n.key+"-"+u.name},i=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered),h="animation-"+u.name;return Ot(n,{name:u.name,styles:"@keyframes "+h+"{"+u.styles+"}"}),h},s=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered);Ot(n,u)},o=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return It(n.registered,r,Kr(d))};return{css:r,cx:o,injectGlobal:s,keyframes:i,hydrate:function(c){c.forEach(function(d){n.inserted[d]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:on.bind(null,n.registered),merge:It.bind(null,n.registered,r)}},Kr=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(i!=null){var s=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))s=e(i);else{s="";for(var o in i)i[o]&&o&&(s&&(s+=" "),s+=o)}break}default:s=i}s&&(n&&(n+=" "),n+=s)}}return n};const Qr=(e,t=!1,n="")=>{const{variables:r={},...i}=e,s={light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",changedBackground:"#fffbdd",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",codeFoldGutterBackground:"#dbedff",codeFoldBackground:"#f1f8ff",emptyLineBackground:"#fafbfc",gutterColor:"#212529",addedGutterColor:"#212529",removedGutterColor:"#212529",codeFoldContentColor:"#212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleColor:"#212529",diffViewerTitleBorderColor:"#eee",...r.light||{}},dark:{diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",addedBackground:"#044B53",addedColor:"white",removedBackground:"#632F34",removedColor:"white",changedBackground:"#3e302c",wordAddedBackground:"#055d67",wordRemovedBackground:"#7d383f",addedGutterBackground:"#034148",removedGutterBackground:"#632b30",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",codeFoldGutterBackground:"#262831",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#757a9b",diffViewerTitleBorderColor:"#353846",...r.dark||{}}},o=t?s.dark:s.light,{css:a,cx:c}=Xr({key:"react-diff",nonce:n}),d=a({width:"auto",label:"content"}),f=a({label:"split-view"}),u=a({background:o.diffViewerTitleBackground,color:o.diffViewerTitleColor,padding:"0.5em 1em",display:"flex",alignItems:"center",gap:"0.5em",fontFamily:"monospace",fill:o.diffViewerTitleColor}),h=a({width:"100%",minWidth:"1000px",overflowX:"auto",tableLayout:"fixed",background:o.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"1.6em",width:"fit-content"},label:"diff-container",borderCollapse:"collapse"}),b=a({overflow:"hidden",width:"100%"}),g=a({color:o.diffViewerColor,whiteSpace:"pre-wrap",fontFamily:"monospace",lineBreak:"anywhere",textDecoration:"none",label:"content-text"}),p=a({userSelect:"none",label:"unselectable"}),C=a({background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",margin:0,label:"all-expand-button",":hover":{fill:o.addedGutterColor},":focus":{outline:`1px ${o.addedGutterColor} solid`}}),w=a({background:o.diffViewerTitleBackground,padding:"0.5em",lineHeight:"1.4em",height:"2.4em",overflow:"hidden",width:"50%",borderBottom:`1px solid ${o.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${o.diffViewerTitleBorderColor}`},[`.${g}`]:{color:o.diffViewerTitleColor}}),N=a({color:o.gutterColor,label:"line-number"}),j=a({background:o.removedBackground,color:o.removedColor,pre:{color:o.removedColor},[`.${N}`]:{color:o.removedGutterColor},label:"diff-removed"}),x=a({background:o.addedBackground,color:o.addedColor,pre:{color:o.addedColor},[`.${N}`]:{color:o.addedGutterColor},label:"diff-added"}),v=a({background:o.changedBackground,[`.${N}`]:{color:o.gutterColor},label:"diff-changed"}),y=a({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),m=a({background:o.wordAddedBackground,textDecoration:"none",label:"word-added"}),A=a({background:o.wordRemovedBackground,textDecoration:"none",label:"word-removed"}),E=a({backgroundColor:o.codeFoldGutterBackground,label:"code-fold-gutter",minWidth:"50px",width:"50px"}),B=a({padding:""}),T=a({background:o.codeFoldBackground,cursor:"pointer",display:"inline",margin:0,border:"none",label:"code-fold-expand-button"}),F=a({color:o.codeFoldContentColor,fontFamily:"monospace",label:"code-fold-content"}),k=a({display:"block",width:"10px",height:"10px",backgroundColor:"#ddd",borderWidth:"1px",borderStyle:"solid",borderColor:o.diffViewerTitleBorderColor}),S=a({backgroundColor:o.wordAddedBackground}),I=a({backgroundColor:o.wordRemovedBackground}),V=a({backgroundColor:o.codeFoldBackground,height:40,fontSize:14,alignItems:"center",userSelect:"none",fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),te=a({backgroundColor:o.emptyLineBackground,label:"empty-line"}),Z=a({width:28,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${x}`]:{pre:{color:o.addedColor}},[`&.${j}`]:{pre:{color:o.removedColor}}}),se=a({background:o.highlightBackground,label:"highlighted-line",[`.${m}, .${A}`]:{backgroundColor:"initial"}}),ae=a({label:"highlighted-gutter"}),$e=a({userSelect:"none",minWidth:50,width:"50px",padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:o.gutterBackground,"&:hover":{cursor:"pointer",background:o.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${x}`]:{background:o.addedGutterBackground},[`&.${j}`]:{background:o.removedGutterBackground},[`&.${ae}`]:{background:o.highlightGutterBackground,"&:hover":{background:o.highlightGutterBackground}}}),Ve=a({"&:hover":{background:o.gutterBackground,cursor:"initial"},label:"empty-gutter"}),ne=a({verticalAlign:"baseline",label:"line",textDecoration:"none"}),ve=a({}),ie={diffContainer:h,diffRemoved:j,diffAdded:x,diffChanged:v,splitView:f,marker:Z,highlightedGutter:ae,highlightedLine:se,gutter:$e,line:ne,lineContent:b,wordDiff:y,wordAdded:m,summary:u,block:k,blockAddition:S,blockDeletion:I,wordRemoved:A,noSelect:p,codeFoldGutter:E,codeFoldExpandButton:T,codeFoldContentContainer:B,codeFold:V,emptyGutter:Ve,emptyLine:te,lineNumber:N,contentText:g,content:d,column:ve,codeFoldContent:F,titleBlock:w,allExpandButton:C},le=Object.keys(i).reduce((ce,J)=>({...ce,[J]:a(i[J])}),{});return Object.keys(ie).reduce((ce,J)=>({...ce,[J]:le[J]?c(ie[J],le[J]):ie[J]}),{})};function es(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[l.jsx("title",{children:"fold"}),l.jsx("path",{d:"M10.896 2H8.75V.75a.75.75 0 0 0-1.5 0V2H5.104a.25.25 0 0 0-.177.427l2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 2ZM8.75 15.25a.75.75 0 0 1-1.5 0V14H5.104a.25.25 0 0 1-.177-.427l2.896-2.896a.25.25 0 0 1 .354 0l2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25Zm-6.5-6.5a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}var H;(function(e){e.LEFT="L",e.RIGHT="R"})(H||(H={}));class an extends R.Component{constructor(n){super(n);G(this,"styles");G(this,"resetCodeBlocks",()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1);G(this,"onBlockExpand",n=>{const r=this.state.expandedBlocks.slice();r.push(n),this.setState({expandedBlocks:r})});G(this,"computeStyles",Mn(Qr));G(this,"onLineNumberClickProxy",n=>this.props.onLineNumberClick?r=>this.props.onLineNumberClick(n,r):()=>{});G(this,"renderWordDiff",(n,r)=>n.map((i,s)=>{const o=r?r(i.value):typeof i.value=="string"?i.value:void 0;return i.type===O.ADDED?l.jsx("ins",{className:U(this.styles.wordDiff,{[this.styles.wordAdded]:i.type===O.ADDED}),children:o},s):i.type===O.REMOVED?l.jsx("del",{className:U(this.styles.wordDiff,{[this.styles.wordRemoved]:i.type===O.REMOVED}),children:o},s):l.jsx("span",{className:U(this.styles.wordDiff),children:o},s)}));G(this,"renderLine",(n,r,i,s,o,a)=>{const c=`${i}-${n}`,d=`${a}-${o}`,f=this.props.highlightLines.includes(c)||this.props.highlightLines.includes(d),u=r===O.ADDED,h=r===O.REMOVED,b=r===O.CHANGED;let g;const p=Array.isArray(s);p?g=this.renderWordDiff(s,this.props.renderContent):this.props.renderContent?g=this.props.renderContent(s):g=s;let C="div";return u&&!p?C="ins":h&&!p&&(C="del"),l.jsxs(l.Fragment,{children:[!this.props.hideLineNumbers&&l.jsx("td",{onClick:n&&this.onLineNumberClickProxy(c),className:U(this.styles.gutter,{[this.styles.emptyGutter]:!n,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedGutter]:f}),children:l.jsx("pre",{className:this.styles.lineNumber,children:n})}),!this.props.splitView&&!this.props.hideLineNumbers&&l.jsx("td",{onClick:o&&this.onLineNumberClickProxy(d),className:U(this.styles.gutter,{[this.styles.emptyGutter]:!o,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedGutter]:f}),children:l.jsx("pre",{className:this.styles.lineNumber,children:o})}),this.props.renderGutter?this.props.renderGutter({lineNumber:n,type:r,prefix:i,value:s,additionalLineNumber:o,additionalPrefix:a,styles:this.styles}):null,l.jsx("td",{className:U(this.styles.marker,{[this.styles.emptyLine]:!g,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedLine]:f}),children:l.jsxs("pre",{children:[u&&"+",h&&"-"]})}),l.jsx("td",{className:U(this.styles.content,{[this.styles.emptyLine]:!g,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedLine]:f,left:i===H.LEFT,right:i===H.RIGHT}),onMouseDown:()=>{const w=document.getElementsByClassName(i===H.LEFT?"right":"left");for(let N=0;N<w.length;N++)w.item(N).classList.add(this.styles.noSelect)},title:u&&!p?"Added line":h&&!p?"Removed line":void 0,children:l.jsx(C,{className:this.styles.contentText,children:g})})]})});G(this,"renderSplitView",({left:n,right:r},i)=>l.jsxs("tr",{className:this.styles.line,children:[this.renderLine(n.lineNumber,n.type,H.LEFT,n.value),this.renderLine(r.lineNumber,r.type,H.RIGHT,r.value)]},i));G(this,"renderInlineView",({left:n,right:r},i)=>{let s;return n.type===O.REMOVED&&r.type===O.ADDED?l.jsxs(R.Fragment,{children:[l.jsx("tr",{className:this.styles.line,children:this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,null)}),l.jsx("tr",{className:this.styles.line,children:this.renderLine(null,r.type,H.RIGHT,r.value,r.lineNumber,H.RIGHT)})]},i):(n.type===O.REMOVED&&(s=this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,null)),n.type===O.DEFAULT&&(s=this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,r.lineNumber,H.RIGHT)),r.type===O.ADDED&&(s=this.renderLine(null,r.type,H.RIGHT,r.value,r.lineNumber)),l.jsx("tr",{className:this.styles.line,children:s},i))});G(this,"onBlockClickProxy",n=>()=>this.onBlockExpand(n));G(this,"renderSkippedLineIndicator",(n,r,i,s)=>{const{hideLineNumbers:o,splitView:a}=this.props,c=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(n,i,s):l.jsxs("span",{className:this.styles.codeFoldContent,children:["Expand ",n," lines ..."]}),d=l.jsx("td",{className:this.styles.codeFoldContentContainer,children:l.jsx("button",{type:"button",className:this.styles.codeFoldExpandButton,onClick:this.onBlockClickProxy(r),tabIndex:0,children:c})}),f=!a&&!o;return l.jsxs("tr",{className:this.styles.codeFold,children:[!o&&l.jsx("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?l.jsx("td",{className:this.styles.codeFoldGutter}):null,l.jsx("td",{className:U({[this.styles.codeFoldGutter]:f})}),f?l.jsxs(R.Fragment,{children:[l.jsx("td",{}),d]}):l.jsxs(R.Fragment,{children:[d,this.props.renderGutter?l.jsx("td",{}):null,l.jsx("td",{}),l.jsx("td",{}),o?null:l.jsx("td",{})]})]},`${i}-${s}`)});G(this,"renderDiff",()=>{const{oldValue:n,newValue:r,splitView:i,disableWordDiff:s,compareMethod:o,linesOffset:a}=this.props,{lineInformation:c,diffLines:d}=ur(n,r,s,o,a,this.props.alwaysShowLines),f=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:u,blocks:h}=Rn(c,d,f);return{diffNodes:c.map((g,p)=>{if(this.props.showDiffOnly){const C=u[p];if(C!==void 0){const w=h[C].endLine===p;if(!this.state.expandedBlocks.includes(C)&&w)return l.jsx(R.Fragment,{children:this.renderSkippedLineIndicator(h[C].lines,C,g.left.lineNumber,g.right.lineNumber)},p);if(!this.state.expandedBlocks.includes(C))return null}}return i?this.renderSplitView(g,p):this.renderInlineView(g,p)}),blocks:h,lineInformation:c}});G(this,"render",()=>{const{oldValue:n,newValue:r,useDarkTheme:i,leftTitle:s,rightTitle:o,splitView:a,compareMethod:c,hideLineNumbers:d,nonce:f}=this.props;if(typeof c=="string"&&c!==ue.JSON&&(typeof n!="string"||typeof r!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,i,f);const u=this.renderDiff();let h=3,b=4;d&&(h-=1,b-=1),this.props.renderGutter&&(h+=1,b+=1);let g=0,p=0;for(const x of u.lineInformation)x.left.type===O.ADDED&&p++,x.right.type===O.ADDED&&p++,x.left.type===O.REMOVED&&g++,x.right.type===O.REMOVED&&g++;const C=g+p,w=Math.round(p/C*100),N=[];for(let x=0;x<5;x++)w>x*20?N.push(l.jsx("span",{className:U(this.styles.block,this.styles.blockAddition)},x)):N.push(l.jsx("span",{className:U(this.styles.block,this.styles.blockDeletion)},x));const j=this.state.expandedBlocks.length===u.blocks.length;return l.jsxs("div",{children:[l.jsxs("div",{className:this.styles.summary,role:"banner",children:[l.jsx("button",{type:"button",className:this.styles.allExpandButton,onClick:()=>{this.setState({expandedBlocks:j?[]:u.blocks.map(x=>x.index)})},children:j?l.jsx(es,{}):l.jsx(hr,{})})," ",C,l.jsx("div",{style:{display:"flex",gap:"1px"},children:N}),this.props.summary?l.jsx("span",{children:this.props.summary}):null]}),l.jsx("table",{className:U(this.styles.diffContainer,{[this.styles.splitView]:a}),onMouseUp:()=>{const x=document.getElementsByClassName("right");for(let y=0;y<x.length;y++)x.item(y).classList.remove(this.styles.noSelect);const v=document.getElementsByClassName("left");for(let y=0;y<v.length;y++)v.item(y).classList.remove(this.styles.noSelect)},children:l.jsxs("tbody",{children:[l.jsxs("tr",{children:[this.props.hideLineNumbers?null:l.jsx("td",{width:"50px"}),!a&&!this.props.hideLineNumbers?l.jsx("td",{width:"50px"}):null,this.props.renderGutter?l.jsx("td",{width:"50px"}):null,l.jsx("td",{width:"28px"}),l.jsx("td",{width:"100%"}),a?l.jsxs(l.Fragment,{children:[this.props.hideLineNumbers?null:l.jsx("td",{width:"50px"}),this.props.renderGutter?l.jsx("td",{width:"50px"}):null,l.jsx("td",{width:"28px"}),l.jsx("td",{width:"100%"})]}):null]}),s||o?l.jsxs("tr",{children:[l.jsx("th",{colSpan:a?h:b,className:U(this.styles.titleBlock,this.styles.column),children:s?l.jsx("pre",{className:this.styles.contentText,children:s}):null}),a?l.jsx("th",{colSpan:h,className:U(this.styles.titleBlock,this.styles.column),children:o?l.jsx("pre",{className:this.styles.contentText,children:o}):null}):null]}):null,u.diffNodes]})})]})});this.state={expandedBlocks:[],noSelect:void 0}}}G(an,"defaultProps",{oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:ue.CHARS,styles:{},hideLineNumbers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""});function ts({diffView:e,diffContent:t,isLoading:n,entities:r,onClose:i}){var d;const[s,o]=R.useState(!1),[a,c]=R.useState(!1);return R.useEffect(()=>{c(!0)},[]),l.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-8 z-50",children:l.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-6xl w-full max-h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"p-6 border-b border-[#e1e1e1] flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"font-['IBM_Plex_Sans'] text-2xl font-semibold text-[#232323]",children:e.type==="file"?"File Diff":"Entity Diff"}),l.jsx("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e] mt-1",children:e.path}),e.type==="entity"&&e.entitySha&&l.jsxs("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e]",children:["Entity:"," ",((d=r.find(f=>f.sha===e.entitySha))==null?void 0:d.name)||e.entitySha]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:()=>o(!s),className:"px-3 py-1.5 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] text-sm font-semibold hover:bg-[#e1e1e1] transition-colors cursor-pointer",title:s?"Show changes only":"Show full file",children:s?"Show Changes Only":"Show Full File"}),l.jsx("button",{onClick:i,className:"text-[#8e8e8e] hover:text-[#626262] transition-colors cursor-pointer",children:l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:n?l.jsx("div",{className:"p-6 text-center",children:l.jsx("div",{className:"text-[#8e8e8e]",children:"Loading diff..."})}):t?l.jsx("div",{className:"diff-viewer-wrapper",children:a&&l.jsx(an,{oldValue:t.oldContent,newValue:t.newContent,splitView:!0,useDarkTheme:!1,showDiffOnly:!s,extraLinesSurroundingDiff:4,styles:{variables:{light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f6f8fa",gutterBackgroundDark:"#f3f4f6",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1"}},contentText:{fontSize:"12px",lineHeight:"1.5"},line:{padding:"2px 10px",fontSize:"12px","&:hover":{background:"#f8f9fa"}},splitView:{display:"flex",width:"100%"},diffContainer:{width:"50%",overflowX:"auto"}}})}):l.jsx("div",{className:"p-6 text-center",children:l.jsx("div",{className:"text-[#8e8e8e]",children:"No diff available"})})}),l.jsx("div",{className:"p-6 border-t border-[#e1e1e1] flex justify-end gap-3",children:l.jsx("button",{onClick:i,className:"px-4 py-2 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] font-semibold hover:bg-[#e1e1e1] transition-colors cursor-pointer",children:"Close"})})]})})}function ns({files:e,currentBranch:t,defaultBranch:n,baseBranch:r,allBranches:i,expandedFiles:s,isEntityBeingAnalyzed:o,isEntityQueued:a,sortOrder:c,onToggleFile:d,onBranchChange:f,onGenerateSimulation:u,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}){const C=e.flatMap(([j,{entities:x}])=>{const v=x.filter(y=>o(y.sha)||a(y)).map(y=>y.sha);return v.length>0?[{entityShas:v}]:[]}),w=j=>{const x=j.map(v=>Ht(v,C));return x.includes("analyzing")||x.includes("queued")?"analyzing":x.includes("out-of-date")?"out-of-date":x.includes("not-analyzed")?"not-analyzed":"up-to-date"},N=R.useMemo(()=>[...e].sort((j,x)=>{const v=j[1].entities.reduce((E,B)=>{var F;const T=((F=B.metadata)==null?void 0:F.editedAt)||B.updatedAt;return T?E?new Date(T)>new Date(E)?T:E:T:E},null),y=x[1].entities.reduce((E,B)=>{var F;const T=((F=B.metadata)==null?void 0:F.editedAt)||B.updatedAt;return T?E?new Date(T)>new Date(E)?T:E:T:E},null);if(!v&&!y)return 0;if(!v)return 1;if(!y)return-1;const m=new Date(v).getTime(),A=new Date(y).getTime();return c==="desc"?A-m:m-A}),[e,c]);return l.jsx("div",{children:e.length>0?l.jsxs("div",{children:[l.jsx(Vt,{showActions:!0,sortOrder:c,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}),l.jsx("div",{className:"flex flex-col gap-[3px]",children:N.map(([j,{status:x,entities:v,isUncommitted:y}])=>{const m=s.has(j),A=w(v),E=v.reduce((k,S)=>{var V;const I=((V=S.metadata)==null?void 0:V.editedAt)||S.updatedAt;return I?k?new Date(I)>new Date(k)?I:k:I:k},null),T=v.filter(k=>k.entityType==="visual"||k.entityType==="library").length===0;let F;return T?F=l.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"}):A==="analyzing"?F=l.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):A==="up-to-date"?F=l.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):A==="out-of-date"?F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!o(S.sha)&&!a(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):A==="not-analyzed"&&(F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!o(S.sha)&&!a(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Analyze File"})),l.jsx(zt,{filePath:j,isExpanded:m,onToggle:()=>d(j),fileStatus:x,isUncommitted:y,simulationPreviews:l.jsx(Gt,{entities:v,maxPreviews:1}),entityCount:v.length,state:A,lastModified:E,isNotAnalyzable:T,actionButton:F,children:v.sort((k,S)=>{const I=k.entityType==="visual"||k.entityType==="library",V=S.entityType==="visual"||S.entityType==="library";return I&&!V?-1:!I&&V?1:0}).map(k=>l.jsx(Pt,{entity:k,isActivelyAnalyzing:o(k.sha),isQueued:a(k),onGenerateSimulation:u},k.sha))},j)})})]}):l.jsxs("div",{className:"bg-[#efefef] rounded-[10px] flex flex-col items-center justify-center text-center",style:{height:"190px"},children:[l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-medium text-[16px] text-[#3e3e3e] leading-[24px] mb-2",children:"No Changes"}),l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-normal text-[14px] text-[#3e3e3e] leading-[18px]",children:"No files have been modified in this branch."})]})})}function rs({files:e,entityImpactMap:t,expandedFiles:n,isEntityBeingAnalyzed:r,isEntityQueued:i,projectSlug:s,baseBranch:o,currentBranch:a,sortOrder:c,onToggleFile:d,onShowFileDiff:f,onGenerateSimulation:u,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}){const C=R.useMemo(()=>{const j=[];return e.forEach(([x,{editedEntities:v}])=>{const y=v.filter(m=>r(m.sha)||i(m)).map(m=>m.sha);y.length>0&&j.push({entityShas:y})}),j},[e,r,i]),w=R.useMemo(()=>{const j=new Map;return e.forEach(([x,{editedEntities:v}])=>{const y=v.map(B=>Ht(B,C));let m;y.includes("analyzing")||y.includes("queued")?m="analyzing":y.includes("out-of-date")?m="out-of-date":y.includes("not-analyzed")?m="not-analyzed":m="up-to-date";const A=v.reduce((B,T)=>{var k;const F=((k=T.metadata)==null?void 0:k.editedAt)||T.updatedAt;return F&&(!B||new Date(F)>new Date(B))?F:B},null),E=v.filter(B=>B.entityType==="visual"||B.entityType==="library").length;j.set(x,{state:m,lastModified:A,analyzableCount:E})}),j},[e,C]),N=R.useMemo(()=>[...e].sort((j,x)=>{const v=w.get(j[0]),y=w.get(x[0]),m=v==null?void 0:v.lastModified,A=y==null?void 0:y.lastModified;if(!m&&!A)return 0;if(!m)return 1;if(!A)return-1;const E=new Date(m).getTime(),B=new Date(A).getTime();return c==="desc"?B-E:E-B}),[e,w,c]);return e.length===0?l.jsxs("div",{className:"bg-[#efefef] rounded-[10px] flex flex-col items-center justify-center text-center",style:{height:"190px"},children:[l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-medium text-[16px] text-[#3e3e3e] leading-[24px] mb-2",children:"No Uncommitted Changes"}),l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-normal text-[14px] text-[#3e3e3e] leading-[18px]",children:"If you edit a file in your project, it will show up here."})]}):l.jsxs("div",{children:[l.jsx(Vt,{showActions:!0,sortOrder:c,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}),l.jsx("div",{className:"flex flex-col gap-[3px]",children:N.map(([j,{status:x,editedEntities:v}])=>{const y=n.has(j),m=w.get(j),{state:A,lastModified:E,analyzableCount:B}=m,T=B===0;let F;return T?F=l.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"}):A==="analyzing"?F=l.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):A==="up-to-date"?F=l.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):A==="out-of-date"?F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!r(S.sha)&&!i(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):A==="not-analyzed"&&(F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!r(S.sha)&&!i(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Analyze File"})),l.jsx(zt,{filePath:j,isExpanded:y,onToggle:()=>d(j),fileStatus:x,simulationPreviews:l.jsx(Gt,{entities:v,maxPreviews:1}),entityCount:v.length,state:A,lastModified:E,isNotAnalyzable:T,isUncommitted:!0,actionButton:F,children:v.sort((k,S)=>{const I=k.entityType==="visual"||k.entityType==="library",V=S.entityType==="visual"||S.entityType==="library";return I&&!V?-1:!I&&V?1:0}).map(k=>l.jsx(Pt,{entity:k,isActivelyAnalyzing:r(k.sha),isQueued:i(k),onGenerateSimulation:u},k.sha))},j)})})]})}function ss({activeTab:e,onTabChange:t,uncommittedCount:n,branchCount:r}){return l.jsx("div",{className:"border-b border-gray-200",children:l.jsxs("nav",{className:"flex gap-8 items-center",children:[l.jsxs("button",{onClick:()=>t("branch"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="branch"?"text-primary-100":"text-gray-500 hover:text-gray-700"}`,children:[l.jsxs("span",{className:"flex items-center gap-2",children:["Branch Changes",r>0&&l.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="branch"?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:r})]}),e==="branch"&&l.jsx("span",{className:"absolute -bottom-px left-0 right-0 h-0.5 bg-primary-100"})]}),l.jsxs("button",{onClick:()=>t("uncommitted"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="uncommitted"?"text-primary-100":"text-gray-500 hover:text-gray-700"}`,children:[l.jsxs("span",{className:"flex items-center gap-2",children:["Uncommitted Changes",n>0&&l.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="uncommitted"?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:n})]}),e==="uncommitted"&&l.jsx("span",{className:"absolute -bottom-px left-0 right-0 h-0.5 bg-primary-100"})]})]})})}const bs=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],ws=mn(function(){var ft,ut;const{entities:t,gitStatus:n,currentBranch:r,actualCurrentBranch:i,defaultBranch:s,allBranches:o,baseBranch:a,branchDiff:c,currentCommit:d,projectSlug:f,queueState:u}=gn();yn({source:"git-page"});const[h,b]=xn(),[g,p]=R.useState(null),[C,w]=R.useState("desc"),[N,j]=R.useState("branch"),x=h.get("expanded")==="true",v=()=>{w(L=>L==="desc"?"asc":"desc")},y=$t(),m=y.data;R.useEffect(()=>{r&&a&&r!==a&&y.state==="idle"&&!m&&y.load(`/api/branch-entity-diff?base=${encodeURIComponent(a)}&compare=${encodeURIComponent(r)}`)},[r,a,y,m]);const A=R.useMemo(()=>{const L=jn(n,t);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[n,t]),E=R.useMemo(()=>{const L=Sn(c,t,m);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[c,t,m]),B=R.useMemo(()=>kn(n,t),[n,t]),T=R.useMemo(()=>N==="uncommitted"?A:E,[N,A,E]),F=R.useMemo(()=>T.map(([L])=>L),[T]),{expandedUncommitted:k,setExpandedUncommitted:S,toggleFile:I,expandAllUncommitted:V,collapseAllUncommitted:te}=An(x,F,[]),{diffView:Z,diffContent:se,isLoading:ae,handleShowFileDiff:$e,handleCloseDiff:Ve}=En(a,r),ne=(ft=d==null?void 0:d.metadata)==null?void 0:ft.currentRun,ve=new Set((ne==null?void 0:ne.currentEntityShas)||[]),ie=new Set(u.jobs.flatMap(L=>L.entityShas||[])),le=new Set(((ut=u.currentlyExecuting)==null?void 0:ut.entityShas)||[]),{isAnalyzing:ce,handleGenerateSimulation:J,handleGenerateAllSimulations:ln,isEntityBeingAnalyzed:rt,isEntityPending:st}=vn(ne==null?void 0:ne.currentEntityShas,u),it=L=>st(L)||ie.has(L.sha)||le.has(L.sha),cn=L=>{L===(i||r)?h.delete("viewBranch"):h.set("viewBranch",L),b(h)},ot=L=>{L===s?h.delete("compare"):h.set("compare",L),b(h)},at=()=>{const K=T.flatMap(([Q,ht])=>ht.editedEntities||ht.entities||[]).filter(Q=>!ve.has(Q.sha)&&!ie.has(Q.sha)&&!le.has(Q.sha)&&!st(Q));ln(K)},dn=A.length,fn=E.length,ze=T.flatMap(([L,K])=>K.editedEntities||K.entities||[]),be=ze.filter(L=>L.entityType==="visual"||L.entityType==="library"),Pe=be.length>0&&be.every(L=>ve.has(L.sha)),lt=be.length>0&&!Pe&&be.every(L=>ie.has(L.sha)||le.has(L.sha)),ct=ce||Pe||lt,dt=Pe?"Analyzing...":lt?"Queued...":ce?"Analyzing...":"Analyze All";return l.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:l.jsxs("div",{className:"px-20 py-12",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Git Changes"}),l.jsxs("p",{className:"text-[15px] text-gray-500",children:["This is a list of all the files that are affected by your local changes. ",l.jsx("strong",{children:"Analyze a file to get simulations."})]})]}),l.jsx("div",{className:"mb-6",children:l.jsx(ss,{activeTab:N,onTabChange:j,uncommittedCount:dn,branchCount:fn})}),r&&N==="branch"&&l.jsx("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:r===s?l.jsxs("div",{className:"text-gray-700",children:["You are currently on the primary branch,"," ",l.jsx("span",{className:"text-cyblack-75",children:s}),"."]}):l.jsxs("div",{className:"flex gap-6 items-center",children:[l.jsxs("div",{className:"shrink-0",children:[l.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Changes in Branch:"}),o.length>0?l.jsxs("div",{className:"relative w-50",children:[l.jsx("select",{value:r,onChange:L=>cn(L.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-2.5 pr-6 text-[13px] h-9.75 w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:o.map(L=>l.jsx("option",{value:L,children:L},L))}),l.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}):l.jsx("span",{className:"text-gray-900 font-medium text-[12px]",children:r})]}),l.jsxs("div",{className:"flex-shrink-0",children:[l.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Compared To:"}),l.jsxs("div",{className:"relative w-[200px]",children:[l.jsx("select",{value:a,onChange:L=>ot(L.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:o.filter(L=>L!==r).map(L=>l.jsx("option",{value:L,children:L},L))}),l.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),l.jsx("div",{className:"flex-1 mt-6",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("svg",{className:"absolute left-3 w-4 h-4 text-gray-400 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),l.jsx("input",{type:"text",placeholder:"Search component",className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})})]})}),l.jsx("div",{className:"mb-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx("span",{style:{color:"#000000"},children:T.length})," ","modified ",T.length===1?"file":"files"]}),l.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[l.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),l.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:l.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",l.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),l.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),l.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[l.jsx("span",{style:{color:"#000000"},children:ze.length})," ",ze.length===1?"entity":"entities"]})]}),T.length>0&&l.jsxs("div",{className:"flex gap-6",children:[l.jsxs("button",{onClick:V,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx(bn,{className:"w-3.5 h-3.5"}),"Expand All"]}),l.jsxs("button",{onClick:te,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx(wn,{className:"w-3.5 h-3.5"}),"Collapse All"]})]})]})}),l.jsxs("div",{className:"overflow-hidden",children:[N==="branch"&&r&&l.jsx(ns,{files:E,currentBranch:r,defaultBranch:s,baseBranch:a,allBranches:o,expandedFiles:k,isEntityBeingAnalyzed:rt,isEntityQueued:it,sortOrder:C,onToggleFile:L=>I(L,k,S),onBranchChange:ot,onGenerateSimulation:J,onSortChange:v,onAnalyzeAll:at,analyzeAllDisabled:ct,analyzeAllText:dt}),N==="uncommitted"&&l.jsx(rs,{files:A,entityImpactMap:B,expandedFiles:k,isEntityBeingAnalyzed:rt,isEntityQueued:it,projectSlug:f,baseBranch:a,currentBranch:r,sortOrder:C,onToggleFile:L=>I(L,k,S),onShowFileDiff:$e,onGenerateSimulation:J,onSortChange:v,onAnalyzeAll:at,analyzeAllDisabled:ct,analyzeAllText:dt})]}),Z&&l.jsx(ts,{diffView:Z,diffContent:se,isLoading:ae,entities:t,onClose:Ve}),g&&f&&l.jsx(Cn,{projectSlug:f,onClose:()=>p(null)})]})})});export{ws as default,bs as meta};