@codeyam/codeyam-cli 0.1.0-staging.eb21b2f → 0.1.0-staging.f777668
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.
- package/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +21 -21
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +34 -3
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +114 -113
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +259 -5
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +78 -2
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +19 -7
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +9 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +0 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +65 -28
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +83 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
- package/analyzer-template/packages/aws/package.json +10 -10
- package/analyzer-template/packages/database/index.ts +1 -0
- package/analyzer-template/packages/database/package.json +3 -3
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +68 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +151 -135
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
- package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/index.js +1 -0
- package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +5 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +22 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +51 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +100 -89
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +1 -0
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +10 -0
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +1 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +10 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +6 -2
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +14 -2
- package/analyzer-template/playwright/captureFromUrl.ts +89 -82
- package/analyzer-template/project/constructMockCode.ts +168 -48
- package/analyzer-template/project/orchestrateCapture.ts +4 -1
- package/analyzer-template/project/reconcileMockDataKeys.ts +19 -14
- package/analyzer-template/project/start.ts +3 -0
- package/analyzer-template/project/startScenarioCapture.ts +9 -0
- package/analyzer-template/project/writeClientLogRoute.ts +125 -0
- package/analyzer-template/project/writeMockDataTsx.ts +17 -0
- package/analyzer-template/project/writeScenarioComponents.ts +96 -17
- package/analyzer-template/tsconfig.json +13 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +143 -39
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +4 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +17 -11
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +2 -0
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
- package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -0
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +73 -12
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +208 -11
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/cli.js +32 -25
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +17 -7
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +14 -2
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +2607 -0
- package/codeyam-cli/src/commands/editor.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +40 -11
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +29 -58
- package/codeyam-cli/src/commands/memory.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +635 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +155 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +393 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +266 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1686 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +6 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +101 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +246 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +50 -4
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +50 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +21 -5
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/buildFlags.js +4 -0
- package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
- package/codeyam-cli/src/utils/devModeEvents.js +40 -0
- package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
- package/codeyam-cli/src/utils/devServerState.js +71 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -0
- package/codeyam-cli/src/utils/editorApi.js +73 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +159 -0
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
- package/codeyam-cli/src/utils/editorCapture.js +102 -0
- package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +109 -0
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +225 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +81 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorMockState.js +248 -0
- package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +106 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +96 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +337 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +107 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
- package/codeyam-cli/src/utils/fileMetadata.js +5 -0
- package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +25 -9
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +103 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +57 -15
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js +2 -2
- package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -1
- package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
- package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
- package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
- package/codeyam-cli/src/utils/project.js +15 -5
- package/codeyam-cli/src/utils/project.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
- package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
- package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +70 -1
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +7 -6
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +5 -6
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +0 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +2 -4
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +2 -5
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +1 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -1
- package/codeyam-cli/src/utils/rules/parser.js +14 -4
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
- package/codeyam-cli/src/utils/rules/pathMatcher.js +34 -3
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -1
- package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
- package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
- package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
- package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
- package/codeyam-cli/src/utils/scenariosManifest.js +112 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
- package/codeyam-cli/src/utils/serverState.js +27 -2
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +82 -11
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +159 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/testRunner.js +158 -0
- package/codeyam-cli/src/utils/testRunner.js.map +1 -0
- package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
- package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
- package/codeyam-cli/src/utils/versionInfo.js +21 -0
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +14 -2
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +41 -27
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/git.js +396 -0
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +118 -18
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-jNYXRRNI.js → CopyButton-DmJveP3T.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-bwuHPyTa.js → EntityItem-C76mRRiF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CvzqMxcu.js → EntityTypeBadge-g3saevPb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BH0XDim7.js → EntityTypeIcon-CobE682z.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-yjIHlOGa.js → InteractivePreview-DYFW3lDD.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-Cq5o8jL4.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BvMu2i-g.js → LoadingDots-BU_OAEMP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-kgBTLoJD.js → LogViewer-ceAyBX-H.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzPgx-xO.js → ReportIssueModal-djPLI-WV.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CwZrv-Ok.js → SafeScreenshot-BED4B6sP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BX2Ny2Qj.js → ScenarioViewer-ZlRKbhrq.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CDpEprKa.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BRx8ZGZo.js → _index-C96V0n15.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-4S4yPfFw.js → activity.(_tab)-BpKzcsJz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-D9hemwl6.js +22 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.dev-mode-events-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-D4IPYH_y.js → book-open-D_nMCFmP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-CG65viiV.js → chevron-down-BH2h1Ea2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-DB3aFuEO.js → chunk-JZWAC4HX-C4pqxYJB.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-igfMr5DY.js → circle-check-DyIKORY6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-Coc4o_8c.js → copy-NDbZjXao.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-D1zB-pYc.js → createLucideIcon-CMT1jU2q.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CltMNppm.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor-DTEBHY7Z.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-B7ztwLut.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-B0h9AqE6.js → entity._sha._-DItJnD8s.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D5rYBT5x.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-PePWg17F.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-I-Wo99C_.js → entry.client-DTvKq3TY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-9sMMAiWJ.js → fileTableUtils-cPo8LiG3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-Co65J0s3.js → files-DO4CZ16O.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-CdN8sCqs.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-JMY99HpD.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CUM5iXwc.js → index-10oVnAAH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-_417gcQW.js → index-BcvgDzbZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-TzRHMVog.js → loader-circle-BAXYRVEO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-7aab51c4.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +96 -0
- package/codeyam-cli/src/webserver/build/client/assets/{pause-hjzB7t2z.js → pause-DTAcYxBt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-FRztnN-P.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-DcAwD_Ln.js → search-fKo7v0Zo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-DVNJVQgD.js → simulations-B3aOzpCZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-DbEAHMbA.js → terminal-BG4heKCG.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CAD5b1o_.js → triangle-alert-DtSmdtM4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-CrAK28Bc.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DZlYx2c4.js → useReportContext-O-jkvSPx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-ihdMtlf6.js → useToast-9FIWuYfK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-Cz751Dm2.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DSylnYVM.js +367 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/devServer.js +39 -5
- package/codeyam-cli/src/webserver/devServer.js.map +1 -1
- package/codeyam-cli/src/webserver/editorProxy.js +431 -0
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +230 -0
- package/codeyam-cli/src/webserver/server.js +258 -1
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +706 -0
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +68 -0
- package/codeyam-cli/templates/editor-step-hook.py +208 -0
- package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
- package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
- package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
- package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
- package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
- package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
- package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/PRISMA_SETUP.md +84 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +19 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +38 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +37 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +89 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
- package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
- package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
- package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
- package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
- package/codeyam-cli/templates/rule-notification-hook.py +44 -17
- package/codeyam-cli/templates/rule-reflection-hook.py +24 -4
- package/codeyam-cli/templates/rules-instructions.md +34 -88
- package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +136 -0
- package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -2
- package/package.json +21 -14
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +22 -4
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +10 -7
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +234 -3
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
- package/packages/ai/src/lib/generateEntityScenarioData.js +57 -2
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +13 -4
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +8 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +0 -5
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +54 -27
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +65 -0
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +18 -4
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/database/index.js +1 -0
- package/packages/database/index.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +5 -0
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +51 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- package/packages/database/src/lib/loadCommits.js +23 -13
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +100 -89
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +6 -2
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/scripts/npm-post-install.cjs +34 -0
- package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -120
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
- package/codeyam-cli/src/commands/list.js +0 -31
- package/codeyam-cli/src/commands/list.js.map +0 -1
- package/codeyam-cli/src/commands/webapp-info.js +0 -146
- package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
- package/codeyam-cli/src/utils/universal-mocks.js +0 -152
- package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-EhOseatT.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +0 -17
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-JTAjQ54M.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CtYowLOt.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/git-BdHOxVfg.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-390cb8fa.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-CzZySbBE.js +0 -78
- package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +0 -62
- package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BqgrAzs3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-DAFqfEDH.js +0 -2
- package/codeyam-cli/src/webserver/build/server/assets/index-CXfuiwt3.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BSvme_Ao.js +0 -259
- package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
- package/scripts/finalize-analyzer.cjs +0 -13
- /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { runClaudeCode } from "./claude-code.js";
|
|
2
|
-
export async function detectUniversalMocks(existingMocks = [], progressCallback) {
|
|
3
|
-
const claudeResult = await runClaudeCode({
|
|
4
|
-
prompt: getPrompt(existingMocks),
|
|
5
|
-
allowedTools: ['Bash(jq:*)'],
|
|
6
|
-
progressCallback,
|
|
7
|
-
});
|
|
8
|
-
if (!claudeResult) {
|
|
9
|
-
// Claude Code package failed to load, return empty mocks
|
|
10
|
-
return {
|
|
11
|
-
universalMocks: existingMocks,
|
|
12
|
-
duration_ms: 0,
|
|
13
|
-
total_cost_usd: 0,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
let resultString = claudeResult.result;
|
|
17
|
-
// use regexp to extract ths ```json\n...\n``` block
|
|
18
|
-
const jsonMatch = resultString.match(/```json\n([\s\S]*?)\n```/);
|
|
19
|
-
if (jsonMatch && jsonMatch.length > 1) {
|
|
20
|
-
resultString = jsonMatch[1].trim();
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
console.warn(`CodeYam Warning: Claude Code did not return markdown-wrapped JSON`);
|
|
24
|
-
// fall back to the entire result if no JSON block is found
|
|
25
|
-
}
|
|
26
|
-
const result = JSON.parse(resultString);
|
|
27
|
-
const universalMocks = result && result.universalMocks && Array.isArray(result.universalMocks)
|
|
28
|
-
? result.universalMocks
|
|
29
|
-
.map((mock) => {
|
|
30
|
-
if (mock.content &&
|
|
31
|
-
typeof mock.content === 'string' &&
|
|
32
|
-
mock.filePath &&
|
|
33
|
-
typeof mock.filePath === 'string' &&
|
|
34
|
-
mock.entityName &&
|
|
35
|
-
typeof mock.entityName === 'string') {
|
|
36
|
-
return {
|
|
37
|
-
content: mock.content,
|
|
38
|
-
filePath: mock.filePath,
|
|
39
|
-
entityName: mock.entityName,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
console.warn(`CodeYam Warning: Invalid universal mock format`, mock);
|
|
43
|
-
return null;
|
|
44
|
-
})
|
|
45
|
-
.filter((mock) => mock !== null)
|
|
46
|
-
: [];
|
|
47
|
-
return {
|
|
48
|
-
universalMocks,
|
|
49
|
-
duration_ms: claudeResult.duration_ms,
|
|
50
|
-
total_cost_usd: claudeResult.total_cost_usd,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function getPrompt(existingMocks) {
|
|
54
|
-
const mocksString = JSON.stringify(existingMocks);
|
|
55
|
-
return `
|
|
56
|
-
Hi Claude! You should find in this directory a primarily TypeScript-based web application. If that doesn't seem to be the case, return an error object:
|
|
57
|
-
\`\`\`
|
|
58
|
-
{
|
|
59
|
-
"error": "<reason for failure>"
|
|
60
|
-
}
|
|
61
|
-
\`\`\`
|
|
62
|
-
|
|
63
|
-
Now, your job is to explore the codebase and read enough source modules to determine if any of them rely on environment variables or external services in a way which **prevents startup**. You will MODIFY NO FILES. You are only gathering data, and you will finish by outputting a JSON object of these 'universal mocks'.
|
|
64
|
-
|
|
65
|
-
**CRITICAL: Mocks should be MINIMAL** - just enough to prevent startup crashes, not comprehensive implementations.
|
|
66
|
-
|
|
67
|
-
We will illustrate with examples:
|
|
68
|
-
|
|
69
|
-
**Example 1: Class that's initialized on load**
|
|
70
|
-
File: \`lib/dbNotifier.ts\`
|
|
71
|
-
\`\`\`
|
|
72
|
-
export class DbNotifier extends EventEmitter {
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
this.db = connectToDatabase(process.env.DATABASE_URL!); // ❌ Crashes on load
|
|
76
|
-
}
|
|
77
|
-
async start() { /* ... */ }
|
|
78
|
-
}
|
|
79
|
-
\`\`\`
|
|
80
|
-
|
|
81
|
-
**Minimal mock** (just enough to start):
|
|
82
|
-
\`\`\`
|
|
83
|
-
class DbNotifier extends EventEmitter { async start() {} }
|
|
84
|
-
\`\`\`
|
|
85
|
-
|
|
86
|
-
**Example 2: Client initialized on load**
|
|
87
|
-
File: \`lib/supabase.ts\`
|
|
88
|
-
\`\`\`
|
|
89
|
-
import { createClient } from "@supabase/supabase-js"
|
|
90
|
-
export const supabase = createClient(
|
|
91
|
-
process.env.NEXT_PUBLIC_SUPABASE_URL!, // ❌ Crashes on load
|
|
92
|
-
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
|
93
|
-
)
|
|
94
|
-
\`\`\`
|
|
95
|
-
|
|
96
|
-
**Minimal mock**:
|
|
97
|
-
\`\`\`
|
|
98
|
-
export const supabase = {
|
|
99
|
-
auth: {
|
|
100
|
-
getSession: async () => ({ data: { session: null } }),
|
|
101
|
-
onAuthStateChange: () => ({ data: { subscription: { unsubscribe: () => {} } } })
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
\`\`\`
|
|
105
|
-
|
|
106
|
-
**Example 3: NO MOCK NEEDED**
|
|
107
|
-
File: \`lib/client.ts\`
|
|
108
|
-
\`\`\`
|
|
109
|
-
export function getClient() {
|
|
110
|
-
return createClient(process.env.API_URL!); // ✅ OK - not called on load
|
|
111
|
-
}
|
|
112
|
-
\`\`\`
|
|
113
|
-
No mock needed - lazy initialization won't crash on startup.
|
|
114
|
-
|
|
115
|
-
**Key principles:**
|
|
116
|
-
1. Only mock things that are **executed during module load**
|
|
117
|
-
2. Mocks should be **minimal** - empty methods/properties are fine
|
|
118
|
-
3. We need the app to **compile and start**, not work correctly
|
|
119
|
-
4. Return types should match what TypeScript expects (but values can be empty/null) When you've determined that a file requires a universal mock, you will include it in your output, which might look something like this:
|
|
120
|
-
\`\`\`json
|
|
121
|
-
{
|
|
122
|
-
"universalMocks": [
|
|
123
|
-
{
|
|
124
|
-
"entityName": "DbNotifier",
|
|
125
|
-
"filePath": "lib/dbNotifier.ts",
|
|
126
|
-
"content": "class DbNotifier extends EventEmitter { async start() {} }"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"entityName": "supabase",
|
|
130
|
-
"filePath": "lib/supabase.ts",
|
|
131
|
-
"content": "export const supabase = { auth: { getSession: async () => ({ data: { session: null } }) } };"
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
\`\`\`
|
|
136
|
-
|
|
137
|
-
Note: You MUST wrap the result JSON in \`\`\`json\n...\n\`\`\` so that it can later be extracted programmatically.
|
|
138
|
-
|
|
139
|
-
So a "universal mock" object contains of a file path (\`/example/lib/supabase.ts\` in our case), an entity name (\`supabase\`), and the full text of the TypeScript with which to replace that entity in the mocked-up module.
|
|
140
|
-
- There can be multiple mocks in the same file, for different entities. An entity is e.g. a function, a type, a variable, a React component, etc.
|
|
141
|
-
- Each universal mock should contain ONLY the replacement content for a single entity. If a file exports multiple entities that need mocking, create separate mock objects for each entity.
|
|
142
|
-
- Remember that the JSON string must be escaped.
|
|
143
|
-
|
|
144
|
-
The current \`universalMocks\` array, which you should merge into / append to, is as follows:
|
|
145
|
-
\`\`\`
|
|
146
|
-
${mocksString}
|
|
147
|
-
\`\`\`
|
|
148
|
-
|
|
149
|
-
Now put on your best sleuthing cap and figure out how to scan this repository for likely signs of external dependencies that may need mocking, compile a list of universal mocks, and return it as JSON on the format shown above.
|
|
150
|
-
`;
|
|
151
|
-
}
|
|
152
|
-
//# sourceMappingURL=universal-mocks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"universal-mocks.js","sourceRoot":"","sources":["../../../../src/utils/universal-mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,gBAAmD,EAAE,EACrD,gBAAiD;IAMjD,MAAM,YAAY,GAAG,MAAM,aAAa,CAAC;QACvC,MAAM,EAAE,SAAS,CAAC,aAAa,CAAC;QAChC,YAAY,EAAE,CAAC,YAAY,CAAC;QAC5B,gBAAgB;KACjB,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,yDAAyD;QACzD,OAAO;YACL,cAAc,EAAE,aAAa;YAC7B,WAAW,EAAE,CAAC;YACd,cAAc,EAAE,CAAC;SAClB,CAAC;IACJ,CAAC;IAED,IAAI,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;IAEvC,oDAAoD;IACpD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACjE,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,IAAI,CACV,mEAAmE,CACpE,CAAC;QACF,2DAA2D;IAC7D,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACxC,MAAM,cAAc,GAClB,MAAM,IAAI,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;QACrE,CAAC,CAAC,MAAM,CAAC,cAAc;aAClB,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACjB,IACE,IAAI,CAAC,OAAO;gBACZ,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;gBAChC,IAAI,CAAC,QAAQ;gBACb,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ;gBACjC,IAAI,CAAC,UAAU;gBACf,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,EACnC,CAAC;gBACD,OAAO;oBACL,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,UAAU,EAAE,IAAI,CAAC,UAAU;iBAC5B,CAAC;YACJ,CAAC;YACD,OAAO,CAAC,IAAI,CACV,gDAAgD,EAChD,IAAI,CACL,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAiB,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC;QACjD,CAAC,CAAC,EAAE,CAAC;IAET,OAAO;QACL,cAAc;QACd,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,cAAc,EAAE,YAAY,CAAC,cAAc;KAC5C,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,aAAqB;IACtC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAElD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FP,WAAW;;;;GAIV,CAAC;AACJ,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{c as _,r as e,j as h}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as K}from"./useLastLogLine-DAFqfEDH.js";function U(s){const r=s.replace(/[^a-zA-Z0-9_]+/g,"_");return r.slice(0,1).toUpperCase()+r.slice(1)}function V({analysisId:s,scenarioId:r,scenarioName:a,projectSlug:i,enabled:g=!0,refreshTrigger:f=0}){const k=_(),[S,w]=e.useState(null),[A,E]=e.useState(!1),[B,c]=e.useState(!1),[q,l]=e.useState(!1),d=e.useRef(!1),x=e.useRef(null),I=e.useRef(null),[M,m]=e.useState(0),[z,R]=e.useState(0),n=e.useRef(null),u=e.useRef(!1),{interactiveUrl:b,resetLogs:L}=K(i,g),y=e.useRef(r),F=e.useRef(f);e.useEffect(()=>{F.current!==f&&(F.current=f,S&&(console.log("[useInteractiveMode] Manual refresh triggered"),c(!0),l(!1),m(0),R(t=>t+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null)))},[f,S]),e.useEffect(()=>{if(y.current!==r&&(y.current=r,x.current&&I.current&&a)){const t=U(I.current),o=U(a),p=x.current.replace(t,o);w(p),c(!0),l(!1),m(0),R(v=>v+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null);return}},[r,a]),e.useEffect(()=>{if(b){const t=b+"?width=600px";x.current=t,a&&(I.current=a),w(t),E(!1),c(!0)}},[b]),e.useEffect(()=>{const t=o=>{o.data.type==="codeyam-resize"&&(u.current||(u.current=!0,n.current&&(clearTimeout(n.current),n.current=null),m(0),l(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const j=()=>{u.current=!1,n.current&&clearTimeout(n.current);const t=500*Math.pow(2,M);n.current=setTimeout(()=>{u.current||(M<2?(m(o=>o+1),R(o=>o+1),c(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),l(!0),c(!1)))},t)};return e.useEffect(()=>{g&&!d.current&&r&&s&&(d.current=!0,E(!0),l(!1),w(null),(async()=>{if(i)try{await fetch(`/api/logs/${i}`,{method:"DELETE"})}catch(o){console.error("[useInteractiveMode] Failed to clear log file:",o)}L(),k.submit({action:"start",analysisId:s,scenarioId:r},{method:"post",action:"/api/interactive-mode"})})())},[g,r,s,L,i]),e.useEffect(()=>{const t=s,o=()=>{if(d.current&&t){const v=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",v);console.log("[useInteractiveMode] sendBeacon result:",T),T||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:v,keepalive:!0}).catch(D=>console.error("Failed to stop interactive mode:",D)))}},p=()=>{o()};return window.addEventListener("beforeunload",p),()=>{window.removeEventListener("beforeunload",p),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),o()}},[s]),{interactiveServerUrl:S,isStarting:A,isLoading:B,showIframe:q,iframeKey:z,onIframeLoad:j}}function Z(){return h.jsxs("div",{className:"spinner-container",children:[h.jsx("span",{className:"loader"}),h.jsx("style",{children:`
|
|
2
|
-
.loader {
|
|
3
|
-
width: 48px;
|
|
4
|
-
height: 48px;
|
|
5
|
-
border: 3px solid rgba(0, 92, 117, 0.2);
|
|
6
|
-
border-radius: 50%;
|
|
7
|
-
display: inline-block;
|
|
8
|
-
position: relative;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
animation: rotation 1s linear infinite;
|
|
11
|
-
}
|
|
12
|
-
.loader::after {
|
|
13
|
-
content: '';
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
position: absolute;
|
|
16
|
-
left: 50%;
|
|
17
|
-
top: 50%;
|
|
18
|
-
transform: translate(-50%, -50%);
|
|
19
|
-
width: 56px;
|
|
20
|
-
height: 56px;
|
|
21
|
-
border-radius: 50%;
|
|
22
|
-
border: 3px solid;
|
|
23
|
-
border-color: #005c75 transparent;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@keyframes rotation {
|
|
27
|
-
0% {
|
|
28
|
-
transform: rotate(0deg);
|
|
29
|
-
}
|
|
30
|
-
100% {
|
|
31
|
-
transform: rotate(360deg);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
`})]})}const C=["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"],N=80;function $(){const[s,r]=e.useState(0);return e.useEffect(()=>{const a=setInterval(()=>{r(i=>(i+1)%C.length)},N);return()=>clearInterval(a)},[]),h.jsx("span",{className:"inline-block mr-2",children:C[s]})}export{$ as I,Z as S,V as u};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{w as C,u as T,a as E,g as A,r as i,j as e,L as $}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as O}from"./useReportContext-DZlYx2c4.js";import{c as v}from"./createLucideIcon-D1zB-pYc.js";import{T as S,C as N}from"./terminal-DbEAHMbA.js";import{S as R}from"./search-DcAwD_Ln.js";import{C as w}from"./chevron-down-CG65viiV.js";import{B as L}from"./book-open-D4IPYH_y.js";import{T as M}from"./triangle-alert-CAD5b1o_.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 I=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],B=v("arrow-left",I);/**
|
|
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 F=[["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"}]],D=v("message-square",F);/**
|
|
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 V=[["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"}]],U=v("save",V),oe=()=>[{title:"Agent Transcripts - CodeYam"},{name:"description",content:"View background agent transcripts and tool call history"}];function P(t){if(!t)return"";try{return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return t}}function H(t){if(!t)return"";try{return new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return t}}function y({type:t,toolName:s}){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:s||"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[t]||"bg-gray-300 text-black"}`,children:r[t]||t})}function z({input:t}){return e.jsx("div",{className:"text-xs font-mono space-y-1",children:Object.entries(t).map(([s,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:[s,":"]})," ",e.jsx("span",{className:"text-gray-700",children:r})]},s)})})}function q({content:t,truncated:s,fullLength:a}){const[r,l]=i.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:[t,s&&!r&&"..."]}),s&&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)-t.length} more chars)`})]})}function J({entry:t,pairedResult:s}){const[a,r]=i.useState(!1),l=P(t.timestamp||"");return t.type==="user_prompt"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{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:t.text})]}):t.type==="assistant_text"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{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:t.text})]}):t.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(w,{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(y,{type:"tool_call",toolName:t.name}),e.jsx("span",{className:"text-xs text-gray-500 font-mono truncate flex-1",children:t.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(z,{input:t.input||{}}),s&&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",s.is_error?" (Error)":"",":"]}),e.jsx(q,{content:s.content||"",truncated:s.truncated,fullLength:s.fullLength})]})]})]}):(t.type==="tool_result",null)}function K({context:t}){const[s,a]=i.useState(!1);return e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 mb-1 cursor-pointer hover:opacity-80",children:[s?e.jsx(w,{className:"w-3 h-3 text-gray-400"}):e.jsx(N,{className:"w-3 h-3 text-gray-400"}),e.jsx(y,{type:"context"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Full prompt context"})]}),s&&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:t})]})}function W({snippet:t}){const[s,a]=i.useState(!1),r=t.split(`
|
|
17
|
-
`).filter(c=>c.trim()),l=r.slice(0,4),m=r.length>4,f=s?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(D,{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:f.map((c,p)=>{const x=c.match(/^\[(\w+)\]:\s*(.*)/);if(!x)return null;const[,b,h]=x,u=b==="user";return e.jsxs("div",{className:"text-xs",children:[e.jsxs("span",{className:`font-bold ${u?"text-blue-700":"text-gray-500"}`,children:[u?"User":"Assistant",":"]})," ",e.jsx("span",{className:"text-gray-700",children:h.length>200?h.slice(0,200)+"...":h})]},p)})}),m&&e.jsx("button",{onClick:()=>a(!s),className:"text-[11px] text-blue-600 hover:text-blue-800 mt-2 font-mono cursor-pointer",children:s?"Show less":`Show all ${r.length} messages`})]})}function X({change:t}){const[s,a]=i.useState(!1),r=t.action==="created"?!!t.content:t.action==="modified"?!!(t.oldString||t.newString):!1;return e.jsxs("li",{children:[e.jsx("button",{onClick:()=>r&&a(!s),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&&(s?e.jsx(w,{className:"w-3 h-3 inline flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 inline flex-shrink-0"})),t.action==="created"?"Created":"Modified"," ",t.filePath]})}),s&&t.action==="created"&&t.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:t.content}),s&&t.action==="modified"&&e.jsxs("div",{className:"mt-1 mb-2 ml-4 space-y-1",children:[t.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:["- ",t.oldString]}),t.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:["+ ",t.newString]})]})]})}function Y({changes:t}){const s=t.filter(r=>r.action==="touched"),a=t.filter(r=>r.action!=="touched");return e.jsxs("div",{className:"my-2 bg-green-50 border border-green-200 rounded-md p-3",children:[e.jsx("div",{className:"text-xs font-bold text-green-800 mb-1",children:"Rule Changes:"}),e.jsxs("ul",{className:"text-xs text-green-700 space-y-0.5 font-mono",children:[a.map((r,l)=>e.jsx(X,{change:r},l)),s.length>0&&e.jsxs("li",{children:["Touched timestamps on ",s.length," rule",s.length!==1?"s":""]})]})]})}function G({agent:t,defaultOpen:s,isAdmin:a}){const[r,l]=i.useState(s),[m,f]=i.useState(!1),[c,p]=i.useState(null),x=i.useMemo(()=>{const o={};for(const n of t.entries)n.type==="tool_result"&&n.tool_use_id&&(o[n.tool_use_id]=n);return o},[t.entries]),b=i.useMemo(()=>{const o=new Set;for(const n of t.entries)n.type==="tool_call"&&n.tool_use_id&&x[n.tool_use_id]&&o.add(n.tool_use_id);return o},[t.entries,x]),h=o=>{o.stopPropagation(),f(!0),p(null),fetch("/api/save-fixture",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t.id})}).then(n=>n.json()).then(n=>{n.success?p(`Saved to ${n.fixturePath}`):p(`Error: ${n.error}`)}).catch(n=>{p(`Error: ${n instanceof Error?n.message:String(n)}`)}).finally(()=>{f(!1)})},u=(t.ruleChanges||[]).filter(o=>o.action!=="touched"),j=(t.ruleChanges||[]).filter(o=>o.action==="touched"),g=u.length>0,d=j.length>0,k=g||d;return e.jsxs("div",{className:`bg-white border rounded-lg overflow-hidden mb-4 ${g?"border-green-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(w,{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:t.id.slice(0,8)}),t.slug&&e.jsx("span",{className:"text-xs text-gray-500",children:t.slug}),g&&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(L,{className:"w-3 h-3"}),u.length===1?"1 rule changed":`${u.length} rules changed`]}),!g&&d&&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:[j.length," timestamp",j.length!==1?"s":""," ","touched"]}),t.hasConfusion&&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(M,{className:"w-3 h-3"}),"Confusion Detected"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono",children:[t.stats.toolCalls," tool calls, ",t.stats.textBlocks," text blocks"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono ml-auto flex items-center gap-2",children:[H(t.timestamp),a&&g&&e.jsxs("button",{onClick:h,disabled:m,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(U,{className:"w-3 h-3"}),m?"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:[t.conversationSnippet&&e.jsx(W,{snippet:t.conversationSnippet}),k&&e.jsx(Y,{changes:t.ruleChanges}),t.context&&e.jsx(K,{context:t.context}),t.entries.map((o,n)=>{if(o.type==="tool_result"&&o.tool_use_id&&b.has(o.tool_use_id))return null;const _=o.type==="tool_call"&&o.tool_use_id?x[o.tool_use_id]:void 0;return e.jsx(J,{entry:o,pairedResult:_},`${t.id}-${n}`)})]})]})}const le=C(function(){const{agents:s,error:a,search:r}=T(),l=E(),m=A("root"),f=(m==null?void 0:m.isAdmin)??!1,[c,p]=i.useState(r),[x,b]=i.useState(!1),[h,u]=i.useState(0);O({source:"agent-transcripts-page"});const j=d=>{d.preventDefault(),window.location.href=`/agent-transcripts${c?`?search=${encodeURIComponent(c)}`:""}`},g=()=>{b(!x),u(d=>d+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:()=>{l("/memory")},className:"text-gray-600 hover:text-[#005C75] transition-colors cursor-pointer",title:"Back to Memory","aria-label":"Back to Memory",children:e.jsx(B,{className:"w-5 h-5"})}),e.jsx(S,{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:j,className:"relative flex-1 max-w-md",children:[e.jsx(R,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",value:c,onChange:d=>p(d.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:g,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:x?"Collapse All":"Expand All"})]}),e.jsxs("div",{className:"text-sm text-gray-500 mb-4",children:[s.length," agent",s.length!==1?"s":""," found",r&&e.jsxs("span",{children:[" ","matching “",r,"”",e.jsx($,{to:"/agent-transcripts",className:"text-[#005C75] hover:underline ml-2",children:"Clear"})]})]}),s.length===0?e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[e.jsx(S,{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:s.map(d=>e.jsx(G,{agent:d,defaultOpen:x,isAdmin:f},d.id))},h)]})})});export{le as default,oe as meta};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as t,c as r,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{S as i}from"./ScenarioViewer-BX2Ny2Qj.js";import{W as n}from"./InteractivePreview-yjIHlOGa.js";import"./useCustomSizes-BqgrAzs3.js";import"./LogViewer-kgBTLoJD.js";import"./SafeScreenshot-CwZrv-Ok.js";import"./useLastLogLine-DAFqfEDH.js";import"./InlineSpinner-EhOseatT.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-BzPgx-xO.js";import"./createLucideIcon-D1zB-pYc.js";import"./circle-check-igfMr5DY.js";import"./triangle-alert-CAD5b1o_.js";import"./copy-Coc4o_8c.js";import"./scenarioStatus-B_8jpV3e.js";const y=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],w=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{w as default,y as meta};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{w as Y,u as q,a as G,b as J,r as l,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as O,S as P,I as $}from"./InlineSpinner-EhOseatT.js";import{u as Q}from"./useLastLogLine-DAFqfEDH.js";import{u as X,V as Z,S as ee}from"./useCustomSizes-BqgrAzs3.js";import{c as te}from"./cy-logo-cli-DcX-ZS3p.js";const b=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],de=Y(function(){const{entity:i,scenario:s,analysis:r,projectSlug:m}=q(),u=G();J();const[ne,w]=l.useState(null),[_,N]=l.useState(1440),[a,g]=l.useState({name:"Desktop",width:1440,height:900}),[z,p]=l.useState(!1),[f,B]=l.useState(null),{customSizes:S,addCustomSize:D}=X(m),x=l.useMemo(()=>[...b,...S],[S]),{interactiveServerUrl:y,isStarting:k,isLoading:C,showIframe:I,iframeKey:W,onIframeLoad:E}=O({analysisId:r==null?void 0:r.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:!0}),{lastLine:h}=Q(m,k||C),U=()=>{u(`/entity/${i.sha}`)},V=(t,n)=>{N(t);const o=x.find(M=>M.width===t&&M.height===n);w(o||null),g({name:(o==null?void 0:o.name)||"Custom",width:t,height:n})},L=t=>{w(t),N(t.width),g({name:t.name,width:t.width,height:t.height})},R=t=>{D(t,a.width,a.height??900),p(!1),g(n=>({...n,name:t}))},c=((r==null?void 0:r.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),H=d+1,T=c.length,v=d>0,j=d<c.length-1,A=()=>{if(v){const t=c[d-1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},F=()=>{if(j){const t=c[d+1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},K=k||C||!I;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:te,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:A,disabled:!v,className:`${v?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[H,"/",T]}),e.jsx("button",{onClick:F,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:U,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${b[b.length-1].width}px`,width:"100%"},children:e.jsx(Z,{currentViewportWidth:_,currentPresetName:a.name,onDevicePresetClick:L,devicePresets:x,hideLabel:!0,onHoverChange:B,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(f==null?void 0:f.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=x.find(o=>o.name===t.target.value);n&&L(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[x.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&V(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>p(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:y?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${a.width}px`,maxHeight:`${a.height}px`},children:[K&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),e.jsx("iframe",{src:y,className:"w-full h-full border-none",title:`Interactive preview: ${s==null?void 0:s.name}`,onLoad:E,style:{opacity:I?1:0}},W)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),z&&e.jsx(ee,{width:a.width,height:a.height??900,onSave:R,onCancel:()=>p(!1)})]})});export{de as default};
|
package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CtYowLOt.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e,w as Z,u as ee,a as te,L as v}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{W as se,u as re,I as ae}from"./InteractivePreview-yjIHlOGa.js";import{u as ne}from"./InlineSpinner-EhOseatT.js";import{c as oe}from"./executionFlowCoverage-BWhdfn70.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-DAFqfEDH.js";function ie({executionFlows:t,selections:r,onChange:n,disabled:i=!1}){const x=a.useCallback(s=>r.some(o=>o.flowId===s),[r]),p=a.useCallback(s=>{x(s.id)?n(r.filter(o=>o.flowId!==s.id)):n([...r,{flowId:s.id,flowName:s.name}])},[r,n,x]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No execution flows found."}):e.jsx("div",{className:"space-y-3",children:t.map(s=>{const o=x(s.id),I=s.usedInScenarios.length>0;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(s),disabled:i,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:s.name}),!I&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"uncovered"}),s.blocksOtherFlows&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-100 text-purple-700 rounded",children:"blocking"}),s.impact==="high"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-100 text-red-700 rounded",children:"high impact"})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:s.description})]})]}),o&&s.requiredValues.length>0&&e.jsxs("div",{className:"ml-6 mt-2 p-2 bg-gray-50 rounded text-xs",children:[e.jsx("span",{className:"text-gray-700 font-medium",children:"Required values:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:s.requiredValues.map((h,E)=>e.jsxs("li",{className:"text-gray-600",children:[e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.attributePath})," ",e.jsx("span",{className:"text-gray-400",children:h.comparison})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.value})]},E))})]})]},s.id)})})}const he=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function ce(){var W;const{analysis:t,defaultScenario:r,entity:n,entitySha:i,projectSlug:x}=ee(),p=te(),{iframeRef:s}=re(),[o,I]=a.useState(""),[h,E]=a.useState(400),[b,P]=a.useState(!1),[U,R]=a.useState(!1),[G,$]=a.useState(!1),[M,L]=a.useState(null),[F,l]=a.useState(null),[d,H]=a.useState([]),D=a.useMemo(()=>{var c;return!((c=t==null?void 0:t.metadata)!=null&&c.executionFlows)||!(t!=null&&t.scenarios)?[]:oe(t.metadata.executionFlows,t.scenarios).executionFlows},[t]),{interactiveServerUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V}=ne({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),Y=a.useCallback(async()=>{var m,c,T,z;if(!o.trim()&&d.length===0){L("Please describe how you want to change the scenario or select execution flows");return}R(!0),L(null),l("Generating scenario with AI...");try{const u=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o,existingScenarios:t.scenarios,scenariosDataStructure:(m=t.metadata)==null?void 0:m.scenariosDataStructure,flowSelections:d.length>0?d:void 0})}),N=await u.json();if(!u.ok||!N.success)throw new Error(N.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",N.data);const g=N.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),$(!0);const X={name:g.name,description:g.description||o,metadata:{data:g.data,interactiveExamplePath:(c=r.metadata)==null?void 0:c.interactiveExamplePath}},Q=[...t.scenarios||[],X],O=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:Q})}),C=await O.json();if(!O.ok||!C.success)throw new Error(C.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",C);const f=(z=(T=C.analysis)==null?void 0:T.scenarios)==null?void 0:z.find(k=>k.name===g.name);if(!(f!=null&&f.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void p(`/entity/${i}`),1e3);return}if(y){l("Capturing screenshot...");const k=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:y,scenarioId:f.id,projectId:t.projectId,viewportWidth:1440})}),A=await k.json();!k.ok||!A.success?(console.error("[CreateScenario] Capture failed:",A),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{p(`/entity/${i}/scenarios/${f.id}`)},1e3)}catch(u){console.error("[CreateScenario] Error:",u),L(u instanceof Error?u.message:String(u)),l(null)}finally{R(!1),$(!1)}},[o,d,t,r,i,y,p]),j=U||G,K=a.useCallback(()=>{P(!0)},[]),w=a.useCallback(m=>{if(!b)return;const c=m.clientX;c>=250&&c<=600&&E(c)},[b]),S=a.useCallback(()=>{P(!1)},[]);return a.useEffect(()=>(b?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}),[b,w,S]),e.jsxs("div",{className:"h-screen bg-white flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-end h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 pb-[14px]",children:[e.jsx("button",{onClick:()=>void p(`/entity/${i}`),className:"no-underline shrink-0 bg-transparent border-none cursor-pointer p-0 flex items-center",title:"Back",children:e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h1",{className:"text-base font-semibold text-black m-0 leading-[20px] shrink-0",children:n==null?void 0:n.name}),e.jsx("span",{className:"text-xs text-[#9e9e9e] font-mono font-normal whitespace-nowrap overflow-hidden text-ellipsis min-w-0",title:n==null?void 0:n.filePath,children:n==null?void 0:n.filePath})]}),e.jsxs("div",{className:"flex items-end gap-8 shrink-0",children:[e.jsx(v,{to:`/entity/${i}/scenarios`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-medium border-b-2",style:{color:"#005C75",borderColor:"#005C75"},children:e.jsxs("span",{className:"flex items-center gap-2",children:["Scenarios",e.jsx("span",{className:"inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full bg-[#cbf3fa] text-[#005c75]",children:((W=t==null?void 0:t.scenarios)==null?void 0:W.length)||0})]})}),e.jsx(v,{to:`/entity/${i}/related`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Related Entities"}),e.jsx(v,{to:`/entity/${i}/code`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Code"}),e.jsx(v,{to:`/entity/${i}/data`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Data Structure"}),e.jsx(v,{to:`/entity/${i}/history`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"History"})]})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0 relative",children:[e.jsxs("aside",{className:"bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",style:{width:`${h}px`},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select execution flows and/or describe how you'd like to change it."})]}),D.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Execution Flows"," ",d.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",d.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ie,{executionFlows:D,selections:d,onChange:H,disabled:j})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"Describe your scenario"}),e.jsx("textarea",{id:"prompt",value:o,onChange:m=>I(m.target.value),placeholder:"e.g., Show an empty state with no items...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>void Y(),disabled:j||!o.trim()&&d.length===0,className:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium cursor-pointer transition-colors hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:j?"Creating...":"Create Scenario"}),F&&e.jsx("div",{className:"text-xs text-blue-600 bg-blue-50 px-2 py-1.5 rounded",children:F}),M&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded",children:M})]})]}),e.jsxs("div",{onMouseDown:K,style:{width:"20px",position:"absolute",top:0,left:`${h-10}px`,bottom:0,cursor:"col-resize",touchAction:"none",userSelect:"none",zIndex:100,pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",left:"10px",top:0,bottom:0,width:"1px",background:b?"#005c75":"rgba(0,0,0,0.1)",transition:"background 0.15s ease"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"10px",transform:"translate(-50%, -50%)",width:"8px",height:"40px",background:"#fff",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",cursor:"col-resize"}})]}),e.jsx("main",{className:"flex-1 overflow-auto flex items-center justify-center min-w-0",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:e.jsx(ae,{scenarioId:r.id||r.name,scenarioName:r.name,iframeUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V,projectSlug:x,defaultWidth:1440,defaultHeight:900})})]})]})}const ge=Z(function(){return e.jsx(se,{children:e.jsx(ce,{})})});export{ge as default,he as meta};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var un=Object.defineProperty;var hn=(e,t,n)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var G=(e,t,n)=>hn(e,typeof t!="symbol"?t+"":t,n);import{r as R,c as $t,H as pn,j as l,w as mn,u as gn,b as xn}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as yn}from"./useReportContext-DZlYx2c4.js";import{F as Vt,b as zt,E as Pt,S as Gt,u as vn,C as bn,a as wn}from"./EntityItem-bwuHPyTa.js";import{L as Cn}from"./LogViewer-kgBTLoJD.js";import{g as Ht}from"./fileTableUtils-9sMMAiWJ.js";import"./createLucideIcon-D1zB-pYc.js";import"./useToast-ihdMtlf6.js";import"./TruncatedFilePath-CDpEprKa.js";import"./SafeScreenshot-CwZrv-Ok.js";import"./LibraryFunctionPreview-Cq5o8jL4.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-CAD5b1o_.js";import"./EntityTypeIcon-BH0XDim7.js";import"./EntityTypeBadge-CvzqMxcu.js";function Nn(e,t,n=10){var c;const r=new Map,i=d=>d.entityType==="visual"||d.entityType==="library";for(const d of e)i(d)&&r.set(d.sha,{entity:d,depth:0});const s=new Map;for(const d of t){const f=(c=d.metadata)==null?void 0:c.importedBy;if(f)for(const u of Object.keys(f))for(const h of Object.keys(f[u])){const{shas:b}=f[u][h];for(const g of b)s.has(d.sha)||s.set(d.sha,new Set),s.get(d.sha).add(g)}}const o=[],a=new Set;for(const d of e)o.push({sha:d.sha,depth:0}),a.add(d.sha);for(;o.length>0;){const{sha:d,depth:f}=o.shift();if(f>=n)continue;const u=s.get(d);if(u)for(const h of u){if(a.has(h))continue;a.add(h);const b=t.find(g=>g.sha===h);if(b){if(i(b)){const g=f+1,p=r.get(h);(!p||g<p.depth)&&r.set(h,{entity:b,depth:g})}o.push({sha:h,depth:f+1})}}}return Array.from(r.values()).sort((d,f)=>d.depth!==f.depth?d.depth-f.depth:d.entity.name.localeCompare(f.entity.name))}function Le(e){const t=new Map;for(const r of e)t.has(r.name)||t.set(r.name,[]),t.get(r.name).push(r);const n=[];for(const r of t.values())if(r.length===1)n.push(r[0]);else{const i=r.sort((s,o)=>{var d,f;const a=((d=s.metadata)==null?void 0:d.editedAt)||s.createdAt||"";return(((f=o.metadata)==null?void 0:f.editedAt)||o.createdAt||"").localeCompare(a)});n.push(i[0])}return n}function jn(e,t){const n=new Map,r=new Set(e.map(i=>i.path));for(const i of e)i.status==="renamed"&&i.oldPath&&r.add(i.oldPath);for(const i of e){const s=t.filter(c=>c.filePath===i.path||i.status==="renamed"&&i.oldPath&&c.filePath===i.oldPath),o=s.filter(c=>{var d,f;return r.has(c.filePath)&&((d=c.metadata)==null?void 0:d.isUncommitted)&&!((f=c.metadata)!=null&&f.isSuperseded)}),a=Le(o);n.set(i.path,{status:i,entities:s,editedEntities:a})}return n}function Sn(e,t,n){const r=new Map;if(!n){for(const s of e)if(s.status==="deleted")r.set(s.path,{status:s,entities:[]});else{const o=t.filter(c=>c.filePath===s.path||s.status==="renamed"&&s.oldPath&&c.filePath===s.oldPath),a=Le(o);r.set(s.path,{status:s,entities:a})}return r}const i=new Map;for(const s of n.fileComparisons){const o=new Set;for(const a of s.newEntities)o.add(a.name);for(const a of s.modifiedEntities)o.add(a.name);for(const a of s.deletedEntities)o.add(a.name);o.size>0&&i.set(s.filePath,o)}for(const s of e){const o=i.get(s.path);if(s.status==="deleted")r.set(s.path,{status:s,entities:[]});else{const a=o?t.filter(d=>(d.filePath===s.path||s.status==="renamed"&&s.oldPath&&d.filePath===s.oldPath)&&o.has(d.name)):[],c=Le(a);r.set(s.path,{status:s,entities:c})}}return r}function kn(e,t){const n=new Map,r=Ln(e,t);for(const i of r){const o=Nn([i],t).filter(({depth:a})=>a>0);n.set(i.sha,o)}return n}function Ln(e,t){const n=new Set(e.map(i=>i.path));for(const i of e)i.status==="renamed"&&i.oldPath&&n.add(i.oldPath);const r=t.filter(i=>{var s,o;return n.has(i.filePath)&&((s=i.metadata)==null?void 0:s.isUncommitted)&&!((o=i.metadata)!=null&&o.isSuperseded)});return Le(r)}function An(e,t,n){const[r,i]=R.useState(()=>new Set),[s,o]=R.useState(()=>new Set),a=R.useRef([]),c=R.useRef([]);return R.useEffect(()=>{(t.length!==a.current.length||t.some((p,C)=>p!==a.current[C]))&&(a.current=t,i(p=>{const C=new Set;return t.forEach(w=>{p.has(w)&&C.add(w)}),C}))},[t]),R.useEffect(()=>{(n.length!==c.current.length||n.some((p,C)=>p!==c.current[C]))&&(c.current=n,o(p=>{const C=new Set;return n.forEach(w=>{p.has(w)&&C.add(w)}),C}))},[n]),{expandedUncommitted:r,expandedBranch:s,setExpandedUncommitted:i,setExpandedBranch:o,toggleFile:(g,p,C)=>{C(w=>{const N=new Set(w);return N.has(g)?N.delete(g):N.add(g),N})},expandAllUncommitted:()=>{i(new Set(t))},collapseAllUncommitted:()=>{i(new Set)},expandAllBranch:()=>{o(new Set(n))},collapseAllBranch:()=>{o(new Set)}}}function En(e,t,n){const[r,i]=R.useState(null),[s,o]=R.useState(null),a=$t();R.useEffect(()=>{var u,h;((u=a.data)==null?void 0:u.oldContent)!==void 0&&((h=a.data)==null?void 0:h.newContent)!==void 0&&o({oldContent:a.data.oldContent,newContent:a.data.newContent,fileName:a.data.fileName})},[a.data]);const c=u=>{i({type:"file",path:u}),o(null);const h=new FormData;h.append("actionType","getDiff"),h.append("filePath",u),h.append("diffType","branch"),h.append("baseBranch",e),h.append("currentBranch",t||""),a.submit(h,{method:"post"})},d=(u,h)=>{i({type:"entity",path:u,entitySha:h}),o(null);const b=new FormData;b.append("actionType","getDiff"),b.append("filePath",u),b.append("diffType","branch"),b.append("baseBranch",e),b.append("currentBranch",t||""),b.append("entitySha",h),a.submit(b,{method:"post"})},f=()=>{i(null),o(null)};return{diffView:r,diffContent:s,isLoading:a.state==="loading"||a.state==="submitting",handleShowFileDiff:c,handleShowEntityDiff:d,handleCloseDiff:f}}var Ge={exports:{}};/*!
|
|
2
|
-
Copyright (c) 2018 Jed Watson.
|
|
3
|
-
Licensed under the MIT License (MIT), see
|
|
4
|
-
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var pt;function Bn(){return pt||(pt=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ge)),Ge.exports}var Fn=Bn();const U=pn(Fn);var mt=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Tn(e,t){return!!(e===t||mt(e)&&mt(t))}function Dn(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Tn(e[n],t[n]))return!1;return!0}function Mn(e,t){t===void 0&&(t=Dn);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}function Rn(e,t,n){let r=0,i;const s={},o=[];return e.forEach((a,c)=>{const d=t.some(f=>f>=c-n&&f<=c+n);!d&&i===void 0?(i={index:r,startLine:c,endLine:c,lines:1},o.push(i),s[c]=i.index,r++):!d&&i?(i.endLine=c,i.lines++,s[c]=i.index):i=void 0}),{lineBlocks:s,blocks:o}}function X(){}X.prototype={diff:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.callback;typeof i=="function"&&(s=i,i={}),this.options=i;var o=this;function a(x){return s?(setTimeout(function(){s(void 0,x)},0),!0):x}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var c=n.length,d=t.length,f=1,u=c+d;i.maxEditLength&&(u=Math.min(u,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,b=Date.now()+h,g=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(g[0],n,t,0);if(g[0].oldPos+1>=d&&p+1>=c)return a([{value:this.join(n),count:n.length}]);var C=-1/0,w=1/0;function N(){for(var x=Math.max(C,-f);x<=Math.min(w,f);x+=2){var v=void 0,y=g[x-1],m=g[x+1];y&&(g[x-1]=void 0);var A=!1;if(m){var E=m.oldPos-x;A=m&&0<=E&&E<c}var B=y&&y.oldPos+1<d;if(!A&&!B){g[x]=void 0;continue}if(!B||A&&y.oldPos+1<m.oldPos?v=o.addToPath(m,!0,void 0,0):v=o.addToPath(y,void 0,!0,1),p=o.extractCommon(v,n,t,x),v.oldPos+1>=d&&p+1>=c)return a(On(o,v.lastComponent,n,t,o.useLongestToken));g[x]=v,v.oldPos+1>=d&&(w=Math.min(w,x-1)),p+1>=c&&(C=Math.max(C,x+1))}f++}if(s)(function x(){setTimeout(function(){if(f>u||Date.now()>b)return s();N()||x()},0)})();else for(;f<=u&&Date.now()<=b;){var j=N();if(j)return j}},addToPath:function(t,n,r,i){var s=t.lastComponent;return s&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}},extractCommon:function(t,n,r,i){for(var s=n.length,o=r.length,a=t.oldPos,c=a-i,d=0;c+1<s&&a+1<o&&this.equals(n[c+1],r[a+1]);)c++,a++,d++;return d&&(t.lastComponent={count:d,previousComponent:t.lastComponent}),t.oldPos=a,c},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function On(e,t,n,r,i){for(var s=[],o;t;)s.push(t),o=t.previousComponent,delete t.previousComponent,t=o;s.reverse();for(var a=0,c=s.length,d=0,f=0;a<c;a++){var u=s[a];if(u.removed){if(u.value=e.join(r.slice(f,f+u.count)),f+=u.count,a&&s[a-1].added){var b=s[a-1];s[a-1]=s[a],s[a]=b}}else{if(!u.added&&i){var h=n.slice(d,d+u.count);h=h.map(function(p,C){var w=r[f+C];return w.length>p.length?w:p}),u.value=e.join(h)}else u.value=e.join(n.slice(d,d+u.count));d+=u.count,u.added||(f+=u.count)}}var g=s[c-1];return c>1&&typeof g.value=="string"&&(g.added||g.removed)&&e.equals("",g.value)&&(s[c-2].value+=g.value,s.pop()),s}var In=new X;function $n(e,t,n){return In.diff(e,t,n)}function Wt(e,t){if(typeof e=="function")t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var gt=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,xt=/\S/,Te=new X;Te.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!xt.test(e)&&!xt.test(t)};Te.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&>.test(t[n])&>.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function Vn(e,t,n){return n=Wt(n,{ignoreWhitespace:!0}),Te.diff(e,t,n)}function zn(e,t,n){return Te.diff(e,t,n)}var De=new X;De.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
6
|
-
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function Ye(e,t,n){return De.diff(e,t,n)}function Pn(e,t,n){var r=Wt(n,{ignoreWhitespace:!0});return De.diff(e,t,r)}var Ut=new X;Ut.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};function Gn(e,t,n){return Ut.diff(e,t,n)}var qt=new X;qt.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Hn(e,t,n){return qt.diff(e,t,n)}function Ne(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ne=function(t){return typeof t}:Ne=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yt(Object(n),!0).forEach(function(r){Wn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ee(e){return Un(e)||qn(e)||Zn(e)||Jn()}function Un(e){if(Array.isArray(e))return Ue(e)}function qn(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Zn(e,t){if(e){if(typeof e=="string")return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}}function Ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _n=Object.prototype.toString,fe=new X;fe.useLongestToken=!0;fe.tokenize=De.tokenize;fe.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(s,o){return typeof o>"u"?n:o}:r;return typeof e=="string"?e:JSON.stringify(Ae(e,null,null,i),i," ")};fe.equals=function(e,t){return X.prototype.equals.call(fe,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Zt(e,t,n){return fe.diff(e,t,n)}function Ae(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(_n.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ae(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Ne(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],c;for(c in e)e.hasOwnProperty(c)&&a.push(c);for(a.sort(),s=0;s<a.length;s+=1)c=a[s],o[c]=Ae(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var Ee=new X;Ee.tokenize=function(e){return e.slice()};Ee.join=Ee.removeEmpty=function(e){return e};function Yn(e,t,n){return Ee.diff(e,t,n)}function Me(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),r=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],i=[],s=0;function o(){var d={};for(i.push(d);s<n.length;){var f=n[s];if(/^(\-\-\-|\+\+\+|@@)\s/.test(f))break;var u=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(f);u&&(d.index=u[1]),s++}for(a(d),a(d),d.hunks=[];s<n.length;){var h=n[s];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(h))break;if(/^@@/.test(h))d.hunks.push(c());else{if(h&&t.strict)throw new Error("Unknown line "+(s+1)+" "+JSON.stringify(h));s++}}}function a(d){var f=/^(---|\+\+\+)\s+(.*)$/.exec(n[s]);if(f){var u=f[1]==="---"?"old":"new",h=f[2].split(" ",2),b=h[0].replace(/\\\\/g,"\\");/^".*"$/.test(b)&&(b=b.substr(1,b.length-2)),d[u+"FileName"]=b,d[u+"Header"]=(h[1]||"").trim(),s++}}function c(){var d=s,f=n[s++],u=f.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),h={oldStart:+u[1],oldLines:typeof u[2]>"u"?1:+u[2],newStart:+u[3],newLines:typeof u[4]>"u"?1:+u[4],lines:[],linedelimiters:[]};h.oldLines===0&&(h.oldStart+=1),h.newLines===0&&(h.newStart+=1);for(var b=0,g=0;s<n.length&&!(n[s].indexOf("--- ")===0&&s+2<n.length&&n[s+1].indexOf("+++ ")===0&&n[s+2].indexOf("@@")===0);s++){var p=n[s].length==0&&s!=n.length-1?" ":n[s][0];if(p==="+"||p==="-"||p===" "||p==="\\")h.lines.push(n[s]),h.linedelimiters.push(r[s]||`
|
|
8
|
-
`),p==="+"?b++:p==="-"?g++:p===" "&&(b++,g++);else break}if(!b&&h.newLines===1&&(h.newLines=0),!g&&h.oldLines===1&&(h.oldLines=0),t.strict){if(b!==h.newLines)throw new Error("Added line count did not match for hunk at line "+(d+1));if(g!==h.oldLines)throw new Error("Removed line count did not match for hunk at line "+(d+1))}return h}for(;s<n.length;)o();return i}function Xn(e,t,n){var r=!0,i=!1,s=!1,o=1;return function a(){if(r&&!s){if(i?o++:r=!1,e+o<=n)return o;s=!0}if(!i)return s||(r=!0),t<=e-o?-o++:(i=!0,a())}}function Jt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string"&&(t=Me(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var r=e.split(/\r\n|[\n\v\f\r\x85]/),i=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=t.hunks,o=n.compareLine||function(I,V,te,Z){return V===Z},a=0,c=n.fuzzFactor||0,d=0,f=0,u,h;function b(I,V){for(var te=0;te<I.lines.length;te++){var Z=I.lines[te],se=Z.length>0?Z[0]:" ",ae=Z.length>0?Z.substr(1):Z;if(se===" "||se==="-"){if(!o(V+1,r[V],se,ae)&&(a++,a>c))return!1;V++}}return!0}for(var g=0;g<s.length;g++){for(var p=s[g],C=r.length-p.oldLines,w=0,N=f+p.oldStart-1,j=Xn(N,d,C);w!==void 0;w=j())if(b(p,N+w)){p.offset=f+=w;break}if(w===void 0)return!1;d=p.offset+p.oldStart+p.oldLines}for(var x=0,v=0;v<s.length;v++){var y=s[v],m=y.oldStart+y.offset+x-1;x+=y.newLines-y.oldLines;for(var A=0;A<y.lines.length;A++){var E=y.lines[A],B=E.length>0?E[0]:" ",T=E.length>0?E.substr(1):E,F=y.linedelimiters&&y.linedelimiters[A]||`
|
|
9
|
-
`;if(B===" ")m++;else if(B==="-")r.splice(m,1),i.splice(m,1);else if(B==="+")r.splice(m,0,T),i.splice(m,0,F),m++;else if(B==="\\"){var k=y.lines[A-1]?y.lines[A-1][0]:null;k==="+"?u=!0:k==="-"&&(h=!0)}}}if(u)for(;!r[r.length-1];)r.pop(),i.pop();else h&&(r.push(""),i.push(`
|
|
10
|
-
`));for(var S=0;S<r.length-1;S++)r[S]=r[S]+i[S];return r.join("")}function Kn(e,t){typeof e=="string"&&(e=Me(e));var n=0;function r(){var i=e[n++];if(!i)return t.complete();t.loadFile(i,function(s,o){if(s)return t.complete(s);var a=Jt(o,i,t);t.patched(i,a,function(c){if(c)return t.complete(c);r()})})}r()}function Xe(e,t,n,r,i,s,o){o||(o={}),typeof o.context>"u"&&(o.context=4);var a=Ye(n,r,o);if(!a)return;a.push({value:"",lines:[]});function c(w){return w.map(function(N){return" "+N})}for(var d=[],f=0,u=0,h=[],b=1,g=1,p=function(N){var j=a[N],x=j.lines||j.value.replace(/\n$/,"").split(`
|
|
11
|
-
`);if(j.lines=x,j.added||j.removed){var v;if(!f){var y=a[N-1];f=b,u=g,y&&(h=o.context>0?c(y.lines.slice(-o.context)):[],f-=h.length,u-=h.length)}(v=h).push.apply(v,ee(x.map(function(S){return(j.added?"+":"-")+S}))),j.added?g+=x.length:b+=x.length}else{if(f)if(x.length<=o.context*2&&N<a.length-2){var m;(m=h).push.apply(m,ee(c(x)))}else{var A,E=Math.min(x.length,o.context);(A=h).push.apply(A,ee(c(x.slice(0,E))));var B={oldStart:f,oldLines:b-f+E,newStart:u,newLines:g-u+E,lines:h};if(N>=a.length-2&&x.length<=o.context){var T=/\n$/.test(n),F=/\n$/.test(r),k=x.length==0&&h.length>B.oldLines;!T&&k&&n.length>0&&h.splice(B.oldLines,0,"\"),(!T&&!k||!F)&&h.push("\")}d.push(B),f=0,u=0,h=[]}b+=x.length,g+=x.length}},C=0;C<a.length;C++)p(C);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:d}}function Ke(e){if(Array.isArray(e))return e.map(Ke).join(`
|
|
12
|
-
`);var t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),t.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader));for(var n=0;n<e.hunks.length;n++){var r=e.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),t.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@"),t.push.apply(t,r.lines)}return t.join(`
|
|
13
|
-
`)+`
|
|
14
|
-
`}function _t(e,t,n,r,i,s,o){return Ke(Xe(e,t,n,r,i,s,o))}function Qn(e,t,n,r,i,s){return _t(e,e,t,n,r,i,s)}function er(e,t){return e.length!==t.length?!1:qe(e,t)}function qe(e,t){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function tr(e){var t=Ze(e.lines),n=t.oldLines,r=t.newLines;n!==void 0?e.oldLines=n:delete e.oldLines,r!==void 0?e.newLines=r:delete e.newLines}function nr(e,t,n){e=bt(e,n),t=bt(t,n);var r={};(e.index||t.index)&&(r.index=e.index||t.index),(e.newFileName||t.newFileName)&&(wt(e)?wt(t)?(r.oldFileName=we(r,e.oldFileName,t.oldFileName),r.newFileName=we(r,e.newFileName,t.newFileName),r.oldHeader=we(r,e.oldHeader,t.oldHeader),r.newHeader=we(r,e.newHeader,t.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=t.oldFileName||e.oldFileName,r.newFileName=t.newFileName||e.newFileName,r.oldHeader=t.oldHeader||e.oldHeader,r.newHeader=t.newHeader||e.newHeader)),r.hunks=[];for(var i=0,s=0,o=0,a=0;i<e.hunks.length||s<t.hunks.length;){var c=e.hunks[i]||{oldStart:1/0},d=t.hunks[s]||{oldStart:1/0};if(Ct(c,d))r.hunks.push(Nt(c,o)),i++,a+=c.newLines-c.oldLines;else if(Ct(d,c))r.hunks.push(Nt(d,a)),s++,o+=d.newLines-d.oldLines;else{var f={oldStart:Math.min(c.oldStart,d.oldStart),oldLines:0,newStart:Math.min(c.newStart+o,d.oldStart+a),newLines:0,lines:[]};rr(f,c.oldStart,c.lines,d.oldStart,d.lines),s++,i++,r.hunks.push(f)}}return r}function bt(e,t){if(typeof e=="string"){if(/^@@/m.test(e)||/^Index:/m.test(e))return Me(e)[0];if(!t)throw new Error("Must provide a base reference or pass in a patch");return Xe(void 0,void 0,t,e)}return e}function wt(e){return e.newFileName&&e.newFileName!==e.oldFileName}function we(e,t,n){return t===n?t:(e.conflict=!0,{mine:t,theirs:n})}function Ct(e,t){return e.oldStart<t.oldStart&&e.oldStart+e.oldLines<t.oldStart}function Nt(e,t){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+t,newLines:e.newLines,lines:e.lines}}function rr(e,t,n,r,i){var s={offset:t,lines:n,index:0},o={offset:r,lines:i,index:0};for(St(e,s,o),St(e,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],c=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(c[0]==="-"||c[0]==="+"))sr(e,s,o);else if(a[0]==="+"&&c[0]===" "){var d;(d=e.lines).push.apply(d,ee(oe(s)))}else if(c[0]==="+"&&a[0]===" "){var f;(f=e.lines).push.apply(f,ee(oe(o)))}else a[0]==="-"&&c[0]===" "?jt(e,s,o):c[0]==="-"&&a[0]===" "?jt(e,o,s,!0):a===c?(e.lines.push(a),s.index++,o.index++):Qe(e,oe(s),oe(o))}kt(e,s),kt(e,o),tr(e)}function sr(e,t,n){var r=oe(t),i=oe(n);if(Lt(r)&&Lt(i)){if(qe(r,i)&&At(n,r,r.length-i.length)){var s;(s=e.lines).push.apply(s,ee(r));return}else if(qe(i,r)&&At(t,i,i.length-r.length)){var o;(o=e.lines).push.apply(o,ee(i));return}}else if(er(r,i)){var a;(a=e.lines).push.apply(a,ee(r));return}Qe(e,r,i)}function jt(e,t,n,r){var i=oe(t),s=ir(n,i);if(s.merged){var o;(o=e.lines).push.apply(o,ee(s.merged))}else Qe(e,r?s:i,r?i:s)}function Qe(e,t,n){e.conflict=!0,e.lines.push({conflict:!0,mine:t,theirs:n})}function St(e,t,n){for(;t.offset<n.offset&&t.index<t.lines.length;){var r=t.lines[t.index++];e.lines.push(r),t.offset++}}function kt(e,t){for(;t.index<t.lines.length;){var n=t.lines[t.index++];e.lines.push(n)}}function oe(e){for(var t=[],n=e.lines[e.index][0];e.index<e.lines.length;){var r=e.lines[e.index];if(n==="-"&&r[0]==="+"&&(n="+"),n===r[0])t.push(r),e.index++;else break}return t}function ir(e,t){for(var n=[],r=[],i=0,s=!1,o=!1;i<t.length&&e.index<e.lines.length;){var a=e.lines[e.index],c=t[i];if(c[0]==="+")break;if(s=s||a[0]!==" ",r.push(c),i++,a[0]==="+")for(o=!0;a[0]==="+";)n.push(a),a=e.lines[++e.index];c.substr(1)===a.substr(1)?(n.push(a),e.index++):o=!0}if((t[i]||"")[0]==="+"&&s&&(o=!0),o)return n;for(;i<t.length;)r.push(t[i++]);return{merged:r,changes:n}}function Lt(e){return e.reduce(function(t,n){return t&&n[0]==="-"},!0)}function At(e,t,n){for(var r=0;r<n;r++){var i=t[t.length-n+r].substr(1);if(e.lines[e.index+r]!==" "+i)return!1}return e.index+=n,!0}function Ze(e){var t=0,n=0;return e.forEach(function(r){if(typeof r!="string"){var i=Ze(r.mine),s=Ze(r.theirs);t!==void 0&&(i.oldLines===s.oldLines?t+=i.oldLines:t=void 0),n!==void 0&&(i.newLines===s.newLines?n+=i.newLines:n=void 0)}else n!==void 0&&(r[0]==="+"||r[0]===" ")&&n++,t!==void 0&&(r[0]==="-"||r[0]===" ")&&t++}),{oldLines:t,newLines:n}}function Yt(e){return Array.isArray(e)?e.map(Yt).reverse():vt(vt({},e),{},{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(function(t){return{oldLines:t.newLines,oldStart:t.newStart,newLines:t.oldLines,newStart:t.oldStart,linedelimiters:t.linedelimiters,lines:t.lines.map(function(n){return n.startsWith("-")?"+".concat(n.slice(1)):n.startsWith("+")?"-".concat(n.slice(1)):n})}})})}function or(e){for(var t=[],n,r,i=0;i<e.length;i++)n=e[i],n.added?r=1:n.removed?r=-1:r=0,t.push([r,n.value]);return t}function ar(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(lr(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function lr(e){var t=e;return t=t.replace(/&/g,"&"),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t=t.replace(/"/g,"""),t}const cr=Object.freeze(Object.defineProperty({__proto__:null,Diff:X,applyPatch:Jt,applyPatches:Kn,canonicalize:Ae,convertChangesToDMP:or,convertChangesToXML:ar,createPatch:Qn,createTwoFilesPatch:_t,diffArrays:Yn,diffChars:$n,diffCss:Hn,diffJson:Zt,diffLines:Ye,diffSentences:Gn,diffTrimmedLines:Pn,diffWords:Vn,diffWordsWithSpace:zn,formatPatch:Ke,merge:nr,parsePatch:Me,reversePatch:Yt,structuredPatch:Xe},Symbol.toStringTag,{value:"Module"})),dr=cr;var O;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ADDED=1]="ADDED",e[e.REMOVED=2]="REMOVED",e[e.CHANGED=3]="CHANGED"})(O||(O={}));var ue;(function(e){e.CHARS="diffChars",e.WORDS="diffWords",e.WORDS_WITH_SPACE="diffWordsWithSpace",e.LINES="diffLines",e.TRIMMED_LINES="diffTrimmedLines",e.SENTENCES="diffSentences",e.CSS="diffCss",e.JSON="diffJson"})(ue||(ue={}));const Et=e=>e===""?[]:e.replace(/\n$/,"").split(`
|
|
15
|
-
`),fr=(e,t,n=ue.CHARS)=>{const i=(typeof n=="string"?dr[n]:n)(e,t),s={left:[],right:[]};return i.forEach(({added:o,removed:a,value:c})=>{const d={};return o&&(d.type=O.ADDED,d.value=c,s.right.push(d)),a&&(d.type=O.REMOVED,d.value=c,s.left.push(d)),!a&&!o&&(d.type=O.DEFAULT,d.value=c,s.right.push(d),s.left.push(d)),d}),s},ur=(e,t,n=!1,r=ue.CHARS,i=0,s=[])=>{let o=[];typeof e=="string"&&typeof t=="string"?o=Ye(e,t,{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):o=Zt(e,t);let a=i,c=i,d=[],f=0;const u=[],h=[],b=(g,p,C,w,N)=>Et(g).map((x,v)=>{const y={},m={};if(!(h.includes(`${p}-${v}`)||N&&v!==0)){if(C||w){let A=!0;if(w){c+=1,y.lineNumber=c,y.type=O.REMOVED,y.value=x||" ";const E=o[p+1];if(E!=null&&E.added){const B=Et(E.value)[v];if(B){const T=b(B,p,!0,!1,!0),{value:F,lineNumber:k,type:S}=T[0].right;if(h.push(`${p+1}-${v}`),m.lineNumber=k,y.value===F)A=!1,m.type=0,y.type=0,m.value=F;else if(m.type=S,n)m.value=F;else{const I=fr(x,F,r);m.value=I.right,y.value=I.left}}}}else a+=1,m.lineNumber=a,m.type=O.ADDED,m.value=x;A&&!N&&(u.includes(f)||u.push(f))}else c+=1,a+=1,y.lineNumber=c,y.type=O.DEFAULT,y.value=x,m.lineNumber=a,m.type=O.DEFAULT,m.value=x;return(s!=null&&s.includes(`L-${y.lineNumber}`)||s!=null&&s.includes(`R-${m.lineNumber}`)&&!u.includes(f))&&u.push(f),N||(f+=1),{right:m,left:y}}}).filter(Boolean);return o.forEach(({added:g,removed:p,value:C},w)=>{d=[...d,...b(C,w,g,p)]}),{lineInformation:d,diffLines:u}};function hr(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[l.jsx("title",{children:"expand"}),l.jsx("path",{d:"m8.177.677 2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25a.75.75 0 0 1-1.5 0V4H5.104a.25.25 0 0 1-.177-.427L7.823.677a.25.25 0 0 1 .354 0ZM7.25 10.75a.75.75 0 0 1 1.5 0V12h2.146a.25.25 0 0 1 .177.427l-2.896 2.896a.25.25 0 0 1-.354 0l-2.896-2.896A.25.25 0 0 1 5.104 12H7.25v-1.25Zm-5-2a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}function pr(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function mr(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var gr=(function(){function e(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(mr(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=pr(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e})(),P="-ms-",Be="-moz-",D="-webkit-",Xt="comm",et="rule",tt="decl",xr="@import",Kt="@keyframes",yr="@layer",vr=Math.abs,Re=String.fromCharCode,br=Object.assign;function wr(e,t){return z(e,0)^45?(((t<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3):0}function Qt(e){return e.trim()}function Cr(e,t){return(e=t.exec(e))?e[0]:e}function M(e,t,n){return e.replace(t,n)}function Je(e,t){return e.indexOf(t)}function z(e,t){return e.charCodeAt(t)|0}function ge(e,t,n){return e.slice(t,n)}function _(e){return e.length}function nt(e){return e.length}function Ce(e,t){return t.push(e),e}function Nr(e,t){return e.map(t).join("")}var Oe=1,he=1,en=0,W=0,$=0,pe="";function Ie(e,t,n,r,i,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:Oe,column:he,length:o,return:""}}function me(e,t){return br(Ie("",null,null,"",null,null,0),e,{length:-e.length},t)}function jr(){return $}function Sr(){return $=W>0?z(pe,--W):0,he--,$===10&&(he=1,Oe--),$}function q(){return $=W<en?z(pe,W++):0,he++,$===10&&(he=1,Oe++),$}function Y(){return z(pe,W)}function je(){return W}function ye(e,t){return ge(pe,e,t)}function xe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tn(e){return Oe=he=1,en=_(pe=e),W=0,[]}function nn(e){return pe="",e}function Se(e){return Qt(ye(W-1,_e(e===91?e+2:e===40?e+1:e)))}function kr(e){for(;($=Y())&&$<33;)q();return xe(e)>2||xe($)>3?"":" "}function Lr(e,t){for(;--t&&q()&&!($<48||$>102||$>57&&$<65||$>70&&$<97););return ye(e,je()+(t<6&&Y()==32&&q()==32))}function _e(e){for(;q();)switch($){case e:return W;case 34:case 39:e!==34&&e!==39&&_e($);break;case 40:e===41&&_e(e);break;case 92:q();break}return W}function Ar(e,t){for(;q()&&e+$!==57;)if(e+$===84&&Y()===47)break;return"/*"+ye(t,W-1)+"*"+Re(e===47?e:q())}function Er(e){for(;!xe(Y());)q();return ye(e,W)}function Br(e){return nn(ke("",null,null,null,[""],e=tn(e),0,[0],e))}function ke(e,t,n,r,i,s,o,a,c){for(var d=0,f=0,u=o,h=0,b=0,g=0,p=1,C=1,w=1,N=0,j="",x=i,v=s,y=r,m=j;C;)switch(g=N,N=q()){case 40:if(g!=108&&z(m,u-1)==58){Je(m+=M(Se(N),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:m+=Se(N);break;case 9:case 10:case 13:case 32:m+=kr(g);break;case 92:m+=Lr(je()-1,7);continue;case 47:switch(Y()){case 42:case 47:Ce(Fr(Ar(q(),je()),t,n),c);break;default:m+="/"}break;case 123*p:a[d++]=_(m)*w;case 125*p:case 59:case 0:switch(N){case 0:case 125:C=0;case 59+f:w==-1&&(m=M(m,/\f/g,"")),b>0&&_(m)-u&&Ce(b>32?Ft(m+";",r,n,u-1):Ft(M(m," ","")+";",r,n,u-2),c);break;case 59:m+=";";default:if(Ce(y=Bt(m,t,n,d,f,i,a,j,x=[],v=[],u),s),N===123)if(f===0)ke(m,t,y,y,x,s,u,a,v);else switch(h===99&&z(m,3)===110?100:h){case 100:case 108:case 109:case 115:ke(e,y,y,r&&Ce(Bt(e,y,y,0,0,i,a,j,i,x=[],u),v),i,v,u,a,r?x:v);break;default:ke(m,y,y,y,[""],v,0,a,v)}}d=f=b=0,p=w=1,j=m="",u=o;break;case 58:u=1+_(m),b=g;default:if(p<1){if(N==123)--p;else if(N==125&&p++==0&&Sr()==125)continue}switch(m+=Re(N),N*p){case 38:w=f>0?1:(m+="\f",-1);break;case 44:a[d++]=(_(m)-1)*w,w=1;break;case 64:Y()===45&&(m+=Se(q())),h=Y(),f=u=_(j=m+=Er(je())),N++;break;case 45:g===45&&_(m)==2&&(p=0)}}return s}function Bt(e,t,n,r,i,s,o,a,c,d,f){for(var u=i-1,h=i===0?s:[""],b=nt(h),g=0,p=0,C=0;g<r;++g)for(var w=0,N=ge(e,u+1,u=vr(p=o[g])),j=e;w<b;++w)(j=Qt(p>0?h[w]+" "+N:M(N,/&\f/g,h[w])))&&(c[C++]=j);return Ie(e,t,n,i===0?et:a,c,d,f)}function Fr(e,t,n){return Ie(e,t,n,Xt,Re(jr()),ge(e,2,-2),0)}function Ft(e,t,n,r){return Ie(e,t,n,tt,ge(e,0,r),ge(e,r+1,-1),r)}function de(e,t){for(var n="",r=nt(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Tr(e,t,n,r){switch(e.type){case yr:if(e.children.length)break;case xr:case tt:return e.return=e.return||e.value;case Xt:return"";case Kt:return e.return=e.value+"{"+de(e.children,r)+"}";case et:e.value=e.props.join(",")}return _(n=de(e.children,r))?e.return=e.value+"{"+n+"}":""}function Dr(e){var t=nt(e);return function(n,r,i,s){for(var o="",a=0;a<t;a++)o+=e[a](n,r,i,s)||"";return o}}function Mr(e){return function(t){t.root||(t=t.return)&&e(t)}}function Rr(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Or=function(t,n,r){for(var i=0,s=0;i=s,s=Y(),i===38&&s===12&&(n[r]=1),!xe(s);)q();return ye(t,W)},Ir=function(t,n){var r=-1,i=44;do switch(xe(i)){case 0:i===38&&Y()===12&&(n[r]=1),t[r]+=Or(W-1,n,r);break;case 2:t[r]+=Se(i);break;case 4:if(i===44){t[++r]=Y()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Re(i)}while(i=q());return t},$r=function(t,n){return nn(Ir(tn(t),n))},Tt=new WeakMap,Vr=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Tt.get(r))&&!i){Tt.set(t,!0);for(var s=[],o=$r(n,s),a=r.props,c=0,d=0;c<o.length;c++)for(var f=0;f<a.length;f++,d++)t.props[d]=s[c]?o[c].replace(/&\f/g,a[f]):a[f]+" "+o[c]}}},zr=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function rn(e,t){switch(wr(e,t)){case 5103:return D+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return D+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return D+e+Be+e+P+e+e;case 6828:case 4268:return D+e+P+e+e;case 6165:return D+e+P+"flex-"+e+e;case 5187:return D+e+M(e,/(\w+).+(:[^]+)/,D+"box-$1$2"+P+"flex-$1$2")+e;case 5443:return D+e+P+"flex-item-"+M(e,/flex-|-self/,"")+e;case 4675:return D+e+P+"flex-line-pack"+M(e,/align-content|flex-|-self/,"")+e;case 5548:return D+e+P+M(e,"shrink","negative")+e;case 5292:return D+e+P+M(e,"basis","preferred-size")+e;case 6060:return D+"box-"+M(e,"-grow","")+D+e+P+M(e,"grow","positive")+e;case 4554:return D+M(e,/([^-])(transform)/g,"$1"+D+"$2")+e;case 6187:return M(M(M(e,/(zoom-|grab)/,D+"$1"),/(image-set)/,D+"$1"),e,"")+e;case 5495:case 3959:return M(e,/(image-set\([^]*)/,D+"$1$`$1");case 4968:return M(M(e,/(.+:)(flex-)?(.*)/,D+"box-pack:$3"+P+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+D+e+e;case 4095:case 3583:case 4068:case 2532:return M(e,/(.+)-inline(.+)/,D+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_(e)-1-t>6)switch(z(e,t+1)){case 109:if(z(e,t+4)!==45)break;case 102:return M(e,/(.+:)(.+)-([^]+)/,"$1"+D+"$2-$3$1"+Be+(z(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Je(e,"stretch")?rn(M(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(z(e,t+1)!==115)break;case 6444:switch(z(e,_(e)-3-(~Je(e,"!important")&&10))){case 107:return M(e,":",":"+D)+e;case 101:return M(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+D+(z(e,14)===45?"inline-":"")+"box$3$1"+D+"$2$3$1"+P+"$2box$3")+e}break;case 5936:switch(z(e,t+11)){case 114:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return D+e+P+e+e}return e}var Pr=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case tt:t.return=rn(t.value,t.length);break;case Kt:return de([me(t,{value:M(t.value,"@","@"+D)})],i);case et:if(t.length)return Nr(t.props,function(s){switch(Cr(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return de([me(t,{props:[M(s,/:(read-\w+)/,":"+Be+"$1")]})],i);case"::placeholder":return de([me(t,{props:[M(s,/:(plac\w+)/,":"+D+"input-$1")]}),me(t,{props:[M(s,/:(plac\w+)/,":"+Be+"$1")]}),me(t,{props:[M(s,/:(plac\w+)/,P+"input-$1")]})],i)}return""})}},Gr=[Pr],Hr=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var C=p.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||Gr,s={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var C=p.getAttribute("data-emotion").split(" "),w=1;w<C.length;w++)s[C[w]]=!0;a.push(p)});var c,d=[Vr,zr];{var f,u=[Tr,Mr(function(p){f.insert(p)})],h=Dr(d.concat(i,u)),b=function(C){return de(Br(C),h)};c=function(C,w,N,j){f=N,b(C?C+"{"+w.styles+"}":w.styles),j&&(g.inserted[w.name]=!0)}}var g={key:n,sheet:new gr({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:c};return g.sheet.hydrate(a),g};function Wr(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ur={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},qr=/[A-Z]|^ms/g,Zr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sn=function(t){return t.charCodeAt(1)===45},Dt=function(t){return t!=null&&typeof t!="boolean"},He=Rr(function(e){return sn(e)?e:e.replace(qr,"-$&").toLowerCase()}),Mt=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Zr,function(r,i,s){return re={name:i,styles:s,next:re},i})}return Ur[t]!==1&&!sn(t)&&typeof n=="number"&&n!==0?n+"px":n};function Fe(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return re={name:i.name,styles:i.styles,next:re},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)re={name:o.name,styles:o.styles,next:re},o=o.next;var a=s.styles+";";return a}return Jr(e,t,n)}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function Jr(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Fe(e,t,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=s+"{"+t[a]+"}":Dt(a)&&(r+=He(s)+":"+Mt(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Dt(o[c])&&(r+=He(s)+":"+Mt(s,o[c])+";");else{var d=Fe(e,t,o);switch(s){case"animation":case"animationName":{r+=He(s)+":"+d+";";break}default:r+=s+"{"+d+"}"}}}return r}var Rt=/label:\s*([^\s;{]+)\s*(;|$)/g,re;function We(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";re=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,i+=Fe(n,t,s);else{var o=s;i+=o[0]}for(var a=1;a<e.length;a++)if(i+=Fe(n,t,e[a]),r){var c=s;i+=c[a]}Rt.lastIndex=0;for(var d="",f;(f=Rt.exec(i))!==null;)d+="-"+f[1];var u=Wr(i)+d;return{name:u,styles:i,next:re}}function on(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var _r=function(t,n,r){var i=t.key+"-"+n.name;t.registered[i]===void 0&&(t.registered[i]=n.styles)},Yr=function(t,n,r){_r(t,n);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+i:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function Ot(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function It(e,t,n){var r=[],i=on(e,r,n);return r.length<2?n:i+t(r)}var Xr=function(t){var n=Hr(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered,void 0);return Yr(n,u),n.key+"-"+u.name},i=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered),h="animation-"+u.name;return Ot(n,{name:u.name,styles:"@keyframes "+h+"{"+u.styles+"}"}),h},s=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered);Ot(n,u)},o=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return It(n.registered,r,Kr(d))};return{css:r,cx:o,injectGlobal:s,keyframes:i,hydrate:function(c){c.forEach(function(d){n.inserted[d]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:on.bind(null,n.registered),merge:It.bind(null,n.registered,r)}},Kr=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(i!=null){var s=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))s=e(i);else{s="";for(var o in i)i[o]&&o&&(s&&(s+=" "),s+=o)}break}default:s=i}s&&(n&&(n+=" "),n+=s)}}return n};const Qr=(e,t=!1,n="")=>{const{variables:r={},...i}=e,s={light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",changedBackground:"#fffbdd",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",codeFoldGutterBackground:"#dbedff",codeFoldBackground:"#f1f8ff",emptyLineBackground:"#fafbfc",gutterColor:"#212529",addedGutterColor:"#212529",removedGutterColor:"#212529",codeFoldContentColor:"#212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleColor:"#212529",diffViewerTitleBorderColor:"#eee",...r.light||{}},dark:{diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",addedBackground:"#044B53",addedColor:"white",removedBackground:"#632F34",removedColor:"white",changedBackground:"#3e302c",wordAddedBackground:"#055d67",wordRemovedBackground:"#7d383f",addedGutterBackground:"#034148",removedGutterBackground:"#632b30",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",codeFoldGutterBackground:"#262831",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#757a9b",diffViewerTitleBorderColor:"#353846",...r.dark||{}}},o=t?s.dark:s.light,{css:a,cx:c}=Xr({key:"react-diff",nonce:n}),d=a({width:"auto",label:"content"}),f=a({label:"split-view"}),u=a({background:o.diffViewerTitleBackground,color:o.diffViewerTitleColor,padding:"0.5em 1em",display:"flex",alignItems:"center",gap:"0.5em",fontFamily:"monospace",fill:o.diffViewerTitleColor}),h=a({width:"100%",minWidth:"1000px",overflowX:"auto",tableLayout:"fixed",background:o.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"1.6em",width:"fit-content"},label:"diff-container",borderCollapse:"collapse"}),b=a({overflow:"hidden",width:"100%"}),g=a({color:o.diffViewerColor,whiteSpace:"pre-wrap",fontFamily:"monospace",lineBreak:"anywhere",textDecoration:"none",label:"content-text"}),p=a({userSelect:"none",label:"unselectable"}),C=a({background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",margin:0,label:"all-expand-button",":hover":{fill:o.addedGutterColor},":focus":{outline:`1px ${o.addedGutterColor} solid`}}),w=a({background:o.diffViewerTitleBackground,padding:"0.5em",lineHeight:"1.4em",height:"2.4em",overflow:"hidden",width:"50%",borderBottom:`1px solid ${o.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${o.diffViewerTitleBorderColor}`},[`.${g}`]:{color:o.diffViewerTitleColor}}),N=a({color:o.gutterColor,label:"line-number"}),j=a({background:o.removedBackground,color:o.removedColor,pre:{color:o.removedColor},[`.${N}`]:{color:o.removedGutterColor},label:"diff-removed"}),x=a({background:o.addedBackground,color:o.addedColor,pre:{color:o.addedColor},[`.${N}`]:{color:o.addedGutterColor},label:"diff-added"}),v=a({background:o.changedBackground,[`.${N}`]:{color:o.gutterColor},label:"diff-changed"}),y=a({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),m=a({background:o.wordAddedBackground,textDecoration:"none",label:"word-added"}),A=a({background:o.wordRemovedBackground,textDecoration:"none",label:"word-removed"}),E=a({backgroundColor:o.codeFoldGutterBackground,label:"code-fold-gutter",minWidth:"50px",width:"50px"}),B=a({padding:""}),T=a({background:o.codeFoldBackground,cursor:"pointer",display:"inline",margin:0,border:"none",label:"code-fold-expand-button"}),F=a({color:o.codeFoldContentColor,fontFamily:"monospace",label:"code-fold-content"}),k=a({display:"block",width:"10px",height:"10px",backgroundColor:"#ddd",borderWidth:"1px",borderStyle:"solid",borderColor:o.diffViewerTitleBorderColor}),S=a({backgroundColor:o.wordAddedBackground}),I=a({backgroundColor:o.wordRemovedBackground}),V=a({backgroundColor:o.codeFoldBackground,height:40,fontSize:14,alignItems:"center",userSelect:"none",fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),te=a({backgroundColor:o.emptyLineBackground,label:"empty-line"}),Z=a({width:28,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${x}`]:{pre:{color:o.addedColor}},[`&.${j}`]:{pre:{color:o.removedColor}}}),se=a({background:o.highlightBackground,label:"highlighted-line",[`.${m}, .${A}`]:{backgroundColor:"initial"}}),ae=a({label:"highlighted-gutter"}),$e=a({userSelect:"none",minWidth:50,width:"50px",padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:o.gutterBackground,"&:hover":{cursor:"pointer",background:o.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${x}`]:{background:o.addedGutterBackground},[`&.${j}`]:{background:o.removedGutterBackground},[`&.${ae}`]:{background:o.highlightGutterBackground,"&:hover":{background:o.highlightGutterBackground}}}),Ve=a({"&:hover":{background:o.gutterBackground,cursor:"initial"},label:"empty-gutter"}),ne=a({verticalAlign:"baseline",label:"line",textDecoration:"none"}),ve=a({}),ie={diffContainer:h,diffRemoved:j,diffAdded:x,diffChanged:v,splitView:f,marker:Z,highlightedGutter:ae,highlightedLine:se,gutter:$e,line:ne,lineContent:b,wordDiff:y,wordAdded:m,summary:u,block:k,blockAddition:S,blockDeletion:I,wordRemoved:A,noSelect:p,codeFoldGutter:E,codeFoldExpandButton:T,codeFoldContentContainer:B,codeFold:V,emptyGutter:Ve,emptyLine:te,lineNumber:N,contentText:g,content:d,column:ve,codeFoldContent:F,titleBlock:w,allExpandButton:C},le=Object.keys(i).reduce((ce,J)=>({...ce,[J]:a(i[J])}),{});return Object.keys(ie).reduce((ce,J)=>({...ce,[J]:le[J]?c(ie[J],le[J]):ie[J]}),{})};function es(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[l.jsx("title",{children:"fold"}),l.jsx("path",{d:"M10.896 2H8.75V.75a.75.75 0 0 0-1.5 0V2H5.104a.25.25 0 0 0-.177.427l2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 2ZM8.75 15.25a.75.75 0 0 1-1.5 0V14H5.104a.25.25 0 0 1-.177-.427l2.896-2.896a.25.25 0 0 1 .354 0l2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25Zm-6.5-6.5a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}var H;(function(e){e.LEFT="L",e.RIGHT="R"})(H||(H={}));class an extends R.Component{constructor(n){super(n);G(this,"styles");G(this,"resetCodeBlocks",()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1);G(this,"onBlockExpand",n=>{const r=this.state.expandedBlocks.slice();r.push(n),this.setState({expandedBlocks:r})});G(this,"computeStyles",Mn(Qr));G(this,"onLineNumberClickProxy",n=>this.props.onLineNumberClick?r=>this.props.onLineNumberClick(n,r):()=>{});G(this,"renderWordDiff",(n,r)=>n.map((i,s)=>{const o=r?r(i.value):typeof i.value=="string"?i.value:void 0;return i.type===O.ADDED?l.jsx("ins",{className:U(this.styles.wordDiff,{[this.styles.wordAdded]:i.type===O.ADDED}),children:o},s):i.type===O.REMOVED?l.jsx("del",{className:U(this.styles.wordDiff,{[this.styles.wordRemoved]:i.type===O.REMOVED}),children:o},s):l.jsx("span",{className:U(this.styles.wordDiff),children:o},s)}));G(this,"renderLine",(n,r,i,s,o,a)=>{const c=`${i}-${n}`,d=`${a}-${o}`,f=this.props.highlightLines.includes(c)||this.props.highlightLines.includes(d),u=r===O.ADDED,h=r===O.REMOVED,b=r===O.CHANGED;let g;const p=Array.isArray(s);p?g=this.renderWordDiff(s,this.props.renderContent):this.props.renderContent?g=this.props.renderContent(s):g=s;let C="div";return u&&!p?C="ins":h&&!p&&(C="del"),l.jsxs(l.Fragment,{children:[!this.props.hideLineNumbers&&l.jsx("td",{onClick:n&&this.onLineNumberClickProxy(c),className:U(this.styles.gutter,{[this.styles.emptyGutter]:!n,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedGutter]:f}),children:l.jsx("pre",{className:this.styles.lineNumber,children:n})}),!this.props.splitView&&!this.props.hideLineNumbers&&l.jsx("td",{onClick:o&&this.onLineNumberClickProxy(d),className:U(this.styles.gutter,{[this.styles.emptyGutter]:!o,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedGutter]:f}),children:l.jsx("pre",{className:this.styles.lineNumber,children:o})}),this.props.renderGutter?this.props.renderGutter({lineNumber:n,type:r,prefix:i,value:s,additionalLineNumber:o,additionalPrefix:a,styles:this.styles}):null,l.jsx("td",{className:U(this.styles.marker,{[this.styles.emptyLine]:!g,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedLine]:f}),children:l.jsxs("pre",{children:[u&&"+",h&&"-"]})}),l.jsx("td",{className:U(this.styles.content,{[this.styles.emptyLine]:!g,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedLine]:f,left:i===H.LEFT,right:i===H.RIGHT}),onMouseDown:()=>{const w=document.getElementsByClassName(i===H.LEFT?"right":"left");for(let N=0;N<w.length;N++)w.item(N).classList.add(this.styles.noSelect)},title:u&&!p?"Added line":h&&!p?"Removed line":void 0,children:l.jsx(C,{className:this.styles.contentText,children:g})})]})});G(this,"renderSplitView",({left:n,right:r},i)=>l.jsxs("tr",{className:this.styles.line,children:[this.renderLine(n.lineNumber,n.type,H.LEFT,n.value),this.renderLine(r.lineNumber,r.type,H.RIGHT,r.value)]},i));G(this,"renderInlineView",({left:n,right:r},i)=>{let s;return n.type===O.REMOVED&&r.type===O.ADDED?l.jsxs(R.Fragment,{children:[l.jsx("tr",{className:this.styles.line,children:this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,null)}),l.jsx("tr",{className:this.styles.line,children:this.renderLine(null,r.type,H.RIGHT,r.value,r.lineNumber,H.RIGHT)})]},i):(n.type===O.REMOVED&&(s=this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,null)),n.type===O.DEFAULT&&(s=this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,r.lineNumber,H.RIGHT)),r.type===O.ADDED&&(s=this.renderLine(null,r.type,H.RIGHT,r.value,r.lineNumber)),l.jsx("tr",{className:this.styles.line,children:s},i))});G(this,"onBlockClickProxy",n=>()=>this.onBlockExpand(n));G(this,"renderSkippedLineIndicator",(n,r,i,s)=>{const{hideLineNumbers:o,splitView:a}=this.props,c=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(n,i,s):l.jsxs("span",{className:this.styles.codeFoldContent,children:["Expand ",n," lines ..."]}),d=l.jsx("td",{className:this.styles.codeFoldContentContainer,children:l.jsx("button",{type:"button",className:this.styles.codeFoldExpandButton,onClick:this.onBlockClickProxy(r),tabIndex:0,children:c})}),f=!a&&!o;return l.jsxs("tr",{className:this.styles.codeFold,children:[!o&&l.jsx("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?l.jsx("td",{className:this.styles.codeFoldGutter}):null,l.jsx("td",{className:U({[this.styles.codeFoldGutter]:f})}),f?l.jsxs(R.Fragment,{children:[l.jsx("td",{}),d]}):l.jsxs(R.Fragment,{children:[d,this.props.renderGutter?l.jsx("td",{}):null,l.jsx("td",{}),l.jsx("td",{}),o?null:l.jsx("td",{})]})]},`${i}-${s}`)});G(this,"renderDiff",()=>{const{oldValue:n,newValue:r,splitView:i,disableWordDiff:s,compareMethod:o,linesOffset:a}=this.props,{lineInformation:c,diffLines:d}=ur(n,r,s,o,a,this.props.alwaysShowLines),f=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:u,blocks:h}=Rn(c,d,f);return{diffNodes:c.map((g,p)=>{if(this.props.showDiffOnly){const C=u[p];if(C!==void 0){const w=h[C].endLine===p;if(!this.state.expandedBlocks.includes(C)&&w)return l.jsx(R.Fragment,{children:this.renderSkippedLineIndicator(h[C].lines,C,g.left.lineNumber,g.right.lineNumber)},p);if(!this.state.expandedBlocks.includes(C))return null}}return i?this.renderSplitView(g,p):this.renderInlineView(g,p)}),blocks:h,lineInformation:c}});G(this,"render",()=>{const{oldValue:n,newValue:r,useDarkTheme:i,leftTitle:s,rightTitle:o,splitView:a,compareMethod:c,hideLineNumbers:d,nonce:f}=this.props;if(typeof c=="string"&&c!==ue.JSON&&(typeof n!="string"||typeof r!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,i,f);const u=this.renderDiff();let h=3,b=4;d&&(h-=1,b-=1),this.props.renderGutter&&(h+=1,b+=1);let g=0,p=0;for(const x of u.lineInformation)x.left.type===O.ADDED&&p++,x.right.type===O.ADDED&&p++,x.left.type===O.REMOVED&&g++,x.right.type===O.REMOVED&&g++;const C=g+p,w=Math.round(p/C*100),N=[];for(let x=0;x<5;x++)w>x*20?N.push(l.jsx("span",{className:U(this.styles.block,this.styles.blockAddition)},x)):N.push(l.jsx("span",{className:U(this.styles.block,this.styles.blockDeletion)},x));const j=this.state.expandedBlocks.length===u.blocks.length;return l.jsxs("div",{children:[l.jsxs("div",{className:this.styles.summary,role:"banner",children:[l.jsx("button",{type:"button",className:this.styles.allExpandButton,onClick:()=>{this.setState({expandedBlocks:j?[]:u.blocks.map(x=>x.index)})},children:j?l.jsx(es,{}):l.jsx(hr,{})})," ",C,l.jsx("div",{style:{display:"flex",gap:"1px"},children:N}),this.props.summary?l.jsx("span",{children:this.props.summary}):null]}),l.jsx("table",{className:U(this.styles.diffContainer,{[this.styles.splitView]:a}),onMouseUp:()=>{const x=document.getElementsByClassName("right");for(let y=0;y<x.length;y++)x.item(y).classList.remove(this.styles.noSelect);const v=document.getElementsByClassName("left");for(let y=0;y<v.length;y++)v.item(y).classList.remove(this.styles.noSelect)},children:l.jsxs("tbody",{children:[l.jsxs("tr",{children:[this.props.hideLineNumbers?null:l.jsx("td",{width:"50px"}),!a&&!this.props.hideLineNumbers?l.jsx("td",{width:"50px"}):null,this.props.renderGutter?l.jsx("td",{width:"50px"}):null,l.jsx("td",{width:"28px"}),l.jsx("td",{width:"100%"}),a?l.jsxs(l.Fragment,{children:[this.props.hideLineNumbers?null:l.jsx("td",{width:"50px"}),this.props.renderGutter?l.jsx("td",{width:"50px"}):null,l.jsx("td",{width:"28px"}),l.jsx("td",{width:"100%"})]}):null]}),s||o?l.jsxs("tr",{children:[l.jsx("th",{colSpan:a?h:b,className:U(this.styles.titleBlock,this.styles.column),children:s?l.jsx("pre",{className:this.styles.contentText,children:s}):null}),a?l.jsx("th",{colSpan:h,className:U(this.styles.titleBlock,this.styles.column),children:o?l.jsx("pre",{className:this.styles.contentText,children:o}):null}):null]}):null,u.diffNodes]})})]})});this.state={expandedBlocks:[],noSelect:void 0}}}G(an,"defaultProps",{oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:ue.CHARS,styles:{},hideLineNumbers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""});function ts({diffView:e,diffContent:t,isLoading:n,entities:r,onClose:i}){var d;const[s,o]=R.useState(!1),[a,c]=R.useState(!1);return R.useEffect(()=>{c(!0)},[]),l.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-8 z-50",children:l.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-6xl w-full max-h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"p-6 border-b border-[#e1e1e1] flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"font-['IBM_Plex_Sans'] text-2xl font-semibold text-[#232323]",children:e.type==="file"?"File Diff":"Entity Diff"}),l.jsx("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e] mt-1",children:e.path}),e.type==="entity"&&e.entitySha&&l.jsxs("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e]",children:["Entity:"," ",((d=r.find(f=>f.sha===e.entitySha))==null?void 0:d.name)||e.entitySha]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:()=>o(!s),className:"px-3 py-1.5 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] text-sm font-semibold hover:bg-[#e1e1e1] transition-colors cursor-pointer",title:s?"Show changes only":"Show full file",children:s?"Show Changes Only":"Show Full File"}),l.jsx("button",{onClick:i,className:"text-[#8e8e8e] hover:text-[#626262] transition-colors cursor-pointer",children:l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:n?l.jsx("div",{className:"p-6 text-center",children:l.jsx("div",{className:"text-[#8e8e8e]",children:"Loading diff..."})}):t?l.jsx("div",{className:"diff-viewer-wrapper",children:a&&l.jsx(an,{oldValue:t.oldContent,newValue:t.newContent,splitView:!0,useDarkTheme:!1,showDiffOnly:!s,extraLinesSurroundingDiff:4,styles:{variables:{light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f6f8fa",gutterBackgroundDark:"#f3f4f6",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1"}},contentText:{fontSize:"12px",lineHeight:"1.5"},line:{padding:"2px 10px",fontSize:"12px","&:hover":{background:"#f8f9fa"}},splitView:{display:"flex",width:"100%"},diffContainer:{width:"50%",overflowX:"auto"}}})}):l.jsx("div",{className:"p-6 text-center",children:l.jsx("div",{className:"text-[#8e8e8e]",children:"No diff available"})})}),l.jsx("div",{className:"p-6 border-t border-[#e1e1e1] flex justify-end gap-3",children:l.jsx("button",{onClick:i,className:"px-4 py-2 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] font-semibold hover:bg-[#e1e1e1] transition-colors cursor-pointer",children:"Close"})})]})})}function ns({files:e,currentBranch:t,defaultBranch:n,baseBranch:r,allBranches:i,expandedFiles:s,isEntityBeingAnalyzed:o,isEntityQueued:a,sortOrder:c,onToggleFile:d,onBranchChange:f,onGenerateSimulation:u,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}){const C=e.flatMap(([j,{entities:x}])=>{const v=x.filter(y=>o(y.sha)||a(y)).map(y=>y.sha);return v.length>0?[{entityShas:v}]:[]}),w=j=>{const x=j.map(v=>Ht(v,C));return x.includes("analyzing")||x.includes("queued")?"analyzing":x.includes("out-of-date")?"out-of-date":x.includes("not-analyzed")?"not-analyzed":"up-to-date"},N=R.useMemo(()=>[...e].sort((j,x)=>{const v=j[1].entities.reduce((E,B)=>{var F;const T=((F=B.metadata)==null?void 0:F.editedAt)||B.updatedAt;return T?E?new Date(T)>new Date(E)?T:E:T:E},null),y=x[1].entities.reduce((E,B)=>{var F;const T=((F=B.metadata)==null?void 0:F.editedAt)||B.updatedAt;return T?E?new Date(T)>new Date(E)?T:E:T:E},null);if(!v&&!y)return 0;if(!v)return 1;if(!y)return-1;const m=new Date(v).getTime(),A=new Date(y).getTime();return c==="desc"?A-m:m-A}),[e,c]);return l.jsx("div",{children:e.length>0?l.jsxs("div",{children:[l.jsx(Vt,{showActions:!0,sortOrder:c,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}),l.jsx("div",{className:"flex flex-col gap-[3px]",children:N.map(([j,{status:x,entities:v,isUncommitted:y}])=>{const m=s.has(j),A=w(v),E=v.reduce((k,S)=>{var V;const I=((V=S.metadata)==null?void 0:V.editedAt)||S.updatedAt;return I?k?new Date(I)>new Date(k)?I:k:I:k},null),T=v.filter(k=>k.entityType==="visual"||k.entityType==="library").length===0;let F;return T?F=l.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"}):A==="analyzing"?F=l.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):A==="up-to-date"?F=l.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):A==="out-of-date"?F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!o(S.sha)&&!a(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):A==="not-analyzed"&&(F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!o(S.sha)&&!a(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Analyze File"})),l.jsx(zt,{filePath:j,isExpanded:m,onToggle:()=>d(j),fileStatus:x,isUncommitted:y,simulationPreviews:l.jsx(Gt,{entities:v,maxPreviews:1}),entityCount:v.length,state:A,lastModified:E,isNotAnalyzable:T,actionButton:F,children:v.sort((k,S)=>{const I=k.entityType==="visual"||k.entityType==="library",V=S.entityType==="visual"||S.entityType==="library";return I&&!V?-1:!I&&V?1:0}).map(k=>l.jsx(Pt,{entity:k,isActivelyAnalyzing:o(k.sha),isQueued:a(k),onGenerateSimulation:u},k.sha))},j)})})]}):l.jsxs("div",{className:"bg-[#efefef] rounded-[10px] flex flex-col items-center justify-center text-center",style:{height:"190px"},children:[l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-medium text-[16px] text-[#3e3e3e] leading-[24px] mb-2",children:"No Changes"}),l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-normal text-[14px] text-[#3e3e3e] leading-[18px]",children:"No files have been modified in this branch."})]})})}function rs({files:e,entityImpactMap:t,expandedFiles:n,isEntityBeingAnalyzed:r,isEntityQueued:i,projectSlug:s,baseBranch:o,currentBranch:a,sortOrder:c,onToggleFile:d,onShowFileDiff:f,onGenerateSimulation:u,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}){const C=R.useMemo(()=>{const j=[];return e.forEach(([x,{editedEntities:v}])=>{const y=v.filter(m=>r(m.sha)||i(m)).map(m=>m.sha);y.length>0&&j.push({entityShas:y})}),j},[e,r,i]),w=R.useMemo(()=>{const j=new Map;return e.forEach(([x,{editedEntities:v}])=>{const y=v.map(B=>Ht(B,C));let m;y.includes("analyzing")||y.includes("queued")?m="analyzing":y.includes("out-of-date")?m="out-of-date":y.includes("not-analyzed")?m="not-analyzed":m="up-to-date";const A=v.reduce((B,T)=>{var k;const F=((k=T.metadata)==null?void 0:k.editedAt)||T.updatedAt;return F&&(!B||new Date(F)>new Date(B))?F:B},null),E=v.filter(B=>B.entityType==="visual"||B.entityType==="library").length;j.set(x,{state:m,lastModified:A,analyzableCount:E})}),j},[e,C]),N=R.useMemo(()=>[...e].sort((j,x)=>{const v=w.get(j[0]),y=w.get(x[0]),m=v==null?void 0:v.lastModified,A=y==null?void 0:y.lastModified;if(!m&&!A)return 0;if(!m)return 1;if(!A)return-1;const E=new Date(m).getTime(),B=new Date(A).getTime();return c==="desc"?B-E:E-B}),[e,w,c]);return e.length===0?l.jsxs("div",{className:"bg-[#efefef] rounded-[10px] flex flex-col items-center justify-center text-center",style:{height:"190px"},children:[l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-medium text-[16px] text-[#3e3e3e] leading-[24px] mb-2",children:"No Uncommitted Changes"}),l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-normal text-[14px] text-[#3e3e3e] leading-[18px]",children:"If you edit a file in your project, it will show up here."})]}):l.jsxs("div",{children:[l.jsx(Vt,{showActions:!0,sortOrder:c,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}),l.jsx("div",{className:"flex flex-col gap-[3px]",children:N.map(([j,{status:x,editedEntities:v}])=>{const y=n.has(j),m=w.get(j),{state:A,lastModified:E,analyzableCount:B}=m,T=B===0;let F;return T?F=l.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"}):A==="analyzing"?F=l.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):A==="up-to-date"?F=l.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):A==="out-of-date"?F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!r(S.sha)&&!i(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):A==="not-analyzed"&&(F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!r(S.sha)&&!i(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Analyze File"})),l.jsx(zt,{filePath:j,isExpanded:y,onToggle:()=>d(j),fileStatus:x,simulationPreviews:l.jsx(Gt,{entities:v,maxPreviews:1}),entityCount:v.length,state:A,lastModified:E,isNotAnalyzable:T,isUncommitted:!0,actionButton:F,children:v.sort((k,S)=>{const I=k.entityType==="visual"||k.entityType==="library",V=S.entityType==="visual"||S.entityType==="library";return I&&!V?-1:!I&&V?1:0}).map(k=>l.jsx(Pt,{entity:k,isActivelyAnalyzing:r(k.sha),isQueued:i(k),onGenerateSimulation:u},k.sha))},j)})})]})}function ss({activeTab:e,onTabChange:t,uncommittedCount:n,branchCount:r}){return l.jsx("div",{className:"border-b border-gray-200",children:l.jsxs("nav",{className:"flex gap-8 items-center",children:[l.jsxs("button",{onClick:()=>t("branch"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="branch"?"text-primary-100":"text-gray-500 hover:text-gray-700"}`,children:[l.jsxs("span",{className:"flex items-center gap-2",children:["Branch Changes",r>0&&l.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="branch"?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:r})]}),e==="branch"&&l.jsx("span",{className:"absolute -bottom-px left-0 right-0 h-0.5 bg-primary-100"})]}),l.jsxs("button",{onClick:()=>t("uncommitted"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="uncommitted"?"text-primary-100":"text-gray-500 hover:text-gray-700"}`,children:[l.jsxs("span",{className:"flex items-center gap-2",children:["Uncommitted Changes",n>0&&l.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="uncommitted"?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:n})]}),e==="uncommitted"&&l.jsx("span",{className:"absolute -bottom-px left-0 right-0 h-0.5 bg-primary-100"})]})]})})}const bs=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],ws=mn(function(){var ft,ut;const{entities:t,gitStatus:n,currentBranch:r,actualCurrentBranch:i,defaultBranch:s,allBranches:o,baseBranch:a,branchDiff:c,currentCommit:d,projectSlug:f,queueState:u}=gn();yn({source:"git-page"});const[h,b]=xn(),[g,p]=R.useState(null),[C,w]=R.useState("desc"),[N,j]=R.useState("branch"),x=h.get("expanded")==="true",v=()=>{w(L=>L==="desc"?"asc":"desc")},y=$t(),m=y.data;R.useEffect(()=>{r&&a&&r!==a&&y.state==="idle"&&!m&&y.load(`/api/branch-entity-diff?base=${encodeURIComponent(a)}&compare=${encodeURIComponent(r)}`)},[r,a,y,m]);const A=R.useMemo(()=>{const L=jn(n,t);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[n,t]),E=R.useMemo(()=>{const L=Sn(c,t,m);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[c,t,m]),B=R.useMemo(()=>kn(n,t),[n,t]),T=R.useMemo(()=>N==="uncommitted"?A:E,[N,A,E]),F=R.useMemo(()=>T.map(([L])=>L),[T]),{expandedUncommitted:k,setExpandedUncommitted:S,toggleFile:I,expandAllUncommitted:V,collapseAllUncommitted:te}=An(x,F,[]),{diffView:Z,diffContent:se,isLoading:ae,handleShowFileDiff:$e,handleCloseDiff:Ve}=En(a,r),ne=(ft=d==null?void 0:d.metadata)==null?void 0:ft.currentRun,ve=new Set((ne==null?void 0:ne.currentEntityShas)||[]),ie=new Set(u.jobs.flatMap(L=>L.entityShas||[])),le=new Set(((ut=u.currentlyExecuting)==null?void 0:ut.entityShas)||[]),{isAnalyzing:ce,handleGenerateSimulation:J,handleGenerateAllSimulations:ln,isEntityBeingAnalyzed:rt,isEntityPending:st}=vn(ne==null?void 0:ne.currentEntityShas,u),it=L=>st(L)||ie.has(L.sha)||le.has(L.sha),cn=L=>{L===(i||r)?h.delete("viewBranch"):h.set("viewBranch",L),b(h)},ot=L=>{L===s?h.delete("compare"):h.set("compare",L),b(h)},at=()=>{const K=T.flatMap(([Q,ht])=>ht.editedEntities||ht.entities||[]).filter(Q=>!ve.has(Q.sha)&&!ie.has(Q.sha)&&!le.has(Q.sha)&&!st(Q));ln(K)},dn=A.length,fn=E.length,ze=T.flatMap(([L,K])=>K.editedEntities||K.entities||[]),be=ze.filter(L=>L.entityType==="visual"||L.entityType==="library"),Pe=be.length>0&&be.every(L=>ve.has(L.sha)),lt=be.length>0&&!Pe&&be.every(L=>ie.has(L.sha)||le.has(L.sha)),ct=ce||Pe||lt,dt=Pe?"Analyzing...":lt?"Queued...":ce?"Analyzing...":"Analyze All";return l.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:l.jsxs("div",{className:"px-20 py-12",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Git Changes"}),l.jsxs("p",{className:"text-[15px] text-gray-500",children:["This is a list of all the files that are affected by your local changes. ",l.jsx("strong",{children:"Analyze a file to get simulations."})]})]}),l.jsx("div",{className:"mb-6",children:l.jsx(ss,{activeTab:N,onTabChange:j,uncommittedCount:dn,branchCount:fn})}),r&&N==="branch"&&l.jsx("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:r===s?l.jsxs("div",{className:"text-gray-700",children:["You are currently on the primary branch,"," ",l.jsx("span",{className:"text-cyblack-75",children:s}),"."]}):l.jsxs("div",{className:"flex gap-6 items-center",children:[l.jsxs("div",{className:"shrink-0",children:[l.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Changes in Branch:"}),o.length>0?l.jsxs("div",{className:"relative w-50",children:[l.jsx("select",{value:r,onChange:L=>cn(L.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-2.5 pr-6 text-[13px] h-9.75 w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:o.map(L=>l.jsx("option",{value:L,children:L},L))}),l.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}):l.jsx("span",{className:"text-gray-900 font-medium text-[12px]",children:r})]}),l.jsxs("div",{className:"flex-shrink-0",children:[l.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Compared To:"}),l.jsxs("div",{className:"relative w-[200px]",children:[l.jsx("select",{value:a,onChange:L=>ot(L.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:o.filter(L=>L!==r).map(L=>l.jsx("option",{value:L,children:L},L))}),l.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),l.jsx("div",{className:"flex-1 mt-6",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("svg",{className:"absolute left-3 w-4 h-4 text-gray-400 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),l.jsx("input",{type:"text",placeholder:"Search component",className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})})]})}),l.jsx("div",{className:"mb-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx("span",{style:{color:"#000000"},children:T.length})," ","modified ",T.length===1?"file":"files"]}),l.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[l.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),l.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:l.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",l.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),l.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),l.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[l.jsx("span",{style:{color:"#000000"},children:ze.length})," ",ze.length===1?"entity":"entities"]})]}),T.length>0&&l.jsxs("div",{className:"flex gap-6",children:[l.jsxs("button",{onClick:V,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx(bn,{className:"w-3.5 h-3.5"}),"Expand All"]}),l.jsxs("button",{onClick:te,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx(wn,{className:"w-3.5 h-3.5"}),"Collapse All"]})]})]})}),l.jsxs("div",{className:"overflow-hidden",children:[N==="branch"&&r&&l.jsx(ns,{files:E,currentBranch:r,defaultBranch:s,baseBranch:a,allBranches:o,expandedFiles:k,isEntityBeingAnalyzed:rt,isEntityQueued:it,sortOrder:C,onToggleFile:L=>I(L,k,S),onBranchChange:ot,onGenerateSimulation:J,onSortChange:v,onAnalyzeAll:at,analyzeAllDisabled:ct,analyzeAllText:dt}),N==="uncommitted"&&l.jsx(rs,{files:A,entityImpactMap:B,expandedFiles:k,isEntityBeingAnalyzed:rt,isEntityQueued:it,projectSlug:f,baseBranch:a,currentBranch:r,sortOrder:C,onToggleFile:L=>I(L,k,S),onShowFileDiff:$e,onGenerateSimulation:J,onSortChange:v,onAnalyzeAll:at,analyzeAllDisabled:ct,analyzeAllText:dt})]}),Z&&l.jsx(ts,{diffView:Z,diffContent:se,isLoading:ae,entities:t,onClose:Ve}),g&&f&&l.jsx(Cn,{projectSlug:f,onClose:()=>p(null)})]})})});export{ws as default,bs as meta};
|