@codeyam/codeyam-cli 0.1.6 → 0.1.8

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 (398) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +6 -6
  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/analyze/src/lib/ProjectAnalyzer.ts +6 -0
  11. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +9 -1
  12. package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +0 -6
  13. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  14. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +65 -28
  15. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +83 -0
  16. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
  17. package/analyzer-template/packages/aws/package.json +1 -1
  18. package/analyzer-template/packages/database/index.ts +1 -0
  19. package/analyzer-template/packages/database/package.json +3 -3
  20. package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -0
  21. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +62 -0
  22. package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
  23. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
  24. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +151 -135
  25. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  26. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  27. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  28. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  29. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  30. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  31. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  32. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  33. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
  34. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  35. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +5 -0
  36. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  37. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +20 -0
  38. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  39. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
  40. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  41. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
  42. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  43. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  44. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
  45. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  46. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  47. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  48. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  49. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  50. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +100 -89
  51. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  52. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  53. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  54. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  55. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  56. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  57. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  58. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  59. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  60. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  61. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  62. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  63. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  64. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  65. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  66. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +10 -0
  67. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  68. package/analyzer-template/packages/github/package.json +1 -1
  69. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -0
  70. package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
  71. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  72. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  73. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +10 -0
  74. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  75. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  76. package/analyzer-template/project/constructMockCode.ts +136 -43
  77. package/analyzer-template/project/reconcileMockDataKeys.ts +19 -14
  78. package/analyzer-template/project/start.ts +3 -0
  79. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  80. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  81. package/analyzer-template/project/writeMockDataTsx.ts +17 -0
  82. package/analyzer-template/project/writeScenarioComponents.ts +36 -7
  83. package/analyzer-template/tsconfig.json +13 -1
  84. package/background/src/lib/virtualized/project/constructMockCode.js +115 -34
  85. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  86. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +17 -11
  87. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  88. package/background/src/lib/virtualized/project/start.js +2 -0
  89. package/background/src/lib/virtualized/project/start.js.map +1 -1
  90. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  91. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  92. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  93. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  94. package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -0
  95. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  96. package/background/src/lib/virtualized/project/writeScenarioComponents.js +29 -7
  97. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  98. package/codeyam-cli/scripts/apply-setup.js +208 -11
  99. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  100. package/codeyam-cli/src/cli.js +2 -0
  101. package/codeyam-cli/src/cli.js.map +1 -1
  102. package/codeyam-cli/src/commands/analyze.js +17 -7
  103. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  104. package/codeyam-cli/src/commands/default.js +58 -3
  105. package/codeyam-cli/src/commands/default.js.map +1 -1
  106. package/codeyam-cli/src/commands/editor.js +1839 -0
  107. package/codeyam-cli/src/commands/editor.js.map +1 -0
  108. package/codeyam-cli/src/commands/init.js +40 -11
  109. package/codeyam-cli/src/commands/init.js.map +1 -1
  110. package/codeyam-cli/src/commands/memory.js +26 -2
  111. package/codeyam-cli/src/commands/memory.js.map +1 -1
  112. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +246 -0
  113. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  114. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +126 -0
  115. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  116. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +295 -0
  117. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  118. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  119. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  120. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +100 -0
  121. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  122. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +147 -0
  123. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  124. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +76 -0
  125. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  126. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  127. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  128. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  129. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  130. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  131. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  132. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  133. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  134. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +26 -0
  135. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  136. package/codeyam-cli/src/utils/backgroundServer.js +19 -3
  137. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  138. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  139. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  140. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  141. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  142. package/codeyam-cli/src/utils/editorAudit.js +82 -0
  143. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  144. package/codeyam-cli/src/utils/editorDevServer.js +98 -0
  145. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  146. package/codeyam-cli/src/utils/editorJournal.js +137 -0
  147. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  148. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  149. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  150. package/codeyam-cli/src/utils/editorPreloadHelpers.js +64 -0
  151. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  152. package/codeyam-cli/src/utils/editorPreview.js +66 -0
  153. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  154. package/codeyam-cli/src/utils/editorScenarios.js +56 -0
  155. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  156. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  157. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  158. package/codeyam-cli/src/utils/fileWatcher.js +25 -9
  159. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  160. package/codeyam-cli/src/utils/git.js +103 -0
  161. package/codeyam-cli/src/utils/git.js.map +1 -1
  162. package/codeyam-cli/src/utils/install-skills.js +55 -13
  163. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  164. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  165. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  166. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  167. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  168. package/codeyam-cli/src/utils/project.js +15 -5
  169. package/codeyam-cli/src/utils/project.js.map +1 -1
  170. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  171. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  172. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  173. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  174. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  175. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  176. package/codeyam-cli/src/utils/queue/job.js +70 -1
  177. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  178. package/codeyam-cli/src/utils/queue/manager.js +7 -6
  179. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  180. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  181. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  182. package/codeyam-cli/src/utils/serverState.js +27 -2
  183. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  184. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +45 -4
  185. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  186. package/codeyam-cli/src/utils/testRunner.js +158 -0
  187. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  188. package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
  189. package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
  190. package/codeyam-cli/src/utils/webappDetection.js +14 -2
  191. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  192. package/codeyam-cli/src/webserver/app/lib/database.js +41 -27
  193. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  194. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  195. package/codeyam-cli/src/webserver/backgroundServer.js +109 -19
  196. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  197. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CtmbP4Gl.js → CopyButton-DmJveP3T.js} +1 -1
  198. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-DlMph_Hm.js → EntityItem-C76mRRiF.js} +1 -1
  199. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-B-0PjGOU.js → EntityTypeBadge-g3saevPb.js} +1 -1
  200. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-DN9eiJAO.js → EntityTypeIcon-CobE682z.js} +1 -1
  201. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
  202. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-rE_fI2h2.js → InteractivePreview-DYFW3lDD.js} +3 -3
  203. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CnatsCw2.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
  204. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-CSP6DZrh.js → LoadingDots-BU_OAEMP.js} +1 -1
  205. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CMK8Q7yk.js → LogViewer-ceAyBX-H.js} +1 -1
  206. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-TCV_HBjy.js → ReportIssueModal-djPLI-WV.js} +1 -1
  207. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CG2uh31y.js → SafeScreenshot-BED4B6sP.js} +1 -1
  208. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CU_TDYd8.js → ScenarioViewer-B76aig_2.js} +1 -1
  209. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
  210. package/codeyam-cli/src/webserver/build/client/assets/Terminal-Dnj5CY9R.js +41 -0
  211. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-D7IoaWUW.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
  212. package/codeyam-cli/src/webserver/build/client/assets/{_index-B8z7mjR-.js → _index-C96V0n15.js} +1 -1
  213. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DZu78RI1.js → activity.(_tab)-BpKzcsJz.js} +1 -1
  214. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +1 -0
  215. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
  216. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-D9hemwl6.js +22 -0
  217. package/codeyam-cli/src/webserver/build/client/assets/api.dev-mode-events-l0sNRNKZ.js +1 -0
  218. package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
  219. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  220. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  221. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  222. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  223. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  224. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  225. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  226. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  227. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  228. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  229. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  230. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  231. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  232. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  233. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  234. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  235. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  236. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  237. package/codeyam-cli/src/webserver/build/client/assets/{book-open-Bp5FLkd4.js → book-open-D_nMCFmP.js} +1 -1
  238. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DQJA9f4o.js → chevron-down-BH2h1Ea2.js} +1 -1
  239. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-7VptmeIr.js → chunk-JZWAC4HX-C4pqxYJB.js} +1 -1
  240. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-B6C4LY9o.js → circle-check-DyIKORY6.js} +1 -1
  241. package/codeyam-cli/src/webserver/build/client/assets/{copy-6nzYCu0G.js → copy-NDbZjXao.js} +1 -1
  242. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-D-QUFOwe.js → createLucideIcon-CMT1jU2q.js} +1 -1
  243. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +1 -0
  244. package/codeyam-cli/src/webserver/build/client/assets/editor-D1DAKXtT.js +8 -0
  245. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._--zvFJ4OH.js → entity._sha._-CrjR3zZW.js} +10 -10
  246. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DkzqFzFj.js +6 -0
  247. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +6 -0
  248. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
  249. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-C7ysA4Jq.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
  250. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CU6EUArK.js → entry.client-DTvKq3TY.js} +1 -1
  251. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-EWpfFU4X.js → fileTableUtils-cPo8LiG3.js} +1 -1
  252. package/codeyam-cli/src/webserver/build/client/assets/{files-CrxAoWIL.js → files-DO4CZ16O.js} +1 -1
  253. package/codeyam-cli/src/webserver/build/client/assets/{git-BldHtKeW.js → git-CFCTYk9I.js} +1 -1
  254. package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +1 -0
  255. package/codeyam-cli/src/webserver/build/client/assets/{index-7-1FmlHo.js → index-10oVnAAH.js} +1 -1
  256. package/codeyam-cli/src/webserver/build/client/assets/{index-DuYcwYp_.js → index-BcvgDzbZ.js} +1 -1
  257. package/codeyam-cli/src/webserver/build/client/assets/{labs-CPPVOSWB.js → labs-Zk7ryIM1.js} +1 -1
  258. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BnDcD54R.js → loader-circle-BAXYRVEO.js} +1 -1
  259. package/codeyam-cli/src/webserver/build/client/assets/manifest-a632de18.js +1 -0
  260. package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +96 -0
  261. package/codeyam-cli/src/webserver/build/client/assets/{pause-DhQX2g22.js → pause-DTAcYxBt.js} +1 -1
  262. package/codeyam-cli/src/webserver/build/client/assets/root-DUKqhFlb.js +67 -0
  263. package/codeyam-cli/src/webserver/build/client/assets/{search-DborVoKD.js → search-fKo7v0Zo.js} +1 -1
  264. package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +1 -0
  265. package/codeyam-cli/src/webserver/build/client/assets/{simulations-BtrtCYJg.js → simulations-B3aOzpCZ.js} +1 -1
  266. package/codeyam-cli/src/webserver/build/client/assets/{terminal-Bs4NC-VZ.js → terminal-BG4heKCG.js} +1 -1
  267. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DTf3Jojp.js → triangle-alert-DtSmdtM4.js} +1 -1
  268. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-D_bDZyDU.js → useCustomSizes-ByhSyh0W.js} +1 -1
  269. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
  270. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-BsQb6rFd.js → useReportContext-O-jkvSPx.js} +1 -1
  271. package/codeyam-cli/src/webserver/build/client/assets/{useToast-BOur3mUv.js → useToast-9FIWuYfK.js} +1 -1
  272. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  273. package/codeyam-cli/src/webserver/build/server/assets/index-HfLydfDq.js +1 -0
  274. package/codeyam-cli/src/webserver/build/server/assets/server-build-CUu_F-oo.js +366 -0
  275. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  276. package/codeyam-cli/src/webserver/build-info.json +5 -5
  277. package/codeyam-cli/src/webserver/devServer.js +39 -5
  278. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  279. package/codeyam-cli/src/webserver/editorProxy.js +440 -0
  280. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  281. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +175 -0
  282. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +140 -0
  283. package/codeyam-cli/src/webserver/server.js +226 -1
  284. package/codeyam-cli/src/webserver/server.js.map +1 -1
  285. package/codeyam-cli/src/webserver/terminalServer.js +698 -0
  286. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  287. package/codeyam-cli/templates/codeyam-editor-claude.md +68 -0
  288. package/codeyam-cli/templates/editor-step-hook.py +147 -0
  289. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  290. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  291. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  292. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  293. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  294. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  295. package/codeyam-cli/templates/nextjs-prisma-sqlite/PRISMA_SETUP.md +84 -0
  296. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  297. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  298. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  299. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +19 -0
  300. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  301. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  302. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +43 -0
  303. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  304. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +35 -0
  305. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  306. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  307. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +37 -0
  308. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  309. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  310. package/codeyam-cli/templates/prompts/conversation-guidance.txt +12 -0
  311. package/codeyam-cli/templates/prompts/conversation-prompt.txt +3 -3
  312. package/codeyam-cli/templates/prompts/interruption-prompt.txt +3 -3
  313. package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +3 -3
  314. package/codeyam-cli/templates/rule-notification-hook.py +44 -17
  315. package/codeyam-cli/templates/rule-reflection-hook.py +24 -4
  316. package/codeyam-cli/templates/rules-instructions.md +4 -3
  317. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  318. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +69 -0
  319. package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
  320. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  321. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh +108 -0
  322. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh +69 -0
  323. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  324. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  325. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.sh +12 -0
  326. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter.jq +45 -0
  327. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.sh +139 -0
  328. package/package.json +4 -2
  329. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +22 -4
  330. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  331. package/packages/ai/src/lib/completionCall.js +10 -2
  332. package/packages/ai/src/lib/completionCall.js.map +1 -1
  333. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +21 -0
  334. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  335. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  336. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  337. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  338. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  339. package/packages/ai/src/lib/generateEntityScenarioData.js +57 -2
  340. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  341. package/packages/analyze/src/lib/ProjectAnalyzer.js +3 -0
  342. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  343. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +8 -1
  344. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  345. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +0 -5
  346. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
  347. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  348. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  349. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +54 -27
  350. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -1
  351. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +65 -0
  352. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  353. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +18 -4
  354. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  355. package/packages/database/index.js +1 -0
  356. package/packages/database/index.js.map +1 -1
  357. package/packages/database/src/lib/kysely/db.js +5 -0
  358. package/packages/database/src/lib/kysely/db.js.map +1 -1
  359. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
  360. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  361. package/packages/database/src/lib/loadCommits.js +23 -13
  362. package/packages/database/src/lib/loadCommits.js.map +1 -1
  363. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  364. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  365. package/packages/database/src/lib/updateCommitMetadata.js +100 -89
  366. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  367. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  368. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  369. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  370. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  371. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  372. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  373. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  374. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  375. package/scripts/npm-post-install.cjs +34 -0
  376. package/codeyam-cli/src/webserver/app/routes/api.agent-transcripts.js +0 -486
  377. package/codeyam-cli/src/webserver/app/routes/api.agent-transcripts.js.map +0 -1
  378. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-C1rIyZdV.js +0 -34
  379. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DxCa1oBt.js +0 -23
  380. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DmzSmblj.js +0 -1
  381. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DVTcUnur.js +0 -6
  382. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-BVgNO76F.js +0 -6
  383. package/codeyam-cli/src/webserver/build/client/assets/globals-B4MPiL7S.css +0 -1
  384. package/codeyam-cli/src/webserver/build/client/assets/manifest-c1fc3656.js +0 -1
  385. package/codeyam-cli/src/webserver/build/client/assets/memory-CfpYxpNu.js +0 -93
  386. package/codeyam-cli/src/webserver/build/client/assets/root-CAAbm4U5.js +0 -62
  387. package/codeyam-cli/src/webserver/build/client/assets/settings-BpLDWmGh.js +0 -1
  388. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-DZp6rrQD.js +0 -2
  389. package/codeyam-cli/src/webserver/build/server/assets/index-B8A_aaGG.js +0 -1
  390. package/codeyam-cli/src/webserver/build/server/assets/server-build-69rRZnZo.js +0 -286
  391. package/scripts/finalize-analyzer.cjs +0 -13
  392. /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
  393. /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
  394. /package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -0
  395. /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
  396. /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
  397. /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
  398. /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
@@ -0,0 +1,22 @@
1
+ import{w as O,u as P,a as I,i as B,r as m,j as e,L as D}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as U}from"./useReportContext-O-jkvSPx.js";import{c as w}from"./createLucideIcon-CMT1jU2q.js";import{T as F,C as N}from"./terminal-BG4heKCG.js";import{S as V}from"./search-fKo7v0Zo.js";import{C as _}from"./chevron-down-BH2h1Ea2.js";import{B as A}from"./book-open-D_nMCFmP.js";import{T as H}from"./triangle-alert-DtSmdtM4.js";import{C as q,a as z}from"./copy-NDbZjXao.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 J=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],K=w("arrow-left",J);/**
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
+ */const W=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],X=w("chevron-left",W);/**
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 Y=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],G=w("message-square",Y);/**
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 Q=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Z=w("save",Q),Ne=()=>[{title:"Agent Transcripts - CodeYam"},{name:"description",content:"View background agent transcripts and tool call history"}];function ee(s){if(!s)return"";try{return new Date(s).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return s}}function se(s){if(!s)return"";try{return new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return s}}function te(s){return s.includes("opus")?"Opus":s.includes("sonnet")?"Sonnet":s.includes("haiku")?"Haiku":s}function v({type:s,toolName:t}){const a={user_prompt:"bg-[#00b4d8] text-black",assistant_text:"bg-[#a8dadc] text-black",tool_call:"bg-[#f4a261] text-black",tool_result:"bg-[#2a9d8f] text-black",context:"bg-[#7c3aed] text-white"},r={user_prompt:"USER",assistant_text:"ASSISTANT",tool_call:t||"TOOL",tool_result:"RESULT",context:"CONTEXT"};return e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wide ${a[s]||"bg-gray-300 text-black"}`,children:r[s]||s})}function re({input:s}){return e.jsx("div",{className:"text-xs font-mono space-y-1",children:Object.entries(s).map(([t,a])=>{let r=typeof a=="string"?a:JSON.stringify(a);return r.length>500&&(r=r.slice(0,500)+"..."),e.jsxs("div",{children:[e.jsxs("span",{className:"text-[#f4a261] font-bold",children:[t,":"]})," ",e.jsx("span",{className:"text-gray-700",children:r})]},t)})})}function ae({content:s,truncated:t,fullLength:a}){const[r,l]=m.useState(!1);return e.jsxs("div",{children:[e.jsxs("pre",{className:"whitespace-pre-wrap break-words text-xs max-h-96 overflow-y-auto text-gray-700",children:[s,t&&!r&&"..."]}),t&&e.jsx("button",{onClick:()=>l(!r),className:"text-[11px] text-gray-500 hover:text-gray-700 mt-1 font-mono cursor-pointer",children:r?"Show less":`Show more (${(a||0)-s.length} more chars)`})]})}function ne({entry:s,pairedResult:t}){const[a,r]=m.useState(!1),l=ee(s.timestamp||"");return s.type==="user_prompt"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{type:"user_prompt"}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono",children:l})]}),e.jsx("pre",{className:"bg-white border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-xs font-mono border-l-[3px] border-l-[#00b4d8] max-h-72 overflow-y-auto text-gray-800",children:s.text})]}):s.type==="assistant_text"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{type:"assistant_text"}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono",children:l})]}),e.jsx("div",{className:"bg-white border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-sm border-l-[3px] border-l-[#a8dadc] text-gray-800",children:s.text})]}):s.type==="tool_call"?e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>r(!a),className:"flex items-center gap-2 w-full text-left bg-white border border-gray-200 rounded-md px-3 py-2 hover:bg-gray-50 cursor-pointer",children:[a?e.jsx(_,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}),e.jsx(v,{type:"tool_call",toolName:s.name}),e.jsx("span",{className:"text-xs text-gray-500 font-mono truncate flex-1",children:s.summary||""}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono flex-shrink-0",children:l})]}),a&&e.jsxs("div",{className:"bg-white border border-t-0 border-gray-200 rounded-b-md px-3 py-2 border-l-[3px] border-l-[#f4a261]",children:[e.jsx(re,{input:s.input||{}}),t&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[e.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wide text-[#2a9d8f] mb-1",children:["Result",t.is_error?" (Error)":"",":"]}),e.jsx(ae,{content:t.content||"",truncated:t.truncated,fullLength:t.fullLength})]})]})]}):(s.type==="tool_result",null)}function oe({context:s}){const[t,a]=m.useState(!1);return e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>a(!t),className:"flex items-center gap-2 mb-1 cursor-pointer hover:opacity-80",children:[t?e.jsx(_,{className:"w-3 h-3 text-gray-400"}):e.jsx(N,{className:"w-3 h-3 text-gray-400"}),e.jsx(v,{type:"context"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Full prompt context"})]}),t&&e.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-xs font-mono border-l-[3px] border-l-[#7c3aed] max-h-96 overflow-y-auto text-gray-700",children:s})]})}function le({snippet:s}){const[t,a]=m.useState(!1),r=s.split(`
22
+ `).filter(c=>c.trim()),l=r.slice(0,4),x=r.length>4,i=t?r:l;return e.jsxs("div",{className:"my-2 bg-blue-50 border border-blue-200 rounded-md p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(G,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{className:"text-xs font-bold text-blue-800",children:"Source Conversation"}),e.jsxs("span",{className:"text-[10px] text-blue-500",children:[r.length," message",r.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:i.map((c,d)=>{const h=c.match(/^\[(\w+)\]:\s*(.*)/);if(!h)return null;const[,g,u]=h,f=g==="user";return e.jsxs("div",{className:"text-xs",children:[e.jsxs("span",{className:`font-bold ${f?"text-blue-700":"text-gray-500"}`,children:[f?"User":"Assistant",":"]})," ",e.jsx("span",{className:"text-gray-700",children:u.length>200?u.slice(0,200)+"...":u})]},d)})}),x&&e.jsx("button",{onClick:()=>a(!t),className:"text-[11px] text-blue-600 hover:text-blue-800 mt-2 font-mono cursor-pointer",children:t?"Show less":`Show all ${r.length} messages`})]})}function ie({change:s}){const[t,a]=m.useState(!1),r=s.action==="created"?!!s.content:s.action==="modified"?!!(s.oldString||s.newString):!1;return e.jsxs("li",{children:[e.jsx("button",{onClick:()=>r&&a(!t),className:`text-left w-full ${r?"hover:text-green-900 cursor-pointer":""}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r&&(t?e.jsx(_,{className:"w-3 h-3 inline flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 inline flex-shrink-0"})),s.action==="created"?"Created":"Modified"," ",s.filePath]})}),t&&s.action==="created"&&s.content&&e.jsx("pre",{className:"mt-1 mb-2 ml-4 p-2 bg-white border border-green-200 rounded text-[11px] text-gray-700 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:s.content}),t&&s.action==="modified"&&e.jsxs("div",{className:"mt-1 mb-2 ml-4 space-y-1",children:[s.oldString&&e.jsxs("pre",{className:"p-2 bg-red-50 border border-red-200 rounded text-[11px] text-red-800 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:["- ",s.oldString]}),s.newString&&e.jsxs("pre",{className:"p-2 bg-green-50 border border-green-300 rounded text-[11px] text-green-800 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:["+ ",s.newString]})]})]})}function ce({changes:s}){const t=s.filter(i=>i.action==="touched"),a=s.filter(i=>i.action!=="touched"),r=a.some(i=>i.action==="created"),l=a.some(i=>i.action==="modified"),x=r?"bg-green-50 border-green-200 text-green-800 [&_ul]:text-green-700":l?"bg-amber-50 border-amber-200 text-amber-800 [&_ul]:text-amber-700":"bg-gray-50 border-gray-200 text-gray-600 [&_ul]:text-gray-500";return e.jsxs("div",{className:`my-2 border rounded-md p-3 ${x}`,children:[e.jsx("div",{className:"text-xs font-bold mb-1",children:"Rule Changes:"}),e.jsxs("ul",{className:"text-xs space-y-0.5 font-mono",children:[a.map((i,c)=>e.jsx(ie,{change:i},c)),t.length>0&&e.jsxs("li",{children:["Touched timestamps on ",t.length," rule",t.length!==1?"s":""]})]})]})}function de({result:s}){const t=s.is_error,a=t?"bg-red-50 border-red-200":"bg-green-50 border-green-200",r=t?"text-red-800":"text-green-800",l=t?"text-red-700":"text-green-700",x=s.subtype.replace(/^error_/,"").replace(/_/g," "),i=d=>d>=6e4?`${(d/6e4).toFixed(1)}m`:`${(d/1e3).toFixed(1)}s`,c=d=>d>=1e3?`${(d/1e3).toFixed(1)}k`:String(d);return e.jsxs("div",{className:`my-2 border rounded-md p-3 ${a}`,children:[e.jsxs("div",{className:`text-xs font-bold mb-1 ${r}`,children:["Session Result: ",x]}),e.jsxs("div",{className:`text-xs ${l} font-mono space-y-0.5`,children:[e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-0.5",children:[s.duration_ms!=null&&e.jsxs("span",{children:["Duration: ",i(s.duration_ms)]}),s.duration_api_ms!=null&&e.jsxs("span",{children:["API time: ",i(s.duration_api_ms)]}),s.num_turns!=null&&e.jsxs("span",{children:["Turns: ",s.num_turns]}),s.total_cost_usd!=null&&e.jsxs("span",{children:["Cost: $",s.total_cost_usd.toFixed(4)]})]}),s.usage&&e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-0.5 mt-1",children:[s.usage.input_tokens!=null&&e.jsxs("span",{children:["Input: ",c(s.usage.input_tokens)]}),s.usage.output_tokens!=null&&e.jsxs("span",{children:["Output: ",c(s.usage.output_tokens)]}),s.usage.cache_read_input_tokens!=null&&e.jsxs("span",{children:["Cache read: ",c(s.usage.cache_read_input_tokens)]}),s.usage.cache_creation_input_tokens!=null&&e.jsxs("span",{children:["Cache write:"," ",c(s.usage.cache_creation_input_tokens)]})]}),s.errors&&s.errors.length>0&&e.jsx("div",{className:"mt-1",children:s.errors.map((d,h)=>e.jsx("div",{className:"text-red-700 break-words",children:d},h))})]})]})}function xe({agent:s,defaultOpen:t,isAdmin:a}){var $,E,R;const[r,l]=m.useState(t),[x,i]=m.useState(!1),[c,d]=m.useState(null),[h,g]=m.useState(!1),u=m.useMemo(()=>{const n={};for(const o of s.entries)o.type==="tool_result"&&o.tool_use_id&&(n[o.tool_use_id]=o);return n},[s.entries]),f=m.useMemo(()=>{const n=new Set;for(const o of s.entries)o.type==="tool_call"&&o.tool_use_id&&u[o.tool_use_id]&&n.add(o.tool_use_id);return n},[s.entries,u]),S=n=>{n.stopPropagation(),i(!0),d(null),fetch("/api/save-fixture",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s.id})}).then(o=>o.json()).then(o=>{o.success?d(`Saved to ${o.fixturePath}`):d(`Error: ${o.error}`)}).catch(o=>{d(`Error: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{i(!1)})},y=(s.ruleChanges||[]).filter(n=>n.action!=="touched"),b=y.filter(n=>n.action==="created"),j=y.filter(n=>n.action==="modified"),p=(s.ruleChanges||[]).filter(n=>n.action==="touched"),k=y.length>0,T=p.length>0,L=k||T;return e.jsxs("div",{className:`bg-white border rounded-lg overflow-hidden mb-4 ${s.stats.errors>0?"border-red-300":b.length>0?"border-green-300":j.length>0?"border-amber-300":"border-gray-200"}`,children:[e.jsxs("button",{onClick:()=>l(!r),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-gray-50 cursor-pointer",children:[r?e.jsx(_,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}):e.jsx(N,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-bold text-[#005C75] font-mono",children:s.id.slice(0,8)}),s.slug&&e.jsx("span",{className:"text-xs text-gray-500",children:s.slug}),s.model&&e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-bold bg-purple-100 text-purple-700",title:s.model,children:te(s.model)}),b.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-800",children:[e.jsx(A,{className:"w-3 h-3"}),b.length," rule",b.length!==1?"s":""," ","created"]}),j.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-amber-100 text-amber-800",children:[e.jsx(A,{className:"w-3 h-3"}),j.length," rule",j.length!==1?"s":""," ","modified"]}),!k&&T&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-gray-100 text-gray-500",children:[p.length," timestamp",p.length!==1?"s":""," ","touched"]}),s.stats.errors>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-red-100 text-red-800",children:[e.jsx(H,{className:"w-3 h-3 flex-shrink-0"}),s.stats.errors," ",s.stats.errors===1?"Error":"Errors"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono",children:[s.stats.toolCalls," tool calls, ",s.stats.textBlocks," text blocks",(($=s.sessionResult)==null?void 0:$.duration_ms)!=null&&e.jsxs(e.Fragment,{children:[" · ",s.sessionResult.duration_ms>=6e4?`${(s.sessionResult.duration_ms/6e4).toFixed(1)}m`:`${(s.sessionResult.duration_ms/1e3).toFixed(1)}s`]}),((E=s.sessionResult)==null?void 0:E.total_cost_usd)!=null&&e.jsxs(e.Fragment,{children:[" · ","$",s.sessionResult.total_cost_usd.toFixed(2)]})]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono ml-auto flex items-center gap-2",children:[se(s.timestamp),a&&k&&e.jsxs("button",{onClick:S,disabled:x,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] font-bold bg-gray-100 text-gray-600 hover:bg-gray-200 disabled:opacity-50 cursor-pointer",title:"Save as test fixture",children:[e.jsx(Z,{className:"w-3 h-3"}),x?"Saving...":"Save Fixture"]})]})]}),c&&e.jsx("div",{className:`px-4 py-2 text-xs font-mono ${c.startsWith("Error")?"bg-red-50 text-red-700":"bg-green-50 text-green-700"}`,children:c}),r&&e.jsxs("div",{className:"px-4 pb-4 border-t border-gray-100",children:[s.sourceFile&&e.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-gray-500 font-mono",children:[e.jsx("span",{className:"text-gray-400",children:"FILE:"}),e.jsx("span",{className:"truncate",children:s.sourceFile}),e.jsx("button",{onClick:n=>{n.stopPropagation(),navigator.clipboard.writeText(s.sourceFile),g(!0),setTimeout(()=>g(!1),2e3)},className:"p-0.5 rounded text-gray-400 hover:text-gray-600 cursor-pointer transition-colors flex-shrink-0",title:"Copy file path",children:h?e.jsx(q,{className:"w-3.5 h-3.5 text-green-500"}):e.jsx(z,{className:"w-3.5 h-3.5"})})]}),s.sessionResult&&e.jsx(de,{result:s.sessionResult}),s.stats.errors>0&&((R=s.stats.errorMessages)==null?void 0:R.length)>0&&e.jsxs("div",{className:"my-2 bg-red-50 border border-red-200 rounded-md p-3",children:[e.jsxs("div",{className:"text-xs font-bold text-red-800 mb-1",children:[s.stats.errors," Error",s.stats.errors!==1?"s":"",":"]}),e.jsx("ul",{className:"text-xs text-red-700 space-y-1 font-mono",children:s.stats.errorMessages.map((n,o)=>e.jsx("li",{className:"break-words",children:n},o))})]}),s.conversationSnippet&&e.jsx(le,{snippet:s.conversationSnippet}),L&&e.jsx(ce,{changes:s.ruleChanges}),s.context&&e.jsx(oe,{context:s.context}),s.entries.map((n,o)=>{if(n.type==="tool_result"&&n.tool_use_id&&f.has(n.tool_use_id))return null;const M=n.type==="tool_call"&&n.tool_use_id?u[n.tool_use_id]:void 0;return e.jsx(ne,{entry:n,pairedResult:M},`${s.id}-${o}`)})]})]})}function C(s,t){const a=new URLSearchParams;t&&a.set("search",t),s>1&&a.set("page",String(s));const r=a.toString();return`/agent-transcripts${r?`?${r}`:""}`}const ve=O(function(){const{agents:t,error:a,search:r,page:l,totalPages:x}=P(),i=I(),c=B("root"),d=(c==null?void 0:c.isAdmin)??!1,[h,g]=m.useState(r),[u,f]=m.useState(!1),[S,y]=m.useState(0);U({source:"agent-transcripts-page"});const b=p=>{p.preventDefault(),window.location.href=C(1,h)},j=()=>{f(!u),y(p=>p+1)};return a?e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:a})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("button",{onClick:()=>{i("/memory")},className:"text-gray-600 hover:text-[#005C75] transition-colors cursor-pointer",title:"Back to Memory","aria-label":"Back to Memory",children:e.jsx(K,{className:"w-5 h-5"})}),e.jsx(F,{className:"w-6 h-6 text-[#232323]"}),e.jsx("h1",{className:"text-[24px] font-semibold mb-0",style:{fontFamily:"Sora",color:"#232323"},children:"Agent Transcripts"})]}),e.jsx("p",{className:"text-[15px] text-gray-500 ml-14",children:"View background agent transcripts and tool call history"})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("form",{onSubmit:b,className:"relative flex-1 max-w-md",children:[e.jsx(V,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",value:h,onChange:p=>g(p.target.value),placeholder:"Search transcripts...",className:"w-full pl-10 pr-4 py-2 border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent text-sm"})]}),e.jsx("button",{onClick:j,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:u?"Collapse All":"Expand All"})]}),e.jsxs("div",{className:"text-sm text-gray-500 mb-4",children:["Page ",l," of ",x,r&&e.jsxs("span",{children:[" ","matching “",r,"”",e.jsx(D,{to:"/agent-transcripts",className:"text-[#005C75] hover:underline ml-2",children:"Clear"})]})]}),t.length===0?e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[e.jsx(F,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Agent Transcripts Found"}),e.jsx("p",{className:"text-gray-500",children:"Background agent output files will appear here when available."})]}):e.jsx("div",{children:t.map(p=>e.jsx(xe,{agent:p,defaultOpen:u,isAdmin:d},p.id))},S),x>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 mt-8",children:[e.jsxs("a",{href:l>1?C(l-1,r):void 0,className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${l>1?"bg-white border border-gray-200 text-gray-700 hover:bg-gray-50 cursor-pointer":"bg-gray-100 text-gray-400 pointer-events-none"}`,children:[e.jsx(X,{className:"w-4 h-4"}),"Prev"]}),e.jsxs("span",{className:"text-sm text-gray-500 font-mono",children:[l," / ",x]}),e.jsxs("a",{href:l<x?C(l+1,r):void 0,className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${l<x?"bg-white border border-gray-200 text-gray-700 hover:bg-gray-50 cursor-pointer":"bg-gray-100 text-gray-400 pointer-events-none"}`,children:["Next",e.jsx(N,{className:"w-4 h-4"})]})]})]})})});export{ve as default,Ne as meta};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-D-QUFOwe.js";/**
1
+ import{c as o}from"./createLucideIcon-CMT1jU2q.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-D-QUFOwe.js";/**
1
+ import{c as o}from"./createLucideIcon-CMT1jU2q.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -48,4 +48,4 @@ import(${JSON.stringify(t.entry.module)});`:" ";return f.createElement(f.Fragmen
48
48
  console.log(
49
49
  "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
50
50
  );
51
- `}});if(Ve(e))return f.createElement(yr,{title:"Unhandled Thrown Response!"},f.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return f.createElement(yr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function yr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?f.createElement(Xl,null):null)))}var Zl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Zl&&(window.__reactRouterVersion="7.13.0")}catch{}var ba=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sa=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R){let{basename:b,unstable_useTransitions:E}=f.useContext(Ee),L=typeof u=="string"&&ba.test(u),S=kn(u,b);u=S.to;let D=hi(u,{relative:a}),[A,P,_]=Yl(n,g),y=rs(u,{replace:i,state:l,target:s,preventScrollReset:h,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:m,unstable_useTransitions:E});function M(J){t&&t(J),J.defaultPrevented||y(J)}let F=f.createElement("a",{...g,..._,href:S.absoluteURL||D,onClick:S.isExternal||o?t:M,ref:Ql(R,P),target:s,"data-discover":!L&&r==="render"?"true":void 0});return A&&!L?f.createElement(f.Fragment,null,F,f.createElement(Ea,{page:D})):F});Sa.displayName="Link";var es=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:l,children:s,...u},h){let c=vt(i,{relative:u.relative}),m=Le(),g=f.useContext(et),{navigator:R,basename:b}=f.useContext(Ee),E=g!=null&&ss(c)&&l===!0,L=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,S=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(S=S.toLowerCase(),D=D?D.toLowerCase():null,L=L.toLowerCase()),D&&b&&(D=be(D,b)||D);const A=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let P=S===L||!a&&S.startsWith(L)&&S.charAt(A)==="/",_=D!=null&&(D===L||!a&&D.startsWith(L)&&D.charAt(L.length)==="/"),y={isActive:P,isPending:_,isTransitioning:E},M=P?t:void 0,F;typeof n=="function"?F=n(y):F=[n,P?"active":null,_?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(y):o;return f.createElement(Sa,{...u,"aria-current":M,className:F,ref:h,style:J,to:i,viewTransition:l},typeof s=="function"?s(y):s)});es.displayName="NavLink";var xa=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Ot,action:l,onSubmit:s,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=f.useContext(Ee),E=Pa(),L=os(l,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",D=typeof l=="string"&&ba.test(l),A=P=>{if(s&&s(P),P.defaultPrevented)return;P.preventDefault();let _=P.nativeEvent.submitter,y=(_==null?void 0:_.getAttribute("formmethod"))||i,M=()=>E(_||P.currentTarget,{fetcherKey:t,method:y,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?f.startTransition(()=>M()):M()};return f.createElement("form",{ref:R,method:S,action:L,onSubmit:n?s:A,...g,"data-discover":!D&&e==="render"?"true":void 0})});xa.displayName="Form";function ts({getKey:e,storageKey:t,...r}){let n=f.useContext(zt),{basename:a}=f.useContext(Ee),o=Le(),i=Tr();is({getKey:e,storageKey:t});let l=f.useMemo(()=>{if(!n||!e)return null;let u=gr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let s=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${mr(JSON.stringify(t||vr))}, ${mr(JSON.stringify(l))})`}})}ts.displayName="ScrollRestoration";function Ca(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bt(e){let t=f.useContext(Je);return W(t,Ca(e)),t}function La(e){let t=f.useContext(et);return W(t,Ca(e)),t}function rs(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:s}={}){let u=ra(),h=Le(),c=vt(e,{relative:o});return f.useCallback(m=>{if(zi(m,t)){m.preventDefault();let g=r!==void 0?r:Me(h)===Me(c),R=()=>u(e,{replace:g,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l});s?f.startTransition(()=>R()):R()}},[h,u,c,r,n,t,e,a,o,i,l,s])}function Ps(e){oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(fr(e)),r=f.useRef(!1),n=Le(),a=f.useMemo(()=>Bi(n.search,r.current?null:t.current),[n.search]),o=ra(),i=f.useCallback((l,s)=>{const u=fr(typeof l=="function"?l(new URLSearchParams(a)):l);r.current=!0,o("?"+u,s)},[o,a]);return[a,i]}var ns=0,as=()=>`__${String(++ns)}__`;function Pa(){let{router:e}=Bt("useSubmit"),{basename:t}=f.useContext(Ee),r=Ci(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:h,body:c}=Vi(o,t);if(i.navigate===!1){let m=i.fetcherKey||as();await n(m,r,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function os(e,{relative:t}={}){let{basename:r}=f.useContext(Ee),n=f.useContext(Ce);W(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...vt(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(h=>h==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Te([r,o.pathname])),Me(o)}function Ts({key:e}={}){var P;let{router:t}=Bt("useFetcher"),r=La("useFetcher"),n=f.useContext(Cr),a=f.useContext(Ce),o=(P=a.matches[a.matches.length-1])==null?void 0:P.route.id;W(n,"useFetcher must be used inside a FetchersContext"),W(a,"useFetcher must be used inside a RouteContext"),W(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[l,s]=f.useState(e||i);e&&e!==l&&s(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(l),()=>u(l)),[u,h,l]);let g=f.useCallback(async(_,y)=>{W(o,"No routeId available for fetcher.load()"),await m(l,o,_,y)},[l,o,m]),R=Pa(),b=f.useCallback(async(_,y)=>{await R(_,{...y,navigate:!1,fetcherKey:l})},[l,R]),E=f.useCallback(_=>c(l,_),[c,l]),L=f.useMemo(()=>{let _=f.forwardRef((y,M)=>f.createElement(xa,{...y,navigate:!1,fetcherKey:l,ref:M}));return _.displayName="fetcher.Form",_},[l]),S=r.fetchers.get(l)||zn,D=n.get(l);return f.useMemo(()=>({Form:L,submit:b,load:g,reset:E,...S,data:D}),[L,b,g,E,S,D])}var vr="react-router-scroll-positions",_t={};function gr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function is({getKey:e,storageKey:t}={}){let{router:r}=Bt("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=La("useScrollRestoration"),{basename:o}=f.useContext(Ee),i=Le(),l=Tr(),s=Li();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ls(f.useCallback(()=>{if(s.state==="idle"){let u=gr(i,l,o,e);_t[u]=window.scrollY}try{sessionStorage.setItem(t||vr,JSON.stringify(_t))}catch(u){oe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||vr);u&&(_t=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(_t,()=>window.scrollY,e?(h,c)=>gr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{oe(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function ls(e,t){let{capture:r}={};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function ss(e,{relative:t}={}){let r=f.useContext(xr);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Bt("useViewTransitionState"),a=vt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ft(a.pathname,i)!=null||Ft(a.pathname,o)!=null}export{Rs as A,ps as B,ys as C,xs as D,je as E,zt as F,Xl as G,Ya as H,us as I,Sa as L,Cs as M,vl as N,gs as O,Xa as R,ts as S,ra as a,Ps as b,Ts as c,Le as d,Ti as e,hs as f,Ka as g,ms as h,vi as i,cs as j,Ve as k,W as l,Ae as m,Ss as n,Ls as o,vs as p,Ll as q,f as r,kl as s,Dr as t,Pi as u,fs as v,ws as w,bs as x,Es as y,ds as z};
51
+ `}});if(Ve(e))return f.createElement(yr,{title:"Unhandled Thrown Response!"},f.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return f.createElement(yr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function yr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?f.createElement(Xl,null):null)))}var Zl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Zl&&(window.__reactRouterVersion="7.13.0")}catch{}var ba=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sa=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R){let{basename:b,unstable_useTransitions:E}=f.useContext(Ee),L=typeof u=="string"&&ba.test(u),S=kn(u,b);u=S.to;let D=hi(u,{relative:a}),[A,P,_]=Yl(n,g),y=rs(u,{replace:i,state:l,target:s,preventScrollReset:h,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:m,unstable_useTransitions:E});function M(J){t&&t(J),J.defaultPrevented||y(J)}let F=f.createElement("a",{...g,..._,href:S.absoluteURL||D,onClick:S.isExternal||o?t:M,ref:Ql(R,P),target:s,"data-discover":!L&&r==="render"?"true":void 0});return A&&!L?f.createElement(f.Fragment,null,F,f.createElement(Ea,{page:D})):F});Sa.displayName="Link";var es=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:l,children:s,...u},h){let c=vt(i,{relative:u.relative}),m=Le(),g=f.useContext(et),{navigator:R,basename:b}=f.useContext(Ee),E=g!=null&&ss(c)&&l===!0,L=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,S=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(S=S.toLowerCase(),D=D?D.toLowerCase():null,L=L.toLowerCase()),D&&b&&(D=be(D,b)||D);const A=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let P=S===L||!a&&S.startsWith(L)&&S.charAt(A)==="/",_=D!=null&&(D===L||!a&&D.startsWith(L)&&D.charAt(L.length)==="/"),y={isActive:P,isPending:_,isTransitioning:E},M=P?t:void 0,F;typeof n=="function"?F=n(y):F=[n,P?"active":null,_?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(y):o;return f.createElement(Sa,{...u,"aria-current":M,className:F,ref:h,style:J,to:i,viewTransition:l},typeof s=="function"?s(y):s)});es.displayName="NavLink";var xa=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Ot,action:l,onSubmit:s,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=f.useContext(Ee),E=Pa(),L=os(l,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",D=typeof l=="string"&&ba.test(l),A=P=>{if(s&&s(P),P.defaultPrevented)return;P.preventDefault();let _=P.nativeEvent.submitter,y=(_==null?void 0:_.getAttribute("formmethod"))||i,M=()=>E(_||P.currentTarget,{fetcherKey:t,method:y,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?f.startTransition(()=>M()):M()};return f.createElement("form",{ref:R,method:S,action:L,onSubmit:n?s:A,...g,"data-discover":!D&&e==="render"?"true":void 0})});xa.displayName="Form";function ts({getKey:e,storageKey:t,...r}){let n=f.useContext(zt),{basename:a}=f.useContext(Ee),o=Le(),i=Tr();is({getKey:e,storageKey:t});let l=f.useMemo(()=>{if(!n||!e)return null;let u=gr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let s=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${mr(JSON.stringify(t||vr))}, ${mr(JSON.stringify(l))})`}})}ts.displayName="ScrollRestoration";function Ca(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bt(e){let t=f.useContext(Je);return W(t,Ca(e)),t}function La(e){let t=f.useContext(et);return W(t,Ca(e)),t}function rs(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:s}={}){let u=ra(),h=Le(),c=vt(e,{relative:o});return f.useCallback(m=>{if(zi(m,t)){m.preventDefault();let g=r!==void 0?r:Me(h)===Me(c),R=()=>u(e,{replace:g,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l});s?f.startTransition(()=>R()):R()}},[h,u,c,r,n,t,e,a,o,i,l,s])}function Ps(e){oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(fr(e)),r=f.useRef(!1),n=Le(),a=f.useMemo(()=>Bi(n.search,r.current?null:t.current),[n.search]),o=ra(),i=f.useCallback((l,s)=>{const u=fr(typeof l=="function"?l(new URLSearchParams(a)):l);r.current=!0,o("?"+u,s)},[o,a]);return[a,i]}var ns=0,as=()=>`__${String(++ns)}__`;function Pa(){let{router:e}=Bt("useSubmit"),{basename:t}=f.useContext(Ee),r=Ci(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:h,body:c}=Vi(o,t);if(i.navigate===!1){let m=i.fetcherKey||as();await n(m,r,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function os(e,{relative:t}={}){let{basename:r}=f.useContext(Ee),n=f.useContext(Ce);W(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...vt(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(h=>h==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Te([r,o.pathname])),Me(o)}function Ts({key:e}={}){var P;let{router:t}=Bt("useFetcher"),r=La("useFetcher"),n=f.useContext(Cr),a=f.useContext(Ce),o=(P=a.matches[a.matches.length-1])==null?void 0:P.route.id;W(n,"useFetcher must be used inside a FetchersContext"),W(a,"useFetcher must be used inside a RouteContext"),W(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[l,s]=f.useState(e||i);e&&e!==l&&s(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(l),()=>u(l)),[u,h,l]);let g=f.useCallback(async(_,y)=>{W(o,"No routeId available for fetcher.load()"),await m(l,o,_,y)},[l,o,m]),R=Pa(),b=f.useCallback(async(_,y)=>{await R(_,{...y,navigate:!1,fetcherKey:l})},[l,R]),E=f.useCallback(_=>c(l,_),[c,l]),L=f.useMemo(()=>{let _=f.forwardRef((y,M)=>f.createElement(xa,{...y,navigate:!1,fetcherKey:l,ref:M}));return _.displayName="fetcher.Form",_},[l]),S=r.fetchers.get(l)||zn,D=n.get(l);return f.useMemo(()=>({Form:L,submit:b,load:g,reset:E,...S,data:D}),[L,b,g,E,S,D])}var vr="react-router-scroll-positions",_t={};function gr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function is({getKey:e,storageKey:t}={}){let{router:r}=Bt("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=La("useScrollRestoration"),{basename:o}=f.useContext(Ee),i=Le(),l=Tr(),s=Li();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ls(f.useCallback(()=>{if(s.state==="idle"){let u=gr(i,l,o,e);_t[u]=window.scrollY}try{sessionStorage.setItem(t||vr,JSON.stringify(_t))}catch(u){oe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||vr);u&&(_t=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(_t,()=>window.scrollY,e?(h,c)=>gr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{oe(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function ls(e,t){let{capture:r}={};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function ss(e,{relative:t}={}){let r=f.useContext(xr);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Bt("useViewTransitionState"),a=vt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ft(a.pathname,i)!=null||Ft(a.pathname,o)!=null}export{ds as A,Rs as B,ps as C,ys as D,je as E,zt as F,xs as G,Xl as H,us as I,Sa as L,Cs as M,vl as N,gs as O,Xa as R,ts as S,ra as a,Ps as b,Le as c,Ts as d,Ti as e,hs as f,Ya as g,Ka as h,ms as i,cs as j,vi as k,Ve as l,Ae as m,W as n,Ss as o,Ls as p,vs as q,f as r,kl as s,Ll as t,Pi as u,Dr as v,ws as w,fs as x,bs as y,Es as z};
@@ -1,4 +1,4 @@
1
- import{c}from"./createLucideIcon-D-QUFOwe.js";/**
1
+ import{c}from"./createLucideIcon-CMT1jU2q.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./createLucideIcon-D-QUFOwe.js";/**
1
+ import{c}from"./createLucideIcon-CMT1jU2q.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as s}from"./chunk-JZWAC4HX-7VptmeIr.js";/**
1
+ import{r as s}from"./chunk-JZWAC4HX-C4pqxYJB.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{w as t,d as r,j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{S as i}from"./ScenarioViewer-B76aig_2.js";import{W as n}from"./InteractivePreview-DYFW3lDD.js";import"./useCustomSizes-ByhSyh0W.js";import"./LogViewer-ceAyBX-H.js";import"./SafeScreenshot-BED4B6sP.js";import"./useLastLogLine-C14nCb1q.js";import"./Spinner-Bb5uFQ5V.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-djPLI-WV.js";import"./createLucideIcon-CMT1jU2q.js";import"./circle-check-DyIKORY6.js";import"./triangle-alert-DtSmdtM4.js";import"./copy-NDbZjXao.js";import"./scenarioStatus-B_8jpV3e.js";import"./InlineSpinner-Bu6c6aDe.js";const w=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],k=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{k as default,w as meta};
@@ -0,0 +1,8 @@
1
+ import{r,j as e,w as et,u as tt,f as st,b as at}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as rt,V as nt,S as it}from"./useCustomSizes-ByhSyh0W.js";import{T as lt,D as ot}from"./Terminal-Dnj5CY9R.js";import{c as ct}from"./cy-logo-cli-DcX-ZS3p.js";import{S as Me,u as dt}from"./Spinner-Bb5uFQ5V.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-C14nCb1q.js";function Ee(a){const[s,i]=r.useState(null),[o,g]=r.useState(!1),N=r.useCallback(()=>{a&&(g(!0),fetch(`/api/editor-test-results?testFile=${encodeURIComponent(a)}`).then(v=>v.json()).then(v=>{i(v),g(!1)}).catch(()=>{i({testFilePath:a,status:"error",testCases:[],errorMessage:"Failed to fetch test results"}),g(!1)}))},[a]);return r.useEffect(()=>{a&&N()},[a,N]),{results:s,isRunning:o,runTests:N}}function Y({imgSrc:a,name:s,isActive:i,onSelect:o}){return e.jsxs("button",{onClick:o,className:"flex flex-col items-center gap-1 cursor-pointer group",title:s,children:[e.jsx("div",{className:`w-32 h-32 rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${i?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:a?e.jsx("img",{src:a,alt:s,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-32 ${i?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:s})]})}function me({testFile:a,entityName:s}){const{results:i,isRunning:o,runTests:g}=Ee(a);if(o&&!i)return e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!i)return null;if(i.status==="error")return e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:i.errorMessage})});const N=s?i.testCases.filter(p=>{const u=`${s} > `;return p.fullName.startsWith(u)||p.fullName===s}):i.testCases;if(N.length===0)return null;const v=s?`${s} > `:"";return e.jsxs("div",{className:"px-2 pt-1 space-y-0.5",children:[N.map(p=>{var l;const u=v&&p.fullName.startsWith(v)?p.fullName.slice(v.length):p.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[p.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):p.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${p.status==="passed"?"text-green-400":p.status==="failed"?"text-red-400":"text-gray-500"}`,children:u})]}),p.status==="failed"&&((l=p.failureMessages)==null?void 0:l.map((f,b)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-300/70 truncate max-w-full",title:f,children:f.split(`
2
+ `)[0]},b)))]},p.fullName)}),e.jsx("button",{onClick:g,disabled:o,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#00c4ee] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:o?"Running...":"Re-run"})]})}function V({filePath:a,projectRoot:s}){if(!a)return null;const o=`vscode://file/${s?`${s}/${a}`:a}`;return e.jsxs("div",{className:"flex items-center gap-1 px-2 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-500 truncate",children:a}),e.jsx("a",{href:o,title:"Open in editor",className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors",children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function xt(a){if(!a||a==="/")return"Home";const i=a.split("?")[0].replace(/^\//,"").split("/")[0];return i.charAt(0).toUpperCase()+i.slice(1)}function mt({scenarios:a,projectRoot:s,activeScenarioId:i,onScenarioSelect:o,zoomComponent:g,onZoomChange:N,analyzedEntities:v=[],glossaryFunctions:p=[],activeAnalyzedScenarioId:u,onAnalyzedScenarioSelect:l,entityImports:f}){const{pageGroups:b,componentGroups:k}=r.useMemo(()=>{const t=new Map,d=new Map;for(const S of a)if(S.componentName){const M=d.get(S.componentName)||[];M.push(S),d.set(S.componentName,M)}else{const M=xt(S.url),w=t.get(M)||[];w.push(S),t.set(M,w)}const h=new Map([...d.entries()].sort(([S],[M])=>S.localeCompare(M)));return{pageGroups:t,componentGroups:h}},[a]),j=r.useMemo(()=>{const t=new Set((v||[]).filter(h=>h.entityType==="visual").map(h=>h.name)),d=new Map;for(const[h,S]of k)t.has(h)||d.set(h,S);return d},[k,v]),{visualEntities:I,libraryEntities:$}=r.useMemo(()=>{const t=v.filter(h=>h.entityType==="visual").sort((h,S)=>h.name.localeCompare(S.name)),d=v.filter(h=>h.entityType==="library"||h.entityType==="functionCall").sort((h,S)=>h.name.localeCompare(S.name));return{visualEntities:t,libraryEntities:d}},[v]),R=r.useMemo(()=>{const t=new Set($.map(d=>d.name));return p.filter(d=>!t.has(d.name)).sort((d,h)=>d.name.localeCompare(h.name))},[p,$]),z=v.some(t=>t.isAnalyzing),B=r.useRef(null),x=r.useRef(0),y=r.useCallback(()=>{B.current&&(x.current=B.current.scrollTop)},[]);if(r.useEffect(()=>{B.current&&x.current>0&&(B.current.scrollTop=x.current)}),a.length===0&&v.length===0&&R.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No scenarios yet"}),e.jsx("p",{className:"text-xs",children:"Scenarios will appear here as Claude creates them alongside your code. Each scenario represents a different state of your app's data."})]})});if(g){const t=k.get(g)||[],d=new Set((f==null?void 0:f[g])||[]),h=d.size>0,S=h?I.filter(w=>d.has(w.name)):[],M=h?$.filter(w=>d.has(w.name)):[];return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsxs("button",{onClick:()=>N(void 0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All scenarios"]}),e.jsx("div",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-xs font-semibold text-white uppercase tracking-wider",children:g})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2",children:t.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No scenarios for this component"}):t.map(w=>e.jsx(Y,{imgSrc:w.screenshotPath?`/api/editor-scenario-image/${w.id}.png`:null,name:w.name,isActive:w.id===i,onSelect:()=>o(w)},w.id))}),S.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),S.map(w=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center gap-2 px-2 py-1",children:e.jsx("button",{onClick:()=>N(w.name),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:w.name})}),e.jsx(V,{filePath:w.filePath,projectRoot:s}),(w.scenarios.length>0||w.pendingScenarios.length>0)&&e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:w.scenarios.map(c=>e.jsx(Y,{imgSrc:c.screenshotPath?`/api/screenshot/${c.screenshotPath}`:null,name:c.name,isActive:c.id===u,onSelect:()=>l==null?void 0:l({analysisId:w.analysisId,scenarioId:c.id,scenarioName:c.name,entitySha:w.sha,entityName:w.name})},c.id))})]},w.sha))]}),M.length>0&&e.jsxs("div",{className:"pt-2 mt-1",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),M.map(w=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:w.name})}),e.jsx(V,{filePath:w.filePath,projectRoot:s}),w.testFile&&e.jsx(me,{testFile:w.testFile,entityName:w.name})]},w.sha))]})]})})}return e.jsx("div",{ref:B,onScroll:y,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-3",children:[b.size>0&&e.jsxs("div",{children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"})}),[...b.entries()].sort(([t],[d])=>t==="Home"?-1:d==="Home"?1:t.localeCompare(d)).map(([t,d])=>e.jsxs("div",{className:"px-2 pt-1",children:[e.jsx("div",{className:"py-0.5",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:t})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:d.map(h=>e.jsx(Y,{imgSrc:h.screenshotPath?`/api/editor-scenario-image/${h.id}.png`:null,name:h.name,isActive:h.id===i&&!u,onSelect:()=>o(h)},h.id))})]},t))]}),j.size>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),[...j.entries()].map(([t,d])=>{var h;return e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center justify-between px-2 py-1",children:e.jsx("button",{onClick:()=>N(t),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:t})}),((h=d[0])==null?void 0:h.componentPath)&&e.jsx(V,{filePath:d[0].componentPath,projectRoot:s}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:d.map(S=>e.jsx(Y,{imgSrc:S.screenshotPath?`/api/editor-scenario-image/${S.id}.png`:null,name:S.name,isActive:S.id===i&&!u,onSelect:()=>o(S)},S.id))})]},t)})]}),I.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),z&&a.length===0&&v.every(t=>t.scenarioCount===0)&&e.jsx("span",{className:"ml-2 text-[10px] text-gray-500",children:"— Entities are being analyzed..."})]}),I.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[e.jsx("button",{onClick:()=>N(t.name),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:t.name}),t.isAnalyzing&&t.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(V,{filePath:t.filePath,projectRoot:s}),(t.scenarios.length>0||t.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:[t.scenarios.map(d=>e.jsx(Y,{imgSrc:d.screenshotPath?`/api/screenshot/${d.screenshotPath}`:null,name:d.name,isActive:d.id===u,onSelect:()=>l==null?void 0:l({analysisId:t.analysisId,scenarioId:d.id,scenarioName:d.name,entitySha:t.sha,entityName:t.name})},d.id)),t.pendingScenarios.map(d=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:d,children:d},d))]})]},t.sha))]}),($.length>0||R.length>0)&&e.jsxs("div",{className:`pt-2 mt-1 ${I.length>0?"":"border-t border-[#3d3d3d]"}`,children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),$.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:t.name}),t.isAnalyzing&&t.scenarioCount===0&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(V,{filePath:t.filePath,projectRoot:s}),t.testFile?e.jsx(me,{testFile:t.testFile,entityName:t.name}):e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},t.sha)),R.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:t.name})}),e.jsx(V,{filePath:t.filePath,projectRoot:s}),e.jsx(me,{testFile:t.testFile,entityName:t.name})]},t.name))]})]})})}function ht(a){const s=new Map;for(const i of[...a].reverse()){const o=s.get(i.date)||[];o.push(i),s.set(i.date,o)}return s}function pt(a){const s=new Map;for(const i of a){const o=i.name.indexOf(" - "),g=o!==-1?i.name.slice(0,o):"App",N=s.get(g)||[];N.push(i),s.set(g,N)}return[...s.entries()].sort(([i],[o])=>i==="App"?-1:o==="App"?1:i.localeCompare(o))}const ut={feature:{label:"Feature",color:"bg-[#005c75]"},fix:{label:"Fix",color:"bg-amber-700"},refactor:{label:"Refactor",color:"bg-purple-700"},scaffold:{label:"Scaffold",color:"bg-green-700"},data:{label:"Data",color:"bg-blue-700"},milestone:{label:"Milestone",color:"bg-yellow-600"}};function ft(a){try{return new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function gt(a){try{return new Date(a+"T00:00:00").toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"})}catch{return a}}function jt({isActive:a,onScreenshotClick:s}){const[i,o]=r.useState([]),[g,N]=r.useState(!0),[v,p]=r.useState(new Set),u=r.useCallback(b=>{p(k=>{const j=new Set(k);return j.has(b)?j.delete(b):j.add(b),j})},[]),l=r.useCallback(async()=>{try{const b=await fetch("/api/editor-journal");if(b.ok){const k=await b.json();o(k.entries||[])}}catch{}finally{N(!1)}},[]);if(r.useEffect(()=>{l()},[l]),r.useEffect(()=>{a&&l()},[a,l]),r.useEffect(()=>{const b=new EventSource("/api/events");return b.addEventListener("message",k=>{try{const j=JSON.parse(k.data);j.type==="db-change"&&j.changeType==="journal"&&l()}catch{}}),()=>b.close()},[l]),g)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("span",{className:"text-gray-500 text-sm",children:"Loading journal..."})});if(i.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No journal entries yet"}),e.jsx("p",{className:"text-xs",children:"Journal entries will appear as you build. Claude records features, screenshots, and commits as the project evolves."})]})});const f=ht(i);return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"p-3 space-y-4",children:[...f.entries()].map(([b,k])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 sticky top-0 bg-[#1e1e1e] z-10",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:gt(b)})}),e.jsx("div",{className:"space-y-2",children:k.map((j,I)=>{const $=ut[j.type]||{label:j.type,color:"bg-gray-600"},R=`${j.time}-${I}`,z=v.has(R);return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg overflow-hidden",children:[e.jsxs("div",{className:`p-3 space-y-2 ${z?"":"max-h-[300px] overflow-y-auto"}`,children:[e.jsx("div",{className:"flex items-start gap-2",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white truncate",children:j.title}),e.jsx("span",{className:`${$.color} text-white text-[9px] font-bold px-1.5 py-0.5 rounded uppercase tracking-wider shrink-0`,children:$.label})]}),e.jsx("span",{className:"text-[10px] text-gray-500",children:ft(j.time)})]})}),e.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:j.description}),j.screenshot&&e.jsx("button",{type:"button",className:"rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] flex items-center justify-center p-1 cursor-pointer transition-colors w-full",onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${j.screenshot.replace("screenshots/","")}`,commitSha:j.commitSha,commitMessage:j.commitMessage,scenarioName:j.title}),children:e.jsx("img",{src:`/api/editor-journal-image/${j.screenshot.replace("screenshots/","")}`,alt:j.title,className:"max-w-full max-h-full object-contain",loading:"lazy"})}),j.scenarioScreenshots&&j.scenarioScreenshots.length>0&&(()=>{const B=pt(j.scenarioScreenshots);return e.jsx("div",{className:"space-y-1.5",children:B.map(([x,y])=>e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:x}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:y.map(t=>e.jsx("button",{type:"button",className:"w-[4.5rem] h-[4.5rem] rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] shrink-0 flex items-center justify-center cursor-pointer transition-colors",onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${t.path.replace("screenshots/","")}`,commitSha:j.commitSha,commitMessage:j.commitMessage,scenarioName:t.name}),children:e.jsx("img",{src:`/api/editor-journal-image/${t.path.replace("screenshots/","")}`,alt:t.name,title:t.name,className:"max-w-full max-h-full object-contain",loading:"lazy"})},t.path))})]},x))})})(),j.commitSha&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[e.jsx("span",{className:"font-mono text-[#00a0c4] bg-[#00a0c4]/10 px-1.5 py-0.5 rounded",children:j.commitSha.slice(0,7)}),e.jsx("span",{className:"text-gray-500 truncate",children:j.commitMessage})]})]}),e.jsxs("button",{onClick:()=>u(R),className:"w-full py-1.5 text-[10px] text-gray-500 hover:text-gray-300 border-t border-[#3d3d3d] transition-colors cursor-pointer",children:["——— ",z?"Collapse":"Expand"," ———"]})]},R)})})]},b))})})}function F({imgSrc:a,name:s,isActive:i,onSelect:o}){return e.jsxs("button",{onClick:o,className:"flex flex-col items-center gap-1 cursor-pointer group",title:s,children:[e.jsx("div",{className:`w-24 h-24 rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${i?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:a?e.jsx("img",{src:a,alt:s,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-24 ${i?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:s})]})}function vt({filePath:a,projectRoot:s}){if(!a)return null;const o=`vscode://file/${s?`${s}/${a}`:a}`;return e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-500 truncate",children:a}),e.jsx("a",{href:o,title:"Open in editor",className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors",children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function Nt(a){if(!a||a==="/")return"Home";const i=a.split("?")[0].replace(/^\//,"").split("/")[0];return i.charAt(0).toUpperCase()+i.slice(1)}function bt({hasProject:a,scenarios:s,analyzedEntities:i,glossaryFunctions:o=[],projectRoot:g,activeScenarioId:N,onScenarioSelect:v,onAnalyzedScenarioSelect:p,onSwitchToBuild:u,zoomComponent:l,onZoomChange:f,entityImports:b}){const{pageGroups:k,componentGroups:j}=r.useMemo(()=>{const x=new Map,y=new Map;for(const d of s)if(d.componentName){const h=y.get(d.componentName)||[];h.push(d),y.set(d.componentName,h)}else{const h=Nt(d.url),S=x.get(h)||[];S.push(d),x.set(h,S)}const t=new Map([...y.entries()].sort(([d],[h])=>d.localeCompare(h)));return{pageGroups:x,componentGroups:t}},[s]),I=r.useRef(null),$=r.useRef(0),R=r.useCallback(()=>{I.current&&($.current=I.current.scrollTop)},[]);if(r.useEffect(()=>{I.current&&$.current>0&&(I.current.scrollTop=$.current)}),!a)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Ready to build something?"}),e.jsx("button",{onClick:u,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});const z=r.useMemo(()=>i.filter(x=>x.entityType==="visual").sort((x,y)=>x.name.localeCompare(y.name)),[i]);if(!(s.length>0||z.length>0))return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 px-8 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Your project is ready"}),e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed max-w-[280px]",children:"Describe what you want to build in the Chat and your pages and components will appear here."}),e.jsx("button",{onClick:u,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});if(l){const x=k.get(l)||[],y=j.get(l)||[],t=z.find(c=>c.name===l),d=k.has(l),h=new Set((b==null?void 0:b[l])||[]),S=h.size>0,M=S?[...j.entries()].filter(([c])=>h.has(c)):[...j.entries()],w=S?z.filter(c=>h.has(c.name)):z;return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("button",{onClick:()=>f(void 0),className:"flex items-center gap-2 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer bg-transparent border-none p-0",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All"]}),e.jsx("h2",{className:"text-sm font-semibold text-white m-0 font-['IBM_Plex_Sans'] uppercase tracking-wider",children:l}),x.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(c=>e.jsx(F,{imgSrc:c.screenshotPath?`/api/editor-scenario-image/${c.id}.png`:null,name:c.name,isActive:c.id===N,onSelect:()=>v(c)},c.id))}),y.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:y.map(c=>e.jsx(F,{imgSrc:c.screenshotPath?`/api/editor-scenario-image/${c.id}.png`:null,name:c.name,isActive:c.id===N,onSelect:()=>v(c)},c.id))}),t&&(t.scenarios.length>0||t.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.scenarios.map(c=>e.jsx(F,{imgSrc:c.screenshotPath?`/api/screenshot/${c.screenshotPath}`:null,name:c.name,isActive:!1,onSelect:()=>p({analysisId:t.analysisId,scenarioId:c.id,scenarioName:c.name,entitySha:t.sha,entityName:t.name})},c.id)),t.pendingScenarios.map(c=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:c,children:c},c))]}),d&&M.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),M.map(([c,P])=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>f(c),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:c})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:P.map(_=>e.jsx(F,{imgSrc:_.screenshotPath?`/api/editor-scenario-image/${_.id}.png`:null,name:_.name,isActive:_.id===N,onSelect:()=>v(_)},_.id))})]},c))]}),d&&w.length>0&&e.jsxs("div",{className:`${M.length===0?"pt-2 mt-1 border-t border-[#3d3d3d]":"mt-2"}`,children:[M.length===0&&e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),w.map(c=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>f(c.name),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:c.name})}),(c.scenarios.length>0||c.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[c.scenarios.map(P=>e.jsx(F,{imgSrc:P.screenshotPath?`/api/screenshot/${P.screenshotPath}`:null,name:P.name,isActive:!1,onSelect:()=>p({analysisId:c.analysisId,scenarioId:P.id,scenarioName:P.name,entitySha:c.sha,entityName:c.name})},P.id)),c.pendingScenarios.map(P=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:P,children:P},P))]})]},c.sha))]}),x.length===0&&y.length===0&&!t&&e.jsx("div",{className:"text-xs text-gray-500",children:"No scenarios for this entity"})]})})}return e.jsx("div",{ref:I,onScroll:R,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium text-gray-300 m-0 font-['IBM_Plex_Sans']",children:"What do you want to work on next?"}),e.jsx("button",{onClick:u,className:"w-full py-3 border-2 border-dashed border-[#4d4d4d] rounded-lg text-sm text-gray-400 hover:border-[#005c75] hover:text-white transition-colors cursor-pointer bg-transparent",children:"+ New Page"}),k.size>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),[...k.entries()].sort(([x],[y])=>x==="Home"?-1:y==="Home"?1:x.localeCompare(y)).map(([x,y])=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>f(x),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:x})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:y.map(t=>e.jsx(F,{imgSrc:t.screenshotPath?`/api/editor-scenario-image/${t.id}.png`:null,name:t.name,isActive:t.id===N,onSelect:()=>v(t)},t.id))})]},x))]}),j.size>0&&e.jsx("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),[...j.entries()].map(([x,y])=>e.jsxs("div",{children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>f(x),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:x})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:y.map(t=>e.jsx(F,{imgSrc:t.screenshotPath?`/api/editor-scenario-image/${t.id}.png`:null,name:t.name,isActive:t.id===N,onSelect:()=>v(t)},t.id))})]},x)),z.map(x=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsx("button",{onClick:()=>f(x.name),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:x.name}),x.isAnalyzing&&x.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),(x.scenarios.length>0||x.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[x.scenarios.map(y=>e.jsx(F,{imgSrc:y.screenshotPath?`/api/screenshot/${y.screenshotPath}`:null,name:y.name,isActive:!1,onSelect:()=>p({analysisId:x.analysisId,scenarioId:y.id,scenarioName:y.name,entitySha:x.sha,entityName:x.name})},y.id)),x.pendingScenarios.map(y=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:y,children:y},y))]})]},x.sha)),o.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),o.map(x=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:x.name}),x.testFile&&e.jsx("span",{className:"text-[9px] text-green-400 bg-green-400/10 px-1.5 py-0.5 rounded",children:"tested"})]}),x.description&&e.jsx("p",{className:"text-[10px] text-gray-500 mt-0 mb-0 leading-relaxed",children:x.description}),e.jsx(vt,{filePath:x.filePath,projectRoot:g})]},x.name))]})]})})}function wt({items:a,onNavigate:s}){return a.length===0?null:e.jsx("nav",{className:"flex items-center gap-1 text-xs",children:a.map((i,o)=>{const g=o===a.length-1;return e.jsxs("span",{className:"flex items-center gap-1",children:[o>0&&e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-gray-500",children:e.jsx("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),g?e.jsx("span",{className:"text-white font-medium",children:i.name}):e.jsx("button",{onClick:()=>s(i.componentName),className:"text-gray-400 hover:text-white transition-colors cursor-pointer",children:i.name})]},i.componentName||"app")})})}function $e({scenarioId:a,name:s,isActive:i,onSelect:o}){const[g,N]=r.useState(!1);return e.jsxs("button",{onClick:o,className:"flex flex-col items-center gap-1.5 cursor-pointer group",title:s,children:[e.jsx("div",{className:`w-32 h-32 rounded-lg overflow-hidden border-2 transition-all ${i?"border-[#0ea5e9] ring-2 ring-[#0ea5e9]/40 shadow-lg shadow-[#0ea5e9]/20":"border-gray-200 hover:border-gray-400 shadow-sm"}`,children:g?e.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center",children:e.jsx("span",{className:"text-[9px] text-gray-400",children:"No preview"})}):e.jsx("img",{src:`/api/editor-scenario-image/${a}.png`,alt:s,className:"w-full h-full object-contain bg-white",loading:"lazy",onError:()=>N(!0)})}),e.jsx("span",{className:`text-[11px] leading-tight text-center truncate w-32 font-medium ${i?"text-gray-900":"text-gray-600 group-hover:text-gray-900"}`,children:s})]})}function yt({filePath:a,projectRoot:s}){if(!a)return null;const o=`vscode://file/${s?`${s}/${a}`:a}`;return e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-400 truncate",children:a}),e.jsx("a",{href:o,title:"Open in editor",className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function St({testFile:a,entityName:s}){const{results:i,isRunning:o,runTests:g}=Ee(a);if(o&&!i)return e.jsxs("div",{className:"pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#0ea5e9] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!i)return null;if(i.status==="error")return e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-red-500",children:i.errorMessage})});const N=s?i.testCases.filter(p=>{const u=`${s} > `;return p.fullName.startsWith(u)||p.fullName===s}):i.testCases;if(N.length===0)return null;const v=s?`${s} > `:"";return e.jsxs("div",{className:"pt-1 space-y-0.5",children:[N.map(p=>{var l;const u=v&&p.fullName.startsWith(v)?p.fullName.slice(v.length):p.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[p.status==="passed"?e.jsx("span",{className:"text-green-600 text-[10px]",children:"✓"}):p.status==="failed"?e.jsx("span",{className:"text-red-500 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-400 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${p.status==="passed"?"text-green-600":p.status==="failed"?"text-red-500":"text-gray-400"}`,children:u})]}),p.status==="failed"&&((l=p.failureMessages)==null?void 0:l.map((f,b)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-400 truncate max-w-full",title:f,children:f.split(`
3
+ `)[0]},b)))]},p.fullName)}),e.jsx("button",{onClick:g,disabled:o,className:"mt-1 text-[10px] text-[#0ea5e9] hover:text-[#38bdf8] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:o?"Running...":"Re-run"})]})}function Ct(a){if(!a||a==="/")return"Home";const i=a.split("?")[0].replace(/^\//,"").split("/")[0];return i.charAt(0).toUpperCase()+i.slice(1)}function kt({scenarios:a,glossaryFunctions:s=[],projectRoot:i,activeScenarioId:o,onScenarioSelect:g,onClose:N}){const{pageGroups:v,componentGroups:p}=r.useMemo(()=>{const u=new Map,l=new Map;for(const b of a)if(b.componentName){const k=l.get(b.componentName)||[];k.push(b),l.set(b.componentName,k)}else{const k=Ct(b.url),j=u.get(k)||[];j.push(b),u.set(k,j)}const f=new Map([...l.entries()].sort(([b],[k])=>b.localeCompare(k)));return{pageGroups:u,componentGroups:f}},[a]);return a.length===0&&s.length===0?e.jsxs("div",{className:"h-full bg-white flex items-center justify-center relative",children:[e.jsx("button",{onClick:N,className:"absolute top-2 right-3 text-gray-400 hover:text-gray-700 text-lg leading-none cursor-pointer bg-transparent border-none",title:"Close results",children:"×"}),e.jsx("span",{className:"text-sm text-gray-400",children:"No scenarios registered yet"})]}):e.jsxs("div",{className:"h-full bg-white flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 shrink-0",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Working Session Results"}),e.jsx("button",{onClick:N,className:"text-gray-400 hover:text-gray-700 text-lg leading-none cursor-pointer bg-transparent border-none",title:"Close results",children:"×"})]}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsxs("div",{className:"space-y-5",children:[v.size>0&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"})}),e.jsx("div",{className:"space-y-3 pl-1",children:[...v.entries()].sort(([u],[l])=>u==="Home"?-1:l==="Home"?1:u.localeCompare(l)).map(([u,l])=>e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-600",children:u})}),e.jsx("div",{className:"flex flex-wrap gap-3",children:l.map(f=>e.jsx($e,{scenarioId:f.id,name:f.name,isActive:f.id===o,onSelect:()=>g(f)},f.id))})]},u))})]}),p.size>0&&e.jsxs("div",{className:v.size>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),e.jsx("div",{className:"space-y-3 pl-1",children:[...p.entries()].map(([u,l])=>e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-600",children:u})}),e.jsx("div",{className:"flex flex-wrap gap-3",children:l.map(f=>e.jsx($e,{scenarioId:f.id,name:f.name,isActive:f.id===o,onSelect:()=>g(f)},f.id))})]},u))})]}),s.length>0&&e.jsxs("div",{className:a.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),e.jsx("div",{className:"space-y-2 pl-1",children:s.map(u=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-700",children:u.name})}),e.jsx(yt,{filePath:u.filePath,projectRoot:i}),u.testFile?e.jsx(St,{testFile:u.testFile,entityName:u.name}):e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-400",children:"No test file"})})]},u.name))})]})]})})]})}function K(a){return a.replace(/[^a-zA-Z0-9_]+/g,"_")}function Pt(a){const{activeAnalyzedScenario:s,analyzedPreviewUrl:i,activeScenarioId:o,scenarios:g,proxyUrl:N,devServerUrl:v,zoomComponent:p}=a;if(s&&i)return i;if(s&&!i)return null;if(o){const l=g.find(f=>f.id===o);if(l!=null&&l.url){const f=N||v;return f?l.url.startsWith("/")?`${f}${l.url}`:l.url:null}}const u=N||v;if(!u)return null;if(p&&o){const l=g.find(b=>b.id===o),f=l?K(l.name):"Default";return`${u}/__codeyam__/${p}/${f}`}return u}function Mt(a,s){const i=s.width,o=s.height??900,g=a.width,N=a.height;return i<=g&&o<=N?1:Math.min(g/i,N/o)}const Bt=()=>[{title:"Editor - CodeYam"},{name:"description",content:"CodeYam Code + Data Editor"}],he=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}];function $t({analysisId:a,scenarioId:s,scenarioName:i,entityName:o,projectSlug:g,onStateChange:N}){const{interactiveServerUrl:v,isStarting:p,isLoading:u}=dt({analysisId:a,scenarioId:s,scenarioName:i,entityName:o,projectSlug:g,enabled:!0});return r.useEffect(()=>{N(v,p||u)},[v,p,u,N]),null}const _t=et(function(){const{projectSlug:s,projectRoot:i,hasProject:o,scenarios:g,analyzedEntities:N,glossaryFunctions:v,entityImports:p}=tt(),u=st(),[l,f]=at(),b=r.useRef(null),k=r.useRef(null),j=r.useRef(null),I=l.get("zoom")||void 0,$=l.get("scenario")||void 0;r.useEffect(()=>{if(!$)return;const n=g.find(C=>C.id===$);if(!n)return;const m=K(n.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:m,scenarioId:n.id})}).catch(()=>{})},[$,g]),r.useEffect(()=>{const n=new BroadcastChannel("codeyam-editor");return n.onmessage=m=>{var C;if(((C=m.data)==null?void 0:C.type)==="switch-scenario"&&m.data.scenarioId){const E=m.data.scenarioId,A=g.find(xe=>xe.id===E);if(!A)return;const Z=new URLSearchParams(l);Z.set("scenario",E),Z.delete("zoom"),f(Z),_(null),q(null),O(null);const Ze=K(A.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:Ze,scenarioId:E})}).then(()=>{G(xe=>xe+1),M(!1)}).catch(()=>{})}},()=>n.close()},[l,f,g]),r.useEffect(()=>{if(l.get("ref")!=="link"||!$)return;const n=new BroadcastChannel("codeyam-editor");n.postMessage({type:"switch-scenario",scenarioId:$}),n.close(),window.close()},[]);const[R,z]=r.useState(null),[B,x]=r.useState(null),[y,t]=r.useState(!1),[d,h]=r.useState(null),[S,M]=r.useState(!1),[w,c]=r.useState(!0),[P,_]=r.useState(null),[pe,q]=r.useState(null),[ee,ue]=r.useState(!1),[D,O]=r.useState(null),[fe,ge]=r.useState(!1),[je,Q]=r.useState(null),Ie=r.useCallback(n=>{O(n),Q(null)},[]),Le=r.useCallback((n,m)=>{q(C=>(n&&n!==C&&M(!1),n)),!m&&n&&M(!0),ue(m)},[]),ve=r.useCallback(n=>{O(null),_(C=>(C&&C.analysisId===n.analysisId||(q(null),G(A=>A+1)),n)),ue(!0),M(!1);const m=new URLSearchParams(l);m.delete("scenario"),m.delete("zoom"),f(m)},[l,f]),[Te,Ne]=r.useState(1440),[L,te]=r.useState({name:"Desktop",width:1440,height:900}),[Re,se]=r.useState(!1),[ae,ze]=r.useState(null),[T,H]=r.useState("app"),Ae=r.useCallback(()=>{H("build"),re(!0)},[]),[Be,re]=r.useState(!1),[_e,be]=r.useState(!1),De=r.useCallback(n=>{be(n)},[]),[ne,we]=r.useState(!1),Ue=r.useCallback(()=>{we(!0),H("build"),re(!0)},[]),ye=r.useCallback(()=>{we(!1)},[]),[W,ie]=r.useState(!1),Fe=r.useCallback(()=>{if(W){ie(!1);return}typeof Notification<"u"&&Notification.permission==="default"?Notification.requestPermission().then(n=>{n==="granted"&&ie(!0)}):ie(!0)},[W]);r.useEffect(()=>{if(T==="build"){be(!1);const n=setTimeout(()=>{var m,C;(m=b.current)==null||m.scrollToBottom(),(C=b.current)==null||C.focus()},50);return()=>clearTimeout(n)}},[T]);const[le,Oe]=r.useState(null);r.useEffect(()=>{const n=j.current;if(!n)return;const m=new ResizeObserver(C=>{const E=C[0];E&&Oe({width:E.contentRect.width,height:E.contentRect.height})});return m.observe(n),()=>m.disconnect()},[]);const J=r.useMemo(()=>le?Mt(le,L):1,[le,L]),[He,G]=r.useState(0),[oe,Se]=r.useState(null),We=r.useCallback(n=>{Se(n||null),G(m=>m+1)},[]),{customSizes:Ce,addCustomSize:Je}=rt(s),X=r.useMemo(()=>[...he,...Ce],[Ce]),ke=r.useRef(!1);r.useEffect(()=>{let n=!1,m=null;const C=async()=>{try{const E=await fetch("/api/editor-dev-server");if(n)return;const A=await E.json();if(A.status==="error")z(null),x(null),t(!1),h(A.errorMessage||"Dev server crashed");else if(A.url)z(A.url),x(A.proxyUrl||null),t(!1),h(null),c(!0);else if(A.status==="starting")t(!0),h(null),c(!0);else if(A.status==="stopped")if(R)z(null),t(!1);else if(ke.current)t(!1);else{ke.current=!0;try{(await fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})})).ok?t(!0):c(!1)}catch{}}}catch{}};return C(),m=setInterval(()=>void C(),2e3),()=>{n=!0,m&&clearInterval(m)}},[R]),r.useEffect(()=>{const n=new EventSource("/api/events");let m=null;return n.addEventListener("message",C=>{try{const E=JSON.parse(C.data);(E.type==="db-change"||E.type==="unknown")&&(m&&clearTimeout(m),m=setTimeout(()=>{u.revalidate()},2e3))}catch{}}),()=>{m&&clearTimeout(m),n.close()}},[u]);const Ve=r.useMemo(()=>{const n=[{name:"App"}];return I&&n.push({name:I,componentName:I}),n},[I]),ce=r.useCallback(n=>{const m=new URLSearchParams(l);if(n){m.set("zoom",n);const C=g.find(E=>E.componentName===n||E.componentName===null&&n==="Home");if(C){m.set("scenario",C.id);const E=K(C.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:E,scenarioId:C.id})}).catch(()=>{}),G(A=>A+1),M(!1)}else m.delete("scenario")}else m.delete("zoom"),m.delete("scenario");f(m)},[l,f,g]),de=r.useCallback(n=>{_(null),q(null),O(null);const m=new URLSearchParams(l);m.set("scenario",n.id),f(m);const C=K(n.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:C,scenarioId:n.id})}).catch(()=>{}),G(E=>E+1),M(!1)},[l,f]),Ge=(n,m)=>{Ne(n);const C=X.find(E=>E.width===n&&E.height===m);te({name:(C==null?void 0:C.name)||"Custom",width:n,height:m})},Pe=n=>{Ne(n.width),te({name:n.name,width:n.width,height:n.height})},Ye=n=>{Je(n,L.width,L.height??900),se(!1),te(m=>({...m,name:n}))},Ke=()=>{P||M(!0)},qe=r.useCallback(()=>{h(null),t(!0),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restart"})}).catch(()=>{})},[]),Qe=r.useCallback(()=>{h(null),t(!0),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})}).catch(()=>{})},[]),U=r.useMemo(()=>Pt({activeAnalyzedScenario:!!P,analyzedPreviewUrl:pe,activeScenarioId:$||null,scenarios:g,proxyUrl:B,devServerUrl:R,zoomComponent:I||null}),[B,R,I,$,g,P,pe]),Xe=r.useMemo(()=>{if(!U||!oe)return U;try{const n=new URL(U);return n.pathname=oe,n.href}catch{return U}},[U,oe]);return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[P&&e.jsx($t,{analysisId:P.analysisId,scenarioId:P.scenarioId,scenarioName:P.scenarioName,entityName:P.entityName,projectSlug:s,onStateChange:Le},P.analysisId),e.jsx("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:ct,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:"Editor"}),I&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-gray-600"}),e.jsx(wt,{items:Ve,onNavigate:ce})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-auto",children:"Code + Data"})]})}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[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:`${he[he.length-1].width}px`,width:"100%"},children:e.jsx(nt,{currentViewportWidth:Te,currentPresetName:L.name,onDevicePresetClick:Pe,devicePresets:X,hideLabel:!0,onHoverChange:ze,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:(ae==null?void 0:ae.name)||L.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:L.name,onChange:n=>{const m=X.find(C=>C.name===n.target.value);m&&Pe(m)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[X.map(n=>e.jsx("option",{value:n.name,children:n.name},n.name)),L.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:L.width,onChange:n=>{const m=parseInt(n.target.value,10);!isNaN(m)&&m>0&&Ge(m,L.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:"x"}),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:L.height??900}),L.name==="Custom"&&e.jsx("button",{onClick:()=>se(!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",{ref:j,className:"flex-1 flex items-center justify-center overflow-hidden p-8",style:{backgroundImage:`
4
+ linear-gradient(45deg, #ebebeb 25%, transparent 25%),
5
+ linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
6
+ linear-gradient(45deg, transparent 75%, #ebebeb 75%),
7
+ linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
8
+ `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:D?e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-[700px] w-full",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#333] m-0 font-['IBM_Plex_Sans']",children:"Journal Screenshot"}),e.jsx("p",{className:"text-sm text-[#888] mt-1 m-0 font-['IBM_Plex_Sans']",children:"This is a snapshot from a previous version — not a live preview"})]}),e.jsx("div",{className:"rounded-lg overflow-hidden border-2 border-[#ccc] shadow-md max-w-full w-fit",children:e.jsx("img",{src:D.screenshotUrl,alt:D.scenarioName,className:"max-w-full h-auto block"})}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#666]",children:[D.commitSha&&e.jsx("span",{className:"font-mono text-xs text-[#00a0c4] bg-[#00a0c4]/15 px-2 py-0.5 rounded",children:D.commitSha.slice(0,7)}),e.jsxs("span",{className:"truncate",children:[D.scenarioName,D.commitMessage&&` — ${D.commitMessage}`]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>O(null),className:"text-sm text-[#888] hover:text-[#333] transition-colors cursor-pointer px-3 py-1.5 rounded border border-[#ccc] hover:border-[#999] bg-white",children:"Back to live preview"}),D.commitSha&&e.jsx("button",{onClick:()=>{ge(!0),Q(null),fetch("/api/editor-load-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitSha:D.commitSha})}).then(n=>n.json()).then(n=>{n.success?(O(null),t(!0),M(!1)):Q(n.error||"Failed to load commit")}).catch(n=>{Q(n instanceof Error?n.message:"Network error")}).finally(()=>{ge(!1)})},disabled:fe,className:"bg-[#005c75] hover:bg-[#004d63] disabled:opacity-50 text-white text-sm font-medium px-4 py-1.5 rounded transition-colors cursor-pointer",children:fe?"Loading...":"Load this version"})]}),je&&e.jsx("div",{className:"bg-red-50 border border-red-200 rounded px-4 py-2 text-sm text-red-600 w-full text-center",children:je})]}):U?e.jsx("div",{style:{width:`${L.width*J}px`,height:`${(L.height??900)*J}px`},children:e.jsxs("div",{className:"relative bg-white origin-top-left",style:{width:`${L.width}px`,height:`${L.height??900}px`,transform:J<1?`scale(${J})`:void 0},children:[!S&&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(Me,{})}),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:"Loading Preview"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the app to render"})]})]})}),e.jsx("iframe",{ref:k,src:Xe||U,className:"w-full h-full border-none",title:"Editor preview",onLoad:Ke,style:{opacity:S?1:0}},He)]})}):e.jsx("div",{className:"bg-white rounded-lg shadow-sm flex flex-col items-center justify-center",style:{width:`${L.width*J}px`,height:`${(L.height??900)*J}px`},children:d?e.jsxs("div",{className:"flex flex-col gap-4 text-center px-8 max-w-[600px]",children:[e.jsx("h2",{className:"text-xl font-medium text-red-600 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Dev Server Failed"}),e.jsx("pre",{className:"text-xs text-left bg-gray-100 text-gray-800 p-4 rounded overflow-auto max-h-[300px] w-full font-mono whitespace-pre-wrap",children:d}),e.jsx("button",{onClick:qe,className:"mx-auto px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Retry"})]}):y||ee?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(Me,{})}),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:ee?"Starting Interactive Mode":"Starting Dev Server"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:ee?"Loading component preview...":"Your dev server is starting up..."})]})]}):e.jsxs("div",{className:"flex flex-col gap-3 text-center px-8",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Code + Data Editor"}),e.jsx("p",{className:"text-sm text-[#888] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Describe what you want to build in the chat"})]})})})]}),e.jsxs("aside",{className:"w-[50%] min-w-[400px] max-w-[800px] bg-[#1e1e1e] border-r border-[#3d3d3d] shrink-0 flex flex-col overflow-hidden order-first",children:[e.jsxs("div",{className:"border-b border-[#3d3d3d] px-4 shrink-0 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("button",{onClick:()=>H("app"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${T==="app"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["App",T==="app"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>{H("build"),re(!0)},className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${T==="build"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Build",_e&&T!=="build"&&e.jsx("span",{className:"ml-1.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse"}),T==="build"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>H("data"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${T==="data"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Data",T==="data"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>H("journal"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${T==="journal"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Journal",T==="journal"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]})]}),typeof Notification<"u"&&e.jsx("button",{onClick:Fe,className:`px-2 py-1 text-[10px] rounded transition-colors cursor-pointer ${W?"text-green-400 hover:text-green-300":"text-gray-500 hover:text-gray-300"}`,title:W?"Click to turn off notifications":"Click to get notified when Claude finishes",children:W?"Notifications On":"Notifications Off"})]}),e.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[Be&&e.jsxs("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:T==="build"?"visible":"hidden"},children:[e.jsx("div",{className:ne?"flex-1 min-h-0":"flex-1",style:ne?{flex:"1 1 50%"}:void 0,children:e.jsx(lt,{ref:b,entityName:"Editor",projectSlug:s,entityFilePath:null,scenarioName:null,onRefreshPreview:We,onShowResults:Ue,onHideResults:ye,editorMode:!0,onIdleChange:De,notificationsEnabled:W})}),ne&&e.jsx("div",{style:{flex:"1 1 50%"},className:"min-h-0 border-t-2 border-gray-300",children:e.jsx(kt,{scenarios:g,glossaryFunctions:v,projectRoot:i,activeScenarioId:$,onScenarioSelect:de,onClose:ye})})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:T==="app"?"visible":"hidden"},children:e.jsx(bt,{hasProject:o,scenarios:g,analyzedEntities:[],glossaryFunctions:v,projectRoot:i,activeScenarioId:$,onScenarioSelect:de,onAnalyzedScenarioSelect:ve,onSwitchToBuild:Ae,zoomComponent:I,onZoomChange:ce,entityImports:p})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:T==="data"?"visible":"hidden"},children:e.jsx(mt,{scenarios:g,projectRoot:i,activeScenarioId:$,onScenarioSelect:de,zoomComponent:I,onZoomChange:ce,analyzedEntities:[],glossaryFunctions:v,activeAnalyzedScenarioId:P==null?void 0:P.scenarioId,onAnalyzedScenarioSelect:ve,entityImports:p})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:T==="journal"?"visible":"hidden"},children:e.jsx(jt,{isActive:T==="journal",onScreenshotClick:Ie})})]})]})]}),e.jsx(ot,{serverUrl:R,isStarting:y,projectSlug:s,devServerError:d,onStartServer:w?Qe:void 0}),Re&&e.jsx(it,{width:L.width,height:L.height??900,onSave:Ye,onCancel:()=>se(!1)})]})});export{_t as default,Bt as meta};