@shipit-ai/cli 1.164.2-pr11.36efb66 → 1.164.2-pr6.3fe19cf

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 (175) hide show
  1. package/dist/tsconfig.build.tsbuildinfo +1 -1
  2. package/package.json +2 -2
  3. package/web/.next/BUILD_ID +1 -1
  4. package/web/.next/build-manifest.json +3 -3
  5. package/web/.next/fallback-build-manifest.json +3 -3
  6. package/web/.next/prerender-manifest.json +3 -3
  7. package/web/.next/required-server-files.js +1 -1
  8. package/web/.next/required-server-files.json +1 -1
  9. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  10. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  11. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  12. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  13. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  14. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  15. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  16. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  17. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  19. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
  20. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  21. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  27. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  28. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  29. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  30. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  33. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  36. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  37. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  38. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  39. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
  40. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  43. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
  44. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  47. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  50. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  53. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/_global-error.html +1 -1
  56. package/web/.next/server/app/_global-error.rsc +1 -1
  57. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  58. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  59. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  60. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  61. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  62. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  63. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  64. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  66. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  67. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  68. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  69. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  70. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  71. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  72. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  73. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  75. package/web/.next/server/app/version/page.js.nft.json +1 -1
  76. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js +1 -1
  78. package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js.map +1 -1
  79. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  80. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  81. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  82. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  83. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  84. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  85. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  86. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  87. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  88. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0yky~xo._.js → [root-of-the-server]__0.b9wam._.js} +2 -2
  89. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0yky~xo._.js.map → [root-of-the-server]__0.b9wam._.js.map} +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js +1 -1
  91. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0frgz11._.js → [root-of-the-server]__05lzb~i._.js} +2 -2
  92. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0frgz11._.js.map → [root-of-the-server]__05lzb~i._.js.map} +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js.map +1 -1
  95. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0pti1a3._.js → [root-of-the-server]__0jp4rkd._.js} +2 -2
  96. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0pti1a3._.js.map → [root-of-the-server]__0jp4rkd._.js.map} +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__0oi7r67._.js +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js +1 -1
  100. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js +1 -1
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/{[root-of-the-server]__11dc42t._.js → [root-of-the-server]__0zjrc4e._.js} +2 -2
  104. package/web/.next/server/chunks/ssr/{[root-of-the-server]__11dc42t._.js.map → [root-of-the-server]__0zjrc4e._.js.map} +1 -1
  105. package/web/.next/server/chunks/ssr/_0__4si~._.js +1 -1
  106. package/web/.next/server/chunks/ssr/_0__4si~._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/_0_m17kl._.js +1 -1
  108. package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/_0d4miu.._.js +1 -1
  110. package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/_0e8ern9._.js +1 -1
  112. package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/_0ez.1o4._.js +1 -1
  114. package/web/.next/server/chunks/ssr/_0ez.1o4._.js.map +1 -1
  115. package/web/.next/server/chunks/ssr/{_128eao5._.js → _0g_ubt-._.js} +2 -2
  116. package/web/.next/server/chunks/ssr/{_128eao5._.js.map → _0g_ubt-._.js.map} +1 -1
  117. package/web/.next/server/chunks/ssr/_0hovej-._.js +2 -2
  118. package/web/.next/server/chunks/ssr/_0hovej-._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/{_0wy1cta._.js → _0kpppnf._.js} +2 -2
  120. package/web/.next/server/chunks/ssr/{_0wy1cta._.js.map → _0kpppnf._.js.map} +1 -1
  121. package/web/.next/server/chunks/ssr/_0p3zs6p._.js +1 -1
  122. package/web/.next/server/chunks/ssr/_0r.3n~3._.js +1 -1
  123. package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/_0sgeiju._.js +1 -1
  125. package/web/.next/server/chunks/ssr/_0sgeiju._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/_0t59q8r._.js +1 -1
  127. package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/_0v.yfmg._.js +1 -1
  129. package/web/.next/server/chunks/ssr/_0v.yfmg._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  131. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/_0zk-h5w._.js +1 -1
  133. package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/_0~ev6dw._.js +2 -2
  135. package/web/.next/server/chunks/ssr/_0~ev6dw._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/_1161g9x._.js +1 -1
  137. package/web/.next/server/chunks/ssr/_1161g9x._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/_11bn8co._.js +3 -0
  139. package/web/.next/server/chunks/ssr/{_0u1dso4._.js.map → _11bn8co._.js.map} +1 -1
  140. package/web/.next/server/chunks/ssr/_11kuznh._.js +1 -1
  141. package/web/.next/server/chunks/ssr/_11kuznh._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/src_presentation_web_05-w-~v._.js +1 -1
  143. package/web/.next/server/chunks/ssr/src_presentation_web_05-w-~v._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +1 -1
  145. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  150. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  151. package/web/.next/server/middleware/middleware-manifest.json +5 -5
  152. package/web/.next/server/middleware-build-manifest.js +3 -3
  153. package/web/.next/server/middleware-manifest.json +5 -5
  154. package/web/.next/server/pages/500.html +1 -1
  155. package/web/.next/server/server-reference-manifest.js +1 -1
  156. package/web/.next/server/server-reference-manifest.json +47 -47
  157. package/web/.next/static/chunks/{0kgx8bevf0zbf.js → 0-jmtczbfhww-.js} +1 -1
  158. package/web/.next/static/chunks/{10ga4ea-fiv99.js → 04qpdjcm512g_.js} +1 -1
  159. package/web/.next/static/chunks/{0x340x9ge_i84.js → 0662ovdbjb4c7.js} +1 -1
  160. package/web/.next/static/chunks/{07ff7y0gwcb2s.js → 0cd4c0fnzonag.js} +3 -3
  161. package/web/.next/static/chunks/0d9oefqrs17__.js +1 -0
  162. package/web/.next/static/chunks/{0hautrfv4ejks.js → 0hm.c6pg~a912.js} +2 -2
  163. package/web/.next/static/chunks/{0h2um1ss6dvu-.js → 0qxmrjjfpk8kp.js} +1 -1
  164. package/web/.next/static/chunks/{057~nye-006v3.js → 0w79dc4z8jqex.js} +1 -1
  165. package/web/.next/static/chunks/{121v3eo8aii54.js → 0~dcnoxku3oi_.js} +2 -2
  166. package/web/.next/static/chunks/{00wyizkipe-c3.js → 12bym6~-bgu1k.js} +1 -1
  167. package/web/.next/static/chunks/{10wudg~_0~kqd.js → 13-55s12yx1lp.js} +1 -1
  168. package/web/.next/static/chunks/{06iw16.w1ws5f.js → 13ihgyc1p3992.js} +1 -1
  169. package/web/.next/static/chunks/{0velupgfw.ccj.js → 1515oj_4x~qsj.js} +1 -1
  170. package/web/package.json +1 -1
  171. package/web/.next/server/chunks/ssr/_0u1dso4._.js +0 -3
  172. package/web/.next/static/chunks/098ru2qbj5lpm.js +0 -1
  173. /package/web/.next/static/{5gwa-wpWvB6qklw-UYk7C → LyRhI-nUQ02-98fDJiMLy}/_buildManifest.js +0 -0
  174. /package/web/.next/static/{5gwa-wpWvB6qklw-UYk7C → LyRhI-nUQ02-98fDJiMLy}/_clientMiddlewareManifest.js +0 -0
  175. /package/web/.next/static/{5gwa-wpWvB6qklw-UYk7C → LyRhI-nUQ02-98fDJiMLy}/_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(96871),i=e.i(16539),n=e.i(23925),s=e.i(26370),a=e.i(38573),r=e.i(49228),l=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);let m=(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 h=e.i(58860),p=e.i(48109);let f=(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 x=e.i(60112);e.i(98026);var v=e.i(50728),b=e.i(31777),w=e.i(47373),j=e.i(96976);let y=(0,j.createServerReference)("40accd07ca1c3c627b98aa8b0e0dcd0d8b319f91fd",j.callServer,void 0,j.findSourceMapURL,"updateSettingsAction");var S=e.i(17406),k=e.i(30342),C=e.i(44229),M=e.i(83902);function N(e){return(0,t.jsx)(C.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function I({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function T({className:e}){return(0,t.jsx)(k.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function A({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function D({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function F({className:e,...i}){return(0,t.jsx)(M.Rocket,{className:(0,b.cn)("h-4 w-4",e),...i})}I.displayName="VsCodeIcon",T.displayName="CursorEditorIcon",A.displayName="WindsurfIcon",D.displayName="ZedIcon",F.displayName="AntigravityIcon";let P={vscode:I,cursor:T,windsurf:A,zed:D,antigravity:F};var E=e.i(9749),R=e.i(956),z=e.i(41957);let B=[{value:S.Language.English,label:"English",nativeName:"English"},{value:S.Language.Russian,label:"Русский",nativeName:"Русский"},{value:S.Language.Portuguese,label:"Português",nativeName:"Português"},{value:S.Language.Spanish,label:"Español",nativeName:"Español"},{value:S.Language.Arabic,label:"العربية",nativeName:"العربية"},{value:S.Language.Hebrew,label:"עברית",nativeName:"עברית"},{value:S.Language.French,label:"Français",nativeName:"Français"},{value:S.Language.German,label:"Deutsch",nativeName:"Deutsch"}];function L({language:e}){let{t:s,i18n:a}=(0,v.useTranslation)("web"),[r,l]=(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)(R.Card,{id:"language",className:"scroll-mt-6","data-testid":"language-settings-section",children:[(0,t.jsxs)(R.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)(R.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)(R.CardDescription,{children:s("settings.language.description")})]}),(0,t.jsx)(R.CardContent,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{htmlFor:"display-language",children:s("settings.language.label")}),(0,t.jsxs)(w.Select,{value:r,onValueChange:function(e){l(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 y({user:{preferredLanguage:e}});t.success||x.toast.error(t.error??s("settings.language.failedToSave","Failed to save language settings"))})},children:[(0,t.jsx)(w.SelectTrigger,{id:"display-language","data-testid":"language-select",children:(0,t.jsx)(w.SelectValue,{placeholder:s("settings.language.placeholder")})}),(0,t.jsx)(w.SelectContent,{children:B.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.nativeName},e.value))})]})]})})]})}var _=e.i(61569),_=_,K=e.i(3214),V=e.i(30702),W=e.i(51911);function H({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)(z.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 O({label:e,description:i,id:n,testId:s,checked:a,onChange:r,disabled:l}){return(0,t.jsx)(H,{label:e,description:i,htmlFor:n,children:(0,t.jsx)(W.Switch,{id:n,"data-testid":s,checked:a,onCheckedChange:r,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function q({icon:e,title:i,description:n,badge:s,testId:a,children:r}){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:r})]})}function G({id:e,testId:i,value:n,onChange:s,onBlur:a,placeholder:r,min:l=1,max:o,step:c=1,suffix:d}){let{t:u}=(0,v.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(l,(g??parseInt(r,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)(_.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:r,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(r,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)(K.Plus,{className:"h-3 w-3"})})]}),d?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:d}):null]})}function U({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 $({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)(V.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function Z(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function X({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,r]=(0,i.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[o,c]=(0,i.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[d,u]=(0,i.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[g,m]=(0,i.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),[h,p]=(0,i.useState)(!1!==e.workflow.hideCiStatus),f=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",b=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",w=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",j=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"";function S(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}function k(e){let t=Z(e.ciTimeout??o);return{workflow:{ciMaxFixAttempts:Z(e.ciMaxFix??a),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:Z(e.ciLogMax??d),ciWatchPollIntervalSeconds:Z(e.ciPollInterval??g),hideCiStatus:e.hideCiStatus??h}}}return(0,t.jsxs)(q,{icon:l.Activity,title:n("settings.ci.title"),description:n("settings.ci.description"),testId:"ci-settings-section",children:[(0,t.jsx)(H,{label:n("settings.ci.maxFixAttempts"),description:n("settings.ci.maxFixAttemptsDescription"),htmlFor:"ci-max-fix",children:(0,t.jsx)(G,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:a,onChange:r,onBlur:()=>{a!==f&&S(k({ciMaxFix:a}))},min:1,max:10})}),(0,t.jsx)(H,{label:n("settings.ci.watchTimeout"),description:n("settings.ci.watchTimeoutDescription"),htmlFor:"ci-timeout",children:(0,t.jsx)(G,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:o,onChange:c,onBlur:()=>{o!==b&&S(k({ciTimeout:o}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(H,{label:n("settings.ci.maxLogSize"),description:n("settings.ci.maxLogSizeDescription"),htmlFor:"ci-log-max",children:(0,t.jsx)(G,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:d,onChange:u,onBlur:()=>{d!==w&&S(k({ciLogMax:d}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(H,{label:n("settings.ci.pollInterval"),description:n("settings.ci.pollIntervalDescription"),htmlFor:"ci-poll-interval",children:(0,t.jsx)(G,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:g,onChange:m,onBlur:()=>{g!==j&&S(k({ciPollInterval:g}))},min:5,step:5,suffix:"sec"})}),(0,t.jsx)(O,{label:n("settings.ci.hideCiStatus"),description:n("settings.ci.hideCiStatusDescription"),id:"hide-ci-status",testId:"switch-hide-ci-status",checked:h,onChange:e=>{p(e),S(k({hideCiStatus:e}))}})]})}var Y=e.i(27069),J=e.i(91967),Q=e.i(22353),ee=e.i(9413),et=e.i(36567),ei=e.i(75649),en=e.i(9641),es=e.i(70391),ea=e.i(85565),er=e.i(87099),el=["PageUp","PageDown"],eo=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ec={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ed="Slider",[eu,eg,em]=(0,er.createCollection)(ed),[eh,ep]=(0,ee.createContextScope)(ed,[em]),[ef,ex]=eh(ed),ev=i.forwardRef((e,n)=>{let{name:s,min:a=0,max:r=100,step:l=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,et.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(l).split(".")[1]||"").length,o=Math.round((Math.round((e-a)/l)*l+a)*(n=Math.pow(10,s)))/n,c=(0,Y.clamp)(o,[a,r]);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*l))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)(ef,{scope:e.__scopeSlider,name:s,disabled:c,min:a,max:r,valueIndexToChangeRef:b,thumbs:v.current,values:j,orientation:o,form:f,children:(0,t.jsx)(eu.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(eu.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(w?ej:ey,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:(0,J.composeEventHandlers)(x.onPointerDown,()=>{c||(S.current=j)}),min:a,max:r,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(r,j.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){let i=el.includes(e.key)||e.shiftKey&&eo.includes(e.key),n=b.current;k(j[n]+l*(i?10:1)*t,n,{commit:!0})}}})})})})});ev.displayName=ed;var[eb,ew]=eh(ed,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ej=i.forwardRef((e,n)=>{let{min:s,max:a,dir:r,inverted:l,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,ei.useDirection)(r),v="ltr"===x,b=v&&!l||!v&&l;function w(e){let t=f.current||m.getBoundingClientRect(),i=eP([0,t.width],b?[s,a]:[a,s]);return f.current=t,i(e-t.left)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(eS,{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=ec[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),ey=i.forwardRef((e,n)=>{let{min:s,max:a,inverted:r,onSlideStart:l,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...u}=e,g=i.useRef(null),m=(0,Q.useComposedRefs)(n,g),h=i.useRef(void 0),p=!r;function f(e){let t=h.current||g.current.getBoundingClientRect(),i=eP([0,t.height],p?[a,s]:[s,a]);return h.current=t,i(e-t.top)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:(0,t.jsx)(eS,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=f(e.clientY);l?.(t)},onSlideMove:e=>{let t=f(e.clientY);o?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=ec[p?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),eS=i.forwardRef((e,i)=>{let{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:r,onHomeKeyDown:l,onEndKeyDown:o,onStepKeyDown:c,...d}=e,u=ex(ed,n);return(0,t.jsx)(ea.Primitive.span,{...d,ref:i,onKeyDown:(0,J.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(o(e),e.preventDefault()):el.concat(eo).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,J.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,J.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,J.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(e))})})}),ek="SliderTrack",eC=i.forwardRef((e,i)=>{let{__scopeSlider:n,...s}=e,a=ex(ek,n);return(0,t.jsx)(ea.Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:i})});eC.displayName=ek;var eM="SliderRange",eN=i.forwardRef((e,n)=>{let{__scopeSlider:s,...a}=e,r=ex(eM,s),l=ew(eM,s),o=i.useRef(null),c=(0,Q.useComposedRefs)(n,o),d=r.values.length,u=r.values.map(e=>eF(e,r.min,r.max)),g=d>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(ea.Primitive.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...a,ref:c,style:{...e.style,[l.startEdge]:g+"%",[l.endEdge]:m+"%"}})});eN.displayName=eM;var eI="SliderThumb",eT=i.forwardRef((e,n)=>{let s=eg(e.__scopeSlider),[a,r]=i.useState(null),l=(0,Q.useComposedRefs)(n,e=>r(e)),o=i.useMemo(()=>a?s().findIndex(e=>e.ref.current===a):-1,[s,a]);return(0,t.jsx)(eA,{...e,ref:l,index:o})}),eA=i.forwardRef((e,n)=>{var s,a,r,l,o;let c,d,{__scopeSlider:u,index:g,name:m,...h}=e,p=ex(eI,u),f=ew(eI,u),[x,v]=i.useState(null),b=(0,Q.useComposedRefs)(n,e=>v(e)),w=!x||p.form||!!x.closest("form"),j=(0,es.useSize)(x),y=p.values[g],S=void 0===y?0:eF(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?(r=C,l=S,o=f.direction,d=eP([0,50],[0,c=r/2]),(c-d(l)*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)(eu.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(ea.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,J.composeEventHandlers)(e.onFocus,()=>{p.valueIndexToChangeRef.current=g})})}),w&&(0,t.jsx)(eD,{name:m??(p.name?p.name+(p.values.length>1?"[]":""):void 0),form:p.form,value:y},g)]})});eT.displayName=eI;var eD=i.forwardRef(({__scopeSlider:e,value:n,...s},a)=>{let r=i.useRef(null),l=(0,Q.useComposedRefs)(r,a),o=(0,en.usePrevious)(n);return i.useEffect(()=>{let e=r.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)(ea.Primitive.input,{style:{display:"none"},...s,ref:l,defaultValue:n})});function eF(e,t,i){return(0,Y.clamp)(100/(i-t)*(e-t),[0,100])}function eP(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])}}eD.displayName="RadioBubbleInput",e.s(["Range",0,eN,"Root",0,ev,"Slider",0,ev,"SliderRange",0,eN,"SliderThumb",0,eT,"SliderTrack",0,eC,"Thumb",0,eT,"Track",0,eC,"createSliderScope",0,ep],98207);var eE=e.i(98207),eE=eE;function eR({className:e,defaultValue:n,value:s,min:a=0,max:r=100,...l}){let o=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(n)?n:[a,r],[s,n,a,r]);return(0,t.jsxs)(eE.Root,{"data-slot":"slider",defaultValue:n,value:s,min:a,max:r,className:(0,b.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),...l,children:[(0,t.jsx)(eE.Track,{"data-slot":"slider-track",className:(0,b.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)(eE.Range,{"data-slot":"slider-range",className:(0,b.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(e,i)=>(0,t.jsx)(eE.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 ez=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],eB=ez.length-1;function eL(e){let t=0,i=Math.abs(e-ez[0]);for(let n=1;n<ez.length;n++){let s=Math.abs(e-ez[n]);s<i&&(i=s,t=n)}return t}function e_({id:e,testId:n,value:s,onChange:a,onBlur:r,defaultSeconds:l=1800}){var o;let c,d,u=(""===s?l:parseInt(s,10))||l,[g,m]=(0,i.useState)(()=>eL(u)),h=eL(u);h!==g&&ez[g]!==u&&m(h);let p=(0,i.useCallback)(([e])=>{m(e),a(String(ez[e]))},[a]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(eR,{id:e,"data-testid":n,min:0,max:eB,step:1,value:[g],onValueChange:p,onValueCommit:()=>r(),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=ez[g])/3600),d=Math.round(o%3600/60),0===c?`${d}m`:0===d?`${c}h`:`${c}h ${d}m`)})]})}function eK(e){if(void 0===e)return;let t=function(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}(e);return null!=t?1e3*t:void 0}function eV({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.workflow.stageTimeouts,r=e.workflow.analyzeRepoTimeouts,[l,o]=(0,i.useState)(String(Math.round((a?.analyzeMs??18e5)/1e3))),[c,d]=(0,i.useState)(String(Math.round((a?.requirementsMs??18e5)/1e3))),[u,g]=(0,i.useState)(String(Math.round((a?.researchMs??18e5)/1e3))),[m,p]=(0,i.useState)(String(Math.round((a?.planMs??18e5)/1e3))),[f,b]=(0,i.useState)(String(Math.round((a?.implementMs??18e5)/1e3))),[w,j]=(0,i.useState)(String(Math.round((a?.mergeMs??18e5)/1e3))),[S,k]=(0,i.useState)(String(Math.round((r?.analyzeMs??6e5)/1e3))),C=a?.analyzeMs!=null?String(Math.round(a.analyzeMs/1e3)):"",M=a?.requirementsMs!=null?String(Math.round(a.requirementsMs/1e3)):"",N=a?.researchMs!=null?String(Math.round(a.researchMs/1e3)):"",I=a?.planMs!=null?String(Math.round(a.planMs/1e3)):"",T=a?.implementMs!=null?String(Math.round(a.implementMs/1e3)):"",A=a?.mergeMs!=null?String(Math.round(a.mergeMs/1e3)):"",D=r?.analyzeMs!=null?String(Math.round(r.analyzeMs/1e3)):"";function F(e){return{workflow:{stageTimeouts:{analyzeMs:eK(e.analyzeTimeout??l),requirementsMs:eK(e.requirementsTimeout??c),researchMs:eK(e.researchTimeout??u),planMs:eK(e.planTimeout??m),implementMs:eK(e.implementTimeout??f),mergeMs:eK(e.mergeTimeout??w)},analyzeRepoTimeouts:{analyzeMs:eK(e.analyzeRepoTimeout??S)}}}}function P(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:h.Timer,title:n("settings.stageTimeouts.title"),description:n("settings.stageTimeouts.description"),testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.featureAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze",children:(0,t.jsx)(e_,{id:"timeout-analyze",testId:"timeout-analyze-input",value:l,onChange:o,onBlur:()=>{l!==C&&P(F({analyzeTimeout:l}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.requirements"),description:n("settings.stageTimeouts.requirementsDescription"),htmlFor:"timeout-requirements",children:(0,t.jsx)(e_,{id:"timeout-requirements",testId:"timeout-requirements-input",value:c,onChange:d,onBlur:()=>{c!==M&&P(F({requirementsTimeout:c}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.research"),description:n("settings.stageTimeouts.researchDescription"),htmlFor:"timeout-research",children:(0,t.jsx)(e_,{id:"timeout-research",testId:"timeout-research-input",value:u,onChange:g,onBlur:()=>{u!==N&&P(F({researchTimeout:u}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.plan"),description:n("settings.stageTimeouts.planDescription"),htmlFor:"timeout-plan",children:(0,t.jsx)(e_,{id:"timeout-plan",testId:"timeout-plan-input",value:m,onChange:p,onBlur:()=>{m!==I&&P(F({planTimeout:m}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.implement"),description:n("settings.stageTimeouts.implementDescription"),htmlFor:"timeout-implement",children:(0,t.jsx)(e_,{id:"timeout-implement",testId:"timeout-implement-input",value:f,onChange:b,onBlur:()=>{f!==T&&P(F({implementTimeout:f}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.merge"),description:n("settings.stageTimeouts.mergeDescription"),htmlFor:"timeout-merge",children:(0,t.jsx)(e_,{id:"timeout-merge",testId:"timeout-merge-input",value:w,onChange:j,onBlur:()=>{w!==A&&P(F({mergeTimeout:w}))},defaultSeconds:1800})}),(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.analyzeRepoAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(e_,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:S,onChange:k,onBlur:()=>{S!==D&&P(F({analyzeRepoTimeout:S}))},defaultSeconds:600})})]})}function eW({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.interactiveAgent??{enabled:!0,autoTimeoutMinutes:15,maxConcurrentSessions:3},[r,l]=(0,i.useState)(a.enabled),[o,c]=(0,i.useState)(String(a.autoTimeoutMinutes)),[d,u]=(0,i.useState)(String(a.maxConcurrentSessions));function g(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:p.MessageSquare,title:n("settings.interactiveAgent.title"),description:n("settings.interactiveAgent.description"),testId:"interactive-agent-settings-section",children:[(0,t.jsx)(O,{label:n("settings.interactiveAgent.enableChatTab"),description:n("settings.interactiveAgent.enableChatTabDescription"),id:"interactive-agent-enabled",testId:"switch-interactive-agent-enabled",checked:r,onChange:e=>{l(e),g({interactiveAgent:{enabled:e,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:parseInt(d,10)||3}})}}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.autoTimeout"),description:n("settings.interactiveAgent.autoTimeoutDescription"),htmlFor:"interactive-agent-timeout",children:(0,t.jsx)(G,{id:"interactive-agent-timeout",testId:"input-interactive-agent-timeout",value:o,placeholder:"15",min:1,max:120,suffix:"min",onChange:c,onBlur:()=>{let e=parseInt(o,10),t=Number.isNaN(e)?15:Math.min(120,Math.max(1,e));c(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:t,maxConcurrentSessions:parseInt(d,10)||3}})}})}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.maxConcurrentSessions"),description:n("settings.interactiveAgent.maxConcurrentSessionsDescription"),htmlFor:"interactive-agent-sessions",children:(0,t.jsx)(G,{id:"interactive-agent-sessions",testId:"input-interactive-agent-sessions",value:d,placeholder:"3",min:1,max:10,onChange:u,onBlur:()=>{let e=parseInt(d,10),t=Number.isNaN(e)?3:Math.min(10,Math.max(1,e));u(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:t}})}})})]})}function eH({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.fabLayout??{swapPosition:!1},[r,l]=(0,i.useState)(a.swapPosition);return(0,t.jsx)(q,{icon:f,title:n("settings.fabLayout.title"),description:n("settings.fabLayout.description"),testId:"fab-layout-settings-section",children:(0,t.jsx)(O,{label:n("settings.fabLayout.swapPosition"),description:n("settings.fabLayout.swapPositionDescription"),id:"fab-swap-position",testId:"switch-fab-swap-position",checked:r,onChange:e=>{var t;l(e),t={fabLayout:{swapPosition:e}},s(async()=>{let e=await y(t);e.success||x.toast.error(e.error??n("settings.failedToSave"))})}})})}let eO=[{value:S.EditorType.VsCode,label:"VS Code"},{value:S.EditorType.Cursor,label:"Cursor"},{value:S.EditorType.Windsurf,label:"Windsurf"},{value:S.EditorType.Zed,label:"Zed"},{value:S.EditorType.Antigravity,label:"Antigravity"}],eq=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],eG=[{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:r.GitBranch},{id:"ci",labelKey:"settings.sections.ci",icon:l.Activity},{id:"stage-timeouts",labelKey:"settings.sections.timeouts",icon:h.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:p.MessageSquare},{id:"fab-layout",labelKey:"settings.sections.layout",icon:f},{id:"database",labelKey:"settings.sections.database",icon:u}];e.s(["SettingsPageClient",0,function({settings:e,shipitAiHome:l,dbFileSize:o,availableTerminals:g}){let{t:h}=(0,v.useTranslation)("web"),{showSaving:p,showSaved:f,save:j}=function(){let{t:e}=(0,v.useTranslation)("web"),[t,n]=(0,i.useTransition)(),[s,a]=(0,i.useState)(!1),[r,l]=(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),l(!0),setTimeout(()=>l(!1),2e3))},350)),!t&&s&&(c.current=!0,o.current||(a(!1),l(!0),setTimeout(()=>l(!1),2e3)))},[t,s]),{showSaving:s,showSaved:r,save:(0,i.useCallback)(t=>{n(async()=>{let i=await y(t);i.success||x.toast.error(i.error??e("settings.failedToSave"))})},[n,e])}}(),k=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1},[C,M]=(0,i.useState)(e.agent.type),[I,T]=(0,i.useState)(e.environment.defaultEditor),[A,D]=(0,i.useState)(e.environment.shellPreference),[F,R]=(0,i.useState)(e.environment.terminalPreference??S.TerminalType.System),z=g?g.filter(e=>e.available):[{id:S.TerminalType.System,name:h("settings.environment.systemTerminal"),available:!0}],[B,_]=(0,i.useState)(e.workflow.openPrOnImplementationComplete),[K,V]=(0,i.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[W,Z]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPrd),[Y,J]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPlan),[Q,ee]=(0,i.useState)(e.workflow.approvalGateDefaults.allowMerge),[et,ei]=(0,i.useState)(e.workflow.enableEvidence),[en,es]=(0,i.useState)(e.workflow.commitEvidence),[ea,er]=(0,i.useState)(!1!==e.workflow.ciWatchEnabled),[el,eo]=(0,i.useState)(!1!==e.workflow.defaultFastMode),[ec,ed]=(0,i.useState)((e.workflow.autoArchiveDelayMinutes??10)>0),[eu,eg]=(0,i.useState)(String(e.workflow.autoArchiveDelayMinutes??10)),[em,eh]=(0,i.useState)(e.notifications.inApp.enabled),[ep,ef]=(0,i.useState)({...e.notifications.events}),[ex,ev]=(0,i.useState)({...k});function eb(e={}){let t=e.autoArchiveEnabled??ec,i=parseInt(e.autoArchiveDelay??eu,10);return{workflow:{openPrOnImplementationComplete:e.openPr??B,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??K,allowPrd:e.allowPrd??W,allowPlan:e.allowPlan??Y,allowMerge:e.allowMerge??Q},enableEvidence:e.enableEvidence??et,commitEvidence:e.commitEvidence??en,ciWatchEnabled:e.ciWatchEnabled??ea,defaultFastMode:e.defaultFastMode??el,autoArchiveDelayMinutes:t?Number.isNaN(i)||i<1?10:i:0}}}function ew(e={}){return{notifications:{inApp:{enabled:e.inApp??em},events:e.events??ep}}}let[ej,ey]=(0,i.useState)("agent");(0,i.useEffect)(()=>{let e=eG.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&&ey(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let i of e)t.observe(i);return()=>t.disconnect()},[]);let eS=(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)(m,{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,b.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,b.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",f&&!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:eG.map(e=>{let i=e.icon,n=ej===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>eS(e.id),className:(0,b.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)(L,{language:e.user?.preferredLanguage??S.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)(q,{icon:s.Bot,title:h("settings.agent.sectionTitle"),description:h("settings.agent.sectionDescription"),testId:"agent-settings-section",children:(0,t.jsx)(H,{label:h("settings.agent.agentAndModel"),description:h("settings.agent.agentAndModelDescription"),htmlFor:"agent-model-picker",children:(0,t.jsx)(E.AgentModelPicker,{initialAgentType:C,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>M(e),className:"w-55"})})}),(0,t.jsx)($,{links:[{label:h("settings.agent.links.agentSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/agent-system.md"},{label:h("settings.agent.links.addingAgents"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/adding-agents.md"},{label:h("settings.agent.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/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)(q,{icon:a.Terminal,title:h("settings.environment.sectionTitle"),description:h("settings.environment.sectionDescription"),testId:"environment-settings-section",children:[(0,t.jsx)(H,{label:h("settings.environment.defaultEditor"),description:h("settings.environment.defaultEditorDescription"),htmlFor:"default-editor",children:(0,t.jsxs)(w.Select,{value:I,onValueChange:e=>{T(e),j({environment:{defaultEditor:e,shellPreference:A,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eO.map(e=>{var i;let n=(i=e.value)&&i in P?P[i]:N;return(0,t.jsx)(w.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)(H,{label:h("settings.environment.shell"),description:h("settings.environment.shellDescription"),htmlFor:"shell-preference",children:(0,t.jsxs)(w.Select,{value:A,onValueChange:e=>{D(e),j({environment:{defaultEditor:I,shellPreference:e,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eq.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(H,{label:h("settings.environment.terminal"),description:h("settings.environment.terminalDescription"),htmlFor:"terminal-preference",children:(0,t.jsxs)(w.Select,{value:F,onValueChange:e=>{R(e),j({environment:{defaultEditor:I,shellPreference:A,terminalPreference:e}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:z.map(e=>(0,t.jsx)(w.SelectItem,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)($,{links:[{label:h("settings.environment.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/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)(q,{icon:r.GitBranch,title:h("settings.workflow.title"),description:h("settings.workflow.sectionDescription"),testId:"workflow-settings-section",children:[(0,t.jsx)(O,{label:h("settings.workflow.defaultFastMode"),description:h("settings.workflow.defaultFastModeDescription"),id:"default-fast-mode",testId:"switch-default-fast-mode",checked:el,onChange:e=>{eo(e),j(eb({defaultFastMode:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.approve")}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePrd"),description:h("settings.workflow.autoApprovePrdDescription"),id:"allow-prd",testId:"switch-allow-prd",checked:W,onChange:e=>{Z(e),j(eb({allowPrd:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePlan"),description:h("settings.workflow.autoApprovePlanDescription"),id:"allow-plan",testId:"switch-allow-plan",checked:Y,onChange:e=>{J(e),j(eb({allowPlan:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApproveMerge"),description:h("settings.workflow.autoApproveMergeDescription"),id:"allow-merge",testId:"switch-allow-merge",checked:Q,onChange:e=>{ee(e),j(eb({allowMerge:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.evidence")}),(0,t.jsx)(O,{label:h("settings.workflow.collectEvidence"),description:h("settings.workflow.collectEvidenceDescription"),id:"enable-evidence",testId:"switch-enable-evidence",checked:et,onChange:e=>{ei(e),e?j(eb({enableEvidence:e})):(es(!1),j(eb({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.addEvidenceToPr"),description:h("settings.workflow.addEvidenceToPrDescription"),id:"commit-evidence",testId:"switch-commit-evidence",checked:en,disabled:!et||!B,onChange:e=>{es(e),j(eb({commitEvidence:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.git")}),(0,t.jsx)(O,{label:h("settings.workflow.pushOnComplete"),description:h("settings.workflow.pushOnCompleteDescription"),id:"push-on-complete",testId:"switch-push-on-complete",checked:K,onChange:e=>{V(e),j(eb({pushOnComplete:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.openPrOnComplete"),description:h("settings.workflow.openPrOnCompleteDescription"),id:"open-pr",testId:"switch-open-pr",checked:B,onChange:e=>{_(e),e?j(eb({openPr:e})):(es(!1),j(eb({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.watchCiAfterPush"),description:h("settings.workflow.watchCiAfterPushDescription"),id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:ea,onChange:e=>{er(e),j(eb({ciWatchEnabled:e}))}}),(0,t.jsx)(U,{children:"Archive"}),(0,t.jsx)(O,{label:"Auto-archive completed",description:"Automatically archive features after they reach the completed state",id:"auto-archive-enabled",testId:"switch-auto-archive-enabled",checked:ec,onChange:e=>{ed(e),j(eb({autoArchiveEnabled:e}))}}),(0,t.jsx)(H,{label:"Archive delay",description:"Minutes to wait after completion before archiving (1–1440)",htmlFor:"auto-archive-delay",children:(0,t.jsx)(G,{id:"auto-archive-delay",testId:"input-auto-archive-delay",value:eu,placeholder:"10",min:1,max:1440,suffix:"min",onChange:e=>{eg(e)},onBlur:()=>{if(!ec)return;let e=parseInt(eu,10),t=Number.isNaN(e)?10:Math.min(1440,Math.max(1,e));eg(String(t)),j(eb({autoArchiveDelay:String(t)}))}})})]}),(0,t.jsx)($,{links:[{label:h("settings.workflow.links.approvalGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:h("settings.workflow.links.pushAndPrFlags"),href:"https://github.com/jrmatherly/shipit/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.jsx)(X,{settings:e}),(0,t.jsx)($,{links:[{label:h("settings.ci.links.cicdPipeline"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/cicd.md"},{label:h("settings.ci.links.ciSecurityGates"),href:"https://github.com/jrmatherly/shipit/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.jsx)(eV,{settings:e}),(0,t.jsx)($,{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)(q,{icon:c,title:h("settings.notifications.title"),description:h("settings.notifications.sectionDescription"),testId:"notification-settings-section",children:[(0,t.jsx)(U,{children:h("settings.notifications.channels")}),(0,t.jsx)(O,{label:h("settings.notifications.inAppLabel"),description:h("settings.notifications.inAppDescription"),id:"notif-in-app",testId:"switch-in-app",checked:em,onChange:e=>{eh(e),j(ew({inApp:e}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.agentEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentStarted"),id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ep.agentStarted,onChange:e=>{let t={...ep,agentStarted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.phaseCompleted"),id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ep.phaseCompleted,onChange:e=>{let t={...ep,phaseCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.waitingApproval"),id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ep.waitingApproval,onChange:e=>{let t={...ep,waitingApproval:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentCompleted"),id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ep.agentCompleted,onChange:e=>{let t={...ep,agentCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentFailed"),id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ep.agentFailed,onChange:e=>{let t={...ep,agentFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.pullRequestEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.prMerged"),id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ep.prMerged,onChange:e=>{let t={...ep,prMerged:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prClosed"),id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ep.prClosed,onChange:e=>{let t={...ep,prClosed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksPassed"),id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ep.prChecksPassed,onChange:e=>{let t={...ep,prChecksPassed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksFailed"),id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ep.prChecksFailed,onChange:e=>{let t={...ep,prChecksFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prBlocked"),id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:ep.prBlocked,onChange:e=>{let t={...ep,prBlocked:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.mergeReviewReady"),id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:ep.mergeReviewReady,onChange:e=>{let t={...ep,mergeReviewReady:e};ef(t),j(ew({events:t}))}})]}),(0,t.jsx)($,{links:[{label:h("settings.notifications.links.notificationSystem"),href:"https://github.com/jrmatherly/shipit/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)(q,{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)(O,{label:h("settings.featureFlags.skills"),description:h("settings.featureFlags.skillsDescription"),id:"flag-skills",testId:"switch-flag-skills",checked:ex.skills,onChange:e=>{let t={...ex,skills:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.deployments"),description:h("settings.featureFlags.deploymentsDescription"),id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ex.envDeploy,onChange:e=>{let t={...ex,envDeploy:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.debug"),description:h("settings.featureFlags.debugDescription"),id:"flag-debug",testId:"switch-flag-debug",checked:ex.debug,onChange:e=>{let t={...ex,debug:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.githubImport"),description:h("settings.featureFlags.githubImportDescription"),id:"flag-githubImport",testId:"switch-flag-githubImport",checked:ex.githubImport,onChange:e=>{let t={...ex,githubImport:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.adoptBranch"),description:h("settings.featureFlags.adoptBranchDescription"),id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:ex.adoptBranch,onChange:e=>{let t={...ex,adoptBranch:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.gitRebaseSync"),description:h("settings.featureFlags.gitRebaseSyncDescription"),id:"flag-gitRebaseSync",testId:"switch-flag-gitRebaseSync",checked:ex.gitRebaseSync,onChange:e=>{let t={...ex,gitRebaseSync:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.reactFileManager"),description:h("settings.featureFlags.reactFileManagerDescription"),id:"flag-reactFileManager",testId:"switch-flag-reactFileManager",checked:ex.reactFileManager,onChange:e=>{let t={...ex,reactFileManager:e};ev(t),j({featureFlags:t})}})]}),(0,t.jsx)($,{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.jsx)(eW,{settings:e}),(0,t.jsx)($,{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)(eH,{settings:e}),(0,t.jsx)($,{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)(q,{icon:u,title:h("settings.database.title"),description:h("settings.database.sectionDescription"),testId:"database-settings-section",children:[(0,t.jsx)(H,{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":"shipit-ai-home-path",children:l})}),(0,t.jsx)(H,{label:h("settings.database.size"),children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:o})})]}),(0,t.jsx)($,{links:[{label:h("settings.database.links.settingsService"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/settings-service.md"},{label:h("settings.database.links.settingsSpec"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/005-global-settings-service/spec.md"}],children:h("settings.database.hint")})]})]})]})}],41952)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(96871),i=e.i(16539),n=e.i(23925),s=e.i(26370),a=e.i(38573),r=e.i(49228),l=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);let m=(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 h=e.i(58860),p=e.i(48109);let f=(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 x=e.i(60112);e.i(98026);var v=e.i(50728),b=e.i(31777),w=e.i(47373),j=e.i(96976);let y=(0,j.createServerReference)("40638246f70ae0ab4285d9706fddbdd9d72c515631",j.callServer,void 0,j.findSourceMapURL,"updateSettingsAction");var S=e.i(17406),k=e.i(30342),C=e.i(44229),M=e.i(83902);function N(e){return(0,t.jsx)(C.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function I({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function T({className:e}){return(0,t.jsx)(k.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function A({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function D({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function F({className:e,...i}){return(0,t.jsx)(M.Rocket,{className:(0,b.cn)("h-4 w-4",e),...i})}I.displayName="VsCodeIcon",T.displayName="CursorEditorIcon",A.displayName="WindsurfIcon",D.displayName="ZedIcon",F.displayName="AntigravityIcon";let P={vscode:I,cursor:T,windsurf:A,zed:D,antigravity:F};var E=e.i(9749),R=e.i(956),z=e.i(41957);let B=[{value:S.Language.English,label:"English",nativeName:"English"},{value:S.Language.Russian,label:"Русский",nativeName:"Русский"},{value:S.Language.Portuguese,label:"Português",nativeName:"Português"},{value:S.Language.Spanish,label:"Español",nativeName:"Español"},{value:S.Language.Arabic,label:"العربية",nativeName:"العربية"},{value:S.Language.Hebrew,label:"עברית",nativeName:"עברית"},{value:S.Language.French,label:"Français",nativeName:"Français"},{value:S.Language.German,label:"Deutsch",nativeName:"Deutsch"}];function L({language:e}){let{t:s,i18n:a}=(0,v.useTranslation)("web"),[r,l]=(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)(R.Card,{id:"language",className:"scroll-mt-6","data-testid":"language-settings-section",children:[(0,t.jsxs)(R.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)(R.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)(R.CardDescription,{children:s("settings.language.description")})]}),(0,t.jsx)(R.CardContent,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{htmlFor:"display-language",children:s("settings.language.label")}),(0,t.jsxs)(w.Select,{value:r,onValueChange:function(e){l(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 y({user:{preferredLanguage:e}});t.success||x.toast.error(t.error??s("settings.language.failedToSave","Failed to save language settings"))})},children:[(0,t.jsx)(w.SelectTrigger,{id:"display-language","data-testid":"language-select",children:(0,t.jsx)(w.SelectValue,{placeholder:s("settings.language.placeholder")})}),(0,t.jsx)(w.SelectContent,{children:B.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.nativeName},e.value))})]})]})})]})}var _=e.i(61569),_=_,K=e.i(3214),V=e.i(30702),W=e.i(51911);function H({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)(z.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 O({label:e,description:i,id:n,testId:s,checked:a,onChange:r,disabled:l}){return(0,t.jsx)(H,{label:e,description:i,htmlFor:n,children:(0,t.jsx)(W.Switch,{id:n,"data-testid":s,checked:a,onCheckedChange:r,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function q({icon:e,title:i,description:n,badge:s,testId:a,children:r}){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:r})]})}function G({id:e,testId:i,value:n,onChange:s,onBlur:a,placeholder:r,min:l=1,max:o,step:c=1,suffix:d}){let{t:u}=(0,v.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(l,(g??parseInt(r,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)(_.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:r,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(r,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)(K.Plus,{className:"h-3 w-3"})})]}),d?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:d}):null]})}function U({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 $({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)(V.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function Z(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function X({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,r]=(0,i.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[o,c]=(0,i.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[d,u]=(0,i.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[g,m]=(0,i.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),[h,p]=(0,i.useState)(!1!==e.workflow.hideCiStatus),f=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",b=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",w=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",j=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"";function S(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}function k(e){let t=Z(e.ciTimeout??o);return{workflow:{ciMaxFixAttempts:Z(e.ciMaxFix??a),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:Z(e.ciLogMax??d),ciWatchPollIntervalSeconds:Z(e.ciPollInterval??g),hideCiStatus:e.hideCiStatus??h}}}return(0,t.jsxs)(q,{icon:l.Activity,title:n("settings.ci.title"),description:n("settings.ci.description"),testId:"ci-settings-section",children:[(0,t.jsx)(H,{label:n("settings.ci.maxFixAttempts"),description:n("settings.ci.maxFixAttemptsDescription"),htmlFor:"ci-max-fix",children:(0,t.jsx)(G,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:a,onChange:r,onBlur:()=>{a!==f&&S(k({ciMaxFix:a}))},min:1,max:10})}),(0,t.jsx)(H,{label:n("settings.ci.watchTimeout"),description:n("settings.ci.watchTimeoutDescription"),htmlFor:"ci-timeout",children:(0,t.jsx)(G,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:o,onChange:c,onBlur:()=>{o!==b&&S(k({ciTimeout:o}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(H,{label:n("settings.ci.maxLogSize"),description:n("settings.ci.maxLogSizeDescription"),htmlFor:"ci-log-max",children:(0,t.jsx)(G,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:d,onChange:u,onBlur:()=>{d!==w&&S(k({ciLogMax:d}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(H,{label:n("settings.ci.pollInterval"),description:n("settings.ci.pollIntervalDescription"),htmlFor:"ci-poll-interval",children:(0,t.jsx)(G,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:g,onChange:m,onBlur:()=>{g!==j&&S(k({ciPollInterval:g}))},min:5,step:5,suffix:"sec"})}),(0,t.jsx)(O,{label:n("settings.ci.hideCiStatus"),description:n("settings.ci.hideCiStatusDescription"),id:"hide-ci-status",testId:"switch-hide-ci-status",checked:h,onChange:e=>{p(e),S(k({hideCiStatus:e}))}})]})}var Y=e.i(27069),J=e.i(91967),Q=e.i(22353),ee=e.i(9413),et=e.i(36567),ei=e.i(75649),en=e.i(9641),es=e.i(70391),ea=e.i(85565),er=e.i(87099),el=["PageUp","PageDown"],eo=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ec={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ed="Slider",[eu,eg,em]=(0,er.createCollection)(ed),[eh,ep]=(0,ee.createContextScope)(ed,[em]),[ef,ex]=eh(ed),ev=i.forwardRef((e,n)=>{let{name:s,min:a=0,max:r=100,step:l=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,et.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(l).split(".")[1]||"").length,o=Math.round((Math.round((e-a)/l)*l+a)*(n=Math.pow(10,s)))/n,c=(0,Y.clamp)(o,[a,r]);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*l))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)(ef,{scope:e.__scopeSlider,name:s,disabled:c,min:a,max:r,valueIndexToChangeRef:b,thumbs:v.current,values:j,orientation:o,form:f,children:(0,t.jsx)(eu.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(eu.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(w?ej:ey,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:(0,J.composeEventHandlers)(x.onPointerDown,()=>{c||(S.current=j)}),min:a,max:r,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(r,j.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){let i=el.includes(e.key)||e.shiftKey&&eo.includes(e.key),n=b.current;k(j[n]+l*(i?10:1)*t,n,{commit:!0})}}})})})})});ev.displayName=ed;var[eb,ew]=eh(ed,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ej=i.forwardRef((e,n)=>{let{min:s,max:a,dir:r,inverted:l,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,ei.useDirection)(r),v="ltr"===x,b=v&&!l||!v&&l;function w(e){let t=f.current||m.getBoundingClientRect(),i=eP([0,t.width],b?[s,a]:[a,s]);return f.current=t,i(e-t.left)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(eS,{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=ec[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),ey=i.forwardRef((e,n)=>{let{min:s,max:a,inverted:r,onSlideStart:l,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...u}=e,g=i.useRef(null),m=(0,Q.useComposedRefs)(n,g),h=i.useRef(void 0),p=!r;function f(e){let t=h.current||g.current.getBoundingClientRect(),i=eP([0,t.height],p?[a,s]:[s,a]);return h.current=t,i(e-t.top)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:(0,t.jsx)(eS,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=f(e.clientY);l?.(t)},onSlideMove:e=>{let t=f(e.clientY);o?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=ec[p?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),eS=i.forwardRef((e,i)=>{let{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:r,onHomeKeyDown:l,onEndKeyDown:o,onStepKeyDown:c,...d}=e,u=ex(ed,n);return(0,t.jsx)(ea.Primitive.span,{...d,ref:i,onKeyDown:(0,J.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(o(e),e.preventDefault()):el.concat(eo).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,J.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,J.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,J.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(e))})})}),ek="SliderTrack",eC=i.forwardRef((e,i)=>{let{__scopeSlider:n,...s}=e,a=ex(ek,n);return(0,t.jsx)(ea.Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:i})});eC.displayName=ek;var eM="SliderRange",eN=i.forwardRef((e,n)=>{let{__scopeSlider:s,...a}=e,r=ex(eM,s),l=ew(eM,s),o=i.useRef(null),c=(0,Q.useComposedRefs)(n,o),d=r.values.length,u=r.values.map(e=>eF(e,r.min,r.max)),g=d>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(ea.Primitive.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...a,ref:c,style:{...e.style,[l.startEdge]:g+"%",[l.endEdge]:m+"%"}})});eN.displayName=eM;var eI="SliderThumb",eT=i.forwardRef((e,n)=>{let s=eg(e.__scopeSlider),[a,r]=i.useState(null),l=(0,Q.useComposedRefs)(n,e=>r(e)),o=i.useMemo(()=>a?s().findIndex(e=>e.ref.current===a):-1,[s,a]);return(0,t.jsx)(eA,{...e,ref:l,index:o})}),eA=i.forwardRef((e,n)=>{var s,a,r,l,o;let c,d,{__scopeSlider:u,index:g,name:m,...h}=e,p=ex(eI,u),f=ew(eI,u),[x,v]=i.useState(null),b=(0,Q.useComposedRefs)(n,e=>v(e)),w=!x||p.form||!!x.closest("form"),j=(0,es.useSize)(x),y=p.values[g],S=void 0===y?0:eF(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?(r=C,l=S,o=f.direction,d=eP([0,50],[0,c=r/2]),(c-d(l)*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)(eu.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(ea.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,J.composeEventHandlers)(e.onFocus,()=>{p.valueIndexToChangeRef.current=g})})}),w&&(0,t.jsx)(eD,{name:m??(p.name?p.name+(p.values.length>1?"[]":""):void 0),form:p.form,value:y},g)]})});eT.displayName=eI;var eD=i.forwardRef(({__scopeSlider:e,value:n,...s},a)=>{let r=i.useRef(null),l=(0,Q.useComposedRefs)(r,a),o=(0,en.usePrevious)(n);return i.useEffect(()=>{let e=r.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)(ea.Primitive.input,{style:{display:"none"},...s,ref:l,defaultValue:n})});function eF(e,t,i){return(0,Y.clamp)(100/(i-t)*(e-t),[0,100])}function eP(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])}}eD.displayName="RadioBubbleInput",e.s(["Range",0,eN,"Root",0,ev,"Slider",0,ev,"SliderRange",0,eN,"SliderThumb",0,eT,"SliderTrack",0,eC,"Thumb",0,eT,"Track",0,eC,"createSliderScope",0,ep],98207);var eE=e.i(98207),eE=eE;function eR({className:e,defaultValue:n,value:s,min:a=0,max:r=100,...l}){let o=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(n)?n:[a,r],[s,n,a,r]);return(0,t.jsxs)(eE.Root,{"data-slot":"slider",defaultValue:n,value:s,min:a,max:r,className:(0,b.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),...l,children:[(0,t.jsx)(eE.Track,{"data-slot":"slider-track",className:(0,b.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)(eE.Range,{"data-slot":"slider-range",className:(0,b.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(e,i)=>(0,t.jsx)(eE.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 ez=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],eB=ez.length-1;function eL(e){let t=0,i=Math.abs(e-ez[0]);for(let n=1;n<ez.length;n++){let s=Math.abs(e-ez[n]);s<i&&(i=s,t=n)}return t}function e_({id:e,testId:n,value:s,onChange:a,onBlur:r,defaultSeconds:l=1800}){var o;let c,d,u=(""===s?l:parseInt(s,10))||l,[g,m]=(0,i.useState)(()=>eL(u)),h=eL(u);h!==g&&ez[g]!==u&&m(h);let p=(0,i.useCallback)(([e])=>{m(e),a(String(ez[e]))},[a]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(eR,{id:e,"data-testid":n,min:0,max:eB,step:1,value:[g],onValueChange:p,onValueCommit:()=>r(),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=ez[g])/3600),d=Math.round(o%3600/60),0===c?`${d}m`:0===d?`${c}h`:`${c}h ${d}m`)})]})}function eK(e){if(void 0===e)return;let t=function(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}(e);return null!=t?1e3*t:void 0}function eV({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.workflow.stageTimeouts,r=e.workflow.analyzeRepoTimeouts,[l,o]=(0,i.useState)(String(Math.round((a?.analyzeMs??18e5)/1e3))),[c,d]=(0,i.useState)(String(Math.round((a?.requirementsMs??18e5)/1e3))),[u,g]=(0,i.useState)(String(Math.round((a?.researchMs??18e5)/1e3))),[m,p]=(0,i.useState)(String(Math.round((a?.planMs??18e5)/1e3))),[f,b]=(0,i.useState)(String(Math.round((a?.implementMs??18e5)/1e3))),[w,j]=(0,i.useState)(String(Math.round((a?.mergeMs??18e5)/1e3))),[S,k]=(0,i.useState)(String(Math.round((r?.analyzeMs??6e5)/1e3))),C=a?.analyzeMs!=null?String(Math.round(a.analyzeMs/1e3)):"",M=a?.requirementsMs!=null?String(Math.round(a.requirementsMs/1e3)):"",N=a?.researchMs!=null?String(Math.round(a.researchMs/1e3)):"",I=a?.planMs!=null?String(Math.round(a.planMs/1e3)):"",T=a?.implementMs!=null?String(Math.round(a.implementMs/1e3)):"",A=a?.mergeMs!=null?String(Math.round(a.mergeMs/1e3)):"",D=r?.analyzeMs!=null?String(Math.round(r.analyzeMs/1e3)):"";function F(e){return{workflow:{stageTimeouts:{analyzeMs:eK(e.analyzeTimeout??l),requirementsMs:eK(e.requirementsTimeout??c),researchMs:eK(e.researchTimeout??u),planMs:eK(e.planTimeout??m),implementMs:eK(e.implementTimeout??f),mergeMs:eK(e.mergeTimeout??w)},analyzeRepoTimeouts:{analyzeMs:eK(e.analyzeRepoTimeout??S)}}}}function P(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:h.Timer,title:n("settings.stageTimeouts.title"),description:n("settings.stageTimeouts.description"),testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.featureAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze",children:(0,t.jsx)(e_,{id:"timeout-analyze",testId:"timeout-analyze-input",value:l,onChange:o,onBlur:()=>{l!==C&&P(F({analyzeTimeout:l}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.requirements"),description:n("settings.stageTimeouts.requirementsDescription"),htmlFor:"timeout-requirements",children:(0,t.jsx)(e_,{id:"timeout-requirements",testId:"timeout-requirements-input",value:c,onChange:d,onBlur:()=>{c!==M&&P(F({requirementsTimeout:c}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.research"),description:n("settings.stageTimeouts.researchDescription"),htmlFor:"timeout-research",children:(0,t.jsx)(e_,{id:"timeout-research",testId:"timeout-research-input",value:u,onChange:g,onBlur:()=>{u!==N&&P(F({researchTimeout:u}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.plan"),description:n("settings.stageTimeouts.planDescription"),htmlFor:"timeout-plan",children:(0,t.jsx)(e_,{id:"timeout-plan",testId:"timeout-plan-input",value:m,onChange:p,onBlur:()=>{m!==I&&P(F({planTimeout:m}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.implement"),description:n("settings.stageTimeouts.implementDescription"),htmlFor:"timeout-implement",children:(0,t.jsx)(e_,{id:"timeout-implement",testId:"timeout-implement-input",value:f,onChange:b,onBlur:()=>{f!==T&&P(F({implementTimeout:f}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.merge"),description:n("settings.stageTimeouts.mergeDescription"),htmlFor:"timeout-merge",children:(0,t.jsx)(e_,{id:"timeout-merge",testId:"timeout-merge-input",value:w,onChange:j,onBlur:()=>{w!==A&&P(F({mergeTimeout:w}))},defaultSeconds:1800})}),(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.analyzeRepoAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(e_,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:S,onChange:k,onBlur:()=>{S!==D&&P(F({analyzeRepoTimeout:S}))},defaultSeconds:600})})]})}function eW({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.interactiveAgent??{enabled:!0,autoTimeoutMinutes:15,maxConcurrentSessions:3},[r,l]=(0,i.useState)(a.enabled),[o,c]=(0,i.useState)(String(a.autoTimeoutMinutes)),[d,u]=(0,i.useState)(String(a.maxConcurrentSessions));function g(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:p.MessageSquare,title:n("settings.interactiveAgent.title"),description:n("settings.interactiveAgent.description"),testId:"interactive-agent-settings-section",children:[(0,t.jsx)(O,{label:n("settings.interactiveAgent.enableChatTab"),description:n("settings.interactiveAgent.enableChatTabDescription"),id:"interactive-agent-enabled",testId:"switch-interactive-agent-enabled",checked:r,onChange:e=>{l(e),g({interactiveAgent:{enabled:e,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:parseInt(d,10)||3}})}}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.autoTimeout"),description:n("settings.interactiveAgent.autoTimeoutDescription"),htmlFor:"interactive-agent-timeout",children:(0,t.jsx)(G,{id:"interactive-agent-timeout",testId:"input-interactive-agent-timeout",value:o,placeholder:"15",min:1,max:120,suffix:"min",onChange:c,onBlur:()=>{let e=parseInt(o,10),t=Number.isNaN(e)?15:Math.min(120,Math.max(1,e));c(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:t,maxConcurrentSessions:parseInt(d,10)||3}})}})}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.maxConcurrentSessions"),description:n("settings.interactiveAgent.maxConcurrentSessionsDescription"),htmlFor:"interactive-agent-sessions",children:(0,t.jsx)(G,{id:"interactive-agent-sessions",testId:"input-interactive-agent-sessions",value:d,placeholder:"3",min:1,max:10,onChange:u,onBlur:()=>{let e=parseInt(d,10),t=Number.isNaN(e)?3:Math.min(10,Math.max(1,e));u(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:t}})}})})]})}function eH({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.fabLayout??{swapPosition:!1},[r,l]=(0,i.useState)(a.swapPosition);return(0,t.jsx)(q,{icon:f,title:n("settings.fabLayout.title"),description:n("settings.fabLayout.description"),testId:"fab-layout-settings-section",children:(0,t.jsx)(O,{label:n("settings.fabLayout.swapPosition"),description:n("settings.fabLayout.swapPositionDescription"),id:"fab-swap-position",testId:"switch-fab-swap-position",checked:r,onChange:e=>{var t;l(e),t={fabLayout:{swapPosition:e}},s(async()=>{let e=await y(t);e.success||x.toast.error(e.error??n("settings.failedToSave"))})}})})}let eO=[{value:S.EditorType.VsCode,label:"VS Code"},{value:S.EditorType.Cursor,label:"Cursor"},{value:S.EditorType.Windsurf,label:"Windsurf"},{value:S.EditorType.Zed,label:"Zed"},{value:S.EditorType.Antigravity,label:"Antigravity"}],eq=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],eG=[{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:r.GitBranch},{id:"ci",labelKey:"settings.sections.ci",icon:l.Activity},{id:"stage-timeouts",labelKey:"settings.sections.timeouts",icon:h.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:p.MessageSquare},{id:"fab-layout",labelKey:"settings.sections.layout",icon:f},{id:"database",labelKey:"settings.sections.database",icon:u}];e.s(["SettingsPageClient",0,function({settings:e,shipitAiHome:l,dbFileSize:o,availableTerminals:g}){let{t:h}=(0,v.useTranslation)("web"),{showSaving:p,showSaved:f,save:j}=function(){let{t:e}=(0,v.useTranslation)("web"),[t,n]=(0,i.useTransition)(),[s,a]=(0,i.useState)(!1),[r,l]=(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),l(!0),setTimeout(()=>l(!1),2e3))},350)),!t&&s&&(c.current=!0,o.current||(a(!1),l(!0),setTimeout(()=>l(!1),2e3)))},[t,s]),{showSaving:s,showSaved:r,save:(0,i.useCallback)(t=>{n(async()=>{let i=await y(t);i.success||x.toast.error(i.error??e("settings.failedToSave"))})},[n,e])}}(),k=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1},[C,M]=(0,i.useState)(e.agent.type),[I,T]=(0,i.useState)(e.environment.defaultEditor),[A,D]=(0,i.useState)(e.environment.shellPreference),[F,R]=(0,i.useState)(e.environment.terminalPreference??S.TerminalType.System),z=g?g.filter(e=>e.available):[{id:S.TerminalType.System,name:h("settings.environment.systemTerminal"),available:!0}],[B,_]=(0,i.useState)(e.workflow.openPrOnImplementationComplete),[K,V]=(0,i.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[W,Z]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPrd),[Y,J]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPlan),[Q,ee]=(0,i.useState)(e.workflow.approvalGateDefaults.allowMerge),[et,ei]=(0,i.useState)(e.workflow.enableEvidence),[en,es]=(0,i.useState)(e.workflow.commitEvidence),[ea,er]=(0,i.useState)(!1!==e.workflow.ciWatchEnabled),[el,eo]=(0,i.useState)(!1!==e.workflow.defaultFastMode),[ec,ed]=(0,i.useState)((e.workflow.autoArchiveDelayMinutes??10)>0),[eu,eg]=(0,i.useState)(String(e.workflow.autoArchiveDelayMinutes??10)),[em,eh]=(0,i.useState)(e.notifications.inApp.enabled),[ep,ef]=(0,i.useState)({...e.notifications.events}),[ex,ev]=(0,i.useState)({...k});function eb(e={}){let t=e.autoArchiveEnabled??ec,i=parseInt(e.autoArchiveDelay??eu,10);return{workflow:{openPrOnImplementationComplete:e.openPr??B,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??K,allowPrd:e.allowPrd??W,allowPlan:e.allowPlan??Y,allowMerge:e.allowMerge??Q},enableEvidence:e.enableEvidence??et,commitEvidence:e.commitEvidence??en,ciWatchEnabled:e.ciWatchEnabled??ea,defaultFastMode:e.defaultFastMode??el,autoArchiveDelayMinutes:t?Number.isNaN(i)||i<1?10:i:0}}}function ew(e={}){return{notifications:{inApp:{enabled:e.inApp??em},events:e.events??ep}}}let[ej,ey]=(0,i.useState)("agent");(0,i.useEffect)(()=>{let e=eG.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&&ey(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let i of e)t.observe(i);return()=>t.disconnect()},[]);let eS=(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)(m,{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,b.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,b.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",f&&!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:eG.map(e=>{let i=e.icon,n=ej===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>eS(e.id),className:(0,b.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)(L,{language:e.user?.preferredLanguage??S.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)(q,{icon:s.Bot,title:h("settings.agent.sectionTitle"),description:h("settings.agent.sectionDescription"),testId:"agent-settings-section",children:(0,t.jsx)(H,{label:h("settings.agent.agentAndModel"),description:h("settings.agent.agentAndModelDescription"),htmlFor:"agent-model-picker",children:(0,t.jsx)(E.AgentModelPicker,{initialAgentType:C,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>M(e),className:"w-55"})})}),(0,t.jsx)($,{links:[{label:h("settings.agent.links.agentSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/agent-system.md"},{label:h("settings.agent.links.addingAgents"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/adding-agents.md"},{label:h("settings.agent.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/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)(q,{icon:a.Terminal,title:h("settings.environment.sectionTitle"),description:h("settings.environment.sectionDescription"),testId:"environment-settings-section",children:[(0,t.jsx)(H,{label:h("settings.environment.defaultEditor"),description:h("settings.environment.defaultEditorDescription"),htmlFor:"default-editor",children:(0,t.jsxs)(w.Select,{value:I,onValueChange:e=>{T(e),j({environment:{defaultEditor:e,shellPreference:A,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eO.map(e=>{var i;let n=(i=e.value)&&i in P?P[i]:N;return(0,t.jsx)(w.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)(H,{label:h("settings.environment.shell"),description:h("settings.environment.shellDescription"),htmlFor:"shell-preference",children:(0,t.jsxs)(w.Select,{value:A,onValueChange:e=>{D(e),j({environment:{defaultEditor:I,shellPreference:e,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eq.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(H,{label:h("settings.environment.terminal"),description:h("settings.environment.terminalDescription"),htmlFor:"terminal-preference",children:(0,t.jsxs)(w.Select,{value:F,onValueChange:e=>{R(e),j({environment:{defaultEditor:I,shellPreference:A,terminalPreference:e}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:z.map(e=>(0,t.jsx)(w.SelectItem,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)($,{links:[{label:h("settings.environment.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/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)(q,{icon:r.GitBranch,title:h("settings.workflow.title"),description:h("settings.workflow.sectionDescription"),testId:"workflow-settings-section",children:[(0,t.jsx)(O,{label:h("settings.workflow.defaultFastMode"),description:h("settings.workflow.defaultFastModeDescription"),id:"default-fast-mode",testId:"switch-default-fast-mode",checked:el,onChange:e=>{eo(e),j(eb({defaultFastMode:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.approve")}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePrd"),description:h("settings.workflow.autoApprovePrdDescription"),id:"allow-prd",testId:"switch-allow-prd",checked:W,onChange:e=>{Z(e),j(eb({allowPrd:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePlan"),description:h("settings.workflow.autoApprovePlanDescription"),id:"allow-plan",testId:"switch-allow-plan",checked:Y,onChange:e=>{J(e),j(eb({allowPlan:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApproveMerge"),description:h("settings.workflow.autoApproveMergeDescription"),id:"allow-merge",testId:"switch-allow-merge",checked:Q,onChange:e=>{ee(e),j(eb({allowMerge:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.evidence")}),(0,t.jsx)(O,{label:h("settings.workflow.collectEvidence"),description:h("settings.workflow.collectEvidenceDescription"),id:"enable-evidence",testId:"switch-enable-evidence",checked:et,onChange:e=>{ei(e),e?j(eb({enableEvidence:e})):(es(!1),j(eb({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.addEvidenceToPr"),description:h("settings.workflow.addEvidenceToPrDescription"),id:"commit-evidence",testId:"switch-commit-evidence",checked:en,disabled:!et||!B,onChange:e=>{es(e),j(eb({commitEvidence:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.git")}),(0,t.jsx)(O,{label:h("settings.workflow.pushOnComplete"),description:h("settings.workflow.pushOnCompleteDescription"),id:"push-on-complete",testId:"switch-push-on-complete",checked:K,onChange:e=>{V(e),j(eb({pushOnComplete:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.openPrOnComplete"),description:h("settings.workflow.openPrOnCompleteDescription"),id:"open-pr",testId:"switch-open-pr",checked:B,onChange:e=>{_(e),e?j(eb({openPr:e})):(es(!1),j(eb({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.watchCiAfterPush"),description:h("settings.workflow.watchCiAfterPushDescription"),id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:ea,onChange:e=>{er(e),j(eb({ciWatchEnabled:e}))}}),(0,t.jsx)(U,{children:"Archive"}),(0,t.jsx)(O,{label:"Auto-archive completed",description:"Automatically archive features after they reach the completed state",id:"auto-archive-enabled",testId:"switch-auto-archive-enabled",checked:ec,onChange:e=>{ed(e),j(eb({autoArchiveEnabled:e}))}}),(0,t.jsx)(H,{label:"Archive delay",description:"Minutes to wait after completion before archiving (1–1440)",htmlFor:"auto-archive-delay",children:(0,t.jsx)(G,{id:"auto-archive-delay",testId:"input-auto-archive-delay",value:eu,placeholder:"10",min:1,max:1440,suffix:"min",onChange:e=>{eg(e)},onBlur:()=>{if(!ec)return;let e=parseInt(eu,10),t=Number.isNaN(e)?10:Math.min(1440,Math.max(1,e));eg(String(t)),j(eb({autoArchiveDelay:String(t)}))}})})]}),(0,t.jsx)($,{links:[{label:h("settings.workflow.links.approvalGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:h("settings.workflow.links.pushAndPrFlags"),href:"https://github.com/jrmatherly/shipit/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.jsx)(X,{settings:e}),(0,t.jsx)($,{links:[{label:h("settings.ci.links.cicdPipeline"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/cicd.md"},{label:h("settings.ci.links.ciSecurityGates"),href:"https://github.com/jrmatherly/shipit/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.jsx)(eV,{settings:e}),(0,t.jsx)($,{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)(q,{icon:c,title:h("settings.notifications.title"),description:h("settings.notifications.sectionDescription"),testId:"notification-settings-section",children:[(0,t.jsx)(U,{children:h("settings.notifications.channels")}),(0,t.jsx)(O,{label:h("settings.notifications.inAppLabel"),description:h("settings.notifications.inAppDescription"),id:"notif-in-app",testId:"switch-in-app",checked:em,onChange:e=>{eh(e),j(ew({inApp:e}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.agentEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentStarted"),id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ep.agentStarted,onChange:e=>{let t={...ep,agentStarted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.phaseCompleted"),id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ep.phaseCompleted,onChange:e=>{let t={...ep,phaseCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.waitingApproval"),id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ep.waitingApproval,onChange:e=>{let t={...ep,waitingApproval:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentCompleted"),id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ep.agentCompleted,onChange:e=>{let t={...ep,agentCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentFailed"),id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ep.agentFailed,onChange:e=>{let t={...ep,agentFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.pullRequestEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.prMerged"),id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ep.prMerged,onChange:e=>{let t={...ep,prMerged:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prClosed"),id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ep.prClosed,onChange:e=>{let t={...ep,prClosed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksPassed"),id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ep.prChecksPassed,onChange:e=>{let t={...ep,prChecksPassed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksFailed"),id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ep.prChecksFailed,onChange:e=>{let t={...ep,prChecksFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prBlocked"),id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:ep.prBlocked,onChange:e=>{let t={...ep,prBlocked:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.mergeReviewReady"),id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:ep.mergeReviewReady,onChange:e=>{let t={...ep,mergeReviewReady:e};ef(t),j(ew({events:t}))}})]}),(0,t.jsx)($,{links:[{label:h("settings.notifications.links.notificationSystem"),href:"https://github.com/jrmatherly/shipit/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)(q,{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)(O,{label:h("settings.featureFlags.skills"),description:h("settings.featureFlags.skillsDescription"),id:"flag-skills",testId:"switch-flag-skills",checked:ex.skills,onChange:e=>{let t={...ex,skills:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.deployments"),description:h("settings.featureFlags.deploymentsDescription"),id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ex.envDeploy,onChange:e=>{let t={...ex,envDeploy:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.debug"),description:h("settings.featureFlags.debugDescription"),id:"flag-debug",testId:"switch-flag-debug",checked:ex.debug,onChange:e=>{let t={...ex,debug:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.githubImport"),description:h("settings.featureFlags.githubImportDescription"),id:"flag-githubImport",testId:"switch-flag-githubImport",checked:ex.githubImport,onChange:e=>{let t={...ex,githubImport:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.adoptBranch"),description:h("settings.featureFlags.adoptBranchDescription"),id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:ex.adoptBranch,onChange:e=>{let t={...ex,adoptBranch:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.gitRebaseSync"),description:h("settings.featureFlags.gitRebaseSyncDescription"),id:"flag-gitRebaseSync",testId:"switch-flag-gitRebaseSync",checked:ex.gitRebaseSync,onChange:e=>{let t={...ex,gitRebaseSync:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.reactFileManager"),description:h("settings.featureFlags.reactFileManagerDescription"),id:"flag-reactFileManager",testId:"switch-flag-reactFileManager",checked:ex.reactFileManager,onChange:e=>{let t={...ex,reactFileManager:e};ev(t),j({featureFlags:t})}})]}),(0,t.jsx)($,{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.jsx)(eW,{settings:e}),(0,t.jsx)($,{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)(eH,{settings:e}),(0,t.jsx)($,{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)(q,{icon:u,title:h("settings.database.title"),description:h("settings.database.sectionDescription"),testId:"database-settings-section",children:[(0,t.jsx)(H,{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":"shipit-ai-home-path",children:l})}),(0,t.jsx)(H,{label:h("settings.database.size"),children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:o})})]}),(0,t.jsx)($,{links:[{label:h("settings.database.links.settingsService"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/settings-service.md"},{label:h("settings.database.links.settingsSpec"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/005-global-settings-service/spec.md"}],children:h("settings.database.hint")})]})]})]})}],41952)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43416,e=>{"use strict";let s=(0,e.i(3645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],43416)},16489,e=>{"use strict";let s=(0,e.i(3645).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",0,s],16489)},35749,e=>{"use strict";let s=(0,e.i(3645).default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,s],35749)},12919,e=>{"use strict";let s=(0,e.i(3645).default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],12919)},10661,e=>{"use strict";var s=e.i(96871),t=e.i(16539),a=e.i(33109),r=e.i(8986),n=e.i(38573),i=e.i(19933),l=e.i(43416),o=e.i(24042),d=e.i(64970),c=e.i(33548),x=e.i(23925),h=e.i(83428),m=e.i(16489),p=e.i(48109),u=e.i(49228),g=e.i(65530),j=e.i(58481),f=e.i(32494),b=e.i(3645);let v=(0,b.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var y=e.i(37260),N=e.i(35749),k=e.i(12919);let C=(0,b.default)("file-check-corner",[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]]);var T=e.i(31777);e.i(1650);var z=e.i(11495);e.i(99348);var w=e.i(17466),P=e.i(2828),L=e.i(68304),S=e.i(74442),M=e.i(8537),R=e.i(75921),D=e.i(28112),F=e.i(96976);let B=(0,F.createServerReference)("6063cc0676665786d6fd3cfb046b1fb394ea86fcdf",F.callServer,void 0,F.findSourceMapURL,"getGitRepoInfo"),I="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",A="bg-border/60 mx-1.5 h-5 w-px shrink-0";function O({icon:e,title:t,children:a}){return(0,s.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,s.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,s.jsx)(e,{className:"size-4 opacity-50"}),t]}),a]})}function $({children:e,className:t}){return(0,s.jsx)("div",{className:(0,T.cn)("bg-muted/60 rounded-md border border-transparent p-3",t),children:e})}function E({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,s.jsx)("span",{className:"text-sm leading-snug",children:t})]})}function H({data:e,syncError:a}){let[r,n]=(0,t.useState)(null),[i,l]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!e.repositoryPath)return;let s=!1;return l(!0),B(e.repositoryPath,8).then(e=>{s||n(e)}).catch(()=>{}).finally(()=>{s||l(!1)}),()=>{s=!0}},[e.repositoryPath]),!e.repositoryPath)return null;let o=r?.workingTree,d=o&&(o.staged>0||o.modified>0||o.untracked>0),c=r?.diffStats;return(0,s.jsxs)("div",{className:"pb-4",children:[i?(0,s.jsxs)("div",{className:"text-foreground/40 flex items-center gap-2 px-4 py-8 text-sm",children:[(0,s.jsx)(h.Loader2,{className:"size-4 animate-spin"})," Loading repository info..."]}):null,r?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pt-3",children:[(0,s.jsx)($,{children:(0,s.jsxs)(E,{label:"Branch",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(u.GitBranch,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,s.jsx)("code",{className:"font-mono text-sm",children:r.currentBranch??e.branch??"—"})]}),null!=e.behindCount&&e.behindCount>0?(0,s.jsxs)("span",{className:"mt-0.5 block text-xs text-orange-600 dark:text-orange-400",children:[e.behindCount," behind default"]}):null]})}),(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Working Tree",children:d?(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[o.staged>0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-green-600 dark:text-green-400",children:[(0,s.jsx)(C,{className:"size-3.5"})," ",o.staged," staged"]}):null,o.modified>0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-amber-600 dark:text-amber-400",children:[(0,s.jsx)(N.FileEdit,{className:"size-3.5"})," ",o.modified," modified"]}):null,o.untracked>0?(0,s.jsxs)("span",{className:"text-foreground/50 inline-flex items-center gap-1 text-sm",children:[(0,s.jsx)(k.FilePlus,{className:"size-3.5"})," ",o.untracked," untracked"]}):null]}):(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[(0,s.jsx)(x.Check,{className:"size-3.5"})," Clean"]})})}),c?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Uncommitted Changes",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,s.jsxs)("span",{children:[c.filesChanged," file",1!==c.filesChanged?"s":""]}),(0,s.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",c.insertions]}),(0,s.jsxs)("span",{className:"text-red-500 dark:text-red-400",children:["-",c.deletions]})]})})}):null,r.remotes.length>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Remote",children:r.remotes.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(f.Globe,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:e.url.replace(/\.git$/,"").replace(/^https?:\/\/([^@]+@)?/,"").replace(/x-access-token:[^@]+@/,"")})]},e.name))})}):null,r.stashCount>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Stashes",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(y.Archive,{className:"text-foreground/30 size-3.5 shrink-0"}),r.stashCount," stash",1!==r.stashCount?"es":""]})})}):null,r.tags.length>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Tags",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(e=>(0,s.jsxs)("span",{className:"bg-foreground/[0.04] inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-xs",children:[(0,s.jsx)(v,{className:"text-foreground/30 size-2.5"}),e]},e))})})}):null]}):null,r&&r.commits.length>0?(0,s.jsx)(O,{icon:g.GitCommitHorizontal,title:"Recent Commits",children:(0,s.jsxs)("div",{className:"relative ml-3",children:[(0,s.jsx)("div",{className:"bg-border absolute top-2 bottom-2 left-[5px] w-px"}),r.commits.map((e,t)=>(0,s.jsxs)("div",{className:"group relative flex gap-3 py-1.5",children:[(0,s.jsx)("div",{className:(0,T.cn)("relative z-10 mt-1.5 size-[11px] shrink-0 rounded-full border-2",0===t?"border-primary bg-primary":"border-border bg-background group-hover:border-foreground/30")}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("p",{className:"min-w-0 truncate text-sm leading-snug",children:e.subject}),(0,s.jsx)("code",{className:"text-foreground/30 shrink-0 font-mono text-[11px]",children:e.shortHash})]}),(0,s.jsxs)("div",{className:"text-foreground/40 mt-0.5 flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{children:e.author}),(0,s.jsx)("span",{children:"·"}),(0,s.jsx)("span",{children:e.relativeDate}),e.branch?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"·"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,s.jsx)(u.GitBranch,{className:"size-3"}),e.branch]})]}):null]})]})]},e.hash))]})}):null,r&&r.branches.length>1?(0,s.jsx)(O,{icon:u.GitBranch,title:"Branches",children:(0,s.jsx)("div",{className:"flex flex-col",children:[...r.branches].sort((e,s)=>{let t,a,r,n;return e.isCurrent&&!s.isCurrent?-1:!e.isCurrent&&s.isCurrent?1:(t=e.name,/^(main|master)$/.test(t)&&(a=s.name,!/^(main|master)$/.test(a)))?-1:+(r=e.name,!!(!/^(main|master)$/.test(r)&&(n=s.name,/^(main|master)$/.test(n))))}).map(e=>(0,s.jsxs)("div",{className:(0,T.cn)("flex items-center justify-between rounded px-2 py-1.5",e.isCurrent&&"bg-muted/60"),children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[e.isCurrent?(0,s.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-green-500"}):/^(main|master)$/.test(e.name)?(0,s.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-blue-500"}):(0,s.jsx)("span",{className:"bg-foreground/10 size-2 shrink-0 rounded-full"}),(0,s.jsx)("code",{className:"font-mono text-[13px]",children:e.name}),e.isCurrent?(0,s.jsx)("span",{className:"text-foreground/40 text-[10px]",children:"current"}):null]}),(0,s.jsx)("span",{className:"text-foreground/40 text-xs",children:e.lastCommitDate})]},e.name))})}):null,a?(0,s.jsx)(O,{icon:j.AlertTriangle,title:"Issues",children:(0,s.jsx)($,{className:"bg-destructive/5 border-transparent",children:(0,s.jsx)("p",{className:"text-destructive text-sm",children:a})})}):null]})}e.s(["RepositoryDrawerClient",0,function({data:e,initialTab:u}){let g=(0,R.useFeatureFlags)(),j=(0,a.useRouter)(),f=(0,a.usePathname)().startsWith("/repository/"),[b,v]=(0,t.useState)(u??"overview"),[y,N]=(0,t.useState)(!1),k=(0,S.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),C=(0,t.useCallback)(()=>{j.push("/")},[j]),F=(0,M.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),B="Booting"===F.status||"Ready"===F.status,O=(0,t.useCallback)(()=>{e.repositoryPath&&(navigator.clipboard.writeText(e.repositoryPath),N(!0),setTimeout(()=>N(!1),2e3))},[e.repositoryPath]),$=e.id?`repo-${e.id}`:`repo-${e.name}`;return(0,s.jsx)(z.BaseDrawer,{open:f,onClose:C,size:"lg",modal:!1,"data-testid":"repository-drawer",children:(0,s.jsxs)(L.Tabs,{value:b,onValueChange:v,className:"flex min-h-0 flex-1 flex-col",children:[(0,s.jsxs)(L.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:[(0,s.jsxs)(L.TabsTrigger,{value:"overview",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,s.jsx)(m.LayoutDashboard,{className:"mr-1.5 size-4"}),"Overview"]}),(0,s.jsxs)(L.TabsTrigger,{value:"chat",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,s.jsx)(p.MessageSquare,{className:"mr-1.5 size-4"}),"Chat"]})]}),(0,s.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-4 pe-10 pt-2.5 pb-2","data-testid":"repository-drawer-header",children:[(0,s.jsx)("h2",{className:"text-foreground min-w-0 truncate text-base font-semibold tracking-tight",children:e.name}),e.repositoryPath?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-muted-foreground/40 text-xs",children:"/"}),(0,s.jsx)("span",{className:"text-muted-foreground min-w-0 truncate font-mono text-[11px]",children:e.repositoryPath})]}):null]}),e.repositoryPath?(0,s.jsx)("div",{"data-testid":"repository-drawer-toolbar",children:(0,s.jsxs)("div",{className:"flex h-9 items-center px-1.5",children:[(0,s.jsxs)(P.TooltipProvider,{delayDuration:300,children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openInIde,disabled:k.ideLoading,"aria-label":"Open in IDE",children:k.ideLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(r.Code2,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openInShell,disabled:k.shellLoading,"aria-label":"Open terminal",children:k.shellLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(n.Terminal,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openFolder,disabled:k.folderLoading,"aria-label":"Open folder",children:k.folderLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(i.FolderOpen,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:O,"aria-label":"Copy path",children:y?(0,s.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,s.jsx)(c.Copy,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:y?"Copied!":"Copy path"})]})]}),e.id&&g.gitRebaseSync?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:A}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.syncMain,disabled:k.syncLoading,"aria-label":"Sync main",children:k.syncLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(l.RefreshCw,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Sync main"})]})]}):null,g.envDeploy?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:A}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",disabled:F.deployLoading||F.stopLoading,onClick:B?F.stop:F.deploy,className:(0,T.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",B?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-500 hover:bg-green-500/10 hover:text-green-400"),"aria-label":B?"Stop dev server":"Start dev server",children:F.deployLoading||F.stopLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):B?(0,s.jsx)(d.Square,{className:"size-4"}):(0,s.jsx)(o.Play,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:B?"Stop dev server":"Start dev server"})]}),B?(0,s.jsx)(w.DeploymentStatusBadge,{status:F.status,url:F.url,targetId:e.repositoryPath}):null]}):null]}),(0,s.jsx)("div",{className:"flex-1"})]})}):null]}),(0,s.jsx)(L.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,s.jsx)(H,{data:e,syncError:k.syncError})}),(0,s.jsx)(L.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,s.jsx)(D.ChatTab,{featureId:$,worktreePath:e.repositoryPath})})]})})}],10661)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43416,e=>{"use strict";let s=(0,e.i(3645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],43416)},16489,e=>{"use strict";let s=(0,e.i(3645).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",0,s],16489)},35749,e=>{"use strict";let s=(0,e.i(3645).default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,s],35749)},12919,e=>{"use strict";let s=(0,e.i(3645).default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],12919)},10661,e=>{"use strict";var s=e.i(96871),t=e.i(16539),a=e.i(33109),r=e.i(8986),n=e.i(38573),i=e.i(19933),l=e.i(43416),o=e.i(24042),d=e.i(64970),c=e.i(33548),x=e.i(23925),h=e.i(83428),m=e.i(16489),p=e.i(48109),u=e.i(49228),g=e.i(65530),j=e.i(58481),b=e.i(32494),f=e.i(3645);let v=(0,f.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var y=e.i(37260),N=e.i(35749),k=e.i(12919);let C=(0,f.default)("file-check-corner",[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]]);var T=e.i(31777);e.i(1650);var z=e.i(11495);e.i(99348);var w=e.i(17466),P=e.i(2828),L=e.i(68304),S=e.i(74442),M=e.i(8537),R=e.i(75921),D=e.i(28112),F=e.i(96976);let B=(0,F.createServerReference)("600799469d05e158812b6d4d0b049435747ed9c965",F.callServer,void 0,F.findSourceMapURL,"getGitRepoInfo"),I="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",A="bg-border/60 mx-1.5 h-5 w-px shrink-0";function O({icon:e,title:t,children:a}){return(0,s.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,s.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,s.jsx)(e,{className:"size-4 opacity-50"}),t]}),a]})}function $({children:e,className:t}){return(0,s.jsx)("div",{className:(0,T.cn)("bg-muted/60 rounded-md border border-transparent p-3",t),children:e})}function E({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,s.jsx)("span",{className:"text-sm leading-snug",children:t})]})}function H({data:e,syncError:a}){let[r,n]=(0,t.useState)(null),[i,l]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!e.repositoryPath)return;let s=!1;return l(!0),B(e.repositoryPath,8).then(e=>{s||n(e)}).catch(()=>{}).finally(()=>{s||l(!1)}),()=>{s=!0}},[e.repositoryPath]),!e.repositoryPath)return null;let o=r?.workingTree,d=o&&(o.staged>0||o.modified>0||o.untracked>0),c=r?.diffStats;return(0,s.jsxs)("div",{className:"pb-4",children:[i?(0,s.jsxs)("div",{className:"text-foreground/40 flex items-center gap-2 px-4 py-8 text-sm",children:[(0,s.jsx)(h.Loader2,{className:"size-4 animate-spin"})," Loading repository info..."]}):null,r?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pt-3",children:[(0,s.jsx)($,{children:(0,s.jsxs)(E,{label:"Branch",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(u.GitBranch,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,s.jsx)("code",{className:"font-mono text-sm",children:r.currentBranch??e.branch??"—"})]}),null!=e.behindCount&&e.behindCount>0?(0,s.jsxs)("span",{className:"mt-0.5 block text-xs text-orange-600 dark:text-orange-400",children:[e.behindCount," behind default"]}):null]})}),(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Working Tree",children:d?(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[o.staged>0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-green-600 dark:text-green-400",children:[(0,s.jsx)(C,{className:"size-3.5"})," ",o.staged," staged"]}):null,o.modified>0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-amber-600 dark:text-amber-400",children:[(0,s.jsx)(N.FileEdit,{className:"size-3.5"})," ",o.modified," modified"]}):null,o.untracked>0?(0,s.jsxs)("span",{className:"text-foreground/50 inline-flex items-center gap-1 text-sm",children:[(0,s.jsx)(k.FilePlus,{className:"size-3.5"})," ",o.untracked," untracked"]}):null]}):(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[(0,s.jsx)(x.Check,{className:"size-3.5"})," Clean"]})})}),c?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Uncommitted Changes",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,s.jsxs)("span",{children:[c.filesChanged," file",1!==c.filesChanged?"s":""]}),(0,s.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",c.insertions]}),(0,s.jsxs)("span",{className:"text-red-500 dark:text-red-400",children:["-",c.deletions]})]})})}):null,r.remotes.length>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Remote",children:r.remotes.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(b.Globe,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:e.url.replace(/\.git$/,"").replace(/^https?:\/\/([^@]+@)?/,"").replace(/x-access-token:[^@]+@/,"")})]},e.name))})}):null,r.stashCount>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Stashes",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(y.Archive,{className:"text-foreground/30 size-3.5 shrink-0"}),r.stashCount," stash",1!==r.stashCount?"es":""]})})}):null,r.tags.length>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Tags",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(e=>(0,s.jsxs)("span",{className:"bg-foreground/[0.04] inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-xs",children:[(0,s.jsx)(v,{className:"text-foreground/30 size-2.5"}),e]},e))})})}):null]}):null,r&&r.commits.length>0?(0,s.jsx)(O,{icon:g.GitCommitHorizontal,title:"Recent Commits",children:(0,s.jsxs)("div",{className:"relative ml-3",children:[(0,s.jsx)("div",{className:"bg-border absolute top-2 bottom-2 left-[5px] w-px"}),r.commits.map((e,t)=>(0,s.jsxs)("div",{className:"group relative flex gap-3 py-1.5",children:[(0,s.jsx)("div",{className:(0,T.cn)("relative z-10 mt-1.5 size-[11px] shrink-0 rounded-full border-2",0===t?"border-primary bg-primary":"border-border bg-background group-hover:border-foreground/30")}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("p",{className:"min-w-0 truncate text-sm leading-snug",children:e.subject}),(0,s.jsx)("code",{className:"text-foreground/30 shrink-0 font-mono text-[11px]",children:e.shortHash})]}),(0,s.jsxs)("div",{className:"text-foreground/40 mt-0.5 flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{children:e.author}),(0,s.jsx)("span",{children:"·"}),(0,s.jsx)("span",{children:e.relativeDate}),e.branch?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"·"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,s.jsx)(u.GitBranch,{className:"size-3"}),e.branch]})]}):null]})]})]},e.hash))]})}):null,r&&r.branches.length>1?(0,s.jsx)(O,{icon:u.GitBranch,title:"Branches",children:(0,s.jsx)("div",{className:"flex flex-col",children:[...r.branches].sort((e,s)=>{let t,a,r,n;return e.isCurrent&&!s.isCurrent?-1:!e.isCurrent&&s.isCurrent?1:(t=e.name,/^(main|master)$/.test(t)&&(a=s.name,!/^(main|master)$/.test(a)))?-1:+(r=e.name,!!(!/^(main|master)$/.test(r)&&(n=s.name,/^(main|master)$/.test(n))))}).map(e=>(0,s.jsxs)("div",{className:(0,T.cn)("flex items-center justify-between rounded px-2 py-1.5",e.isCurrent&&"bg-muted/60"),children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[e.isCurrent?(0,s.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-green-500"}):/^(main|master)$/.test(e.name)?(0,s.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-blue-500"}):(0,s.jsx)("span",{className:"bg-foreground/10 size-2 shrink-0 rounded-full"}),(0,s.jsx)("code",{className:"font-mono text-[13px]",children:e.name}),e.isCurrent?(0,s.jsx)("span",{className:"text-foreground/40 text-[10px]",children:"current"}):null]}),(0,s.jsx)("span",{className:"text-foreground/40 text-xs",children:e.lastCommitDate})]},e.name))})}):null,a?(0,s.jsx)(O,{icon:j.AlertTriangle,title:"Issues",children:(0,s.jsx)($,{className:"bg-destructive/5 border-transparent",children:(0,s.jsx)("p",{className:"text-destructive text-sm",children:a})})}):null]})}e.s(["RepositoryDrawerClient",0,function({data:e,initialTab:u}){let g=(0,R.useFeatureFlags)(),j=(0,a.useRouter)(),b=(0,a.usePathname)().startsWith("/repository/"),[f,v]=(0,t.useState)(u??"overview"),[y,N]=(0,t.useState)(!1),k=(0,S.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),C=(0,t.useCallback)(()=>{j.push("/")},[j]),F=(0,M.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),B="Booting"===F.status||"Ready"===F.status,O=(0,t.useCallback)(()=>{e.repositoryPath&&(navigator.clipboard.writeText(e.repositoryPath),N(!0),setTimeout(()=>N(!1),2e3))},[e.repositoryPath]),$=e.id?`repo-${e.id}`:`repo-${e.name}`;return(0,s.jsx)(z.BaseDrawer,{open:b,onClose:C,size:"lg",modal:!1,"data-testid":"repository-drawer",children:(0,s.jsxs)(L.Tabs,{value:f,onValueChange:v,className:"flex min-h-0 flex-1 flex-col",children:[(0,s.jsxs)(L.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:[(0,s.jsxs)(L.TabsTrigger,{value:"overview",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,s.jsx)(m.LayoutDashboard,{className:"mr-1.5 size-4"}),"Overview"]}),(0,s.jsxs)(L.TabsTrigger,{value:"chat",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,s.jsx)(p.MessageSquare,{className:"mr-1.5 size-4"}),"Chat"]})]}),(0,s.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-4 pe-10 pt-2.5 pb-2","data-testid":"repository-drawer-header",children:[(0,s.jsx)("h2",{className:"text-foreground min-w-0 truncate text-base font-semibold tracking-tight",children:e.name}),e.repositoryPath?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-muted-foreground/40 text-xs",children:"/"}),(0,s.jsx)("span",{className:"text-muted-foreground min-w-0 truncate font-mono text-[11px]",children:e.repositoryPath})]}):null]}),e.repositoryPath?(0,s.jsx)("div",{"data-testid":"repository-drawer-toolbar",children:(0,s.jsxs)("div",{className:"flex h-9 items-center px-1.5",children:[(0,s.jsxs)(P.TooltipProvider,{delayDuration:300,children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openInIde,disabled:k.ideLoading,"aria-label":"Open in IDE",children:k.ideLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(r.Code2,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openInShell,disabled:k.shellLoading,"aria-label":"Open terminal",children:k.shellLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(n.Terminal,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openFolder,disabled:k.folderLoading,"aria-label":"Open folder",children:k.folderLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(i.FolderOpen,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:O,"aria-label":"Copy path",children:y?(0,s.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,s.jsx)(c.Copy,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:y?"Copied!":"Copy path"})]})]}),e.id&&g.gitRebaseSync?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:A}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.syncMain,disabled:k.syncLoading,"aria-label":"Sync main",children:k.syncLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):(0,s.jsx)(l.RefreshCw,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Sync main"})]})]}):null,g.envDeploy?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:A}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",disabled:F.deployLoading||F.stopLoading,onClick:B?F.stop:F.deploy,className:(0,T.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",B?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-500 hover:bg-green-500/10 hover:text-green-400"),"aria-label":B?"Stop dev server":"Start dev server",children:F.deployLoading||F.stopLoading?(0,s.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):B?(0,s.jsx)(d.Square,{className:"size-4"}):(0,s.jsx)(o.Play,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:B?"Stop dev server":"Start dev server"})]}),B?(0,s.jsx)(w.DeploymentStatusBadge,{status:F.status,url:F.url,targetId:e.repositoryPath}):null]}):null]}),(0,s.jsx)("div",{className:"flex-1"})]})}):null]}),(0,s.jsx)(L.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,s.jsx)(H,{data:e,syncError:k.syncError})}),(0,s.jsx)(L.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,s.jsx)(D.ChatTab,{featureId:$,worktreePath:e.repositoryPath})})]})})}],10661)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("4095c06403d4d73bf37410154c0c88c730720d1ea9",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(98026);var n=e.i(50728);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),h=e.i(81846),u=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("4067c4dceee2978700f0b81a9687b11191587bc041",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(16868),w=e.i(53360),C=e.i(55016),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var k=e.i(86254),P=e.i(9749);function T({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:A,overrideModel:M,currentAgentType:O,currentModel:I,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),G=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:G,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=G.current?.contains(document.activeElement),t=G.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(k.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(P.AgentModelPicker,{initialAgentType:A??O??"claude-code",initialModel:M??I??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(81542),F=e.i(70471),E=e.i(43416);let R=["allowPrd","allowPlan","allowMerge"];function L({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:h,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:k,computedOpenPr:P,isSubmitting:T}){let{t:A}=(0,n.useTranslation)("web"),M=[{id:"allowPrd",label:A("createDrawer.prd"),description:A("createDrawer.prdDescription")},{id:"allowPlan",label:A("createDrawer.plan"),description:A("createDrawer.planDescription")},{id:"allowMerge",label:A("createDrawer.merge"),description:A("createDrawer.mergeDescription")}];return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.approve")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(a=>(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:T||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?A("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=R.every(t=>e[t]),a={};for(let e of R)a[e]=!t;r(a)},disabled:T,className:(0,y.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",R.every(t=>e[t])&&"text-primary"),children:A("createDrawer.all")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.evidence")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.collect")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.collectDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:T||!a||!d&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!d&&!v)&&"opacity-50"),children:A("createDrawer.addToPr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:d||v?a?A("createDrawer.addToPrDescription"):A("createDrawer.requiresEvidence"):A("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:A("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:k,onCheckedChange:e=>{c(e),!e&&d&&h(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.push")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.pushDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:P,onCheckedChange:e=>{h(e),e||o(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.pr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.prDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.watch")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),A("createDrawer.sync")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.syncDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),A("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),A("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.forkAndPrDescription")})]})]})]})]})}var A=e.i(83843),M=e.i(97667),O=e.i(98127),I=e.i(90382);function z({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),h=(0,r.useRef)(null),u=e.find(e=>e.id===a),m=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.id.toLowerCase().includes(d.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>h.current?.focus(),0):p("")},[l]),(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!u&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:u?`${u.name} (${u.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(O.Input,{ref:h,placeholder:o("createDrawer.searchFeatures"),value:d,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&d?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}var U=e.i(91925),B=e.i(83428),G=e.i(25235),W=e.i(75921),$=e.i(20097),q=e.i(78521);e.i(13322);var K=e.i(61201);function Z({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[h,u]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,W.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.path.toLowerCase().includes(d.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,$.addRepository)({path:e});if(t.error){x(t.error),u(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),c(!1),p("")}},[i,s]),k=(0,r.useCallback)(async()=>{if(!h){if(j)return void g(!0);u(!0),x(null);try{let e=await (0,q.pickFolder)();if(!e)return void u(!1);await N(e)}catch{g(!0)}finally{u(!1)}}},[h,j,N]),P=(0,r.useCallback)(async e=>{if(g(!1),e){u(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{u(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(O.Input,{ref:b,placeholder:v("createDrawer.searchRepositories"),value:d,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(G.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:k,disabled:h,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[h?(0,t.jsx)(B.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(U.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(K.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:P})]})}function J({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:c,initialDescription:d,canPushDirectly:p}){let h=(0,m.useSoundAction)("create"),u=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,k=i?.fast!==!1,[P,T]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&T(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,A]=(0,r.useState)(w),[M,O]=(0,r.useState)(C),[I,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[G,W]=(0,r.useState)(N),[$,q]=(0,r.useState)(void 0),[K,Z]=(0,r.useState)(k),[J,V]=(0,r.useState)(!1),[H,Q]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!0),[_,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(u||void 0),[en,el]=(0,r.useState)(o??[]),[ec,ed]=(0,r.useState)(!1),[ep,eh]=(0,r.useState)(null),[eu,em]=(0,r.useState)(!1),ex=(0,r.useRef)(crypto.randomUUID()),ef=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),A(i.push),O(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),W(i.commitEvidence),Z(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{el(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&q(n)},[e,n]);let[eg,eb]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{eb(p??!1)},[p]);let ej=(0,r.useRef)(ei);(0,r.useEffect)(()=>{ei&&ei!==ej.current&&(ej.current=ei,f(ei).then(e=>eb(e.canPushDirectly)).catch(()=>eb(!1)))},[ei]),(0,r.useEffect)(()=>{eg&&(Q(!1),A(w),O(C),Y(!0))},[eg,w,C]);let ev=(0,r.useCallback)(()=>{T(""),F([]),R({...v}),A(w),O(C),z(y),B(D),W(N),q(void 0),eo(u||void 0),el(o??[]),Z(k),V(!1),Q(!1),Y(!0),ee(!0),er(void 0),es(void 0),eh(null),ef.current=0,ed(!1)},[v,w,C,D,y,N,k,u,o]),ew=""!==P.trim()||S.length>0,{attemptClose:eC}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ew,onClose:t,onReset:ev}),ey=(0,r.useCallback)(async e=>{for(let t of(eh(null),e)){if(t.size>0xa00000)return void eh(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!b.has(e))return void eh(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",ex.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let s=await a.json();F(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current+=1,1===ef.current&&ed(!0)},[]),eN=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current-=1,0===ef.current&&ed(!1)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current=0,ed(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&ey(t)},[ey]),eT=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),ey(r))},[ey]),eS=(0,r.useCallback)(e=>{if(e.preventDefault(),!P.trim())return;let t=ei??u;t&&(h.play(),a({description:P.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!H||L||M,openPr:!!H||M,ciWatchEnabled:I,enableEvidence:U,commitEvidence:G,fast:K,forkAndPr:H,commitSpecs:X,rebaseBeforeBranch:_,...J?{pending:J}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...$?{parentId:$}:{},sessionId:ex.current}),ev())},[P,S,E,ei,u,a,L,M,U,I,G,K,H,X,_,J,et,ea,$,h,ev]),eF=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:ex.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let a=await r.json();F(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}}catch{}},[]),eE=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eR=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:u,canPush:eg,isDirty:ew,computedPush:!!H||L||M,computedOpenPr:!!H||M,description:P,setDescription:T,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:A,openPr:M,setOpenPr:O,ciWatchEnabled:I,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:G,setCommitEvidence:W,parentId:$,setParentId:q,fast:K,setFast:Z,pending:J,setPending:V,forkAndPr:H,setForkAndPr:Q,commitSpecs:X,setCommitSpecs:Y,rebaseBeforeBranch:_,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,selectedRepoPath:ei,setSelectedRepoPath:eo,localRepos:en,setLocalRepos:el,isDragOver:ec,uploadError:ep,isPromptFocused:eu,setIsPromptFocused:em,sessionIdRef:ex,currentAgentType:l,currentModel:c,attemptClose:eC,handleFiles:ey,handleDragEnter:eD,handleDragLeave:eN,handleDragOver:ek,handleDrop:eP,handlePaste:eT,handleSubmit:eS,handleAddFiles:eF,handleRemoveFile:eE,handleNotesChange:eR,resetForm:ev}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),A=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,O=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(c.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(h.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(d.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(d.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||O,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(u.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(Z,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(T,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),A&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(z,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(L,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:h,canPushDirectly:u}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),f(!1)})},[m]);return(0,t.jsx)(J,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:h,canPushDirectly:u})}],15203)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("4065019e882df136fcd225a6934dc6474f0be53c1f",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(98026);var n=e.i(50728);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),h=e.i(81846),u=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("4064a87f40dd33931fbc9add9a323b61452ae8fd1e",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(16868),w=e.i(53360),C=e.i(55016),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var k=e.i(86254),P=e.i(9749);function T({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:A,overrideModel:M,currentAgentType:O,currentModel:I,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),G=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:G,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=G.current?.contains(document.activeElement),t=G.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(k.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(P.AgentModelPicker,{initialAgentType:A??O??"claude-code",initialModel:M??I??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(81542),F=e.i(70471),E=e.i(43416);let R=["allowPrd","allowPlan","allowMerge"];function L({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:h,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:k,computedOpenPr:P,isSubmitting:T}){let{t:A}=(0,n.useTranslation)("web"),M=[{id:"allowPrd",label:A("createDrawer.prd"),description:A("createDrawer.prdDescription")},{id:"allowPlan",label:A("createDrawer.plan"),description:A("createDrawer.planDescription")},{id:"allowMerge",label:A("createDrawer.merge"),description:A("createDrawer.mergeDescription")}];return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.approve")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(a=>(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:T||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?A("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=R.every(t=>e[t]),a={};for(let e of R)a[e]=!t;r(a)},disabled:T,className:(0,y.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",R.every(t=>e[t])&&"text-primary"),children:A("createDrawer.all")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.evidence")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.collect")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.collectDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:T||!a||!d&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!d&&!v)&&"opacity-50"),children:A("createDrawer.addToPr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:d||v?a?A("createDrawer.addToPrDescription"):A("createDrawer.requiresEvidence"):A("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:A("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:k,onCheckedChange:e=>{c(e),!e&&d&&h(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.push")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.pushDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:P,onCheckedChange:e=>{h(e),e||o(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.pr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.prDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.watch")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),A("createDrawer.sync")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.syncDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),A("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),A("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.forkAndPrDescription")})]})]})]})]})}var A=e.i(83843),M=e.i(97667),O=e.i(98127),I=e.i(90382);function z({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),h=(0,r.useRef)(null),u=e.find(e=>e.id===a),m=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.id.toLowerCase().includes(d.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>h.current?.focus(),0):p("")},[l]),(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!u&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:u?`${u.name} (${u.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(O.Input,{ref:h,placeholder:o("createDrawer.searchFeatures"),value:d,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&d?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}var U=e.i(91925),B=e.i(83428),G=e.i(25235),W=e.i(75921),$=e.i(86989),q=e.i(78521);e.i(13322);var K=e.i(61201);function Z({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[h,u]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,W.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.path.toLowerCase().includes(d.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,$.addRepository)({path:e});if(t.error){x(t.error),u(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),c(!1),p("")}},[i,s]),k=(0,r.useCallback)(async()=>{if(!h){if(j)return void g(!0);u(!0),x(null);try{let e=await (0,q.pickFolder)();if(!e)return void u(!1);await N(e)}catch{g(!0)}finally{u(!1)}}},[h,j,N]),P=(0,r.useCallback)(async e=>{if(g(!1),e){u(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{u(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(O.Input,{ref:b,placeholder:v("createDrawer.searchRepositories"),value:d,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(G.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:k,disabled:h,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[h?(0,t.jsx)(B.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(U.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(K.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:P})]})}function J({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:c,initialDescription:d,canPushDirectly:p}){let h=(0,m.useSoundAction)("create"),u=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,k=i?.fast!==!1,[P,T]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&T(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,A]=(0,r.useState)(w),[M,O]=(0,r.useState)(C),[I,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[G,W]=(0,r.useState)(N),[$,q]=(0,r.useState)(void 0),[K,Z]=(0,r.useState)(k),[J,V]=(0,r.useState)(!1),[H,Q]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!0),[_,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(u||void 0),[en,el]=(0,r.useState)(o??[]),[ec,ed]=(0,r.useState)(!1),[ep,eh]=(0,r.useState)(null),[eu,em]=(0,r.useState)(!1),ex=(0,r.useRef)(crypto.randomUUID()),ef=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),A(i.push),O(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),W(i.commitEvidence),Z(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{el(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&q(n)},[e,n]);let[eg,eb]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{eb(p??!1)},[p]);let ej=(0,r.useRef)(ei);(0,r.useEffect)(()=>{ei&&ei!==ej.current&&(ej.current=ei,f(ei).then(e=>eb(e.canPushDirectly)).catch(()=>eb(!1)))},[ei]),(0,r.useEffect)(()=>{eg&&(Q(!1),A(w),O(C),Y(!0))},[eg,w,C]);let ev=(0,r.useCallback)(()=>{T(""),F([]),R({...v}),A(w),O(C),z(y),B(D),W(N),q(void 0),eo(u||void 0),el(o??[]),Z(k),V(!1),Q(!1),Y(!0),ee(!0),er(void 0),es(void 0),eh(null),ef.current=0,ed(!1)},[v,w,C,D,y,N,k,u,o]),ew=""!==P.trim()||S.length>0,{attemptClose:eC}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ew,onClose:t,onReset:ev}),ey=(0,r.useCallback)(async e=>{for(let t of(eh(null),e)){if(t.size>0xa00000)return void eh(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!b.has(e))return void eh(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",ex.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let s=await a.json();F(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current+=1,1===ef.current&&ed(!0)},[]),eN=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current-=1,0===ef.current&&ed(!1)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current=0,ed(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&ey(t)},[ey]),eT=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),ey(r))},[ey]),eS=(0,r.useCallback)(e=>{if(e.preventDefault(),!P.trim())return;let t=ei??u;t&&(h.play(),a({description:P.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!H||L||M,openPr:!!H||M,ciWatchEnabled:I,enableEvidence:U,commitEvidence:G,fast:K,forkAndPr:H,commitSpecs:X,rebaseBeforeBranch:_,...J?{pending:J}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...$?{parentId:$}:{},sessionId:ex.current}),ev())},[P,S,E,ei,u,a,L,M,U,I,G,K,H,X,_,J,et,ea,$,h,ev]),eF=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:ex.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let a=await r.json();F(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}}catch{}},[]),eE=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eR=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:u,canPush:eg,isDirty:ew,computedPush:!!H||L||M,computedOpenPr:!!H||M,description:P,setDescription:T,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:A,openPr:M,setOpenPr:O,ciWatchEnabled:I,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:G,setCommitEvidence:W,parentId:$,setParentId:q,fast:K,setFast:Z,pending:J,setPending:V,forkAndPr:H,setForkAndPr:Q,commitSpecs:X,setCommitSpecs:Y,rebaseBeforeBranch:_,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,selectedRepoPath:ei,setSelectedRepoPath:eo,localRepos:en,setLocalRepos:el,isDragOver:ec,uploadError:ep,isPromptFocused:eu,setIsPromptFocused:em,sessionIdRef:ex,currentAgentType:l,currentModel:c,attemptClose:eC,handleFiles:ey,handleDragEnter:eD,handleDragLeave:eN,handleDragOver:ek,handleDrop:eP,handlePaste:eT,handleSubmit:eS,handleAddFiles:eF,handleRemoveFile:eE,handleNotesChange:eR,resetForm:ev}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),A=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,O=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(c.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(h.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(d.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(d.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||O,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(u.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(Z,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(T,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),A&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(z,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(L,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:h,canPushDirectly:u}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),f(!1)})},[m]);return(0,t.jsx)(J,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:h,canPushDirectly:u})}],15203)}]);