@shepai/cli 1.166.1 → 1.167.0-pr505.5cf8222

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 (406) hide show
  1. package/apis/json-schema/FeatureFlags.yaml +5 -0
  2. package/dist/packages/core/src/application/index.d.ts +1 -0
  3. package/dist/packages/core/src/application/index.d.ts.map +1 -1
  4. package/dist/packages/core/src/application/index.js +1 -0
  5. package/dist/packages/core/src/application/ports/output/agents/agent-run-repository.interface.d.ts +12 -0
  6. package/dist/packages/core/src/application/ports/output/agents/agent-run-repository.interface.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/use-cases/features/update-feature-pinned-config.use-case.d.ts +24 -0
  8. package/dist/packages/core/src/application/use-cases/features/update-feature-pinned-config.use-case.d.ts.map +1 -0
  9. package/dist/packages/core/src/application/use-cases/features/update-feature-pinned-config.use-case.js +107 -0
  10. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
  11. package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +1 -0
  12. package/dist/packages/core/src/domain/generated/output.d.ts +4 -0
  13. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  14. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/di/container.js +5 -0
  16. package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.d.ts.map +1 -1
  17. package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.js +11 -0
  18. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +1 -0
  19. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  20. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +2 -0
  21. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/050-add-feature-flag-inventory.d.ts +11 -0
  22. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/050-add-feature-flag-inventory.d.ts.map +1 -0
  23. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/050-add-feature-flag-inventory.js +17 -0
  24. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.d.ts +3 -3
  25. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.js +3 -3
  26. package/dist/packages/core/src/infrastructure/repositories/agent-run.repository.d.ts +2 -1
  27. package/dist/packages/core/src/infrastructure/repositories/agent-run.repository.d.ts.map +1 -1
  28. package/dist/packages/core/src/infrastructure/repositories/agent-run.repository.js +15 -0
  29. package/dist/packages/core/src/infrastructure/services/web-server.service.d.ts +3 -0
  30. package/dist/packages/core/src/infrastructure/services/web-server.service.d.ts.map +1 -1
  31. package/dist/packages/core/src/infrastructure/services/web-server.service.js +10 -0
  32. package/dist/src/presentation/web/app/actions/update-feature-pinned-config.d.ts +5 -0
  33. package/dist/src/presentation/web/app/actions/update-feature-pinned-config.d.ts.map +1 -0
  34. package/dist/src/presentation/web/app/actions/update-feature-pinned-config.js +29 -0
  35. package/dist/src/presentation/web/app/features/feature-tree-page-client.d.ts +7 -0
  36. package/dist/src/presentation/web/app/features/feature-tree-page-client.d.ts.map +1 -0
  37. package/dist/src/presentation/web/app/features/feature-tree-page-client.js +13 -0
  38. package/dist/src/presentation/web/app/features/get-feature-tree-data.d.ts +10 -0
  39. package/dist/src/presentation/web/app/features/get-feature-tree-data.d.ts.map +1 -0
  40. package/dist/src/presentation/web/app/features/get-feature-tree-data.js +47 -0
  41. package/dist/src/presentation/web/app/features/page.d.ts +4 -0
  42. package/dist/src/presentation/web/app/features/page.d.ts.map +1 -0
  43. package/dist/src/presentation/web/app/features/page.js +9 -0
  44. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  45. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +100 -9
  46. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +4 -1
  47. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  48. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +3 -3
  49. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts +3 -1
  50. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  51. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +21 -10
  52. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +4 -0
  53. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
  54. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +33 -0
  55. package/dist/src/presentation/web/components/common/feature-drawer-tabs/pinned-config-utils.d.ts +18 -0
  56. package/dist/src/presentation/web/components/common/feature-drawer-tabs/pinned-config-utils.d.ts.map +1 -0
  57. package/dist/src/presentation/web/components/common/feature-drawer-tabs/pinned-config-utils.js +17 -0
  58. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts.map +1 -1
  59. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.js +1 -0
  60. package/dist/src/presentation/web/components/features/feature-tree-table/feature-tree-table.d.ts +36 -0
  61. package/dist/src/presentation/web/components/features/feature-tree-table/feature-tree-table.d.ts.map +1 -0
  62. package/dist/src/presentation/web/components/features/feature-tree-table/feature-tree-table.js +196 -0
  63. package/dist/src/presentation/web/components/features/feature-tree-table/feature-tree-table.stories.d.ts +12 -0
  64. package/dist/src/presentation/web/components/features/feature-tree-table/feature-tree-table.stories.d.ts.map +1 -0
  65. package/dist/src/presentation/web/components/features/feature-tree-table/feature-tree-table.stories.js +166 -0
  66. package/dist/src/presentation/web/components/features/feature-tree-table/index.d.ts +3 -0
  67. package/dist/src/presentation/web/components/features/feature-tree-table/index.d.ts.map +1 -0
  68. package/dist/src/presentation/web/components/features/feature-tree-table/index.js +1 -0
  69. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts +2 -0
  70. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts.map +1 -1
  71. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.js +27 -0
  72. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.d.ts +10 -1
  73. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.d.ts.map +1 -1
  74. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.js +33 -25
  75. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.d.ts.map +1 -1
  76. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.js +3 -0
  77. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.d.ts.map +1 -1
  78. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.js +3 -0
  79. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  80. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +5 -0
  81. package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts.map +1 -1
  82. package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.js +1 -0
  83. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
  84. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +2 -2
  85. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts.map +1 -1
  86. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.js +1 -0
  87. package/dist/src/presentation/web/hooks/feature-flags-context.d.ts.map +1 -1
  88. package/dist/src/presentation/web/hooks/feature-flags-context.js +1 -0
  89. package/dist/src/presentation/web/lib/feature-flags.d.ts +2 -0
  90. package/dist/src/presentation/web/lib/feature-flags.d.ts.map +1 -1
  91. package/dist/src/presentation/web/lib/feature-flags.js +5 -0
  92. package/dist/translations/ar/web.json +3 -0
  93. package/dist/translations/de/web.json +3 -0
  94. package/dist/translations/en/web.json +3 -0
  95. package/dist/translations/es/web.json +3 -0
  96. package/dist/translations/fr/web.json +3 -0
  97. package/dist/translations/he/web.json +3 -0
  98. package/dist/translations/pt/web.json +3 -0
  99. package/dist/translations/ru/web.json +3 -0
  100. package/dist/tsconfig.build.tsbuildinfo +1 -1
  101. package/package.json +1 -1
  102. package/web/.next/BUILD_ID +1 -1
  103. package/web/.next/app-path-routes-manifest.json +1 -0
  104. package/web/.next/build-manifest.json +5 -5
  105. package/web/.next/fallback-build-manifest.json +2 -2
  106. package/web/.next/prerender-manifest.json +3 -3
  107. package/web/.next/required-server-files.js +3 -3
  108. package/web/.next/required-server-files.json +3 -3
  109. package/web/.next/routes-manifest.json +6 -0
  110. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +3 -3
  111. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  112. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
  113. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  114. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  115. package/web/.next/server/app/(dashboard)/@drawer/chat/page/build-manifest.json +3 -3
  116. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  117. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -1
  118. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  119. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  120. package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +3 -3
  121. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  122. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  123. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  124. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  125. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +3 -3
  126. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +89 -74
  127. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -2
  128. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  129. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  130. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +3 -3
  131. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +89 -74
  132. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -2
  133. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  134. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  135. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/build-manifest.json +3 -3
  136. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  137. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
  138. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  139. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  140. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +3 -3
  141. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  142. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  143. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  144. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  145. package/web/.next/server/app/(dashboard)/chat/page/build-manifest.json +3 -3
  146. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  147. package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
  148. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  149. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  150. package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +3 -3
  151. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  152. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  153. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  154. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  155. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +3 -3
  156. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +89 -74
  157. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -2
  158. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  159. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  160. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +3 -3
  161. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +89 -74
  162. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -2
  163. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  164. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  165. package/web/.next/server/app/(dashboard)/page/build-manifest.json +3 -3
  166. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  167. package/web/.next/server/app/(dashboard)/page.js +1 -1
  168. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  169. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  170. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/build-manifest.json +3 -3
  171. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  172. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
  173. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  174. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  175. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +3 -3
  176. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  177. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  178. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  179. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  180. package/web/.next/server/app/_global-error/page/build-manifest.json +3 -3
  181. package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  182. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  183. package/web/.next/server/app/_global-error.html +2 -2
  184. package/web/.next/server/app/_global-error.rsc +1 -1
  185. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  186. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  187. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  188. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  189. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  190. package/web/.next/server/app/_not-found/page/build-manifest.json +3 -3
  191. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  192. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  193. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  194. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  195. package/web/.next/server/app/api/attachments/upload-from-path/route.js +1 -1
  196. package/web/.next/server/app/api/attachments/upload-from-path/route.js.nft.json +1 -1
  197. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  198. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  199. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  200. package/web/.next/server/app/features/page/app-paths-manifest.json +3 -0
  201. package/web/.next/server/app/features/page/build-manifest.json +18 -0
  202. package/web/.next/server/app/features/page/next-font-manifest.json +6 -0
  203. package/web/.next/server/app/features/page/react-loadable-manifest.json +8 -0
  204. package/web/.next/server/app/features/page/server-reference-manifest.json +95 -0
  205. package/web/.next/server/app/features/page.js +18 -0
  206. package/web/.next/server/app/features/page.js.map +5 -0
  207. package/web/.next/server/app/features/page.js.nft.json +1 -0
  208. package/web/.next/server/app/features/page_client-reference-manifest.js +2 -0
  209. package/web/.next/server/app/settings/page/build-manifest.json +3 -3
  210. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  211. package/web/.next/server/app/settings/page.js +1 -1
  212. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  213. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  214. package/web/.next/server/app/skills/page/build-manifest.json +3 -3
  215. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  216. package/web/.next/server/app/skills/page.js +1 -1
  217. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  218. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  219. package/web/.next/server/app/tools/page/build-manifest.json +3 -3
  220. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  221. package/web/.next/server/app/tools/page.js +1 -1
  222. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  223. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  224. package/web/.next/server/app/version/page/build-manifest.json +3 -3
  225. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  226. package/web/.next/server/app/version/page.js.nft.json +1 -1
  227. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  228. package/web/.next/server/app-paths-manifest.json +1 -0
  229. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  230. package/web/.next/server/chunks/{[root-of-the-server]__ea653642._.js → [root-of-the-server]__a5879003._.js} +2 -2
  231. package/web/.next/server/chunks/{[root-of-the-server]__ea653642._.js.map → [root-of-the-server]__a5879003._.js.map} +1 -1
  232. package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js.map +1 -1
  233. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  234. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  235. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  236. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +3 -3
  237. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  238. package/web/.next/server/chunks/ssr/[root-of-the-server]__08c912ab._.js +3 -0
  239. package/web/.next/server/chunks/ssr/[root-of-the-server]__08c912ab._.js.map +1 -0
  240. package/web/.next/server/chunks/ssr/{[root-of-the-server]__b062b383._.js → [root-of-the-server]__0c5452c3._.js} +2 -2
  241. package/web/.next/server/chunks/ssr/[root-of-the-server]__0c5452c3._.js.map +1 -0
  242. package/web/.next/server/chunks/ssr/{[root-of-the-server]__2d0c3840._.js → [root-of-the-server]__13fa44e4._.js} +2 -2
  243. package/web/.next/server/chunks/ssr/{[root-of-the-server]__2d0c3840._.js.map → [root-of-the-server]__13fa44e4._.js.map} +1 -1
  244. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  245. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  246. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  247. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +4 -0
  248. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +1 -0
  249. package/web/.next/server/chunks/ssr/{[root-of-the-server]__dffa13c5._.js → [root-of-the-server]__69dd3217._.js} +2 -2
  250. package/web/.next/server/chunks/ssr/{[root-of-the-server]__dffa13c5._.js.map → [root-of-the-server]__69dd3217._.js.map} +1 -1
  251. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +4 -0
  252. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -0
  253. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +4 -0
  254. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -0
  255. package/web/.next/server/chunks/ssr/{[root-of-the-server]__7562afc6._.js → [root-of-the-server]__7ffd3598._.js} +3 -3
  256. package/web/.next/server/chunks/ssr/[root-of-the-server]__7ffd3598._.js.map +1 -0
  257. package/web/.next/server/chunks/ssr/{[root-of-the-server]__248ee887._.js → [root-of-the-server]__851f6adb._.js} +2 -2
  258. package/web/.next/server/chunks/ssr/[root-of-the-server]__851f6adb._.js.map +1 -0
  259. package/web/.next/server/chunks/ssr/{[root-of-the-server]__1abe77bb._.js → [root-of-the-server]__b020c17d._.js} +3 -3
  260. package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +1 -0
  261. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  262. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  263. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +4 -0
  264. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -0
  265. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +4 -0
  266. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -0
  267. package/web/.next/server/chunks/ssr/{[root-of-the-server]__8b0aac03._.js → [root-of-the-server]__e88da4ee._.js} +3 -3
  268. package/web/.next/server/chunks/ssr/{[root-of-the-server]__8b0aac03._.js.map → [root-of-the-server]__e88da4ee._.js.map} +1 -1
  269. package/web/.next/server/chunks/ssr/_0020fddd._.js +1 -1
  270. package/web/.next/server/chunks/ssr/_0020fddd._.js.map +1 -1
  271. package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
  272. package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -1
  273. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  274. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  275. package/web/.next/server/chunks/ssr/_0727935d._.js +1 -1
  276. package/web/.next/server/chunks/ssr/_0727935d._.js.map +1 -1
  277. package/web/.next/server/chunks/ssr/_0dc06d07._.js +1 -1
  278. package/web/.next/server/chunks/ssr/_0dc06d07._.js.map +1 -1
  279. package/web/.next/server/chunks/ssr/_16235e5e._.js +1 -1
  280. package/web/.next/server/chunks/ssr/_16235e5e._.js.map +1 -1
  281. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  282. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  283. package/web/.next/server/chunks/ssr/_18886033._.js +1 -1
  284. package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
  285. package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
  286. package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
  287. package/web/.next/server/chunks/ssr/_4a4709c5._.js +4 -0
  288. package/web/.next/server/chunks/ssr/_4a4709c5._.js.map +1 -0
  289. package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
  290. package/web/.next/server/chunks/ssr/_560f2971._.js +3 -0
  291. package/web/.next/server/chunks/ssr/_560f2971._.js.map +1 -0
  292. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  293. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  294. package/web/.next/server/chunks/ssr/{_0a90d28b._.js → _5c76b6b5._.js} +2 -2
  295. package/web/.next/server/chunks/ssr/{_0a90d28b._.js.map → _5c76b6b5._.js.map} +1 -1
  296. package/web/.next/server/chunks/ssr/{_a65c54ca._.js → _5f099575._.js} +2 -2
  297. package/web/.next/server/chunks/ssr/{_a65c54ca._.js.map → _5f099575._.js.map} +1 -1
  298. package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
  299. package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
  300. package/web/.next/server/chunks/ssr/_a69efc34._.js +3 -0
  301. package/web/.next/server/chunks/ssr/{_4d49a312._.js.map → _a69efc34._.js.map} +1 -1
  302. package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
  303. package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
  304. package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
  305. package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
  306. package/web/.next/server/chunks/ssr/{_05dae8d0._.js → _cac860bb._.js} +2 -2
  307. package/web/.next/server/chunks/ssr/{_05dae8d0._.js.map → _cac860bb._.js.map} +1 -1
  308. package/web/.next/server/chunks/ssr/{_506a3bc3._.js → _cc936cdc._.js} +2 -2
  309. package/web/.next/server/chunks/ssr/_cc936cdc._.js.map +1 -0
  310. package/web/.next/server/chunks/ssr/_df737cce._.js +3 -0
  311. package/web/.next/server/chunks/ssr/_df737cce._.js.map +1 -0
  312. package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
  313. package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
  314. package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
  315. package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
  316. package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
  317. package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
  318. package/web/.next/server/chunks/ssr/_f535d854._.js +3 -0
  319. package/web/.next/server/chunks/ssr/_f535d854._.js.map +1 -0
  320. package/web/.next/server/chunks/ssr/_f79e241b._.js +3 -0
  321. package/web/.next/server/chunks/ssr/{_3bcda5d7._.js.map → _f79e241b._.js.map} +1 -1
  322. package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
  323. package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
  324. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  325. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  326. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  327. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  328. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  329. package/web/.next/server/chunks/ssr/src_presentation_web_app_features_feature-tree-page-client_tsx_34c5cbbf._.js +10 -0
  330. package/web/.next/server/chunks/ssr/src_presentation_web_app_features_feature-tree-page-client_tsx_34c5cbbf._.js.map +1 -0
  331. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  332. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  333. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_page-header_index_ts_bdf4db0b._.js +3 -0
  334. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_page-header_index_ts_bdf4db0b._.js.map +1 -0
  335. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  336. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  337. package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js +1 -1
  338. package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js.map +1 -1
  339. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
  340. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
  341. package/web/.next/server/middleware-build-manifest.js +3 -3
  342. package/web/.next/server/pages/500.html +2 -2
  343. package/web/.next/server/server-reference-manifest.js +1 -1
  344. package/web/.next/server/server-reference-manifest.json +273 -195
  345. package/web/.next/static/chunks/{8c96c49aad817377.js → 110a8827583ae5bb.js} +1 -1
  346. package/web/.next/static/chunks/20f7cc98a013b11c.js +1 -0
  347. package/web/.next/static/chunks/{0b732842dcca8b8d.js → 2615825711ac4e81.js} +3 -3
  348. package/web/.next/static/chunks/2f711373a93c5bc3.css +1 -0
  349. package/web/.next/static/chunks/{ee270565c4bdb7e1.js → 328874065794ea9f.js} +2 -2
  350. package/web/.next/static/chunks/3e393d6a78b2ade4.js +1 -0
  351. package/web/.next/static/chunks/{c60d6c2b2f7b0593.js → 4ac6f8c2bb39a6e4.js} +1 -1
  352. package/web/.next/static/chunks/{44275180f9c50dbb.js → 4ba01cd71cfa981b.js} +1 -1
  353. package/web/.next/static/chunks/4cec255f2754e5ec.js +1 -0
  354. package/web/.next/static/chunks/5d4a8552d5b6a4a8.js +1 -0
  355. package/web/.next/static/chunks/5ed47e998707b519.js +8 -0
  356. package/web/.next/static/chunks/612750555eb00a6c.js +5 -0
  357. package/web/.next/static/chunks/647140fe96a7c88a.js +1 -0
  358. package/web/.next/static/chunks/68127a29d87ba43a.js +1 -0
  359. package/web/.next/static/chunks/92c8c994d9ad0c81.js +1 -0
  360. package/web/.next/static/chunks/{18e8b12721a9316e.js → 9c4927d092875708.js} +1 -1
  361. package/web/.next/static/chunks/{1cd31898fb6e763a.js → 9e2dcc66aa1e3ee7.js} +1 -1
  362. package/web/.next/static/chunks/a262ab91e9288145.js +1 -0
  363. package/web/.next/static/chunks/a825ba5207a10722.js +7 -0
  364. package/web/.next/static/chunks/c3ef3b892f7794ec.js +1 -0
  365. package/web/.next/static/chunks/c4874941c93f4f77.js +1 -0
  366. package/web/.next/static/chunks/c5b3a8430ab26648.css +1 -0
  367. package/web/.next/static/chunks/dc134f3f58cdf850.js +5 -0
  368. package/web/.next/static/chunks/{43eca8783fbc9558.js → f0183c225f31840b.js} +1 -1
  369. package/web/.next/static/chunks/f998b42b5cddafd6.js +1 -0
  370. package/web/.next/static/chunks/{turbopack-432ef324fc27240c.js → turbopack-62782e656a49f322.js} +1 -1
  371. package/web/package.json +2 -0
  372. package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js.map +0 -1
  373. package/web/.next/server/chunks/ssr/[root-of-the-server]__248ee887._.js.map +0 -1
  374. package/web/.next/server/chunks/ssr/[root-of-the-server]__563e4faf._.js +0 -4
  375. package/web/.next/server/chunks/ssr/[root-of-the-server]__563e4faf._.js.map +0 -1
  376. package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js.map +0 -1
  377. package/web/.next/server/chunks/ssr/[root-of-the-server]__821a11c1._.js +0 -4
  378. package/web/.next/server/chunks/ssr/[root-of-the-server]__821a11c1._.js.map +0 -1
  379. package/web/.next/server/chunks/ssr/[root-of-the-server]__98740ee4._.js +0 -4
  380. package/web/.next/server/chunks/ssr/[root-of-the-server]__98740ee4._.js.map +0 -1
  381. package/web/.next/server/chunks/ssr/[root-of-the-server]__b062b383._.js.map +0 -1
  382. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba9f9e11._.js +0 -4
  383. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba9f9e11._.js.map +0 -1
  384. package/web/.next/server/chunks/ssr/_3bcda5d7._.js +0 -3
  385. package/web/.next/server/chunks/ssr/_4d49a312._.js +0 -3
  386. package/web/.next/server/chunks/ssr/_506a3bc3._.js.map +0 -1
  387. package/web/.next/server/chunks/ssr/_9215e9ec._.js +0 -3
  388. package/web/.next/server/chunks/ssr/_9215e9ec._.js.map +0 -1
  389. package/web/.next/server/chunks/ssr/_b5fc318a._.js +0 -3
  390. package/web/.next/server/chunks/ssr/_b5fc318a._.js.map +0 -1
  391. package/web/.next/static/chunks/16eea21868510afd.js +0 -5
  392. package/web/.next/static/chunks/1e6609edc3367244.css +0 -1
  393. package/web/.next/static/chunks/345246551a96bdb2.js +0 -1
  394. package/web/.next/static/chunks/3deefc76ea55047c.js +0 -1
  395. package/web/.next/static/chunks/40b6bcf1a2de4a0f.js +0 -1
  396. package/web/.next/static/chunks/5fde2118133bc2bb.js +0 -1
  397. package/web/.next/static/chunks/65440524d7ee7d13.js +0 -1
  398. package/web/.next/static/chunks/672e3da3ad26005b.js +0 -1
  399. package/web/.next/static/chunks/9dbfc283af013ec1.js +0 -7
  400. package/web/.next/static/chunks/c0e13e7d1601bc5d.js +0 -1
  401. package/web/.next/static/chunks/c7e793951b20a67f.js +0 -1
  402. package/web/.next/static/chunks/d5dcf6575f5f9dd8.js +0 -5
  403. package/web/.next/static/chunks/dd52a7ae78af4f7f.js +0 -1
  404. /package/web/.next/static/{RH3NxvKaE9Efp8ZrIyCm5 → xAhPAfLhIR5KWVO7DbsJR}/_buildManifest.js +0 -0
  405. /package/web/.next/static/{RH3NxvKaE9Efp8ZrIyCm5 → xAhPAfLhIR5KWVO7DbsJR}/_clientMiddlewareManifest.json +0 -0
  406. /package/web/.next/static/{RH3NxvKaE9Efp8ZrIyCm5 → xAhPAfLhIR5KWVO7DbsJR}/_ssgManifest.js +0 -0
@@ -0,0 +1,5 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36986,e=>{"use strict";var t=e.i(20314),s=e.i(79054),a=e.i(31777);e.i(41001);var r=e.i(64780),n=e.i(31406),l=e.i(60112),i=e.i(83428),o=e.i(67669),d=e.i(24042),c=e.i(6910),u=e.i(33548),x=e.i(23925),m=e.i(37260),p=e.i(83299),h=e.i(21023);let f=(0,h.createServerReference)("60021c22ed1da1979b92fb371074a8ffd4531db81c",h.callServer,void 0,h.findSourceMapURL,"approveFeature");var g=e.i(63418),b=e.i(7493),j=e.i(21802);let v=(0,h.createServerReference)("7056aff0cd35658a0ad6cc695d5dcb073fda84879a",h.callServer,void 0,h.findSourceMapURL,"rejectFeature"),y=(0,h.createServerReference)("4041a99ef1f695f96cc2b0b91315f38f507f395602",h.callServer,void 0,h.findSourceMapURL,"getFeatureArtifact"),N=(0,h.createServerReference)("407c161cd061f13c85b40c2a05cd7dfa4350edf57d",h.callServer,void 0,h.findSourceMapURL,"getResearchArtifact"),w=(0,h.createServerReference)("403294a4a798af22189f7340d5c834435ba4c7a638",h.callServer,void 0,h.findSourceMapURL,"getMergeReviewData");var k=e.i(75921),C=e.i(8361),T=e.i(30153),S=e.i(8537),M=e.i(39443);e.i(1650);var R=e.i(11495);e.i(99348);var I=e.i(5259),P=e.i(2828);e.i(31566);var A=e.i(65104),z=e.i(8986),$=e.i(38573),E=e.i(19933),D=e.i(70471),L=e.i(51251);let F="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40";function q({loading:e,error:s,icon:a}){return e?(0,t.jsx)(i.Loader2,{className:"size-3.5 animate-spin"}):s?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-3.5"}):(0,t.jsx)(a,{className:"size-4"})}function O({actions:e,repositoryPath:a,worktreePath:r,showSpecs:n}){let[l,i]=(0,s.useState)(!1);return(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openInIde,disabled:e.ideLoading,"aria-label":"Open in IDE",children:(0,t.jsx)(q,{loading:e.ideLoading,error:e.ideError,icon:z.Code2})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openInShell,disabled:e.shellLoading,"aria-label":"Open terminal",children:(0,t.jsx)(q,{loading:e.shellLoading,error:e.shellError,icon:$.Terminal})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openFolder,disabled:e.folderLoading,"aria-label":"Open folder",children:(0,t.jsx)(q,{loading:e.folderLoading,error:e.folderError,icon:E.FolderOpen})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),n?(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openSpecsFolder,disabled:e.specsLoading,"aria-label":"Open specs",children:(0,t.jsx)(q,{loading:e.specsLoading,error:e.specsError,icon:D.FileText})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open specs"})]}):null,(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:()=>{navigator.clipboard.writeText(r??a),i(!0),setTimeout(()=>i(!1),2e3)},"aria-label":"Copy path",children:l?(0,t.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,t.jsx)(u.Copy,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:l?"Copied!":"Copy path"})]})]})})}var B=e.i(79687),U=e.i(16489),V=e.i(74294),W=e.i(3645);let H=(0,W.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),G=(0,W.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),_=(0,W.default)("file-check",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);var K=e.i(18532),Z=e.i(93192);let Q=(0,W.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var J=e.i(48109),X=e.i(38227),Y=e.i(53360);let ee=(0,W.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var et=e.i(68304);let es=(0,h.createServerReference)("401f31d69d7ce947bdb44f12c1c9b1fa6a804e5330",h.callServer,void 0,h.findSourceMapURL,"getFeaturePhaseTimings"),ea=(0,h.createServerReference)("40683d33e3500c179ebb012a3344da01529baf0c15",h.callServer,void 0,h.findSourceMapURL,"getFeaturePlan");e.i(47506);var er=e.i(2929);let en=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),el=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function ei({className:e,size:s="md",duration:r=5,...n}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,a.cn)(en({size:s}),e),...n,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),el.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}var eo=e.i(11345),ed=e.i(76016),ec=e.i(35364),eu=e.i(81846),ex=e.i(16868);let em=(0,W.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var ep=e.i(58481),eh=e.i(48306);e.i(50032);var ef=e.i(86254),eg=e.i(42076);let eb=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function ej({onReject:e,onApprove:n,approveLabel:l,approveVariant:i="default",revisionPlaceholder:o,isProcessing:d=!1,isRejecting:c=!1,children:u,chatInput:m,onChatInputChange:p}){let{t:h}=(0,r.useTranslation)("web"),f="warning"===i,g=f?ep.AlertTriangle:x.Check,b=f?"bg-orange-500/85":"bg-blue-500/85",[j,v]=(0,s.useState)(""),y=m??j,N=p??v,w=(0,C.useSoundAction)("approve"),k=d||c,[T,S]=(0,s.useState)([]),[M,R]=(0,s.useState)(!1),[I,A]=(0,s.useState)(null),[z,$]=(0,s.useState)(!1),[E,D]=(0,s.useState)(!1),[L,F]=(0,s.useState)(!1),q=y.trim().length>0,O=q?z||E&&L:!z,B=(0,s.useRef)(0),U=(0,s.useRef)(crypto.randomUUID()),V=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&D(!0),"Shift"===e.key&&F(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&D(!1),"Shift"===e.key&&F(!1)}function s(){D(!1),F(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",s)}},[]);let W=(0,s.useCallback)(async e=>{for(let t of(A(null),e)){if(t.size>0xa00000)return void A(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!eb.has(e))return void A(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();S(s=>[...s,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let s=new FormData;s.append("file",t),s.append("sessionId",U.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:s});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));S(t=>t.filter(t=>t.id!==e)),A(t.error??"Upload failed");return}let r=await a.json();S(t=>t.some(t=>t.id!==e&&t.path===r.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...r,id:e,loading:!1}:t))}catch{S(t=>t.filter(t=>t.id!==e)),A("Upload failed")}}},[]),H=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current+=1,1===B.current&&R(!0)},[]),G=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current-=1,0===B.current&&R(!1)},[]),_=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),K=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current=0,R(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&W(t)},[W]),Z=(0,s.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let s=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&s.push(t)}s.length>0&&(e.preventDefault(),W(s))},[W]),Q=(0,s.useCallback)(async()=>{try{let e=await (0,eg.pickFiles)();e&&S(t=>{let s=new Set(t.map(e=>e.path)),a=e.filter(e=>!s.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return a.length>0?[...t,...a]:t})}catch{}},[]),J=(0,s.useCallback)(e=>{S(t=>t.filter(t=>t.id!==e))},[]),X=(0,s.useCallback)((e,t)=>{S(s=>s.map(s=>s.id===e?{...s,notes:t}:s))},[]),Y=(0,s.useCallback)(()=>{N(""),S([]),A(null)},[N]),ee=(0,s.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),V.current?.requestSubmit())},[]),et="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[u,e?(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:V,onSubmit:function(t){t.preventDefault();let s=y.trim();if(O)w.play(),n(),Y();else{if(!s||!e)return;e(s,T.filter(e=>!e.loading)),Y()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":h("createDrawer.fileDropZone"),"data-drag-over":M?"true":"false",onDragEnter:H,onDragLeave:G,onDragOver:_,onDrop:K,className:(0,a.cn)("rounded-md border-2 border-transparent transition-colors",M&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(eh.Textarea,{placeholder:o??"Ask AI to revise...","aria-label":o??"Ask AI to revise...",disabled:k,value:y,onChange:e=>N(e.target.value),onKeyDown:ee,onPaste:Z,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),T.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:T.map(e=>(0,t.jsx)(ef.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>J(e.id),disabled:k,loading:e.loading,notes:e.notes,onNotesChange:t=>X(e.id,t)},e.id))}),I?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:I}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[et,"+Enter"]})," ",q?"reject":"approve"]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:Q,disabled:k,"aria-label":h("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(ex.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:h("chat.attachFiles")})]}),(0,t.jsx)("div",{onMouseLeave:()=>$(!1),children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:k,"data-testid":"drawer-action-submit",className:(0,a.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border ps-4 pe-10 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",O?`${f?"border-orange-400/60":"border-blue-400/60"} text-white`:q&&E&&!L?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:(0,a.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",b),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,a.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pe-8 transition-opacity duration-300",O?"opacity-0":"opacity-100"),children:[(0,t.jsx)(em,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,a.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",O?"opacity-100":"opacity-0"),children:[(0,t.jsx)(g,{className:"h-4 w-4 shrink-0"}),l]}),(0,t.jsx)("span",{className:(0,a.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-e-[5px] border-s ${b} transition-opacity duration-300`,!q&&!z&&"pointer-events-none opacity-0"),onMouseEnter:()=>$(!0),children:(0,t.jsx)(eo.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),f?null:(0,t.jsx)(P.TooltipContent,{side:"top",children:O?l:h("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(ec.Button,{type:"button",className:"flex-1",disabled:k,onClick:()=>{w.play(),n()},children:l})})]})}function ev({data:e,selections:r,onSelect:n,onApprove:l,onReject:i,isProcessing:o=!1,isRejecting:d=!1,showHeader:c=!1,chatInput:u,onChatInputChange:x}){let{question:m,context:p,questions:h,finalAction:f}=e,[g,b]=(0,s.useState)(0),j=(0,C.useSoundAction)("select"),v=(0,C.useSoundAction)("navigate"),y=h.length,N=g===y-1,w=h[g],k=(0,s.useMemo)(()=>Object.keys(r).length,[r]),T=(0,s.useCallback)((e,t)=>{j.play(),n(e,t),N||setTimeout(()=>b(e=>e+1),250)},[n,N,j]);return 0===y?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:m}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:p})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[g+1,". ",w.question]}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,s)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${s+1}`,className:(0,a.cn)("h-1.5 rounded-full transition-all duration-200",s===g?"bg-primary w-4":"w-1.5",s!==g&&r[e.id]?"bg-primary/50":"",s===g||r[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),b(s)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:w.options.map((e,s)=>{let n=r[w.id]===e.id,l=String.fromCharCode(65+s);return(0,t.jsx)("button",{type:"button",className:(0,a.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-start text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",n&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:o,onClick:()=>T(w.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[l,"."]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:e.label}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]}),e.recommended||e.isNew?(0,t.jsx)("div",{className:"shrink-0 pt-0.5",children:e.recommended?(0,t.jsx)(eu.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,t.jsx)(eu.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(ec.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===g||o,onClick:()=>{v.play(),b(e=>e-1)},children:[(0,t.jsx)(eo.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),N?null:(0,t.jsxs)(ec.Button,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>{v.play(),b(e=>e+1)},children:[r[w.id]?"Next":"Skip",(0,t.jsx)(ed.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,t.jsx)(ej,{onReject:i,onApprove:()=>l(f.id),approveLabel:f.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:o,isRejecting:d,chatInput:u,onChatInputChange:x,children:(0,t.jsx)("div",{className:(0,a.cn)("bg-muted h-1.5 overflow-hidden",k>0&&k<y||o?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:o?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${y>0?k/y*100:0}%`},"data-testid":"progress-bar"})})})]})}var ey=e.i(427);let eN=(0,W.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),ew={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:s})=>s?(0,t.jsx)("code",{className:`${s} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 ps-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 ps-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:s})=>(0,t.jsx)("a",{href:s,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function ek({decision:e,index:a}){let[r,n]=(0,s.useState)(!1),l=(0,C.useSoundAction)("expand"),i=(0,C.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:a+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(eu.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(ey.default,{components:ew,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{r?i.play():l.play(),n(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(ed.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${r?"rotate-90":""}`}),(0,t.jsx)(ee,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),r?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function eC({data:e}){let{summary:s,decisions:a}=e;return 0===a.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),s?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(eN,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),a.map((e,s)=>(0,t.jsx)(ek,{decision:e,index:s},e.title))]})}var eT=e.i(41698);function eS({item:e,index:s}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:s+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(eu.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function eM({data:e}){let{questions:s}=e;return 0===s.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eT.ClipboardList,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),s.map((e,s)=>(0,t.jsx)(eS,{item:e,index:s},e.question))]})}var eR=e.i(30702);let eI=(0,W.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var eP=e.i(48923),eA=e.i(49228);let ez=(0,W.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),e$=(0,W.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]),eE=(0,W.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var eD=e.i(81181),eL=e.i(99105),eF=e.i(35e3),eq=e.i(30090),eq=eq,eO=e.i(17406);function eB({status:e}){switch(e){case eO.CiStatus.Success:return(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(eF.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case eO.CiStatus.Pending:return(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(i.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case eO.CiStatus.Failure:return(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(eq.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}var eU=e.i(12919);let eV=(0,W.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);var eW=e.i(35749);let eH={added:{icon:eU.FilePlus,label:"A",className:"text-green-600"},modified:{icon:eW.FileEdit,label:"M",className:"text-amber-600"},deleted:{icon:eV,label:"D",className:"text-red-600"},renamed:{icon:eW.FileEdit,label:"R",className:"text-blue-600"}};function eG({status:e}){let s=eH[e],r=s.icon;return(0,t.jsx)(r,{className:(0,a.cn)("h-3.5 w-3.5 shrink-0",s.className)})}function e_({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,a.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,a.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pe-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function eK({file:e}){let[r,n]=(0,s.useState)(!1),l=e.path.split("/").pop()??e.path,i=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>n(!r),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,t.jsx)(ed.ChevronRight,{className:(0,a.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",r&&"rotate-90")}),(0,t.jsx)(eG,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[i,"/"]}),l]}):l}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),r&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(e_,{hunk:e},e.header))}):null]})}function eZ({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(D.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(eK,{file:e},`${e.status}-${e.path}`))})]})}let eQ={Screenshot:e$,Video:eE,TestOutput:D.FileText,TerminalRecording:$.Terminal},eJ=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),eX=new Set([".mp4",".webm",".mov"]);function eY({evidence:e}){var a,r;let n,[l,i]=(0,s.useState)(!0),o=eQ[e.type]??e$,d=(n=(a=e.relativePath).lastIndexOf("."))>=0?a.slice(n).toLowerCase():"",c=(r=e.relativePath,`/api/evidence?path=${encodeURIComponent(r)}`),u="Screenshot"===e.type||eJ.has(d),x="Video"===e.type||eX.has(d),m="TestOutput"===e.type||"TerminalRecording"===e.type;return(0,t.jsxs)("li",{className:"border-border rounded-md border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!l),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-start",children:[l?(0,t.jsx)(eL.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,t.jsx)(ed.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.description}),e.taskRef?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1.5 text-[10px]",children:["(",e.taskRef,")"]}):null]}),(0,t.jsx)("a",{href:c,download:!0,onClick:e=>e.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,t.jsx)(eD.Download,{className:"h-3 w-3"})})]}),l&&c?(0,t.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:u?(0,t.jsx)("img",{src:c,alt:e.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):x?(0,t.jsx)("video",{src:c,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,t.jsx)("track",{kind:"captions"})}):m?(0,t.jsx)(e0,{url:c}):(0,t.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:e.relativePath})}):null,null]})}function e0({url:e}){let[a,r]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1);return n?a?(0,t.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:a}):(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(e).then(e=>e.ok?e.text():Promise.reject(Error("Failed"))).then(e=>{let t=e.split("\n");r(t.length>100?`${t.slice(0,100).join("\n")}
2
+ ...`:e)}).catch(()=>r(null)).finally(()=>l(!0)),(0,t.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function e1({evidence:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(e$,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,t.jsx)(eu.Badge,{variant:"secondary",className:"text-[10px]",children:e.length})]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(eY,{evidence:e},`${e.type}-${e.relativePath}`))})]})})}function e2({data:e,readOnly:s=!1,onApprove:a,onReject:r,isProcessing:n=!1,isRejecting:l=!1,chatInput:i,onChatInputChange:o}){let{pr:d,diffSummary:c,fileDiffs:u,branch:x,warning:m,evidence:p,hideCiStatus:h}=e,f=d?.mergeable===!1,g=f&&r?()=>r("Resolve merge conflicts",[]):a;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:s?"Merge History":"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s?"This feature was merged. Review the pull request details and evidence below.":d?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),x?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(eA.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(eu.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:x.source}),(0,t.jsx)(ez,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(eu.Badge,{variant:"outline",className:"font-mono text-[11px]",children:x.target})]})}):null,d?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",d.number,(0,t.jsx)(eR.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(eu.Badge,{variant:"outline",className:"text-xs",children:d.status})]}),!1===d.mergeable?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(ep.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,d.ciStatus&&!0!==h?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(eB,{status:d.ciStatus})]}):null,d.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eP.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:d.commitHash.slice(0,7)})]})]}):null]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(eI,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",c.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",c.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):m?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(ep.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:m})]})}):null,p&&p.length>0?(0,t.jsx)(e1,{evidence:p}):null,u&&u.length>0?(0,t.jsx)(eZ,{fileDiffs:u}):null]}),!s&&(0,t.jsx)(ej,{onReject:r,onApprove:g,approveLabel:f?"Resolve Conflicts":"Approve Merge",approveVariant:f?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:n,isRejecting:l,chatInput:i,onChatInputChange:o})]})}var e5=e.i(55016);let e3=(0,W.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]),e4=(0,W.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var e6=e.i(59311),e8=e.i(39200);let e9=(0,W.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var e7=e.i(60253),te=e.i(2287),tt=e.i(28267),ts=e.i(80436);let ta=(0,W.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),tr=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function tn(e){let t=e.lastIndexOf(".");return t>=0&&tr.has(e.slice(t).toLowerCase())}function tl(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",s=tn(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",a=new URLSearchParams({path:e,...s&&{mimeType:s}});return`/api/attachments/preview?${a.toString()}`}let ti=/(?:^|\s)@(\/[^\s]+)/g;function to({text:e,attachmentPaths:s}){let a=function(e){let t=[],s=0;for(let a of e.matchAll(ti)){let r=a.index,n=r+(a[0].length-a[0].trimStart().length);n>s&&t.push({type:"text",value:e.slice(s,n)}),t.push({type:"attachment",path:a[1]}),s=r+a[0].length}return s<e.length&&t.push({type:"text",value:e.slice(s)}),t}(e),r=a.some(e=>"attachment"===e.type),n=s?.filter(Boolean)??[];return r||0!==n.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[a.map(e=>{if("text"===e.type){let s=e.value.trim();return s?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:s},`text-${s.slice(0,40)}`):null}return(0,t.jsx)(td,{path:e.path},`att-${e.path}`)}),n.map(e=>(0,t.jsx)(td,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function td({path:e}){let a=e.split("/").pop()??e,[r,n]=(0,s.useState)(!1);return tn(e)?r?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(ta,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}):(0,t.jsxs)(te.Dialog,{children:[(0,t.jsx)(te.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:tl(e),alt:a,"data-testid":"inline-attachment-image",onError:()=>n(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(te.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(tt.VisuallyHidden.Root,{children:(0,t.jsxs)(te.DialogTitle,{children:["Preview: ",a]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:tl(e),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:a})}),(0,t.jsx)("a",{href:tl(e),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,t.jsx)(ts.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:tl(e),download:a,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:a})}e.i(81803);var tc=e.i(72714),tu=e.i(41413),tx=e.i(86782),tm=e.i(29847);function tp(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let s=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return s>0?`${s}h ${a}m`:a>0?`${a}m ${r}s`:`${r}s`}let th=new Set(["pending","action-required","error"]);function tf(e){return e?.agentType?{agentType:e.agentType,modelId:e.modelId??""}:null}function tg({icon:e,title:s,children:a}){return(0,t.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,t.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,t.jsx)(e,{className:"size-4 opacity-50"}),s]}),a]})}function tb({children:e,className:s}){return(0,t.jsx)("div",{className:(0,a.cn)("bg-muted/60 rounded-md border border-transparent p-3",s),children:e})}function tj({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,t.jsx)("span",{className:"text-sm leading-snug",children:s})]})}function tv({on:e,label:s}){return(0,t.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium",e?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-foreground/[0.04] text-foreground/25"),children:[e?(0,t.jsx)(x.Check,{className:"size-3"}):(0,t.jsx)(e7.X,{className:"size-3"}),s]})}let ty={[eO.PrStatus.Open]:"text-blue-600 dark:text-blue-400",[eO.PrStatus.Merged]:"text-purple-600 dark:text-purple-400",[eO.PrStatus.Closed]:"text-red-600 dark:text-red-400"};function tN({data:e,pinnedConfig:r,syncStatus:n,syncLoading:l,syncError:i,onRefreshSync:o,onRebaseOnMain:d,rebaseLoading:c,rebaseError:u}){var x;let m,p,h,f,g,b,j="maintain"===e.lifecycle,v=function(e){let[t,a]=(0,s.useState)(null),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>e?(a(tp(Math.max(0,Date.now()-e))),r.current=setInterval(()=>{a(tp(Math.max(0,Date.now()-e)))},1e3),()=>{r.current&&clearInterval(r.current)}):void a(null),[e]),t}("running"===e.state||"action-required"===e.state?e.startedAt:void 0),y=er.featureNodeStateConfig[e.state],N=!!e.summary&&!(e.userQuery&&e.summary?.trim()===e.userQuery.trim());return(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"pb-4",children:[!j&&e.progress>0?(0,t.jsx)("div",{"data-testid":"feature-drawer-progress",className:"px-3 pb-2",children:(0,t.jsx)("div",{className:"bg-foreground/[0.06] h-1.5 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,a.cn)("h-full rounded-full transition-all",y.progressClass),style:{width:`${e.progress}%`}})})}):null,e.oneLiner||e.userQuery||N?(0,t.jsx)(tg,{icon:e4,title:"Description",children:(0,t.jsxs)(tb,{className:"flex flex-col gap-2",children:[e.oneLiner?(0,t.jsx)(tj,{label:"One-Liner",children:e.oneLiner}):null,e.userQuery?(0,t.jsx)(tj,{label:"Query",children:(0,t.jsx)(to,{text:e.userQuery})}):null,N?(0,t.jsx)(tj,{label:"Summary",children:(0,t.jsx)("span",{className:"leading-snug",children:e.summary})}):null]})}):null,e.pr?(0,t.jsx)(tg,{icon:eP.GitCommitHorizontal,title:"Pull Request",children:(0,t.jsx)(tb,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("a",{href:e.pr.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1 text-sm font-semibold hover:underline",children:["#",e.pr.number," ",(0,t.jsx)(eR.ExternalLink,{className:"size-3"})]}),(0,t.jsx)("span",{className:(0,a.cn)("text-xs font-semibold",ty[e.pr.status]),children:e.pr.status}),!1===e.pr.mergeable?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-orange-600 dark:text-orange-400",children:[(0,t.jsx)(ep.AlertTriangle,{className:"size-3 shrink-0"})," Conflicts"]}):null,e.pr.ciStatus&&!0!==e.hideCiStatus?(0,t.jsx)(eB,{status:e.pr.ciStatus}):null,e.pr.commitHash?(0,t.jsx)("code",{className:"text-foreground/40 ml-auto font-mono text-[11px]",children:e.pr.commitHash.slice(0,7)}):null]})})}):null,(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pb-1",children:[e.branch?(0,t.jsx)(tb,{children:(0,t.jsxs)(tj,{label:"Branch",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(eA.GitBranch,{className:"text-foreground/30 size-3 shrink-0"}),(0,t.jsx)("code",{className:"font-mono text-[11px]",children:e.branch})]}),e.baseBranch?(0,t.jsxs)("span",{className:"text-foreground/30 block text-[10px]",children:["from ",e.baseBranch]}):null]})}):null,e.agentType||e.modelId?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:"Agent",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[e.agentType?(m=(0,tx.getAgentTypeIcon)(e.agentType),(0,t.jsx)(m,{className:"size-3.5 shrink-0 opacity-50"})):null,e.agentType?(0,t.jsx)("span",{children:tx.agentTypeLabels[e.agentType]??e.agentType}):null,e.agentType&&e.modelId?(0,t.jsx)("span",{className:"text-foreground/20",children:"/"}):null,e.modelId?(0,t.jsx)("span",{className:"text-foreground/50 text-[12px]",children:(0,tm.getModelMeta)(e.modelId).displayName||e.modelId}):null]})})}):null,e.createdAt?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:"Created",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(e5.Clock,{className:"text-foreground/30 size-3 shrink-0"}),(x=e.createdAt,p=Date.now(),(b=Math.floor((g=Math.floor((f=Math.floor((p-(h="string"==typeof x?new Date(x).getTime():x))/6e4))/60))/24))>30?new Date(h).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):b>0?`${b}d ago`:g>0?`${g}h ago`:f>0?`${f}m ago`:"just now")]})})}):null,e.fastMode?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:"Mode",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(Y.Zap,{className:"size-3.5"})," Fast"]})})}):null,e.runtime||v?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:e.runtime?"Runtime":"Elapsed",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(e5.Clock,{className:"text-foreground/30 size-3 shrink-0"}),e.runtime??v]})})}):null]}),e.blockedBy||e.errorMessage?(0,t.jsx)(tg,{icon:ep.AlertTriangle,title:"Issues",children:(0,t.jsxs)(tb,{className:"border-destructive/20 bg-destructive/5",children:[e.blockedBy?(0,t.jsx)(tj,{label:"Blocked By",children:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(tj,{label:"Error",children:(0,t.jsx)("span",{className:"text-destructive",children:e.errorMessage})}):null]})}):null,d&&e.branch&&o?(0,t.jsx)(tg,{icon:e6.RefreshCw,title:"Branch Sync",children:(0,t.jsx)(tw,{syncStatus:n??null,syncLoading:l??!1,syncError:i??null,onRefreshSync:o,onRebaseOnMain:d,rebaseLoading:c??!1,rebaseError:u??null})}):null,(0,t.jsx)(tC,{data:e,pinnedConfig:r})]})}function tw({syncStatus:e,syncLoading:s,syncError:n,onRefreshSync:l,onRebaseOnMain:i,rebaseLoading:o,rebaseError:d}){let{t:c}=(0,r.useTranslation)("web"),u=null!=e&&e.behind>0,x=e?.behind===0,m=e?.baseBranch??"main";return(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-1.5 text-[13px]",children:s&&!e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{size:"sm"}),(0,t.jsx)("span",{className:"text-foreground/40",children:"Checking..."})]}):n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ep.AlertTriangle,{className:"size-3.5 text-red-500"}),(0,t.jsx)("span",{className:"text-destructive text-xs",children:n})]}):o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{size:"sm"}),(0,t.jsxs)("span",{children:["Rebasing on ",(0,t.jsx)("code",{className:"font-mono text-[11px]",children:m}),"..."]})]}):u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ep.AlertTriangle,{className:"size-3.5 text-orange-500"}),(0,t.jsxs)("span",{children:[e.behind," behind ",(0,t.jsx)("code",{className:"font-mono text-[11px]",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",e.ahead," ahead"]}):null]})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eF.CheckCircle2,{className:"size-3.5 text-green-500"}),(0,t.jsxs)("span",{children:["Up to date · ",(0,t.jsx)("code",{className:"font-mono text-[11px]",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",e.ahead," ahead"]}):null]})]}):null}),(e||n)&&!o?(0,t.jsx)("button",{onClick:l,disabled:s,className:"text-foreground/30 hover:text-foreground/60 hover:bg-foreground/5 inline-flex size-6 items-center justify-center rounded-sm disabled:opacity-50","aria-label":c("branchSyncStatus.refreshSyncStatus"),children:(0,t.jsx)(e6.RefreshCw,{className:(0,a.cn)("size-3",s&&"animate-spin")})}):null]}),u&&!o?(0,t.jsx)("div",{className:"pt-2",children:(0,t.jsx)(tc.ActionButton,{label:c("branchSyncStatus.rebaseOnMain"),onClick:i,loading:!1,error:!!d,icon:Q,variant:"outline",size:"sm"})}):null,d?(0,t.jsx)("p",{className:"text-destructive pt-1 text-[11px]",children:d}):null]})}function tk({pinnedConfig:e}){let s=(0,tx.getAgentTypeIcon)(e.agentType),a=e.modelId?(0,tm.getModelMeta)(e.modelId).displayName||e.modelId:"No model selected";return(0,t.jsxs)(tb,{"data-testid":"feature-pinned-config-card",className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-foreground/40 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(e8.Settings,{className:"size-3"})," Pinned Execution"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(s,{className:"size-4 shrink-0 opacity-60"}),(0,t.jsx)("span",{className:"font-medium",children:tx.agentTypeLabels[e.agentType]??e.agentType}),(0,t.jsx)("span",{className:"text-foreground/20",children:"/"}),(0,t.jsx)("span",{className:"text-foreground/60",children:a})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Change the pinned agent and model before the next start, approval, or retry."})]}),(0,t.jsx)(tu.AgentModelPicker,{initialAgentType:e.agentType,initialModel:e.modelId,agentType:e.agentType,model:e.modelId,onSave:e.onSave,saveError:e.error,saving:e.saving,disabled:e.saving,mode:"settings"})]})}function tC({data:e,pinnedConfig:s}){var a;let r=null!=e.approvalGates||null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.enableEvidence||null!=e.forkAndPr||null!=e.commitSpecs,n=null!=s&&(a=e.state,th.has(a));return r||n?(0,t.jsx)(tg,{icon:e8.Settings,title:"Settings",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[n?(0,t.jsx)(tk,{pinnedConfig:s}):null,r?(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[e.approvalGates?(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(e9,{className:"size-3"})," Approve"]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(tv,{on:e.approvalGates.allowPrd,label:"PRD"}),(0,t.jsx)(tv,{on:e.approvalGates.allowPlan,label:"Plan"}),(0,t.jsx)(tv,{on:e.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=e.enableEvidence?(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(e3,{className:"size-3"})," Evidence"]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(tv,{on:e.enableEvidence,label:"Collect"}),null!=e.commitEvidence?(0,t.jsx)(tv,{on:e.commitEvidence,label:"Add to PR"}):null]})]}):null,null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.commitSpecs||null!=e.forkAndPr?(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(eA.GitBranch,{className:"size-3"})," Git"]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[null!=e.push?(0,t.jsx)(tv,{on:e.push,label:"Push"}):null,null!=e.openPr?(0,t.jsx)(tv,{on:e.openPr,label:"PR"}):null,null!=e.ciWatchEnabled?(0,t.jsx)(tv,{on:e.ciWatchEnabled,label:"Watch"}):null,null!=e.commitSpecs?(0,t.jsx)(tv,{on:e.commitSpecs,label:"Specs"}):null,null!=e.forkAndPr?(0,t.jsx)(tv,{on:e.forkAndPr,label:"Fork"}):null]})]}):null]}):null]})}):null}let tT=(0,W.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var eq=eq,tS=e.i(94819),tM=e.i(58860);let tR=(0,W.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),tI=(0,W.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function tP(e,t){if(null!=e.durationMs&&e.durationMs>0)return e.durationMs;if(!e.completedAt&&e.startedAt){let s=new Date(e.startedAt).getTime();if(!Number.isNaN(s))return Math.max(0,t-s)}return 0}function tA(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function tz(e){let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function t$(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`}let tE={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},tD={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:d.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:X.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:eF.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:eq.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:c.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:eq.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:tS.Ban}};function tL(e){return e.startsWith("run:")}function tF({timings:e,loading:a,error:n,rejectionFeedback:l}){let{t:o}=(0,r.useTranslation)("web"),d=function(e){let[t,a]=(0,s.useState)(Date.now),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>(e&&e.some(e=>!e.phase.startsWith("run:")&&!e.completedAt&&e.startedAt)&&(r.current=setInterval(()=>a(Date.now()),1e3)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[e]),t}(e);if(a)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(n)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(e5.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-base",children:o("activityTab.noActivityRecorded")})]});let c=e.filter(e=>!tL(e.phase)),u=Math.max(...c.map(e=>tP(e,d)),...c.map(e=>e.approvalWaitMs??0),0),x=function(e,t){if(!e.length)return[];let s=e.filter(e=>"run:rejected"===e.phase).length,a=t?.length??0,r=e;if(a>s){r=[...e];let n=e[e.length-1].agentRunId;for(let e=s;e<a;e++){let a=t[e];e>s&&r.push({agentRunId:n,phase:"run:resumed",startedAt:a.timestamp??`synthetic-resumed-${e}`}),r.push({agentRunId:n,phase:"run:rejected",startedAt:a.timestamp??`synthetic-${e}`})}}let n=[],l=[],i=0;for(let e of r)if(l.push(e),"run:rejected"===e.phase){let e=t?.[i];n.push({number:n.length+1,timings:l,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),l=[],i++}return l.length>0&&n.push({number:n.length+1,timings:l}),n}(e,l),m=x.length>1,p=c.reduce((e,t)=>e+tP(t,d),0),h=c.reduce((e,t)=>e+(t.approvalWaitMs??0),0),f=c.reduce((e,t)=>e+(t.inputTokens??0),0),g=c.reduce((e,t)=>e+(t.outputTokens??0),0),b=c.reduce((e,t)=>e+(t.costUsd??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:x.map(e=>(0,t.jsx)(tq,{iteration:e,showHeader:m,maxDurationMs:u,now:d},e.number))}),p>0?(0,t.jsx)(tV,{totalExecMs:p,totalWaitMs:h,totalInputTokens:f,totalOutputTokens:g,totalCostUsd:b}):null]})}function tq({iteration:e,showHeader:s,maxDurationMs:a,now:r}){let n=function(e){let t=[...e.timings].reverse().find(e=>tL(e.phase));if(!t)return null;switch(t.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(e);return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[s?(0,t.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",e.number]}),n?(0,t.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${n.colorClass}`,children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n.dotClass}`}),n.label]}):null]}):null,(0,t.jsxs)("div",{className:"relative flex flex-col",children:[(0,t.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),e.timings.map((s,n)=>{if(tL(s.phase)){let a,r="run:rejected"===s.phase,l="run:failed"===s.phase||"run:crashed"===s.phase||"run:stopped"===s.phase;if(r)a=e.rejectionMessage;else if(l){let t=[...e.timings].reverse().find(e=>!tL(e.phase)&&e.errorMessage);a=t?.errorMessage??s.errorMessage}return(0,t.jsx)(tO,{timing:s,message:a,attachments:r?e.rejectionAttachments:void 0,isFirst:0===n,isLast:n===e.timings.length-1},`${s.agentRunId}-${s.phase}-${s.startedAt}`)}return(0,t.jsx)(tB,{timing:s,maxDurationMs:a,now:r},`${s.agentRunId}-${s.phase}-${s.startedAt}`)})]})]})}function tO({timing:e,message:s,attachments:a,isFirst:r,isLast:n}){let l,i=tD[e.phase];if(!i)return null;let o=a&&a.length>0,d=i.icon;return(0,t.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${r?"pt-2":"pt-1"} ${n?"pb-2":"pb-1"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${i.bgClass}`,children:(0,t.jsx)(d,{className:`h-3 w-3 ${i.colorClass}`})}),(0,t.jsx)("span",{className:`text-sm font-medium ${i.colorClass}`,children:i.label}),e.startedAt&&!("string"==typeof e.startedAt&&e.startedAt.startsWith("synthetic"))?(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:tz(String(e.startedAt))}):null]}),s?(l="run:failed"===e.phase||"run:crashed"===e.phase||"run:stopped"===e.phase,(0,t.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${l?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[l?(0,t.jsx)(B.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,t.jsx)(J.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,t.jsxs)("span",{"data-testid":l?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",s]})]})):null,o?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,t.jsx)(to,{text:"",attachmentPaths:a})}):null]})}function tB({timing:e,maxDurationMs:a,now:n}){let{t:l}=(0,r.useTranslation)("web"),i=e.phase.includes(":")?e.phase.split(":")[0]:e.phase,o=e.phase.includes(":")?e.phase.split(":")[1]:null,d=null!==o,c=o?.startsWith("phase-")??!1,m=tE[i]??i,p=c?`Phase ${o.replace("phase-","")}`:null!==o?`${m} #${o}`:m,h=tP(e,n),f=!e.completedAt&&!!e.startedAt,g=f?15:2,b=a>0?Math.max(g,h/a*100):g,j=e.completedAt?c?"bg-emerald-400":d?"bg-amber-500":"bg-emerald-500":"bg-blue-500",v=null!=e.inputTokens||null!=e.outputTokens?(e.inputTokens??0)+(e.outputTokens??0):null,[y,N]=(0,s.useState)(!1),w=(0,s.useCallback)(()=>{e.prompt&&navigator.clipboard.writeText(e.prompt).then(()=>{N(!0),setTimeout(()=>N(!1),1500)})},[e.prompt]);return(0,t.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${d?"ms-4":""}`,children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:`rounded-full ${f?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${f?"bg-blue-500":e.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,t.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${d?"text-muted-foreground":"text-foreground/80"}`,children:p}),e.prompt?(0,t.jsx)("button",{type:"button",onClick:w,className:"text-muted-foreground/50 hover:text-foreground/70 -ms-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:l("activityTab.copyPromptToClipboard"),children:y?(0,t.jsx)(x.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(u.Copy,{className:"h-3.5 w-3.5"})}):null,(0,t.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${d?"h-1.5":"h-2"}`,children:f?(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${j}`,style:{width:`${Math.min(b,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-sm font-medium tabular-nums",children:tp(h)})]}),(0,t.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[e.startedAt?(0,t.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:tz(e.startedAt)}):null,null!=v&&v>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(Y.Zap,{className:"h-3 w-3 opacity-50"}),tA(v)]}):null,null!=e.costUsd&&e.costUsd>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(tT,{className:"h-3 w-3 opacity-50"}),t$(e.costUsd)]}):null]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(tU,{timing:e,maxDurationMs:a}):null]})}function tU({timing:e,maxDurationMs:s}){let a=e.approvalWaitMs??0,r=s>0?Math.max(2,a/s*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,t.jsx)(tM.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(r,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-xs tabular-nums",children:tp(a)})]})}function tV({totalExecMs:e,totalWaitMs:s,totalInputTokens:a,totalOutputTokens:n,totalCostUsd:l}){let{t:i}=(0,r.useTranslation)("web"),o=a+n;return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,t.jsx)(tW,{icon:e5.Clock,label:i("activityTab.execution"),value:tp(e)}),(0,t.jsx)(tW,{icon:tM.Timer,label:i("activityTab.wait"),value:s>0?tp(s):"n/a"}),(0,t.jsx)(tW,{icon:e5.Clock,label:"Wall-clock",value:s>0?tp(e+s):tp(e)}),(0,t.jsx)(tW,{icon:tT,label:i("activityTab.cost"),value:l>0?t$(l):"n/a"}),(0,t.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(Y.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),o>0?(0,t.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,t.jsx)("span",{children:tA(o)}),(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tR,{className:"h-3 w-3 text-blue-500 opacity-60"}),tA(a)]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tI,{className:"h-3 w-3 text-emerald-500 opacity-60"}),tA(n)]})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function tW({icon:e,label:s,value:a,className:r=""}){let n="n/a"===a;return(0,t.jsxs)("div",{className:`flex flex-col gap-0.5 ${r}`,children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(e,{className:"h-3 w-3 opacity-40"}),s]}),(0,t.jsx)("span",{className:`text-sm tabular-nums ${n?"text-muted-foreground/40 italic":""}`,children:a})]})}var tH=e.i(7311),tG=e.i(44229);let t_=(0,W.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),tK=(0,W.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),tZ=(0,W.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),tQ=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,tJ=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function tX(e){let t=e.match(tQ);if(!t)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:e,raw:e};let[,s,a,r,n,l]=t,i=null,o=null,d=null,c=l??"";if(null!=r&&null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null,c=`[${r}] ${l??""}`}else i=a,o=r,d=n??null;else if(null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null}else i=a;let u=c.match(tJ),x="info";return u&&(x=u[1].toLowerCase(),c=u[2]),{timestamp:s??null,phase:i,agent:o,model:d,tag:x,message:c.trim(),raw:e}}function tY({content:e}){let a=(0,s.useMemo)(()=>e?e.split("\n").filter(e=>e.trim().length>0).map(tX):[],[e]);return 0===a.length?null:(0,t.jsx)("div",{className:"flex flex-col",children:a.map((e,s)=>(0,t.jsx)(t0,{line:e},s))})}function t0({line:e}){switch(e.tag){case"tool":return(0,t.jsx)(t5,{line:e});case"tool-result":return(0,t.jsx)(t7,{line:e});case"text":case"delta":return(0,t.jsx)(t4,{line:e});case"result":return(0,t.jsx)(t6,{line:e});case"tokens":case"turn":return(0,t.jsx)(t8,{line:e});case"cmd":return(0,t.jsx)(se,{line:e});case"file":return(0,t.jsx)(st,{line:e});case"thread":case"event":case"info":return(0,t.jsx)(sa,{line:e});case"error":return(0,t.jsx)(ss,{line:e});case"worker":return(0,t.jsx)(t9,{line:e});default:return(0,t.jsx)(sr,{line:e})}}function t1({value:e}){if(!e)return null;let s=e.replace(/^.*T/,"").replace("Z",""),a=s.split(":"),r=a.length>=3?`${a[1]}:${a[2].split(".")[0]}`:s;return(0,t.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:r})}function t2({phase:e}){return e?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:e,children:e}):(0,t.jsx)("span",{className:"w-20 shrink-0"})}function t5({line:e}){var s;let a,{toolName:r,args:n}=-1===(a=(s=e.message).indexOf(" "))?{toolName:s,args:""}:{toolName:s.slice(0,a),args:s.slice(a+1)},l=function(e,t){try{let s=JSON.parse(t);if("Read"===e&&s.file_path||"Write"===e&&s.file_path||"Edit"===e&&s.file_path)return s.file_path;if("Glob"===e&&s.pattern||"Grep"===e&&s.pattern)return s.pattern;if("Bash"===e&&s.command)return s.command;if("Task"===e&&s.description)return s.description}catch{if(t.length>0)return t}return null}(r,n);return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(t3,{toolName:r}),(0,t.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:r}),l?(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:l}):null]})]})}function t3({toolName:e}){let s=e.toLowerCase();return"bash"===s?(0,t.jsx)($.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===s||"glob"===s||"grep"===s?(0,t.jsx)(D.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===s||"edit"===s?(0,t.jsx)(tZ,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,t.jsx)($.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function t4({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(J.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,t.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:e.message})]})]})}function t6({line:e}){var s;let a,r,{chars:n}=(a=(s=e.message).match(/^(\d+)\s+chars/),r=s.match(/session=(\S+)/),{chars:a?parseInt(a[1],10):0,sessionId:r?r[1]:null});return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(eF.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",n.toLocaleString()," chars"]})]})]})}function t8({line:e}){let s,{inputTokens:a,outputTokens:r}=(s=e.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(s[1],10),outputTokens:parseInt(s[2],10)}:{inputTokens:0,outputTokens:0};return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(t_,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:a.toLocaleString()})," in / ",(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.toLocaleString()})," out"]})]})]})}function t9({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tK,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:e.message})]})]})}function t7({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(ez,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-400"}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-[11px] break-all",children:e.message})]})]})}function se({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(d.Play,{className:"mt-0.5 h-3 w-3 shrink-0 text-cyan-500"}),(0,t.jsx)("span",{className:"min-w-0 font-mono text-xs break-all text-cyan-700 dark:text-cyan-400",children:e.message})]})]})}function st({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tZ,{className:"mt-0.5 h-3 w-3 shrink-0 text-orange-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs break-all text-orange-700 dark:text-orange-400",children:e.message})]})]})}function ss({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-red-50 px-3 py-1.5 transition-colors dark:bg-red-950/30",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(B.AlertCircle,{className:"mt-0.5 h-3 w-3 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs font-medium break-all text-red-700 dark:text-red-400",children:e.message})]})]})}function sa({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:e.message})]})}function sr({line:e}){return(0,t.jsx)("div",{className:"px-3 py-0.5",children:(0,t.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:e.raw})})}function sn({content:e,isConnected:a,error:n}){let{t:l}=(0,r.useTranslation)("web"),i=(0,s.useRef)(null),[o,d]=(0,s.useState)(!0),[c,u]=(0,s.useState)("structured"),x=(0,s.useCallback)(()=>{let e=i.current;e&&d(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),m=(0,s.useCallback)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight,d(!0))},[]);return((0,s.useEffect)(()=>{o&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,o]),n)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${a?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:a?"Live":"Disconnected"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u("structured"),className:`rounded p-1 transition-colors ${"structured"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.structuredView"),children:(0,t.jsx)(D.FileText,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>u("raw"),className:`rounded p-1 transition-colors ${"raw"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.rawView"),children:(0,t.jsx)(tG.Code,{className:"h-3.5 w-3.5"})}),o?null:(0,t.jsxs)("button",{type:"button",onClick:m,className:"text-muted-foreground hover:text-foreground ms-1 flex items-center gap-1 text-xs",children:[(0,t.jsx)(tH.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,t.jsx)("div",{ref:i,onScroll:x,className:`flex-1 overflow-y-auto ${"raw"===c?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===c?(0,t.jsx)(tY,{content:e}):e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)($.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:l("logTab.noLogOutput")}),a?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let sl=(0,W.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var si=e.i(95812),so=e.i(87889);let sd=(0,W.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),sc={Todo:{icon:si.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:i.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:x.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:so.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},su={icon:si.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function sx({tasks:e}){let{t:s}=(0,r.useTranslation)("web");return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:s("taskProgress.noTasksDefined")})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(sm,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,s)=>(0,t.jsx)(sh,{task:e,index:s},e.title||`task-${s}`))})]})}function sm({tasks:e}){let{t:a}=(0,r.useTranslation)("web"),n=(0,s.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,s=e.filter(e=>"Work in Progress"===e.state).length,a=e.filter(e=>"Review"===e.state).length,r=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,n=e.length,l=n>0?Math.round(t/n*100):0;return{done:t,wip:s,review:a,todo:r,total:n,percent:l}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[n.done," of ",n.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${n.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[n.done>0?(0,t.jsx)(sp,{icon:x.Check,label:a("taskProgress.done"),count:n.done,className:"text-emerald-600"}):null,n.wip>0?(0,t.jsx)(sp,{icon:i.Loader2,label:a("taskProgress.inProgress"),count:n.wip,className:"text-blue-600"}):null,n.review>0?(0,t.jsx)(sp,{icon:so.Eye,label:a("taskProgress.review"),count:n.review,className:"text-amber-600"}):null,n.todo>0?(0,t.jsx)(sp,{icon:si.Circle,label:a("taskProgress.todo"),count:n.todo,className:"text-muted-foreground"}):null]})]})}function sp({icon:e,label:s,count:r,className:n}){return(0,t.jsxs)("span",{className:(0,a.cn)("flex items-center gap-1 text-xs",n),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),r," ",s]})}function sh({task:e,index:r}){let[n,l]=(0,s.useState)(!1),i=sc[e.state]??su,o=i.icon,d=e.actionItems.length>0,c=(0,s.useCallback)(()=>{d&&l(e=>!e)},[d]);return(0,t.jsxs)("div",{"data-testid":`task-card-${r}`,className:(0,a.cn)("rounded-lg border",i.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:c,disabled:!d,className:(0,a.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",d&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(o,{className:(0,a.cn)("mt-0.5 h-4 w-4 shrink-0",i.colorClass,i.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,a.cn)("text-sm font-medium",i.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),d?(0,t.jsx)(ed.ChevronRight,{className:(0,a.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",n&&"rotate-90")}):null]}),n&&d?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,s)=>(0,t.jsx)(sf,{item:e},e.name||`ai-${s}`))})}):null]})}function sf({item:e}){let s=e.acceptanceCriteria.length,a=e.acceptanceCriteria.filter(e=>e.verified).length,r=s>0&&a===s;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[r?(0,t.jsx)(eF.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(sd,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),s>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[a,"/",s]}):null]}),s>0?(0,t.jsx)("div",{className:"ms-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,s)=>(0,t.jsx)(sg,{criterion:e},e.description||`ac-${s}`))}):null]})}function sg({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(x.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(si.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,a.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let sb={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function sj({plan:e,loading:s,error:a}){return s?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):a?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:a})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(eu.Badge,{className:sb[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(sx,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(sl,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var sv=e.i(28112);function sy(){return{data:null,loading:!1,error:null}}let sN=[{key:"overview",label:"Overview",icon:U.LayoutDashboard},{key:"activity",label:"Activity",icon:V.Activity},{key:"log",label:"Log",icon:H},{key:"plan",label:"Plan",icon:G},{key:"prd-review",label:"PRD Review",icon:_},{key:"tech-decisions",label:"Tech Decisions",icon:K.Cpu},{key:"product-decisions",label:"Product",icon:Z.Package},{key:"merge-review",label:"Merge Review",icon:Q},{key:"chat",label:"Chat",icon:J.MessageSquare}],sw={activity:async function(e){let t=await es(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await ea(e);if("error"in t)throw Error(t.error);return t.plan}};function sk({featureName:e,headerContent:r,featureNode:l,featureId:o,initialTab:u,urlTab:x,prdData:m,prdSelections:p,onPrdSelect:h,onPrdApprove:f,onPrdReject:g,isPrdLoading:b,techData:j,onTechApprove:v,onTechReject:y,isTechLoading:N,productData:w,mergeData:k,onMergeApprove:C,onMergeReject:T,isMergeLoading:S,syncStatus:M,syncLoading:R,syncError:I,onRefreshSync:A,onRebaseOnMain:z,rebaseLoading:$,rebaseError:E,isRejecting:D,chatInput:L,onChatInputChange:F,pinnedConfig:q,continuationActionsDisabled:O=!1,sseEvents:U,interactiveAgentEnabled:V=!0,onRetry:W,onStop:H,onStart:G}){let _,K=(0,n.usePathname)(),Z=(0,s.useMemo)(()=>(function(e,t=!0){let s=["overview","activity"];return e.hasAgentRun&&s.push("log"),e.hasPlan&&s.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&s.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&s.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&s.push("merge-review"),"maintain"===e.lifecycle&&e.pr&&s.push("merge-review"),t&&s.push("chat"),s})(l,V),[l,V]),Q=(0,s.useMemo)(()=>sN.filter(e=>Z.includes(e.key)).map(e=>"merge-review"===e.key&&"maintain"===l.lifecycle?{...e,label:"Merge History"}:e),[Z,l.lifecycle]),J=(0,s.useMemo)(()=>{let e=K.match(/^(\/feature\/[^/]+)/);return e?e[1]:K},[K]),es=(0,s.useMemo)(()=>x&&Z.includes(x)?x:u&&Z.includes(u)?u:"overview",[]),[ea,en]=(0,s.useState)(es),el=function(e){let[t,a]=(0,s.useState)(""),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(null),d=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),n(!1)},[]);return(0,s.useEffect)(()=>{if(!e){a(""),n(!1),i(null);return}a(""),i(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return o.current=t,t.onopen=()=>{n(!0)},t.addEventListener("initial",e=>{a(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);a(e=>e+t.content)}),t.addEventListener("error",e=>{try{let t=JSON.parse(e.data);i(t.error)}catch{i(e.data?String(e.data):"Log stream unavailable")}}),t.onerror=()=>{n(!1)},()=>{t.close(),o.current=null}},[e,d]),{content:t,isConnected:r,error:l}}("log"===ea?o:null),{tabs:eo,fetchTab:ed,refreshTab:ec}=function(e,t){let a=Object.keys(t),[r,n]=(0,s.useState)(()=>{let e={};for(let t of a)e[t]=sy();return e}),l=(0,s.useRef)(t);l.current=t;let i=(0,s.useRef)(e);i.current=e;let o=(0,s.useRef)(!0);(0,s.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]);let d=(0,s.useRef)(e);(0,s.useEffect)(()=>{d.current!==e&&(d.current=e,n(e=>{let t={};for(let s of Object.keys(e))t[s]=sy();return t}))},[e]);let c=(0,s.useCallback)(async e=>{let t=l.current[e],s=i.current;if(t){o.current&&n(t=>t[e]?.data!==null?t:{...t,[e]:{...t[e],loading:!0,error:null}});try{let a=await t(s);o.current&&n(t=>({...t,[e]:{data:a,loading:!1,error:null}}))}catch(t){o.current&&n(s=>{let a=t instanceof Error?t.message:"Failed to fetch tab data",r=s[e]?.data??null;return{...s,[e]:{data:r,loading:!1,error:r?null:a}}})}}},[]),u=(0,s.useCallback)(async e=>{let t=r[e];t&&null!==t.data||t&&t.loading||await c(e)},[r,c]);return{tabs:r,fetchTab:u,refreshTab:(0,s.useCallback)(async e=>{await c(e)},[c])}}(o,sw),eu=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!eu.current)return;eu.current=!1;let e="overview"===ea?J:`${J}/${ea}`;e!==K&&window.history.pushState(null,"",e)},[ea,J,K]);let ex=(0,s.useRef)(K);(0,s.useEffect)(()=>{if(ex.current===K||(ex.current=K,eu.current))return;let e=K.split("/"),t=e.length>=4?e[3]:void 0,s=t&&Z.includes(t)?t:"overview";s!==ea&&(en(s),("activity"===s||"plan"===s)&&ed(s))},[K]);let em=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!em.current&&(em.current=!0,!x&&"overview"!==es)){let e=`${J}/${es}`;e!==K&&window.history.replaceState(null,"",e)}},[]);let ep=(0,s.useRef)(!1);(0,s.useEffect)(()=>{ep.current||(ep.current=!0,("activity"===ea||"plan"===ea)&&ed(ea))},[ea,ed]);let eh=(0,s.useRef)(o);(0,s.useEffect)(()=>{eh.current!==o&&(eh.current=o,en("overview"))},[o]);let ef=(0,s.useRef)(u);(0,s.useEffect)(()=>{if(ef.current!==u&&u&&Z.includes(u)){ef.current=u,en(u),("activity"===u||"plan"===u)&&ed(u);let e="overview"===u?J:`${J}/${u}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[u,Z,J,ed]),(0,s.useEffect)(()=>{Z.includes(ea)||(en("overview"),window.location.pathname!==J&&window.history.replaceState(null,"",J))},[Z,ea,J]);let eg=(0,s.useRef)(ea);eg.current=ea;let eb=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(!U||0===U.length||(eb.current>U.length&&(eb.current=0),U.length<=eb.current))return;let e=U.slice(eb.current);if(eb.current=U.length,!e.some(e=>e.featureId===o))return;ec("activity");let t=eg.current;"plan"===t&&ec(t)},[U,o,ec]);let ej="running"===l.state||"creating"===l.state;(0,s.useEffect)(()=>{if(!ej)return;let e=setInterval(()=>{ec("activity")},5e3);return()=>clearInterval(e)},[ej,ec]);let ey=(0,s.useCallback)(e=>{eu.current=!0,en(e),("activity"===e||"plan"===e)&&ed(e)},[ed]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)(et.Tabs,{value:ea,onValueChange:ey,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)(et.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:Q.map(e=>{let s=e.icon;return(0,t.jsxs)(et.TabsTrigger,{value:e.key,className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,t.jsx)(s,{className:"mr-1.5 size-4"}),e.label]},e.key)})}),(0,t.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[e?(0,t.jsxs)("div",{className:"flex h-12 items-stretch gap-2 pr-0 pl-4","data-testid":"feature-drawer-header",children:[(0,t.jsx)("div",{className:"flex items-center",children:l.fastMode?(0,t.jsx)(Y.Zap,{className:"size-4 shrink-0 text-amber-500"}):(0,t.jsx)(ee,{className:"text-muted-foreground/50 size-4 shrink-0"})}),(0,t.jsx)("h2",{className:"text-foreground flex min-w-0 items-center truncate text-base font-semibold tracking-tight",children:e}),l.repositoryName?(0,t.jsxs)("span",{className:"animate-in fade-in flex shrink-0 items-center gap-1.5 self-center duration-200",children:[(0,t.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),l.remoteUrl?(0,t.jsx)("a",{href:l.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground text-sm",children:l.repositoryName}):(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:l.repositoryName})]}):(0,t.jsxs)("span",{className:"flex items-center gap-1.5 self-center",children:[(0,t.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),(0,t.jsx)("span",{className:"bg-muted h-4 w-16 animate-pulse rounded"})]}),(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 cursor-default items-center self-stretch text-xs font-medium",children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-center gap-1.5 self-stretch px-3",er.featureNodeStateConfig[l.state].labelClass),children:["running"===l.state?(0,t.jsx)(ei,{size:"sm",className:"shrink-0"}):(_=er.featureNodeStateConfig[l.state].icon,(0,t.jsx)(_,{className:"size-3.5 shrink-0"})),er.featureNodeStateConfig[l.state].label]}),"pending"===l.state&&G?(0,t.jsxs)("button",{type:"button",onClick:()=>G(l.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-green-500/10 hover:text-green-600 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-green-400","data-testid":"feature-drawer-start-button",children:[(0,t.jsx)(d.Play,{className:"size-3.5"})," Start"]}):"error"===l.state&&W?(0,t.jsxs)("button",{type:"button",onClick:()=>W(l.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-red-400","data-testid":"feature-drawer-retry-button",children:[(0,t.jsx)(X.RotateCcw,{className:"size-3.5"})," Retry"]}):"running"===l.state&&H?(0,t.jsxs)("button",{type:"button",onClick:()=>H(l.featureId),className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 dark:hover:text-red-400","data-testid":"feature-drawer-stop-button",children:[(0,t.jsx)(c.Square,{className:"size-3.5"})," Stop"]}):null]})}),l.errorMessage?(0,t.jsxs)(P.TooltipContent,{side:"bottom",align:"end",sideOffset:4,className:"z-[100] max-w-xs cursor-pointer text-xs leading-relaxed select-text",onClick:()=>{navigator.clipboard.writeText(l.errorMessage)},children:[l.errorMessage,(0,t.jsx)("span",{className:"text-muted-foreground ml-1 text-[10px] italic",children:"(click to copy)"})]}):null]})})]}):null,r]}),(0,t.jsx)(et.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(tN,{data:l,pinnedConfig:q,syncStatus:M,syncLoading:R,syncError:I,onRefreshSync:A,onRebaseOnMain:z,rebaseLoading:$,rebaseError:E})}),(0,t.jsx)(et.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(tF,{timings:eo.activity.data?.timings??null,loading:eo.activity.loading,error:eo.activity.error,rejectionFeedback:eo.activity.data?.rejectionFeedback})}),(0,t.jsx)(et.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(sn,{content:el.content,isConnected:el.isConnected,error:el.error})}),(0,t.jsx)(et.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(sj,{plan:eo.plan.data,loading:eo.plan.loading,error:eo.plan.error})}),Z.includes("prd-review")?(0,t.jsx)(et.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:m?(0,t.jsx)(ev,{data:m,selections:p??{},onSelect:h??(()=>void 0),onApprove:f??(()=>void 0),onReject:g,isProcessing:!!(b||O),isRejecting:D,chatInput:L,onChatInputChange:F}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,Z.includes("tech-decisions")?(0,t.jsx)(et.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:j?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(eC,{data:j})}),(0,t.jsx)(sC,{onApprove:v??(()=>void 0),onReject:y,isProcessing:!!(N||O),isRejecting:D,chatInput:L,onChatInputChange:F})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,Z.includes("product-decisions")?(0,t.jsx)(et.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===w?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):w?(0,t.jsx)(eM,{data:w}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,Z.includes("merge-review")?(0,t.jsx)(et.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:k?(0,t.jsx)(e2,{data:k,readOnly:"maintain"===l.lifecycle,onApprove:C??(()=>void 0),onReject:T,isProcessing:!!(S||O),isRejecting:D,chatInput:L,onChatInputChange:F}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:S?(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,t.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,t.jsx)(B.AlertCircle,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,Z.includes("chat")?(0,t.jsx)(et.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(sv.ChatTab,{featureId:o,worktreePath:l.worktreePath})}):null]})})}function sC({onApprove:e,onReject:s,isProcessing:a,isRejecting:n,chatInput:l,onChatInputChange:i}){let{t:o}=(0,r.useTranslation)("web");return(0,t.jsx)(ej,{onReject:s,onApprove:e,approveLabel:o("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:a,isRejecting:n,chatInput:l,onChatInputChange:i})}var sT=e.i(99952),sS=e.i(52587),sM=e.i(70731);let sR=(0,h.createServerReference)("40685d915d40058d3ed817b8b1ec834544be494d8d",h.callServer,void 0,h.findSourceMapURL,"rebaseFeature");var sI=e.i(99045);function sP(e){return"requirements"===e.lifecycle&&"action-required"===e.state?"prd-review":"implementation"===e.lifecycle&&"action-required"===e.state?"tech-decisions":"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?"merge-review":"overview"}function sA(e,t,a,r,n,i){let[o,d]=(0,s.useState)(!1),c=(0,s.useRef)(a),u=(0,s.useRef)(r);return c.current=a,u.current=r,(0,s.useEffect)(()=>{if(u.current(),!e)return;let s=!1;return d(!0),t(e).then(e=>{s||c.current(e)}).catch(()=>{!s&&n&&l.toast.error(n)}).finally(()=>{s||d(!1)}),()=>{s=!0}},[e,t,n,i]),o}let sz=(0,h.createServerReference)("400c6906adbfe216e30db5ad786f7433a4cafe4d60",h.callServer,void 0,h.findSourceMapURL,"getFeatureDrawerData"),s$=(0,h.createServerReference)("40e50ec9cc34e4a02b777bef703f8eaaca00eded20",h.callServer,void 0,h.findSourceMapURL,"getBranchSyncStatus"),sE=new Map,sD=(0,h.createServerReference)("70a5b956a410907cc9a3e6093fffda583a1ebcd63e",h.callServer,void 0,h.findSourceMapURL,"updateFeaturePinnedConfig");function sL({view:e,urlTab:h,interactiveAgentEnabled:z=!0}){var $,E;let D,L,F,q,B,U,V=(0,k.useFeatureFlags)(),{t:W}=(0,r.useTranslation)("web"),H=(0,n.useRouter)(),G=(0,C.useSoundAction)("reject"),[_,K]=(0,s.useState)(e),[Z,Q]=(0,s.useState)(()=>"feature"===e.type?tf(e.node):null),[J,X]=(0,s.useState)(()=>"feature"===e.type?tf(e.node):null),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(null),ea=(0,s.useRef)(null);(0,s.useEffect)(()=>{K(t=>"feature"===t.type&&"feature"===e.type&&t.node.featureId===e.node.featureId?{...e,node:{...t.node,...e.node}}:e)},[e]);let er="feature"===_.type?_.node:null,en=!!er&&($=er.state,th.has($));(0,s.useEffect)(()=>{if("feature"!==_.type||Y)return;let e=tf(_.node),t=e?`${_.node.featureId}:${e.agentType}:${e.modelId}`:`${_.node.featureId}:none`,s=ea.current!==t;ea.current=t,Q(e),X(e),s&&es(null)},[_,Y]);let{events:el}=(0,M.useAgentEventsContext)(),ei=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(ei.current>el.length&&(ei.current=0),!er||el.length<=ei.current)return;let e=el.slice(ei.current);for(let t of(ei.current=el.length,(0,sI.resolveSseEventUpdates)(e)))t.featureId===er.featureId&&"deleting"!==er.state&&(void 0!==t.state||void 0!==t.lifecycle)&&K(e=>{if("feature"!==e.type)return e;let s={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:s,initialTab:sP(s)}})},[el,er]);let eo=(0,n.usePathname)().startsWith("/feature/");E=er?.featureId??null,D=(0,s.useRef)(eo),L=(0,s.useRef)(!1),F=(0,s.useRef)(0),q=(0,s.useCallback)(async()=>{if(!E||L.current)return;L.current=!0;let e=F.current;try{let t=await sz(E);if(!t||e!==F.current)return;K(e=>(function(e,t){if("feature"!==e.type)return e;let s={...e.node,...t},a=s.state!==e.node.state||s.lifecycle!==e.node.lifecycle;return{...e,node:s,initialTab:a?sP(s):e.initialTab}})(e,t))}catch{}finally{L.current=!1}},[E,K]),B=(0,s.useRef)(!1),(0,s.useEffect)(()=>{!eo||D.current&&B.current||(B.current=!0,F.current+=1,L.current=!1,q()),D.current=eo},[eo,q]),(0,s.useEffect)(()=>{if(!eo||!E)return;let e=setInterval(()=>{q()},15e3);return()=>clearInterval(e)},[eo,E,q]);let ed=(0,s.useCallback)(()=>{H.push("/")},[H]),[ec,eu]=(0,s.useState)(""),[ex,em]=(0,s.useState)(null),[ep,eh]=(0,s.useState)({}),[ef,eg]=(0,s.useState)({}),[eb,ej]=(0,s.useState)(null),[ev,ey]=(0,s.useState)(void 0),[eN,ew]=(0,s.useState)(null),[ek,eC]=(0,s.useState)(!1),[eT,eS]=(0,s.useState)(!1),[eM,eR]=(0,s.useState)(!1),eI=`${er?.featureId}:${er?.state}`,eP=(0,s.useRef)(eI);(0,s.useEffect)(()=>{eI!==eP.current&&(eP.current=eI,eR(!1))},[eI]);let[eA,ez]=(0,s.useState)(!1),e$=(0,s.useRef)(!1),eE="feature"===_.type?_.initialTab:void 0;(0,s.useEffect)(()=>{eu("")},[eE]);let eD=(0,s.useRef)(0),eL=(0,s.useRef)(er?.state),eF=(0,s.useRef)(er?.lifecycle);(er?.state!==eL.current||er?.lifecycle!==eF.current)&&(eL.current=er?.state,eF.current=er?.lifecycle,eD.current+=1);let eq=eD.current,eO=sA(er?.lifecycle==="requirements"&&er?.state==="action-required"?er.featureId:null,y,e=>{if(e.error)return void l.toast.error(e.error);if(e.questionnaire){em(e.questionnaire);let t={};for(let s of e.questionnaire.questions){let e=s.options.find(e=>e.recommended);e&&(t[s.id]=e.id)}eh(t),eg(t)}},()=>{eh({}),eg({}),em(null)},"Failed to load questionnaire",eq),eB=er?.lifecycle==="implementation"&&er?.state==="action-required"?er.featureId:null,eU=sA(eB,N,e=>{e.error?l.toast.error(e.error):e.techDecisions&&ej(e.techDecisions)},()=>ej(null),"Failed to load tech decisions",eq),eV=sA(eB,y,e=>{e.productDecisions&&ey(e.productDecisions)},()=>ey(void 0),void 0,eq),eW=sA(er?.lifecycle==="review"&&(er?.state==="action-required"||er?.state==="error")||er?.lifecycle==="maintain"&&er?.pr?er.featureId:null,w,e=>{"error"in e?l.toast.error(e.error):ew(e)},()=>ew(null),"Failed to load merge review data",eq),eH=ec.trim().length>0,eG=er?.lifecycle==="requirements"&&er?.state==="action-required"&&Object.keys(ef).some(e=>ef[e]!==ep[e]),e_=(0,s.useCallback)(()=>{eu(""),eh({...ef})},[ef]),{attemptClose:eK}=(0,T.useGuardedDrawerClose)({open:eo,isDirty:eH||eG,onClose:ed,onReset:e_}),eZ=(0,s.useCallback)(async(e,t,s=[],a)=>{if(!Y&&er?.featureId){e$.current=!0,ez(!0);try{let r=s.map(e=>e.path).filter(Boolean),n=s.filter(e=>e.notes?.trim()),i=n.length>0?`${e}
3
+
4
+ Image notes:
5
+ ${n.map(e=>`- @${e.path}: ${e.notes.trim()}`).join("\n")}`:e,o=await v(er.featureId,i,r);if(!o.rejected)return void l.toast.error(o.error??`Failed to reject ${t.toLowerCase()}`);G.play(),eu(""),l.toast.success(`${t} rejected — agent re-iterating (iteration ${o.iteration})`),o.iterationWarning&&l.toast.warning(`Iteration ${o.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:er.featureId}})),ed(),a?.()}finally{e$.current=!1,ez(!1)}}},[er,ed,Y,G]),eQ=(0,s.useCallback)((e,t)=>eZ(e,"Requirements",t,()=>eh({})),[eZ]),eJ=(0,s.useCallback)((e,t)=>eZ(e,"Plan",t),[eZ]),eX=(0,s.useCallback)((e,t)=>eZ(e,"Merge",t),[eZ]),eY=(0,s.useCallback)(async e=>{if(Y||!er?.featureId)return;let t=await f(er.featureId);t.approved?(eu(""),l.toast.success(`${e} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:er.featureId}})),ed()):l.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[er,ed,Y]),e0=(0,s.useCallback)(async e=>{let t;if(Y||"feature"!==_.type||!er)return;if(ex){let e=[];for(let[t,s]of Object.entries(ep)){let a=ex.questions.find(e=>e.id===t),r=a?.options.find(e=>e.id===s);a&&r&&e.push({questionId:a.question,selectedOption:r.label})}t={approved:!0,changedSelections:e}}let s=await f(er.featureId,t);s.approved?(eu(""),l.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:er.featureId}})),eh({}),ed()):l.toast.error(s.error??"Failed to approve requirements")},[_,er,Y,ex,ep,ed]),e1=(0,s.useCallback)(()=>eY("Plan"),[eY]),e2=(0,s.useCallback)(()=>eY("Merge"),[eY]),e5=(0,s.useCallback)(async(e,t,s,a)=>{eC(!0),eS(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:e,cleanup:t,cascadeDelete:s,closePr:a}})),H.push("/")},[H]),e3=(0,s.useCallback)(e=>{eR(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:e}})),H.push("/")},[H]),e4=(0,s.useCallback)(e=>{eR(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:e}})),H.push("/")},[H]),e6=(0,s.useCallback)(async e=>{if(Y)return;let t=await (0,g.resumeFeature)(e);t.error?l.toast.error(t.error):(l.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:e}})),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[Y]),e8=(0,s.useCallback)(async e=>{let t=await (0,j.stopFeature)(e);t.stopped?(l.toast.success("Agent stopped"),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"error"}})):l.toast.error(t.error??"Failed to stop")},[]),e9=(0,s.useCallback)(async e=>{if(Y)return;let t=await (0,b.startFeature)(e);t.error?l.toast.error(t.error):(l.toast.success("Feature started"),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[Y]),e7=(0,s.useCallback)(async(e,t)=>{var s;if(!er)return{ok:!1,error:"Feature is not loaded"};if(s=er.state,!th.has(s))return{ok:!1,error:"Pinned execution can only be changed before start, approval, or retry"};let a=J??tf(er),r={agentType:e,modelId:t};Q(r),es(null),ee(!0);try{let s=await sD(er.featureId,e,t);if(!s.ok){let e=s.error??"Failed to save pinned config";return Q(a),es(e),l.toast.error(e),{ok:!1,error:e}}return X(r),K(e=>"feature"!==e.type||e.node.featureId!==er.featureId?e:{...e,node:{...e.node,agentType:r.agentType,modelId:t}}),{ok:!0}}catch(t){let e=t instanceof Error?t.message:"Failed to save pinned config";return Q(a),es(e),l.toast.error(e),{ok:!1,error:e}}finally{ee(!1)}},[er,J]),te=er?.repositoryPath&&er?.branch?{featureId:er.featureId,repositoryPath:er.repositoryPath,branch:er.branch,worktreePath:er.worktreePath,specPath:er.specPath}:null,tt=function(e){let[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[x,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),[f,g]=(0,s.useState)(null),[b,j]=(0,s.useState)(null),[v,y]=(0,s.useState)(null),N=(0,s.useRef)(null),w=(0,s.useRef)(null),k=(0,s.useRef)(null),C=(0,s.useRef)(null),T=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=[N,w,k,C,T];return()=>{for(let t of e)t.current&&clearTimeout(t.current)}},[]);let S=(0,s.useCallback)(async(t,s,a,r,n)=>{if(e&&!n){r.current&&clearTimeout(r.current),s(!0),a(null);try{let s=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!s.success){let e=s.error??"An unexpected error occurred";a(e),r.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),r.current=setTimeout(()=>a(null),5e3)}finally{s(!1)}}},[e]);return{openInIde:(0,s.useCallback)(()=>S(sT.openIde,a,m,N,t),[S,t]),openInShell:(0,s.useCallback)(()=>S(sS.openShell,n,h,w,r),[S,r]),openFolder:(0,s.useCallback)(async()=>{if(e&&!l){k.current&&clearTimeout(k.current),i(!0),g(null);try{let t=e.worktreePath??e.repositoryPath,s=await (0,sM.openFolder)(t);if(!s.success){let e=s.error??"An unexpected error occurred";g(e),k.current=setTimeout(()=>g(null),5e3)}}catch(e){g(e instanceof Error?e.message:"An unexpected error occurred"),k.current=setTimeout(()=>g(null),5e3)}finally{i(!1)}}},[e,l]),openSpecsFolder:(0,s.useCallback)(async()=>{if(e?.specPath&&!o){C.current&&clearTimeout(C.current),d(!0),j(null);try{let t=await (0,sM.openFolder)(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";j(e),C.current=setTimeout(()=>j(null),5e3)}}catch(e){j(e instanceof Error?e.message:"An unexpected error occurred"),C.current=setTimeout(()=>j(null),5e3)}finally{d(!1)}}},[e,o]),rebaseOnMain:(0,s.useCallback)(async()=>{if(e?.featureId&&!c){T.current&&clearTimeout(T.current),u(!0),y(null);try{let t=await sR(e.featureId);if(!t.success){let e=t.error??"An unexpected error occurred";y(e),T.current=setTimeout(()=>y(null),5e3)}}catch(e){y(e instanceof Error?e.message:"An unexpected error occurred"),T.current=setTimeout(()=>y(null),5e3)}finally{u(!1)}}},[e,c]),ideLoading:t,shellLoading:r,folderLoading:l,specsLoading:o,rebaseLoading:c,ideError:x,shellError:p,folderError:f,specsError:b,rebaseError:v}}(te),ts=V.gitRebaseSync&&er?.branch&&er?.remoteUrl?er.featureId:null,{data:ta,loading:tr,error:tn,refresh:tl}=function(e){let[t,a]=(0,s.useState)(()=>{if(!e)return null;let t=sE.get(e);return t?t.data:null}),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(e);o.current=e;let d=(0,s.useCallback)(async e=>{n(!0),i(null);try{let t=await s$(e);if(o.current!==e)return;if(t.success&&t.data){let s=t.data;sE.set(e,{data:s,timestamp:Date.now()}),a(s)}else i(t.error??"Failed to check sync status")}catch{if(o.current!==e)return;i("Failed to check sync status")}finally{o.current===e&&n(!1)}},[]);return(0,s.useEffect)(()=>{if(!e){a(null),i(null);return}let t=sE.get(e);t&&(a(t.data),Date.now()-t.timestamp<3e4)||d(e)},[e,d]),{data:t,loading:r,error:l,refresh:(0,s.useCallback)(()=>{e&&d(e)},[e,d])}}(ts),ti=(0,s.useRef)(tt.rebaseLoading);(0,s.useEffect)(()=>{!ti.current||tt.rebaseLoading||tt.rebaseError||tl(),ti.current=tt.rebaseLoading},[tt.rebaseLoading,tt.rebaseError,tl]);let to=er?.repositoryPath&&er.branch?{targetId:er.featureId,targetType:"feature",repositoryPath:er.repositoryPath,branch:er.branch}:null,td=(0,S.useDeployAction)(to),tc="Booting"===td.status||"Ready"===td.status,[tu,tx]=(0,s.useState)(!1),tm=(0,s.useCallback)(()=>{er?.featureId&&(navigator.clipboard.writeText(er.featureId),tx(!0),setTimeout(()=>tx(!1),2e3))},[er?.featureId]);if(er){let e=er.featureId.slice(0,8),s="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",r="bg-border/60 mx-1.5 h-5 w-px shrink-0";U=(0,t.jsx)("div",{"data-testid":"feature-drawer-toolbar",children:(0,t.jsxs)("div",{className:"flex h-10 items-center px-2","data-testid":"feature-drawer-actions",children:[te&&er?.state!=="done"?(0,t.jsx)(O,{actions:tt,repositoryPath:te.repositoryPath,worktreePath:te.worktreePath,showSpecs:!!te.specPath}):null,te&&er?.state!=="done"&&V.envDeploy&&to?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:r}),(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:td.deployLoading||td.stopLoading,onClick:tc?td.stop:td.deploy,className:(0,a.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",tc?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-600 hover:bg-green-500/10 dark:text-green-500"),"aria-label":W(tc?"featureDrawer.stopDevServer":"featureDrawer.startDevServer"),children:td.deployLoading||td.stopLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):tc?(0,t.jsx)(c.Square,{className:"size-4"}):(0,t.jsx)(d.Play,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W(tc?"featureDrawer.stopDevServer":"featureDrawer.startDevServer")})]})}),tc?(0,t.jsx)(I.DeploymentStatusBadge,{status:td.status,url:td.url,targetId:to?.targetId}):null]}):null,(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("code",{className:"text-muted-foreground/70 font-mono text-[10px] tracking-wide select-none",children:e}),(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:tm,className:s,"aria-label":W("featureDrawer.copyFeatureId"),"data-testid":"feature-drawer-copy-id",children:tu?(0,t.jsx)(x.Check,{className:"size-4 text-green-500"}):(0,t.jsx)(u.Copy,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.copyFeatureId")})]})}),er.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:r}),(0,t.jsxs)(P.TooltipProvider,{delayDuration:300,children:["archived"===er.state?(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:eM,className:s,"data-testid":"feature-drawer-unarchive",onClick:()=>e4(er.featureId),children:eM?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(p.ArchiveRestore,{className:"size-3"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.unarchiveFeature")})]}):"deleting"!==er.state?(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:eM,className:s,"data-testid":"feature-drawer-archive",onClick:()=>e3(er.featureId),children:eM?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(m.Archive,{className:"size-3"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.archiveFeature")})]}):null,(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:ek,className:(0,a.cn)(s,"hover:bg-destructive/10 hover:text-destructive"),"data-testid":"feature-drawer-delete",onClick:()=>eS(!0),children:ek?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(o.Trash2,{className:"size-3"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.deleteFeature")})]})]}),(0,t.jsx)(A.DeleteFeatureDialog,{open:eT,onOpenChange:eS,onConfirm:(e,t,s)=>e5(er.featureId,e,t,s),isDeleting:ek,featureName:er.name,featureId:er.featureId,hasChildren:er.hasChildren,hasOpenPr:!!er.pr&&"Open"===er.pr.status})]}):null]})]})})}let tp=null;if("feature"===_.type&&er){let e={...er,..."error"===er.state&&{onRetry:e6},..."pending"===er.state&&{onStart:e9}};tp=(0,t.jsx)(sk,{featureName:er.name,headerContent:U,featureNode:e,featureId:er.featureId,initialTab:_.initialTab,urlTab:h,sseEvents:el,prdData:ex,prdSelections:ep,onPrdSelect:(e,t)=>eh(s=>({...s,[e]:t})),onPrdApprove:e0,onPrdReject:eQ,isPrdLoading:eO,techData:eb,onTechApprove:e1,onTechReject:eJ,isTechLoading:eU,productData:eV?null:ev,mergeData:eN,onMergeApprove:e2,onMergeReject:eX,isMergeLoading:eW,syncStatus:ts?ta:void 0,syncLoading:tr,syncError:tn,onRefreshSync:ts?tl:void 0,onRebaseOnMain:ts?tt.rebaseOnMain:void 0,rebaseLoading:tt.rebaseLoading,rebaseError:tt.rebaseError,isRejecting:eA,chatInput:ec,onChatInputChange:eu,pinnedConfig:en&&Z?{...Z,saving:Y,error:et,onSave:e7}:void 0,continuationActionsDisabled:Y,interactiveAgentEnabled:z,onRetry:e6,onStop:e8,onStart:e9})}return(0,t.jsx)(R.BaseDrawer,{open:eo,onClose:eK,size:"lg",modal:!1,"data-testid":"feature"===_.type?"feature-drawer":"repository-drawer",children:tp})}e.s(["FeatureDrawerClient",()=>sL],36986)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31406,(e,t,s)=>{t.exports=e.r(67013)},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},43698,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["default",()=>t])},64764,80436,17087,e=>{"use strict";var t=e.i(15506);e.s(["Loader2Icon",()=>t.default],64764);var s=e.i(95230);e.s(["DownloadIcon",()=>s.default],80436);let r=(0,e.i(3645).default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>r],17087)},48306,e=>{"use strict";var t=e.i(20314),s=e.i(31777);function r({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}e.s(["Textarea",()=>r])},28267,57484,e=>{"use strict";var t=e.i(1693);e.s(["VisuallyHidden",0,t],28267);let s=(0,e.i(3645).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>s],57484)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},50032,86254,e=>{"use strict";var t=e.i(20314),s=e.i(60253),r=e.i(64764),i=e.i(80436),n=e.i(17087),a=e.i(31777),o=e.i(2287),l=e.i(48306),u=e.i(2828),c=e.i(28267),h=e.i(57484),d=e.i(16298),d=d;let p=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var f=e.i(93752),f=f;e.i(35364);let y=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),m=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function v(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function g(e,t){let s=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${s.toString()}`}function x({name:e,size:x,mimeType:w,path:S,onRemove:R,loading:T=!1,disabled:j=!1,notes:O,onNotesChange:C}){let k,I,E=(k=e.lastIndexOf("."))>=0?e.slice(k).toLowerCase():"",Q=y.has(E)?p:".pdf"===E?d.default:m.has(E)?f.default:h.FileIcon,F=".pdf"===E?"bg-red-50 text-red-600":y.has(E)?"bg-blue-50 text-blue-600":m.has(E)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",M=(I=e.lastIndexOf("."))>=0&&b.has(e.slice(I).toLowerCase());if(T)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(r.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(M){let r=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:g(S,w),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),O?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(n.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(u.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(o.Dialog,{children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(o.DialogTrigger,{asChild:!0,children:r})}),!j&&(0,t.jsx)("button",{type:"button",onClick:R,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]}),O?(0,t.jsx)(u.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:O})}):null]}),(0,t.jsxs)(o.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(o.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:g(S,w),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:v(x)})]}),(0,t.jsx)("a",{href:g(S,w),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(i.DownloadIcon,{className:"h-4 w-4"})})]}),C?(0,t.jsx)(l.Textarea,{placeholder:"Add notes about this image…",value:O??"",onChange:e=>C(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):O?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:O}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 ps-2 pe-3",children:[(0,t.jsx)("div",{className:(0,a.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",F),children:(0,t.jsx)(Q,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:v(x)}),!j&&(0,t.jsx)("button",{type:"button",onClick:R,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]})}e.s(["AttachmentChip",()=>x],86254),e.s([],50032)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},67669,e=>{"use strict";let t=(0,e.i(3645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],67669)},94365,e=>{"use strict";let t=(0,e.i(3645).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],94365)},4520,77501,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t],77501);var s=new class extends t{#e;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>s],4520)},3,68911,e=>{"use strict";e.i(44172);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s=new class{#r=t;#i=!1;setTimeoutProvider(e){this.#r=e}setTimeout(e,t){return this.#r.setTimeout(e,t)}clearTimeout(e){this.#r.clearTimeout(e)}setInterval(e,t){return this.#r.setInterval(e,t)}clearInterval(e){this.#r.clearInterval(e)}};function r(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>r,"timeoutManager",()=>s],68911);var i="u"<typeof window||"Deno"in globalThis;function n(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==p(a,t.options))return!1}else if(!y(t.queryKey,a))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!i||i===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:s,status:r,predicate:i,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(f(t.options.mutationKey)!==f(n))return!1}else if(!y(t.options.mutationKey,n))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function p(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>g(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function y(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>y(e[s],t[s]))}var m=Object.prototype.hasOwnProperty;function v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let s in e)if(e[s]!==t[s])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e){if(!x(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!x(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return new Promise(t=>{s.setTimeout(t,e)})}function S(e,t,s){return"function"==typeof s.structuralSharing?s.structuralSharing(e,t):!1!==s.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let i=b(t)&&b(s);if(!i&&!(g(t)&&g(s)))return s;let n=(i?t:Object.keys(t)).length,a=i?s:Object.keys(s),o=a.length,l=i?Array(o):{},u=0;for(let c=0;c<o;c++){let o=i?c:a[c],h=t[o],d=s[o];if(h===d){l[o]=h,(i?c<n:m.call(t,o))&&u++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){l[o]=d;continue}let p=e(h,d,r+1);l[o]=p,p===h&&u++}return n===o&&u===n?t:l}(e,t):t}function R(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r}function T(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var j=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==j?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function C(e,t){return"function"==typeof e?e(...t):!!e}function k(e,t,s){let r,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}e.s(["addConsumeAwareSignal",()=>k,"addToEnd",()=>R,"addToStart",()=>T,"ensureQueryFn",()=>O,"functionalUpdate",()=>a,"hashKey",()=>f,"hashQueryKeyByOptions",()=>p,"isServer",()=>i,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>y,"replaceData",()=>S,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>v,"shouldThrowError",()=>C,"skipToken",()=>j,"sleep",()=>w,"timeUntilStale",()=>l],3)},65617,e=>{"use strict";let t;var s=e.i(3),r=(t=()=>s.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",()=>r])},6786,e=>{"use strict";let t,s,r,i,n,a;var o=e.i(68911).systemSetTimeoutZero,l=(t=[],s=0,r=e=>{e()},i=e=>{e()},n=o,{batch:e=>{let a;s++;try{a=e()}finally{let e;--s||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{r(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{s?t.push(e):n(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>l])},13598,20820,e=>{"use strict";var t=e.i(77501),s=new class extends t.Subscribable{#n=!0;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function r(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}e.s(["onlineManager",()=>s],13598),e.i(3),e.s(["pendingThenable",()=>r],20820)},28574,20979,19644,34682,e=>{"use strict";e.i(44172);var t=e.i(3),s=e.i(6786),r=e.i(4520),i=e.i(13598),n=e.i(20820),a=e.i(65617);function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||i.onlineManager.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let s,c=!1,h=0,d=(0,n.pendingThenable)(),p=()=>r.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),y=e=>{"pending"===d.status&&(s?.(),d.resolve(e))},m=e=>{"pending"===d.status&&(s?.(),d.reject(e))},v=()=>new Promise(t=>{s=e=>{("pending"!==d.status||p())&&t(e)},e.onPause?.()}).then(()=>{s=void 0,"pending"===d.status&&e.onContinue?.()}),b=()=>{let s;if("pending"!==d.status)return;let r=0===h?e.initialPromise:void 0;try{s=r??e.fn()}catch(e){s=Promise.reject(e)}Promise.resolve(s).then(y).catch(s=>{if("pending"!==d.status)return;let r=e.retry??3*!a.environmentManager.isServer(),i=e.retryDelay??o,n="function"==typeof i?i(h,s):i,l=!0===r||"number"==typeof r&&h<r||"function"==typeof r&&r(h,s);c||!l?m(s):(h++,e.onFail?.(h,s),(0,t.sleep)(n).then(()=>p()?void 0:v()).then(()=>{c?m(s):b()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let s=new u(t);m(s),e.onCancel?.(s)}},continue:()=>(s?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:f,start:()=>(f()?b():v().then(b),d)}}e.s(["CancelledError",()=>u,"canFetch",()=>l,"createRetryer",()=>c],20979);var h=e.i(68911),d=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>d],19644);var p=class extends d{#o;#l;#u;#c;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=m(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=m(this.options);void 0!==e.data&&(this.setState(y(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,s){let r=(0,t.replaceData)(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){let s=this.#h?.promise;return this.#h?.cancel(e),s?s.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#o}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#y()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,s){let r;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,i.signal)})},a=()=>{let e,r=(0,t.ensureQueryFn)(this.options,s),i=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(r,i,this):r(i)},o=(n(r={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),r);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:s?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),i.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof u){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...f(t.data,this.options),fetchMeta:e.meta??null};case"success":let s={...t,...y(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?s:void 0,s;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),s.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function f(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function y(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function m(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>p,"fetchState",()=>f],28574);var v=e.i(79054),b=e.i(20314),g=v.createContext(void 0),x=e=>{let t=v.useContext(g);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},w=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,b.jsx)(g.Provider,{value:e,children:t}));e.s(["QueryClientProvider",()=>w,"useQueryClient",()=>x],34682)},62885,e=>{"use strict";let t;var s=e.i(4520),r=e.i(65617),i=e.i(6786),n=e.i(28574),a=e.i(77501),o=e.i(20820),l=e.i(3),u=e.i(68911),c=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#m=null,this.#v=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#b=void 0;#g=void 0;#x=void 0;#w;#S;#v;#m;#R;#T;#j;#O;#C;#k;#I=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),h(this.#b,this.options)?this.#E():this.updateResult(),this.#Q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#M(),this.#b.removeObserver(this)}setOptions(e){let t=this.options,s=this.#b;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,l.resolveEnabled)(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#D(),this.#b.setOptions(this.options),t._defaulted&&!(0,l.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let r=this.hasListeners();r&&p(this.#b,s,this.options,t)&&this.#E(),this.updateResult(),r&&(this.#b!==s||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||(0,l.resolveStaleTime)(this.options.staleTime,this.#b)!==(0,l.resolveStaleTime)(t.staleTime,this.#b))&&this.#U();let i=this.#P();r&&(this.#b!==s||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||i!==this.#k)&&this.#q(i)}getOptimisticResult(e){var t,s;let r=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(r,e);return t=this,s=i,(0,l.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#x=i,this.#S=this.options,this.#w=this.#b.state),i}getCurrentResult(){return this.#x}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#I.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),s=this.#c.getQueryCache().build(this.#c,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#E({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#x))}#E(e){this.#D();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.noop)),t}#U(){this.#F();let e=(0,l.resolveStaleTime)(this.options.staleTime,this.#b);if(r.environmentManager.isServer()||this.#x.isStale||!(0,l.isValidTimeout)(e))return;let t=(0,l.timeUntilStale)(this.#x.dataUpdatedAt,e);this.#O=u.timeoutManager.setTimeout(()=>{this.#x.isStale||this.updateResult()},t+1)}#P(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#q(e){this.#M(),this.#k=e,!r.environmentManager.isServer()&&!1!==(0,l.resolveEnabled)(this.options.enabled,this.#b)&&(0,l.isValidTimeout)(this.#k)&&0!==this.#k&&(this.#C=u.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#E()},this.#k))}#Q(){this.#U(),this.#q(this.#P())}#F(){this.#O&&(u.timeoutManager.clearTimeout(this.#O),this.#O=void 0)}#M(){this.#C&&(u.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let s,r=this.#b,i=this.options,a=this.#x,u=this.#w,c=this.#S,d=e!==r?e.state:this.#g,{state:y}=e,m={...y},v=!1;if(t._optimisticResults){let s=this.hasListeners(),a=!s&&h(e,t),o=s&&p(e,r,t,i);(a||o)&&(m={...m,...(0,n.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:x}=m;s=m.data;let w=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===x){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,w=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#j?.state.data,this.#j):t.placeholderData,void 0!==e&&(x="success",s=(0,l.replaceData)(a?.data,e,t),v=!0)}if(t.select&&void 0!==s&&!w)if(a&&s===u?.data&&t.select===this.#R)s=this.#T;else try{this.#R=t.select,s=t.select(s),s=(0,l.replaceData)(a?.data,s,t),this.#T=s,this.#m=null}catch(e){this.#m=e}this.#m&&(b=this.#m,s=this.#T,g=Date.now(),x="error");let S="fetching"===m.fetchStatus,R="pending"===x,T="error"===x,j=R&&S,O=void 0!==s,C={status:x,fetchStatus:m.fetchStatus,isPending:R,isSuccess:"success"===x,isError:T,isInitialLoading:j,isLoading:j,data:s,dataUpdatedAt:m.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!R,isLoadingError:T&&!O,isPaused:"paused"===m.fetchStatus,isPlaceholderData:v,isRefetchError:T&&O,isStale:f(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,l.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==C.data,s="error"===C.status&&!t,i=e=>{s?e.reject(C.error):t&&e.resolve(C.data)},n=()=>{i(this.#v=C.promise=(0,o.pendingThenable)())},a=this.#v;switch(a.status){case"pending":e.queryHash===r.queryHash&&i(a);break;case"fulfilled":(s||C.data!==a.value)&&n();break;case"rejected":s&&C.error===a.reason||n()}}return C}updateResult(){let e=this.#x,t=this.createResult(this.#b,this.options);if(this.#w=this.#b.state,this.#S=this.options,void 0!==this.#w.data&&(this.#j=this.#b),(0,l.shallowEqualObjects)(t,e))return;this.#x=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#I.size)return!0;let r=new Set(s??this.#I);return this.options.throwOnError&&r.add("error"),Object.keys(this.#x).some(t=>this.#x[t]!==e[t]&&r.has(t))};this.#N({listeners:s()})}#D(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#b)return;let t=this.#b;this.#b=e,this.#g=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#Q()}#N(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#x)}),this.#c.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function h(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,s){if(!1!==(0,l.resolveEnabled)(t.enabled,e)&&"static"!==(0,l.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof s?s(e):s;return"always"===r||!1!==r&&f(e,t)}return!1}function p(e,t,s,r){return(e!==t||!1===(0,l.resolveEnabled)(r.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&f(e,s)}function f(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,l.resolveStaleTime)(t.staleTime,e))}e.i(44172);var y=e.i(79054),m=e.i(34682);e.i(20314);var v=y.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),b=y.createContext(!1);b.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function x(e,t){return function(e,t,s){let n,a=y.useContext(b),o=y.useContext(v),u=(0,m.useQueryClient)(s),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let h=u.getQueryCache().get(c.queryHash);if(c._optimisticResults=a?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}n=h?.state.error&&"function"==typeof c.throwOnError?(0,l.shouldThrowError)(c.throwOnError,[h.state.error,h]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||n)&&!o.isReset()&&(c.retryOnMount=!1),y.useEffect(()=>{o.clearReset()},[o]);let d=!u.getQueryCache().get(c.queryHash),[p]=y.useState(()=>new t(u,c)),f=p.getOptimisticResult(c),x=!a&&!1!==e.subscribed;if(y.useSyncExternalStore(y.useCallback(e=>{let t=x?p.subscribe(i.notifyManager.batchCalls(e)):l.noop;return p.updateResult(),t},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setOptions(c)},[c,p]),c?.suspense&&f.isPending)throw g(c,p,o);if((({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&void 0===e.data||(0,l.shouldThrowError)(s,[e.error,r])))({result:f,errorResetBoundary:o,throwOnError:c.throwOnError,query:h,suspense:c.suspense}))throw f.error;if(u.getDefaultOptions().queries?._experimental_afterQuery?.(c,f),c.experimental_prefetchInRender&&!r.environmentManager.isServer()&&f.isLoading&&f.isFetching&&!a){let e=d?g(c,p,o):h?.promise;e?.catch(l.noop).finally(()=>{p.updateResult()})}return c.notifyOnChangeProps?f:p.trackResult(f)}(e,c,t)}e.s(["useQuery",()=>x],62885)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),i=e.i(79054),n=e.i(23925),s=e.i(26370),a=e.i(38573),l=e.i(49228),r=e.i(74294),o=e.i(3645);let c=(0,o.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),d=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),u=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var g=e.i(32494),m=e.i(10714),m=m,h=e.i(3214),p=e.i(30702);let f=(0,o.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var x=e.i(58860),v=e.i(48109);let b=(0,o.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var w=e.i(60112);e.i(41001);var j=e.i(64780),y=e.i(31777),S=e.i(41957),k=e.i(51911),C=e.i(47373),M=e.i(21023);let I=(0,M.createServerReference)("40eb3c78a982c3a976751431a84a8b4fb933ebbd68",M.callServer,void 0,M.findSourceMapURL,"updateSettingsAction");var N=e.i(17406),T=e.i(98804),A=e.i(44229),D=e.i(83902);function F(e){return(0,t.jsx)(A.Code,{className:(0,y.cn)("h-4 w-4",e.className),...e})}function P({className:e}){return(0,t.jsx)(T.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,y.cn)("rounded-sm object-contain",e)})}function E({className:e}){return(0,t.jsx)(T.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,y.cn)("rounded-sm object-contain",e)})}function R({className:e}){return(0,t.jsx)(T.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,y.cn)("rounded-sm object-contain",e)})}function z({className:e}){return(0,t.jsx)(T.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,y.cn)("rounded-sm object-contain",e)})}function B({className:e,...i}){return(0,t.jsx)(D.Rocket,{className:(0,y.cn)("h-4 w-4",e),...i})}P.displayName="VsCodeIcon",E.displayName="CursorEditorIcon",R.displayName="WindsurfIcon",z.displayName="ZedIcon",B.displayName="AntigravityIcon";let L={vscode:P,cursor:E,windsurf:R,zed:z,antigravity:B};var _=e.i(41413),K=e.i(956);let V=[{value:N.Language.English,label:"English",nativeName:"English"},{value:N.Language.Russian,label:"Русский",nativeName:"Русский"},{value:N.Language.Portuguese,label:"Português",nativeName:"Português"},{value:N.Language.Spanish,label:"Español",nativeName:"Español"},{value:N.Language.Arabic,label:"العربية",nativeName:"العربية"},{value:N.Language.Hebrew,label:"עברית",nativeName:"עברית"},{value:N.Language.French,label:"Français",nativeName:"Français"},{value:N.Language.German,label:"Deutsch",nativeName:"Deutsch"}];function W({language:e}){let{t:s,i18n:a}=(0,j.useTranslation)("web"),[l,r]=(0,i.useState)(e),[o,c]=(0,i.useTransition)(),[d,u]=(0,i.useState)(!1),m=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{if(m.current&&!o){u(!0);let e=setTimeout(()=>u(!1),2e3);return()=>clearTimeout(e)}m.current=o},[o]),(0,t.jsxs)(K.Card,{id:"language",className:"scroll-mt-6","data-testid":"language-settings-section",children:[(0,t.jsxs)(K.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Globe,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)(K.CardTitle,{children:s("settings.language.title")})]}),o?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:s("common:labels.saving")}):null,d&&!o?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-green-600",children:[(0,t.jsx)(n.Check,{className:"h-3 w-3"}),s("common:labels.saved")]}):null]}),(0,t.jsx)(K.CardDescription,{children:s("settings.language.description")})]}),(0,t.jsx)(K.CardContent,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(S.Label,{htmlFor:"display-language",children:s("settings.language.label")}),(0,t.jsxs)(C.Select,{value:l,onValueChange:function(e){r(e),a.changeLanguage(e);let t="ar"===e||"he"===e?"rtl":"ltr";document.documentElement.lang=e,document.documentElement.dir=t,c(async()=>{let t=await I({user:{preferredLanguage:e}});t.success||w.toast.error(t.error??s("settings.language.failedToSave","Failed to save language settings"))})},children:[(0,t.jsx)(C.SelectTrigger,{id:"display-language","data-testid":"language-select",children:(0,t.jsx)(C.SelectValue,{placeholder:s("settings.language.placeholder")})}),(0,t.jsx)(C.SelectContent,{children:V.map(e=>(0,t.jsx)(C.SelectItem,{value:e.value,children:e.nativeName},e.value))})]})]})})]})}var H=e.i(27069),O=e.i(91967),q=e.i(5978),G=e.i(22528),U=e.i(36589),$=e.i(66033),Z=e.i(23405),X=e.i(77624),Y=e.i(87620),J=e.i(87342),Q=["PageUp","PageDown"],ee=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],et={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ei="Slider",[en,es,ea]=(0,J.createCollection)(ei),[el,er]=(0,G.createContextScope)(ei,[ea]),[eo,ec]=el(ei),ed=i.forwardRef((e,n)=>{let{name:s,min:a=0,max:l=100,step:r=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[a],value:g,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:f,...x}=e,v=i.useRef(new Set),b=i.useRef(0),w="horizontal"===o,[j=[],y]=(0,U.useControllableState)({prop:g,defaultProp:u,onChange:e=>{let t=[...v.current];t[b.current]?.focus(),m(e)}}),S=i.useRef(j);function k(e,t,{commit:i}={commit:!1}){let n,s=(String(r).split(".")[1]||"").length,o=Math.round((Math.round((e-a)/r)*r+a)*(n=Math.pow(10,s)))/n,c=(0,H.clamp)(o,[a,l]);y((e=[])=>{let n=function(e=[],t,i){let n=[...e];return n[i]=t,n.sort((e,t)=>e-t)}(e,c,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,i)=>e[i+1]-t))>=t;return!0}(n,d*r))return e;{b.current=n.indexOf(c);let t=String(n)!==String(e);return t&&i&&h(n),t?n:e}})}return(0,t.jsx)(eo,{scope:e.__scopeSlider,name:s,disabled:c,min:a,max:l,valueIndexToChangeRef:b,thumbs:v.current,values:j,orientation:o,form:f,children:(0,t.jsx)(en.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(en.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(w?em:eh,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:(0,O.composeEventHandlers)(x.onPointerDown,()=>{c||(S.current=j)}),min:a,max:l,inverted:p,onSlideStart:c?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let i=e.map(e=>Math.abs(e-t)),n=Math.min(...i);return i.indexOf(n)}(j,e);k(e,t)},onSlideMove:c?void 0:function(e){k(e,b.current)},onSlideEnd:c?void 0:function(){let e=S.current[b.current];j[b.current]!==e&&h(j)},onHomeKeyDown:()=>!c&&k(a,0,{commit:!0}),onEndKeyDown:()=>!c&&k(l,j.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){let i=Q.includes(e.key)||e.shiftKey&&ee.includes(e.key),n=b.current;k(j[n]+r*(i?10:1)*t,n,{commit:!0})}}})})})})});ed.displayName=ei;var[eu,eg]=el(ei,{startEdge:"left",endEdge:"right",size:"width",direction:1}),em=i.forwardRef((e,n)=>{let{min:s,max:a,dir:l,inverted:r,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...g}=e,[m,h]=i.useState(null),p=(0,q.useComposedRefs)(n,e=>h(e)),f=i.useRef(void 0),x=(0,$.useDirection)(l),v="ltr"===x,b=v&&!r||!v&&r;function w(e){let t=f.current||m.getBoundingClientRect(),i=eC([0,t.width],b?[s,a]:[a,s]);return f.current=t,i(e-t.left)}return(0,t.jsx)(eu,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(ep,{dir:x,"data-orientation":"horizontal",...g,ref:p,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=w(e.clientX);o?.(t)},onSlideMove:e=>{let t=w(e.clientX);c?.(t)},onSlideEnd:()=>{f.current=void 0,d?.()},onStepKeyDown:e=>{let t=et[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),eh=i.forwardRef((e,n)=>{let{min:s,max:a,inverted:l,onSlideStart:r,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...u}=e,g=i.useRef(null),m=(0,q.useComposedRefs)(n,g),h=i.useRef(void 0),p=!l;function f(e){let t=h.current||g.current.getBoundingClientRect(),i=eC([0,t.height],p?[a,s]:[s,a]);return h.current=t,i(e-t.top)}return(0,t.jsx)(eu,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:(0,t.jsx)(ep,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=f(e.clientY);r?.(t)},onSlideMove:e=>{let t=f(e.clientY);o?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=et[p?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),ep=i.forwardRef((e,i)=>{let{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:l,onHomeKeyDown:r,onEndKeyDown:o,onStepKeyDown:c,...d}=e,u=ec(ei,n);return(0,t.jsx)(Y.Primitive.span,{...d,ref:i,onKeyDown:(0,O.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(r(e),e.preventDefault()):"End"===e.key?(o(e),e.preventDefault()):Q.concat(ee).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,O.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,O.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,O.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),l(e))})})}),ef="SliderTrack",ex=i.forwardRef((e,i)=>{let{__scopeSlider:n,...s}=e,a=ec(ef,n);return(0,t.jsx)(Y.Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:i})});ex.displayName=ef;var ev="SliderRange",eb=i.forwardRef((e,n)=>{let{__scopeSlider:s,...a}=e,l=ec(ev,s),r=eg(ev,s),o=i.useRef(null),c=(0,q.useComposedRefs)(n,o),d=l.values.length,u=l.values.map(e=>ek(e,l.min,l.max)),g=d>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(Y.Primitive.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...a,ref:c,style:{...e.style,[r.startEdge]:g+"%",[r.endEdge]:m+"%"}})});eb.displayName=ev;var ew="SliderThumb",ej=i.forwardRef((e,n)=>{let s=es(e.__scopeSlider),[a,l]=i.useState(null),r=(0,q.useComposedRefs)(n,e=>l(e)),o=i.useMemo(()=>a?s().findIndex(e=>e.ref.current===a):-1,[s,a]);return(0,t.jsx)(ey,{...e,ref:r,index:o})}),ey=i.forwardRef((e,n)=>{var s,a,l,r,o;let c,d,{__scopeSlider:u,index:g,name:m,...h}=e,p=ec(ew,u),f=eg(ew,u),[x,v]=i.useState(null),b=(0,q.useComposedRefs)(n,e=>v(e)),w=!x||p.form||!!x.closest("form"),j=(0,X.useSize)(x),y=p.values[g],S=void 0===y?0:ek(y,p.min,p.max),k=(s=g,(a=p.values.length)>2?`Value ${s+1} of ${a}`:2===a?["Minimum","Maximum"][s]:void 0),C=j?.[f.size],M=C?(l=C,r=S,o=f.direction,d=eC([0,50],[0,c=l/2]),(c-d(r)*o)*o):0;return i.useEffect(()=>{if(x)return p.thumbs.add(x),()=>{p.thumbs.delete(x)}},[x,p.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${S}% + ${M}px)`},children:[(0,t.jsx)(en.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(Y.Primitive.span,{role:"slider","aria-label":e["aria-label"]||k,"aria-valuemin":p.min,"aria-valuenow":y,"aria-valuemax":p.max,"aria-orientation":p.orientation,"data-orientation":p.orientation,"data-disabled":p.disabled?"":void 0,tabIndex:p.disabled?void 0:0,...h,ref:b,style:void 0===y?{display:"none"}:e.style,onFocus:(0,O.composeEventHandlers)(e.onFocus,()=>{p.valueIndexToChangeRef.current=g})})}),w&&(0,t.jsx)(eS,{name:m??(p.name?p.name+(p.values.length>1?"[]":""):void 0),form:p.form,value:y},g)]})});ej.displayName=ew;var eS=i.forwardRef(({__scopeSlider:e,value:n,...s},a)=>{let l=i.useRef(null),r=(0,q.useComposedRefs)(l,a),o=(0,Z.usePrevious)(n);return i.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(o!==n&&t){let i=new Event("input",{bubbles:!0});t.call(e,n),e.dispatchEvent(i)}},[o,n]),(0,t.jsx)(Y.Primitive.input,{style:{display:"none"},...s,ref:r,defaultValue:n})});function ek(e,t,i){return(0,H.clamp)(100/(i-t)*(e-t),[0,100])}function eC(e,t){return i=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(i-e[0])}}eS.displayName="RadioBubbleInput",e.s(["Range",()=>eb,"Root",()=>ed,"Slider",()=>ed,"SliderRange",()=>eb,"SliderThumb",()=>ej,"SliderTrack",()=>ex,"Thumb",()=>ej,"Track",()=>ex,"createSliderScope",()=>er],29991);var eM=e.i(29991),eM=eM;function eI({className:e,defaultValue:n,value:s,min:a=0,max:l=100,...r}){let o=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(n)?n:[a,l],[s,n,a,l]);return(0,t.jsxs)(eM.Root,{"data-slot":"slider",defaultValue:n,value:s,min:a,max:l,className:(0,y.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...r,children:[(0,t.jsx)(eM.Track,{"data-slot":"slider-track",className:(0,y.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(eM.Range,{"data-slot":"slider-range",className:(0,y.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(e,i)=>(0,t.jsx)(eM.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},i))]})}let eN=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],eT=eN.length-1;function eA(e){let t=0,i=Math.abs(e-eN[0]);for(let n=1;n<eN.length;n++){let s=Math.abs(e-eN[n]);s<i&&(i=s,t=n)}return t}function eD({id:e,testId:n,value:s,onChange:a,onBlur:l,defaultSeconds:r=1800}){var o;let c,d,u=(""===s?r:parseInt(s,10))||r,[g,m]=(0,i.useState)(()=>eA(u)),h=eA(u);h!==g&&eN[g]!==u&&m(h);let p=(0,i.useCallback)(([e])=>{m(e),a(String(eN[e]))},[a]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(eI,{id:e,"data-testid":n,min:0,max:eT,step:1,value:[g],onValueChange:p,onValueCommit:()=>l(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-end text-xs tabular-nums",children:(c=Math.floor((o=eN[g])/3600),d=Math.round(o%3600/60),0===c?`${d}m`:0===d?`${c}h`:`${c}h ${d}m`)})]})}let eF=[{value:N.EditorType.VsCode,label:"VS Code"},{value:N.EditorType.Cursor,label:"Cursor"},{value:N.EditorType.Windsurf,label:"Windsurf"},{value:N.EditorType.Zed,label:"Zed"},{value:N.EditorType.Antigravity,label:"Antigravity"}],eP=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],eE=[{id:"language",labelKey:"settings.sections.language",icon:g.Globe},{id:"agent",labelKey:"settings.sections.agent",icon:s.Bot},{id:"environment",labelKey:"settings.sections.environment",icon:a.Terminal},{id:"workflow",labelKey:"settings.sections.workflow",icon:l.GitBranch},{id:"ci",labelKey:"settings.sections.ci",icon:r.Activity},{id:"stage-timeouts",labelKey:"settings.sections.timeouts",icon:x.Timer},{id:"notifications",labelKey:"settings.sections.notifications",icon:c},{id:"feature-flags",labelKey:"settings.sections.flags",icon:d},{id:"interactive-agent",labelKey:"settings.sections.chat",icon:v.MessageSquare},{id:"fab-layout",labelKey:"settings.sections.layout",icon:b},{id:"database",labelKey:"settings.sections.database",icon:u}];function eR({label:e,description:i,htmlFor:n,children:s}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(S.Label,{htmlFor:n,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),i?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:i}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}function ez({label:e,description:i,id:n,testId:s,checked:a,onChange:l,disabled:r}){return(0,t.jsx)(eR,{label:e,description:i,htmlFor:n,children:(0,t.jsx)(k.Switch,{id:n,"data-testid":s,checked:a,onCheckedChange:l,disabled:r,className:(0,y.cn)("cursor-pointer",r&&"cursor-not-allowed opacity-50")})})}function eB({icon:e,title:i,description:n,badge:s,testId:a,children:l}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":a,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:i}),s?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:s}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:n})]}),(0,t.jsx)("div",{className:"px-4",children:l})]})}function eL({id:e,testId:i,value:n,onChange:s,onBlur:a,placeholder:l,min:r=1,max:o,step:c=1,suffix:d}){let{t:u}=(0,j.useTranslation)("web"),g=""===n?void 0:parseInt(n,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{s(String(Math.max(r,(g??parseInt(l,10))-c)))},onMouseUp:a,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":u("common.decrease"),children:(0,t.jsx)(m.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":i,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:n,placeholder:l,onChange:e=>{s(e.target.value.replace(/[^0-9]/g,""))},onBlur:a,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=g??parseInt(l,10),s(String(null!=o?Math.min(o,e+c):e+c))},onMouseUp:a,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":u("common.increase"),children:(0,t.jsx)(h.Plus,{className:"h-3 w-3"})})]}),d?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:d}):null]})}function e_({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function eK({children:e,links:i}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=i&&i.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:i.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(p.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function eV({settings:e,shepHome:o,dbFileSize:g,availableTerminals:m}){let{t:h}=(0,j.useTranslation)("web"),{showSaving:p,showSaved:S,save:k}=function(){let{t:e}=(0,j.useTranslation)("web"),[t,n]=(0,i.useTransition)(),[s,a]=(0,i.useState)(!1),[l,r]=(0,i.useState)(!1),o=(0,i.useRef)(null),c=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{t&&!s&&(a(!0),c.current=!1,o.current=setTimeout(()=>{o.current=null,c.current&&(a(!1),r(!0),setTimeout(()=>r(!1),2e3))},350)),!t&&s&&(c.current=!0,o.current||(a(!1),r(!0),setTimeout(()=>r(!1),2e3)))},[t,s]),{showSaving:s,showSaved:l,save:(0,i.useCallback)(t=>{n(async()=>{let i=await I(t);i.success||w.toast.error(i.error??e("settings.failedToSave"))})},[n,e])}}(),M=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1,inventory:!1},[T,A]=(0,i.useState)(e.agent.type),[D,P]=(0,i.useState)(e.environment.defaultEditor),[E,R]=(0,i.useState)(e.environment.shellPreference),[z,B]=(0,i.useState)(e.environment.terminalPreference??N.TerminalType.System),K=m?m.filter(e=>e.available):[{id:N.TerminalType.System,name:h("settings.environment.systemTerminal"),available:!0}],[V,H]=(0,i.useState)(e.workflow.openPrOnImplementationComplete),[O,q]=(0,i.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[G,U]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPrd),[$,Z]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPlan),[X,Y]=(0,i.useState)(e.workflow.approvalGateDefaults.allowMerge),[J,Q]=(0,i.useState)(e.workflow.enableEvidence),[ee,et]=(0,i.useState)(e.workflow.commitEvidence),[ei,en]=(0,i.useState)(!1!==e.workflow.ciWatchEnabled),[es,ea]=(0,i.useState)(!1!==e.workflow.hideCiStatus),[el,er]=(0,i.useState)(!1!==e.workflow.defaultFastMode),[eo,ec]=(0,i.useState)((e.workflow.autoArchiveDelayMinutes??10)>0),[ed,eu]=(0,i.useState)(String(e.workflow.autoArchiveDelayMinutes??10)),[eg,em]=(0,i.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[eh,ep]=(0,i.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[ef,ex]=(0,i.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[ev,eb]=(0,i.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),ew=e.workflow.stageTimeouts,[ej,ey]=(0,i.useState)(String(Math.round((ew?.analyzeMs??18e5)/1e3))),[eS,ek]=(0,i.useState)(String(Math.round((ew?.requirementsMs??18e5)/1e3))),[eC,eM]=(0,i.useState)(String(Math.round((ew?.researchMs??18e5)/1e3))),[eI,eN]=(0,i.useState)(String(Math.round((ew?.planMs??18e5)/1e3))),[eT,eA]=(0,i.useState)(String(Math.round((ew?.implementMs??18e5)/1e3))),[eV,eW]=(0,i.useState)(String(Math.round((ew?.fastImplementMs??18e5)/1e3))),[eH,eO]=(0,i.useState)(String(Math.round((ew?.mergeMs??18e5)/1e3))),eq=e.workflow.analyzeRepoTimeouts,[eG,eU]=(0,i.useState)(String(Math.round((eq?.analyzeMs??6e5)/1e3))),e$=e.interactiveAgent??{enabled:!0,autoTimeoutMinutes:15,maxConcurrentSessions:3},[eZ,eX]=(0,i.useState)(e$.enabled),[eY,eJ]=(0,i.useState)(String(e$.autoTimeoutMinutes)),[eQ,e0]=(0,i.useState)(String(e$.maxConcurrentSessions)),e1=e.fabLayout??{swapPosition:!1},[e3,e2]=(0,i.useState)(e1.swapPosition),[e4,e5]=(0,i.useState)(e.notifications.inApp.enabled),[e8,e6]=(0,i.useState)({...e.notifications.events}),[e7,e9]=(0,i.useState)({...M}),te=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",tt=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",ti=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",tn=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",ts=ew?.analyzeMs!=null?String(Math.round(ew.analyzeMs/1e3)):"",ta=ew?.requirementsMs!=null?String(Math.round(ew.requirementsMs/1e3)):"",tl=ew?.researchMs!=null?String(Math.round(ew.researchMs/1e3)):"",tr=ew?.planMs!=null?String(Math.round(ew.planMs/1e3)):"",to=ew?.implementMs!=null?String(Math.round(ew.implementMs/1e3)):"",tc=ew?.fastImplementMs!=null?String(Math.round(ew.fastImplementMs/1e3)):"",td=ew?.mergeMs!=null?String(Math.round(ew.mergeMs/1e3)):"",tu=eq?.analyzeMs!=null?String(Math.round(eq.analyzeMs/1e3)):"";function tg(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function tm(e){if(void 0===e)return;let t=tg(e);return null!=t?1e3*t:void 0}function th(e={}){let t=tg(e.ciTimeout??eh),i=e.autoArchiveEnabled??eo,n=parseInt(e.autoArchiveDelay??ed,10);return{workflow:{openPrOnImplementationComplete:e.openPr??V,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??O,allowPrd:e.allowPrd??G,allowPlan:e.allowPlan??$,allowMerge:e.allowMerge??X},enableEvidence:e.enableEvidence??J,commitEvidence:e.commitEvidence??ee,ciWatchEnabled:e.ciWatchEnabled??ei,hideCiStatus:e.hideCiStatus??es,defaultFastMode:e.defaultFastMode??el,autoArchiveDelayMinutes:i?Number.isNaN(n)||n<1?10:n:0,ciMaxFixAttempts:tg(e.ciMaxFix??eg),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:tg(e.ciLogMax??ef),ciWatchPollIntervalSeconds:tg(e.ciPollInterval??ev),stageTimeouts:{analyzeMs:tm(e.analyzeTimeout??ej),requirementsMs:tm(e.requirementsTimeout??eS),researchMs:tm(e.researchTimeout??eC),planMs:tm(e.planTimeout??eI),implementMs:tm(e.implementTimeout??eT),fastImplementMs:tm(e.fastImplementTimeout??eV),mergeMs:tm(e.mergeTimeout??eH)},analyzeRepoTimeouts:{analyzeMs:tm(e.analyzeRepoTimeout??eG)}}}}function tp(e={}){return{notifications:{inApp:{enabled:e.inApp??e4},events:e.events??e8}}}let[tf,tx]=(0,i.useState)("agent");(0,i.useEffect)(()=>{let e=eE.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&tx(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let i of e)t.observe(i);return()=>t.disconnect()},[]);let tv=(0,i.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:h("settings.title")}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,y.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",p?"opacity-100":"opacity-0"),children:h("settings.saving")}),(0,t.jsxs)("span",{className:(0,y.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",S&&!p?"opacity-100":"opacity-0"),children:[(0,t.jsx)(n.Check,{className:"h-3 w-3"}),h("settings.saved")]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:eE.map(e=>{let i=e.icon,n=tf===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>tv(e.id),className:(0,y.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",n?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(i,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:h(e.labelKey)})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("div",{id:"section-language",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:(0,t.jsx)(W,{language:e.user?.preferredLanguage??N.Language.English})}),(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(eB,{icon:s.Bot,title:h("settings.agent.sectionTitle"),description:h("settings.agent.sectionDescription"),testId:"agent-settings-section",children:(0,t.jsx)(eR,{label:h("settings.agent.agentAndModel"),description:h("settings.agent.agentAndModelDescription"),htmlFor:"agent-model-picker",children:(0,t.jsx)(_.AgentModelPicker,{initialAgentType:T,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>A(e),className:"w-55"})})}),(0,t.jsx)(eK,{links:[{label:h("settings.agent.links.agentSystem"),href:"https://github.com/shep-ai/shep/blob/main/docs/architecture/agent-system.md"},{label:h("settings.agent.links.addingAgents"),href:"https://github.com/shep-ai/shep/blob/main/docs/development/adding-agents.md"},{label:h("settings.agent.links.configurationGuide"),href:"https://github.com/shep-ai/shep/blob/main/docs/guides/configuration.md"}],children:h("settings.agent.hint")})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:a.Terminal,title:h("settings.environment.sectionTitle"),description:h("settings.environment.sectionDescription"),testId:"environment-settings-section",children:[(0,t.jsx)(eR,{label:h("settings.environment.defaultEditor"),description:h("settings.environment.defaultEditorDescription"),htmlFor:"default-editor",children:(0,t.jsxs)(C.Select,{value:D,onValueChange:e=>{P(e),k({environment:{defaultEditor:e,shellPreference:E,terminalPreference:z}})},children:[(0,t.jsx)(C.SelectTrigger,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(C.SelectValue,{})}),(0,t.jsx)(C.SelectContent,{children:eF.map(e=>{var i;let n=(i=e.value)&&i in L?L[i]:F;return(0,t.jsx)(C.SelectItem,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(eR,{label:h("settings.environment.shell"),description:h("settings.environment.shellDescription"),htmlFor:"shell-preference",children:(0,t.jsxs)(C.Select,{value:E,onValueChange:e=>{R(e),k({environment:{defaultEditor:D,shellPreference:e,terminalPreference:z}})},children:[(0,t.jsx)(C.SelectTrigger,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(C.SelectValue,{})}),(0,t.jsx)(C.SelectContent,{children:eP.map(e=>(0,t.jsx)(C.SelectItem,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(eR,{label:h("settings.environment.terminal"),description:h("settings.environment.terminalDescription"),htmlFor:"terminal-preference",children:(0,t.jsxs)(C.Select,{value:z,onValueChange:e=>{B(e),k({environment:{defaultEditor:D,shellPreference:E,terminalPreference:e}})},children:[(0,t.jsx)(C.SelectTrigger,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(C.SelectValue,{})}),(0,t.jsx)(C.SelectContent,{children:K.map(e=>(0,t.jsx)(C.SelectItem,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(eK,{links:[{label:h("settings.environment.links.configurationGuide"),href:"https://github.com/shep-ai/shep/blob/main/docs/guides/configuration.md"}],children:h("settings.environment.hint")})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:l.GitBranch,title:h("settings.workflow.title"),description:h("settings.workflow.sectionDescription"),testId:"workflow-settings-section",children:[(0,t.jsx)(ez,{label:h("settings.workflow.defaultFastMode"),description:h("settings.workflow.defaultFastModeDescription"),id:"default-fast-mode",testId:"switch-default-fast-mode",checked:el,onChange:e=>{er(e),k(th({defaultFastMode:e}))}}),(0,t.jsx)(e_,{children:h("settings.workflow.subsections.approve")}),(0,t.jsx)(ez,{label:h("settings.workflow.autoApprovePrd"),description:h("settings.workflow.autoApprovePrdDescription"),id:"allow-prd",testId:"switch-allow-prd",checked:G,onChange:e=>{U(e),k(th({allowPrd:e}))}}),(0,t.jsx)(ez,{label:h("settings.workflow.autoApprovePlan"),description:h("settings.workflow.autoApprovePlanDescription"),id:"allow-plan",testId:"switch-allow-plan",checked:$,onChange:e=>{Z(e),k(th({allowPlan:e}))}}),(0,t.jsx)(ez,{label:h("settings.workflow.autoApproveMerge"),description:h("settings.workflow.autoApproveMergeDescription"),id:"allow-merge",testId:"switch-allow-merge",checked:X,onChange:e=>{Y(e),k(th({allowMerge:e}))}}),(0,t.jsx)(e_,{children:h("settings.workflow.subsections.evidence")}),(0,t.jsx)(ez,{label:h("settings.workflow.collectEvidence"),description:h("settings.workflow.collectEvidenceDescription"),id:"enable-evidence",testId:"switch-enable-evidence",checked:J,onChange:e=>{Q(e),e?k(th({enableEvidence:e})):(et(!1),k(th({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(ez,{label:h("settings.workflow.addEvidenceToPr"),description:h("settings.workflow.addEvidenceToPrDescription"),id:"commit-evidence",testId:"switch-commit-evidence",checked:ee,disabled:!J||!V,onChange:e=>{et(e),k(th({commitEvidence:e}))}}),(0,t.jsx)(e_,{children:h("settings.workflow.subsections.git")}),(0,t.jsx)(ez,{label:h("settings.workflow.pushOnComplete"),description:h("settings.workflow.pushOnCompleteDescription"),id:"push-on-complete",testId:"switch-push-on-complete",checked:O,onChange:e=>{q(e),k(th({pushOnComplete:e}))}}),(0,t.jsx)(ez,{label:h("settings.workflow.openPrOnComplete"),description:h("settings.workflow.openPrOnCompleteDescription"),id:"open-pr",testId:"switch-open-pr",checked:V,onChange:e=>{H(e),e?k(th({openPr:e})):(et(!1),k(th({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(ez,{label:h("settings.workflow.watchCiAfterPush"),description:h("settings.workflow.watchCiAfterPushDescription"),id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:ei,onChange:e=>{en(e),k(th({ciWatchEnabled:e}))}}),(0,t.jsx)(e_,{children:"Archive"}),(0,t.jsx)(ez,{label:"Auto-archive completed",description:"Automatically archive features after they reach the completed state",id:"auto-archive-enabled",testId:"switch-auto-archive-enabled",checked:eo,onChange:e=>{ec(e),k(th({autoArchiveEnabled:e}))}}),(0,t.jsx)(eR,{label:"Archive delay",description:"Minutes to wait after completion before archiving (1–1440)",htmlFor:"auto-archive-delay",children:(0,t.jsx)(eL,{id:"auto-archive-delay",testId:"input-auto-archive-delay",value:ed,placeholder:"10",min:1,max:1440,suffix:"min",onChange:e=>{eu(e)},onBlur:()=>{if(!eo)return;let e=parseInt(ed,10),t=Number.isNaN(e)?10:Math.min(1440,Math.max(1,e));eu(String(t)),k(th({autoArchiveDelay:String(t)}))}})})]}),(0,t.jsx)(eK,{links:[{label:h("settings.workflow.links.approvalGates"),href:"https://github.com/shep-ai/shep/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:h("settings.workflow.links.pushAndPrFlags"),href:"https://github.com/shep-ai/shep/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:h("settings.workflow.hint")})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:r.Activity,title:h("settings.ci.title"),description:h("settings.ci.description"),testId:"ci-settings-section",children:[(0,t.jsx)(eR,{label:h("settings.ci.maxFixAttempts"),description:h("settings.ci.maxFixAttemptsDescription"),htmlFor:"ci-max-fix",children:(0,t.jsx)(eL,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:eg,onChange:em,onBlur:()=>{eg!==te&&k(th({ciMaxFix:eg}))},min:1,max:10})}),(0,t.jsx)(eR,{label:h("settings.ci.watchTimeout"),description:h("settings.ci.watchTimeoutDescription"),htmlFor:"ci-timeout",children:(0,t.jsx)(eL,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:eh,onChange:ep,onBlur:()=>{eh!==tt&&k(th({ciTimeout:eh}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(eR,{label:h("settings.ci.maxLogSize"),description:h("settings.ci.maxLogSizeDescription"),htmlFor:"ci-log-max",children:(0,t.jsx)(eL,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:ef,onChange:ex,onBlur:()=>{ef!==ti&&k(th({ciLogMax:ef}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(eR,{label:h("settings.ci.pollInterval"),description:h("settings.ci.pollIntervalDescription"),htmlFor:"ci-poll-interval",children:(0,t.jsx)(eL,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:ev,onChange:eb,onBlur:()=>{ev!==tn&&k(th({ciPollInterval:ev}))},min:5,step:5,suffix:"sec"})}),(0,t.jsx)(ez,{label:h("settings.ci.hideCiStatus"),description:h("settings.ci.hideCiStatusDescription"),id:"hide-ci-status",testId:"switch-hide-ci-status",checked:es,onChange:e=>{ea(e),k(th({hideCiStatus:e}))}})]}),(0,t.jsx)(eK,{links:[{label:h("settings.ci.links.cicdPipeline"),href:"https://github.com/shep-ai/shep/blob/main/docs/development/cicd.md"},{label:h("settings.ci.links.ciSecurityGates"),href:"https://github.com/shep-ai/shep/blob/main/specs/003-cicd-security-gates/spec.md"}],children:h("settings.ci.hint")})]}),(0,t.jsxs)("div",{id:"section-stage-timeouts",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:x.Timer,title:h("settings.stageTimeouts.title"),description:h("settings.stageTimeouts.description"),testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(e_,{children:h("settings.stageTimeouts.subsections.featureAgent")}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.analyze"),description:h("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze",children:(0,t.jsx)(eD,{id:"timeout-analyze",testId:"timeout-analyze-input",value:ej,onChange:ey,onBlur:()=>{ej!==ts&&k(th({analyzeTimeout:ej}))},defaultSeconds:1800})}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.requirements"),description:h("settings.stageTimeouts.requirementsDescription"),htmlFor:"timeout-requirements",children:(0,t.jsx)(eD,{id:"timeout-requirements",testId:"timeout-requirements-input",value:eS,onChange:ek,onBlur:()=>{eS!==ta&&k(th({requirementsTimeout:eS}))},defaultSeconds:1800})}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.research"),description:h("settings.stageTimeouts.researchDescription"),htmlFor:"timeout-research",children:(0,t.jsx)(eD,{id:"timeout-research",testId:"timeout-research-input",value:eC,onChange:eM,onBlur:()=>{eC!==tl&&k(th({researchTimeout:eC}))},defaultSeconds:1800})}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.plan"),description:h("settings.stageTimeouts.planDescription"),htmlFor:"timeout-plan",children:(0,t.jsx)(eD,{id:"timeout-plan",testId:"timeout-plan-input",value:eI,onChange:eN,onBlur:()=>{eI!==tr&&k(th({planTimeout:eI}))},defaultSeconds:1800})}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.implement"),description:h("settings.stageTimeouts.implementDescription"),htmlFor:"timeout-implement",children:(0,t.jsx)(eD,{id:"timeout-implement",testId:"timeout-implement-input",value:eT,onChange:eA,onBlur:()=>{eT!==to&&k(th({implementTimeout:eT}))},defaultSeconds:1800})}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.fastImplement"),description:h("settings.stageTimeouts.fastImplementDescription"),htmlFor:"timeout-fast-implement",children:(0,t.jsx)(eD,{id:"timeout-fast-implement",testId:"timeout-fast-implement-input",value:eV,onChange:eW,onBlur:()=>{eV!==tc&&k(th({fastImplementTimeout:eV}))},defaultSeconds:1800})}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.merge"),description:h("settings.stageTimeouts.mergeDescription"),htmlFor:"timeout-merge",children:(0,t.jsx)(eD,{id:"timeout-merge",testId:"timeout-merge-input",value:eH,onChange:eO,onBlur:()=>{eH!==td&&k(th({mergeTimeout:eH}))},defaultSeconds:1800})}),(0,t.jsx)(e_,{children:h("settings.stageTimeouts.subsections.analyzeRepoAgent")}),(0,t.jsx)(eR,{label:h("settings.stageTimeouts.analyze"),description:h("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(eD,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:eG,onChange:eU,onBlur:()=>{eG!==tu&&k(th({analyzeRepoTimeout:eG}))},defaultSeconds:600})})]}),(0,t.jsx)(eK,{children:h("settings.stageTimeouts.hint")})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:c,title:h("settings.notifications.title"),description:h("settings.notifications.sectionDescription"),testId:"notification-settings-section",children:[(0,t.jsx)(e_,{children:h("settings.notifications.channels")}),(0,t.jsx)(ez,{label:h("settings.notifications.inAppLabel"),description:h("settings.notifications.inAppDescription"),id:"notif-in-app",testId:"switch-in-app",checked:e4,onChange:e=>{e5(e),k(tp({inApp:e}))}}),(0,t.jsx)(e_,{children:h("settings.notifications.subsections.agentEvents")}),(0,t.jsx)(ez,{label:h("settings.notifications.events.agentStarted"),id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:e8.agentStarted,onChange:e=>{let t={...e8,agentStarted:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.phaseCompleted"),id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:e8.phaseCompleted,onChange:e=>{let t={...e8,phaseCompleted:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.waitingApproval"),id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:e8.waitingApproval,onChange:e=>{let t={...e8,waitingApproval:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.agentCompleted"),id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:e8.agentCompleted,onChange:e=>{let t={...e8,agentCompleted:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.agentFailed"),id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:e8.agentFailed,onChange:e=>{let t={...e8,agentFailed:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(e_,{children:h("settings.notifications.subsections.pullRequestEvents")}),(0,t.jsx)(ez,{label:h("settings.notifications.events.prMerged"),id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:e8.prMerged,onChange:e=>{let t={...e8,prMerged:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.prClosed"),id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:e8.prClosed,onChange:e=>{let t={...e8,prClosed:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.prChecksPassed"),id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:e8.prChecksPassed,onChange:e=>{let t={...e8,prChecksPassed:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.prChecksFailed"),id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:e8.prChecksFailed,onChange:e=>{let t={...e8,prChecksFailed:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.prBlocked"),id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:e8.prBlocked,onChange:e=>{let t={...e8,prBlocked:e};e6(t),k(tp({events:t}))}}),(0,t.jsx)(ez,{label:h("settings.notifications.events.mergeReviewReady"),id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:e8.mergeReviewReady,onChange:e=>{let t={...e8,mergeReviewReady:e};e6(t),k(tp({events:t}))}})]}),(0,t.jsx)(eK,{links:[{label:h("settings.notifications.links.notificationSystem"),href:"https://github.com/shep-ai/shep/blob/main/specs/021-agent-notifications/spec.yaml"}],children:h("settings.notifications.hint")})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:d,title:h("settings.featureFlags.title"),description:h("settings.featureFlags.sectionDescription"),badge:h("settings.featureFlags.badge"),testId:"feature-flags-settings-section",children:[(0,t.jsx)(ez,{label:h("settings.featureFlags.skills"),description:h("settings.featureFlags.skillsDescription"),id:"flag-skills",testId:"switch-flag-skills",checked:e7.skills,onChange:e=>{let t={...e7,skills:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.deployments"),description:h("settings.featureFlags.deploymentsDescription"),id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:e7.envDeploy,onChange:e=>{let t={...e7,envDeploy:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.debug"),description:h("settings.featureFlags.debugDescription"),id:"flag-debug",testId:"switch-flag-debug",checked:e7.debug,onChange:e=>{let t={...e7,debug:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.githubImport"),description:h("settings.featureFlags.githubImportDescription"),id:"flag-githubImport",testId:"switch-flag-githubImport",checked:e7.githubImport,onChange:e=>{let t={...e7,githubImport:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.adoptBranch"),description:h("settings.featureFlags.adoptBranchDescription"),id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:e7.adoptBranch,onChange:e=>{let t={...e7,adoptBranch:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.gitRebaseSync"),description:h("settings.featureFlags.gitRebaseSyncDescription"),id:"flag-gitRebaseSync",testId:"switch-flag-gitRebaseSync",checked:e7.gitRebaseSync,onChange:e=>{let t={...e7,gitRebaseSync:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.reactFileManager"),description:h("settings.featureFlags.reactFileManagerDescription"),id:"flag-reactFileManager",testId:"switch-flag-reactFileManager",checked:e7.reactFileManager,onChange:e=>{let t={...e7,reactFileManager:e};e9(t),k({featureFlags:t})}}),(0,t.jsx)(ez,{label:h("settings.featureFlags.inventory"),description:h("settings.featureFlags.inventoryDescription"),id:"flag-inventory",testId:"switch-flag-inventory",checked:e7.inventory,onChange:e=>{let t={...e7,inventory:e};e9(t),k({featureFlags:t})}})]}),(0,t.jsx)(eK,{children:h("settings.featureFlags.hint")})]}),(0,t.jsxs)("div",{id:"section-interactive-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:v.MessageSquare,title:h("settings.interactiveAgent.title"),description:h("settings.interactiveAgent.description"),testId:"interactive-agent-settings-section",children:[(0,t.jsx)(ez,{label:h("settings.interactiveAgent.enableChatTab"),description:h("settings.interactiveAgent.enableChatTabDescription"),id:"interactive-agent-enabled",testId:"switch-interactive-agent-enabled",checked:eZ,onChange:e=>{eX(e),k({interactiveAgent:{enabled:e,autoTimeoutMinutes:parseInt(eY,10)||15,maxConcurrentSessions:parseInt(eQ,10)||3}})}}),(0,t.jsx)(eR,{label:h("settings.interactiveAgent.autoTimeout"),description:h("settings.interactiveAgent.autoTimeoutDescription"),htmlFor:"interactive-agent-timeout",children:(0,t.jsx)(eL,{id:"interactive-agent-timeout",testId:"input-interactive-agent-timeout",value:eY,placeholder:"15",min:1,max:120,suffix:"min",onChange:eJ,onBlur:()=>{let e=parseInt(eY,10),t=Number.isNaN(e)?15:Math.min(120,Math.max(1,e));eJ(String(t)),k({interactiveAgent:{enabled:eZ,autoTimeoutMinutes:t,maxConcurrentSessions:parseInt(eQ,10)||3}})}})}),(0,t.jsx)(eR,{label:h("settings.interactiveAgent.maxConcurrentSessions"),description:h("settings.interactiveAgent.maxConcurrentSessionsDescription"),htmlFor:"interactive-agent-sessions",children:(0,t.jsx)(eL,{id:"interactive-agent-sessions",testId:"input-interactive-agent-sessions",value:eQ,placeholder:"3",min:1,max:10,onChange:e0,onBlur:()=>{let e=parseInt(eQ,10),t=Number.isNaN(e)?3:Math.min(10,Math.max(1,e));e0(String(t)),k({interactiveAgent:{enabled:eZ,autoTimeoutMinutes:parseInt(eY,10)||15,maxConcurrentSessions:t}})}})})]}),(0,t.jsx)(eK,{children:h("settings.interactiveAgent.hint")})]}),(0,t.jsxs)("div",{id:"section-fab-layout",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(eB,{icon:b,title:h("settings.fabLayout.title"),description:h("settings.fabLayout.description"),testId:"fab-layout-settings-section",children:(0,t.jsx)(ez,{label:h("settings.fabLayout.swapPosition"),description:h("settings.fabLayout.swapPositionDescription"),id:"fab-swap-position",testId:"switch-fab-swap-position",checked:e3,onChange:e=>{e2(e),k({fabLayout:{swapPosition:e}})}})}),(0,t.jsx)(eK,{children:h("settings.fabLayout.hint")})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(eB,{icon:u,title:h("settings.database.title"),description:h("settings.database.sectionDescription"),testId:"database-settings-section",children:[(0,t.jsx)(eR,{label:h("settings.database.location"),description:h("settings.database.locationDescription"),children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:o})}),(0,t.jsx)(eR,{label:h("settings.database.size"),children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:g})})]}),(0,t.jsx)(eK,{links:[{label:h("settings.database.links.settingsService"),href:"https://github.com/shep-ai/shep/blob/main/docs/architecture/settings-service.md"},{label:h("settings.database.links.settingsSpec"),href:"https://github.com/shep-ai/shep/blob/main/specs/005-global-settings-service/spec.md"}],children:h("settings.database.hint")})]})]})]})}e.s(["SettingsPageClient",()=>eV],41952)}]);