@codeyam/codeyam-cli 0.1.0-staging.09652b8 → 0.1.0-staging.28f73cf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +7 -6
  4. package/analyzer-template/packages/ai/index.ts +2 -0
  5. package/analyzer-template/packages/ai/package.json +2 -2
  6. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +24 -0
  7. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +14 -0
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1402 -546
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.ts +138 -0
  10. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +1 -1
  11. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +139 -0
  12. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/DebugTracer.ts +224 -0
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/PathManager.ts +203 -0
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/README.md +294 -0
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +161 -0
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.ts +235 -0
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +2 -0
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/selectBestValue.ts +70 -0
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.ts +113 -0
  20. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +36 -0
  21. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +32 -8
  22. package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +27 -6
  23. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +42 -4
  24. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +39 -0
  25. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +18 -6
  26. package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +2 -1
  27. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +8 -10
  28. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -1
  29. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +8 -6
  30. package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +5 -13
  31. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +34 -15
  32. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +17 -3
  33. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +35 -16
  34. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +7 -1
  35. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +9 -1
  36. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +6 -1
  37. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +9 -1
  38. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts +23 -0
  39. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -0
  40. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +30 -0
  41. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -0
  42. package/analyzer-template/packages/aws/package.json +5 -4
  43. package/analyzer-template/packages/aws/s3/index.ts +4 -0
  44. package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +62 -0
  45. package/analyzer-template/packages/generate/src/lib/scenarioComponent.ts +6 -3
  46. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.d.ts.map +1 -1
  47. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js +5 -3
  48. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js.map +1 -1
  49. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts +2 -0
  50. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts.map +1 -1
  51. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js +3 -0
  52. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js.map +1 -1
  53. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts +2 -0
  54. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts.map +1 -1
  55. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts +37 -0
  56. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -0
  57. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  58. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  59. package/analyzer-template/packages/github/dist/utils/index.d.ts +1 -0
  60. package/analyzer-template/packages/github/dist/utils/index.d.ts.map +1 -1
  61. package/analyzer-template/packages/github/dist/utils/index.js +1 -0
  62. package/analyzer-template/packages/github/dist/utils/index.js.map +1 -1
  63. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts +25 -0
  64. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  65. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js +40 -0
  66. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js.map +1 -0
  67. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  68. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  69. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  70. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  71. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  72. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  73. package/analyzer-template/packages/supabase/src/lib/kysely/db.ts +6 -0
  74. package/analyzer-template/packages/supabase/src/lib/kysely/tableRelations.ts +3 -0
  75. package/analyzer-template/packages/supabase/src/lib/kysely/tables/debugReportsTable.ts +61 -0
  76. package/analyzer-template/packages/utils/dist/utils/index.d.ts +1 -0
  77. package/analyzer-template/packages/utils/dist/utils/index.d.ts.map +1 -1
  78. package/analyzer-template/packages/utils/dist/utils/index.js +1 -0
  79. package/analyzer-template/packages/utils/dist/utils/index.js.map +1 -1
  80. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts +25 -0
  81. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  82. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js +40 -0
  83. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js.map +1 -0
  84. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  85. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  86. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  87. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  88. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  89. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  90. package/analyzer-template/packages/utils/index.ts +1 -0
  91. package/analyzer-template/packages/utils/src/lib/Semaphore.ts +42 -0
  92. package/analyzer-template/packages/utils/src/lib/frameworks/getRemixRoutePath.ts +2 -1
  93. package/analyzer-template/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.ts +1 -0
  94. package/analyzer-template/project/constructMockCode.ts +170 -6
  95. package/analyzer-template/project/reconcileMockDataKeys.ts +13 -0
  96. package/analyzer-template/project/start.ts +1 -11
  97. package/analyzer-template/project/writeMockDataTsx.ts +32 -1
  98. package/analyzer-template/project/writeScenarioComponents.ts +164 -18
  99. package/analyzer-template/project/writeUniversalMocks.ts +66 -8
  100. package/background/src/lib/virtualized/project/constructMockCode.js +158 -7
  101. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  102. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +12 -0
  103. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  104. package/background/src/lib/virtualized/project/start.js +1 -8
  105. package/background/src/lib/virtualized/project/start.js.map +1 -1
  106. package/background/src/lib/virtualized/project/writeMockDataTsx.js +25 -1
  107. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  108. package/background/src/lib/virtualized/project/writeScenarioComponents.js +129 -17
  109. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  110. package/background/src/lib/virtualized/project/writeUniversalMocks.js +56 -7
  111. package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
  112. package/codeyam-cli/src/cli.js +6 -0
  113. package/codeyam-cli/src/cli.js.map +1 -1
  114. package/codeyam-cli/src/codeyam-cli.js +0 -0
  115. package/codeyam-cli/src/commands/debug.js +221 -0
  116. package/codeyam-cli/src/commands/debug.js.map +1 -0
  117. package/codeyam-cli/src/commands/report.js +102 -0
  118. package/codeyam-cli/src/commands/report.js.map +1 -0
  119. package/codeyam-cli/src/commands/setup-sandbox.js +164 -0
  120. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -0
  121. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js +6 -6
  122. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js.map +1 -1
  123. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +8 -0
  124. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  125. package/codeyam-cli/src/utils/analyzer.js +30 -0
  126. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  127. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js +2 -2
  128. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js.map +1 -1
  129. package/codeyam-cli/src/utils/generateReport.js +219 -0
  130. package/codeyam-cli/src/utils/generateReport.js.map +1 -0
  131. package/codeyam-cli/src/utils/install-skills.js +7 -0
  132. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  133. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js +1 -0
  134. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js.map +1 -1
  135. package/codeyam-cli/src/utils/queue/job.js +5 -1
  136. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  137. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +4 -0
  138. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  139. package/codeyam-cli/src/webserver/app/lib/database.js +50 -2
  140. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  141. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-D5ZHFomX.js +1 -0
  142. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CDnfNKKQ.js → InteractivePreview-XDSzQLOY.js} +2 -2
  143. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-DUS-3h7I.js → LibraryFunctionPreview-BYVx9KFp.js} +1 -1
  144. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-TJzDQku1.js → LogViewer-CRcT5fOZ.js} +1 -1
  145. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +1 -0
  146. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BgdlWM6p.js → SafeScreenshot-Bual6h18.js} +1 -1
  147. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +6 -0
  148. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-4D2vLLJz.js +5 -0
  149. package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +1 -0
  150. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +10 -0
  151. package/codeyam-cli/src/webserver/build/client/assets/api.generate-report-l0sNRNKZ.js +1 -0
  152. package/codeyam-cli/src/webserver/build/client/assets/chart-column-B8fb6wnw.js +1 -0
  153. package/codeyam-cli/src/webserver/build/client/assets/{chunk-WWGJGFF6-DvL0YqDJ.js → chunk-WWGJGFF6-De6i8FUT.js} +1 -1
  154. package/codeyam-cli/src/webserver/build/client/assets/circle-alert-IdsgAK39.js +1 -0
  155. package/codeyam-cli/src/webserver/build/client/assets/circle-check-BACUUf75.js +1 -0
  156. package/codeyam-cli/src/webserver/build/client/assets/clock-vWeoCemX.js +1 -0
  157. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CS7XDrKv.js +1 -0
  158. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DIOEw_3i.js +1 -0
  159. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-3bYjyojg.js → entity._sha._-8Els_3Wb.js} +10 -10
  160. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DtfwpN9J.js → entity._sha_.create-scenario-C3FZJx1w.js} +1 -1
  161. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-YJz_igar.js +5 -0
  162. package/codeyam-cli/src/webserver/build/client/assets/entityStatus-BEqj2qBy.js +1 -0
  163. package/codeyam-cli/src/webserver/build/client/assets/entry.client-DiP0q291.js +5 -0
  164. package/codeyam-cli/src/webserver/build/client/assets/file-text-LM0mgxXE.js +1 -0
  165. package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +1 -0
  166. package/codeyam-cli/src/webserver/build/client/assets/{git-WoKohOtW.js → git-BXmqrWCH.js} +10 -10
  167. package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +1 -0
  168. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +5 -0
  169. package/codeyam-cli/src/webserver/build/client/assets/{index-Vvbl94Xc.js → index-D-zYbzFZ.js} +2 -2
  170. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-BXPKbHEb.js +1 -0
  171. package/codeyam-cli/src/webserver/build/client/assets/manifest-1af162d4.js +1 -0
  172. package/codeyam-cli/src/webserver/build/client/assets/root-DB7VgjCY.js +16 -0
  173. package/codeyam-cli/src/webserver/build/client/assets/settings-5zF_GOcS.js +1 -0
  174. package/codeyam-cli/src/webserver/build/client/assets/{settings-LuiJ1UIm.js → settings-Dc4MlMpK.js} +1 -1
  175. package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +1 -0
  176. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-D7k-ArFa.js +1 -0
  177. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-CpUcCv1V.js → useLastLogLine-AlhS7g5F.js} +1 -1
  178. package/codeyam-cli/src/webserver/build/client/assets/useToast-Ddo4UQv7.js +1 -0
  179. package/codeyam-cli/src/webserver/build/client/assets/zap-_jw-9DCp.js +1 -0
  180. package/codeyam-cli/src/webserver/build/server/assets/{index-DzbqTxoN.js → index-D4JpXSIO.js} +1 -1
  181. package/codeyam-cli/src/webserver/build/server/assets/server-build-vwbN7n65.js +169 -0
  182. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  183. package/codeyam-cli/src/webserver/build-info.json +5 -5
  184. package/codeyam-cli/templates/codeyam-setup-skill.md +65 -85
  185. package/codeyam-cli/templates/debug-command.md +125 -0
  186. package/package.json +4 -6
  187. package/packages/ai/index.js +1 -1
  188. package/packages/ai/index.js.map +1 -1
  189. package/packages/ai/src/lib/analyzeScope.js +13 -0
  190. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  191. package/packages/ai/src/lib/astScopes/processExpression.js +12 -0
  192. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  193. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1023 -405
  194. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  195. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js +137 -1
  196. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js.map +1 -1
  197. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +1 -1
  198. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  199. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +112 -0
  200. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -0
  201. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js +176 -0
  202. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js.map +1 -0
  203. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js +178 -0
  204. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js.map +1 -0
  205. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +138 -0
  206. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -0
  207. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js +199 -0
  208. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js.map +1 -0
  209. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +2 -0
  210. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  211. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js +62 -0
  212. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js.map +1 -0
  213. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js +90 -0
  214. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js.map +1 -0
  215. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +22 -0
  216. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
  217. package/packages/ai/src/lib/generateEntityKeyAttributes.js +32 -8
  218. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
  219. package/packages/ai/src/lib/getConditionalUsagesFromCode.js +13 -8
  220. package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
  221. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +36 -3
  222. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  223. package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
  224. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  225. package/packages/analyze/src/lib/FileAnalyzer.js +17 -5
  226. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  227. package/packages/analyze/src/lib/asts/nodes/index.js +2 -1
  228. package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
  229. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +6 -8
  230. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  231. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +5 -1
  232. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  233. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +8 -2
  234. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  235. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +5 -8
  236. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
  237. package/packages/analyze/src/lib/files/analyzeChange.js +21 -9
  238. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  239. package/packages/analyze/src/lib/files/analyzeEntity.js +10 -4
  240. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  241. package/packages/analyze/src/lib/files/analyzeInitial.js +21 -9
  242. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  243. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +6 -1
  244. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  245. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +9 -1
  246. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
  247. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +5 -1
  248. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  249. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +9 -1
  250. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  251. package/packages/generate/src/lib/scenarioComponent.js +5 -3
  252. package/packages/generate/src/lib/scenarioComponent.js.map +1 -1
  253. package/packages/supabase/src/lib/kysely/db.js +3 -0
  254. package/packages/supabase/src/lib/kysely/db.js.map +1 -1
  255. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  256. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  257. package/packages/utils/index.js +1 -0
  258. package/packages/utils/index.js.map +1 -1
  259. package/packages/utils/src/lib/Semaphore.js +40 -0
  260. package/packages/utils/src/lib/Semaphore.js.map +1 -0
  261. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  262. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  263. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  264. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  265. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-B9Sf8e9w.js +0 -1
  266. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl6GY-OE.js +0 -6
  267. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BDq8RX50.js +0 -5
  268. package/codeyam-cli/src/webserver/build/client/assets/_index-Bh3y3Wsl.js +0 -1
  269. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-tq7Bl6-t.js +0 -10
  270. package/codeyam-cli/src/webserver/build/client/assets/chart-column-q9_nHfwv.js +0 -1
  271. package/codeyam-cli/src/webserver/build/client/assets/circle-alert-CKMpA1v_.js +0 -1
  272. package/codeyam-cli/src/webserver/build/client/assets/clock-Wnfog8Qw.js +0 -1
  273. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C_ixaqqh.js +0 -1
  274. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-QecTs_sq.js +0 -5
  275. package/codeyam-cli/src/webserver/build/client/assets/entry.client-hnkEgHrC.js +0 -5
  276. package/codeyam-cli/src/webserver/build/client/assets/file-text-CvCVdKLW.js +0 -1
  277. package/codeyam-cli/src/webserver/build/client/assets/files-DgUCYhbd.js +0 -1
  278. package/codeyam-cli/src/webserver/build/client/assets/globals-DZfbt0u5.css +0 -1
  279. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-Bxm63UxG.js +0 -1
  280. package/codeyam-cli/src/webserver/build/client/assets/manifest-c90b8608.js +0 -1
  281. package/codeyam-cli/src/webserver/build/client/assets/root-DrVZQamX.js +0 -16
  282. package/codeyam-cli/src/webserver/build/client/assets/search-CJkk16Ct.js +0 -1
  283. package/codeyam-cli/src/webserver/build/client/assets/settings-ConzHeiL.js +0 -1
  284. package/codeyam-cli/src/webserver/build/client/assets/simulations-B9LRwAej.js +0 -1
  285. package/codeyam-cli/src/webserver/build/client/assets/useToast-DOxmMaSg.js +0 -1
  286. package/codeyam-cli/src/webserver/build/client/assets/zap-D5R1FAcH.js +0 -1
  287. package/codeyam-cli/src/webserver/build/server/assets/server-build-DGGis3OZ.js +0 -166
@@ -1,12 +1,12 @@
1
- import{r as q,b as rt,G as Xt,H as yr,g as vr,I as br,j as f,L as Ce,w as wr,u as jr,e as Cr}from"./chunk-WWGJGFF6-DvL0YqDJ.js";import{u as Nr}from"./useLastLogLine-CpUcCv1V.js";import{u as Sr,C as Lr}from"./useToast-DOxmMaSg.js";import{L as _r}from"./LogViewer-TJzDQku1.js";import{E as Yt}from"./EntityTypeIcon-B9Sf8e9w.js";import{g as kr,s as Dr}from"./entityVersioning-Bk_YB1jM.js";import{c as Kt}from"./file-text-CvCVdKLW.js";import{Z as Er}from"./zap-D5R1FAcH.js";import{C as Ar}from"./circle-alert-CKMpA1v_.js";import{S as er}from"./SafeScreenshot-BgdlWM6p.js";import"./chart-column-q9_nHfwv.js";const Pr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Or=Kt("circle",Pr);const Mr=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Br=Kt("plus",Mr);function tr(e,r,i=10){const n=new Map,s=o=>o.entityType==="visual"||o.entityType==="library";for(const o of e)s(o)&&n.set(o.sha,{entity:o,depth:0});const t=new Map;for(const o of r){const c=o.metadata?.importedBy;if(c)for(const l of Object.keys(c))for(const h of Object.keys(c[l])){const{shas:g}=c[l][h];for(const p of g)t.has(o.sha)||t.set(o.sha,new Set),t.get(o.sha).add(p)}}const a=[],d=new Set;for(const o of e)a.push({sha:o.sha,depth:0}),d.add(o.sha);for(;a.length>0;){const{sha:o,depth:c}=a.shift();if(c>=i)continue;const l=t.get(o);if(l)for(const h of l){if(d.has(h))continue;d.add(h);const g=r.find(p=>p.sha===h);if(g){if(s(g)){const p=c+1,x=n.get(h);(!x||p<x.depth)&&n.set(h,{entity:g,depth:p})}a.push({sha:h,depth:c+1})}}}return Array.from(n.values()).sort((o,c)=>o.depth!==c.depth?o.depth-c.depth:o.entity.name.localeCompare(c.entity.name))}function Fe(e){const r=new Map;for(const n of e)r.has(n.name)||r.set(n.name,[]),r.get(n.name).push(n);const i=[];for(const n of r.values())if(n.length===1)i.push(n[0]);else{const s=n.sort((t,a)=>{const d=t.metadata?.editedAt||t.createdAt||"";return(a.metadata?.editedAt||a.createdAt||"").localeCompare(d)});i.push(s[0])}return i}function Tr(e,r){const i=new Map,n=new Set(e.map(s=>s.path));for(const s of e)s.status==="renamed"&&s.oldPath&&n.add(s.oldPath);for(const s of e){const t=r.filter(o=>o.filePath===s.path||s.status==="renamed"&&s.oldPath&&o.filePath===s.oldPath),a=t.filter(o=>n.has(o.filePath)&&o.metadata?.isUncommitted&&!o.metadata?.isSuperseded),d=Fe(a);i.set(s.path,{status:s,entities:t,editedEntities:d})}return i}function Fr(e,r,i){const n=new Map;if(!i){for(const t of e)if(t.status==="deleted")n.set(t.path,{status:t,entities:[]});else{const a=r.filter(o=>o.filePath===t.path||t.status==="renamed"&&t.oldPath&&o.filePath===t.oldPath),d=Fe(a);n.set(t.path,{status:t,entities:d})}return n}const s=new Map;for(const t of i.fileComparisons){const a=new Set;for(const d of t.newEntities)a.add(d.name);for(const d of t.modifiedEntities)a.add(d.name);for(const d of t.deletedEntities)a.add(d.name);a.size>0&&s.set(t.filePath,a)}for(const t of e){const a=s.get(t.path);if(t.status==="deleted")n.set(t.path,{status:t,entities:[]});else{const d=a?r.filter(c=>(c.filePath===t.path||t.status==="renamed"&&t.oldPath&&c.filePath===t.oldPath)&&a.has(c.name)):[],o=Fe(d);n.set(t.path,{status:t,entities:o})}}return n}function Rr(e,r){const i=new Map,n=$r(e,r);for(const s of n){const a=tr([s],r).filter(({depth:d})=>d>0);i.set(s.sha,a)}return i}function Ir(e,r){const i=new Map;for(const n of e){const t=tr([n],r).filter(({depth:a})=>a>0);i.set(n.sha,t)}return i}function $r(e,r){const i=new Set(e.map(s=>s.path));for(const s of e)s.status==="renamed"&&s.oldPath&&i.add(s.oldPath);const n=r.filter(s=>i.has(s.filePath)&&s.metadata?.isUncommitted&&!s.metadata?.isSuperseded);return Fe(n)}function Vr(e,r,i){const[n,s]=q.useState(()=>new Set(r)),[t,a]=q.useState(()=>new Set(i)),d=q.useRef([]),o=q.useRef([]);return q.useEffect(()=>{(r.length!==d.current.length||r.some((w,y)=>w!==d.current[y]))&&(d.current=r,s(w=>{const y=new Set(w);return r.forEach(m=>{w.has(m)||y.add(m)}),y}))},[r]),q.useEffect(()=>{(i.length!==o.current.length||i.some((w,y)=>w!==o.current[y]))&&(o.current=i,a(w=>{const y=new Set(w);return i.forEach(m=>{w.has(m)||y.add(m)}),y}))},[i]),{expandedUncommitted:n,expandedBranch:t,setExpandedUncommitted:s,setExpandedBranch:a,toggleFile:(x,w,y)=>{y(m=>{const b=new Set(m);return b.has(x)?b.delete(x):b.add(x),b})},expandAllUncommitted:()=>{s(new Set(r))},collapseAllUncommitted:()=>{s(new Set)},expandAllBranch:()=>{a(new Set(i))},collapseAllBranch:()=>{a(new Set)}}}function qr(e,r,i){const[n,s]=q.useState(null),[t,a]=q.useState(null),d=rt();q.useEffect(()=>{d.data?.oldContent!==void 0&&d.data?.newContent!==void 0&&a({oldContent:d.data.oldContent,newContent:d.data.newContent,fileName:d.data.fileName})},[d.data]);const o=h=>{s({type:"file",path:h}),a(null);const g=new FormData;g.append("actionType","getDiff"),g.append("filePath",h),g.append("diffType",i==="branch"?"branch":"uncommitted"),g.append("baseBranch",e),g.append("currentBranch",r||""),d.submit(g,{method:"post"})},c=(h,g)=>{s({type:"entity",path:h,entitySha:g}),a(null);const p=new FormData;p.append("actionType","getDiff"),p.append("filePath",h),p.append("diffType",i==="branch"?"branch":"uncommitted"),p.append("baseBranch",e),p.append("currentBranch",r||""),p.append("entitySha",g),d.submit(p,{method:"post"})},l=()=>{s(null),a(null)};return{diffView:n,diffContent:t,isLoading:d.state==="loading"||d.state==="submitting",handleShowFileDiff:o,handleShowEntityDiff:c,handleCloseDiff:l}}function Gr(e){const r=rt(),{showToast:i}=Sr();q.useEffect(()=>{if(r.state==="idle"&&r.data){const a=r.data;a?.error&&i(`Error: ${a.error}`,"error",6e3)}},[r.state,r.data,i]);const n=a=>{console.log("Generate analysis clicked for entity:",a.sha,a.name);const d=new FormData;d.append("entitySha",a.sha),d.append("filePath",a.filePath||""),r.submit(d,{method:"post",action:"/api/analyze"})},s=a=>{const d=a.filter(l=>l.entityType==="visual"||l.entityType==="library");console.log("Generate analysis for all entities:",d.length);const o=d.map(l=>l.sha).join(","),c=new FormData;c.append("entityShas",o),r.submit(c,{method:"post",action:"/api/analyze"})},t=a=>e?.includes(a)??!1;return{isAnalyzing:r.state!=="idle",handleGenerateSimulation:n,handleGenerateAllSimulations:s,isEntityBeingAnalyzed:t}}var K={},Je={exports:{}};var yt;function Hr(){return yt||(yt=1,(function(e){(function(){var r={}.hasOwnProperty;function i(){for(var t="",a=0;a<arguments.length;a++){var d=arguments[a];d&&(t=s(t,n(d)))}return t}function n(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var a="";for(var d in t)r.call(t,d)&&t[d]&&(a=s(a,d));return a}function s(t,a){return a?t?t+" "+a:t+a:t}e.exports?(i.default=i,e.exports=i):window.classNames=i})()})(Je)),Je.exports}var U={},Ze={},Qe={},vt;function ae(){return vt||(vt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(){}r.prototype={diff:function(s,t){var a,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=d.callback;typeof d=="function"&&(o=d,d={}),this.options=d;var c=this;function l(S){return o?(setTimeout(function(){o(void 0,S)},0),!0):S}s=this.castInput(s),t=this.castInput(t),s=this.removeEmpty(this.tokenize(s)),t=this.removeEmpty(this.tokenize(t));var h=t.length,g=s.length,p=1,x=h+g;d.maxEditLength&&(x=Math.min(x,d.maxEditLength));var w=(a=d.timeout)!==null&&a!==void 0?a:1/0,y=Date.now()+w,m=[{oldPos:-1,lastComponent:void 0}],b=this.extractCommon(m[0],t,s,0);if(m[0].oldPos+1>=g&&b+1>=h)return l([{value:this.join(t),count:t.length}]);var L=-1/0,N=1/0;function k(){for(var S=Math.max(L,-p);S<=Math.min(N,p);S+=2){var M=void 0,P=m[S-1],F=m[S+1];P&&(m[S-1]=void 0);var u=!1;if(F){var v=F.oldPos-S;u=F&&0<=v&&v<h}var C=P&&P.oldPos+1<g;if(!u&&!C){m[S]=void 0;continue}if(!C||u&&P.oldPos+1<F.oldPos?M=c.addToPath(F,!0,void 0,0):M=c.addToPath(P,void 0,!0,1),b=c.extractCommon(M,t,s,S),M.oldPos+1>=g&&b+1>=h)return l(i(c,M.lastComponent,t,s,c.useLongestToken));m[S]=M,M.oldPos+1>=g&&(N=Math.min(N,S-1)),b+1>=h&&(L=Math.max(L,S+1))}p++}if(o)(function S(){setTimeout(function(){if(p>x||Date.now()>y)return o();k()||S()},0)})();else for(;p<=x&&Date.now()<=y;){var E=k();if(E)return E}},addToPath:function(s,t,a,d){var o=s.lastComponent;return o&&o.added===t&&o.removed===a?{oldPos:s.oldPos+d,lastComponent:{count:o.count+1,added:t,removed:a,previousComponent:o.previousComponent}}:{oldPos:s.oldPos+d,lastComponent:{count:1,added:t,removed:a,previousComponent:o}}},extractCommon:function(s,t,a,d){for(var o=t.length,c=a.length,l=s.oldPos,h=l-d,g=0;h+1<o&&l+1<c&&this.equals(t[h+1],a[l+1]);)h++,l++,g++;return g&&(s.lastComponent={count:g,previousComponent:s.lastComponent}),s.oldPos=l,h},equals:function(s,t){return this.options.comparator?this.options.comparator(s,t):s===t||this.options.ignoreCase&&s.toLowerCase()===t.toLowerCase()},removeEmpty:function(s){for(var t=[],a=0;a<s.length;a++)s[a]&&t.push(s[a]);return t},castInput:function(s){return s},tokenize:function(s){return s.split("")},join:function(s){return s.join("")}};function i(n,s,t,a,d){for(var o=[],c;s;)o.push(s),c=s.previousComponent,delete s.previousComponent,s=c;o.reverse();for(var l=0,h=o.length,g=0,p=0;l<h;l++){var x=o[l];if(x.removed){if(x.value=n.join(a.slice(p,p+x.count)),p+=x.count,l&&o[l-1].added){var y=o[l-1];o[l-1]=o[l],o[l]=y}}else{if(!x.added&&d){var w=t.slice(g,g+x.count);w=w.map(function(b,L){var N=a[p+L];return N.length>b.length?N:b}),x.value=n.join(w)}else x.value=n.join(t.slice(g,g+x.count));g+=x.count,x.added||(p+=x.count)}}var m=o[h-1];return h>1&&typeof m.value=="string"&&(m.added||m.removed)&&n.equals("",m.value)&&(o[h-2].value+=m.value,o.pop()),o}})(Qe)),Qe}var fe={},bt;function Wr(){if(bt)return fe;bt=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.diffChars=n,fe.characterDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;fe.characterDiff=i;function n(s,t,a){return i.diff(s,t,a)}return fe}var oe={},ke={},wt;function rr(){if(wt)return ke;wt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.generateOptions=e;function e(r,i){if(typeof r=="function")i.callback=r;else if(r)for(var n in r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i}return ke}var jt;function zr(){if(jt)return oe;jt=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.diffWords=a,oe.diffWordsWithSpace=d,oe.wordDiff=void 0;var e=i(ae()),r=rr();function i(o){return o&&o.__esModule?o:{default:o}}var n=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,s=/\S/,t=new e.default;oe.wordDiff=t,t.equals=function(o,c){return this.options.ignoreCase&&(o=o.toLowerCase(),c=c.toLowerCase()),o===c||this.options.ignoreWhitespace&&!s.test(o)&&!s.test(c)},t.tokenize=function(o){for(var c=o.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),l=0;l<c.length-1;l++)!c[l+1]&&c[l+2]&&n.test(c[l])&&n.test(c[l+2])&&(c[l]+=c[l+2],c.splice(l+1,2),l--);return c};function a(o,c,l){return l=(0,r.generateOptions)(l,{ignoreWhitespace:!0}),t.diff(o,c,l)}function d(o,c,l){return t.diff(o,c,l)}return oe}var le={},Ct;function nt(){if(Ct)return le;Ct=1,Object.defineProperty(le,"__esModule",{value:!0}),le.diffLines=s,le.diffTrimmedLines=t,le.lineDiff=void 0;var e=i(ae()),r=rr();function i(a){return a&&a.__esModule?a:{default:a}}var n=new e.default;le.lineDiff=n,n.tokenize=function(a){this.options.stripTrailingCr&&(a=a.replace(/\r\n/g,`
2
- `));var d=[],o=a.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(var c=0;c<o.length;c++){var l=o[c];c%2&&!this.options.newlineIsToken?d[d.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),d.push(l))}return d};function s(a,d,o){return n.diff(a,d,o)}function t(a,d,o){var c=(0,r.generateOptions)(o,{ignoreWhitespace:!0});return n.diff(a,d,c)}return le}var ue={},Nt;function Ur(){if(Nt)return ue;Nt=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.diffSentences=n,ue.sentenceDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;ue.sentenceDiff=i,i.tokenize=function(s){return s.split(/(\S.+?[.!?])(?=\s+|$)/)};function n(s,t,a){return i.diff(s,t,a)}return ue}var he={},St;function Jr(){if(St)return he;St=1,Object.defineProperty(he,"__esModule",{value:!0}),he.diffCss=n,he.cssDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;he.cssDiff=i,i.tokenize=function(s){return s.split(/([{}:;,]|\s+)/)};function n(s,t,a){return i.diff(s,t,a)}return he}var ce={},Lt;function Zr(){if(Lt)return ce;Lt=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.diffJson=a,ce.canonicalize=d,ce.jsonDiff=void 0;var e=i(ae()),r=nt();function i(o){return o&&o.__esModule?o:{default:o}}function n(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?n=function(l){return typeof l}:n=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},n(o)}var s=Object.prototype.toString,t=new e.default;ce.jsonDiff=t,t.useLongestToken=!0,t.tokenize=r.lineDiff.tokenize,t.castInput=function(o){var c=this.options,l=c.undefinedReplacement,h=c.stringifyReplacer,g=h===void 0?function(p,x){return typeof x>"u"?l:x}:h;return typeof o=="string"?o:JSON.stringify(d(o,null,null,g),g," ")},t.equals=function(o,c){return e.default.prototype.equals.call(t,o.replace(/,([\r\n])/g,"$1"),c.replace(/,([\r\n])/g,"$1"))};function a(o,c,l){return t.diff(o,c,l)}function d(o,c,l,h,g){c=c||[],l=l||[],h&&(o=h(g,o));var p;for(p=0;p<c.length;p+=1)if(c[p]===o)return l[p];var x;if(s.call(o)==="[object Array]"){for(c.push(o),x=new Array(o.length),l.push(x),p=0;p<o.length;p+=1)x[p]=d(o[p],c,l,h,g);return c.pop(),l.pop(),x}if(o&&o.toJSON&&(o=o.toJSON()),n(o)==="object"&&o!==null){c.push(o),x={},l.push(x);var w=[],y;for(y in o)o.hasOwnProperty(y)&&w.push(y);for(w.sort(),p=0;p<w.length;p+=1)y=w[p],x[y]=d(o[y],c,l,h,y);c.pop(),l.pop()}else x=o;return x}return ce}var pe={},_t;function Qr(){if(_t)return pe;_t=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.diffArrays=n,pe.arrayDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;pe.arrayDiff=i,i.tokenize=function(s){return s.slice()},i.join=i.removeEmpty=function(s){return s};function n(s,t,a){return i.diff(s,t,a)}return pe}var ye={},De={},kt;function st(){if(kt)return De;kt=1,Object.defineProperty(De,"__esModule",{value:!0}),De.parsePatch=e;function e(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.split(/\r\n|[\n\v\f\r\x85]/),s=r.match(/\r\n|[\n\v\f\r\x85]/g)||[],t=[],a=0;function d(){var l={};for(t.push(l);a<n.length;){var h=n[a];if(/^(\-\-\-|\+\+\+|@@)\s/.test(h))break;var g=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(h);g&&(l.index=g[1]),a++}for(o(l),o(l),l.hunks=[];a<n.length;){var p=n[a];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(p))break;if(/^@@/.test(p))l.hunks.push(c());else{if(p&&i.strict)throw new Error("Unknown line "+(a+1)+" "+JSON.stringify(p));a++}}}function o(l){var h=/^(---|\+\+\+)\s+(.*)$/.exec(n[a]);if(h){var g=h[1]==="---"?"old":"new",p=h[2].split(" ",2),x=p[0].replace(/\\\\/g,"\\");/^".*"$/.test(x)&&(x=x.substr(1,x.length-2)),l[g+"FileName"]=x,l[g+"Header"]=(p[1]||"").trim(),a++}}function c(){var l=a,h=n[a++],g=h.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),p={oldStart:+g[1],oldLines:typeof g[2]>"u"?1:+g[2],newStart:+g[3],newLines:typeof g[4]>"u"?1:+g[4],lines:[],linedelimiters:[]};p.oldLines===0&&(p.oldStart+=1),p.newLines===0&&(p.newStart+=1);for(var x=0,w=0;a<n.length&&!(n[a].indexOf("--- ")===0&&a+2<n.length&&n[a+1].indexOf("+++ ")===0&&n[a+2].indexOf("@@")===0);a++){var y=n[a].length==0&&a!=n.length-1?" ":n[a][0];if(y==="+"||y==="-"||y===" "||y==="\\")p.lines.push(n[a]),p.linedelimiters.push(s[a]||`
3
- `),y==="+"?x++:y==="-"?w++:y===" "&&(x++,w++);else break}if(!x&&p.newLines===1&&(p.newLines=0),!w&&p.oldLines===1&&(p.oldLines=0),i.strict){if(x!==p.newLines)throw new Error("Added line count did not match for hunk at line "+(l+1));if(w!==p.oldLines)throw new Error("Removed line count did not match for hunk at line "+(l+1))}return p}for(;a<n.length;)d();return t}return De}var Xe={},Dt;function Xr(){return Dt||(Dt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(i,n,s){var t=!0,a=!1,d=!1,o=1;return function c(){if(t&&!d){if(a?o++:t=!1,i+o<=s)return o;d=!0}if(!a)return d||(t=!0),n<=i-o?-o++:(a=!0,c())}}})(Xe)),Xe}var Et;function Yr(){if(Et)return ye;Et=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.applyPatch=n,ye.applyPatches=s;var e=st(),r=i(Xr());function i(t){return t&&t.__esModule?t:{default:t}}function n(t,a){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof a=="string"&&(a=(0,e.parsePatch)(a)),Array.isArray(a)){if(a.length>1)throw new Error("applyPatch only works with a single input.");a=a[0]}var o=t.split(/\r\n|[\n\v\f\r\x85]/),c=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],l=a.hunks,h=d.compareLine||function($,V,J,W){return V===W},g=0,p=d.fuzzFactor||0,x=0,w=0,y,m;function b($,V){for(var J=0;J<$.lines.length;J++){var W=$.lines[J],X=W.length>0?W[0]:" ",ne=W.length>0?W.substr(1):W;if(X===" "||X==="-"){if(!h(V+1,o[V],X,ne)&&(g++,g>p))return!1;V++}}return!0}for(var L=0;L<l.length;L++){for(var N=l[L],k=o.length-N.oldLines,E=0,S=w+N.oldStart-1,M=(0,r.default)(S,x,k);E!==void 0;E=M())if(b(N,S+E)){N.offset=w+=E;break}if(E===void 0)return!1;x=N.offset+N.oldStart+N.oldLines}for(var P=0,F=0;F<l.length;F++){var u=l[F],v=u.oldStart+u.offset+P-1;P+=u.newLines-u.oldLines;for(var C=0;C<u.lines.length;C++){var j=u.lines[C],_=j.length>0?j[0]:" ",D=j.length>0?j.substr(1):j,A=u.linedelimiters&&u.linedelimiters[C]||`
4
- `;if(_===" ")v++;else if(_==="-")o.splice(v,1),c.splice(v,1);else if(_==="+")o.splice(v,0,D),c.splice(v,0,A),v++;else if(_==="\\"){var O=u.lines[C-1]?u.lines[C-1][0]:null;O==="+"?y=!0:O==="-"&&(m=!0)}}}if(y)for(;!o[o.length-1];)o.pop(),c.pop();else m&&(o.push(""),c.push(`
5
- `));for(var B=0;B<o.length-1;B++)o[B]=o[B]+c[B];return o.join("")}function s(t,a){typeof t=="string"&&(t=(0,e.parsePatch)(t));var d=0;function o(){var c=t[d++];if(!c)return a.complete();a.loadFile(c,function(l,h){if(l)return a.complete(l);var g=n(h,c,a);a.patched(c,g,function(p){if(p)return a.complete(p);o()})})}o()}return ye}var ve={},de={},At;function nr(){if(At)return de;At=1,Object.defineProperty(de,"__esModule",{value:!0}),de.structuredPatch=d,de.formatPatch=o,de.createTwoFilesPatch=c,de.createPatch=l;var e=nt();function r(h){return t(h)||s(h)||n(h)||i()}function i(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
6
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(h,g){if(h){if(typeof h=="string")return a(h,g);var p=Object.prototype.toString.call(h).slice(8,-1);if(p==="Object"&&h.constructor&&(p=h.constructor.name),p==="Map"||p==="Set")return Array.from(h);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return a(h,g)}}function s(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function t(h){if(Array.isArray(h))return a(h)}function a(h,g){(g==null||g>h.length)&&(g=h.length);for(var p=0,x=new Array(g);p<g;p++)x[p]=h[p];return x}function d(h,g,p,x,w,y,m){m||(m={}),typeof m.context>"u"&&(m.context=4);var b=(0,e.diffLines)(p,x,m);if(!b)return;b.push({value:"",lines:[]});function L(v){return v.map(function(C){return" "+C})}for(var N=[],k=0,E=0,S=[],M=1,P=1,F=function(C){var j=b[C],_=j.lines||j.value.replace(/\n$/,"").split(`
7
- `);if(j.lines=_,j.added||j.removed){var D;if(!k){var A=b[C-1];k=M,E=P,A&&(S=m.context>0?L(A.lines.slice(-m.context)):[],k-=S.length,E-=S.length)}(D=S).push.apply(D,r(_.map(function(ne){return(j.added?"+":"-")+ne}))),j.added?P+=_.length:M+=_.length}else{if(k)if(_.length<=m.context*2&&C<b.length-2){var O;(O=S).push.apply(O,r(L(_)))}else{var B,$=Math.min(_.length,m.context);(B=S).push.apply(B,r(L(_.slice(0,$))));var V={oldStart:k,oldLines:M-k+$,newStart:E,newLines:P-E+$,lines:S};if(C>=b.length-2&&_.length<=m.context){var J=/\n$/.test(p),W=/\n$/.test(x),X=_.length==0&&S.length>V.oldLines;!J&&X&&p.length>0&&S.splice(V.oldLines,0,"\"),(!J&&!X||!W)&&S.push("\")}N.push(V),k=0,E=0,S=[]}M+=_.length,P+=_.length}},u=0;u<b.length;u++)F(u);return{oldFileName:h,newFileName:g,oldHeader:w,newHeader:y,hunks:N}}function o(h){if(Array.isArray(h))return h.map(o).join(`
1
+ import{r as q,b as rt,G as Xt,H as yr,A as vr,I as br,j as d,L as Ce,w as wr,u as jr,e as Cr}from"./chunk-WWGJGFF6-De6i8FUT.js";import{u as Nr}from"./useLastLogLine-AlhS7g5F.js";import{u as Sr}from"./useToast-Ddo4UQv7.js";import{L as Lr}from"./LogViewer-CRcT5fOZ.js";import{E as Yt}from"./EntityTypeIcon-D5ZHFomX.js";import{g as _r,s as kr}from"./entityVersioning-Bk_YB1jM.js";import{c as Kt}from"./createLucideIcon-CS7XDrKv.js";import{Z as Dr}from"./zap-_jw-9DCp.js";import{C as Er}from"./circle-alert-IdsgAK39.js";import{C as Ar}from"./circle-check-BACUUf75.js";import{S as er}from"./SafeScreenshot-Bual6h18.js";import"./file-text-LM0mgxXE.js";import"./chart-column-B8fb6wnw.js";const Pr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Mr=Kt("circle",Pr);const Or=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Br=Kt("plus",Or);function tr(e,r,i=10){const n=new Map,s=o=>o.entityType==="visual"||o.entityType==="library";for(const o of e)s(o)&&n.set(o.sha,{entity:o,depth:0});const t=new Map;for(const o of r){const c=o.metadata?.importedBy;if(c)for(const l of Object.keys(c))for(const h of Object.keys(c[l])){const{shas:g}=c[l][h];for(const p of g)t.has(o.sha)||t.set(o.sha,new Set),t.get(o.sha).add(p)}}const a=[],f=new Set;for(const o of e)a.push({sha:o.sha,depth:0}),f.add(o.sha);for(;a.length>0;){const{sha:o,depth:c}=a.shift();if(c>=i)continue;const l=t.get(o);if(l)for(const h of l){if(f.has(h))continue;f.add(h);const g=r.find(p=>p.sha===h);if(g){if(s(g)){const p=c+1,x=n.get(h);(!x||p<x.depth)&&n.set(h,{entity:g,depth:p})}a.push({sha:h,depth:c+1})}}}return Array.from(n.values()).sort((o,c)=>o.depth!==c.depth?o.depth-c.depth:o.entity.name.localeCompare(c.entity.name))}function Fe(e){const r=new Map;for(const n of e)r.has(n.name)||r.set(n.name,[]),r.get(n.name).push(n);const i=[];for(const n of r.values())if(n.length===1)i.push(n[0]);else{const s=n.sort((t,a)=>{const f=t.metadata?.editedAt||t.createdAt||"";return(a.metadata?.editedAt||a.createdAt||"").localeCompare(f)});i.push(s[0])}return i}function Tr(e,r){const i=new Map,n=new Set(e.map(s=>s.path));for(const s of e)s.status==="renamed"&&s.oldPath&&n.add(s.oldPath);for(const s of e){const t=r.filter(o=>o.filePath===s.path||s.status==="renamed"&&s.oldPath&&o.filePath===s.oldPath),a=t.filter(o=>n.has(o.filePath)&&o.metadata?.isUncommitted&&!o.metadata?.isSuperseded),f=Fe(a);i.set(s.path,{status:s,entities:t,editedEntities:f})}return i}function Fr(e,r,i){const n=new Map;if(!i){for(const t of e)if(t.status==="deleted")n.set(t.path,{status:t,entities:[]});else{const a=r.filter(o=>o.filePath===t.path||t.status==="renamed"&&t.oldPath&&o.filePath===t.oldPath),f=Fe(a);n.set(t.path,{status:t,entities:f})}return n}const s=new Map;for(const t of i.fileComparisons){const a=new Set;for(const f of t.newEntities)a.add(f.name);for(const f of t.modifiedEntities)a.add(f.name);for(const f of t.deletedEntities)a.add(f.name);a.size>0&&s.set(t.filePath,a)}for(const t of e){const a=s.get(t.path);if(t.status==="deleted")n.set(t.path,{status:t,entities:[]});else{const f=a?r.filter(c=>(c.filePath===t.path||t.status==="renamed"&&t.oldPath&&c.filePath===t.oldPath)&&a.has(c.name)):[],o=Fe(f);n.set(t.path,{status:t,entities:o})}}return n}function Rr(e,r){const i=new Map,n=$r(e,r);for(const s of n){const a=tr([s],r).filter(({depth:f})=>f>0);i.set(s.sha,a)}return i}function Ir(e,r){const i=new Map;for(const n of e){const t=tr([n],r).filter(({depth:a})=>a>0);i.set(n.sha,t)}return i}function $r(e,r){const i=new Set(e.map(s=>s.path));for(const s of e)s.status==="renamed"&&s.oldPath&&i.add(s.oldPath);const n=r.filter(s=>i.has(s.filePath)&&s.metadata?.isUncommitted&&!s.metadata?.isSuperseded);return Fe(n)}function Vr(e,r,i){const[n,s]=q.useState(()=>new Set(r)),[t,a]=q.useState(()=>new Set(i)),f=q.useRef([]),o=q.useRef([]);return q.useEffect(()=>{(r.length!==f.current.length||r.some((w,y)=>w!==f.current[y]))&&(f.current=r,s(w=>{const y=new Set(w);return r.forEach(m=>{w.has(m)||y.add(m)}),y}))},[r]),q.useEffect(()=>{(i.length!==o.current.length||i.some((w,y)=>w!==o.current[y]))&&(o.current=i,a(w=>{const y=new Set(w);return i.forEach(m=>{w.has(m)||y.add(m)}),y}))},[i]),{expandedUncommitted:n,expandedBranch:t,setExpandedUncommitted:s,setExpandedBranch:a,toggleFile:(x,w,y)=>{y(m=>{const b=new Set(m);return b.has(x)?b.delete(x):b.add(x),b})},expandAllUncommitted:()=>{s(new Set(r))},collapseAllUncommitted:()=>{s(new Set)},expandAllBranch:()=>{a(new Set(i))},collapseAllBranch:()=>{a(new Set)}}}function qr(e,r,i){const[n,s]=q.useState(null),[t,a]=q.useState(null),f=rt();q.useEffect(()=>{f.data?.oldContent!==void 0&&f.data?.newContent!==void 0&&a({oldContent:f.data.oldContent,newContent:f.data.newContent,fileName:f.data.fileName})},[f.data]);const o=h=>{s({type:"file",path:h}),a(null);const g=new FormData;g.append("actionType","getDiff"),g.append("filePath",h),g.append("diffType",i==="branch"?"branch":"uncommitted"),g.append("baseBranch",e),g.append("currentBranch",r||""),f.submit(g,{method:"post"})},c=(h,g)=>{s({type:"entity",path:h,entitySha:g}),a(null);const p=new FormData;p.append("actionType","getDiff"),p.append("filePath",h),p.append("diffType",i==="branch"?"branch":"uncommitted"),p.append("baseBranch",e),p.append("currentBranch",r||""),p.append("entitySha",g),f.submit(p,{method:"post"})},l=()=>{s(null),a(null)};return{diffView:n,diffContent:t,isLoading:f.state==="loading"||f.state==="submitting",handleShowFileDiff:o,handleShowEntityDiff:c,handleCloseDiff:l}}function Gr(e){const r=rt(),{showToast:i}=Sr();q.useEffect(()=>{if(r.state==="idle"&&r.data){const a=r.data;a?.error&&i(`Error: ${a.error}`,"error",6e3)}},[r.state,r.data,i]);const n=a=>{console.log("Generate analysis clicked for entity:",a.sha,a.name);const f=new FormData;f.append("entitySha",a.sha),f.append("filePath",a.filePath||""),r.submit(f,{method:"post",action:"/api/analyze"})},s=a=>{const f=a.filter(l=>l.entityType==="visual"||l.entityType==="library");console.log("Generate analysis for all entities:",f.length);const o=f.map(l=>l.sha).join(","),c=new FormData;c.append("entityShas",o),r.submit(c,{method:"post",action:"/api/analyze"})},t=a=>e?.includes(a)??!1;return{isAnalyzing:r.state!=="idle",handleGenerateSimulation:n,handleGenerateAllSimulations:s,isEntityBeingAnalyzed:t}}var K={},Je={exports:{}};var yt;function Hr(){return yt||(yt=1,(function(e){(function(){var r={}.hasOwnProperty;function i(){for(var t="",a=0;a<arguments.length;a++){var f=arguments[a];f&&(t=s(t,n(f)))}return t}function n(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var a="";for(var f in t)r.call(t,f)&&t[f]&&(a=s(a,f));return a}function s(t,a){return a?t?t+" "+a:t+a:t}e.exports?(i.default=i,e.exports=i):window.classNames=i})()})(Je)),Je.exports}var U={},Ze={},Qe={},vt;function ae(){return vt||(vt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(){}r.prototype={diff:function(s,t){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=f.callback;typeof f=="function"&&(o=f,f={}),this.options=f;var c=this;function l(S){return o?(setTimeout(function(){o(void 0,S)},0),!0):S}s=this.castInput(s),t=this.castInput(t),s=this.removeEmpty(this.tokenize(s)),t=this.removeEmpty(this.tokenize(t));var h=t.length,g=s.length,p=1,x=h+g;f.maxEditLength&&(x=Math.min(x,f.maxEditLength));var w=(a=f.timeout)!==null&&a!==void 0?a:1/0,y=Date.now()+w,m=[{oldPos:-1,lastComponent:void 0}],b=this.extractCommon(m[0],t,s,0);if(m[0].oldPos+1>=g&&b+1>=h)return l([{value:this.join(t),count:t.length}]);var L=-1/0,N=1/0;function k(){for(var S=Math.max(L,-p);S<=Math.min(N,p);S+=2){var O=void 0,P=m[S-1],F=m[S+1];P&&(m[S-1]=void 0);var u=!1;if(F){var v=F.oldPos-S;u=F&&0<=v&&v<h}var C=P&&P.oldPos+1<g;if(!u&&!C){m[S]=void 0;continue}if(!C||u&&P.oldPos+1<F.oldPos?O=c.addToPath(F,!0,void 0,0):O=c.addToPath(P,void 0,!0,1),b=c.extractCommon(O,t,s,S),O.oldPos+1>=g&&b+1>=h)return l(i(c,O.lastComponent,t,s,c.useLongestToken));m[S]=O,O.oldPos+1>=g&&(N=Math.min(N,S-1)),b+1>=h&&(L=Math.max(L,S+1))}p++}if(o)(function S(){setTimeout(function(){if(p>x||Date.now()>y)return o();k()||S()},0)})();else for(;p<=x&&Date.now()<=y;){var E=k();if(E)return E}},addToPath:function(s,t,a,f){var o=s.lastComponent;return o&&o.added===t&&o.removed===a?{oldPos:s.oldPos+f,lastComponent:{count:o.count+1,added:t,removed:a,previousComponent:o.previousComponent}}:{oldPos:s.oldPos+f,lastComponent:{count:1,added:t,removed:a,previousComponent:o}}},extractCommon:function(s,t,a,f){for(var o=t.length,c=a.length,l=s.oldPos,h=l-f,g=0;h+1<o&&l+1<c&&this.equals(t[h+1],a[l+1]);)h++,l++,g++;return g&&(s.lastComponent={count:g,previousComponent:s.lastComponent}),s.oldPos=l,h},equals:function(s,t){return this.options.comparator?this.options.comparator(s,t):s===t||this.options.ignoreCase&&s.toLowerCase()===t.toLowerCase()},removeEmpty:function(s){for(var t=[],a=0;a<s.length;a++)s[a]&&t.push(s[a]);return t},castInput:function(s){return s},tokenize:function(s){return s.split("")},join:function(s){return s.join("")}};function i(n,s,t,a,f){for(var o=[],c;s;)o.push(s),c=s.previousComponent,delete s.previousComponent,s=c;o.reverse();for(var l=0,h=o.length,g=0,p=0;l<h;l++){var x=o[l];if(x.removed){if(x.value=n.join(a.slice(p,p+x.count)),p+=x.count,l&&o[l-1].added){var y=o[l-1];o[l-1]=o[l],o[l]=y}}else{if(!x.added&&f){var w=t.slice(g,g+x.count);w=w.map(function(b,L){var N=a[p+L];return N.length>b.length?N:b}),x.value=n.join(w)}else x.value=n.join(t.slice(g,g+x.count));g+=x.count,x.added||(p+=x.count)}}var m=o[h-1];return h>1&&typeof m.value=="string"&&(m.added||m.removed)&&n.equals("",m.value)&&(o[h-2].value+=m.value,o.pop()),o}})(Qe)),Qe}var fe={},bt;function Wr(){if(bt)return fe;bt=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.diffChars=n,fe.characterDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;fe.characterDiff=i;function n(s,t,a){return i.diff(s,t,a)}return fe}var oe={},ke={},wt;function rr(){if(wt)return ke;wt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.generateOptions=e;function e(r,i){if(typeof r=="function")i.callback=r;else if(r)for(var n in r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i}return ke}var jt;function zr(){if(jt)return oe;jt=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.diffWords=a,oe.diffWordsWithSpace=f,oe.wordDiff=void 0;var e=i(ae()),r=rr();function i(o){return o&&o.__esModule?o:{default:o}}var n=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,s=/\S/,t=new e.default;oe.wordDiff=t,t.equals=function(o,c){return this.options.ignoreCase&&(o=o.toLowerCase(),c=c.toLowerCase()),o===c||this.options.ignoreWhitespace&&!s.test(o)&&!s.test(c)},t.tokenize=function(o){for(var c=o.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),l=0;l<c.length-1;l++)!c[l+1]&&c[l+2]&&n.test(c[l])&&n.test(c[l+2])&&(c[l]+=c[l+2],c.splice(l+1,2),l--);return c};function a(o,c,l){return l=(0,r.generateOptions)(l,{ignoreWhitespace:!0}),t.diff(o,c,l)}function f(o,c,l){return t.diff(o,c,l)}return oe}var le={},Ct;function nt(){if(Ct)return le;Ct=1,Object.defineProperty(le,"__esModule",{value:!0}),le.diffLines=s,le.diffTrimmedLines=t,le.lineDiff=void 0;var e=i(ae()),r=rr();function i(a){return a&&a.__esModule?a:{default:a}}var n=new e.default;le.lineDiff=n,n.tokenize=function(a){this.options.stripTrailingCr&&(a=a.replace(/\r\n/g,`
2
+ `));var f=[],o=a.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(var c=0;c<o.length;c++){var l=o[c];c%2&&!this.options.newlineIsToken?f[f.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),f.push(l))}return f};function s(a,f,o){return n.diff(a,f,o)}function t(a,f,o){var c=(0,r.generateOptions)(o,{ignoreWhitespace:!0});return n.diff(a,f,c)}return le}var ue={},Nt;function Ur(){if(Nt)return ue;Nt=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.diffSentences=n,ue.sentenceDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;ue.sentenceDiff=i,i.tokenize=function(s){return s.split(/(\S.+?[.!?])(?=\s+|$)/)};function n(s,t,a){return i.diff(s,t,a)}return ue}var he={},St;function Jr(){if(St)return he;St=1,Object.defineProperty(he,"__esModule",{value:!0}),he.diffCss=n,he.cssDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;he.cssDiff=i,i.tokenize=function(s){return s.split(/([{}:;,]|\s+)/)};function n(s,t,a){return i.diff(s,t,a)}return he}var ce={},Lt;function Zr(){if(Lt)return ce;Lt=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.diffJson=a,ce.canonicalize=f,ce.jsonDiff=void 0;var e=i(ae()),r=nt();function i(o){return o&&o.__esModule?o:{default:o}}function n(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?n=function(l){return typeof l}:n=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},n(o)}var s=Object.prototype.toString,t=new e.default;ce.jsonDiff=t,t.useLongestToken=!0,t.tokenize=r.lineDiff.tokenize,t.castInput=function(o){var c=this.options,l=c.undefinedReplacement,h=c.stringifyReplacer,g=h===void 0?function(p,x){return typeof x>"u"?l:x}:h;return typeof o=="string"?o:JSON.stringify(f(o,null,null,g),g," ")},t.equals=function(o,c){return e.default.prototype.equals.call(t,o.replace(/,([\r\n])/g,"$1"),c.replace(/,([\r\n])/g,"$1"))};function a(o,c,l){return t.diff(o,c,l)}function f(o,c,l,h,g){c=c||[],l=l||[],h&&(o=h(g,o));var p;for(p=0;p<c.length;p+=1)if(c[p]===o)return l[p];var x;if(s.call(o)==="[object Array]"){for(c.push(o),x=new Array(o.length),l.push(x),p=0;p<o.length;p+=1)x[p]=f(o[p],c,l,h,g);return c.pop(),l.pop(),x}if(o&&o.toJSON&&(o=o.toJSON()),n(o)==="object"&&o!==null){c.push(o),x={},l.push(x);var w=[],y;for(y in o)o.hasOwnProperty(y)&&w.push(y);for(w.sort(),p=0;p<w.length;p+=1)y=w[p],x[y]=f(o[y],c,l,h,y);c.pop(),l.pop()}else x=o;return x}return ce}var pe={},_t;function Qr(){if(_t)return pe;_t=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.diffArrays=n,pe.arrayDiff=void 0;var e=r(ae());function r(s){return s&&s.__esModule?s:{default:s}}var i=new e.default;pe.arrayDiff=i,i.tokenize=function(s){return s.slice()},i.join=i.removeEmpty=function(s){return s};function n(s,t,a){return i.diff(s,t,a)}return pe}var ye={},De={},kt;function st(){if(kt)return De;kt=1,Object.defineProperty(De,"__esModule",{value:!0}),De.parsePatch=e;function e(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.split(/\r\n|[\n\v\f\r\x85]/),s=r.match(/\r\n|[\n\v\f\r\x85]/g)||[],t=[],a=0;function f(){var l={};for(t.push(l);a<n.length;){var h=n[a];if(/^(\-\-\-|\+\+\+|@@)\s/.test(h))break;var g=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(h);g&&(l.index=g[1]),a++}for(o(l),o(l),l.hunks=[];a<n.length;){var p=n[a];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(p))break;if(/^@@/.test(p))l.hunks.push(c());else{if(p&&i.strict)throw new Error("Unknown line "+(a+1)+" "+JSON.stringify(p));a++}}}function o(l){var h=/^(---|\+\+\+)\s+(.*)$/.exec(n[a]);if(h){var g=h[1]==="---"?"old":"new",p=h[2].split(" ",2),x=p[0].replace(/\\\\/g,"\\");/^".*"$/.test(x)&&(x=x.substr(1,x.length-2)),l[g+"FileName"]=x,l[g+"Header"]=(p[1]||"").trim(),a++}}function c(){var l=a,h=n[a++],g=h.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),p={oldStart:+g[1],oldLines:typeof g[2]>"u"?1:+g[2],newStart:+g[3],newLines:typeof g[4]>"u"?1:+g[4],lines:[],linedelimiters:[]};p.oldLines===0&&(p.oldStart+=1),p.newLines===0&&(p.newStart+=1);for(var x=0,w=0;a<n.length&&!(n[a].indexOf("--- ")===0&&a+2<n.length&&n[a+1].indexOf("+++ ")===0&&n[a+2].indexOf("@@")===0);a++){var y=n[a].length==0&&a!=n.length-1?" ":n[a][0];if(y==="+"||y==="-"||y===" "||y==="\\")p.lines.push(n[a]),p.linedelimiters.push(s[a]||`
3
+ `),y==="+"?x++:y==="-"?w++:y===" "&&(x++,w++);else break}if(!x&&p.newLines===1&&(p.newLines=0),!w&&p.oldLines===1&&(p.oldLines=0),i.strict){if(x!==p.newLines)throw new Error("Added line count did not match for hunk at line "+(l+1));if(w!==p.oldLines)throw new Error("Removed line count did not match for hunk at line "+(l+1))}return p}for(;a<n.length;)f();return t}return De}var Xe={},Dt;function Xr(){return Dt||(Dt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(i,n,s){var t=!0,a=!1,f=!1,o=1;return function c(){if(t&&!f){if(a?o++:t=!1,i+o<=s)return o;f=!0}if(!a)return f||(t=!0),n<=i-o?-o++:(a=!0,c())}}})(Xe)),Xe}var Et;function Yr(){if(Et)return ye;Et=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.applyPatch=n,ye.applyPatches=s;var e=st(),r=i(Xr());function i(t){return t&&t.__esModule?t:{default:t}}function n(t,a){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof a=="string"&&(a=(0,e.parsePatch)(a)),Array.isArray(a)){if(a.length>1)throw new Error("applyPatch only works with a single input.");a=a[0]}var o=t.split(/\r\n|[\n\v\f\r\x85]/),c=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],l=a.hunks,h=f.compareLine||function($,V,J,W){return V===W},g=0,p=f.fuzzFactor||0,x=0,w=0,y,m;function b($,V){for(var J=0;J<$.lines.length;J++){var W=$.lines[J],X=W.length>0?W[0]:" ",ne=W.length>0?W.substr(1):W;if(X===" "||X==="-"){if(!h(V+1,o[V],X,ne)&&(g++,g>p))return!1;V++}}return!0}for(var L=0;L<l.length;L++){for(var N=l[L],k=o.length-N.oldLines,E=0,S=w+N.oldStart-1,O=(0,r.default)(S,x,k);E!==void 0;E=O())if(b(N,S+E)){N.offset=w+=E;break}if(E===void 0)return!1;x=N.offset+N.oldStart+N.oldLines}for(var P=0,F=0;F<l.length;F++){var u=l[F],v=u.oldStart+u.offset+P-1;P+=u.newLines-u.oldLines;for(var C=0;C<u.lines.length;C++){var j=u.lines[C],_=j.length>0?j[0]:" ",D=j.length>0?j.substr(1):j,A=u.linedelimiters&&u.linedelimiters[C]||`
4
+ `;if(_===" ")v++;else if(_==="-")o.splice(v,1),c.splice(v,1);else if(_==="+")o.splice(v,0,D),c.splice(v,0,A),v++;else if(_==="\\"){var M=u.lines[C-1]?u.lines[C-1][0]:null;M==="+"?y=!0:M==="-"&&(m=!0)}}}if(y)for(;!o[o.length-1];)o.pop(),c.pop();else m&&(o.push(""),c.push(`
5
+ `));for(var B=0;B<o.length-1;B++)o[B]=o[B]+c[B];return o.join("")}function s(t,a){typeof t=="string"&&(t=(0,e.parsePatch)(t));var f=0;function o(){var c=t[f++];if(!c)return a.complete();a.loadFile(c,function(l,h){if(l)return a.complete(l);var g=n(h,c,a);a.patched(c,g,function(p){if(p)return a.complete(p);o()})})}o()}return ye}var ve={},de={},At;function nr(){if(At)return de;At=1,Object.defineProperty(de,"__esModule",{value:!0}),de.structuredPatch=f,de.formatPatch=o,de.createTwoFilesPatch=c,de.createPatch=l;var e=nt();function r(h){return t(h)||s(h)||n(h)||i()}function i(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(h,g){if(h){if(typeof h=="string")return a(h,g);var p=Object.prototype.toString.call(h).slice(8,-1);if(p==="Object"&&h.constructor&&(p=h.constructor.name),p==="Map"||p==="Set")return Array.from(h);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return a(h,g)}}function s(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function t(h){if(Array.isArray(h))return a(h)}function a(h,g){(g==null||g>h.length)&&(g=h.length);for(var p=0,x=new Array(g);p<g;p++)x[p]=h[p];return x}function f(h,g,p,x,w,y,m){m||(m={}),typeof m.context>"u"&&(m.context=4);var b=(0,e.diffLines)(p,x,m);if(!b)return;b.push({value:"",lines:[]});function L(v){return v.map(function(C){return" "+C})}for(var N=[],k=0,E=0,S=[],O=1,P=1,F=function(C){var j=b[C],_=j.lines||j.value.replace(/\n$/,"").split(`
7
+ `);if(j.lines=_,j.added||j.removed){var D;if(!k){var A=b[C-1];k=O,E=P,A&&(S=m.context>0?L(A.lines.slice(-m.context)):[],k-=S.length,E-=S.length)}(D=S).push.apply(D,r(_.map(function(ne){return(j.added?"+":"-")+ne}))),j.added?P+=_.length:O+=_.length}else{if(k)if(_.length<=m.context*2&&C<b.length-2){var M;(M=S).push.apply(M,r(L(_)))}else{var B,$=Math.min(_.length,m.context);(B=S).push.apply(B,r(L(_.slice(0,$))));var V={oldStart:k,oldLines:O-k+$,newStart:E,newLines:P-E+$,lines:S};if(C>=b.length-2&&_.length<=m.context){var J=/\n$/.test(p),W=/\n$/.test(x),X=_.length==0&&S.length>V.oldLines;!J&&X&&p.length>0&&S.splice(V.oldLines,0,"\"),(!J&&!X||!W)&&S.push("\")}N.push(V),k=0,E=0,S=[]}O+=_.length,P+=_.length}},u=0;u<b.length;u++)F(u);return{oldFileName:h,newFileName:g,oldHeader:w,newHeader:y,hunks:N}}function o(h){if(Array.isArray(h))return h.map(o).join(`
8
8
  `);var g=[];h.oldFileName==h.newFileName&&g.push("Index: "+h.oldFileName),g.push("==================================================================="),g.push("--- "+h.oldFileName+(typeof h.oldHeader>"u"?"":" "+h.oldHeader)),g.push("+++ "+h.newFileName+(typeof h.newHeader>"u"?"":" "+h.newHeader));for(var p=0;p<h.hunks.length;p++){var x=h.hunks[p];x.oldLines===0&&(x.oldStart-=1),x.newLines===0&&(x.newStart-=1),g.push("@@ -"+x.oldStart+","+x.oldLines+" +"+x.newStart+","+x.newLines+" @@"),g.push.apply(g,x.lines)}return g.join(`
9
9
  `)+`
10
- `}function c(h,g,p,x,w,y,m){return o(d(h,g,p,x,w,y,m))}function l(h,g,p,x,w,y){return c(h,h,g,p,x,w,y)}return de}var be={},Pt;function Kr(){if(Pt)return be;Pt=1,Object.defineProperty(be,"__esModule",{value:!0}),be.arrayEqual=e,be.arrayStartsWith=r;function e(i,n){return i.length!==n.length?!1:r(i,n)}function r(i,n){if(n.length>i.length)return!1;for(var s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}return be}var Ot;function en(){if(Ot)return ve;Ot=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.calcLineCount=c,ve.merge=l;var e=nr(),r=st(),i=Kr();function n(u){return d(u)||a(u)||t(u)||s()}function s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t(u,v){if(u){if(typeof u=="string")return o(u,v);var C=Object.prototype.toString.call(u).slice(8,-1);if(C==="Object"&&u.constructor&&(C=u.constructor.name),C==="Map"||C==="Set")return Array.from(u);if(C==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C))return o(u,v)}}function a(u){if(typeof Symbol<"u"&&Symbol.iterator in Object(u))return Array.from(u)}function d(u){if(Array.isArray(u))return o(u)}function o(u,v){(v==null||v>u.length)&&(v=u.length);for(var C=0,j=new Array(v);C<v;C++)j[C]=u[C];return j}function c(u){var v=F(u.lines),C=v.oldLines,j=v.newLines;C!==void 0?u.oldLines=C:delete u.oldLines,j!==void 0?u.newLines=j:delete u.newLines}function l(u,v,C){u=h(u,C),v=h(v,C);var j={};(u.index||v.index)&&(j.index=u.index||v.index),(u.newFileName||v.newFileName)&&(g(u)?g(v)?(j.oldFileName=p(j,u.oldFileName,v.oldFileName),j.newFileName=p(j,u.newFileName,v.newFileName),j.oldHeader=p(j,u.oldHeader,v.oldHeader),j.newHeader=p(j,u.newHeader,v.newHeader)):(j.oldFileName=u.oldFileName,j.newFileName=u.newFileName,j.oldHeader=u.oldHeader,j.newHeader=u.newHeader):(j.oldFileName=v.oldFileName||u.oldFileName,j.newFileName=v.newFileName||u.newFileName,j.oldHeader=v.oldHeader||u.oldHeader,j.newHeader=v.newHeader||u.newHeader)),j.hunks=[];for(var _=0,D=0,A=0,O=0;_<u.hunks.length||D<v.hunks.length;){var B=u.hunks[_]||{oldStart:1/0},$=v.hunks[D]||{oldStart:1/0};if(x(B,$))j.hunks.push(w(B,A)),_++,O+=B.newLines-B.oldLines;else if(x($,B))j.hunks.push(w($,O)),D++,A+=$.newLines-$.oldLines;else{var V={oldStart:Math.min(B.oldStart,$.oldStart),oldLines:0,newStart:Math.min(B.newStart+A,$.oldStart+O),newLines:0,lines:[]};y(V,B.oldStart,B.lines,$.oldStart,$.lines),D++,_++,j.hunks.push(V)}}return j}function h(u,v){if(typeof u=="string"){if(/^@@/m.test(u)||/^Index:/m.test(u))return(0,r.parsePatch)(u)[0];if(!v)throw new Error("Must provide a base reference or pass in a patch");return(0,e.structuredPatch)(void 0,void 0,v,u)}return u}function g(u){return u.newFileName&&u.newFileName!==u.oldFileName}function p(u,v,C){return v===C?v:(u.conflict=!0,{mine:v,theirs:C})}function x(u,v){return u.oldStart<v.oldStart&&u.oldStart+u.oldLines<v.oldStart}function w(u,v){return{oldStart:u.oldStart,oldLines:u.oldLines,newStart:u.newStart+v,newLines:u.newLines,lines:u.lines}}function y(u,v,C,j,_){var D={offset:v,lines:C,index:0},A={offset:j,lines:_,index:0};for(N(u,D,A),N(u,A,D);D.index<D.lines.length&&A.index<A.lines.length;){var O=D.lines[D.index],B=A.lines[A.index];if((O[0]==="-"||O[0]==="+")&&(B[0]==="-"||B[0]==="+"))m(u,D,A);else if(O[0]==="+"&&B[0]===" "){var $;($=u.lines).push.apply($,n(E(D)))}else if(B[0]==="+"&&O[0]===" "){var V;(V=u.lines).push.apply(V,n(E(A)))}else O[0]==="-"&&B[0]===" "?b(u,D,A):B[0]==="-"&&O[0]===" "?b(u,A,D,!0):O===B?(u.lines.push(O),D.index++,A.index++):L(u,E(D),E(A))}k(u,D),k(u,A),c(u)}function m(u,v,C){var j=E(v),_=E(C);if(M(j)&&M(_)){if((0,i.arrayStartsWith)(j,_)&&P(C,j,j.length-_.length)){var D;(D=u.lines).push.apply(D,n(j));return}else if((0,i.arrayStartsWith)(_,j)&&P(v,_,_.length-j.length)){var A;(A=u.lines).push.apply(A,n(_));return}}else if((0,i.arrayEqual)(j,_)){var O;(O=u.lines).push.apply(O,n(j));return}L(u,j,_)}function b(u,v,C,j){var _=E(v),D=S(C,_);if(D.merged){var A;(A=u.lines).push.apply(A,n(D.merged))}else L(u,j?D:_,j?_:D)}function L(u,v,C){u.conflict=!0,u.lines.push({conflict:!0,mine:v,theirs:C})}function N(u,v,C){for(;v.offset<C.offset&&v.index<v.lines.length;){var j=v.lines[v.index++];u.lines.push(j),v.offset++}}function k(u,v){for(;v.index<v.lines.length;){var C=v.lines[v.index++];u.lines.push(C)}}function E(u){for(var v=[],C=u.lines[u.index][0];u.index<u.lines.length;){var j=u.lines[u.index];if(C==="-"&&j[0]==="+"&&(C="+"),C===j[0])v.push(j),u.index++;else break}return v}function S(u,v){for(var C=[],j=[],_=0,D=!1,A=!1;_<v.length&&u.index<u.lines.length;){var O=u.lines[u.index],B=v[_];if(B[0]==="+")break;if(D=D||O[0]!==" ",j.push(B),_++,O[0]==="+")for(A=!0;O[0]==="+";)C.push(O),O=u.lines[++u.index];B.substr(1)===O.substr(1)?(C.push(O),u.index++):A=!0}if((v[_]||"")[0]==="+"&&D&&(A=!0),A)return C;for(;_<v.length;)j.push(v[_++]);return{merged:j,changes:C}}function M(u){return u.reduce(function(v,C){return v&&C[0]==="-"},!0)}function P(u,v,C){for(var j=0;j<C;j++){var _=v[v.length-C+j].substr(1);if(u.lines[u.index+j]!==" "+_)return!1}return u.index+=C,!0}function F(u){var v=0,C=0;return u.forEach(function(j){if(typeof j!="string"){var _=F(j.mine),D=F(j.theirs);v!==void 0&&(_.oldLines===D.oldLines?v+=_.oldLines:v=void 0),C!==void 0&&(_.newLines===D.newLines?C+=_.newLines:C=void 0)}else C!==void 0&&(j[0]==="+"||j[0]===" ")&&C++,v!==void 0&&(j[0]==="-"||j[0]===" ")&&v++}),{oldLines:v,newLines:C}}return ve}var Ee={},Mt;function tn(){if(Mt)return Ee;Mt=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.reversePatch=n;function e(s,t){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(s);t&&(d=d.filter(function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable})),a.push.apply(a,d)}return a}function r(s){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?e(Object(a),!0).forEach(function(d){i(s,d,a[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(d){Object.defineProperty(s,d,Object.getOwnPropertyDescriptor(a,d))})}return s}function i(s,t,a){return t in s?Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[t]=a,s}function n(s){return Array.isArray(s)?s.map(n).reverse():r(r({},s),{},{oldFileName:s.newFileName,oldHeader:s.newHeader,newFileName:s.oldFileName,newHeader:s.oldHeader,hunks:s.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(a){return a.startsWith("-")?"+".concat(a.slice(1)):a.startsWith("+")?"-".concat(a.slice(1)):a})}})})}return Ee}var Ae={},Bt;function rn(){if(Bt)return Ae;Bt=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.convertChangesToDMP=e;function e(r){for(var i=[],n,s,t=0;t<r.length;t++)n=r[t],n.added?s=1:n.removed?s=-1:s=0,i.push([s,n.value]);return i}return Ae}var Pe={},Tt;function nn(){if(Tt)return Pe;Tt=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.convertChangesToXML=e;function e(i){for(var n=[],s=0;s<i.length;s++){var t=i[s];t.added?n.push("<ins>"):t.removed&&n.push("<del>"),n.push(r(t.value)),t.added?n.push("</ins>"):t.removed&&n.push("</del>")}return n.join("")}function r(i){var n=i;return n=n.replace(/&/g,"&amp;"),n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(/"/g,"&quot;"),n}return Pe}var Ft;function sn(){return Ft||(Ft=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Diff",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"diffChars",{enumerable:!0,get:function(){return i.diffChars}}),Object.defineProperty(e,"diffWords",{enumerable:!0,get:function(){return n.diffWords}}),Object.defineProperty(e,"diffWordsWithSpace",{enumerable:!0,get:function(){return n.diffWordsWithSpace}}),Object.defineProperty(e,"diffLines",{enumerable:!0,get:function(){return s.diffLines}}),Object.defineProperty(e,"diffTrimmedLines",{enumerable:!0,get:function(){return s.diffTrimmedLines}}),Object.defineProperty(e,"diffSentences",{enumerable:!0,get:function(){return t.diffSentences}}),Object.defineProperty(e,"diffCss",{enumerable:!0,get:function(){return a.diffCss}}),Object.defineProperty(e,"diffJson",{enumerable:!0,get:function(){return d.diffJson}}),Object.defineProperty(e,"canonicalize",{enumerable:!0,get:function(){return d.canonicalize}}),Object.defineProperty(e,"diffArrays",{enumerable:!0,get:function(){return o.diffArrays}}),Object.defineProperty(e,"applyPatch",{enumerable:!0,get:function(){return c.applyPatch}}),Object.defineProperty(e,"applyPatches",{enumerable:!0,get:function(){return c.applyPatches}}),Object.defineProperty(e,"parsePatch",{enumerable:!0,get:function(){return l.parsePatch}}),Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return h.merge}}),Object.defineProperty(e,"reversePatch",{enumerable:!0,get:function(){return g.reversePatch}}),Object.defineProperty(e,"structuredPatch",{enumerable:!0,get:function(){return p.structuredPatch}}),Object.defineProperty(e,"createTwoFilesPatch",{enumerable:!0,get:function(){return p.createTwoFilesPatch}}),Object.defineProperty(e,"createPatch",{enumerable:!0,get:function(){return p.createPatch}}),Object.defineProperty(e,"formatPatch",{enumerable:!0,get:function(){return p.formatPatch}}),Object.defineProperty(e,"convertChangesToDMP",{enumerable:!0,get:function(){return x.convertChangesToDMP}}),Object.defineProperty(e,"convertChangesToXML",{enumerable:!0,get:function(){return w.convertChangesToXML}});var r=y(ae()),i=Wr(),n=zr(),s=nt(),t=Ur(),a=Jr(),d=Zr(),o=Qr(),c=Yr(),l=st(),h=en(),g=tn(),p=nr(),x=rn(),w=nn();function y(m){return m&&m.__esModule?m:{default:m}}})(Ze)),Ze}var Rt;function an(){if(Rt)return U;Rt=1;var e=U&&U.__createBinding||(Object.create?(function(l,h,g,p){p===void 0&&(p=g);var x=Object.getOwnPropertyDescriptor(h,g);(!x||("get"in x?!h.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return h[g]}}),Object.defineProperty(l,p,x)}):(function(l,h,g,p){p===void 0&&(p=g),l[p]=h[g]})),r=U&&U.__setModuleDefault||(Object.create?(function(l,h){Object.defineProperty(l,"default",{enumerable:!0,value:h})}):function(l,h){l.default=h}),i=U&&U.__importStar||function(l){if(l&&l.__esModule)return l;var h={};if(l!=null)for(var g in l)g!=="default"&&Object.prototype.hasOwnProperty.call(l,g)&&e(h,l,g);return r(h,l),h};Object.defineProperty(U,"__esModule",{value:!0}),U.computeLineInformation=U.DiffMethod=U.DiffType=void 0;const n=i(sn()),s=n;var t;(function(l){l[l.DEFAULT=0]="DEFAULT",l[l.ADDED=1]="ADDED",l[l.REMOVED=2]="REMOVED",l[l.CHANGED=3]="CHANGED"})(t||(U.DiffType=t={}));var a;(function(l){l.CHARS="diffChars",l.WORDS="diffWords",l.WORDS_WITH_SPACE="diffWordsWithSpace",l.LINES="diffLines",l.TRIMMED_LINES="diffTrimmedLines",l.SENTENCES="diffSentences",l.CSS="diffCss",l.JSON="diffJson"})(a||(U.DiffMethod=a={}));const d=l=>l===""?[]:l.replace(/\n$/,"").split(`
12
- `),o=(l,h,g=a.CHARS)=>{const p=s[g](l,h),x={left:[],right:[]};return p.forEach(({added:w,removed:y,value:m})=>{const b={};return w&&(b.type=t.ADDED,b.value=m,x.right.push(b)),y&&(b.type=t.REMOVED,b.value=m,x.left.push(b)),!y&&!w&&(b.type=t.DEFAULT,b.value=m,x.right.push(b),x.left.push(b)),b}),x},c=(l,h,g=!1,p=a.CHARS,x=0,w=[])=>{let y=[];typeof l=="string"&&typeof h=="string"?y=n.diffLines(l.trimRight(),h.trimRight(),{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):y=n.diffJson(l,h);let m=x,b=x,L=[],N=0;const k=[],E=[],S=(M,P,F,u,v)=>d(M).map((j,_)=>{const D={},A={};if(!(E.includes(`${P}-${_}`)||v&&_!==0)){if(F||u){let O=!0;if(u){b+=1,D.lineNumber=b,D.type=t.REMOVED,D.value=j||" ";const B=y[P+1];if(B&&B.added){const $=d(B.value)[_];if($){const V=S($,P,!0,!1,!0),{value:J,lineNumber:W,type:X}=V[0].right;if(E.push(`${P+1}-${_}`),A.lineNumber=W,D.value===J)O=!1,A.type=0,D.type=0,A.value=J;else if(A.type=X,g)A.value=J;else{const ne=o(j,J,p);A.value=ne.right,D.value=ne.left}}}}else m+=1,A.lineNumber=m,A.type=t.ADDED,A.value=j;O&&!v&&(k.includes(N)||k.push(N))}else b+=1,m+=1,D.lineNumber=b,D.type=t.DEFAULT,D.value=j,A.lineNumber=m,A.type=t.DEFAULT,A.value=j;return(w?.includes(`L-${D.lineNumber}`)||w?.includes(`R-${A.lineNumber}`)&&!k.includes(N))&&k.push(N),v||(N+=1),{right:A,left:D}}}).filter(Boolean);return y.forEach(({added:M,removed:P,value:F},u)=>{L=[...L,...S(F,u,M,P)]}),{lineInformation:L,diffLines:k}};return U.computeLineInformation=c,U}var se={};function on(e){if(e.sheet)return e.sheet;for(var r=0;r<document.styleSheets.length;r++)if(document.styleSheets[r].ownerNode===e)return document.styleSheets[r]}function ln(e){var r=document.createElement("style");return r.setAttribute("data-emotion",e.key),e.nonce!==void 0&&r.setAttribute("nonce",e.nonce),r.appendChild(document.createTextNode("")),r.setAttribute("data-s",""),r}var cn=(function(){function e(i){var n=this;this._insertTag=function(s){var t;n.tags.length===0?n.insertionPoint?t=n.insertionPoint.nextSibling:n.prepend?t=n.container.firstChild:t=n.before:t=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(s,t),n.tags.push(s)},this.isSpeedy=i.speedy===void 0?!0:i.speedy,this.tags=[],this.ctr=0,this.nonce=i.nonce,this.key=i.key,this.container=i.container,this.prepend=i.prepend,this.insertionPoint=i.insertionPoint,this.before=null}var r=e.prototype;return r.hydrate=function(n){n.forEach(this._insertTag)},r.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(ln(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var t=on(s);try{t.insertRule(n,t.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(n));this.ctr++},r.flush=function(){this.tags.forEach(function(n){var s;return(s=n.parentNode)==null?void 0:s.removeChild(n)}),this.tags=[],this.ctr=0},e})(),z="-ms-",Re="-moz-",R="-webkit-",sr="comm",it="rule",at="decl",dn="@import",ir="@keyframes",fn="@layer",un=Math.abs,$e=String.fromCharCode,hn=Object.assign;function pn(e,r){return H(e,0)^45?(((r<<2^H(e,0))<<2^H(e,1))<<2^H(e,2))<<2^H(e,3):0}function ar(e){return e.trim()}function mn(e,r){return(e=r.exec(e))?e[0]:e}function I(e,r,i){return e.replace(r,i)}function et(e,r){return e.indexOf(r)}function H(e,r){return e.charCodeAt(r)|0}function Ne(e,r,i){return e.slice(r,i)}function te(e){return e.length}function ot(e){return e.length}function Oe(e,r){return r.push(e),e}function gn(e,r){return e.map(r).join("")}var Ve=1,ge=1,or=0,Z=0,G=0,xe="";function qe(e,r,i,n,s,t,a){return{value:e,root:r,parent:i,type:n,props:s,children:t,line:Ve,column:ge,length:a,return:""}}function we(e,r){return hn(qe("",null,null,"",null,null,0),e,{length:-e.length},r)}function xn(){return G}function yn(){return G=Z>0?H(xe,--Z):0,ge--,G===10&&(ge=1,Ve--),G}function Q(){return G=Z<or?H(xe,Z++):0,ge++,G===10&&(ge=1,Ve++),G}function re(){return H(xe,Z)}function Me(){return Z}function Le(e,r){return Ne(xe,e,r)}function Se(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 lr(e){return Ve=ge=1,or=te(xe=e),Z=0,[]}function cr(e){return xe="",e}function Be(e){return ar(Le(Z-1,tt(e===91?e+2:e===40?e+1:e)))}function vn(e){for(;(G=re())&&G<33;)Q();return Se(e)>2||Se(G)>3?"":" "}function bn(e,r){for(;--r&&Q()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return Le(e,Me()+(r<6&&re()==32&&Q()==32))}function tt(e){for(;Q();)switch(G){case e:return Z;case 34:case 39:e!==34&&e!==39&&tt(G);break;case 40:e===41&&tt(e);break;case 92:Q();break}return Z}function wn(e,r){for(;Q()&&e+G!==57;)if(e+G===84&&re()===47)break;return"/*"+Le(r,Z-1)+"*"+$e(e===47?e:Q())}function jn(e){for(;!Se(re());)Q();return Le(e,Z)}function Cn(e){return cr(Te("",null,null,null,[""],e=lr(e),0,[0],e))}function Te(e,r,i,n,s,t,a,d,o){for(var c=0,l=0,h=a,g=0,p=0,x=0,w=1,y=1,m=1,b=0,L="",N=s,k=t,E=n,S=L;y;)switch(x=b,b=Q()){case 40:if(x!=108&&H(S,h-1)==58){et(S+=I(Be(b),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:S+=Be(b);break;case 9:case 10:case 13:case 32:S+=vn(x);break;case 92:S+=bn(Me()-1,7);continue;case 47:switch(re()){case 42:case 47:Oe(Nn(wn(Q(),Me()),r,i),o);break;default:S+="/"}break;case 123*w:d[c++]=te(S)*m;case 125*w:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+l:m==-1&&(S=I(S,/\f/g,"")),p>0&&te(S)-h&&Oe(p>32?$t(S+";",n,i,h-1):$t(I(S," ","")+";",n,i,h-2),o);break;case 59:S+=";";default:if(Oe(E=It(S,r,i,c,l,s,d,L,N=[],k=[],h),t),b===123)if(l===0)Te(S,r,E,E,N,t,h,d,k);else switch(g===99&&H(S,3)===110?100:g){case 100:case 108:case 109:case 115:Te(e,E,E,n&&Oe(It(e,E,E,0,0,s,d,L,s,N=[],h),k),s,k,h,d,n?N:k);break;default:Te(S,E,E,E,[""],k,0,d,k)}}c=l=p=0,w=m=1,L=S="",h=a;break;case 58:h=1+te(S),p=x;default:if(w<1){if(b==123)--w;else if(b==125&&w++==0&&yn()==125)continue}switch(S+=$e(b),b*w){case 38:m=l>0?1:(S+="\f",-1);break;case 44:d[c++]=(te(S)-1)*m,m=1;break;case 64:re()===45&&(S+=Be(Q())),g=re(),l=h=te(L=S+=jn(Me())),b++;break;case 45:x===45&&te(S)==2&&(w=0)}}return t}function It(e,r,i,n,s,t,a,d,o,c,l){for(var h=s-1,g=s===0?t:[""],p=ot(g),x=0,w=0,y=0;x<n;++x)for(var m=0,b=Ne(e,h+1,h=un(w=a[x])),L=e;m<p;++m)(L=ar(w>0?g[m]+" "+b:I(b,/&\f/g,g[m])))&&(o[y++]=L);return qe(e,r,i,s===0?it:d,o,c,l)}function Nn(e,r,i){return qe(e,r,i,sr,$e(xn()),Ne(e,2,-2),0)}function $t(e,r,i,n){return qe(e,r,i,at,Ne(e,0,n),Ne(e,n+1,-1),n)}function me(e,r){for(var i="",n=ot(e),s=0;s<n;s++)i+=r(e[s],s,e,r)||"";return i}function Sn(e,r,i,n){switch(e.type){case fn:if(e.children.length)break;case dn:case at:return e.return=e.return||e.value;case sr:return"";case ir:return e.return=e.value+"{"+me(e.children,n)+"}";case it:e.value=e.props.join(",")}return te(i=me(e.children,n))?e.return=e.value+"{"+i+"}":""}function Ln(e){var r=ot(e);return function(i,n,s,t){for(var a="",d=0;d<r;d++)a+=e[d](i,n,s,t)||"";return a}}function _n(e){return function(r){r.root||(r=r.return)&&e(r)}}function kn(e){var r=Object.create(null);return function(i){return r[i]===void 0&&(r[i]=e(i)),r[i]}}var Dn=function(r,i,n){for(var s=0,t=0;s=t,t=re(),s===38&&t===12&&(i[n]=1),!Se(t);)Q();return Le(r,Z)},En=function(r,i){var n=-1,s=44;do switch(Se(s)){case 0:s===38&&re()===12&&(i[n]=1),r[n]+=Dn(Z-1,i,n);break;case 2:r[n]+=Be(s);break;case 4:if(s===44){r[++n]=re()===58?"&\f":"",i[n]=r[n].length;break}default:r[n]+=$e(s)}while(s=Q());return r},An=function(r,i){return cr(En(lr(r),i))},Vt=new WeakMap,Pn=function(r){if(!(r.type!=="rule"||!r.parent||r.length<1)){for(var i=r.value,n=r.parent,s=r.column===n.column&&r.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(r.props.length===1&&i.charCodeAt(0)!==58&&!Vt.get(n))&&!s){Vt.set(r,!0);for(var t=[],a=An(i,t),d=n.props,o=0,c=0;o<a.length;o++)for(var l=0;l<d.length;l++,c++)r.props[c]=t[o]?a[o].replace(/&\f/g,d[l]):d[l]+" "+a[o]}}},On=function(r){if(r.type==="decl"){var i=r.value;i.charCodeAt(0)===108&&i.charCodeAt(2)===98&&(r.return="",r.value="")}};function dr(e,r){switch(pn(e,r)){case 5103:return R+"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 R+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return R+e+Re+e+z+e+e;case 6828:case 4268:return R+e+z+e+e;case 6165:return R+e+z+"flex-"+e+e;case 5187:return R+e+I(e,/(\w+).+(:[^]+)/,R+"box-$1$2"+z+"flex-$1$2")+e;case 5443:return R+e+z+"flex-item-"+I(e,/flex-|-self/,"")+e;case 4675:return R+e+z+"flex-line-pack"+I(e,/align-content|flex-|-self/,"")+e;case 5548:return R+e+z+I(e,"shrink","negative")+e;case 5292:return R+e+z+I(e,"basis","preferred-size")+e;case 6060:return R+"box-"+I(e,"-grow","")+R+e+z+I(e,"grow","positive")+e;case 4554:return R+I(e,/([^-])(transform)/g,"$1"+R+"$2")+e;case 6187:return I(I(I(e,/(zoom-|grab)/,R+"$1"),/(image-set)/,R+"$1"),e,"")+e;case 5495:case 3959:return I(e,/(image-set\([^]*)/,R+"$1$`$1");case 4968:return I(I(e,/(.+:)(flex-)?(.*)/,R+"box-pack:$3"+z+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+R+e+e;case 4095:case 3583:case 4068:case 2532:return I(e,/(.+)-inline(.+)/,R+"$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(te(e)-1-r>6)switch(H(e,r+1)){case 109:if(H(e,r+4)!==45)break;case 102:return I(e,/(.+:)(.+)-([^]+)/,"$1"+R+"$2-$3$1"+Re+(H(e,r+3)==108?"$3":"$2-$3"))+e;case 115:return~et(e,"stretch")?dr(I(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(H(e,r+1)!==115)break;case 6444:switch(H(e,te(e)-3-(~et(e,"!important")&&10))){case 107:return I(e,":",":"+R)+e;case 101:return I(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+R+(H(e,14)===45?"inline-":"")+"box$3$1"+R+"$2$3$1"+z+"$2box$3")+e}break;case 5936:switch(H(e,r+11)){case 114:return R+e+z+I(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return R+e+z+I(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return R+e+z+I(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return R+e+z+e+e}return e}var Mn=function(r,i,n,s){if(r.length>-1&&!r.return)switch(r.type){case at:r.return=dr(r.value,r.length);break;case ir:return me([we(r,{value:I(r.value,"@","@"+R)})],s);case it:if(r.length)return gn(r.props,function(t){switch(mn(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return me([we(r,{props:[I(t,/:(read-\w+)/,":"+Re+"$1")]})],s);case"::placeholder":return me([we(r,{props:[I(t,/:(plac\w+)/,":"+R+"input-$1")]}),we(r,{props:[I(t,/:(plac\w+)/,":"+Re+"$1")]}),we(r,{props:[I(t,/:(plac\w+)/,z+"input-$1")]})],s)}return""})}},Bn=[Mn],Tn=function(r){var i=r.key;if(i==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(w){var y=w.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var s=r.stylisPlugins||Bn,t={},a,d=[];a=r.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+i+' "]'),function(w){for(var y=w.getAttribute("data-emotion").split(" "),m=1;m<y.length;m++)t[y[m]]=!0;d.push(w)});var o,c=[Pn,On];{var l,h=[Sn,_n(function(w){l.insert(w)})],g=Ln(c.concat(s,h)),p=function(y){return me(Cn(y),g)};o=function(y,m,b,L){l=b,p(y?y+"{"+m.styles+"}":m.styles),L&&(x.inserted[m.name]=!0)}}var x={key:i,sheet:new cn({key:i,container:a,nonce:r.nonce,speedy:r.speedy,prepend:r.prepend,insertionPoint:r.insertionPoint}),nonce:r.nonce,inserted:t,registered:{},insert:o};return x.sheet.hydrate(d),x};function Fn(e){for(var r=0,i,n=0,s=e.length;s>=4;++n,s-=4)i=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,r=(i&65535)*1540483477+((i>>>16)*59797<<16)^(r&65535)*1540483477+((r>>>16)*59797<<16);switch(s){case 3:r^=(e.charCodeAt(n+2)&255)<<16;case 2:r^=(e.charCodeAt(n+1)&255)<<8;case 1:r^=e.charCodeAt(n)&255,r=(r&65535)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,r=(r&65535)*1540483477+((r>>>16)*59797<<16),((r^r>>>15)>>>0).toString(36)}var Rn={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},In=/[A-Z]|^ms/g,$n=/_EMO_([^_]+?)_([^]*?)_EMO_/g,fr=function(r){return r.charCodeAt(1)===45},qt=function(r){return r!=null&&typeof r!="boolean"},Ye=kn(function(e){return fr(e)?e:e.replace(In,"-$&").toLowerCase()}),Gt=function(r,i){switch(r){case"animation":case"animationName":if(typeof i=="string")return i.replace($n,function(n,s,t){return ie={name:s,styles:t,next:ie},s})}return Rn[r]!==1&&!fr(r)&&typeof i=="number"&&i!==0?i+"px":i};function Ie(e,r,i){if(i==null)return"";var n=i;if(n.__emotion_styles!==void 0)return n;switch(typeof i){case"boolean":return"";case"object":{var s=i;if(s.anim===1)return ie={name:s.name,styles:s.styles,next:ie},s.name;var t=i;if(t.styles!==void 0){var a=t.next;if(a!==void 0)for(;a!==void 0;)ie={name:a.name,styles:a.styles,next:ie},a=a.next;var d=t.styles+";";return d}return Vn(e,r,i)}}var o=i;if(r==null)return o;var c=r[o];return c!==void 0?c:o}function Vn(e,r,i){var n="";if(Array.isArray(i))for(var s=0;s<i.length;s++)n+=Ie(e,r,i[s])+";";else for(var t in i){var a=i[t];if(typeof a!="object"){var d=a;r!=null&&r[d]!==void 0?n+=t+"{"+r[d]+"}":qt(d)&&(n+=Ye(t)+":"+Gt(t,d)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(r==null||r[a[0]]===void 0))for(var o=0;o<a.length;o++)qt(a[o])&&(n+=Ye(t)+":"+Gt(t,a[o])+";");else{var c=Ie(e,r,a);switch(t){case"animation":case"animationName":{n+=Ye(t)+":"+c+";";break}default:n+=t+"{"+c+"}"}}}return n}var Ht=/label:\s*([^\s;{]+)\s*(;|$)/g,ie;function Ke(e,r,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,s="";ie=void 0;var t=e[0];if(t==null||t.raw===void 0)n=!1,s+=Ie(i,r,t);else{var a=t;s+=a[0]}for(var d=1;d<e.length;d++)if(s+=Ie(i,r,e[d]),n){var o=t;s+=o[d]}Ht.lastIndex=0;for(var c="",l;(l=Ht.exec(s))!==null;)c+="-"+l[1];var h=Fn(s)+c;return{name:h,styles:s,next:ie}}function ur(e,r,i){var n="";return i.split(" ").forEach(function(s){e[s]!==void 0?r.push(e[s]+";"):s&&(n+=s+" ")}),n}var qn=function(r,i,n){var s=r.key+"-"+i.name;r.registered[s]===void 0&&(r.registered[s]=i.styles)},Gn=function(r,i,n){qn(r,i);var s=r.key+"-"+i.name;if(r.inserted[i.name]===void 0){var t=i;do r.insert(i===t?"."+s:"",t,r.sheet,!0),t=t.next;while(t!==void 0)}};function Wt(e,r){if(e.inserted[r.name]===void 0)return e.insert("",r,e.sheet,!0)}function zt(e,r,i){var n=[],s=ur(e,n,i);return n.length<2?i:s+r(n)}var Hn=function(r){var i=Tn(r);i.sheet.speedy=function(d){this.isSpeedy=d},i.compat=!0;var n=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];var h=Ke(c,i.registered,void 0);return Gn(i,h),i.key+"-"+h.name},s=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];var h=Ke(c,i.registered),g="animation-"+h.name;return Wt(i,{name:h.name,styles:"@keyframes "+g+"{"+h.styles+"}"}),g},t=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];var h=Ke(c,i.registered);Wt(i,h)},a=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return zt(i.registered,n,Wn(c))};return{css:n,cx:a,injectGlobal:t,keyframes:s,hydrate:function(o){o.forEach(function(c){i.inserted[c]=!0})},flush:function(){i.registered={},i.inserted={},i.sheet.flush()},sheet:i.sheet,cache:i,getRegisteredStyles:ur.bind(null,i.registered),merge:zt.bind(null,i.registered,n)}},Wn=function e(r){for(var i="",n=0;n<r.length;n++){var s=r[n];if(s!=null){var t=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))t=e(s);else{t="";for(var a in s)s[a]&&a&&(t&&(t+=" "),t+=a)}break}default:t=s}t&&(i&&(i+=" "),i+=t)}}return i};const zn=Object.freeze(Object.defineProperty({__proto__:null,default:Hn},Symbol.toStringTag,{value:"Module"})),Un=Xt(zn);var Ut;function Jn(){if(Ut)return se;Ut=1;var e=se&&se.__rest||function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,a=Object.getOwnPropertySymbols(n);d<a.length;d++)s.indexOf(a[d])<0&&Object.prototype.propertyIsEnumerable.call(n,a[d])&&(t[a[d]]=n[a[d]]);return t},r=se&&se.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(se,"__esModule",{value:!0});const i=r(Un);return se.default=(n,s=!1,t="")=>{const{variables:a={}}=n,d=e(n,["variables"]),o={light:Object.assign({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"},a.light||{}),dark:Object.assign({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:"#21232b",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#555a7b",diffViewerTitleBorderColor:"#353846"},a.dark||{})},c=s?o.dark:o.light,{css:l,cx:h}=(0,i.default)({key:"react-diff",nonce:t}),g=l({width:"100%",label:"content"}),p=l({[`.${g}`]:{width:"50%"},label:"split-view"}),x=l({width:"100%",background:c.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"25px"},label:"diff-container",borderCollapse:"collapse"}),w=l({color:c.codeFoldContentColor,label:"code-fold-content"}),y=l({color:c.diffViewerColor,label:"content-text"}),m=l({background:c.diffViewerTitleBackground,padding:10,borderBottom:`1px solid ${c.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${c.diffViewerTitleBorderColor}`},[`.${y}`]:{color:c.diffViewerTitleColor}}),b=l({color:c.gutterColor,label:"line-number"}),L=l({background:c.removedBackground,color:c.removedColor,pre:{color:c.removedColor},[`.${b}`]:{color:c.removedGutterColor},label:"diff-removed"}),N=l({background:c.addedBackground,color:c.addedColor,pre:{color:c.addedColor},[`.${b}`]:{color:c.addedGutterColor},label:"diff-added"}),k=l({background:c.changedBackground,[`.${b}`]:{color:c.gutterColor},label:"diff-changed"}),E=l({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),S=l({background:c.wordAddedBackground,label:"word-added"}),M=l({background:c.wordRemovedBackground,label:"word-removed"}),P=l({backgroundColor:c.codeFoldGutterBackground,label:"code-fold-gutter"}),F=l({backgroundColor:c.codeFoldBackground,height:40,fontSize:14,fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),u=l({backgroundColor:c.emptyLineBackground,label:"empty-line"}),v=l({width:25,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${N}`]:{pre:{color:c.addedColor}},[`&.${L}`]:{pre:{color:c.removedColor}}}),C=l({background:c.highlightBackground,label:"highlighted-line",[`.${S}, .${M}`]:{backgroundColor:"initial"}}),j=l({label:"highlighted-gutter"}),_=l({userSelect:"none",minWidth:50,padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:c.gutterBackground,"&:hover":{cursor:"pointer",background:c.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${N}`]:{background:c.addedGutterBackground},[`&.${L}`]:{background:c.removedGutterBackground},[`&.${j}`]:{background:c.highlightGutterBackground,"&:hover":{background:c.highlightGutterBackground}}}),D=l({"&:hover":{background:c.gutterBackground,cursor:"initial"},label:"empty-gutter"}),A=l({verticalAlign:"baseline",label:"line"}),O={diffContainer:x,diffRemoved:L,diffAdded:N,diffChanged:k,splitView:p,marker:v,highlightedGutter:j,highlightedLine:C,gutter:_,line:A,wordDiff:E,wordAdded:S,wordRemoved:M,codeFoldGutter:P,codeFold:F,emptyGutter:D,emptyLine:u,lineNumber:b,contentText:y,content:g,codeFoldContent:w,titleBlock:m},B=Object.keys(d).reduce(($,V)=>Object.assign(Object.assign({},$),{[V]:l(d[V])}),{});return Object.keys(O).reduce(($,V)=>Object.assign(Object.assign({},$),{[V]:B[V]?h(O[V],B[V]):O[V]}),{})},se}var je={},Jt;function Zn(){if(Jt)return je;Jt=1,Object.defineProperty(je,"__esModule",{value:!0}),je.computeHiddenBlocks=void 0;function e(r,i,n){let s=0,t,a={},d=[];return r.forEach((o,c)=>{const l=i.some(h=>h>=c-n&&h<=c+n);!l&&t==null?(t={index:s,startLine:c,endLine:c,lines:1},d.push(t),a[c]=t.index,s++):l?t=void 0:(t.endLine=c,t.lines++,a[c]=t.index)}),{lineBlocks:a,blocks:d}}return je.computeHiddenBlocks=e,je}var Zt=Number.isNaN||function(r){return typeof r=="number"&&r!==r};function Qn(e,r){return!!(e===r||Zt(e)&&Zt(r))}function Xn(e,r){if(e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!Qn(e[i],r[i]))return!1;return!0}function Yn(e,r){r===void 0&&(r=Xn);var i=null;function n(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];if(i&&i.lastThis===this&&r(s,i.lastArgs))return i.lastResult;var a=e.apply(this,s);return i={lastResult:a,lastArgs:s,lastThis:this},a}return n.clear=function(){i=null},n}const Kn=Object.freeze(Object.defineProperty({__proto__:null,default:Yn},Symbol.toStringTag,{value:"Module"})),es=Xt(Kn);var Qt;function ts(){return Qt||(Qt=1,(function(e){var r=K&&K.__createBinding||(Object.create?(function(w,y,m,b){b===void 0&&(b=m);var L=Object.getOwnPropertyDescriptor(y,m);(!L||("get"in L?!y.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return y[m]}}),Object.defineProperty(w,b,L)}):(function(w,y,m,b){b===void 0&&(b=m),w[b]=y[m]})),i=K&&K.__setModuleDefault||(Object.create?(function(w,y){Object.defineProperty(w,"default",{enumerable:!0,value:y})}):function(w,y){w.default=y}),n=K&&K.__importStar||function(w){if(w&&w.__esModule)return w;var y={};if(w!=null)for(var m in w)m!=="default"&&Object.prototype.hasOwnProperty.call(w,m)&&r(y,w,m);return i(y,w),y},s=K&&K.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.DiffMethod=e.LineNumberPrefix=void 0;const t=yr(),a=n(vr()),d=s(Hr()),o=an();Object.defineProperty(e,"DiffMethod",{enumerable:!0,get:function(){return o.DiffMethod}});const c=s(Jn()),l=Zn(),h=es,g=h.default||h;var p;(function(w){w.LEFT="L",w.RIGHT="R"})(p||(e.LineNumberPrefix=p={}));class x extends a.Component{constructor(y){super(y),this.resetCodeBlocks=()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1,this.onBlockExpand=m=>{const b=this.state.expandedBlocks.slice();b.push(m),this.setState({expandedBlocks:b})},this.computeStyles=g(c.default),this.onLineNumberClickProxy=m=>this.props.onLineNumberClick?b=>this.props.onLineNumberClick(m,b):()=>{},this.renderWordDiff=(m,b)=>m.map((L,N)=>(0,t.jsx)("span",{className:(0,d.default)(this.styles.wordDiff,{[this.styles.wordAdded]:L.type===o.DiffType.ADDED,[this.styles.wordRemoved]:L.type===o.DiffType.REMOVED}),children:b?b(L.value):L.value},N)),this.renderLine=(m,b,L,N,k,E)=>{const S=`${L}-${m}`,M=`${E}-${k}`,P=this.props.highlightLines.includes(S)||this.props.highlightLines.includes(M),F=b===o.DiffType.ADDED,u=b===o.DiffType.REMOVED,v=b===o.DiffType.CHANGED;let C;return Array.isArray(N)?C=this.renderWordDiff(N,this.props.renderContent):this.props.renderContent?C=this.props.renderContent(N):C=N,(0,t.jsxs)(a.Fragment,{children:[!this.props.hideLineNumbers&&(0,t.jsx)("td",{onClick:m&&this.onLineNumberClickProxy(S),className:(0,d.default)(this.styles.gutter,{[this.styles.emptyGutter]:!m,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedGutter]:P}),children:(0,t.jsx)("pre",{className:this.styles.lineNumber,children:m})}),!this.props.splitView&&!this.props.hideLineNumbers&&(0,t.jsx)("td",{onClick:k&&this.onLineNumberClickProxy(M),className:(0,d.default)(this.styles.gutter,{[this.styles.emptyGutter]:!k,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedGutter]:P}),children:(0,t.jsx)("pre",{className:this.styles.lineNumber,children:k})}),this.props.renderGutter?this.props.renderGutter({lineNumber:m,type:b,prefix:L,value:N,additionalLineNumber:k,additionalPrefix:E,styles:this.styles}):null,!this.props.hideMarkers&&(0,t.jsx)("td",{className:(0,d.default)(this.styles.marker,{[this.styles.emptyLine]:!C,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedLine]:P}),children:(0,t.jsxs)("pre",{children:[F&&"+",u&&"-"]})}),(0,t.jsx)("td",{className:(0,d.default)(this.styles.content,{[this.styles.emptyLine]:!C,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedLine]:P}),children:(0,t.jsx)("pre",{className:this.styles.contentText,children:C})})]})},this.renderSplitView=({left:m,right:b},L)=>(0,t.jsxs)("tr",{className:this.styles.line,children:[this.renderLine(m.lineNumber,m.type,p.LEFT,m.value),this.renderLine(b.lineNumber,b.type,p.RIGHT,b.value)]},L),this.renderInlineView=({left:m,right:b},L)=>{let N;return m.type===o.DiffType.REMOVED&&b.type===o.DiffType.ADDED?(0,t.jsxs)(a.Fragment,{children:[(0,t.jsx)("tr",{className:this.styles.line,children:this.renderLine(m.lineNumber,m.type,p.LEFT,m.value,null)}),(0,t.jsx)("tr",{className:this.styles.line,children:this.renderLine(null,b.type,p.RIGHT,b.value,b.lineNumber)})]},L):(m.type===o.DiffType.REMOVED&&(N=this.renderLine(m.lineNumber,m.type,p.LEFT,m.value,null)),m.type===o.DiffType.DEFAULT&&(N=this.renderLine(m.lineNumber,m.type,p.LEFT,m.value,b.lineNumber,p.RIGHT)),b.type===o.DiffType.ADDED&&(N=this.renderLine(null,b.type,p.RIGHT,b.value,b.lineNumber)),(0,t.jsx)("tr",{className:this.styles.line,children:N},L))},this.onBlockClickProxy=m=>()=>this.onBlockExpand(m),this.renderSkippedLineIndicator=(m,b,L,N)=>{const{hideLineNumbers:k,splitView:E}=this.props,S=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(m,L,N):(0,t.jsxs)("pre",{className:this.styles.codeFoldContent,children:["Expand ",m," lines ..."]}),M=(0,t.jsx)("td",{children:(0,t.jsx)("a",{onClick:this.onBlockClickProxy(b),tabIndex:0,children:S})}),P=!E&&!k;return(0,t.jsxs)("tr",{className:this.styles.codeFold,children:[!k&&(0,t.jsx)("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?(0,t.jsx)("td",{className:this.styles.codeFoldGutter}):null,(0,t.jsx)("td",{className:(0,d.default)({[this.styles.codeFoldGutter]:P})}),P?(0,t.jsxs)(a.Fragment,{children:[(0,t.jsx)("td",{}),M]}):(0,t.jsxs)(a.Fragment,{children:[M,this.props.renderGutter?(0,t.jsx)("td",{}):null,(0,t.jsx)("td",{})]}),(0,t.jsx)("td",{}),(0,t.jsx)("td",{})]},`${L}-${N}`)},this.renderDiff=()=>{const{oldValue:m,newValue:b,splitView:L,disableWordDiff:N,compareMethod:k,linesOffset:E}=this.props,{lineInformation:S,diffLines:M}=(0,o.computeLineInformation)(m,b,N,k,E,this.props.alwaysShowLines),P=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:F,blocks:u}=(0,l.computeHiddenBlocks)(S,M,P);return S.map((v,C)=>{if(this.props.showDiffOnly){const _=F[C];if(_!==void 0){const D=u[_].endLine===C;if(!this.state.expandedBlocks.includes(_)&&D)return(0,t.jsx)(a.Fragment,{children:this.renderSkippedLineIndicator(u[_].lines,_,v.left.lineNumber,v.right.lineNumber)},C);if(!this.state.expandedBlocks.includes(_))return null}}return L?this.renderSplitView(v,C):this.renderInlineView(v,C)})},this.render=()=>{const{oldValue:m,newValue:b,useDarkTheme:L,leftTitle:N,rightTitle:k,splitView:E,hideLineNumbers:S,hideMarkers:M,nonce:P}=this.props;if(this.props.compareMethod!==o.DiffMethod.JSON&&(typeof m!="string"||typeof b!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,L,P);const F=this.renderDiff();let u=S?2:3,v=S?2:4;M&&(u-=1,v-=1);const C=this.props.renderGutter?1:0,j=(N||k)&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{colSpan:(E?u:v)+C,className:this.styles.titleBlock,children:(0,t.jsx)("pre",{className:this.styles.contentText,children:N})}),E&&(0,t.jsx)("td",{colSpan:u+C,className:this.styles.titleBlock,children:(0,t.jsx)("pre",{className:this.styles.contentText,children:k})})]});return(0,t.jsx)("table",{className:(0,d.default)(this.styles.diffContainer,{[this.styles.splitView]:E}),children:(0,t.jsxs)("tbody",{children:[j,F]})})},this.state={expandedBlocks:[]}}}x.defaultProps={oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:o.DiffMethod.CHARS,styles:{},hideLineNumbers:!1,hideMarkers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""},e.default=x})(K)),K}var rs=ts();const ns=br(rs);function ss({diffView:e,diffContent:r,isLoading:i,entities:n,onClose:s}){const[t,a]=q.useState(!1),[d,o]=q.useState(!1);return q.useEffect(()=>{o(!0)},[]),f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-8 z-50",children:f.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-6xl w-full max-h-[90vh] flex flex-col",children:[f.jsxs("div",{className:"p-6 border-b border-[#e1e1e1] flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"font-['IBM_Plex_Sans'] text-2xl font-semibold text-[#232323]",children:e.type==="file"?"File Diff":"Entity Diff"}),f.jsx("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e] mt-1",children:e.path}),e.type==="entity"&&e.entitySha&&f.jsxs("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e]",children:["Entity:"," ",n.find(c=>c.sha===e.entitySha)?.name||e.entitySha]})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:()=>a(!t),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",title:t?"Show changes only":"Show full file",children:t?"Show Changes Only":"Show Full File"}),f.jsx("button",{onClick:s,className:"text-[#8e8e8e] hover:text-[#626262] transition-colors",children:f.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),f.jsx("div",{className:"flex-1 overflow-auto",children:i?f.jsx("div",{className:"p-6 text-center",children:f.jsx("div",{className:"text-[#8e8e8e]",children:"Loading diff..."})}):r?f.jsx("div",{className:"diff-viewer-wrapper",children:d&&f.jsx(ns,{oldValue:r.oldContent,newValue:r.newContent,splitView:!0,useDarkTheme:!1,showDiffOnly:!t,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"}}})}):f.jsx("div",{className:"p-6 text-center",children:f.jsx("div",{className:"text-[#8e8e8e]",children:"No diff available"})})}),f.jsx("div",{className:"p-6 border-t border-[#e1e1e1] flex justify-end gap-3",children:f.jsx("button",{onClick:s,className:"px-4 py-2 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] font-semibold hover:bg-[#e1e1e1] transition-colors",children:"Close"})})]})})}function is({activeTab:e,onTabChange:r,uncommittedCount:i,branchCount:n}){return f.jsx("div",{className:"border-b border-gray-200 mb-6",children:f.jsxs("nav",{className:"flex gap-8 items-center",children:[f.jsx("button",{onClick:()=>r("uncommitted"),className:`relative pb-4 px-2 text-sm font-medium transition-colors ${e==="uncommitted"?"text-[#005C75] border-b-2 border-[#005C75]":"text-gray-500 hover:text-gray-700"}`,children:f.jsxs("span",{className:"flex items-center gap-2",children:["Uncommitted Changes",i>0&&f.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="uncommitted"?"bg-[#e8f1f5] text-[#005C75]":"bg-gray-200 text-gray-700"}`,children:i})]})}),f.jsx("button",{onClick:()=>r("branch"),className:`relative pb-4 px-2 text-sm font-medium transition-colors ${e==="branch"?"text-[#005C75] border-b-2 border-[#005C75]":"text-gray-500 hover:text-gray-700"}`,children:f.jsxs("span",{className:"flex items-center gap-2",children:["Branch Changes",n>0&&f.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="branch"?"bg-[#e8f1f5] text-[#005C75]":"bg-gray-200 text-gray-700"}`,children:n})]})})]})})}function as(e,r){const n=r.match(/text-(\w+)-\d+/)?.[1]||"gray",t={green:"#15803d",gray:"#374151",orange:"#b45309",blue:"#1e40af",amber:"#b45309",purple:"#6b21a8"}[n]||"#374151";switch(e){case"✓":return f.jsx(Lr,{size:16,color:t});case"○":return f.jsx(Or,{size:16,color:t});case"⚠":return f.jsx(Ar,{size:16,color:t});case"●":return f.jsx(Er,{size:16,color:t});case"+":return f.jsx(Br,{size:16,color:t});default:return e}}function os({entity:e,variant:r="full"}){const i=kr(e),{badge:n}=i,s=as(n.icon,n.color);return r==="icon-only"?f.jsx("span",{className:`${n.color} text-sm font-bold`,title:n.label,children:s}):r==="compact"?f.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-normal border ${n.color} ${n.bgColor} ${n.borderColor}`,title:n.label,children:f.jsx("span",{children:n.label})}):f.jsx("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-normal border ${n.color} ${n.bgColor} ${n.borderColor}`,children:f.jsx("span",{children:n.label})})}function ls({entity:e,filePath:r,impactedEntities:i,isBeingAnalyzed:n,isQueued:s,projectSlug:t,diffType:a,baseBranch:d,currentBranch:o,onGenerateSimulation:c,onShowLogs:l}){const h=e.analyses?.[0],g=h?.scenarios||[],p=h?.status?.scenarios||[];return f.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-white border border-[#e1e1e1] rounded-md transition-all hover:border-[#005c75] hover:shadow-sm",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(Ce,{to:`/entity/${e.sha}`,className:"flex items-center gap-3 flex-1 min-w-0 no-underline",children:[f.jsx(Yt,{type:e.entityType}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"font-['IBM_Plex_Sans'] font-medium text-sm text-[#343434] flex items-center gap-2",children:[f.jsx("span",{children:e.name}),e.entityType==="visual"&&f.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),e.entityType==="library"&&f.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),e.entityType==="other"&&f.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"}),f.jsx(os,{entity:e,variant:"full"})]}),e.description&&f.jsx("div",{className:"font-['IBM_Plex_Sans'] text-xs text-[#8e8e8e] mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap",children:e.description})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[f.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Analyzing..."]}),!n&&s&&f.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"})]})]}),(e.entityType==="visual"||e.entityType==="library")&&!n&&!s&&f.jsx("button",{onClick:x=>{x.stopPropagation(),c(e)},className:"px-3 py-1.5 bg-[#005c75] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors whitespace-nowrap",title:"Analyze this entity",children:"Analyze"}),n&&t&&f.jsx("button",{onClick:x=>{x.stopPropagation(),l(e.sha)},className:"px-3 py-1.5 bg-[#626262] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-semibold hover:bg-[#4a4a4a] transition-colors whitespace-nowrap",title:"View analysis logs",children:"📋 Logs"})]}),(e.entityType==="visual"||e.entityType==="library")&&g.length>0&&f.jsx("div",{className:"flex gap-2.5 mt-3 overflow-x-auto pb-1",children:g.map((x,w)=>{const y=x.metadata?.screenshotPaths?.[0],m=p.find(N=>N.name===x.name),b=m?.screenshotStartedAt&&!m?.screenshotFinishedAt,L=!!y;return f.jsx(Ce,{to:x.id?`/entity/${e.sha}/scenarios/${x.id}`:`/entity/${e.sha}`,className:"shrink-0 block no-underline",children:f.jsx("div",{className:"w-36 h-24 rounded-md border border-gray-200 overflow-hidden bg-gray-100 flex items-center justify-center transition-all",onMouseEnter:N=>{N.currentTarget.style.borderColor="#005C75",N.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)"},onMouseLeave:N=>{N.currentTarget.style.borderColor="#d1d5db",N.currentTarget.style.boxShadow="none"},children:L?f.jsx(er,{screenshotPath:y,alt:x.name,className:"max-w-full max-h-full object-contain"}):f.jsx("span",{className:`text-2xl ${b?"animate-pulse":"text-gray-400"}`,children:b?"⋯":"⏹️"})})},w)})})]})}function cs({files:e,entityImpactMap:r,expandedFiles:i,isEntityBeingAnalyzed:n,isEntityQueued:s,projectSlug:t,baseBranch:a,currentBranch:d,onToggleFile:o,onShowFileDiff:c,onGenerateSimulation:l,onShowLogs:h}){return f.jsx("div",{children:e.length>0?f.jsx("div",{className:"flex flex-col gap-3",children:e.map(([g,{status:p,editedEntities:x}])=>{const w=i.has(g);return f.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#306AFF"},children:[f.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>o(g),role:"button",tabIndex:0,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),o(g))},children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-gray-500 text-xs w-4 shrink-0",children:w?"▼":"▶"}),f.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[f.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[f.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),f.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),f.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),f.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),f.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_784_10666",children:f.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:g}),f.jsxs("span",{className:"text-xs text-gray-500",children:[x.length," entit",x.length!==1?"ies":"y"]})]})]})}),w&&x.length>0&&f.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:x.map(y=>f.jsx(ls,{entity:y,filePath:g,impactedEntities:r.get(y.sha)||[],isBeingAnalyzed:n(y.sha),isQueued:s(y.sha),projectSlug:t,diffType:"uncommitted",baseBranch:a,currentBranch:d,onGenerateSimulation:l,onShowLogs:h},y.sha))})]},g)})}):f.jsxs("div",{className:"py-12 px-6 text-center",children:[f.jsx("div",{className:"text-6xl mb-4 opacity-50",children:"✓"}),f.jsx("p",{className:"font-['IBM_Plex_Sans'] text-lg font-semibold text-[#3e3e3e] mb-2",children:"No edited entities"}),f.jsxs("p",{className:"font-['IBM_Plex_Sans'] text-sm text-[#8e8e8e]",children:["There are no uncommitted changes.",f.jsx("br",{}),f.jsx("br",{}),"If you edit a file in the project, it will show up here."]})]})})}function ds({status:e}){const i={modified:{label:"M",bgColor:"bg-[#f59e0c]"},added:{label:"A",bgColor:"bg-emerald-500"},deleted:{label:"D",bgColor:"bg-red-500",showWarning:!0},renamed:{label:"R",bgColor:"bg-indigo-500"},untracked:{label:"U",bgColor:"bg-purple-500"}}[e]||{label:"?",bgColor:"bg-gray-500"};return f.jsxs("div",{className:"inline-flex items-center gap-1",children:[f.jsx("span",{className:`inline-flex items-center justify-center w-5 h-5 text-[11px] font-bold text-white rounded ${i.bgColor}`,title:e,children:i.label}),i.showWarning&&f.jsx("span",{className:"inline-flex items-center justify-center w-3 h-3 text-[10px] text-amber-600",title:"Warning: File will be deleted",children:"⚠"})]})}function fs({files:e,currentBranch:r,defaultBranch:i,baseBranch:n,allBranches:s,expandedFiles:t,isEntityBeingAnalyzed:a,isEntityQueued:d,isAnyAnalysisInProgress:o,isAnalyzing:c,lastLogLine:l,projectSlug:h,onToggleFile:g,onBranchChange:p,onGenerateSimulation:x,onShowLogs:w}){return e.length>0&&e.some(([y,{entities:m}])=>m.length>0),f.jsxs("div",{children:[f.jsx("div",{className:"mb-5",children:r===i?f.jsxs("p",{className:"text-sm text-gray-500",children:["Currently on the primary branch"," ",f.jsx("strong",{className:"text-gray-900 font-semibold",children:r})]}):f.jsxs("p",{className:"text-sm text-gray-500",children:["Changes in"," ",f.jsx("strong",{className:"text-gray-900 font-semibold",children:r})," ","compared to"," ",f.jsx("select",{value:n,onChange:y=>p(y.target.value),className:"py-0.5 px-2 bg-white border border-gray-300 rounded-md text-sm font-semibold text-gray-900 cursor-pointer hover:border-indigo-500",children:s.filter(y=>y!==r).map(y=>f.jsx("option",{value:y,children:y},y))})]})}),r===i?f.jsxs("div",{className:"py-12 px-6 text-center bg-blue-50 rounded-lg border border-blue-100",children:[f.jsx("div",{className:"text-6xl mb-4",children:"ℹ️"}),f.jsx("p",{className:"text-lg font-semibold text-gray-900 mb-3",children:"You're on the primary branch"}),f.jsxs("p",{className:"text-sm text-gray-600 mb-2 max-w-md mx-auto",children:["When you switch to a feature branch, this section will show all the changes between your branch and"," ",f.jsx("strong",{className:"font-semibold",children:i}),"."]}),f.jsx("p",{className:"text-sm text-gray-600 max-w-md mx-auto",children:"This helps you understand what will be included in your pull request before you create it."})]}):e.length>0?f.jsx("div",{className:"flex flex-col gap-3",children:e.map(([y,{status:m,entities:b}])=>{const L=t.has(y);return f.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#306AFF"},children:[f.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>g(y),role:"button",tabIndex:0,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),g(y))},children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-gray-500 text-xs w-4 shrink-0",children:L?"▼":"▶"}),f.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[f.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[f.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),f.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),f.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),f.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),f.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_784_10666",children:f.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:y}),f.jsx(ds,{status:m.status})]}),f.jsxs("span",{className:"text-xs text-gray-500",children:[b.length," entit",b.length!==1?"ies":"y"]})]})]})}),L&&b.length>0&&f.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-2 flex flex-col gap-1.5",children:b.map(N=>{const k=a(N.sha),E=d(N.sha),S=k&&l,M=N.analyses?.[0],P=M?.scenarios||[],F=M?.status?.scenarios||[];return f.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-white border border-gray-200 rounded-md transition-all hover:border-blue-600 hover:shadow-sm",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(Ce,{to:`/entity/${N.sha}`,className:"flex items-center gap-3 flex-1 min-w-0 no-underline",children:[f.jsx(Yt,{type:N.entityType}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"font-['IBM_Plex_Sans'] font-medium text-sm text-[#343434] flex items-center gap-2",children:[f.jsx("span",{children:N.name}),N.entityType==="visual"&&f.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),N.entityType==="library"&&f.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),N.entityType==="other"&&f.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"})]}),N.description&&f.jsx("div",{className:"font-['IBM_Plex_Sans'] text-xs text-[#8e8e8e] mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap",children:N.description})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[k&&f.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[f.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Analyzing..."]}),!k&&E&&f.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"})]})]}),(N.entityType==="visual"||N.entityType==="library")&&f.jsx("button",{onClick:u=>{u.stopPropagation(),x(N)},disabled:c||o||E||k,className:"px-3 py-1.5 bg-[#005c75] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors whitespace-nowrap disabled:bg-gray-400 disabled:cursor-not-allowed",title:E?"Entity is queued for analysis":k?"Entity is being analyzed":o?"Please wait for current analysis to complete":"Analyze this entity",children:k?"Analyzing...":E?"Queued":o?"Waiting...":"Analyze"}),k&&h&&f.jsx("button",{onClick:u=>{u.stopPropagation(),w(N.sha)},className:"px-3 py-1.5 bg-[#626262] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#4a4a4a] transition-colors whitespace-nowrap",title:"View analysis logs",children:"📋 Logs"})]}),S&&f.jsxs("div",{className:"flex items-center gap-1.5 text-[13px] font-medium text-blue-600 px-2 py-1 bg-blue-50 rounded",children:[f.jsx("span",{className:"animate-spin",children:"⚙️"}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-xs max-w-full",title:l,children:l})]}),P.length>0&&f.jsx("div",{className:"flex gap-2 flex-wrap",children:P.slice(0,5).map((u,v)=>{const C=u.metadata?.screenshotPaths?.[0],j=F.find(O=>O.name===u.name),_=j?.screenshotStartedAt&&!j?.screenshotFinishedAt,D=!!C,A=Dr(N)||N.metadata?.isSuperseded;return D?f.jsx(Ce,{to:`/entity/${N.sha}/scenarios/${u.id}`,className:`relative w-20 h-15 border-2 rounded overflow-hidden bg-gray-50 cursor-pointer transition-all flex items-center justify-center hover:scale-105 hover:shadow-md ${A?"border-amber-500 hover:border-amber-600":"border-gray-200 hover:border-blue-600"}`,children:f.jsx(er,{screenshotPath:C,alt:u.name,title:u.name,className:"max-w-full max-h-full object-contain object-center"})},v):f.jsx(Ce,{to:`/entity/${N.sha}/scenarios/${u.id}`,className:"w-20 h-15 border-2 border-dashed border-gray-300 rounded bg-gray-50 flex items-center justify-center text-2xl",title:`Capturing ${u.name}...`,children:f.jsx("span",{className:_?"animate-spin":"text-gray-400",children:_?"⏳":"⏹️"})},v)})})]},N.sha)})})]},y)})}):f.jsxs("div",{className:"py-12 px-6 text-center",children:[f.jsx("div",{className:"text-6xl mb-4 opacity-50",children:"✓"}),f.jsx("p",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No differences found"}),f.jsxs("p",{className:"text-sm text-gray-500",children:["This branch is up to date with ",n]})]})]})}const Ns=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],Ss=wr(function(){const{entities:r,gitStatus:i,currentBranch:n,defaultBranch:s,allBranches:t,baseBranch:a,branchDiff:d,currentCommit:o,projectSlug:c,queueState:l}=jr(),[h,g]=Cr(),[p,x]=q.useState("uncommitted"),[w,y]=q.useState(null),m=h.get("expanded")==="true",b=rt(),L=b.data;q.useEffect(()=>{p==="branch"&&n&&a&&n!==a&&b.state==="idle"&&!L&&b.load(`/api/branch-entity-diff?base=${encodeURIComponent(a)}&compare=${encodeURIComponent(n)}`)},[p,n,a,b,L]);const N=q.useMemo(()=>{const T=Tr(i,r);return Array.from(T.entries()).sort((ee,Y)=>ee[0].localeCompare(Y[0]))},[i,r]),k=q.useMemo(()=>{const T=Fr(d,r,L);return Array.from(T.entries()).sort((ee,Y)=>ee[0].localeCompare(Y[0]))},[d,r,L]),E=q.useMemo(()=>Rr(i,r),[i,r]);q.useMemo(()=>{const T=k.flatMap(([ee,Y])=>Y.entities);return Ir(T,r)},[k,r]);const S=q.useMemo(()=>N.map(([T])=>T),[N]),M=q.useMemo(()=>k.map(([T])=>T),[k]),{expandedUncommitted:P,expandedBranch:F,setExpandedUncommitted:u,setExpandedBranch:v,toggleFile:C,expandAllUncommitted:j,collapseAllUncommitted:_,expandAllBranch:D,collapseAllBranch:A}=Vr(m,S,M),{diffView:O,diffContent:B,isLoading:$,handleShowFileDiff:V,handleCloseDiff:J}=qr(a,n,p),W=o?.metadata?.currentRun,X=!!W?.createdAt&&!W?.analysisCompletedAt,{lastLine:ne,isCompleted:hr}=Nr(c,X),pr=X&&!hr,lt=new Set(W?.currentEntityShas||[]),Ge=new Set(l.jobs.flatMap(T=>T.entityShas||[])),He=new Set(l.currentlyExecuting?.entityShas||[]),{isAnalyzing:We,handleGenerateSimulation:ct,handleGenerateAllSimulations:mr,isEntityBeingAnalyzed:dt}=Gr(W?.currentEntityShas),ft=T=>Ge.has(T)||He.has(T),ut=T=>{T===s?h.delete("compare"):h.set("compare",T),g(h)},gr=()=>{const ee=(p==="uncommitted"?N.flatMap(([Y,Ue])=>Ue.editedEntities):k.flatMap(([Y,Ue])=>Ue.entities)).filter(Y=>!lt.has(Y.sha)&&!Ge.has(Y.sha)&&!He.has(Y.sha));mr(ee)},ht=N.length,pt=k.length,xr=p==="uncommitted"?ht:pt,_e=(p==="uncommitted"?N.flatMap(([T,ee])=>ee.editedEntities):k.flatMap(([T,ee])=>ee.entities)).filter(T=>T.entityType==="visual"||T.entityType==="library"),ze=_e.length>0&&_e.every(T=>lt.has(T.sha)),mt=_e.length>0&&!ze&&_e.every(T=>Ge.has(T.sha)||He.has(T.sha)),gt=We||ze||mt,xt=ze?"Analyzing...":mt?"Queued...":We?"Analyzing...":"Analyze All";return f.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:f.jsxs("div",{className:"px-36 py-12",children:[f.jsxs("div",{className:"mb-8",children:[f.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Git Changes"}),f.jsx("div",{className:"flex items-center gap-4 text-sm text-gray-600 mt-2",children:n&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-xs",children:"Branch:"}),t.length>0?f.jsx("select",{value:n,onChange:T=>ut(T.target.value),className:"text-gray-900 font-medium px-2 py-1 border border-gray-300 rounded text-sm hover:border-gray-400 focus:outline-none focus:border-blue-500",style:{paddingRight:"26px",backgroundPosition:"right 6px center",backgroundRepeat:"no-repeat",backgroundSize:"16px",appearance:"none",backgroundImage:`url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e")`},children:t.map(T=>f.jsxs("option",{value:T,children:[T," ",T===s?"(default)":""]},T))}):f.jsx("span",{className:"text-gray-900 font-medium",children:n})]})})]}),f.jsxs("div",{className:"flex items-center justify-between mb-1",children:[f.jsx(is,{activeTab:p,onTabChange:x,uncommittedCount:ht,branchCount:pt}),xr>0&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:p==="uncommitted"?j:D,className:"px-3 py-1.5 text-xs font-['IBM_Plex_Sans'] font-medium text-[#626262] hover:text-cyblack-100 hover:bg-gray-100 rounded transition-colors cursor-pointer",children:"Expand All"}),f.jsx("button",{onClick:p==="uncommitted"?_:A,className:"px-3 py-1.5 text-xs font-['IBM_Plex_Sans'] font-medium text-[#626262] hover:text-cyblack-100 hover:bg-gray-100 rounded transition-colors cursor-pointer",children:"Collapse All"}),f.jsx("button",{onClick:gr,disabled:gt,className:"px-4 py-1.5 bg-[#005c75] text-white rounded text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors cursor-pointer disabled:bg-gray-400 disabled:cursor-not-allowed",title:gt?xt:`Analyze all ${p} entities`,children:xt})]})]}),f.jsxs("div",{className:"overflow-hidden",children:[p==="uncommitted"&&f.jsx(cs,{files:N,entityImpactMap:E,expandedFiles:P,isEntityBeingAnalyzed:dt,isEntityQueued:ft,projectSlug:c,baseBranch:a,currentBranch:n,onToggleFile:T=>C(T,P,u),onShowFileDiff:V,onGenerateSimulation:ct,onShowLogs:y}),p==="branch"&&n&&f.jsx(fs,{files:k,currentBranch:n,defaultBranch:s,baseBranch:a,allBranches:t,expandedFiles:F,isEntityBeingAnalyzed:dt,isEntityQueued:ft,isAnyAnalysisInProgress:pr,isAnalyzing:We,lastLogLine:ne,projectSlug:c,onToggleFile:T=>C(T,F,v),onBranchChange:ut,onGenerateSimulation:ct,onShowLogs:y})]}),O&&f.jsx(ss,{diffView:O,diffContent:B,isLoading:$,entities:r,onClose:J}),w&&c&&f.jsx(_r,{projectSlug:c,onClose:()=>y(null)})]})})});export{Ss as default,Ns as meta};
10
+ `}function c(h,g,p,x,w,y,m){return o(f(h,g,p,x,w,y,m))}function l(h,g,p,x,w,y){return c(h,h,g,p,x,w,y)}return de}var be={},Pt;function Kr(){if(Pt)return be;Pt=1,Object.defineProperty(be,"__esModule",{value:!0}),be.arrayEqual=e,be.arrayStartsWith=r;function e(i,n){return i.length!==n.length?!1:r(i,n)}function r(i,n){if(n.length>i.length)return!1;for(var s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}return be}var Mt;function en(){if(Mt)return ve;Mt=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.calcLineCount=c,ve.merge=l;var e=nr(),r=st(),i=Kr();function n(u){return f(u)||a(u)||t(u)||s()}function s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t(u,v){if(u){if(typeof u=="string")return o(u,v);var C=Object.prototype.toString.call(u).slice(8,-1);if(C==="Object"&&u.constructor&&(C=u.constructor.name),C==="Map"||C==="Set")return Array.from(u);if(C==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C))return o(u,v)}}function a(u){if(typeof Symbol<"u"&&Symbol.iterator in Object(u))return Array.from(u)}function f(u){if(Array.isArray(u))return o(u)}function o(u,v){(v==null||v>u.length)&&(v=u.length);for(var C=0,j=new Array(v);C<v;C++)j[C]=u[C];return j}function c(u){var v=F(u.lines),C=v.oldLines,j=v.newLines;C!==void 0?u.oldLines=C:delete u.oldLines,j!==void 0?u.newLines=j:delete u.newLines}function l(u,v,C){u=h(u,C),v=h(v,C);var j={};(u.index||v.index)&&(j.index=u.index||v.index),(u.newFileName||v.newFileName)&&(g(u)?g(v)?(j.oldFileName=p(j,u.oldFileName,v.oldFileName),j.newFileName=p(j,u.newFileName,v.newFileName),j.oldHeader=p(j,u.oldHeader,v.oldHeader),j.newHeader=p(j,u.newHeader,v.newHeader)):(j.oldFileName=u.oldFileName,j.newFileName=u.newFileName,j.oldHeader=u.oldHeader,j.newHeader=u.newHeader):(j.oldFileName=v.oldFileName||u.oldFileName,j.newFileName=v.newFileName||u.newFileName,j.oldHeader=v.oldHeader||u.oldHeader,j.newHeader=v.newHeader||u.newHeader)),j.hunks=[];for(var _=0,D=0,A=0,M=0;_<u.hunks.length||D<v.hunks.length;){var B=u.hunks[_]||{oldStart:1/0},$=v.hunks[D]||{oldStart:1/0};if(x(B,$))j.hunks.push(w(B,A)),_++,M+=B.newLines-B.oldLines;else if(x($,B))j.hunks.push(w($,M)),D++,A+=$.newLines-$.oldLines;else{var V={oldStart:Math.min(B.oldStart,$.oldStart),oldLines:0,newStart:Math.min(B.newStart+A,$.oldStart+M),newLines:0,lines:[]};y(V,B.oldStart,B.lines,$.oldStart,$.lines),D++,_++,j.hunks.push(V)}}return j}function h(u,v){if(typeof u=="string"){if(/^@@/m.test(u)||/^Index:/m.test(u))return(0,r.parsePatch)(u)[0];if(!v)throw new Error("Must provide a base reference or pass in a patch");return(0,e.structuredPatch)(void 0,void 0,v,u)}return u}function g(u){return u.newFileName&&u.newFileName!==u.oldFileName}function p(u,v,C){return v===C?v:(u.conflict=!0,{mine:v,theirs:C})}function x(u,v){return u.oldStart<v.oldStart&&u.oldStart+u.oldLines<v.oldStart}function w(u,v){return{oldStart:u.oldStart,oldLines:u.oldLines,newStart:u.newStart+v,newLines:u.newLines,lines:u.lines}}function y(u,v,C,j,_){var D={offset:v,lines:C,index:0},A={offset:j,lines:_,index:0};for(N(u,D,A),N(u,A,D);D.index<D.lines.length&&A.index<A.lines.length;){var M=D.lines[D.index],B=A.lines[A.index];if((M[0]==="-"||M[0]==="+")&&(B[0]==="-"||B[0]==="+"))m(u,D,A);else if(M[0]==="+"&&B[0]===" "){var $;($=u.lines).push.apply($,n(E(D)))}else if(B[0]==="+"&&M[0]===" "){var V;(V=u.lines).push.apply(V,n(E(A)))}else M[0]==="-"&&B[0]===" "?b(u,D,A):B[0]==="-"&&M[0]===" "?b(u,A,D,!0):M===B?(u.lines.push(M),D.index++,A.index++):L(u,E(D),E(A))}k(u,D),k(u,A),c(u)}function m(u,v,C){var j=E(v),_=E(C);if(O(j)&&O(_)){if((0,i.arrayStartsWith)(j,_)&&P(C,j,j.length-_.length)){var D;(D=u.lines).push.apply(D,n(j));return}else if((0,i.arrayStartsWith)(_,j)&&P(v,_,_.length-j.length)){var A;(A=u.lines).push.apply(A,n(_));return}}else if((0,i.arrayEqual)(j,_)){var M;(M=u.lines).push.apply(M,n(j));return}L(u,j,_)}function b(u,v,C,j){var _=E(v),D=S(C,_);if(D.merged){var A;(A=u.lines).push.apply(A,n(D.merged))}else L(u,j?D:_,j?_:D)}function L(u,v,C){u.conflict=!0,u.lines.push({conflict:!0,mine:v,theirs:C})}function N(u,v,C){for(;v.offset<C.offset&&v.index<v.lines.length;){var j=v.lines[v.index++];u.lines.push(j),v.offset++}}function k(u,v){for(;v.index<v.lines.length;){var C=v.lines[v.index++];u.lines.push(C)}}function E(u){for(var v=[],C=u.lines[u.index][0];u.index<u.lines.length;){var j=u.lines[u.index];if(C==="-"&&j[0]==="+"&&(C="+"),C===j[0])v.push(j),u.index++;else break}return v}function S(u,v){for(var C=[],j=[],_=0,D=!1,A=!1;_<v.length&&u.index<u.lines.length;){var M=u.lines[u.index],B=v[_];if(B[0]==="+")break;if(D=D||M[0]!==" ",j.push(B),_++,M[0]==="+")for(A=!0;M[0]==="+";)C.push(M),M=u.lines[++u.index];B.substr(1)===M.substr(1)?(C.push(M),u.index++):A=!0}if((v[_]||"")[0]==="+"&&D&&(A=!0),A)return C;for(;_<v.length;)j.push(v[_++]);return{merged:j,changes:C}}function O(u){return u.reduce(function(v,C){return v&&C[0]==="-"},!0)}function P(u,v,C){for(var j=0;j<C;j++){var _=v[v.length-C+j].substr(1);if(u.lines[u.index+j]!==" "+_)return!1}return u.index+=C,!0}function F(u){var v=0,C=0;return u.forEach(function(j){if(typeof j!="string"){var _=F(j.mine),D=F(j.theirs);v!==void 0&&(_.oldLines===D.oldLines?v+=_.oldLines:v=void 0),C!==void 0&&(_.newLines===D.newLines?C+=_.newLines:C=void 0)}else C!==void 0&&(j[0]==="+"||j[0]===" ")&&C++,v!==void 0&&(j[0]==="-"||j[0]===" ")&&v++}),{oldLines:v,newLines:C}}return ve}var Ee={},Ot;function tn(){if(Ot)return Ee;Ot=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.reversePatch=n;function e(s,t){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(s);t&&(f=f.filter(function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable})),a.push.apply(a,f)}return a}function r(s){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?e(Object(a),!0).forEach(function(f){i(s,f,a[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(f){Object.defineProperty(s,f,Object.getOwnPropertyDescriptor(a,f))})}return s}function i(s,t,a){return t in s?Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[t]=a,s}function n(s){return Array.isArray(s)?s.map(n).reverse():r(r({},s),{},{oldFileName:s.newFileName,oldHeader:s.newHeader,newFileName:s.oldFileName,newHeader:s.oldHeader,hunks:s.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(a){return a.startsWith("-")?"+".concat(a.slice(1)):a.startsWith("+")?"-".concat(a.slice(1)):a})}})})}return Ee}var Ae={},Bt;function rn(){if(Bt)return Ae;Bt=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.convertChangesToDMP=e;function e(r){for(var i=[],n,s,t=0;t<r.length;t++)n=r[t],n.added?s=1:n.removed?s=-1:s=0,i.push([s,n.value]);return i}return Ae}var Pe={},Tt;function nn(){if(Tt)return Pe;Tt=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.convertChangesToXML=e;function e(i){for(var n=[],s=0;s<i.length;s++){var t=i[s];t.added?n.push("<ins>"):t.removed&&n.push("<del>"),n.push(r(t.value)),t.added?n.push("</ins>"):t.removed&&n.push("</del>")}return n.join("")}function r(i){var n=i;return n=n.replace(/&/g,"&amp;"),n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(/"/g,"&quot;"),n}return Pe}var Ft;function sn(){return Ft||(Ft=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Diff",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"diffChars",{enumerable:!0,get:function(){return i.diffChars}}),Object.defineProperty(e,"diffWords",{enumerable:!0,get:function(){return n.diffWords}}),Object.defineProperty(e,"diffWordsWithSpace",{enumerable:!0,get:function(){return n.diffWordsWithSpace}}),Object.defineProperty(e,"diffLines",{enumerable:!0,get:function(){return s.diffLines}}),Object.defineProperty(e,"diffTrimmedLines",{enumerable:!0,get:function(){return s.diffTrimmedLines}}),Object.defineProperty(e,"diffSentences",{enumerable:!0,get:function(){return t.diffSentences}}),Object.defineProperty(e,"diffCss",{enumerable:!0,get:function(){return a.diffCss}}),Object.defineProperty(e,"diffJson",{enumerable:!0,get:function(){return f.diffJson}}),Object.defineProperty(e,"canonicalize",{enumerable:!0,get:function(){return f.canonicalize}}),Object.defineProperty(e,"diffArrays",{enumerable:!0,get:function(){return o.diffArrays}}),Object.defineProperty(e,"applyPatch",{enumerable:!0,get:function(){return c.applyPatch}}),Object.defineProperty(e,"applyPatches",{enumerable:!0,get:function(){return c.applyPatches}}),Object.defineProperty(e,"parsePatch",{enumerable:!0,get:function(){return l.parsePatch}}),Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return h.merge}}),Object.defineProperty(e,"reversePatch",{enumerable:!0,get:function(){return g.reversePatch}}),Object.defineProperty(e,"structuredPatch",{enumerable:!0,get:function(){return p.structuredPatch}}),Object.defineProperty(e,"createTwoFilesPatch",{enumerable:!0,get:function(){return p.createTwoFilesPatch}}),Object.defineProperty(e,"createPatch",{enumerable:!0,get:function(){return p.createPatch}}),Object.defineProperty(e,"formatPatch",{enumerable:!0,get:function(){return p.formatPatch}}),Object.defineProperty(e,"convertChangesToDMP",{enumerable:!0,get:function(){return x.convertChangesToDMP}}),Object.defineProperty(e,"convertChangesToXML",{enumerable:!0,get:function(){return w.convertChangesToXML}});var r=y(ae()),i=Wr(),n=zr(),s=nt(),t=Ur(),a=Jr(),f=Zr(),o=Qr(),c=Yr(),l=st(),h=en(),g=tn(),p=nr(),x=rn(),w=nn();function y(m){return m&&m.__esModule?m:{default:m}}})(Ze)),Ze}var Rt;function an(){if(Rt)return U;Rt=1;var e=U&&U.__createBinding||(Object.create?(function(l,h,g,p){p===void 0&&(p=g);var x=Object.getOwnPropertyDescriptor(h,g);(!x||("get"in x?!h.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return h[g]}}),Object.defineProperty(l,p,x)}):(function(l,h,g,p){p===void 0&&(p=g),l[p]=h[g]})),r=U&&U.__setModuleDefault||(Object.create?(function(l,h){Object.defineProperty(l,"default",{enumerable:!0,value:h})}):function(l,h){l.default=h}),i=U&&U.__importStar||function(l){if(l&&l.__esModule)return l;var h={};if(l!=null)for(var g in l)g!=="default"&&Object.prototype.hasOwnProperty.call(l,g)&&e(h,l,g);return r(h,l),h};Object.defineProperty(U,"__esModule",{value:!0}),U.computeLineInformation=U.DiffMethod=U.DiffType=void 0;const n=i(sn()),s=n;var t;(function(l){l[l.DEFAULT=0]="DEFAULT",l[l.ADDED=1]="ADDED",l[l.REMOVED=2]="REMOVED",l[l.CHANGED=3]="CHANGED"})(t||(U.DiffType=t={}));var a;(function(l){l.CHARS="diffChars",l.WORDS="diffWords",l.WORDS_WITH_SPACE="diffWordsWithSpace",l.LINES="diffLines",l.TRIMMED_LINES="diffTrimmedLines",l.SENTENCES="diffSentences",l.CSS="diffCss",l.JSON="diffJson"})(a||(U.DiffMethod=a={}));const f=l=>l===""?[]:l.replace(/\n$/,"").split(`
12
+ `),o=(l,h,g=a.CHARS)=>{const p=s[g](l,h),x={left:[],right:[]};return p.forEach(({added:w,removed:y,value:m})=>{const b={};return w&&(b.type=t.ADDED,b.value=m,x.right.push(b)),y&&(b.type=t.REMOVED,b.value=m,x.left.push(b)),!y&&!w&&(b.type=t.DEFAULT,b.value=m,x.right.push(b),x.left.push(b)),b}),x},c=(l,h,g=!1,p=a.CHARS,x=0,w=[])=>{let y=[];typeof l=="string"&&typeof h=="string"?y=n.diffLines(l.trimRight(),h.trimRight(),{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):y=n.diffJson(l,h);let m=x,b=x,L=[],N=0;const k=[],E=[],S=(O,P,F,u,v)=>f(O).map((j,_)=>{const D={},A={};if(!(E.includes(`${P}-${_}`)||v&&_!==0)){if(F||u){let M=!0;if(u){b+=1,D.lineNumber=b,D.type=t.REMOVED,D.value=j||" ";const B=y[P+1];if(B&&B.added){const $=f(B.value)[_];if($){const V=S($,P,!0,!1,!0),{value:J,lineNumber:W,type:X}=V[0].right;if(E.push(`${P+1}-${_}`),A.lineNumber=W,D.value===J)M=!1,A.type=0,D.type=0,A.value=J;else if(A.type=X,g)A.value=J;else{const ne=o(j,J,p);A.value=ne.right,D.value=ne.left}}}}else m+=1,A.lineNumber=m,A.type=t.ADDED,A.value=j;M&&!v&&(k.includes(N)||k.push(N))}else b+=1,m+=1,D.lineNumber=b,D.type=t.DEFAULT,D.value=j,A.lineNumber=m,A.type=t.DEFAULT,A.value=j;return(w?.includes(`L-${D.lineNumber}`)||w?.includes(`R-${A.lineNumber}`)&&!k.includes(N))&&k.push(N),v||(N+=1),{right:A,left:D}}}).filter(Boolean);return y.forEach(({added:O,removed:P,value:F},u)=>{L=[...L,...S(F,u,O,P)]}),{lineInformation:L,diffLines:k}};return U.computeLineInformation=c,U}var se={};function on(e){if(e.sheet)return e.sheet;for(var r=0;r<document.styleSheets.length;r++)if(document.styleSheets[r].ownerNode===e)return document.styleSheets[r]}function ln(e){var r=document.createElement("style");return r.setAttribute("data-emotion",e.key),e.nonce!==void 0&&r.setAttribute("nonce",e.nonce),r.appendChild(document.createTextNode("")),r.setAttribute("data-s",""),r}var cn=(function(){function e(i){var n=this;this._insertTag=function(s){var t;n.tags.length===0?n.insertionPoint?t=n.insertionPoint.nextSibling:n.prepend?t=n.container.firstChild:t=n.before:t=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(s,t),n.tags.push(s)},this.isSpeedy=i.speedy===void 0?!0:i.speedy,this.tags=[],this.ctr=0,this.nonce=i.nonce,this.key=i.key,this.container=i.container,this.prepend=i.prepend,this.insertionPoint=i.insertionPoint,this.before=null}var r=e.prototype;return r.hydrate=function(n){n.forEach(this._insertTag)},r.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(ln(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var t=on(s);try{t.insertRule(n,t.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(n));this.ctr++},r.flush=function(){this.tags.forEach(function(n){var s;return(s=n.parentNode)==null?void 0:s.removeChild(n)}),this.tags=[],this.ctr=0},e})(),z="-ms-",Re="-moz-",R="-webkit-",sr="comm",it="rule",at="decl",dn="@import",ir="@keyframes",fn="@layer",un=Math.abs,$e=String.fromCharCode,hn=Object.assign;function pn(e,r){return H(e,0)^45?(((r<<2^H(e,0))<<2^H(e,1))<<2^H(e,2))<<2^H(e,3):0}function ar(e){return e.trim()}function mn(e,r){return(e=r.exec(e))?e[0]:e}function I(e,r,i){return e.replace(r,i)}function et(e,r){return e.indexOf(r)}function H(e,r){return e.charCodeAt(r)|0}function Ne(e,r,i){return e.slice(r,i)}function te(e){return e.length}function ot(e){return e.length}function Me(e,r){return r.push(e),e}function gn(e,r){return e.map(r).join("")}var Ve=1,ge=1,or=0,Z=0,G=0,xe="";function qe(e,r,i,n,s,t,a){return{value:e,root:r,parent:i,type:n,props:s,children:t,line:Ve,column:ge,length:a,return:""}}function we(e,r){return hn(qe("",null,null,"",null,null,0),e,{length:-e.length},r)}function xn(){return G}function yn(){return G=Z>0?H(xe,--Z):0,ge--,G===10&&(ge=1,Ve--),G}function Q(){return G=Z<or?H(xe,Z++):0,ge++,G===10&&(ge=1,Ve++),G}function re(){return H(xe,Z)}function Oe(){return Z}function Le(e,r){return Ne(xe,e,r)}function Se(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 lr(e){return Ve=ge=1,or=te(xe=e),Z=0,[]}function cr(e){return xe="",e}function Be(e){return ar(Le(Z-1,tt(e===91?e+2:e===40?e+1:e)))}function vn(e){for(;(G=re())&&G<33;)Q();return Se(e)>2||Se(G)>3?"":" "}function bn(e,r){for(;--r&&Q()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return Le(e,Oe()+(r<6&&re()==32&&Q()==32))}function tt(e){for(;Q();)switch(G){case e:return Z;case 34:case 39:e!==34&&e!==39&&tt(G);break;case 40:e===41&&tt(e);break;case 92:Q();break}return Z}function wn(e,r){for(;Q()&&e+G!==57;)if(e+G===84&&re()===47)break;return"/*"+Le(r,Z-1)+"*"+$e(e===47?e:Q())}function jn(e){for(;!Se(re());)Q();return Le(e,Z)}function Cn(e){return cr(Te("",null,null,null,[""],e=lr(e),0,[0],e))}function Te(e,r,i,n,s,t,a,f,o){for(var c=0,l=0,h=a,g=0,p=0,x=0,w=1,y=1,m=1,b=0,L="",N=s,k=t,E=n,S=L;y;)switch(x=b,b=Q()){case 40:if(x!=108&&H(S,h-1)==58){et(S+=I(Be(b),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:S+=Be(b);break;case 9:case 10:case 13:case 32:S+=vn(x);break;case 92:S+=bn(Oe()-1,7);continue;case 47:switch(re()){case 42:case 47:Me(Nn(wn(Q(),Oe()),r,i),o);break;default:S+="/"}break;case 123*w:f[c++]=te(S)*m;case 125*w:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+l:m==-1&&(S=I(S,/\f/g,"")),p>0&&te(S)-h&&Me(p>32?$t(S+";",n,i,h-1):$t(I(S," ","")+";",n,i,h-2),o);break;case 59:S+=";";default:if(Me(E=It(S,r,i,c,l,s,f,L,N=[],k=[],h),t),b===123)if(l===0)Te(S,r,E,E,N,t,h,f,k);else switch(g===99&&H(S,3)===110?100:g){case 100:case 108:case 109:case 115:Te(e,E,E,n&&Me(It(e,E,E,0,0,s,f,L,s,N=[],h),k),s,k,h,f,n?N:k);break;default:Te(S,E,E,E,[""],k,0,f,k)}}c=l=p=0,w=m=1,L=S="",h=a;break;case 58:h=1+te(S),p=x;default:if(w<1){if(b==123)--w;else if(b==125&&w++==0&&yn()==125)continue}switch(S+=$e(b),b*w){case 38:m=l>0?1:(S+="\f",-1);break;case 44:f[c++]=(te(S)-1)*m,m=1;break;case 64:re()===45&&(S+=Be(Q())),g=re(),l=h=te(L=S+=jn(Oe())),b++;break;case 45:x===45&&te(S)==2&&(w=0)}}return t}function It(e,r,i,n,s,t,a,f,o,c,l){for(var h=s-1,g=s===0?t:[""],p=ot(g),x=0,w=0,y=0;x<n;++x)for(var m=0,b=Ne(e,h+1,h=un(w=a[x])),L=e;m<p;++m)(L=ar(w>0?g[m]+" "+b:I(b,/&\f/g,g[m])))&&(o[y++]=L);return qe(e,r,i,s===0?it:f,o,c,l)}function Nn(e,r,i){return qe(e,r,i,sr,$e(xn()),Ne(e,2,-2),0)}function $t(e,r,i,n){return qe(e,r,i,at,Ne(e,0,n),Ne(e,n+1,-1),n)}function me(e,r){for(var i="",n=ot(e),s=0;s<n;s++)i+=r(e[s],s,e,r)||"";return i}function Sn(e,r,i,n){switch(e.type){case fn:if(e.children.length)break;case dn:case at:return e.return=e.return||e.value;case sr:return"";case ir:return e.return=e.value+"{"+me(e.children,n)+"}";case it:e.value=e.props.join(",")}return te(i=me(e.children,n))?e.return=e.value+"{"+i+"}":""}function Ln(e){var r=ot(e);return function(i,n,s,t){for(var a="",f=0;f<r;f++)a+=e[f](i,n,s,t)||"";return a}}function _n(e){return function(r){r.root||(r=r.return)&&e(r)}}function kn(e){var r=Object.create(null);return function(i){return r[i]===void 0&&(r[i]=e(i)),r[i]}}var Dn=function(r,i,n){for(var s=0,t=0;s=t,t=re(),s===38&&t===12&&(i[n]=1),!Se(t);)Q();return Le(r,Z)},En=function(r,i){var n=-1,s=44;do switch(Se(s)){case 0:s===38&&re()===12&&(i[n]=1),r[n]+=Dn(Z-1,i,n);break;case 2:r[n]+=Be(s);break;case 4:if(s===44){r[++n]=re()===58?"&\f":"",i[n]=r[n].length;break}default:r[n]+=$e(s)}while(s=Q());return r},An=function(r,i){return cr(En(lr(r),i))},Vt=new WeakMap,Pn=function(r){if(!(r.type!=="rule"||!r.parent||r.length<1)){for(var i=r.value,n=r.parent,s=r.column===n.column&&r.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(r.props.length===1&&i.charCodeAt(0)!==58&&!Vt.get(n))&&!s){Vt.set(r,!0);for(var t=[],a=An(i,t),f=n.props,o=0,c=0;o<a.length;o++)for(var l=0;l<f.length;l++,c++)r.props[c]=t[o]?a[o].replace(/&\f/g,f[l]):f[l]+" "+a[o]}}},Mn=function(r){if(r.type==="decl"){var i=r.value;i.charCodeAt(0)===108&&i.charCodeAt(2)===98&&(r.return="",r.value="")}};function dr(e,r){switch(pn(e,r)){case 5103:return R+"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 R+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return R+e+Re+e+z+e+e;case 6828:case 4268:return R+e+z+e+e;case 6165:return R+e+z+"flex-"+e+e;case 5187:return R+e+I(e,/(\w+).+(:[^]+)/,R+"box-$1$2"+z+"flex-$1$2")+e;case 5443:return R+e+z+"flex-item-"+I(e,/flex-|-self/,"")+e;case 4675:return R+e+z+"flex-line-pack"+I(e,/align-content|flex-|-self/,"")+e;case 5548:return R+e+z+I(e,"shrink","negative")+e;case 5292:return R+e+z+I(e,"basis","preferred-size")+e;case 6060:return R+"box-"+I(e,"-grow","")+R+e+z+I(e,"grow","positive")+e;case 4554:return R+I(e,/([^-])(transform)/g,"$1"+R+"$2")+e;case 6187:return I(I(I(e,/(zoom-|grab)/,R+"$1"),/(image-set)/,R+"$1"),e,"")+e;case 5495:case 3959:return I(e,/(image-set\([^]*)/,R+"$1$`$1");case 4968:return I(I(e,/(.+:)(flex-)?(.*)/,R+"box-pack:$3"+z+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+R+e+e;case 4095:case 3583:case 4068:case 2532:return I(e,/(.+)-inline(.+)/,R+"$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(te(e)-1-r>6)switch(H(e,r+1)){case 109:if(H(e,r+4)!==45)break;case 102:return I(e,/(.+:)(.+)-([^]+)/,"$1"+R+"$2-$3$1"+Re+(H(e,r+3)==108?"$3":"$2-$3"))+e;case 115:return~et(e,"stretch")?dr(I(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(H(e,r+1)!==115)break;case 6444:switch(H(e,te(e)-3-(~et(e,"!important")&&10))){case 107:return I(e,":",":"+R)+e;case 101:return I(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+R+(H(e,14)===45?"inline-":"")+"box$3$1"+R+"$2$3$1"+z+"$2box$3")+e}break;case 5936:switch(H(e,r+11)){case 114:return R+e+z+I(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return R+e+z+I(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return R+e+z+I(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return R+e+z+e+e}return e}var On=function(r,i,n,s){if(r.length>-1&&!r.return)switch(r.type){case at:r.return=dr(r.value,r.length);break;case ir:return me([we(r,{value:I(r.value,"@","@"+R)})],s);case it:if(r.length)return gn(r.props,function(t){switch(mn(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return me([we(r,{props:[I(t,/:(read-\w+)/,":"+Re+"$1")]})],s);case"::placeholder":return me([we(r,{props:[I(t,/:(plac\w+)/,":"+R+"input-$1")]}),we(r,{props:[I(t,/:(plac\w+)/,":"+Re+"$1")]}),we(r,{props:[I(t,/:(plac\w+)/,z+"input-$1")]})],s)}return""})}},Bn=[On],Tn=function(r){var i=r.key;if(i==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(w){var y=w.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var s=r.stylisPlugins||Bn,t={},a,f=[];a=r.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+i+' "]'),function(w){for(var y=w.getAttribute("data-emotion").split(" "),m=1;m<y.length;m++)t[y[m]]=!0;f.push(w)});var o,c=[Pn,Mn];{var l,h=[Sn,_n(function(w){l.insert(w)})],g=Ln(c.concat(s,h)),p=function(y){return me(Cn(y),g)};o=function(y,m,b,L){l=b,p(y?y+"{"+m.styles+"}":m.styles),L&&(x.inserted[m.name]=!0)}}var x={key:i,sheet:new cn({key:i,container:a,nonce:r.nonce,speedy:r.speedy,prepend:r.prepend,insertionPoint:r.insertionPoint}),nonce:r.nonce,inserted:t,registered:{},insert:o};return x.sheet.hydrate(f),x};function Fn(e){for(var r=0,i,n=0,s=e.length;s>=4;++n,s-=4)i=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,r=(i&65535)*1540483477+((i>>>16)*59797<<16)^(r&65535)*1540483477+((r>>>16)*59797<<16);switch(s){case 3:r^=(e.charCodeAt(n+2)&255)<<16;case 2:r^=(e.charCodeAt(n+1)&255)<<8;case 1:r^=e.charCodeAt(n)&255,r=(r&65535)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,r=(r&65535)*1540483477+((r>>>16)*59797<<16),((r^r>>>15)>>>0).toString(36)}var Rn={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},In=/[A-Z]|^ms/g,$n=/_EMO_([^_]+?)_([^]*?)_EMO_/g,fr=function(r){return r.charCodeAt(1)===45},qt=function(r){return r!=null&&typeof r!="boolean"},Ye=kn(function(e){return fr(e)?e:e.replace(In,"-$&").toLowerCase()}),Gt=function(r,i){switch(r){case"animation":case"animationName":if(typeof i=="string")return i.replace($n,function(n,s,t){return ie={name:s,styles:t,next:ie},s})}return Rn[r]!==1&&!fr(r)&&typeof i=="number"&&i!==0?i+"px":i};function Ie(e,r,i){if(i==null)return"";var n=i;if(n.__emotion_styles!==void 0)return n;switch(typeof i){case"boolean":return"";case"object":{var s=i;if(s.anim===1)return ie={name:s.name,styles:s.styles,next:ie},s.name;var t=i;if(t.styles!==void 0){var a=t.next;if(a!==void 0)for(;a!==void 0;)ie={name:a.name,styles:a.styles,next:ie},a=a.next;var f=t.styles+";";return f}return Vn(e,r,i)}}var o=i;if(r==null)return o;var c=r[o];return c!==void 0?c:o}function Vn(e,r,i){var n="";if(Array.isArray(i))for(var s=0;s<i.length;s++)n+=Ie(e,r,i[s])+";";else for(var t in i){var a=i[t];if(typeof a!="object"){var f=a;r!=null&&r[f]!==void 0?n+=t+"{"+r[f]+"}":qt(f)&&(n+=Ye(t)+":"+Gt(t,f)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(r==null||r[a[0]]===void 0))for(var o=0;o<a.length;o++)qt(a[o])&&(n+=Ye(t)+":"+Gt(t,a[o])+";");else{var c=Ie(e,r,a);switch(t){case"animation":case"animationName":{n+=Ye(t)+":"+c+";";break}default:n+=t+"{"+c+"}"}}}return n}var Ht=/label:\s*([^\s;{]+)\s*(;|$)/g,ie;function Ke(e,r,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,s="";ie=void 0;var t=e[0];if(t==null||t.raw===void 0)n=!1,s+=Ie(i,r,t);else{var a=t;s+=a[0]}for(var f=1;f<e.length;f++)if(s+=Ie(i,r,e[f]),n){var o=t;s+=o[f]}Ht.lastIndex=0;for(var c="",l;(l=Ht.exec(s))!==null;)c+="-"+l[1];var h=Fn(s)+c;return{name:h,styles:s,next:ie}}function ur(e,r,i){var n="";return i.split(" ").forEach(function(s){e[s]!==void 0?r.push(e[s]+";"):s&&(n+=s+" ")}),n}var qn=function(r,i,n){var s=r.key+"-"+i.name;r.registered[s]===void 0&&(r.registered[s]=i.styles)},Gn=function(r,i,n){qn(r,i);var s=r.key+"-"+i.name;if(r.inserted[i.name]===void 0){var t=i;do r.insert(i===t?"."+s:"",t,r.sheet,!0),t=t.next;while(t!==void 0)}};function Wt(e,r){if(e.inserted[r.name]===void 0)return e.insert("",r,e.sheet,!0)}function zt(e,r,i){var n=[],s=ur(e,n,i);return n.length<2?i:s+r(n)}var Hn=function(r){var i=Tn(r);i.sheet.speedy=function(f){this.isSpeedy=f},i.compat=!0;var n=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];var h=Ke(c,i.registered,void 0);return Gn(i,h),i.key+"-"+h.name},s=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];var h=Ke(c,i.registered),g="animation-"+h.name;return Wt(i,{name:h.name,styles:"@keyframes "+g+"{"+h.styles+"}"}),g},t=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];var h=Ke(c,i.registered);Wt(i,h)},a=function(){for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return zt(i.registered,n,Wn(c))};return{css:n,cx:a,injectGlobal:t,keyframes:s,hydrate:function(o){o.forEach(function(c){i.inserted[c]=!0})},flush:function(){i.registered={},i.inserted={},i.sheet.flush()},sheet:i.sheet,cache:i,getRegisteredStyles:ur.bind(null,i.registered),merge:zt.bind(null,i.registered,n)}},Wn=function e(r){for(var i="",n=0;n<r.length;n++){var s=r[n];if(s!=null){var t=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))t=e(s);else{t="";for(var a in s)s[a]&&a&&(t&&(t+=" "),t+=a)}break}default:t=s}t&&(i&&(i+=" "),i+=t)}}return i};const zn=Object.freeze(Object.defineProperty({__proto__:null,default:Hn},Symbol.toStringTag,{value:"Module"})),Un=Xt(zn);var Ut;function Jn(){if(Ut)return se;Ut=1;var e=se&&se.__rest||function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,a=Object.getOwnPropertySymbols(n);f<a.length;f++)s.indexOf(a[f])<0&&Object.prototype.propertyIsEnumerable.call(n,a[f])&&(t[a[f]]=n[a[f]]);return t},r=se&&se.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(se,"__esModule",{value:!0});const i=r(Un);return se.default=(n,s=!1,t="")=>{const{variables:a={}}=n,f=e(n,["variables"]),o={light:Object.assign({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"},a.light||{}),dark:Object.assign({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:"#21232b",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#555a7b",diffViewerTitleBorderColor:"#353846"},a.dark||{})},c=s?o.dark:o.light,{css:l,cx:h}=(0,i.default)({key:"react-diff",nonce:t}),g=l({width:"100%",label:"content"}),p=l({[`.${g}`]:{width:"50%"},label:"split-view"}),x=l({width:"100%",background:c.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"25px"},label:"diff-container",borderCollapse:"collapse"}),w=l({color:c.codeFoldContentColor,label:"code-fold-content"}),y=l({color:c.diffViewerColor,label:"content-text"}),m=l({background:c.diffViewerTitleBackground,padding:10,borderBottom:`1px solid ${c.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${c.diffViewerTitleBorderColor}`},[`.${y}`]:{color:c.diffViewerTitleColor}}),b=l({color:c.gutterColor,label:"line-number"}),L=l({background:c.removedBackground,color:c.removedColor,pre:{color:c.removedColor},[`.${b}`]:{color:c.removedGutterColor},label:"diff-removed"}),N=l({background:c.addedBackground,color:c.addedColor,pre:{color:c.addedColor},[`.${b}`]:{color:c.addedGutterColor},label:"diff-added"}),k=l({background:c.changedBackground,[`.${b}`]:{color:c.gutterColor},label:"diff-changed"}),E=l({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),S=l({background:c.wordAddedBackground,label:"word-added"}),O=l({background:c.wordRemovedBackground,label:"word-removed"}),P=l({backgroundColor:c.codeFoldGutterBackground,label:"code-fold-gutter"}),F=l({backgroundColor:c.codeFoldBackground,height:40,fontSize:14,fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),u=l({backgroundColor:c.emptyLineBackground,label:"empty-line"}),v=l({width:25,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${N}`]:{pre:{color:c.addedColor}},[`&.${L}`]:{pre:{color:c.removedColor}}}),C=l({background:c.highlightBackground,label:"highlighted-line",[`.${S}, .${O}`]:{backgroundColor:"initial"}}),j=l({label:"highlighted-gutter"}),_=l({userSelect:"none",minWidth:50,padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:c.gutterBackground,"&:hover":{cursor:"pointer",background:c.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${N}`]:{background:c.addedGutterBackground},[`&.${L}`]:{background:c.removedGutterBackground},[`&.${j}`]:{background:c.highlightGutterBackground,"&:hover":{background:c.highlightGutterBackground}}}),D=l({"&:hover":{background:c.gutterBackground,cursor:"initial"},label:"empty-gutter"}),A=l({verticalAlign:"baseline",label:"line"}),M={diffContainer:x,diffRemoved:L,diffAdded:N,diffChanged:k,splitView:p,marker:v,highlightedGutter:j,highlightedLine:C,gutter:_,line:A,wordDiff:E,wordAdded:S,wordRemoved:O,codeFoldGutter:P,codeFold:F,emptyGutter:D,emptyLine:u,lineNumber:b,contentText:y,content:g,codeFoldContent:w,titleBlock:m},B=Object.keys(f).reduce(($,V)=>Object.assign(Object.assign({},$),{[V]:l(f[V])}),{});return Object.keys(M).reduce(($,V)=>Object.assign(Object.assign({},$),{[V]:B[V]?h(M[V],B[V]):M[V]}),{})},se}var je={},Jt;function Zn(){if(Jt)return je;Jt=1,Object.defineProperty(je,"__esModule",{value:!0}),je.computeHiddenBlocks=void 0;function e(r,i,n){let s=0,t,a={},f=[];return r.forEach((o,c)=>{const l=i.some(h=>h>=c-n&&h<=c+n);!l&&t==null?(t={index:s,startLine:c,endLine:c,lines:1},f.push(t),a[c]=t.index,s++):l?t=void 0:(t.endLine=c,t.lines++,a[c]=t.index)}),{lineBlocks:a,blocks:f}}return je.computeHiddenBlocks=e,je}var Zt=Number.isNaN||function(r){return typeof r=="number"&&r!==r};function Qn(e,r){return!!(e===r||Zt(e)&&Zt(r))}function Xn(e,r){if(e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!Qn(e[i],r[i]))return!1;return!0}function Yn(e,r){r===void 0&&(r=Xn);var i=null;function n(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];if(i&&i.lastThis===this&&r(s,i.lastArgs))return i.lastResult;var a=e.apply(this,s);return i={lastResult:a,lastArgs:s,lastThis:this},a}return n.clear=function(){i=null},n}const Kn=Object.freeze(Object.defineProperty({__proto__:null,default:Yn},Symbol.toStringTag,{value:"Module"})),es=Xt(Kn);var Qt;function ts(){return Qt||(Qt=1,(function(e){var r=K&&K.__createBinding||(Object.create?(function(w,y,m,b){b===void 0&&(b=m);var L=Object.getOwnPropertyDescriptor(y,m);(!L||("get"in L?!y.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return y[m]}}),Object.defineProperty(w,b,L)}):(function(w,y,m,b){b===void 0&&(b=m),w[b]=y[m]})),i=K&&K.__setModuleDefault||(Object.create?(function(w,y){Object.defineProperty(w,"default",{enumerable:!0,value:y})}):function(w,y){w.default=y}),n=K&&K.__importStar||function(w){if(w&&w.__esModule)return w;var y={};if(w!=null)for(var m in w)m!=="default"&&Object.prototype.hasOwnProperty.call(w,m)&&r(y,w,m);return i(y,w),y},s=K&&K.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.DiffMethod=e.LineNumberPrefix=void 0;const t=yr(),a=n(vr()),f=s(Hr()),o=an();Object.defineProperty(e,"DiffMethod",{enumerable:!0,get:function(){return o.DiffMethod}});const c=s(Jn()),l=Zn(),h=es,g=h.default||h;var p;(function(w){w.LEFT="L",w.RIGHT="R"})(p||(e.LineNumberPrefix=p={}));class x extends a.Component{constructor(y){super(y),this.resetCodeBlocks=()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1,this.onBlockExpand=m=>{const b=this.state.expandedBlocks.slice();b.push(m),this.setState({expandedBlocks:b})},this.computeStyles=g(c.default),this.onLineNumberClickProxy=m=>this.props.onLineNumberClick?b=>this.props.onLineNumberClick(m,b):()=>{},this.renderWordDiff=(m,b)=>m.map((L,N)=>(0,t.jsx)("span",{className:(0,f.default)(this.styles.wordDiff,{[this.styles.wordAdded]:L.type===o.DiffType.ADDED,[this.styles.wordRemoved]:L.type===o.DiffType.REMOVED}),children:b?b(L.value):L.value},N)),this.renderLine=(m,b,L,N,k,E)=>{const S=`${L}-${m}`,O=`${E}-${k}`,P=this.props.highlightLines.includes(S)||this.props.highlightLines.includes(O),F=b===o.DiffType.ADDED,u=b===o.DiffType.REMOVED,v=b===o.DiffType.CHANGED;let C;return Array.isArray(N)?C=this.renderWordDiff(N,this.props.renderContent):this.props.renderContent?C=this.props.renderContent(N):C=N,(0,t.jsxs)(a.Fragment,{children:[!this.props.hideLineNumbers&&(0,t.jsx)("td",{onClick:m&&this.onLineNumberClickProxy(S),className:(0,f.default)(this.styles.gutter,{[this.styles.emptyGutter]:!m,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedGutter]:P}),children:(0,t.jsx)("pre",{className:this.styles.lineNumber,children:m})}),!this.props.splitView&&!this.props.hideLineNumbers&&(0,t.jsx)("td",{onClick:k&&this.onLineNumberClickProxy(O),className:(0,f.default)(this.styles.gutter,{[this.styles.emptyGutter]:!k,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedGutter]:P}),children:(0,t.jsx)("pre",{className:this.styles.lineNumber,children:k})}),this.props.renderGutter?this.props.renderGutter({lineNumber:m,type:b,prefix:L,value:N,additionalLineNumber:k,additionalPrefix:E,styles:this.styles}):null,!this.props.hideMarkers&&(0,t.jsx)("td",{className:(0,f.default)(this.styles.marker,{[this.styles.emptyLine]:!C,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedLine]:P}),children:(0,t.jsxs)("pre",{children:[F&&"+",u&&"-"]})}),(0,t.jsx)("td",{className:(0,f.default)(this.styles.content,{[this.styles.emptyLine]:!C,[this.styles.diffAdded]:F,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:v,[this.styles.highlightedLine]:P}),children:(0,t.jsx)("pre",{className:this.styles.contentText,children:C})})]})},this.renderSplitView=({left:m,right:b},L)=>(0,t.jsxs)("tr",{className:this.styles.line,children:[this.renderLine(m.lineNumber,m.type,p.LEFT,m.value),this.renderLine(b.lineNumber,b.type,p.RIGHT,b.value)]},L),this.renderInlineView=({left:m,right:b},L)=>{let N;return m.type===o.DiffType.REMOVED&&b.type===o.DiffType.ADDED?(0,t.jsxs)(a.Fragment,{children:[(0,t.jsx)("tr",{className:this.styles.line,children:this.renderLine(m.lineNumber,m.type,p.LEFT,m.value,null)}),(0,t.jsx)("tr",{className:this.styles.line,children:this.renderLine(null,b.type,p.RIGHT,b.value,b.lineNumber)})]},L):(m.type===o.DiffType.REMOVED&&(N=this.renderLine(m.lineNumber,m.type,p.LEFT,m.value,null)),m.type===o.DiffType.DEFAULT&&(N=this.renderLine(m.lineNumber,m.type,p.LEFT,m.value,b.lineNumber,p.RIGHT)),b.type===o.DiffType.ADDED&&(N=this.renderLine(null,b.type,p.RIGHT,b.value,b.lineNumber)),(0,t.jsx)("tr",{className:this.styles.line,children:N},L))},this.onBlockClickProxy=m=>()=>this.onBlockExpand(m),this.renderSkippedLineIndicator=(m,b,L,N)=>{const{hideLineNumbers:k,splitView:E}=this.props,S=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(m,L,N):(0,t.jsxs)("pre",{className:this.styles.codeFoldContent,children:["Expand ",m," lines ..."]}),O=(0,t.jsx)("td",{children:(0,t.jsx)("a",{onClick:this.onBlockClickProxy(b),tabIndex:0,children:S})}),P=!E&&!k;return(0,t.jsxs)("tr",{className:this.styles.codeFold,children:[!k&&(0,t.jsx)("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?(0,t.jsx)("td",{className:this.styles.codeFoldGutter}):null,(0,t.jsx)("td",{className:(0,f.default)({[this.styles.codeFoldGutter]:P})}),P?(0,t.jsxs)(a.Fragment,{children:[(0,t.jsx)("td",{}),O]}):(0,t.jsxs)(a.Fragment,{children:[O,this.props.renderGutter?(0,t.jsx)("td",{}):null,(0,t.jsx)("td",{})]}),(0,t.jsx)("td",{}),(0,t.jsx)("td",{})]},`${L}-${N}`)},this.renderDiff=()=>{const{oldValue:m,newValue:b,splitView:L,disableWordDiff:N,compareMethod:k,linesOffset:E}=this.props,{lineInformation:S,diffLines:O}=(0,o.computeLineInformation)(m,b,N,k,E,this.props.alwaysShowLines),P=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:F,blocks:u}=(0,l.computeHiddenBlocks)(S,O,P);return S.map((v,C)=>{if(this.props.showDiffOnly){const _=F[C];if(_!==void 0){const D=u[_].endLine===C;if(!this.state.expandedBlocks.includes(_)&&D)return(0,t.jsx)(a.Fragment,{children:this.renderSkippedLineIndicator(u[_].lines,_,v.left.lineNumber,v.right.lineNumber)},C);if(!this.state.expandedBlocks.includes(_))return null}}return L?this.renderSplitView(v,C):this.renderInlineView(v,C)})},this.render=()=>{const{oldValue:m,newValue:b,useDarkTheme:L,leftTitle:N,rightTitle:k,splitView:E,hideLineNumbers:S,hideMarkers:O,nonce:P}=this.props;if(this.props.compareMethod!==o.DiffMethod.JSON&&(typeof m!="string"||typeof b!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,L,P);const F=this.renderDiff();let u=S?2:3,v=S?2:4;O&&(u-=1,v-=1);const C=this.props.renderGutter?1:0,j=(N||k)&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{colSpan:(E?u:v)+C,className:this.styles.titleBlock,children:(0,t.jsx)("pre",{className:this.styles.contentText,children:N})}),E&&(0,t.jsx)("td",{colSpan:u+C,className:this.styles.titleBlock,children:(0,t.jsx)("pre",{className:this.styles.contentText,children:k})})]});return(0,t.jsx)("table",{className:(0,f.default)(this.styles.diffContainer,{[this.styles.splitView]:E}),children:(0,t.jsxs)("tbody",{children:[j,F]})})},this.state={expandedBlocks:[]}}}x.defaultProps={oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:o.DiffMethod.CHARS,styles:{},hideLineNumbers:!1,hideMarkers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""},e.default=x})(K)),K}var rs=ts();const ns=br(rs);function ss({diffView:e,diffContent:r,isLoading:i,entities:n,onClose:s}){const[t,a]=q.useState(!1),[f,o]=q.useState(!1);return q.useEffect(()=>{o(!0)},[]),d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-8 z-50",children:d.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-6xl w-full max-h-[90vh] flex flex-col",children:[d.jsxs("div",{className:"p-6 border-b border-[#e1e1e1] flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"font-['IBM_Plex_Sans'] text-2xl font-semibold text-[#232323]",children:e.type==="file"?"File Diff":"Entity Diff"}),d.jsx("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e] mt-1",children:e.path}),e.type==="entity"&&e.entitySha&&d.jsxs("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e]",children:["Entity:"," ",n.find(c=>c.sha===e.entitySha)?.name||e.entitySha]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:()=>a(!t),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",title:t?"Show changes only":"Show full file",children:t?"Show Changes Only":"Show Full File"}),d.jsx("button",{onClick:s,className:"text-[#8e8e8e] hover:text-[#626262] transition-colors",children:d.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),d.jsx("div",{className:"flex-1 overflow-auto",children:i?d.jsx("div",{className:"p-6 text-center",children:d.jsx("div",{className:"text-[#8e8e8e]",children:"Loading diff..."})}):r?d.jsx("div",{className:"diff-viewer-wrapper",children:f&&d.jsx(ns,{oldValue:r.oldContent,newValue:r.newContent,splitView:!0,useDarkTheme:!1,showDiffOnly:!t,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"}}})}):d.jsx("div",{className:"p-6 text-center",children:d.jsx("div",{className:"text-[#8e8e8e]",children:"No diff available"})})}),d.jsx("div",{className:"p-6 border-t border-[#e1e1e1] flex justify-end gap-3",children:d.jsx("button",{onClick:s,className:"px-4 py-2 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] font-semibold hover:bg-[#e1e1e1] transition-colors",children:"Close"})})]})})}function is({activeTab:e,onTabChange:r,uncommittedCount:i,branchCount:n}){return d.jsx("div",{className:"border-b border-gray-200 mb-6",children:d.jsxs("nav",{className:"flex gap-8 items-center",children:[d.jsx("button",{onClick:()=>r("uncommitted"),className:`relative pb-4 px-2 text-sm font-medium transition-colors ${e==="uncommitted"?"text-[#005C75] border-b-2 border-[#005C75]":"text-gray-500 hover:text-gray-700"}`,children:d.jsxs("span",{className:"flex items-center gap-2",children:["Uncommitted Changes",i>0&&d.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="uncommitted"?"bg-[#e8f1f5] text-[#005C75]":"bg-gray-200 text-gray-700"}`,children:i})]})}),d.jsx("button",{onClick:()=>r("branch"),className:`relative pb-4 px-2 text-sm font-medium transition-colors ${e==="branch"?"text-[#005C75] border-b-2 border-[#005C75]":"text-gray-500 hover:text-gray-700"}`,children:d.jsxs("span",{className:"flex items-center gap-2",children:["Branch Changes",n>0&&d.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="branch"?"bg-[#e8f1f5] text-[#005C75]":"bg-gray-200 text-gray-700"}`,children:n})]})})]})})}function as(e,r){const n=r.match(/text-(\w+)-\d+/)?.[1]||"gray",t={green:"#15803d",gray:"#374151",orange:"#b45309",blue:"#1e40af",amber:"#b45309",purple:"#6b21a8"}[n]||"#374151";switch(e){case"✓":return d.jsx(Ar,{size:16,color:t});case"○":return d.jsx(Mr,{size:16,color:t});case"⚠":return d.jsx(Er,{size:16,color:t});case"●":return d.jsx(Dr,{size:16,color:t});case"+":return d.jsx(Br,{size:16,color:t});default:return e}}function os({entity:e,variant:r="full"}){const i=_r(e),{badge:n}=i,s=as(n.icon,n.color);return r==="icon-only"?d.jsx("span",{className:`${n.color} text-sm font-bold`,title:n.label,children:s}):r==="compact"?d.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-normal border ${n.color} ${n.bgColor} ${n.borderColor}`,title:n.label,children:d.jsx("span",{children:n.label})}):d.jsx("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-normal border ${n.color} ${n.bgColor} ${n.borderColor}`,children:d.jsx("span",{children:n.label})})}function ls({entity:e,filePath:r,impactedEntities:i,isBeingAnalyzed:n,isQueued:s,projectSlug:t,diffType:a,baseBranch:f,currentBranch:o,onGenerateSimulation:c,onShowLogs:l}){const h=e.analyses?.[0],g=h?.scenarios||[],p=h?.status?.scenarios||[];return d.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-white border border-[#e1e1e1] rounded-md transition-all hover:border-[#005c75] hover:shadow-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ce,{to:`/entity/${e.sha}`,className:"flex items-center gap-3 flex-1 min-w-0 no-underline",children:[d.jsx(Yt,{type:e.entityType}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"font-['IBM_Plex_Sans'] font-medium text-sm text-[#343434] flex items-center gap-2",children:[d.jsx("span",{children:e.name}),e.entityType==="visual"&&d.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),e.entityType==="library"&&d.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),e.entityType==="other"&&d.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"}),d.jsx(os,{entity:e,variant:"full"})]}),e.description&&d.jsx("div",{className:"font-['IBM_Plex_Sans'] text-xs text-[#8e8e8e] mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap",children:e.description})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[n&&d.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[d.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Analyzing..."]}),!n&&s&&d.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"})]})]}),(e.entityType==="visual"||e.entityType==="library")&&!n&&!s&&d.jsx("button",{onClick:x=>{x.stopPropagation(),c(e)},className:"px-3 py-1.5 bg-[#005c75] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors whitespace-nowrap",title:"Analyze this entity",children:"Analyze"}),n&&t&&d.jsx("button",{onClick:x=>{x.stopPropagation(),l(e.sha)},className:"px-3 py-1.5 bg-[#626262] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-semibold hover:bg-[#4a4a4a] transition-colors whitespace-nowrap",title:"View analysis logs",children:"📋 Logs"})]}),(e.entityType==="visual"||e.entityType==="library")&&g.length>0&&d.jsx("div",{className:"flex gap-2.5 mt-3 overflow-x-auto pb-1",children:g.map((x,w)=>{const y=x.metadata?.screenshotPaths?.[0],m=p.find(N=>N.name===x.name),b=m?.screenshotStartedAt&&!m?.screenshotFinishedAt,L=!!y;return d.jsx(Ce,{to:x.id?`/entity/${e.sha}/scenarios/${x.id}`:`/entity/${e.sha}`,className:"shrink-0 block no-underline",children:d.jsx("div",{className:"w-36 h-24 rounded-md border border-gray-200 overflow-hidden bg-gray-100 flex items-center justify-center transition-all",onMouseEnter:N=>{N.currentTarget.style.borderColor="#005C75",N.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)"},onMouseLeave:N=>{N.currentTarget.style.borderColor="#d1d5db",N.currentTarget.style.boxShadow="none"},children:L?d.jsx(er,{screenshotPath:y,alt:x.name,className:"max-w-full max-h-full object-contain"}):d.jsx("span",{className:`text-2xl ${b?"animate-pulse":"text-gray-400"}`,children:b?"⋯":"⏹️"})})},w)})})]})}function cs({files:e,entityImpactMap:r,expandedFiles:i,isEntityBeingAnalyzed:n,isEntityQueued:s,projectSlug:t,baseBranch:a,currentBranch:f,onToggleFile:o,onShowFileDiff:c,onGenerateSimulation:l,onShowLogs:h}){return d.jsx("div",{children:e.length>0?d.jsx("div",{className:"flex flex-col gap-3",children:e.map(([g,{status:p,editedEntities:x}])=>{const w=i.has(g);return d.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#306AFF"},children:[d.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>o(g),role:"button",tabIndex:0,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),o(g))},children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"w-4 inline-flex items-center justify-center shrink-0",style:{transform:w?"rotate(90deg)":"none"},children:d.jsx("svg",{width:"10",height:"12",viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M1.5 1.268L8.5 6L1.5 10.732V1.268Z",fill:w?"#3e3e3e":"#c7c7c7"})})}),d.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[d.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[d.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),d.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),d.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),d.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),d.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_784_10666",children:d.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:g}),d.jsxs("span",{className:"text-xs text-gray-500",children:[x.length," entit",x.length!==1?"ies":"y"]})]})]})}),w&&x.length>0&&d.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:x.map(y=>d.jsx(ls,{entity:y,filePath:g,impactedEntities:r.get(y.sha)||[],isBeingAnalyzed:n(y.sha),isQueued:s(y.sha),projectSlug:t,diffType:"uncommitted",baseBranch:a,currentBranch:f,onGenerateSimulation:l,onShowLogs:h},y.sha))})]},g)})}):d.jsxs("div",{className:"py-12 px-6 text-center",children:[d.jsx("div",{className:"text-6xl mb-4 opacity-50",children:"✓"}),d.jsx("p",{className:"font-['IBM_Plex_Sans'] text-lg font-semibold text-[#3e3e3e] mb-2",children:"No edited entities"}),d.jsxs("p",{className:"font-['IBM_Plex_Sans'] text-sm text-[#8e8e8e]",children:["There are no uncommitted changes.",d.jsx("br",{}),d.jsx("br",{}),"If you edit a file in the project, it will show up here."]})]})})}function ds({status:e}){const i={modified:{label:"M",bgColor:"bg-[#f59e0c]"},added:{label:"A",bgColor:"bg-emerald-500"},deleted:{label:"D",bgColor:"bg-red-500",showWarning:!0},renamed:{label:"R",bgColor:"bg-indigo-500"},untracked:{label:"U",bgColor:"bg-purple-500"}}[e]||{label:"?",bgColor:"bg-gray-500"};return d.jsxs("div",{className:"inline-flex items-center gap-1",children:[d.jsx("span",{className:`inline-flex items-center justify-center w-5 h-5 text-[11px] font-bold text-white rounded ${i.bgColor}`,title:e,children:i.label}),i.showWarning&&d.jsx("span",{className:"inline-flex items-center justify-center w-3 h-3 text-[10px] text-amber-600",title:"Warning: File will be deleted",children:"⚠"})]})}function fs({files:e,currentBranch:r,defaultBranch:i,baseBranch:n,allBranches:s,expandedFiles:t,isEntityBeingAnalyzed:a,isEntityQueued:f,isAnyAnalysisInProgress:o,isAnalyzing:c,lastLogLine:l,projectSlug:h,onToggleFile:g,onBranchChange:p,onGenerateSimulation:x,onShowLogs:w}){return e.length>0&&e.some(([y,{entities:m}])=>m.length>0),d.jsxs("div",{children:[d.jsx("div",{className:"mb-5",children:r===i?d.jsxs("p",{className:"text-sm text-gray-500",children:["Currently on the primary branch"," ",d.jsx("strong",{className:"text-gray-900 font-semibold",children:r})]}):d.jsxs("p",{className:"text-sm text-gray-500",children:["Changes in"," ",d.jsx("strong",{className:"text-gray-900 font-semibold",children:r})," ","compared to"," ",d.jsx("select",{value:n,onChange:y=>p(y.target.value),className:"py-0.5 px-2 bg-white border border-gray-300 rounded-md text-sm font-semibold text-gray-900 cursor-pointer hover:border-indigo-500",children:s.filter(y=>y!==r).map(y=>d.jsx("option",{value:y,children:y},y))})]})}),r===i?d.jsxs("div",{className:"py-12 px-6 text-center bg-blue-50 rounded-lg border border-blue-100",children:[d.jsx("div",{className:"text-6xl mb-4",children:"ℹ️"}),d.jsx("p",{className:"text-lg font-semibold text-gray-900 mb-3",children:"You're on the primary branch"}),d.jsxs("p",{className:"text-sm text-gray-600 mb-2 max-w-md mx-auto",children:["When you switch to a feature branch, this section will show all the changes between your branch and"," ",d.jsx("strong",{className:"font-semibold",children:i}),"."]}),d.jsx("p",{className:"text-sm text-gray-600 max-w-md mx-auto",children:"This helps you understand what will be included in your pull request before you create it."})]}):e.length>0?d.jsx("div",{className:"flex flex-col gap-3",children:e.map(([y,{status:m,entities:b}])=>{const L=t.has(y);return d.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#306AFF"},children:[d.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>g(y),role:"button",tabIndex:0,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),g(y))},children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"w-4 inline-flex items-center justify-center shrink-0",style:{transform:L?"rotate(90deg)":"none"},children:d.jsx("svg",{width:"10",height:"12",viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M1.5 1.268L8.5 6L1.5 10.732V1.268Z",fill:L?"#3e3e3e":"#c7c7c7"})})}),d.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[d.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[d.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),d.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),d.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),d.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),d.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_784_10666",children:d.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:y}),d.jsx(ds,{status:m.status})]}),d.jsxs("span",{className:"text-xs text-gray-500",children:[b.length," entit",b.length!==1?"ies":"y"]})]})]})}),L&&b.length>0&&d.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-2 flex flex-col gap-1.5",children:b.map(N=>{const k=a(N.sha),E=f(N.sha),S=k&&l,O=N.analyses?.[0],P=O?.scenarios||[],F=O?.status?.scenarios||[];return d.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-white border border-gray-200 rounded-md transition-all hover:border-blue-600 hover:shadow-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ce,{to:`/entity/${N.sha}`,className:"flex items-center gap-3 flex-1 min-w-0 no-underline",children:[d.jsx(Yt,{type:N.entityType}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"font-['IBM_Plex_Sans'] font-medium text-sm text-[#343434] flex items-center gap-2",children:[d.jsx("span",{children:N.name}),N.entityType==="visual"&&d.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),N.entityType==="library"&&d.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),N.entityType==="other"&&d.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"})]}),N.description&&d.jsx("div",{className:"font-['IBM_Plex_Sans'] text-xs text-[#8e8e8e] mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap",children:N.description})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[k&&d.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[d.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Analyzing..."]}),!k&&E&&d.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"})]})]}),(N.entityType==="visual"||N.entityType==="library")&&d.jsx("button",{onClick:u=>{u.stopPropagation(),x(N)},disabled:c||o||E||k,className:"px-3 py-1.5 bg-[#005c75] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors whitespace-nowrap disabled:bg-gray-400 disabled:cursor-not-allowed",title:E?"Entity is queued for analysis":k?"Entity is being analyzed":o?"Please wait for current analysis to complete":"Analyze this entity",children:k?"Analyzing...":E?"Queued":o?"Waiting...":"Analyze"}),k&&h&&d.jsx("button",{onClick:u=>{u.stopPropagation(),w(N.sha)},className:"px-3 py-1.5 bg-[#626262] text-white rounded-md text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#4a4a4a] transition-colors whitespace-nowrap",title:"View analysis logs",children:"📋 Logs"})]}),S&&d.jsxs("div",{className:"flex items-center gap-1.5 text-[13px] font-medium text-blue-600 px-2 py-1 bg-blue-50 rounded",children:[d.jsx("span",{className:"animate-spin",children:"⚙️"}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-xs max-w-full",title:l,children:l})]}),P.length>0&&d.jsx("div",{className:"flex gap-2 flex-wrap",children:P.slice(0,5).map((u,v)=>{const C=u.metadata?.screenshotPaths?.[0],j=F.find(M=>M.name===u.name),_=j?.screenshotStartedAt&&!j?.screenshotFinishedAt,D=!!C,A=kr(N)||N.metadata?.isSuperseded;return D?d.jsx(Ce,{to:`/entity/${N.sha}/scenarios/${u.id}`,className:`relative w-20 h-15 border-2 rounded overflow-hidden bg-gray-50 cursor-pointer transition-all flex items-center justify-center hover:scale-105 hover:shadow-md ${A?"border-amber-500 hover:border-amber-600":"border-gray-200 hover:border-blue-600"}`,children:d.jsx(er,{screenshotPath:C,alt:u.name,title:u.name,className:"max-w-full max-h-full object-contain object-center"})},v):d.jsx(Ce,{to:`/entity/${N.sha}/scenarios/${u.id}`,className:"w-20 h-15 border-2 border-dashed border-gray-300 rounded bg-gray-50 flex items-center justify-center text-2xl",title:`Capturing ${u.name}...`,children:d.jsx("span",{className:_?"animate-spin":"text-gray-400",children:_?"⏳":"⏹️"})},v)})})]},N.sha)})})]},y)})}):d.jsxs("div",{className:"py-12 px-6 text-center",children:[d.jsx("div",{className:"text-6xl mb-4 opacity-50",children:"✓"}),d.jsx("p",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No differences found"}),d.jsxs("p",{className:"text-sm text-gray-500",children:["This branch is up to date with ",n]})]})]})}const Ls=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],_s=wr(function(){const{entities:r,gitStatus:i,currentBranch:n,defaultBranch:s,allBranches:t,baseBranch:a,branchDiff:f,currentCommit:o,projectSlug:c,queueState:l}=jr(),[h,g]=Cr(),[p,x]=q.useState("uncommitted"),[w,y]=q.useState(null),m=h.get("expanded")==="true",b=rt(),L=b.data;q.useEffect(()=>{p==="branch"&&n&&a&&n!==a&&b.state==="idle"&&!L&&b.load(`/api/branch-entity-diff?base=${encodeURIComponent(a)}&compare=${encodeURIComponent(n)}`)},[p,n,a,b,L]);const N=q.useMemo(()=>{const T=Tr(i,r);return Array.from(T.entries()).sort((ee,Y)=>ee[0].localeCompare(Y[0]))},[i,r]),k=q.useMemo(()=>{const T=Fr(f,r,L);return Array.from(T.entries()).sort((ee,Y)=>ee[0].localeCompare(Y[0]))},[f,r,L]),E=q.useMemo(()=>Rr(i,r),[i,r]);q.useMemo(()=>{const T=k.flatMap(([ee,Y])=>Y.entities);return Ir(T,r)},[k,r]);const S=q.useMemo(()=>N.map(([T])=>T),[N]),O=q.useMemo(()=>k.map(([T])=>T),[k]),{expandedUncommitted:P,expandedBranch:F,setExpandedUncommitted:u,setExpandedBranch:v,toggleFile:C,expandAllUncommitted:j,collapseAllUncommitted:_,expandAllBranch:D,collapseAllBranch:A}=Vr(m,S,O),{diffView:M,diffContent:B,isLoading:$,handleShowFileDiff:V,handleCloseDiff:J}=qr(a,n,p),W=o?.metadata?.currentRun,X=!!W?.createdAt&&!W?.analysisCompletedAt,{lastLine:ne,isCompleted:hr}=Nr(c,X),pr=X&&!hr,lt=new Set(W?.currentEntityShas||[]),Ge=new Set(l.jobs.flatMap(T=>T.entityShas||[])),He=new Set(l.currentlyExecuting?.entityShas||[]),{isAnalyzing:We,handleGenerateSimulation:ct,handleGenerateAllSimulations:mr,isEntityBeingAnalyzed:dt}=Gr(W?.currentEntityShas),ft=T=>Ge.has(T)||He.has(T),ut=T=>{T===s?h.delete("compare"):h.set("compare",T),g(h)},gr=()=>{const ee=(p==="uncommitted"?N.flatMap(([Y,Ue])=>Ue.editedEntities):k.flatMap(([Y,Ue])=>Ue.entities)).filter(Y=>!lt.has(Y.sha)&&!Ge.has(Y.sha)&&!He.has(Y.sha));mr(ee)},ht=N.length,pt=k.length,xr=p==="uncommitted"?ht:pt,_e=(p==="uncommitted"?N.flatMap(([T,ee])=>ee.editedEntities):k.flatMap(([T,ee])=>ee.entities)).filter(T=>T.entityType==="visual"||T.entityType==="library"),ze=_e.length>0&&_e.every(T=>lt.has(T.sha)),mt=_e.length>0&&!ze&&_e.every(T=>Ge.has(T.sha)||He.has(T.sha)),gt=We||ze||mt,xt=ze?"Analyzing...":mt?"Queued...":We?"Analyzing...":"Analyze All";return d.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:d.jsxs("div",{className:"px-36 py-12",children:[d.jsxs("div",{className:"mb-8",children:[d.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Git Changes"}),d.jsx("div",{className:"flex items-center gap-4 text-sm text-gray-600 mt-2",children:n&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-xs",children:"Branch:"}),t.length>0?d.jsx("select",{value:n,onChange:T=>ut(T.target.value),className:"text-gray-900 font-medium px-2 py-1 border border-gray-300 rounded text-sm hover:border-gray-400 focus:outline-none focus:border-blue-500",style:{paddingRight:"26px",backgroundPosition:"right 6px center",backgroundRepeat:"no-repeat",backgroundSize:"16px",appearance:"none",backgroundImage:`url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e")`},children:t.map(T=>d.jsxs("option",{value:T,children:[T," ",T===s?"(default)":""]},T))}):d.jsx("span",{className:"text-gray-900 font-medium",children:n})]})})]}),d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx(is,{activeTab:p,onTabChange:x,uncommittedCount:ht,branchCount:pt}),xr>0&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:p==="uncommitted"?j:D,className:"px-3 py-1.5 text-xs font-['IBM_Plex_Sans'] font-medium text-[#626262] hover:text-cyblack-100 hover:bg-gray-100 rounded transition-colors cursor-pointer",children:"Expand All"}),d.jsx("button",{onClick:p==="uncommitted"?_:A,className:"px-3 py-1.5 text-xs font-['IBM_Plex_Sans'] font-medium text-[#626262] hover:text-cyblack-100 hover:bg-gray-100 rounded transition-colors cursor-pointer",children:"Collapse All"}),d.jsx("button",{onClick:gr,disabled:gt,className:"px-4 py-1.5 bg-[#005c75] text-white rounded text-xs font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors cursor-pointer disabled:bg-gray-400 disabled:cursor-not-allowed",title:gt?xt:`Analyze all ${p} entities`,children:xt})]})]}),d.jsxs("div",{className:"overflow-hidden",children:[p==="uncommitted"&&d.jsx(cs,{files:N,entityImpactMap:E,expandedFiles:P,isEntityBeingAnalyzed:dt,isEntityQueued:ft,projectSlug:c,baseBranch:a,currentBranch:n,onToggleFile:T=>C(T,P,u),onShowFileDiff:V,onGenerateSimulation:ct,onShowLogs:y}),p==="branch"&&n&&d.jsx(fs,{files:k,currentBranch:n,defaultBranch:s,baseBranch:a,allBranches:t,expandedFiles:F,isEntityBeingAnalyzed:dt,isEntityQueued:ft,isAnyAnalysisInProgress:pr,isAnalyzing:We,lastLogLine:ne,projectSlug:c,onToggleFile:T=>C(T,F,v),onBranchChange:ut,onGenerateSimulation:ct,onShowLogs:y})]}),M&&d.jsx(ss,{diffView:M,diffContent:B,isLoading:$,entities:r,onClose:J}),w&&c&&d.jsx(Lr,{projectSlug:c,onClose:()=>y(null)})]})})});export{_s as default,Ls as meta};