@shepai/cli 1.171.0 → 1.172.0-pr528.108a424

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 (230) hide show
  1. package/apis/json-schema/AgentType.yaml +1 -0
  2. package/dist/packages/core/src/domain/generated/output.d.ts +1 -0
  3. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  4. package/dist/packages/core/src/domain/generated/output.js +1 -0
  5. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  6. package/dist/packages/core/src/infrastructure/di/container.js +3 -0
  7. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -1
  8. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.js +23 -0
  9. package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -1
  10. package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.js +1 -0
  11. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts +63 -0
  12. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts.map +1 -0
  13. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.js +494 -0
  14. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/codex.json +32 -0
  15. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/copilot.json +32 -0
  16. package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -1
  17. package/dist/src/presentation/tui/prompts/agent-select.prompt.js +5 -0
  18. package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -1
  19. package/dist/src/presentation/web/app/actions/check-agent-auth.js +18 -0
  20. package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts.map +1 -1
  21. package/dist/src/presentation/web/app/actions/get-all-agent-models.js +4 -2
  22. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts +1 -1
  23. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts.map +1 -1
  24. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.js +2 -0
  25. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.d.ts.map +1 -1
  26. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.js +1 -0
  27. package/dist/src/presentation/web/components/common/repo-group/repo-group.js +1 -1
  28. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts +1 -0
  29. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts.map +1 -1
  30. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.js +7 -0
  31. package/dist/src/presentation/web/components/features/settings/agent-settings-section.d.ts.map +1 -1
  32. package/dist/src/presentation/web/components/features/settings/agent-settings-section.js +11 -3
  33. package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts +1 -0
  34. package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts.map +1 -1
  35. package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.js +8 -0
  36. package/dist/translations/ar/tui.json +4 -0
  37. package/dist/translations/de/tui.json +4 -0
  38. package/dist/translations/en/tui.json +4 -0
  39. package/dist/translations/es/tui.json +4 -0
  40. package/dist/translations/fr/tui.json +4 -0
  41. package/dist/translations/he/tui.json +4 -0
  42. package/dist/translations/pt/tui.json +4 -0
  43. package/dist/translations/ru/tui.json +4 -0
  44. package/dist/tsconfig.build.tsbuildinfo +1 -1
  45. package/package.json +1 -1
  46. package/web/.next/BUILD_ID +1 -1
  47. package/web/.next/build-manifest.json +2 -2
  48. package/web/.next/fallback-build-manifest.json +2 -2
  49. package/web/.next/prerender-manifest.json +3 -3
  50. package/web/.next/required-server-files.js +3 -3
  51. package/web/.next/required-server-files.json +3 -3
  52. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  53. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  56. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  59. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
  62. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +38 -38
  65. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  68. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  71. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  72. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  74. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  77. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  78. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  79. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
  80. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  81. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  82. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +38 -38
  83. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  84. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  86. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  87. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  88. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  89. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  90. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  91. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  92. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  93. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  94. package/web/.next/server/app/_global-error.html +2 -2
  95. package/web/.next/server/app/_global-error.rsc +1 -1
  96. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  97. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  98. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  99. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  100. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  101. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  102. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  103. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  105. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  106. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  107. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  108. package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
  109. package/web/.next/server/app/features/page.js.nft.json +1 -1
  110. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  111. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  112. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  113. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  114. package/web/.next/server/app/skills/page/server-reference-manifest.json +13 -13
  115. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  116. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  117. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  118. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  119. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  120. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  121. package/web/.next/server/app/version/page.js.nft.json +1 -1
  122. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  123. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  124. package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js +1 -1
  125. package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js.map +1 -1
  126. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
  127. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  129. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  131. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js +1 -1
  133. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  137. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +1 -1
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
  140. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +1 -1
  142. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -1
  143. package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js +2 -2
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js +2 -2
  146. package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +1 -1
  147. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  148. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  149. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +1 -1
  150. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -1
  151. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +1 -1
  152. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -1
  153. package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
  154. package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -1
  155. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  156. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  157. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  158. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/_18886033._.js +1 -1
  160. package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
  161. package/web/.next/server/chunks/ssr/_1e08a336._.js +1 -1
  162. package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
  163. package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/{_f778f3ef._.js → _324beb75._.js} +2 -2
  165. package/web/.next/server/chunks/ssr/{_f778f3ef._.js.map → _324beb75._.js.map} +1 -1
  166. package/web/.next/server/chunks/ssr/_45496654._.js +1 -1
  167. package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
  168. package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
  169. package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
  171. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  172. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  173. package/web/.next/server/chunks/ssr/{_d50cde79._.js → _5e3cb0a7._.js} +2 -2
  174. package/web/.next/server/chunks/ssr/{_d50cde79._.js.map → _5e3cb0a7._.js.map} +1 -1
  175. package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
  176. package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
  177. package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
  178. package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
  179. package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
  180. package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
  181. package/web/.next/server/chunks/ssr/{_49447b3c._.js → _c9d3f255._.js} +2 -2
  182. package/web/.next/server/chunks/ssr/{_49447b3c._.js.map → _c9d3f255._.js.map} +1 -1
  183. package/web/.next/server/chunks/ssr/_df737cce._.js +1 -1
  184. package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
  185. package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
  186. package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
  187. package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
  188. package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
  189. package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
  190. package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
  191. package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
  192. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  193. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  194. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  195. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  196. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  197. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -1
  198. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  199. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  200. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  201. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  202. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  203. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  204. package/web/.next/server/pages/500.html +2 -2
  205. package/web/.next/server/server-reference-manifest.js +1 -1
  206. package/web/.next/server/server-reference-manifest.json +50 -50
  207. package/web/.next/static/chunks/01d34ca202152b33.js +1 -0
  208. package/web/.next/static/chunks/{4383bcae769740e7.js → 120279c82aa8aa25.js} +1 -1
  209. package/web/.next/static/chunks/2e32d8578aace93a.js +1 -0
  210. package/web/.next/static/chunks/{24dd6b3021c2d849.js → 41f5bb33ac4f3c7d.js} +1 -1
  211. package/web/.next/static/chunks/{02fe1303471793b9.js → 43cf78a6c49eb7c1.js} +2 -2
  212. package/web/.next/static/chunks/{aa077ab14015a8fd.js → 50b760a2c7ad03d3.js} +1 -1
  213. package/web/.next/static/chunks/{b93a918712cd4987.js → 6e10cf4513c1f54f.js} +1 -1
  214. package/web/.next/static/chunks/{9705f2a5695a4995.js → 8a486366e2878cbc.js} +1 -1
  215. package/web/.next/static/chunks/{5983ef48d50d2d2a.js → 947678ada7948442.js} +1 -1
  216. package/web/.next/static/chunks/{eff45ffddd85918c.js → b1b0c8ff51c0c2fc.js} +3 -3
  217. package/web/.next/static/chunks/{67a430796dea42a7.js → bd55a833b24ee17b.js} +1 -1
  218. package/web/.next/static/chunks/{6ee5d45de67d3547.js → c91571264851a71e.js} +3 -3
  219. package/web/.next/static/chunks/{3d182168cdc4c15c.js → cc832e47f53eb2c3.js} +1 -1
  220. package/web/.next/static/chunks/da504d7f1c40bce1.js +1 -0
  221. package/web/.next/static/chunks/dcf8bb4389557a76.css +1 -0
  222. package/web/.next/static/chunks/{0ce50b34df07306b.js → f8f647baf2e91a9d.js} +1 -1
  223. package/web/public/icons/agents/copilot.svg +12 -0
  224. package/web/.next/static/chunks/18d4601f068c700d.js +0 -1
  225. package/web/.next/static/chunks/a80bbfca8ee3d79b.js +0 -1
  226. package/web/.next/static/chunks/b14085e99b88e7f7.css +0 -1
  227. package/web/.next/static/chunks/bb962a996814718a.js +0 -1
  228. /package/web/.next/static/{akDn2qFk1krSwrjt4345P → S_u3qor6FkwObhA1F2xEj}/_buildManifest.js +0 -0
  229. /package/web/.next/static/{akDn2qFk1krSwrjt4345P → S_u3qor6FkwObhA1F2xEj}/_clientMiddlewareManifest.json +0 -0
  230. /package/web/.next/static/{akDn2qFk1krSwrjt4345P → S_u3qor6FkwObhA1F2xEj}/_ssgManifest.js +0 -0
@@ -1 +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)("404b5844ffa53da8b364e02a6ead76dd8be9c06c65",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),[e5,e4]=(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??e5},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:e5,onChange:e=>{e4(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)}]);
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)("40bec49950088e599eaa59910823e73b5b6fa62f0d",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),[e5,e4]=(0,i.useState)(e.notifications.inApp.enabled),[e8,e6]=(0,i.useState)({...e.notifications.events}),[e9,e7]=(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??e5},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:e5,onChange:e=>{e4(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:e9.skills,onChange:e=>{let t={...e9,skills:e};e7(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:e9.envDeploy,onChange:e=>{let t={...e9,envDeploy:e};e7(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:e9.debug,onChange:e=>{let t={...e9,debug:e};e7(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:e9.githubImport,onChange:e=>{let t={...e9,githubImport:e};e7(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:e9.adoptBranch,onChange:e=>{let t={...e9,adoptBranch:e};e7(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:e9.gitRebaseSync,onChange:e=>{let t={...e9,gitRebaseSync:e};e7(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:e9.reactFileManager,onChange:e=>{let t={...e9,reactFileManager:e};e7(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:e9.inventory,onChange:e=>{let t={...e9,inventory:e};e7(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)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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])},41413,e=>{"use strict";var t=e.i(20314),s=e.i(79054),r=e.i(23925),i=e.i(11345),n=e.i(76016),a=e.i(49398),o=e.i(2160),l=e.i(86782),u=e.i(29847),c=e.i(35364),h=e.i(90382),d=e.i(31777);function p({initialAgentType:e,initialModel:p,agentType:f,model:m,onAgentModelChange:y,onSave:v,saveError:b,saving:g,disabled:x,className:w,mode:S}){let[j,T]=s.useState(!1),[R,k]=s.useState([]),[C,O]=s.useState(!0),[I,E]=s.useState(f??e),[F,M]=s.useState(m??p),[Q,N]=s.useState(!1),[D,P]=s.useState(null),[U,A]=s.useState(0),[q,L]=s.useState(null);s.useEffect(()=>{(0,a.getAllAgentModels)().then(k).finally(()=>O(!1))},[]),s.useEffect(()=>{E(f??e)},[f,e]),s.useEffect(()=>{M(m??p)},[m,p]);let H=s.useRef(j);s.useEffect(()=>{let e=H.current;if(H.current=j,e&&!j){let e=setTimeout(()=>{A(0),L(null)},150);return()=>clearTimeout(e)}},[j]);let K=async(e,t)=>{if(T(!1),e===I&&t===F)return;if(P(null),"override"===S){E(e),M(t),y?.(e,t);return}let s=v??(async(e,t)=>(0,o.updateAgentAndModel)(e,t||null));N(!0);try{let r=await s(e,t);if(r&&"ok"in r&&!r.ok)return void P(r.error??"Failed to save");E(e),M(t),y?.(e,t)}catch{P("Failed to save")}finally{N(!1)}},z=b??D,B=(0,l.getAgentTypeIcon)(I),_=R.find(e=>e.agentType===I)?.label??I,V=F?(0,u.getModelMeta)(F).displayName||F:null,G=q?R.find(e=>e.agentType===q):null;return(0,t.jsxs)("div",{className:(0,d.cn)("flex flex-col gap-1",w),children:[(0,t.jsxs)(h.Popover,{open:j,onOpenChange:T,children:[(0,t.jsx)(h.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{type:"button",variant:"outline",role:"combobox","aria-expanded":j,disabled:(x??!1)||C||(g??!1)||Q,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(B,{className:"h-4 w-4 shrink-0"}),C?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:_}),V?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:V})]}):null]})]})})}),(0,t.jsx)(h.PopoverContent,{className:"z-[70] w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===U?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),R.map(e=>{let s=(0,l.getAgentTypeIcon)(e.agentType),i=I===e.agentType,a=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,d.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",i&&"bg-accent/50"),onClick:()=>{a?(L(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>A(1))})):K(e.agentType,"")},children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-start",children:e.label}),i&&!a?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,a?(0,t.jsx)(n.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:G?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{A(0),setTimeout(()=>L(null),220)},children:[(0,t.jsx)(i.ChevronLeft,{className:"h-3.5 w-3.5"}),G.label]}),G.models.map(e=>{let s=I===G.agentType&&F===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,d.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-start transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>K(G.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),s?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!z&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:z})]})}e.s(["AgentModelPicker",()=>p])},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);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 m=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),y=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:j,loading:T=!1,disabled:R=!1,notes:k,onNotesChange:C}){let O,I,E=(O=e.lastIndexOf("."))>=0?e.slice(O).toLowerCase():"",F=m.has(E)?p:".pdf"===E?d.default:y.has(E)?f.default:h.FileIcon,M=".pdf"===E?"bg-red-50 text-red-600":m.has(E)?"bg-blue-50 text-blue-600":y.has(E)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",Q=(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(Q){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"}),k?(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})}),!R&&(0,t.jsx)("button",{type:"button",onClick:j,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"})})]}),k?(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:k})}):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:k??"",onChange:e=>C(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):k?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:k}):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",M),children:(0,t.jsx)(F,{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)}),!R&&(0,t.jsx)("button",{type:"button",onClick:j,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(!m(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(!m(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 m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>m(e[s],t[s]))}var y=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:y.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 j(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 R=Symbol();function k(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==R?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function C(e,t){return"function"==typeof e?e(...t):!!e}function O(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",()=>O,"addToEnd",()=>j,"addToStart",()=>T,"ensureQueryFn",()=>k,"functionalUpdate",()=>a,"hashKey",()=>f,"hashQueryKeyByOptions",()=>p,"isServer",()=>i,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>m,"replaceData",()=>S,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>v,"shouldThrowError",()=>C,"skipToken",()=>R,"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(),m=e=>{"pending"===d.status&&(s?.(),d.resolve(e))},y=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(m).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?y(s):(h++,e.onFail?.(h,s),(0,t.sleep)(n).then(()=>p()?void 0:v()).then(()=>{c?y(s):b()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let s=new u(t);y(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=y(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=y(this.options);void 0!==e.data&&(this.setState(m(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.#m()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){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,...m(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 m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function y(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.#y=null,this.#v=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#b=void 0;#g=void 0;#x=void 0;#w;#S;#v;#y;#j;#T;#R;#k;#C;#O;#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.#F())}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.#M(),this.#Q(),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.#N(),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.#D();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.#O)&&this.#U(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.#N();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.noop)),t}#D(){this.#M();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.#k=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}#U(e){this.#Q(),this.#O=e,!r.environmentManager.isServer()&&!1!==(0,l.resolveEnabled)(this.options.enabled,this.#b)&&(0,l.isValidTimeout)(this.#O)&&0!==this.#O&&(this.#C=u.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#E()},this.#O))}#F(){this.#D(),this.#U(this.#P())}#M(){this.#k&&(u.timeoutManager.clearTimeout(this.#k),this.#k=void 0)}#Q(){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:m}=e,y={...m},v=!1;if(t._optimisticResults){let s=this.hasListeners(),a=!s&&h(e,t),o=s&&p(e,r,t,i);(a||o)&&(y={...y,...(0,n.fetchState)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(y.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:x}=y;s=y.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.#R?.state.data,this.#R):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.#j)s=this.#T;else try{this.#j=t.select,s=t.select(s),s=(0,l.replaceData)(a?.data,s,t),this.#T=s,this.#y=null}catch(e){this.#y=e}this.#y&&(b=this.#y,s=this.#T,g=Date.now(),x="error");let S="fetching"===y.fetchStatus,j="pending"===x,T="error"===x,R=j&&S,k=void 0!==s,C={status:x,fetchStatus:y.fetchStatus,isPending:j,isSuccess:"success"===x,isError:T,isInitialLoading:R,isLoading:R,data:s,dataUpdatedAt:y.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>d.dataUpdateCount||y.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!j,isLoadingError:T&&!k,isPaused:"paused"===y.fetchStatus,isPlaceholderData:v,isRefetchError:T&&k,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.#R=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.#A({listeners:s()})}#N(){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.#F()}#A(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 m=e.i(79054),y=e.i(34682);e.i(20314);var v=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),b=m.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=m.useContext(b),o=m.useContext(v),u=(0,y.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),m.useEffect(()=>{o.clearReset()},[o]);let d=!u.getQueryCache().get(c.queryHash),[p]=m.useState(()=>new t(u,c)),f=p.getOptimisticResult(c),x=!a&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=x?p.subscribe(i.notifyManager.batchCalls(e)):l.noop;return p.updateResult(),t},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),m.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)}]);