@shipit-ai/cli 1.173.0 → 1.173.1-pr18.cc1c3ce

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 (250) hide show
  1. package/dist/packages/core/src/application/ports/output/services/mcp-server-browser.interface.d.ts +9 -1
  2. package/dist/packages/core/src/application/ports/output/services/mcp-server-browser.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/use-cases/mcp-servers/fetch-mcp-server-tools.use-case.d.ts +7 -3
  4. package/dist/packages/core/src/application/use-cases/mcp-servers/fetch-mcp-server-tools.use-case.d.ts.map +1 -1
  5. package/dist/packages/core/src/application/use-cases/mcp-servers/fetch-mcp-server-tools.use-case.js +6 -5
  6. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.d.ts.map +1 -1
  7. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.js +10 -0
  8. package/dist/packages/core/src/infrastructure/services/mcp-server-browser/mcp-server-browser.schema.d.ts +12 -0
  9. package/dist/packages/core/src/infrastructure/services/mcp-server-browser/mcp-server-browser.schema.d.ts.map +1 -1
  10. package/dist/packages/core/src/infrastructure/services/mcp-server-browser/mcp-server-browser.schema.js +11 -1
  11. package/dist/packages/core/src/infrastructure/services/mcp-server-browser/mcp-server-browser.service.d.ts +10 -2
  12. package/dist/packages/core/src/infrastructure/services/mcp-server-browser/mcp-server-browser.service.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/services/mcp-server-browser/mcp-server-browser.service.js +50 -13
  14. package/dist/src/presentation/web/app/actions/fetch-mcp-server-tools.d.ts +1 -1
  15. package/dist/src/presentation/web/app/actions/fetch-mcp-server-tools.d.ts.map +1 -1
  16. package/dist/src/presentation/web/app/actions/fetch-mcp-server-tools.js +2 -2
  17. package/dist/src/presentation/web/app/mcp-servers/page.d.ts.map +1 -1
  18. package/dist/src/presentation/web/app/mcp-servers/page.js +3 -1
  19. package/dist/src/presentation/web/components/features/mcp-servers/mcp-connect-instructions.d.ts +19 -0
  20. package/dist/src/presentation/web/components/features/mcp-servers/mcp-connect-instructions.d.ts.map +1 -0
  21. package/dist/src/presentation/web/components/features/mcp-servers/mcp-connect-instructions.js +108 -0
  22. package/dist/src/presentation/web/components/features/mcp-servers/mcp-connect-instructions.stories.d.ts +11 -0
  23. package/dist/src/presentation/web/components/features/mcp-servers/mcp-connect-instructions.stories.d.ts.map +1 -0
  24. package/dist/src/presentation/web/components/features/mcp-servers/mcp-connect-instructions.stories.js +18 -0
  25. package/dist/src/presentation/web/components/features/mcp-servers/mcp-server-card.js +1 -1
  26. package/dist/src/presentation/web/components/features/mcp-servers/mcp-server-detail-drawer.d.ts +2 -2
  27. package/dist/src/presentation/web/components/features/mcp-servers/mcp-server-detail-drawer.d.ts.map +1 -1
  28. package/dist/src/presentation/web/components/features/mcp-servers/mcp-server-detail-drawer.js +15 -9
  29. package/dist/src/presentation/web/components/features/mcp-servers/mcp-server-detail-drawer.stories.d.ts +1 -1
  30. package/dist/src/presentation/web/components/features/mcp-servers/mcp-server-detail-drawer.stories.js +1 -1
  31. package/dist/src/presentation/web/components/features/mcp-servers/mcp-servers-page-client.d.ts +2 -1
  32. package/dist/src/presentation/web/components/features/mcp-servers/mcp-servers-page-client.d.ts.map +1 -1
  33. package/dist/src/presentation/web/components/features/mcp-servers/mcp-servers-page-client.js +3 -4
  34. package/dist/src/presentation/web/components/features/mcp-servers/mcp-servers-page-client.stories.js +2 -2
  35. package/dist/src/presentation/web/components/features/mcp-servers/mcp-tool-list.d.ts +17 -13
  36. package/dist/src/presentation/web/components/features/mcp-servers/mcp-tool-list.d.ts.map +1 -1
  37. package/dist/src/presentation/web/components/features/mcp-servers/mcp-tool-list.js +22 -35
  38. package/dist/src/presentation/web/components/features/mcp-servers/mcp-tool-list.stories.d.ts +1 -1
  39. package/dist/src/presentation/web/components/features/mcp-servers/mcp-tool-list.stories.d.ts.map +1 -1
  40. package/dist/src/presentation/web/components/features/mcp-servers/mcp-tool-list.stories.js +7 -8
  41. package/dist/translations/ar/web.json +6 -1
  42. package/dist/translations/de/web.json +6 -1
  43. package/dist/translations/en/web.json +6 -1
  44. package/dist/translations/es/web.json +6 -1
  45. package/dist/translations/fr/web.json +6 -1
  46. package/dist/translations/he/web.json +6 -1
  47. package/dist/translations/pt/web.json +6 -1
  48. package/dist/translations/ru/web.json +6 -1
  49. package/dist/tsconfig.build.tsbuildinfo +1 -1
  50. package/package.json +1 -1
  51. package/web/.next/BUILD_ID +1 -1
  52. package/web/.next/build-manifest.json +3 -3
  53. package/web/.next/fallback-build-manifest.json +3 -3
  54. package/web/.next/prerender-manifest.json +3 -3
  55. package/web/.next/required-server-files.js +3 -3
  56. package/web/.next/required-server-files.json +3 -3
  57. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  58. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  59. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  61. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  62. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +31 -31
  64. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  67. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  68. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  69. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  70. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  71. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  73. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  74. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  76. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  77. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  79. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  80. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +31 -31
  82. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  83. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  85. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  86. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  88. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  89. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  90. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  91. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  92. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  93. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  94. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  95. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  96. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  97. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  98. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  99. package/web/.next/server/app/_global-error.html +1 -1
  100. package/web/.next/server/app/_global-error.rsc +1 -1
  101. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  102. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  103. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  104. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  105. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  106. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  107. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  108. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  109. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  110. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  111. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  112. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  113. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  114. package/web/.next/server/app/mcp-servers/page/server-reference-manifest.json +13 -13
  115. package/web/.next/server/app/mcp-servers/page.js.nft.json +1 -1
  116. package/web/.next/server/app/mcp-servers/page_client-reference-manifest.js +1 -1
  117. package/web/.next/server/app/plugins/page/server-reference-manifest.json +15 -15
  118. package/web/.next/server/app/plugins/page.js.nft.json +1 -1
  119. package/web/.next/server/app/plugins/page_client-reference-manifest.js +1 -1
  120. package/web/.next/server/app/settings/page/server-reference-manifest.json +12 -12
  121. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  122. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  123. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  124. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  125. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  126. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  127. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  128. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  129. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  130. package/web/.next/server/app/version/page.js.nft.json +1 -1
  131. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  132. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  133. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  134. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  135. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  136. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/0j.8_web_components_features_mcp-servers_mcp-servers-page-client_tsx_0dda8ih._.js +10 -0
  138. package/web/.next/server/chunks/ssr/0j.8_web_components_features_mcp-servers_mcp-servers-page-client_tsx_0dda8ih._.js.map +1 -0
  139. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  140. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  142. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  143. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.5ojmt._.js +1 -1
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.5ojmt._.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__05_qc0n._.js +1 -1
  146. package/web/.next/server/chunks/ssr/[root-of-the-server]__05_qc0n._.js.map +1 -1
  147. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ge~xny._.js +1 -1
  148. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ge~xny._.js.map +1 -1
  149. package/web/.next/server/chunks/ssr/[root-of-the-server]__0mwao26._.js +3 -0
  150. package/web/.next/server/chunks/ssr/[root-of-the-server]__0mwao26._.js.map +1 -0
  151. package/web/.next/server/chunks/ssr/[root-of-the-server]__0qda~yi._.js +1 -1
  152. package/web/.next/server/chunks/ssr/[root-of-the-server]__0qda~yi._.js.map +1 -1
  153. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  154. package/web/.next/server/chunks/ssr/[root-of-the-server]__0tq2syh._.js +1 -1
  155. package/web/.next/server/chunks/ssr/[root-of-the-server]__0t~u8sd._.js +1 -1
  156. package/web/.next/server/chunks/ssr/[root-of-the-server]__0t~u8sd._.js.map +1 -1
  157. package/web/.next/server/chunks/ssr/[root-of-the-server]__10tll_l._.js +1 -1
  158. package/web/.next/server/chunks/ssr/[root-of-the-server]__10tll_l._.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/[root-of-the-server]__12j29w-._.js +1 -1
  160. package/web/.next/server/chunks/ssr/[root-of-the-server]__12j29w-._.js.map +1 -1
  161. package/web/.next/server/chunks/ssr/[root-of-the-server]__13pshs0._.js +1 -1
  162. package/web/.next/server/chunks/ssr/[root-of-the-server]__13pshs0._.js.map +1 -1
  163. package/web/.next/server/chunks/ssr/_0-09vq7._.js +1 -1
  164. package/web/.next/server/chunks/ssr/_0-09vq7._.js.map +1 -1
  165. package/web/.next/server/chunks/ssr/_01sesw0._.js +1 -1
  166. package/web/.next/server/chunks/ssr/_01sesw0._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/_069y.js._.js +2 -2
  168. package/web/.next/server/chunks/ssr/_069y.js._.js.map +1 -1
  169. package/web/.next/server/chunks/ssr/_096x3u~._.js +1 -1
  170. package/web/.next/server/chunks/ssr/_096x3u~._.js.map +1 -1
  171. package/web/.next/server/chunks/ssr/_0__4si~._.js +1 -1
  172. package/web/.next/server/chunks/ssr/_0__4si~._.js.map +1 -1
  173. package/web/.next/server/chunks/ssr/_0_m17kl._.js +1 -1
  174. package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +1 -1
  175. package/web/.next/server/chunks/ssr/_0av5r-b._.js +3 -0
  176. package/web/.next/server/chunks/ssr/_0av5r-b._.js.map +1 -0
  177. package/web/.next/server/chunks/ssr/{_0i0_q..._.js → _0b~rt5k._.js} +2 -2
  178. package/web/.next/server/chunks/ssr/{_0i0_q..._.js.map → _0b~rt5k._.js.map} +1 -1
  179. package/web/.next/server/chunks/ssr/_0d4miu.._.js +1 -1
  180. package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +1 -1
  181. package/web/.next/server/chunks/ssr/_0e8ern9._.js +1 -1
  182. package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +1 -1
  183. package/web/.next/server/chunks/ssr/_0fswe4r._.js +3 -0
  184. package/web/.next/server/chunks/ssr/_0fswe4r._.js.map +1 -0
  185. package/web/.next/server/chunks/ssr/{_052jfzq._.js → _0g36k1q._.js} +2 -2
  186. package/web/.next/server/chunks/ssr/{_052jfzq._.js.map → _0g36k1q._.js.map} +1 -1
  187. package/web/.next/server/chunks/ssr/{_0wl~vw0._.js → _0ha3y7r._.js} +2 -2
  188. package/web/.next/server/chunks/ssr/{_0wl~vw0._.js.map → _0ha3y7r._.js.map} +1 -1
  189. package/web/.next/server/chunks/ssr/_0p3~u8u._.js +2 -2
  190. package/web/.next/server/chunks/ssr/_0p3~u8u._.js.map +1 -1
  191. package/web/.next/server/chunks/ssr/_0r.3n~3._.js +1 -1
  192. package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +1 -1
  193. package/web/.next/server/chunks/ssr/_0t59q8r._.js +1 -1
  194. package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +1 -1
  195. package/web/.next/server/chunks/ssr/_0vyfc4b._.js +1 -1
  196. package/web/.next/server/chunks/ssr/_0vyfc4b._.js.map +1 -1
  197. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  198. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  199. package/web/.next/server/chunks/ssr/_0zk-h5w._.js +1 -1
  200. package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +1 -1
  201. package/web/.next/server/chunks/ssr/_0~7lwu_._.js +1 -1
  202. package/web/.next/server/chunks/ssr/_0~7lwu_._.js.map +1 -1
  203. package/web/.next/server/chunks/ssr/_1161g9x._.js +1 -1
  204. package/web/.next/server/chunks/ssr/_1161g9x._.js.map +1 -1
  205. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_mcp-servers_page_actions_0d.r4q..js +1 -1
  206. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_mcp-servers_page_actions_0d.r4q..js.map +1 -1
  207. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_plugins_page_actions_0rdndum.js +1 -1
  208. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_plugins_page_actions_0rdndum.js.map +1 -1
  209. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +1 -1
  210. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +1 -1
  211. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +1 -1
  212. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +1 -1
  213. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_0pjb_re._.js +1 -1
  214. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  215. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  216. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  217. package/web/.next/server/middleware-build-manifest.js +3 -3
  218. package/web/.next/server/pages/500.html +1 -1
  219. package/web/.next/server/server-reference-manifest.js +1 -1
  220. package/web/.next/server/server-reference-manifest.json +57 -57
  221. package/web/.next/static/chunks/{0.zpc6-geo2pp.js → 0-479g9ihl1ga.js} +1 -1
  222. package/web/.next/static/chunks/{0yz729_n37__3.js → 02ow0rjxjqsob.js} +1 -1
  223. package/web/.next/static/chunks/{0j-doxnxl43yu.js → 04mde8apvce...js} +1 -1
  224. package/web/.next/static/chunks/05uewqqwl93w2.js +8 -0
  225. package/web/.next/static/chunks/{0xmqx8qtb0njk.js → 06fk~iz2u90ux.js} +1 -1
  226. package/web/.next/static/chunks/{0x_xky1fcolbm.js → 08-x1y93o~z1u.js} +1 -1
  227. package/web/.next/static/chunks/{0sgbbtfp4hspl.js → 0gz0lgz7pvrb5.js} +1 -1
  228. package/web/.next/static/chunks/0h2nh2s2b3ma2.css +1 -0
  229. package/web/.next/static/chunks/{156lo29queyhm.js → 0irjgz-p.9i6s.js} +1 -1
  230. package/web/.next/static/chunks/{09ix490-00s4x.js → 0isdv5nl9ixzx.js} +1 -1
  231. package/web/.next/static/chunks/{0sliw7pn2d_57.js → 0nkxltjer~us7.js} +1 -1
  232. package/web/.next/static/chunks/{0ghc-76~~v-cj.js → 0nw5kg.d92o~s.js} +2 -2
  233. package/web/.next/static/chunks/{11e3u3wkmfedd.js → 0~z22-y-2-50b.js} +1 -1
  234. package/web/.next/static/chunks/{0y~ts1~5mpg5h.js → 163wx0qvsyhgb.js} +1 -1
  235. package/web/.next/static/chunks/16mt3g3q98v_k.js +1 -0
  236. package/web/.next/static/chunks/173rm.h7j3_7c.js +1 -0
  237. package/web/.next/static/chunks/{0ferlvybqru33.js → 17t4j5hdn_bcj.js} +2 -2
  238. package/web/.next/server/chunks/ssr/[root-of-the-server]__0b~nfa6._.js +0 -3
  239. package/web/.next/server/chunks/ssr/[root-of-the-server]__0b~nfa6._.js.map +0 -1
  240. package/web/.next/server/chunks/ssr/_0ia4o6_._.js +0 -3
  241. package/web/.next/server/chunks/ssr/_0ia4o6_._.js.map +0 -1
  242. package/web/.next/server/chunks/ssr/_0o.xc6x._.js +0 -3
  243. package/web/.next/server/chunks/ssr/_0o.xc6x._.js.map +0 -1
  244. package/web/.next/static/chunks/00h433i5-1v_-.css +0 -1
  245. package/web/.next/static/chunks/08tp-_of5~bcc.js +0 -1
  246. package/web/.next/static/chunks/0hkfexnwbsfyg.js +0 -1
  247. package/web/.next/static/chunks/0zy_h1essdthk.js +0 -1
  248. /package/web/.next/static/{8igTmoo1g4DAuDf2Tup6h → cK5RMkxfAPELBU1fhTnIV}/_buildManifest.js +0 -0
  249. /package/web/.next/static/{8igTmoo1g4DAuDf2Tup6h → cK5RMkxfAPELBU1fhTnIV}/_clientMiddlewareManifest.js +0 -0
  250. /package/web/.next/static/{8igTmoo1g4DAuDf2Tup6h → cK5RMkxfAPELBU1fhTnIV}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96646,92568,e=>{"use strict";var t=e.i(54864);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,n],96646);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,r],92568)},72714,e=>{"use strict";var t=e.i(96871),n=e.i(79561),r=e.i(73423),a=e.i(31777),o=e.i(35364),l=e.i(8361);e.s(["ActionButton",0,function({label:e,onClick:i,loading:u,error:s,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:u,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",s&&"text-destructive hover:text-destructive",!s&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[u?(0,t.jsx)(n.LoaderCircle,{className:"size-4 animate-spin"}):s?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}])},8537,e=>{"use strict";var t=e.i(16539),n=e.i(18354),r=e.i(96976);let a=(0,r.createServerReference)("408224bdf1ea8124bbe4be08d80a2a550dc6636e9c",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("40081c3290a7137d66e58ff2a328155f18b22c9e52",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("40bd2758ed0b33815b538cad707381c9083e19cba2",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("4025c066fd5bbb9a570db74c9c6c4f7a6e475fd2cc",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),u=(0,n.createLogger)("[useDeployAction]");e.s(["useDeployAction",0,function(e){let[n,r]=(0,t.useState)(!1),[s,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(!0),x=(0,t.useRef)(p);(0,t.useEffect)(()=>{x.current=p},[p]),(0,t.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]),(0,t.useEffect)(()=>()=>{v.current&&clearInterval(v.current)},[]);let y=(0,t.useCallback)(()=>{v.current&&(u.debug("stopping polling"),clearInterval(v.current),v.current=null)},[]),b=(0,t.useCallback)(e=>{y(),u.debug(`starting polling for "${e}" every 3000ms`),v.current=setInterval(async()=>{let t;if(!w.current)return void y();try{t=await i(e)}catch(t){u.warn(`poll fetch failed for "${e}":`,t),w.current&&(m(null),h(null),y());return}w.current&&(t&&"Stopped"!==t.state?(t.state!==x.current&&u.info(`poll state changed: ${x.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(u.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),y()))},3e3)},[y]),j=(0,t.useCallback)(async()=>{if(!e)return void u.warn("deploy() called but input is null — no-op");if(n)return void u.warn("deploy() called but already loading — no-op");u.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(u.info("server action result:",t),!w.current)return void u.warn("component unmounted after deploy — discarding result");if(t.success)u.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),b(e.targetId);else{let e=t.error??"An unexpected error occurred";u.warn(`deploy failed: ${e}`),f(e)}}catch(t){if(!w.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";u.error(`deploy threw exception: ${e}`,t),f(e)}finally{w.current&&r(!1)}},[e,n,b]),C=(0,t.useCallback)(async()=>{if(e&&!s){u.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(u.info("stop result:",t),!w.current)return;t.success&&(y(),m(null),h(null))}catch(e){u.warn("stop error (non-critical):",e)}finally{w.current&&d(!1)}}},[e,s,y]);return{deploy:j,stop:C,deployLoading:n,stopLoading:s,deployError:c,status:p,url:g}}],8537)},81803,e=>{"use strict";e.i(72714),e.s([])},56719,e=>{"use strict";var t=e.i(62854);e.s(["FocusScope",0,t])},99348,17466,45811,e=>{"use strict";let t;var n=e.i(96871),r=e.i(16539),a=e.i(79561),o=e.i(84735),l=e.i(70727),i=e.i(17406),u=e.i(2828),s=e.i(2287),d=e.i(96976);let c=(0,d.createServerReference)("40572e41ce6484a9082805c8dc61579968160406b9",d.callServer,void 0,d.findSourceMapURL,"getDeploymentLogs");function f({open:e,onOpenChange:t,targetId:a}){let{logs:o,isConnected:l}=function(e){let[t,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(!1),l=(0,r.useRef)(null),i=(0,r.useCallback)(()=>{l.current&&(l.current.close(),l.current=null),o(!1)},[]);return(0,r.useEffect)(()=>{if(!e){n([]),o(!1);return}c(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return l.current=t,t.onopen=()=>{o(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{o(!1)},()=>{t.close(),l.current=null}},[e,i]),{logs:t,isConnected:a}}(e?a:null);return(0,n.jsx)(p,{open:e,onOpenChange:t,logs:o,isConnected:l})}function p({open:e,onOpenChange:t,logs:a,isConnected:o}){let i=(0,r.useRef)(null),u=(0,r.useRef)(!0),d=(0,r.useCallback)(()=>{let e=i.current;e&&(u.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,r.useEffect)(()=>{u.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[a]),(0,n.jsx)(s.Dialog,{open:e,onOpenChange:t,children:(0,n.jsxs)(s.DialogContent,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,n.jsxs)(s.DialogHeader,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,n.jsx)(s.DialogTitle,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 pe-8",children:[(0,n.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${o?"bg-green-500":"bg-zinc-500"}`}),(0,n.jsx)("span",{className:"text-xs text-zinc-400",children:o?"Connected":"Disconnected"})]})]}),(0,n.jsxs)("div",{ref:i,onScroll:d,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===a.length?(0,n.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):a.map(e=>(0,n.jsx)(m,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!o&&a.length>0&&(0,n.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function m({entry:e}){return(0,n.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,n.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}let g="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-7 items-center justify-center rounded-[3px]";e.s(["DeploymentStatusBadge",0,function({status:e,url:t,targetId:s}){let[d,c]=(0,r.useState)(!1),p=s&&(e===i.DeploymentState.Booting||e===i.DeploymentState.Ready);switch(e){case i.DeploymentState.Booting:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 pl-1",children:[(0,n.jsx)(a.LoaderCircle,{className:"size-3 animate-spin text-blue-500"}),(0,n.jsx)("span",{className:"text-muted-foreground text-[11px]",children:"Starting..."}),p?(0,n.jsx)(u.TooltipProvider,{delayDuration:300,children:(0,n.jsxs)(u.Tooltip,{children:[(0,n.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:g,onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"size-3.5"})})}),(0,n.jsx)(u.TooltipContent,{side:"bottom",className:"text-xs",children:"Server logs"})]})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});case i.DeploymentState.Ready:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex translate-y-px items-center gap-1 pl-1",children:[(0,n.jsx)("span",{className:"inline-block size-1.5 rounded-full bg-green-500"}),t?(0,n.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-[11px] text-green-600 hover:text-green-500 dark:text-green-400 dark:hover:text-green-300",onClick:e=>e.stopPropagation(),children:[t,(0,n.jsx)(o.ExternalLink,{className:"size-2.5 shrink-0"})]}):(0,n.jsx)("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Ready"}),p?(0,n.jsx)(u.TooltipProvider,{delayDuration:300,children:(0,n.jsxs)(u.Tooltip,{children:[(0,n.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:g,onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"size-3.5"})})}),(0,n.jsx)(u.TooltipContent,{side:"bottom",className:"text-xs",children:"Server logs"})]})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});default:return null}}],17466),e.s([],99348);var h=e.i(8558),v=e.i(94983);let w=r.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),x=()=>{let e=r.default.useContext(w);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function y(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function b(){return j(/^iPhone/)||j(/^iPad/)||j(/^Mac/)&&navigator.maxTouchPoints>1}function j(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let C="u">typeof window?r.useLayoutEffect:r.useEffect;function T(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let R="u">typeof document&&window.visualViewport;function D(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function E(e){for(D(e)&&(e=e.parentElement);e&&!D(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let S=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),k=0;function N(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function $(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=E(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function P(e){return e instanceof HTMLInputElement&&!S.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function M(...e){return r.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let z=new WeakMap;function O(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||z.set(e,r)}let L=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function F(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[L(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[L(t)?5:4]):null}function B(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let A=[.32,.72,0,1],I="vaul-dragging";function H(e){let t=r.default.useRef(e);return r.default.useEffect(()=>{t.current=e}),r.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function W({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.default.useState(e),[a]=n,o=r.default.useRef(a),l=H(t);return r.default.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=H(n);return[i,r.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}let q=()=>()=>{},U=null;function Y({open:e,onOpenChange:n,children:a,onDrag:o,onRelease:l,snapPoints:i,shouldScaleBackground:u=!1,setBackgroundColorOnScale:s=!0,closeThreshold:d=.25,scrollLockTimeout:c=100,dismissible:f=!0,handleOnly:p=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:g,setActiveSnapPoint:h,fixed:x,modal:j=!0,onClose:D,nested:S,noBodyStyles:M=!1,direction:B="bottom",defaultOpen:H=!1,disablePreventScroll:q=!0,snapToSequentialPoint:X=!1,preventScrollRestoration:V=!1,repositionInputs:K=!0,onAnimationEnd:J,container:_,autoFocus:G=!1}){var Q,Z;let[ee=!1,et]=W({defaultProp:H,prop:e,onChange:e=>{null==n||n(e),e||S||eP(),setTimeout(()=>{null==J||J(e)},500),e&&!j&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[en,er]=r.default.useState(!1),[ea,eo]=r.default.useState(!1),[el,ei]=r.default.useState(!1),eu=r.default.useRef(null),es=r.default.useRef(null),ed=r.default.useRef(null),ec=r.default.useRef(null),ef=r.default.useRef(null),ep=r.default.useRef(!1),em=r.default.useRef(null),eg=r.default.useRef(0),eh=r.default.useRef(!1),ev=r.default.useRef(!H),ew=r.default.useRef(0),ex=r.default.useRef(null),ey=r.default.useRef((null==(Q=ex.current)?void 0:Q.getBoundingClientRect().height)||0),eb=r.default.useRef((null==(Z=ex.current)?void 0:Z.getBoundingClientRect().width)||0),ej=r.default.useRef(0),eC=r.default.useCallback(e=>{i&&e===eS.length-1&&(es.current=new Date)},[]),{activeSnapPoint:eT,activeSnapPointIndex:eR,setActiveSnapPoint:eD,onRelease:eE,snapPointsOffset:eS,onDrag:ek,shouldFade:eN,getPercentageDragged:e$}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:a,overlayRef:o,fadeFromIndex:l,onSnapPointChange:i,direction:u="bottom",container:s,snapToSequentialPoint:d}){let[c,f]=W({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=r.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);r.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=r.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=r.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=r.default.useMemo(()=>{var e;let t=s?{width:s.getBoundingClientRect().width,height:s.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),L(u)){let a=n?r:p?e*t.height:0;return p?"bottom"===u?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===u?t.width-a:-t.width+a:a}))?e:[]},[n,p,s]),x=r.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),y=r.default.useCallback(e=>{var t;let r=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(r),O(a.current,{transition:`transform 0.5s cubic-bezier(${A.join(",")})`,transform:L(u)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&r!==w.length-1&&void 0!==l&&r!==l&&r<l?O(o.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`,opacity:"0"}):O(o.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(r,0)])},[a.current,n,w,l,o,f]);return r.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&y(w[r])}},[c,e,n,w,y]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:a}){if(void 0===l)return;let i="bottom"===u||"right"===u?(null!=x?x:0)-e:(null!=x?x:0)+e,s=h===l-1,c=0===h,f=e>0;if(s&&O(o.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`}),!d&&r>2&&!f)return void(a?t():y(w[0]));if(!d&&r>2&&f&&w&&n)return void y(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=L(u)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void y(w[n.length-1]):void(c&&e<0&&a&&t(),null===h||y(w[h+e]))}y(p)},onDrag:function({draggedDistance:e}){if(null===x)return;let t="bottom"===u||"right"===u?x-e:x+e;("bottom"===u||"right"===u)&&t<w[w.length-1]||("top"===u||"left"===u)&&t>w[w.length-1]||O(a.current,{transform:L(u)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:i,activeSnapPointProp:g,setActiveSnapPointProp:h,drawerRef:ex,fadeFromIndex:m,overlayRef:eu,onSnapPointChange:eC,direction:B,container:_,snapToSequentialPoint:X});!function(e={}){let{isDisabled:n}=e;C(()=>{if(!n){var e,r,a;let n,o,l,i,u,s,d;return 1==++k&&b()&&(l=0,i=window.pageXOffset,u=window.pageYOffset,s=T((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),d=T(N(document,"touchstart",e=>{((o=E(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),N(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),N(document,"touchend",e=>{let t=e.target;P(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),N(document,"focus",e=>{let t=e.target;P(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",R&&(R.height<window.innerHeight?requestAnimationFrame(()=>{$(t)}):R.addEventListener("resize",()=>$(t),{once:!0}))}))},!0),N(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{s(),d(),window.scrollTo(i,u)}),()=>{0==--k&&(null==t||t())}}},[n])}({isDisabled:!ee||ea||!j||el||!en||!K||!q});let{restorePositionSetting:eP}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:a,preventScrollRestoration:o,noBodyStyles:l}){let[i,u]=r.default.useState(()=>"u">typeof window?window.location.href:""),s=r.default.useRef(0),d=r.default.useCallback(()=>{if(y()&&null===U&&e&&!l){U={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-s.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&s.current>=t&&(document.body.style.top=`${-(s.current+e)}px`)}),300)}},[e]),c=r.default.useCallback(()=>{if(y()&&null!==U&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,U),window.requestAnimationFrame(()=>{o&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),U=null}},[i]);return r.default.useEffect(()=>{function e(){s.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),r.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),r.default.useEffect(()=>{!n&&a&&(e?(window.matchMedia("(display-mode: standalone)").matches||d(),t||window.setTimeout(()=>{c()},500)):c())},[e,a,i,t,n,d,c]),{restorePositionSetting:c}}({isOpen:ee,modal:j,nested:null!=S&&S,hasBeenOpened:en,preventScrollRestoration:V,noBodyStyles:M});function eM(){return(window.innerWidth-26)/window.innerWidth}function ez(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ex.current?F(ex.current,B):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===B||"left"===B)return!0;if(es.current&&l.getTime()-es.current.getTime()<500)return!1;if(null!==o&&("bottom"===B?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ef.current&&l.getTime()-ef.current.getTime()<c&&0===o||t)return ef.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ef.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function eO(e){ea&&ex.current&&(ex.current.classList.remove(I),ep.current=!1,eo(!1),ec.current=new Date),null==D||D(),e||et(!1),setTimeout(()=>{i&&eD(i[0])},500)}function eL(){if(!ex.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=F(ex.current,B);O(ex.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${A.join(",")})`}),O(eu.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`,opacity:"1"}),u&&t&&t>0&&ee&&O(e,{borderRadius:"8px",overflow:"hidden",...L(B)?{transform:`scale(${eM()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eM()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${A.join(",")})`},!0)}return r.default.useEffect(()=>{window.requestAnimationFrame(()=>{ev.current=!0})},[]),r.default.useEffect(()=>{var e;function t(){if(ex.current&&K&&(P(document.activeElement)||eh.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ex.current.getBoundingClientRect().height||0;ej.current||(ej.current=a);let o=ex.current.getBoundingClientRect().top;if(Math.abs(ew.current-r)>60&&(eh.current=!eh.current),i&&i.length>0&&eS&&eR&&(r+=eS[eR]||0),ew.current=r,a>t||eh.current){let e=ex.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),x?ex.current.style.height=`${e-Math.max(r,0)}px`:ex.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ex.current.style.height=`${ej.current}px`)}i&&i.length>0&&!eh.current?ex.current.style.bottom="0px":ex.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[eR,i,eS]),r.default.useEffect(()=>(ee&&(O(document.documentElement,{scrollBehavior:"auto"}),es.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=z.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[ee]),r.default.useEffect(()=>{j||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[j]),r.default.createElement(v.Root,{defaultOpen:H,onOpenChange:e=>{(f||e)&&(e?er(!0):eO(!0),et(e))},open:ee},r.default.createElement(w.Provider,{value:{activeSnapPoint:eT,snapPoints:i,setActiveSnapPoint:eD,drawerRef:ex,overlayRef:eu,onOpenChange:n,onPress:function(e){var t,n;!f&&!i||(!ex.current||ex.current.contains(e.target))&&(ey.current=(null==(t=ex.current)?void 0:t.getBoundingClientRect().height)||0,eb.current=(null==(n=ex.current)?void 0:n.getBoundingClientRect().width)||0,eo(!0),ed.current=new Date,b()&&window.addEventListener("touchend",()=>ep.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),eg.current=L(B)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!ea||!ex.current)return;ex.current.classList.remove(I),ep.current=!1,eo(!1),ec.current=new Date;let r=F(ex.current,B);if(!e||!ez(e.target,!1)||!r||Number.isNaN(r)||null===ed.current)return;let a=ec.current.getTime()-ed.current.getTime(),o=eg.current-(L(B)?e.pageY:e.pageX),u=Math.abs(o)/a;if(u>.05&&(ei(!0),setTimeout(()=>{ei(!1)},200)),i){eE({draggedDistance:o*("bottom"===B||"right"===B?1:-1),closeDrawer:eO,velocity:u,dismissible:f}),null==l||l(e,!0);return}if("bottom"===B||"right"===B?o>0:o<0){eL(),null==l||l(e,!0);return}if(u>.4){eO(),null==l||l(e,!1);return}let s=Math.min(null!=(t=ex.current.getBoundingClientRect().height)?t:0,window.innerHeight),c=Math.min(null!=(n=ex.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===B||"right"===B?c:s)*d){eO(),null==l||l(e,!1);return}null==l||l(e,!0),eL()},onDrag:function(e){if(ex.current&&ea){let t="bottom"===B||"right"===B?1:-1,n=(eg.current-(L(B)?e.pageY:e.pageX))*t,r=n>0,a=i&&!f&&!r;if(a&&0===eR)return;let l=Math.abs(n),s=document.querySelector("[data-vaul-drawer-wrapper]"),d=l/("bottom"===B||"top"===B?ey.current:eb.current),c=e$(l,r);if(null!==c&&(d=c),a&&d>=1||!ep.current&&!ez(e.target,r))return;if(ex.current.classList.add(I),ep.current=!0,O(ex.current,{transition:"none"}),O(eu.current,{transition:"none"}),i&&ek({draggedDistance:n}),r&&!i){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;O(ex.current,{transform:L(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let p=1-d;if((eN||m&&eR===m-1)&&(null==o||o(e,d),O(eu.current,{opacity:`${p}`,transition:"none"},!0)),s&&eu.current&&u){let e=Math.min(eM()+d*(1-eM()),1),t=8-8*d,n=Math.max(0,14-14*d);O(s,{borderRadius:`${t}px`,transform:L(B)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){let e=l*t;O(ex.current,{transform:L(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:f,shouldAnimate:ev,handleOnly:p,isOpen:ee,isDragging:ea,shouldFade:eN,closeDrawer:eO,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;O(ex.current,{transform:L(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;em.current&&window.clearTimeout(em.current),O(ex.current,{transition:`transform 0.5s cubic-bezier(${A.join(",")})`,transform:L(B)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ex.current&&(em.current=setTimeout(()=>{let e=F(ex.current,B);O(ex.current,{transition:"none",transform:L(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=L(B)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&O(ex.current,{transition:`transform 0.5s cubic-bezier(${A.join(",")})`,transform:L(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eh,modal:j,snapPointsOffset:eS,activeSnapPointIndex:eR,direction:B,shouldScaleBackground:u,setBackgroundColorOnScale:s,noBodyStyles:M,container:_,autoFocus:G}},a))}let X=r.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:a,onRelease:o,shouldFade:l,isOpen:i,modal:u,shouldAnimate:s}=x(),d=M(t,n),c=a&&a.length>0;if(!u)return null;let f=r.default.useCallback(e=>o(e),[o]);return r.default.createElement(v.Overlay,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":i&&c?"true":"false","data-vaul-snap-points-overlay":i&&l?"true":"false","data-vaul-animate":(null==s?void 0:s.current)?"true":"false",...e})});X.displayName="Drawer.Overlay";let V=r.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...a},o){let{drawerRef:l,onPress:i,onRelease:u,onDrag:s,keyboardIsOpen:d,snapPointsOffset:c,activeSnapPointIndex:f,modal:p,isOpen:m,direction:g,snapPoints:h,container:w,handleOnly:y,shouldAnimate:b,autoFocus:j}=x(),[C,T]=r.default.useState(!1),R=M(o,l),D=r.default.useRef(null),E=r.default.useRef(null),S=r.default.useRef(!1),k=h&&h.length>0;function N(e){D.current=null,S.current=!1,u(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:a,noBodyStyles:o}=x(),l=r.default.useRef(null),i=(0,r.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}r.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(a&&!o?B(document.body,{background:"black"}):q,B(t,{transformOrigin:L(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${A.join(",")})`}));let n=B(t,{borderRadius:"8px",overflow:"hidden",...L(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},500)}}},[t,n,i])}(),r.default.useEffect(()=>{k&&window.requestAnimationFrame(()=>{T(!0)})},[]),r.default.createElement(v.Content,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":m&&k?"true":"false","data-vaul-custom-container":w?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...a,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[null!=f?f:0]}px`,...t}:t,onPointerDown:e=>{y||(null==a.onPointerDown||a.onPointerDown.call(a,e),D.current={x:e.pageX,y:e.pageY},i(e))},onOpenAutoFocus:e=>{null==n||n(e),j||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!p||t.defaultPrevented)?t.preventDefault():d.current&&(d.current=!1)},onFocusOutside:e=>{if(!p)return void e.preventDefault()},onPointerMove:e=>{if(E.current=e,y||(null==a.onPointerMove||a.onPointerMove.call(a,e),!D.current))return;let t=e.pageY-D.current.y,n=e.pageX-D.current.x,r="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(S.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return S.current=!0,!0})({x:n,y:t},g,r)?s(e):(Math.abs(n)>r||Math.abs(t)>r)&&(D.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),D.current=null,S.current=!1,u(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),N(E.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),E.current&&N(E.current)}})});V.displayName="Drawer.Content";let K=r.default.forwardRef(function({preventCycle:e=!1,children:t,...n},a){let{closeDrawer:o,isDragging:l,snapPoints:i,activeSnapPoint:u,setActiveSnapPoint:s,dismissible:d,handleOnly:c,isOpen:f,onPress:p,onDrag:m}=x(),g=r.default.useRef(null),h=r.default.useRef(!1);function v(){g.current&&window.clearTimeout(g.current),h.current=!1}return r.default.createElement("div",{onClick:function(){h.current?v():window.setTimeout(()=>{!function(){if(l||e||h.current)return v();if(v(),!i||0===i.length){d||o();return}if(u===i[i.length-1]&&d)return o();let t=i.findIndex(e=>e===u);-1===t||s(i[t+1])}()},120)},onPointerCancel:v,onPointerDown:e=>{c&&p(e),g.current=window.setTimeout(()=>{h.current=!0},250)},onPointerMove:e=>{c&&m(e)},ref:a,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},r.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});K.displayName="Drawer.Handle";let J={Root:Y,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...a}){let{onNestedDrag:o,onNestedOpenChange:l,onNestedRelease:i}=x();if(!o)throw Error("Drawer.NestedRoot must be placed in another drawer");return r.default.createElement(Y,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{o(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:i,...a})},Content:V,Overlay:X,Trigger:v.Trigger,Portal:function(e){let t=x(),{container:n=t.container,...a}=e;return r.default.createElement(v.Portal,{container:n,...a})},Handle:K,Close:v.Close,Title:v.Title,Description:v.Description};var _=e.i(31777);function G({...e}){return(0,n.jsx)(J.Portal,{"data-slot":"drawer-portal",...e})}e.s(["Drawer",0,function({...e}){return(0,n.jsx)(J.Root,{"data-slot":"drawer",...e})},"DrawerContent",0,function({className:e,children:t,direction:r="bottom",showCloseButton:a=!0,...o}){return(0,n.jsx)(G,{children:(0,n.jsxs)(J.Content,{"data-slot":"drawer-content",className:(0,_.cn)("editorial-shadow fixed z-50 flex flex-col","bg-white/80 backdrop-blur-xl dark:bg-[#1e293bd9]","bottom"===r&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===r&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===r&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===r&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"calc(100% + 8px)",userSelect:"text",...o.style??{}},...o,children:[t,a?(0,n.jsxs)(J.Close,{className:"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(h.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})},"DrawerDescription",0,function({className:e,...t}){return(0,n.jsx)(J.Description,{"data-slot":"drawer-description",className:(0,_.cn)("text-muted-foreground text-sm",e),...t})},"DrawerFooter",0,function({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,_.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})},"DrawerHeader",0,function({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,_.cn)("flex flex-col gap-1.5 p-4",e),...t})},"DrawerOverlay",0,function({className:e,...t}){return(0,n.jsx)(J.Overlay,{"data-slot":"drawer-overlay",className:(0,_.cn)("fixed inset-0 z-50 bg-black/40 backdrop-blur-[2px] dark:bg-black/50",e),...t})},"DrawerTitle",0,function({className:e,...t}){return(0,n.jsx)(J.Title,{"data-slot":"drawer-title",className:(0,_.cn)("text-foreground font-semibold",e),...t})}],45811)},11495,e=>{"use strict";var t=e.i(96871),n=e.i(16539),r=e.i(8558),a=e.i(96646),o=e.i(92568),l=e.i(94237),i=e.i(56719),u=e.i(31777);e.i(81803);var s=e.i(72714);e.i(99348);var d=e.i(17466),c=e.i(45811),f=e.i(25235),p=e.i(2828);e.i(26759);var m=e.i(97164),g=e.i(8537),h=e.i(75921);let v=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-2xl",lg:"w-[772px]"}},defaultVariants:{size:"sm"}});function w({deployTarget:e}){let n=(0,g.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pt-3 pb-3",children:[(0,t.jsx)(p.TooltipProvider,{children:(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(s.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(p.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(d.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",0,function({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:s="Drawer",size:d,header:p,children:g,footer:x,className:y,"data-testid":b,deployTarget:j}){let{i18n:C}=(0,m.useTranslation)(),T=(0,h.useFeatureFlags)(),R=(0,n.useRef)(null),D=(0,n.useRef)(null),E="rtl"===C.dir()?"left":"right",S=(0,n.useCallback)(()=>{D.current=document.activeElement},[]),k=(0,n.useCallback)(e=>{D.current&&"function"==typeof D.current.focus&&(e.preventDefault(),D.current.focus(),D.current=null)},[]);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{"Escape"===e.key&&(e.stopPropagation(),a())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,o,a]),(0,n.useEffect)(()=>{if(!e||o)return;let t=l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]',n=e=>!!e&&!!(R.current?.contains(e)||e.closest(t)),r=null,i=e=>{r=e.target},u=e=>{let t=r;r=null;let o=e.target;!document.body.contains(o)||n(o)||n(t)||a()};return document.addEventListener("pointerdown",i,!0),document.addEventListener("click",u),()=>{document.removeEventListener("pointerdown",i,!0),document.removeEventListener("click",u)}},[e,o,a,l]),(0,t.jsxs)(c.Drawer,{direction:E,modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(c.DrawerOverlay,{}):null,(0,t.jsxs)(c.DrawerContent,{ref:R,direction:E,showCloseButton:!1,className:(0,u.cn)(v({size:d}),"bg-white/80 backdrop-blur-xl dark:bg-[#1e293bd9]",y),"data-testid":b,onInteractOutside:o?void 0:e=>e.preventDefault(),...!o?{"aria-modal":!0}:{},children:[(0,t.jsx)(c.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(i.FocusScope.Root,{trapped:!o,loop:!o,asChild:!0,onMountAutoFocus:S,onUnmountAutoFocus:k,children:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute end-3 top-2 z-50 rounded-sm p-1 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":b?`${b}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),p?(0,t.jsx)(c.DrawerHeader,{className:"shrink-0",children:p}):null,p?(0,t.jsx)(f.Separator,{}):null,T.envDeploy&&j?(0,t.jsx)(w,{deployTarget:j}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:g}),x?(0,t.jsx)(c.DrawerFooter,{className:"shrink-0",children:x}):null]})})]})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96646,92568,e=>{"use strict";var t=e.i(54864);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,n],96646);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,r],92568)},72714,e=>{"use strict";var t=e.i(96871),n=e.i(79561),r=e.i(73423),a=e.i(31777),o=e.i(35364),l=e.i(8361);e.s(["ActionButton",0,function({label:e,onClick:i,loading:u,error:s,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:u,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",s&&"text-destructive hover:text-destructive",!s&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[u?(0,t.jsx)(n.LoaderCircle,{className:"size-4 animate-spin"}):s?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}])},8537,e=>{"use strict";var t=e.i(16539),n=e.i(18354),r=e.i(96976);let a=(0,r.createServerReference)("40a376af8d47a8a4e826b4969b3695aeb9de6fe314",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("400ee1bc333c74f42cd919ff1ae6ca4b35321651a6",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("4072b6d1445eeddaa24f0f1c2c4100cbad7cdf6caf",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("401ecbc98e981f2fdd84795db0066ca47587e7687e",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),u=(0,n.createLogger)("[useDeployAction]");e.s(["useDeployAction",0,function(e){let[n,r]=(0,t.useState)(!1),[s,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(!0),x=(0,t.useRef)(p);(0,t.useEffect)(()=>{x.current=p},[p]),(0,t.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]),(0,t.useEffect)(()=>()=>{v.current&&clearInterval(v.current)},[]);let y=(0,t.useCallback)(()=>{v.current&&(u.debug("stopping polling"),clearInterval(v.current),v.current=null)},[]),b=(0,t.useCallback)(e=>{y(),u.debug(`starting polling for "${e}" every 3000ms`),v.current=setInterval(async()=>{let t;if(!w.current)return void y();try{t=await i(e)}catch(t){u.warn(`poll fetch failed for "${e}":`,t),w.current&&(m(null),h(null),y());return}w.current&&(t&&"Stopped"!==t.state?(t.state!==x.current&&u.info(`poll state changed: ${x.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(u.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),y()))},3e3)},[y]),j=(0,t.useCallback)(async()=>{if(!e)return void u.warn("deploy() called but input is null — no-op");if(n)return void u.warn("deploy() called but already loading — no-op");u.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(u.info("server action result:",t),!w.current)return void u.warn("component unmounted after deploy — discarding result");if(t.success)u.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),b(e.targetId);else{let e=t.error??"An unexpected error occurred";u.warn(`deploy failed: ${e}`),f(e)}}catch(t){if(!w.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";u.error(`deploy threw exception: ${e}`,t),f(e)}finally{w.current&&r(!1)}},[e,n,b]),C=(0,t.useCallback)(async()=>{if(e&&!s){u.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(u.info("stop result:",t),!w.current)return;t.success&&(y(),m(null),h(null))}catch(e){u.warn("stop error (non-critical):",e)}finally{w.current&&d(!1)}}},[e,s,y]);return{deploy:j,stop:C,deployLoading:n,stopLoading:s,deployError:c,status:p,url:g}}],8537)},81803,e=>{"use strict";e.i(72714),e.s([])},56719,e=>{"use strict";var t=e.i(62854);e.s(["FocusScope",0,t])},99348,17466,45811,e=>{"use strict";let t;var n=e.i(96871),r=e.i(16539),a=e.i(79561),o=e.i(84735),l=e.i(70727),i=e.i(17406),u=e.i(2828),s=e.i(2287),d=e.i(96976);let c=(0,d.createServerReference)("401946df2a1cbb0b50585dc203a762da49acccf655",d.callServer,void 0,d.findSourceMapURL,"getDeploymentLogs");function f({open:e,onOpenChange:t,targetId:a}){let{logs:o,isConnected:l}=function(e){let[t,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(!1),l=(0,r.useRef)(null),i=(0,r.useCallback)(()=>{l.current&&(l.current.close(),l.current=null),o(!1)},[]);return(0,r.useEffect)(()=>{if(!e){n([]),o(!1);return}c(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return l.current=t,t.onopen=()=>{o(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{o(!1)},()=>{t.close(),l.current=null}},[e,i]),{logs:t,isConnected:a}}(e?a:null);return(0,n.jsx)(p,{open:e,onOpenChange:t,logs:o,isConnected:l})}function p({open:e,onOpenChange:t,logs:a,isConnected:o}){let i=(0,r.useRef)(null),u=(0,r.useRef)(!0),d=(0,r.useCallback)(()=>{let e=i.current;e&&(u.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,r.useEffect)(()=>{u.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[a]),(0,n.jsx)(s.Dialog,{open:e,onOpenChange:t,children:(0,n.jsxs)(s.DialogContent,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,n.jsxs)(s.DialogHeader,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,n.jsx)(s.DialogTitle,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 pe-8",children:[(0,n.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${o?"bg-green-500":"bg-zinc-500"}`}),(0,n.jsx)("span",{className:"text-xs text-zinc-400",children:o?"Connected":"Disconnected"})]})]}),(0,n.jsxs)("div",{ref:i,onScroll:d,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===a.length?(0,n.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):a.map(e=>(0,n.jsx)(m,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!o&&a.length>0&&(0,n.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function m({entry:e}){return(0,n.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,n.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}let g="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-7 items-center justify-center rounded-[3px]";e.s(["DeploymentStatusBadge",0,function({status:e,url:t,targetId:s}){let[d,c]=(0,r.useState)(!1),p=s&&(e===i.DeploymentState.Booting||e===i.DeploymentState.Ready);switch(e){case i.DeploymentState.Booting:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 pl-1",children:[(0,n.jsx)(a.LoaderCircle,{className:"size-3 animate-spin text-blue-500"}),(0,n.jsx)("span",{className:"text-muted-foreground text-[11px]",children:"Starting..."}),p?(0,n.jsx)(u.TooltipProvider,{delayDuration:300,children:(0,n.jsxs)(u.Tooltip,{children:[(0,n.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:g,onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"size-3.5"})})}),(0,n.jsx)(u.TooltipContent,{side:"bottom",className:"text-xs",children:"Server logs"})]})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});case i.DeploymentState.Ready:return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex translate-y-px items-center gap-1 pl-1",children:[(0,n.jsx)("span",{className:"inline-block size-1.5 rounded-full bg-green-500"}),t?(0,n.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-[11px] text-green-600 hover:text-green-500 dark:text-green-400 dark:hover:text-green-300",onClick:e=>e.stopPropagation(),children:[t,(0,n.jsx)(o.ExternalLink,{className:"size-2.5 shrink-0"})]}):(0,n.jsx)("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Ready"}),p?(0,n.jsx)(u.TooltipProvider,{delayDuration:300,children:(0,n.jsxs)(u.Tooltip,{children:[(0,n.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,n.jsx)("button",{type:"button","aria-label":"View server logs",className:g,onClick:e=>{e.stopPropagation(),c(!0)},children:(0,n.jsx)(l.Terminal,{className:"size-3.5"})})}),(0,n.jsx)(u.TooltipContent,{side:"bottom",className:"text-xs",children:"Server logs"})]})}):null]}),p?(0,n.jsx)(f,{open:d,onOpenChange:c,targetId:s}):null]});default:return null}}],17466),e.s([],99348);var h=e.i(8558),v=e.i(94983);let w=r.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),x=()=>{let e=r.default.useContext(w);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function y(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function b(){return j(/^iPhone/)||j(/^iPad/)||j(/^Mac/)&&navigator.maxTouchPoints>1}function j(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let C="u">typeof window?r.useLayoutEffect:r.useEffect;function T(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let R="u">typeof document&&window.visualViewport;function D(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function E(e){for(D(e)&&(e=e.parentElement);e&&!D(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let S=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),k=0;function N(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function $(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=E(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function P(e){return e instanceof HTMLInputElement&&!S.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function M(...e){return r.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let z=new WeakMap;function O(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||z.set(e,r)}let L=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function F(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[L(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[L(t)?5:4]):null}function B(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let A=[.32,.72,0,1],I="vaul-dragging";function H(e){let t=r.default.useRef(e);return r.default.useEffect(()=>{t.current=e}),r.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function W({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.default.useState(e),[a]=n,o=r.default.useRef(a),l=H(t);return r.default.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=H(n);return[i,r.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}let q=()=>()=>{},U=null;function Y({open:e,onOpenChange:n,children:a,onDrag:o,onRelease:l,snapPoints:i,shouldScaleBackground:u=!1,setBackgroundColorOnScale:s=!0,closeThreshold:d=.25,scrollLockTimeout:c=100,dismissible:f=!0,handleOnly:p=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:g,setActiveSnapPoint:h,fixed:x,modal:j=!0,onClose:D,nested:S,noBodyStyles:M=!1,direction:B="bottom",defaultOpen:H=!1,disablePreventScroll:q=!0,snapToSequentialPoint:X=!1,preventScrollRestoration:V=!1,repositionInputs:K=!0,onAnimationEnd:J,container:_,autoFocus:G=!1}){var Q,Z;let[ee=!1,et]=W({defaultProp:H,prop:e,onChange:e=>{null==n||n(e),e||S||eP(),setTimeout(()=>{null==J||J(e)},500),e&&!j&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[en,er]=r.default.useState(!1),[ea,eo]=r.default.useState(!1),[el,ei]=r.default.useState(!1),eu=r.default.useRef(null),es=r.default.useRef(null),ed=r.default.useRef(null),ec=r.default.useRef(null),ef=r.default.useRef(null),ep=r.default.useRef(!1),em=r.default.useRef(null),eg=r.default.useRef(0),eh=r.default.useRef(!1),ev=r.default.useRef(!H),ew=r.default.useRef(0),ex=r.default.useRef(null),ey=r.default.useRef((null==(Q=ex.current)?void 0:Q.getBoundingClientRect().height)||0),eb=r.default.useRef((null==(Z=ex.current)?void 0:Z.getBoundingClientRect().width)||0),ej=r.default.useRef(0),eC=r.default.useCallback(e=>{i&&e===eS.length-1&&(es.current=new Date)},[]),{activeSnapPoint:eT,activeSnapPointIndex:eR,setActiveSnapPoint:eD,onRelease:eE,snapPointsOffset:eS,onDrag:ek,shouldFade:eN,getPercentageDragged:e$}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:a,overlayRef:o,fadeFromIndex:l,onSnapPointChange:i,direction:u="bottom",container:s,snapToSequentialPoint:d}){let[c,f]=W({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=r.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);r.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=r.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=r.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=r.default.useMemo(()=>{var e;let t=s?{width:s.getBoundingClientRect().width,height:s.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),L(u)){let a=n?r:p?e*t.height:0;return p?"bottom"===u?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===u?t.width-a:-t.width+a:a}))?e:[]},[n,p,s]),x=r.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),y=r.default.useCallback(e=>{var t;let r=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(r),O(a.current,{transition:`transform 0.5s cubic-bezier(${A.join(",")})`,transform:L(u)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&r!==w.length-1&&void 0!==l&&r!==l&&r<l?O(o.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`,opacity:"0"}):O(o.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(r,0)])},[a.current,n,w,l,o,f]);return r.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&y(w[r])}},[c,e,n,w,y]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:a}){if(void 0===l)return;let i="bottom"===u||"right"===u?(null!=x?x:0)-e:(null!=x?x:0)+e,s=h===l-1,c=0===h,f=e>0;if(s&&O(o.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`}),!d&&r>2&&!f)return void(a?t():y(w[0]));if(!d&&r>2&&f&&w&&n)return void y(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=L(u)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void y(w[n.length-1]):void(c&&e<0&&a&&t(),null===h||y(w[h+e]))}y(p)},onDrag:function({draggedDistance:e}){if(null===x)return;let t="bottom"===u||"right"===u?x-e:x+e;("bottom"===u||"right"===u)&&t<w[w.length-1]||("top"===u||"left"===u)&&t>w[w.length-1]||O(a.current,{transform:L(u)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:i,activeSnapPointProp:g,setActiveSnapPointProp:h,drawerRef:ex,fadeFromIndex:m,overlayRef:eu,onSnapPointChange:eC,direction:B,container:_,snapToSequentialPoint:X});!function(e={}){let{isDisabled:n}=e;C(()=>{if(!n){var e,r,a;let n,o,l,i,u,s,d;return 1==++k&&b()&&(l=0,i=window.pageXOffset,u=window.pageYOffset,s=T((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),d=T(N(document,"touchstart",e=>{((o=E(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),N(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),N(document,"touchend",e=>{let t=e.target;P(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),N(document,"focus",e=>{let t=e.target;P(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",R&&(R.height<window.innerHeight?requestAnimationFrame(()=>{$(t)}):R.addEventListener("resize",()=>$(t),{once:!0}))}))},!0),N(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{s(),d(),window.scrollTo(i,u)}),()=>{0==--k&&(null==t||t())}}},[n])}({isDisabled:!ee||ea||!j||el||!en||!K||!q});let{restorePositionSetting:eP}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:a,preventScrollRestoration:o,noBodyStyles:l}){let[i,u]=r.default.useState(()=>"u">typeof window?window.location.href:""),s=r.default.useRef(0),d=r.default.useCallback(()=>{if(y()&&null===U&&e&&!l){U={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-s.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&s.current>=t&&(document.body.style.top=`${-(s.current+e)}px`)}),300)}},[e]),c=r.default.useCallback(()=>{if(y()&&null!==U&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,U),window.requestAnimationFrame(()=>{o&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),U=null}},[i]);return r.default.useEffect(()=>{function e(){s.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),r.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),r.default.useEffect(()=>{!n&&a&&(e?(window.matchMedia("(display-mode: standalone)").matches||d(),t||window.setTimeout(()=>{c()},500)):c())},[e,a,i,t,n,d,c]),{restorePositionSetting:c}}({isOpen:ee,modal:j,nested:null!=S&&S,hasBeenOpened:en,preventScrollRestoration:V,noBodyStyles:M});function eM(){return(window.innerWidth-26)/window.innerWidth}function ez(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ex.current?F(ex.current,B):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===B||"left"===B)return!0;if(es.current&&l.getTime()-es.current.getTime()<500)return!1;if(null!==o&&("bottom"===B?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ef.current&&l.getTime()-ef.current.getTime()<c&&0===o||t)return ef.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ef.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function eO(e){ea&&ex.current&&(ex.current.classList.remove(I),ep.current=!1,eo(!1),ec.current=new Date),null==D||D(),e||et(!1),setTimeout(()=>{i&&eD(i[0])},500)}function eL(){if(!ex.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=F(ex.current,B);O(ex.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${A.join(",")})`}),O(eu.current,{transition:`opacity 0.5s cubic-bezier(${A.join(",")})`,opacity:"1"}),u&&t&&t>0&&ee&&O(e,{borderRadius:"8px",overflow:"hidden",...L(B)?{transform:`scale(${eM()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eM()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${A.join(",")})`},!0)}return r.default.useEffect(()=>{window.requestAnimationFrame(()=>{ev.current=!0})},[]),r.default.useEffect(()=>{var e;function t(){if(ex.current&&K&&(P(document.activeElement)||eh.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ex.current.getBoundingClientRect().height||0;ej.current||(ej.current=a);let o=ex.current.getBoundingClientRect().top;if(Math.abs(ew.current-r)>60&&(eh.current=!eh.current),i&&i.length>0&&eS&&eR&&(r+=eS[eR]||0),ew.current=r,a>t||eh.current){let e=ex.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),x?ex.current.style.height=`${e-Math.max(r,0)}px`:ex.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ex.current.style.height=`${ej.current}px`)}i&&i.length>0&&!eh.current?ex.current.style.bottom="0px":ex.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[eR,i,eS]),r.default.useEffect(()=>(ee&&(O(document.documentElement,{scrollBehavior:"auto"}),es.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=z.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[ee]),r.default.useEffect(()=>{j||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[j]),r.default.createElement(v.Root,{defaultOpen:H,onOpenChange:e=>{(f||e)&&(e?er(!0):eO(!0),et(e))},open:ee},r.default.createElement(w.Provider,{value:{activeSnapPoint:eT,snapPoints:i,setActiveSnapPoint:eD,drawerRef:ex,overlayRef:eu,onOpenChange:n,onPress:function(e){var t,n;!f&&!i||(!ex.current||ex.current.contains(e.target))&&(ey.current=(null==(t=ex.current)?void 0:t.getBoundingClientRect().height)||0,eb.current=(null==(n=ex.current)?void 0:n.getBoundingClientRect().width)||0,eo(!0),ed.current=new Date,b()&&window.addEventListener("touchend",()=>ep.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),eg.current=L(B)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!ea||!ex.current)return;ex.current.classList.remove(I),ep.current=!1,eo(!1),ec.current=new Date;let r=F(ex.current,B);if(!e||!ez(e.target,!1)||!r||Number.isNaN(r)||null===ed.current)return;let a=ec.current.getTime()-ed.current.getTime(),o=eg.current-(L(B)?e.pageY:e.pageX),u=Math.abs(o)/a;if(u>.05&&(ei(!0),setTimeout(()=>{ei(!1)},200)),i){eE({draggedDistance:o*("bottom"===B||"right"===B?1:-1),closeDrawer:eO,velocity:u,dismissible:f}),null==l||l(e,!0);return}if("bottom"===B||"right"===B?o>0:o<0){eL(),null==l||l(e,!0);return}if(u>.4){eO(),null==l||l(e,!1);return}let s=Math.min(null!=(t=ex.current.getBoundingClientRect().height)?t:0,window.innerHeight),c=Math.min(null!=(n=ex.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===B||"right"===B?c:s)*d){eO(),null==l||l(e,!1);return}null==l||l(e,!0),eL()},onDrag:function(e){if(ex.current&&ea){let t="bottom"===B||"right"===B?1:-1,n=(eg.current-(L(B)?e.pageY:e.pageX))*t,r=n>0,a=i&&!f&&!r;if(a&&0===eR)return;let l=Math.abs(n),s=document.querySelector("[data-vaul-drawer-wrapper]"),d=l/("bottom"===B||"top"===B?ey.current:eb.current),c=e$(l,r);if(null!==c&&(d=c),a&&d>=1||!ep.current&&!ez(e.target,r))return;if(ex.current.classList.add(I),ep.current=!0,O(ex.current,{transition:"none"}),O(eu.current,{transition:"none"}),i&&ek({draggedDistance:n}),r&&!i){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;O(ex.current,{transform:L(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let p=1-d;if((eN||m&&eR===m-1)&&(null==o||o(e,d),O(eu.current,{opacity:`${p}`,transition:"none"},!0)),s&&eu.current&&u){let e=Math.min(eM()+d*(1-eM()),1),t=8-8*d,n=Math.max(0,14-14*d);O(s,{borderRadius:`${t}px`,transform:L(B)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){let e=l*t;O(ex.current,{transform:L(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:f,shouldAnimate:ev,handleOnly:p,isOpen:ee,isDragging:ea,shouldFade:eN,closeDrawer:eO,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;O(ex.current,{transform:L(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;em.current&&window.clearTimeout(em.current),O(ex.current,{transition:`transform 0.5s cubic-bezier(${A.join(",")})`,transform:L(B)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ex.current&&(em.current=setTimeout(()=>{let e=F(ex.current,B);O(ex.current,{transition:"none",transform:L(B)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=L(B)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&O(ex.current,{transition:`transform 0.5s cubic-bezier(${A.join(",")})`,transform:L(B)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eh,modal:j,snapPointsOffset:eS,activeSnapPointIndex:eR,direction:B,shouldScaleBackground:u,setBackgroundColorOnScale:s,noBodyStyles:M,container:_,autoFocus:G}},a))}let X=r.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:a,onRelease:o,shouldFade:l,isOpen:i,modal:u,shouldAnimate:s}=x(),d=M(t,n),c=a&&a.length>0;if(!u)return null;let f=r.default.useCallback(e=>o(e),[o]);return r.default.createElement(v.Overlay,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":i&&c?"true":"false","data-vaul-snap-points-overlay":i&&l?"true":"false","data-vaul-animate":(null==s?void 0:s.current)?"true":"false",...e})});X.displayName="Drawer.Overlay";let V=r.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...a},o){let{drawerRef:l,onPress:i,onRelease:u,onDrag:s,keyboardIsOpen:d,snapPointsOffset:c,activeSnapPointIndex:f,modal:p,isOpen:m,direction:g,snapPoints:h,container:w,handleOnly:y,shouldAnimate:b,autoFocus:j}=x(),[C,T]=r.default.useState(!1),R=M(o,l),D=r.default.useRef(null),E=r.default.useRef(null),S=r.default.useRef(!1),k=h&&h.length>0;function N(e){D.current=null,S.current=!1,u(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:a,noBodyStyles:o}=x(),l=r.default.useRef(null),i=(0,r.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}r.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(a&&!o?B(document.body,{background:"black"}):q,B(t,{transformOrigin:L(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${A.join(",")})`}));let n=B(t,{borderRadius:"8px",overflow:"hidden",...L(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},500)}}},[t,n,i])}(),r.default.useEffect(()=>{k&&window.requestAnimationFrame(()=>{T(!0)})},[]),r.default.createElement(v.Content,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":m&&k?"true":"false","data-vaul-custom-container":w?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...a,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[null!=f?f:0]}px`,...t}:t,onPointerDown:e=>{y||(null==a.onPointerDown||a.onPointerDown.call(a,e),D.current={x:e.pageX,y:e.pageY},i(e))},onOpenAutoFocus:e=>{null==n||n(e),j||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!p||t.defaultPrevented)?t.preventDefault():d.current&&(d.current=!1)},onFocusOutside:e=>{if(!p)return void e.preventDefault()},onPointerMove:e=>{if(E.current=e,y||(null==a.onPointerMove||a.onPointerMove.call(a,e),!D.current))return;let t=e.pageY-D.current.y,n=e.pageX-D.current.x,r="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(S.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return S.current=!0,!0})({x:n,y:t},g,r)?s(e):(Math.abs(n)>r||Math.abs(t)>r)&&(D.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),D.current=null,S.current=!1,u(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),N(E.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),E.current&&N(E.current)}})});V.displayName="Drawer.Content";let K=r.default.forwardRef(function({preventCycle:e=!1,children:t,...n},a){let{closeDrawer:o,isDragging:l,snapPoints:i,activeSnapPoint:u,setActiveSnapPoint:s,dismissible:d,handleOnly:c,isOpen:f,onPress:p,onDrag:m}=x(),g=r.default.useRef(null),h=r.default.useRef(!1);function v(){g.current&&window.clearTimeout(g.current),h.current=!1}return r.default.createElement("div",{onClick:function(){h.current?v():window.setTimeout(()=>{!function(){if(l||e||h.current)return v();if(v(),!i||0===i.length){d||o();return}if(u===i[i.length-1]&&d)return o();let t=i.findIndex(e=>e===u);-1===t||s(i[t+1])}()},120)},onPointerCancel:v,onPointerDown:e=>{c&&p(e),g.current=window.setTimeout(()=>{h.current=!0},250)},onPointerMove:e=>{c&&m(e)},ref:a,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},r.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});K.displayName="Drawer.Handle";let J={Root:Y,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...a}){let{onNestedDrag:o,onNestedOpenChange:l,onNestedRelease:i}=x();if(!o)throw Error("Drawer.NestedRoot must be placed in another drawer");return r.default.createElement(Y,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{o(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:i,...a})},Content:V,Overlay:X,Trigger:v.Trigger,Portal:function(e){let t=x(),{container:n=t.container,...a}=e;return r.default.createElement(v.Portal,{container:n,...a})},Handle:K,Close:v.Close,Title:v.Title,Description:v.Description};var _=e.i(31777);function G({...e}){return(0,n.jsx)(J.Portal,{"data-slot":"drawer-portal",...e})}e.s(["Drawer",0,function({...e}){return(0,n.jsx)(J.Root,{"data-slot":"drawer",...e})},"DrawerContent",0,function({className:e,children:t,direction:r="bottom",showCloseButton:a=!0,...o}){return(0,n.jsx)(G,{children:(0,n.jsxs)(J.Content,{"data-slot":"drawer-content",className:(0,_.cn)("editorial-shadow fixed z-50 flex flex-col","bg-white/80 backdrop-blur-xl dark:bg-[#1e293bd9]","bottom"===r&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===r&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===r&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===r&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"calc(100% + 8px)",userSelect:"text",...o.style??{}},...o,children:[t,a?(0,n.jsxs)(J.Close,{className:"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(h.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})},"DrawerDescription",0,function({className:e,...t}){return(0,n.jsx)(J.Description,{"data-slot":"drawer-description",className:(0,_.cn)("text-muted-foreground text-sm",e),...t})},"DrawerFooter",0,function({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,_.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})},"DrawerHeader",0,function({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,_.cn)("flex flex-col gap-1.5 p-4",e),...t})},"DrawerOverlay",0,function({className:e,...t}){return(0,n.jsx)(J.Overlay,{"data-slot":"drawer-overlay",className:(0,_.cn)("fixed inset-0 z-50 bg-black/40 backdrop-blur-[2px] dark:bg-black/50",e),...t})},"DrawerTitle",0,function({className:e,...t}){return(0,n.jsx)(J.Title,{"data-slot":"drawer-title",className:(0,_.cn)("text-foreground font-semibold",e),...t})}],45811)},11495,e=>{"use strict";var t=e.i(96871),n=e.i(16539),r=e.i(8558),a=e.i(96646),o=e.i(92568),l=e.i(94237),i=e.i(56719),u=e.i(31777);e.i(81803);var s=e.i(72714);e.i(99348);var d=e.i(17466),c=e.i(45811),f=e.i(25235),p=e.i(2828);e.i(26759);var m=e.i(97164),g=e.i(8537),h=e.i(75921);let v=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-2xl",lg:"w-[772px]"}},defaultVariants:{size:"sm"}});function w({deployTarget:e}){let n=(0,g.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pt-3 pb-3",children:[(0,t.jsx)(p.TooltipProvider,{children:(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(s.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(p.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(d.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",0,function({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:s="Drawer",size:d,header:p,children:g,footer:x,className:y,"data-testid":b,deployTarget:j}){let{i18n:C}=(0,m.useTranslation)(),T=(0,h.useFeatureFlags)(),R=(0,n.useRef)(null),D=(0,n.useRef)(null),E="rtl"===C.dir()?"left":"right",S=(0,n.useCallback)(()=>{D.current=document.activeElement},[]),k=(0,n.useCallback)(e=>{D.current&&"function"==typeof D.current.focus&&(e.preventDefault(),D.current.focus(),D.current=null)},[]);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{"Escape"===e.key&&(e.stopPropagation(),a())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,o,a]),(0,n.useEffect)(()=>{if(!e||o)return;let t=l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]',n=e=>!!e&&!!(R.current?.contains(e)||e.closest(t)),r=null,i=e=>{r=e.target},u=e=>{let t=r;r=null;let o=e.target;!document.body.contains(o)||n(o)||n(t)||a()};return document.addEventListener("pointerdown",i,!0),document.addEventListener("click",u),()=>{document.removeEventListener("pointerdown",i,!0),document.removeEventListener("click",u)}},[e,o,a,l]),(0,t.jsxs)(c.Drawer,{direction:E,modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(c.DrawerOverlay,{}):null,(0,t.jsxs)(c.DrawerContent,{ref:R,direction:E,showCloseButton:!1,className:(0,u.cn)(v({size:d}),"bg-white/80 backdrop-blur-xl dark:bg-[#1e293bd9]",y),"data-testid":b,onInteractOutside:o?void 0:e=>e.preventDefault(),...!o?{"aria-modal":!0}:{},children:[(0,t.jsx)(c.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(i.FocusScope.Root,{trapped:!o,loop:!o,asChild:!0,onMountAutoFocus:S,onUnmountAutoFocus:k,children:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute end-3 top-2 z-50 rounded-sm p-1 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":b?`${b}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),p?(0,t.jsx)(c.DrawerHeader,{className:"shrink-0",children:p}):null,p?(0,t.jsx)(f.Separator,{}):null,T.envDeploy&&j?(0,t.jsx)(w,{deployTarget:j}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:g}),x?(0,t.jsx)(c.DrawerFooter,{className:"shrink-0",children:x}):null]})})]})]})}])}]);
@@ -0,0 +1,8 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70727,e=>{"use strict";let t=(0,e.i(54864).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],70727)},84735,e=>{"use strict";let t=(0,e.i(54864).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],84735)},1650,e=>{"use strict";e.i(11495),e.s([])},68316,e=>{"use strict";var t=e.i(25034);e.s(["Server",()=>t.default])},54793,7729,e=>{"use strict";var t=e.i(96871),r=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:s,description:a,action:l,className:i,...n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",i),...n,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),a?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:a}):null,l?(0,t.jsx)("div",{className:"mt-2",children:l}):null]})}],7729),e.s([],54793)},956,e=>{"use strict";var t=e.i(96871),r=e.i(16539),s=e.i(31777);let a=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("bg-card text-card-foreground editorial-shadow rounded-xl border",e),...r}));a.displayName="Card";let l=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",e),...r}));l.displayName="CardHeader";let i=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("leading-none font-semibold tracking-tight",e),...r}));i.displayName="CardTitle";let n=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("text-muted-foreground text-sm",e),...r}));n.displayName="CardDescription";let c=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("p-6 pt-0",e),...r}));c.displayName="CardContent",r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("flex items-center p-6 pt-0",e),...r})).displayName="CardFooter",e.s(["Card",0,a,"CardContent",0,c,"CardDescription",0,n,"CardHeader",0,l,"CardTitle",0,i])},25326,e=>{"use strict";var t=e.i(23835);e.s(["AlertCircle",()=>t.default])},89372,e=>{"use strict";var t=e.i(96871),r=e.i(16539);e.i(26759);var s=e.i(97164),a=e.i(25326),l=e.i(68787),i=e.i(68316),n=e.i(98127),c=e.i(81846);e.i(54793);var d=e.i(7729),o=e.i(956);let m=(0,e.i(54864).default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);var p=e.i(70727);let x={http:i.Server,sse:m,stdio:p.Terminal};function u({server:e,onSelect:r}){let{t:a}=(0,s.useTranslation)("web"),l=x[e.transport]??i.Server,n=e.mcp_info?.description??"";return(0,t.jsxs)(o.Card,{className:"cursor-pointer p-5 transition-all duration-300 hover:scale-[1.02] hover:shadow-md hover:ring-slate-300 dark:hover:ring-slate-600",role:"button",tabIndex:0,onClick:()=>r(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),r(e))},children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e.name})]}),(0,t.jsx)(c.Badge,{variant:"outline",className:"shrink-0 text-xs",children:a(`mcpServers.transport.${e.transport}`,e.transport.toUpperCase())})]}),n?(0,t.jsx)("p",{className:"text-muted-foreground mt-2 line-clamp-2 text-xs",children:n}):null,(0,t.jsx)("div",{className:"mt-3 flex items-center gap-2",children:e.auth_type&&"none"!==e.auth_type?(0,t.jsx)(c.Badge,{variant:"secondary",className:"text-xs",children:a(`mcpServers.authType.${e.auth_type}`,e.auth_type)}):null})]})}e.i(1650);var h=e.i(11495),f=e.i(45811),v=e.i(25235);function j({tools:e,serverName:a}){let{t:l}=(0,s.useTranslation)("web"),i=(0,r.useMemo)(()=>{let t;return t=`${a}-`,e.map(e=>({displayName:e.name.startsWith(t)?e.name.slice(t.length):e.name,description:e.description,key:e.name})).sort((e,t)=>e.displayName.localeCompare(t.displayName))},[e,a]);return 0===e.length?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:l("mcpServers.tools.noTools")}):(0,t.jsx)("div",{className:"space-y-2",children:i.map(e=>(0,t.jsxs)("div",{className:"rounded-md border p-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(c.Badge,{variant:"outline",className:"font-mono text-xs",children:e.displayName})}),e.description?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs",children:e.description}):null]},e.key))})}var y=e.i(35364),N=e.i(85149),g=e.i(67088);let b=[{id:"claude-code",label:"Claude Code"},{id:"cursor",label:"Cursor"},{id:"vscode",label:"VS Code"},{id:"gemini",label:"Gemini CLI"},{id:"codex",label:"Codex CLI"},{id:"curl",label:"cURL"}];function S({proxyBaseUrl:e,serverName:a}){let{t:l}=(0,s.useTranslation)("web"),[i,n]=(0,r.useState)("claude-code"),[c,d]=(0,r.useState)(!1),o=function(e,t,r){let s=`${t.replace(/\/$/,"")}/${r}/mcp`;switch(e){case"claude-code":return`claude mcp add --transport http ${r} \\
2
+ ${s} \\
3
+ --header "x-litellm-api-key: Bearer <LITELLM_API_KEY>"`;case"cursor":return JSON.stringify({mcpServers:{[r]:{url:s,headers:{"x-litellm-api-key":"Bearer <LITELLM_API_KEY>"}}}},null,2);case"vscode":return JSON.stringify({mcp:{servers:{[r]:{type:"http",url:s,headers:{"x-litellm-api-key":"Bearer <LITELLM_API_KEY>"}}}}},null,2);case"gemini":return JSON.stringify({mcpServers:{[r]:{httpUrl:s,headers:{"x-litellm-api-key":"Bearer <LITELLM_API_KEY>"}}}},null,2);case"codex":return`[mcp_servers.${r}]
4
+ url = "${s}"
5
+ headers = { "x-litellm-api-key" = "Bearer <LITELLM_API_KEY>" }`;case"curl":return`curl --location '${s}' \\
6
+ --header 'Content-Type: application/json' \\
7
+ --header 'x-litellm-api-key: Bearer <LITELLM_API_KEY>' \\
8
+ --data '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'`}}(i,e,a),m=async()=>{try{await navigator.clipboard.writeText(o),d(!0),setTimeout(()=>d(!1),2e3)}catch{}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1",role:"tablist",children:b.map(e=>(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":i===e.id,onClick:()=>n(e.id),className:i===e.id?"bg-primary text-primary-foreground rounded-md px-2.5 py-1 text-xs font-medium":"border-border hover:bg-muted rounded-md border px-2.5 py-1 text-xs",children:e.label},e.id))}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("pre",{className:"bg-muted max-h-64 overflow-auto rounded-md p-3 pr-10 font-mono text-[11px] leading-relaxed",children:(0,t.jsx)("code",{children:o})}),(0,t.jsx)(y.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute top-1 right-1 h-7 w-7",onClick:m,"aria-label":l("mcpServers.connect.copy"),children:c?(0,t.jsx)(N.Check,{className:"text-primary h-3.5 w-3.5"}):(0,t.jsx)(g.Copy,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:l("mcpServers.connect.replaceKey")})]})}var w=e.i(96976);let C=(0,w.createServerReference)("401ba49ea4f9ca43f01491e2327308b75f41aab452",w.callServer,void 0,w.findSourceMapURL,"fetchMcpServerToolsAction");function k({server:e,proxyBaseUrl:a,open:l,onClose:i}){let{t:n}=(0,s.useTranslation)("web"),[d,o]=(0,r.useState)([]),[m,p]=(0,r.useState)(!1),[x,u]=(0,r.useState)(null),[y,N]=(0,r.useState)(null),g=(0,r.useCallback)(async e=>{p(!0),u(null);try{let t=await C(e);o(t.tools),t.error&&u(t.error),N(e)}catch{u("Failed to load tools")}finally{p(!1)}},[]);if((0,r.useEffect)(()=>{l&&e&&y!==e.server_name&&g(e.server_name)},[l,e,y,g]),!e)return null;let b=e.mcp_info?.description??"";return(0,t.jsxs)(h.BaseDrawer,{open:l,onClose:i,children:[(0,t.jsx)(f.DrawerTitle,{children:e.name}),b?(0,t.jsx)(f.DrawerDescription,{children:b}):null,(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n("mcpServers.detail.serverName")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:e.server_name})]}),!function(e){if(!e)return!1;try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e.url)?null:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n("mcpServers.detail.url")}),(0,t.jsx)("span",{className:"max-w-[200px] truncate font-mono text-xs",children:e.url})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n("mcpServers.detail.transport")}),(0,t.jsx)(c.Badge,{variant:"outline",className:"text-xs",children:n(`mcpServers.transport.${e.transport}`,e.transport.toUpperCase())})]}),e.auth_type&&"none"!==e.auth_type?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n("mcpServers.detail.authType")}),(0,t.jsx)(c.Badge,{variant:"secondary",className:"text-xs",children:n(`mcpServers.authType.${e.auth_type}`,e.auth_type)})]}):null]}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:n("mcpServers.tools.title")}),m?(0,t.jsxs)("p",{className:"text-muted-foreground text-sm",children:[n("accessibility.loading"),"..."]}):x?(0,t.jsx)("p",{className:"text-destructive text-sm",children:x}):(0,t.jsx)(j,{tools:d,serverName:e.server_name}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:n("mcpServers.connect.title")}),(0,t.jsx)(S,{proxyBaseUrl:a,serverName:e.server_name})]})}let _=(0,w.createServerReference)("003eb8cb51501bbc7f537effacfeb8932880f2b63e",w.callServer,void 0,w.findSourceMapURL,"fetchMcpServersAction"),L=["all","http","sse","stdio"];e.s(["McpServersPageClient",0,function({proxyConfigured:e,proxyBaseUrl:o}){let{t:m}=(0,s.useTranslation)("web"),[p,x]=(0,r.useState)(""),[h,f]=(0,r.useState)("all"),[v,j]=(0,r.useState)(null),[y,N]=(0,r.useState)([]),[g,b]=(0,r.useState)(!0),[S,w]=(0,r.useState)(null);(0,r.useEffect)(()=>{e?_().then(e=>{N(e.servers),e.error&&w(e.error)}).catch(()=>{w(m("mcpServers.fetchError"))}).finally(()=>{b(!1)}):b(!1)},[e,m]);let C=(0,r.useMemo)(()=>y.filter(e=>{let t=p.toLowerCase(),r=!t||e.name.toLowerCase().includes(t)||(e.mcp_info?.description??"").toLowerCase().includes(t),s="all"===h||e.transport===h;return r&&s}),[y,p,h]);return e?g?(0,t.jsx)("div",{className:"flex h-full items-center justify-center p-8",children:(0,t.jsxs)("p",{className:"text-muted-foreground",children:[m("accessibility.loading"),"..."]})}):(0,t.jsxs)("div",{className:"space-y-6 p-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:m("mcpServers.title")}),S?(0,t.jsx)("div",{className:"border-destructive/50 bg-destructive/10 mt-2 rounded-md border p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.AlertCircle,{className:"text-destructive h-4 w-4"}),(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}):null,(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:m("mcpServers.subtitle")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(n.Input,{placeholder:m("mcpServers.searchPlaceholder"),value:p,onChange:e=>x(e.target.value),className:"max-w-xs"}),(0,t.jsx)("div",{className:"flex gap-1",children:L.map(e=>(0,t.jsx)(c.Badge,{variant:h===e?"default":"outline",className:"cursor-pointer",onClick:()=>f(e),children:"all"===e?m("mcpServers.filter.all"):m(`mcpServers.transport.${e}`,e.toUpperCase())},e))})]}),0===C.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)(d.EmptyState,{icon:0===y.length?(0,t.jsx)(i.Server,{className:"h-8 w-8"}):(0,t.jsx)(l.Search,{className:"h-8 w-8"}),title:0===y.length?m("mcpServers.noServers"):m("mcpServers.noResults")})}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:C.map(e=>(0,t.jsx)(u,{server:e,onSelect:j},e.server_id))}),(0,t.jsx)(k,{server:v,proxyBaseUrl:o,open:!!v,onClose:()=>j(null)})]}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center p-8",children:(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(a.AlertCircle,{className:"h-8 w-8"}),title:m("mcpServers.noProxy")})})}],89372)}]);
@@ -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)("401c780ab9c70b68ed94559ac98c1cd98a6ef73296",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(26759);var n=e.i(97164);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),u=e.i(81846),h=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("40a2757564c25f4795af218df10208cbcc028070ab",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(82639),w=e.i(22570),C=e.i(45977),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var T=e.i(86254),k=e.i(9749);function P({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:M,overrideModel:A,currentAgentType:I,currentModel:O,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),_=(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:u,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:_,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=_.current?.contains(document.activeElement),t=_.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)(T.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)(k.AgentModelPicker,{initialAgentType:M??I??"claude-code",initialModel:A??O??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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)(h.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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)(h.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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)(h.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(8791),F=e.i(13867),E=e.i(96612),R=e.i(27381),L=e.i(47373);let M=(0,i.createServerReference)("4029c8b6630e7a21a766cb989180591beb0c4df7de",i.callServer,void 0,i.findSourceMapURL,"getAgentPermissionOptions"),A=["allowPrd","allowPlan","allowMerge"];function I({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:u,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:T,computedOpenPr:k,isSubmitting:P,agentType:R,permissionMode:L,onPermissionModeChange:M}){let{t:z}=(0,n.useTranslation)("web"),U=[{id:"allowPrd",label:z("createDrawer.prd"),description:z("createDrawer.prdDescription")},{id:"allowPlan",label:z("createDrawer.plan"),description:z("createDrawer.planDescription")},{id:"allowMerge",label:z("createDrawer.merge"),description:z("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)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.approve")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(a=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P||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)(h.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?z("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=A.every(t=>e[t]),a={};for(let e of A)a[e]=!t;r(a)},disabled:P,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",A.every(t=>e[t])&&"text-primary"),children:z("createDrawer.all")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("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)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.evidence")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.collect")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.collectDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P||!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:z("createDrawer.addToPr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:d||v?a?z("createDrawer.addToPrDescription"):z("createDrawer.requiresEvidence"):z("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:z("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:T,onCheckedChange:e=>{c(e),!e&&d&&u(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.push")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.pushDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:k,onCheckedChange:e=>{u(e),e||o(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.pr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.prDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.watch")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(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"}),z("createDrawer.sync")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.syncDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(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"}),z("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(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"}),z("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.forkAndPrDescription")})]})]})]}),R&&M?(0,t.jsx)(O,{agentType:R,permissionMode:L,onPermissionModeChange:M,isSubmitting:P}):null]})}function O({agentType:e,permissionMode:a,onPermissionModeChange:s,isSubmitting:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)([]);return((0,r.useEffect)(()=>{let t=!1;return M(e).then(e=>{t||c(e)}),()=>{t=!0}},[e]),0===l.length)?null:(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground flex w-16 shrink-0 cursor-default items-center gap-1 text-xs font-semibold tracking-wider",children:[(0,t.jsx)(R.Shield,{className:"h-3 w-3"}),o("feature.create.permissionMode")]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:o("settings.agent.permissions.description",{agent:e})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)(L.Select,{value:a??"__default__",onValueChange:e=>s("__default__"===e?void 0:e),disabled:i,children:[(0,t.jsx)(L.SelectTrigger,{id:"permission-mode","data-testid":"permission-mode-select",className:"h-7 text-xs",children:(0,t.jsx)(L.SelectValue,{})}),(0,t.jsxs)(L.SelectContent,{children:[(0,t.jsx)(L.SelectItem,{value:"__default__",children:o("feature.create.permissionModeDefault")}),l.map(e=>(0,t.jsx)(L.SelectItem,{value:e.value,children:e.label},e.value))]})]})})]})}var z=e.i(56060),U=e.i(91653),B=e.i(98127),_=e.i(90382);function G({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)(""),u=(0,r.useRef)(null),h=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(()=>u.current?.focus(),0):p("")},[l]),(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.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",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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)(B.Input,{ref:u,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)(U.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)(U.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 W=e.i(47930),$=e.i(79561),q=e.i(25235),K=e.i(75921),V=e.i(51032),Z=e.i(78521);e.i(13322);var J=e.i(61201);function H({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,K.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,V.addRepository)({path:e});if(t.error){x(t.error),h(!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]),T=(0,r.useCallback)(async()=>{if(!u){if(j)return void g(!0);h(!0),x(null);try{let e=await (0,Z.pickFolder)();if(!e)return void h(!1);await N(e)}catch{g(!0)}finally{h(!1)}}},[u,j,N]),k=(0,r.useCallback)(async e=>{if(g(!1),e){h(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{h(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.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)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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)(B.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)(U.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)(q.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:T,disabled:u,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:[u?(0,t.jsx)($.LoaderCircle,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(W.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)(J.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:k})]})}function Q({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}){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 u=(0,m.useSoundAction)("create"),h=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,T=i?.fast!==!1,[k,P]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&P(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,M]=(0,r.useState)(w),[A,I]=(0,r.useState)(C),[O,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[_,G]=(0,r.useState)(N),[W,$]=(0,r.useState)(void 0),[q,K]=(0,r.useState)(T),[V,Z]=(0,r.useState)(!1),[J,H]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(!0),[Y,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(void 0),[en,el]=(0,r.useState)(h||void 0),[ec,ed]=(0,r.useState)(o??[]),[ep,eu]=(0,r.useState)(!1),[eh,em]=(0,r.useState)(null),[ex,ef]=(0,r.useState)(!1),eg=(0,r.useRef)(crypto.randomUUID()),eb=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),M(i.push),I(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),G(i.commitEvidence),K(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{ed(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&$(n)},[e,n]);let[ej,ev]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{ev(p??!1)},[p]);let ew=(0,r.useRef)(en);(0,r.useEffect)(()=>{en&&en!==ew.current&&(ew.current=en,f(en).then(e=>ev(e.canPushDirectly)).catch(()=>ev(!1)))},[en]),(0,r.useEffect)(()=>{ej&&(H(!1),M(w),I(C),X(!0))},[ej,w,C]);let eC=(0,r.useCallback)(()=>{P(""),F([]),R({...v}),M(w),I(C),z(y),B(D),G(N),$(void 0),el(h||void 0),ed(o??[]),K(T),Z(!1),H(!1),X(!0),ee(!0),er(void 0),es(void 0),eo(void 0),em(null),eb.current=0,eu(!1)},[v,w,C,D,y,N,T,h,o]),ey=""!==k.trim()||S.length>0,{attemptClose:eD}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ey,onClose:t,onReset:eC}),eN=(0,r.useCallback)(async e=>{for(let t of(em(null),e)){if(t.size>0xa00000)return void em(`"${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 em(`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",eg.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)),em(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)),em("Upload failed")}}},[]),eT=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current+=1,1===eb.current&&eu(!0)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current-=1,0===eb.current&&eu(!1)},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current=0,eu(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eN(t)},[eN]),eF=(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(),eN(r))},[eN]),eE=(0,r.useCallback)(e=>{if(e.preventDefault(),!k.trim())return;let t=en??h;t&&(u.play(),a({description:k.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!J||L||A,openPr:!!J||A,ciWatchEnabled:O,enableEvidence:U,commitEvidence:_,fast:q,forkAndPr:J,commitSpecs:Q,rebaseBeforeBranch:Y,...V?{pending:V}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...ei?{permissionMode:ei}:{},...W?{parentId:W}:{},sessionId:eg.current}),eC())},[k,S,E,en,h,a,L,A,U,O,_,q,J,Q,Y,V,et,ea,ei,W,u,eC]),eR=(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:eg.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(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)),em("Upload failed")}}}catch{}},[]),eL=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eM=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:h,canPush:ej,isDirty:ey,computedPush:!!J||L||A,computedOpenPr:!!J||A,description:k,setDescription:P,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:M,openPr:A,setOpenPr:I,ciWatchEnabled:O,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:_,setCommitEvidence:G,parentId:W,setParentId:$,fast:q,setFast:K,pending:V,setPending:Z,forkAndPr:J,setForkAndPr:H,commitSpecs:Q,setCommitSpecs:X,rebaseBeforeBranch:Y,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,permissionMode:ei,setPermissionMode:eo,selectedRepoPath:en,setSelectedRepoPath:el,localRepos:ec,setLocalRepos:ed,isDragOver:ep,uploadError:eh,isPromptFocused:ex,setIsPromptFocused:ef,sessionIdRef:eg,currentAgentType:l,currentModel:c,attemptClose:eD,handleFiles:eN,handleDragEnter:eT,handleDragLeave:ek,handleDragOver:eP,handleDrop:eS,handlePaste:eF,handleSubmit:eE,handleAddFiles:eR,handleRemoveFile:eL,handleNotesChange:eM,resetForm:eC}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),L=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,A=!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)(u.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||A,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(h.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)(H,{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)(P,{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}),L&&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)(G,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(I,{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,agentType:F.overrideAgent??D,permissionMode:F.permissionMode,onPermissionModeChange:F.setPermissionMode})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:u,canPushDirectly:h}){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)(Q,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}],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)("40532839146c1594418d81f1d75a77b120859fe2e9",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(26759);var n=e.i(97164);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),u=e.i(81846),h=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("40b07b8563e95c2982a717a4077cec4ac57578c1dc",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(82639),w=e.i(22570),C=e.i(45977),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var T=e.i(86254),k=e.i(9749);function P({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:M,overrideModel:A,currentAgentType:I,currentModel:O,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),_=(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:u,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:_,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=_.current?.contains(document.activeElement),t=_.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)(T.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)(k.AgentModelPicker,{initialAgentType:M??I??"claude-code",initialModel:A??O??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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)(h.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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)(h.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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)(h.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(8791),F=e.i(13867),E=e.i(96612),R=e.i(27381),L=e.i(47373);let M=(0,i.createServerReference)("40ac427248cf5d8af224fb5df4a3e17ac5d299392d",i.callServer,void 0,i.findSourceMapURL,"getAgentPermissionOptions"),A=["allowPrd","allowPlan","allowMerge"];function I({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:u,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:T,computedOpenPr:k,isSubmitting:P,agentType:R,permissionMode:L,onPermissionModeChange:M}){let{t:z}=(0,n.useTranslation)("web"),U=[{id:"allowPrd",label:z("createDrawer.prd"),description:z("createDrawer.prdDescription")},{id:"allowPlan",label:z("createDrawer.plan"),description:z("createDrawer.planDescription")},{id:"allowMerge",label:z("createDrawer.merge"),description:z("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)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.approve")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(a=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P||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)(h.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?z("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=A.every(t=>e[t]),a={};for(let e of A)a[e]=!t;r(a)},disabled:P,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",A.every(t=>e[t])&&"text-primary"),children:z("createDrawer.all")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("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)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.evidence")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.collect")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.collectDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P||!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:z("createDrawer.addToPr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:d||v?a?z("createDrawer.addToPrDescription"):z("createDrawer.requiresEvidence"):z("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:z("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:T,onCheckedChange:e=>{c(e),!e&&d&&u(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.push")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.pushDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:k,onCheckedChange:e=>{u(e),e||o(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.pr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.prDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.watch")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(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"}),z("createDrawer.sync")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.syncDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(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"}),z("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:P}),(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"}),z("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.forkAndPrDescription")})]})]})]}),R&&M?(0,t.jsx)(O,{agentType:R,permissionMode:L,onPermissionModeChange:M,isSubmitting:P}):null]})}function O({agentType:e,permissionMode:a,onPermissionModeChange:s,isSubmitting:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)([]);return((0,r.useEffect)(()=>{let t=!1;return M(e).then(e=>{t||c(e)}),()=>{t=!0}},[e]),0===l.length)?null:(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground flex w-16 shrink-0 cursor-default items-center gap-1 text-xs font-semibold tracking-wider",children:[(0,t.jsx)(R.Shield,{className:"h-3 w-3"}),o("feature.create.permissionMode")]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:o("settings.agent.permissions.description",{agent:e})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)(L.Select,{value:a??"__default__",onValueChange:e=>s("__default__"===e?void 0:e),disabled:i,children:[(0,t.jsx)(L.SelectTrigger,{id:"permission-mode","data-testid":"permission-mode-select",className:"h-7 text-xs",children:(0,t.jsx)(L.SelectValue,{})}),(0,t.jsxs)(L.SelectContent,{children:[(0,t.jsx)(L.SelectItem,{value:"__default__",children:o("feature.create.permissionModeDefault")}),l.map(e=>(0,t.jsx)(L.SelectItem,{value:e.value,children:e.label},e.value))]})]})})]})}var z=e.i(56060),U=e.i(91653),B=e.i(98127),_=e.i(90382);function G({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)(""),u=(0,r.useRef)(null),h=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(()=>u.current?.focus(),0):p("")},[l]),(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.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",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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)(B.Input,{ref:u,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)(U.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)(U.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 W=e.i(47930),$=e.i(79561),q=e.i(25235),K=e.i(75921),V=e.i(23675),Z=e.i(78521);e.i(13322);var J=e.i(61201);function H({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,K.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,V.addRepository)({path:e});if(t.error){x(t.error),h(!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]),T=(0,r.useCallback)(async()=>{if(!u){if(j)return void g(!0);h(!0),x(null);try{let e=await (0,Z.pickFolder)();if(!e)return void h(!1);await N(e)}catch{g(!0)}finally{h(!1)}}},[u,j,N]),k=(0,r.useCallback)(async e=>{if(g(!1),e){h(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{h(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.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)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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)(B.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)(U.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)(q.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:T,disabled:u,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:[u?(0,t.jsx)($.LoaderCircle,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(W.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)(J.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:k})]})}function Q({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}){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 u=(0,m.useSoundAction)("create"),h=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,T=i?.fast!==!1,[k,P]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&P(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,M]=(0,r.useState)(w),[A,I]=(0,r.useState)(C),[O,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[_,G]=(0,r.useState)(N),[W,$]=(0,r.useState)(void 0),[q,K]=(0,r.useState)(T),[V,Z]=(0,r.useState)(!1),[J,H]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(!0),[Y,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(void 0),[en,el]=(0,r.useState)(h||void 0),[ec,ed]=(0,r.useState)(o??[]),[ep,eu]=(0,r.useState)(!1),[eh,em]=(0,r.useState)(null),[ex,ef]=(0,r.useState)(!1),eg=(0,r.useRef)(crypto.randomUUID()),eb=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),M(i.push),I(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),G(i.commitEvidence),K(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{ed(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&$(n)},[e,n]);let[ej,ev]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{ev(p??!1)},[p]);let ew=(0,r.useRef)(en);(0,r.useEffect)(()=>{en&&en!==ew.current&&(ew.current=en,f(en).then(e=>ev(e.canPushDirectly)).catch(()=>ev(!1)))},[en]),(0,r.useEffect)(()=>{ej&&(H(!1),M(w),I(C),X(!0))},[ej,w,C]);let eC=(0,r.useCallback)(()=>{P(""),F([]),R({...v}),M(w),I(C),z(y),B(D),G(N),$(void 0),el(h||void 0),ed(o??[]),K(T),Z(!1),H(!1),X(!0),ee(!0),er(void 0),es(void 0),eo(void 0),em(null),eb.current=0,eu(!1)},[v,w,C,D,y,N,T,h,o]),ey=""!==k.trim()||S.length>0,{attemptClose:eD}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ey,onClose:t,onReset:eC}),eN=(0,r.useCallback)(async e=>{for(let t of(em(null),e)){if(t.size>0xa00000)return void em(`"${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 em(`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",eg.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)),em(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)),em("Upload failed")}}},[]),eT=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current+=1,1===eb.current&&eu(!0)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current-=1,0===eb.current&&eu(!1)},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current=0,eu(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eN(t)},[eN]),eF=(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(),eN(r))},[eN]),eE=(0,r.useCallback)(e=>{if(e.preventDefault(),!k.trim())return;let t=en??h;t&&(u.play(),a({description:k.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!J||L||A,openPr:!!J||A,ciWatchEnabled:O,enableEvidence:U,commitEvidence:_,fast:q,forkAndPr:J,commitSpecs:Q,rebaseBeforeBranch:Y,...V?{pending:V}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...ei?{permissionMode:ei}:{},...W?{parentId:W}:{},sessionId:eg.current}),eC())},[k,S,E,en,h,a,L,A,U,O,_,q,J,Q,Y,V,et,ea,ei,W,u,eC]),eR=(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:eg.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(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)),em("Upload failed")}}}catch{}},[]),eL=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eM=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:h,canPush:ej,isDirty:ey,computedPush:!!J||L||A,computedOpenPr:!!J||A,description:k,setDescription:P,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:M,openPr:A,setOpenPr:I,ciWatchEnabled:O,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:_,setCommitEvidence:G,parentId:W,setParentId:$,fast:q,setFast:K,pending:V,setPending:Z,forkAndPr:J,setForkAndPr:H,commitSpecs:Q,setCommitSpecs:X,rebaseBeforeBranch:Y,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,permissionMode:ei,setPermissionMode:eo,selectedRepoPath:en,setSelectedRepoPath:el,localRepos:ec,setLocalRepos:ed,isDragOver:ep,uploadError:eh,isPromptFocused:ex,setIsPromptFocused:ef,sessionIdRef:eg,currentAgentType:l,currentModel:c,attemptClose:eD,handleFiles:eN,handleDragEnter:eT,handleDragLeave:ek,handleDragOver:eP,handleDrop:eS,handlePaste:eF,handleSubmit:eE,handleAddFiles:eR,handleRemoveFile:eL,handleNotesChange:eM,resetForm:eC}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),L=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,A=!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)(u.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||A,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(h.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)(H,{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)(P,{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}),L&&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)(G,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(I,{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,agentType:F.overrideAgent??D,permissionMode:F.permissionMode,onPermissionModeChange:F.setPermissionMode})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:u,canPushDirectly:h}){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)(Q,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}],15203)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84735,e=>{"use strict";let t=(0,e.i(54864).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],84735)},70727,e=>{"use strict";let t=(0,e.i(54864).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],70727)},1650,e=>{"use strict";e.i(11495),e.s([])},51911,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(91967),l=e.i(22353),i=e.i(9413),n=e.i(36567),r=e.i(9641),c=e.i(70391),o=e.i(85565),d="Switch",[u,p]=(0,i.createContextScope)(d),[x,m]=u(d),f=a.forwardRef((e,i)=>{let{__scopeSwitch:r,name:c,checked:u,defaultChecked:p,required:m,disabled:f,value:g="on",onCheckedChange:h,form:b,...y}=e,[w,N]=a.useState(null),k=(0,l.useComposedRefs)(i,e=>N(e)),C=a.useRef(!1),S=!w||b||!!w.closest("form"),[P,R]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:h,caller:d});return(0,t.jsxs)(x,{scope:r,checked:P,disabled:f,children:[(0,t.jsx)(o.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":j(P),"data-disabled":f?"":void 0,disabled:f,value:g,...y,ref:k,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{R(e=>!e),S&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),S&&(0,t.jsx)(v,{control:w,bubbles:!C.current,name:c,value:g,checked:P,required:m,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});f.displayName=d;var g="SwitchThumb",h=a.forwardRef((e,a)=>{let{__scopeSwitch:s,...l}=e,i=m(g,s);return(0,t.jsx)(o.Primitive.span,{"data-state":j(i.checked),"data-disabled":i.disabled?"":void 0,...l,ref:a})});h.displayName=g;var v=a.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...o},d)=>{let u=a.useRef(null),p=(0,l.useComposedRefs)(u,d),x=(0,r.usePrevious)(i),m=(0,c.useSize)(s);return a.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==i&&t){let a=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(a)}},[x,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...o,tabIndex:-1,ref:p,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function j(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput",e.s(["Root",0,f,"Switch",0,f,"SwitchThumb",0,h,"Thumb",0,h,"createSwitchScope",0,p],76587);var b=e.i(76587),b=b,y=e.i(31777);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(b.Root,{"data-slot":"switch","data-size":a,className:(0,y.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(b.Thumb,{"data-slot":"switch-thumb",className:(0,y.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}],51911)},9443,85871,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["PageHeader",0,function({title:e,description:s,eyebrow:l,children:i,className:n}){return(0,t.jsxs)("header",{className:(0,a.cn)("flex items-center justify-between gap-4",n),children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[l?(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-[0.2em] text-slate-400 uppercase",children:l}):null,(0,t.jsx)("div",{className:"flex items-baseline gap-3",children:(0,t.jsx)("h1",{className:"text-foreground text-3xl font-black tracking-tight",children:e})}),s?(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:s}):null]}),i?(0,t.jsx)("div",{"data-slot":"actions",children:i}):null]})}],85871),e.s([],9443)},54793,7729,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:s,description:l,action:i,className:n,...r}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",n),...r,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,i?(0,t.jsx)("div",{className:"mt-2",children:i}):null]})}],7729),e.s([],54793)},956,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(31777);let l=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("bg-card text-card-foreground editorial-shadow rounded-xl border",e),...a}));l.displayName="Card";let i=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",e),...a}));i.displayName="CardHeader";let n=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("leading-none font-semibold tracking-tight",e),...a}));n.displayName="CardTitle";let r=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));r.displayName="CardDescription";let c=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("p-6 pt-0",e),...a}));c.displayName="CardContent",a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex items-center p-6 pt-0",e),...a})).displayName="CardFooter",e.s(["Card",0,l,"CardContent",0,c,"CardDescription",0,r,"CardHeader",0,i,"CardTitle",0,n])},25326,e=>{"use strict";var t=e.i(23835);e.s(["AlertCircle",()=>t.default])},26530,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(68787),l=e.i(47952),i=e.i(25326),n=e.i(60112),r=e.i(98127),c=e.i(35364);e.i(9443);var o=e.i(85871);e.i(54793);var d=e.i(7729),u=e.i(956),p=e.i(81846),x=e.i(51911);e.i(26759);var m=e.i(97164);function f({plugin:e,installed:a,onSelect:s,onToggle:l}){let{t:i}=(0,m.useTranslation)("web");return(0,t.jsxs)(u.Card,{className:"cursor-pointer p-5 transition-all duration-300 hover:scale-[1.02] hover:shadow-md hover:ring-slate-300 dark:hover:ring-slate-600",role:"button",tabIndex:0,onClick:()=>s(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),s(e))},"data-testid":`plugin-card-${e.name}`,children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-bold tracking-tight",children:e.name}),e.version?(0,t.jsxs)("p",{className:"text-muted-foreground mt-1 font-mono text-xs",children:["v",e.version]}):null,(0,t.jsx)("p",{className:"text-muted-foreground mt-3 line-clamp-2 text-xs leading-relaxed",children:e.description}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[e.category?(0,t.jsx)(p.Badge,{variant:"outline",children:e.category}):null,a?(0,t.jsx)(p.Badge,{variant:"secondary",children:i("plugins.installed")}):(0,t.jsx)(p.Badge,{variant:"outline",className:"opacity-50",children:i("plugins.notInstalled")})]}),a?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsx)(x.Switch,{checked:a.enabled,onCheckedChange:t=>l?.(e.name,t),"data-testid":`plugin-toggle-${e.name}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:i(a.enabled?"plugins.disable":"plugins.enable")})]}):null]})}e.i(1650);var g=e.i(11495),h=e.i(45811),v=e.i(25235),j=e.i(84735);function b({plugin:e,installed:a,open:s,onClose:l,onInstall:i,onUninstall:n}){let{t:r}=(0,m.useTranslation)("web");if(!e)return null;let o=function(e){let{source:t}=e;if("github"===t.source&&t.repo)return`https://github.com/${t.repo}`;if(("url"===t.source||"git-subdir"===t.source)&&t.url)try{let e=new URL(t.url);if("https:"===e.protocol)return t.url}catch{}return null}(e);return(0,t.jsxs)(g.BaseDrawer,{open:s,onClose:l,children:[(0,t.jsx)(h.DrawerTitle,{className:"text-foreground text-lg font-bold tracking-tight",children:e.name}),(0,t.jsx)(h.DrawerDescription,{className:"text-muted-foreground mt-1 text-sm",children:e.description}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsxs)("div",{className:"space-y-3",children:[e.version?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.version")}),(0,t.jsxs)("span",{className:"font-mono text-sm",children:["v",e.version]})]}):null,e.category?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.category")}),(0,t.jsx)(p.Badge,{variant:"outline",children:e.category})]}):null,o?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.source")}),(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 inline-flex items-center gap-1 text-sm underline underline-offset-2",children:[e.source.repo??"Repository",(0,t.jsx)(j.ExternalLink,{className:"size-3"})]})]}):null,e.keywords&&e.keywords.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-2",children:e.keywords.map(e=>(0,t.jsx)(p.Badge,{variant:"outline",className:"text-xs",children:e},e))}):null]}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsx)("div",{className:"flex gap-2",children:a?(0,t.jsx)(c.Button,{variant:"destructive",size:"sm",onClick:()=>n?.(e.name),"data-testid":"plugin-uninstall-button",children:r("plugins.uninstall")}):(0,t.jsx)(c.Button,{size:"sm",onClick:()=>i?.(e.name),"data-testid":"plugin-install-button",children:r("plugins.install")})})]})}var y=e.i(96976);let w=(0,y.createServerReference)("00c8f43cf8f408093b0a9c54a3976093c13fe75bdb",y.callServer,void 0,y.findSourceMapURL,"fetchPluginCatalogAction"),N=(0,y.createServerReference)("703ed2a1f2b512f97ab04bf721f76017b9b4b20016",y.callServer,void 0,y.findSourceMapURL,"installPluginAction"),k=(0,y.createServerReference)("60619dbf0c85c71a6ffc97f9c1d71bf3e38f86200d",y.callServer,void 0,y.findSourceMapURL,"uninstallPluginAction"),C=(0,y.createServerReference)("70adaac3fec4d3043256b50cea2db56de7a5917b64",y.callServer,void 0,y.findSourceMapURL,"togglePluginAction");e.s(["PluginsPageClient",0,function({proxyConfigured:e,isClaudeCode:u}){let{t:p}=(0,m.useTranslation)("web"),[,x]=(0,a.useTransition)(),[g,h]=(0,a.useState)(""),[v,j]=(0,a.useState)(null),[y,S]=(0,a.useState)(null),[P,R]=(0,a.useState)(null),[z,T]=(0,a.useState)([]),[B,D]=(0,a.useState)([]),[E,A]=(0,a.useState)(!0);(0,a.useEffect)(()=>{e?w().then(e=>{T(e.plugins),D(e.installedPlugins),A(!1)}):A(!1)},[e]);let H=(0,a.useMemo)(()=>{let e=new Set;for(let t of z)t.category&&e.add(t.category);return Array.from(e).sort()},[z]),L=(0,a.useMemo)(()=>{let e=g.toLowerCase();return z.filter(t=>{if(v&&t.category!==v)return!1;if(y){let e=!!B.find(e=>e.id.startsWith(`${t.name}@`));if("installed"===y&&!e||"not-installed"===y&&e)return!1}if(e){let a=t.name.toLowerCase().includes(e),s=t.description.toLowerCase().includes(e);if(!a&&!s)return!1}return!0})},[z,g,v,y,B]),M=e=>B.find(t=>t.id.startsWith(`${e}@`)),I=(e,t)=>{x(async()=>{let a=await C(e,"default",t);a.success?(n.toast.success(`${e} ${t?"enabled":"disabled"}`),D((await w()).installedPlugins)):n.toast.error(a.error??"Toggle failed")})};return u?e?E?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"text-muted-foreground text-center text-sm",children:[p("accessibility.loading"),"..."]})]}):0===z.length?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(l.Blocks,{className:"size-10"}),title:p("plugins.emptyState")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.Search,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),(0,t.jsx)(r.Input,{placeholder:p("plugins.searchPlaceholder"),value:g,onChange:e=>h(e.target.value),className:"ps-9","data-testid":"plugin-search"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(c.Button,{variant:null===v?"default":"outline",size:"sm",onClick:()=>j(null),children:p("plugins.allCategories")}),H.map(e=>(0,t.jsx)(c.Button,{variant:v===e?"default":"outline",size:"sm",onClick:()=>j(e===v?null:e),children:e},e))]}),(0,t.jsx)("div",{className:"bg-border h-6 w-px"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(c.Button,{variant:null===y?"default":"outline",size:"sm",onClick:()=>S(null),children:"All Status"}),(0,t.jsx)(c.Button,{variant:"installed"===y?"default":"outline",size:"sm",onClick:()=>S("installed"===y?null:"installed"),children:p("plugins.installed")}),(0,t.jsx)(c.Button,{variant:"not-installed"===y?"default":"outline",size:"sm",onClick:()=>S("not-installed"===y?null:"not-installed"),children:p("plugins.notInstalled")})]})]}),L.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:L.map(e=>(0,t.jsx)(f,{plugin:e,installed:M(e.name),onSelect:R,onToggle:I},e.name))}):(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(s.Search,{className:"size-10"}),title:p("plugins.emptyState"),action:(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>{h(""),j(null),S(null)},children:p("plugins.clearFilters")})}),(0,t.jsx)(b,{plugin:P,installed:P?M(P.name):void 0,open:!!P,onClose:()=>R(null),onInstall:e=>{x(async()=>{let t=await N(e,"default");t.success?(n.toast.success(`${e} installed`),D((await w()).installedPlugins)):n.toast.error(t.error??"Installation failed")})},onUninstall:e=>{x(async()=>{let t=await k(e,"default");t.success?(n.toast.success(`${e} uninstalled`),D((await w()).installedPlugins)):n.toast.error(t.error??"Uninstallation failed")})}})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(i.AlertCircle,{className:"size-10"}),title:p("plugins.noProxy")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(i.AlertCircle,{className:"size-10"}),title:p("plugins.wrongAgent")})]})}],26530)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84735,e=>{"use strict";let t=(0,e.i(54864).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],84735)},70727,e=>{"use strict";let t=(0,e.i(54864).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],70727)},1650,e=>{"use strict";e.i(11495),e.s([])},51911,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(91967),l=e.i(22353),i=e.i(9413),n=e.i(36567),r=e.i(9641),d=e.i(70391),o=e.i(85565),c="Switch",[u,p]=(0,i.createContextScope)(c),[x,m]=u(c),f=a.forwardRef((e,i)=>{let{__scopeSwitch:r,name:d,checked:u,defaultChecked:p,required:m,disabled:f,value:g="on",onCheckedChange:h,form:b,...y}=e,[w,N]=a.useState(null),k=(0,l.useComposedRefs)(i,e=>N(e)),C=a.useRef(!1),S=!w||b||!!w.closest("form"),[P,R]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:h,caller:c});return(0,t.jsxs)(x,{scope:r,checked:P,disabled:f,children:[(0,t.jsx)(o.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":j(P),"data-disabled":f?"":void 0,disabled:f,value:g,...y,ref:k,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{R(e=>!e),S&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),S&&(0,t.jsx)(v,{control:w,bubbles:!C.current,name:d,value:g,checked:P,required:m,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});f.displayName=c;var g="SwitchThumb",h=a.forwardRef((e,a)=>{let{__scopeSwitch:s,...l}=e,i=m(g,s);return(0,t.jsx)(o.Primitive.span,{"data-state":j(i.checked),"data-disabled":i.disabled?"":void 0,...l,ref:a})});h.displayName=g;var v=a.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...o},c)=>{let u=a.useRef(null),p=(0,l.useComposedRefs)(u,c),x=(0,r.usePrevious)(i),m=(0,d.useSize)(s);return a.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==i&&t){let a=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(a)}},[x,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...o,tabIndex:-1,ref:p,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function j(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput",e.s(["Root",0,f,"Switch",0,f,"SwitchThumb",0,h,"Thumb",0,h,"createSwitchScope",0,p],76587);var b=e.i(76587),b=b,y=e.i(31777);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(b.Root,{"data-slot":"switch","data-size":a,className:(0,y.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(b.Thumb,{"data-slot":"switch-thumb",className:(0,y.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}],51911)},9443,85871,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["PageHeader",0,function({title:e,description:s,eyebrow:l,children:i,className:n}){return(0,t.jsxs)("header",{className:(0,a.cn)("flex items-center justify-between gap-4",n),children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[l?(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-[0.2em] text-slate-400 uppercase",children:l}):null,(0,t.jsx)("div",{className:"flex items-baseline gap-3",children:(0,t.jsx)("h1",{className:"text-foreground text-3xl font-black tracking-tight",children:e})}),s?(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:s}):null]}),i?(0,t.jsx)("div",{"data-slot":"actions",children:i}):null]})}],85871),e.s([],9443)},54793,7729,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:s,description:l,action:i,className:n,...r}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",n),...r,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,i?(0,t.jsx)("div",{className:"mt-2",children:i}):null]})}],7729),e.s([],54793)},956,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(31777);let l=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("bg-card text-card-foreground editorial-shadow rounded-xl border",e),...a}));l.displayName="Card";let i=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",e),...a}));i.displayName="CardHeader";let n=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("leading-none font-semibold tracking-tight",e),...a}));n.displayName="CardTitle";let r=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));r.displayName="CardDescription";let d=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("p-6 pt-0",e),...a}));d.displayName="CardContent",a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex items-center p-6 pt-0",e),...a})).displayName="CardFooter",e.s(["Card",0,l,"CardContent",0,d,"CardDescription",0,r,"CardHeader",0,i,"CardTitle",0,n])},25326,e=>{"use strict";var t=e.i(23835);e.s(["AlertCircle",()=>t.default])},26530,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(68787),l=e.i(47952),i=e.i(25326),n=e.i(60112),r=e.i(98127),d=e.i(35364);e.i(9443);var o=e.i(85871);e.i(54793);var c=e.i(7729),u=e.i(956),p=e.i(81846),x=e.i(51911);e.i(26759);var m=e.i(97164);function f({plugin:e,installed:a,onSelect:s,onToggle:l}){let{t:i}=(0,m.useTranslation)("web");return(0,t.jsxs)(u.Card,{className:"cursor-pointer p-5 transition-all duration-300 hover:scale-[1.02] hover:shadow-md hover:ring-slate-300 dark:hover:ring-slate-600",role:"button",tabIndex:0,onClick:()=>s(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),s(e))},"data-testid":`plugin-card-${e.name}`,children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-bold tracking-tight",children:e.name}),e.version?(0,t.jsxs)("p",{className:"text-muted-foreground mt-1 font-mono text-xs",children:["v",e.version]}):null,(0,t.jsx)("p",{className:"text-muted-foreground mt-3 line-clamp-2 text-xs leading-relaxed",children:e.description}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[e.category?(0,t.jsx)(p.Badge,{variant:"outline",children:e.category}):null,a?(0,t.jsx)(p.Badge,{variant:"secondary",children:i("plugins.installed")}):(0,t.jsx)(p.Badge,{variant:"outline",className:"opacity-50",children:i("plugins.notInstalled")})]}),a?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsx)(x.Switch,{checked:a.enabled,onCheckedChange:t=>l?.(e.name,t),"data-testid":`plugin-toggle-${e.name}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:i(a.enabled?"plugins.disable":"plugins.enable")})]}):null]})}e.i(1650);var g=e.i(11495),h=e.i(45811),v=e.i(25235),j=e.i(84735);function b({plugin:e,installed:a,open:s,onClose:l,onInstall:i,onUninstall:n}){let{t:r}=(0,m.useTranslation)("web");if(!e)return null;let o=function(e){let{source:t}=e;if("github"===t.source&&t.repo)return`https://github.com/${t.repo}`;if(("url"===t.source||"git-subdir"===t.source)&&t.url)try{let e=new URL(t.url);if("https:"===e.protocol)return t.url}catch{}return null}(e);return(0,t.jsxs)(g.BaseDrawer,{open:s,onClose:l,children:[(0,t.jsx)(h.DrawerTitle,{className:"text-foreground text-lg font-bold tracking-tight",children:e.name}),(0,t.jsx)(h.DrawerDescription,{className:"text-muted-foreground mt-1 text-sm",children:e.description}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsxs)("div",{className:"space-y-3",children:[e.version?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.version")}),(0,t.jsxs)("span",{className:"font-mono text-sm",children:["v",e.version]})]}):null,e.category?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.category")}),(0,t.jsx)(p.Badge,{variant:"outline",children:e.category})]}):null,o?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.source")}),(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 inline-flex items-center gap-1 text-sm underline underline-offset-2",children:[e.source.repo??"Repository",(0,t.jsx)(j.ExternalLink,{className:"size-3"})]})]}):null,e.keywords&&e.keywords.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-2",children:e.keywords.map(e=>(0,t.jsx)(p.Badge,{variant:"outline",className:"text-xs",children:e},e))}):null]}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsx)("div",{className:"flex gap-2",children:a?(0,t.jsx)(d.Button,{variant:"destructive",size:"sm",onClick:()=>n?.(e.name),"data-testid":"plugin-uninstall-button",children:r("plugins.uninstall")}):(0,t.jsx)(d.Button,{size:"sm",onClick:()=>i?.(e.name),"data-testid":"plugin-install-button",children:r("plugins.install")})})]})}var y=e.i(96976);let w=(0,y.createServerReference)("004b32674974993d1f73b9d4d1531dd8645e319259",y.callServer,void 0,y.findSourceMapURL,"fetchPluginCatalogAction"),N=(0,y.createServerReference)("7079e10031c0831483fd76842ab90f0d32b86ed15b",y.callServer,void 0,y.findSourceMapURL,"installPluginAction"),k=(0,y.createServerReference)("60611762e0ff2edbeb52de1a638e01b2b2c7599262",y.callServer,void 0,y.findSourceMapURL,"uninstallPluginAction"),C=(0,y.createServerReference)("70cb411e0e055266f834163d0748928989f92e71bb",y.callServer,void 0,y.findSourceMapURL,"togglePluginAction");e.s(["PluginsPageClient",0,function({proxyConfigured:e,isClaudeCode:u}){let{t:p}=(0,m.useTranslation)("web"),[,x]=(0,a.useTransition)(),[g,h]=(0,a.useState)(""),[v,j]=(0,a.useState)(null),[y,S]=(0,a.useState)(null),[P,R]=(0,a.useState)(null),[z,T]=(0,a.useState)([]),[B,D]=(0,a.useState)([]),[E,A]=(0,a.useState)(!0);(0,a.useEffect)(()=>{e?w().then(e=>{T(e.plugins),D(e.installedPlugins),A(!1)}):A(!1)},[e]);let H=(0,a.useMemo)(()=>{let e=new Set;for(let t of z)t.category&&e.add(t.category);return Array.from(e).sort()},[z]),L=(0,a.useMemo)(()=>{let e=g.toLowerCase();return z.filter(t=>{if(v&&t.category!==v)return!1;if(y){let e=!!B.find(e=>e.id.startsWith(`${t.name}@`));if("installed"===y&&!e||"not-installed"===y&&e)return!1}if(e){let a=t.name.toLowerCase().includes(e),s=t.description.toLowerCase().includes(e);if(!a&&!s)return!1}return!0})},[z,g,v,y,B]),M=e=>B.find(t=>t.id.startsWith(`${e}@`)),I=(e,t)=>{x(async()=>{let a=await C(e,"default",t);a.success?(n.toast.success(`${e} ${t?"enabled":"disabled"}`),D((await w()).installedPlugins)):n.toast.error(a.error??"Toggle failed")})};return u?e?E?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"text-muted-foreground text-center text-sm",children:[p("accessibility.loading"),"..."]})]}):0===z.length?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(l.Blocks,{className:"size-10"}),title:p("plugins.emptyState")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.Search,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),(0,t.jsx)(r.Input,{placeholder:p("plugins.searchPlaceholder"),value:g,onChange:e=>h(e.target.value),className:"ps-9","data-testid":"plugin-search"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(d.Button,{variant:null===v?"default":"outline",size:"sm",onClick:()=>j(null),children:p("plugins.allCategories")}),H.map(e=>(0,t.jsx)(d.Button,{variant:v===e?"default":"outline",size:"sm",onClick:()=>j(e===v?null:e),children:e},e))]}),(0,t.jsx)("div",{className:"bg-border h-6 w-px"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(d.Button,{variant:null===y?"default":"outline",size:"sm",onClick:()=>S(null),children:"All Status"}),(0,t.jsx)(d.Button,{variant:"installed"===y?"default":"outline",size:"sm",onClick:()=>S("installed"===y?null:"installed"),children:p("plugins.installed")}),(0,t.jsx)(d.Button,{variant:"not-installed"===y?"default":"outline",size:"sm",onClick:()=>S("not-installed"===y?null:"not-installed"),children:p("plugins.notInstalled")})]})]}),L.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:L.map(e=>(0,t.jsx)(f,{plugin:e,installed:M(e.name),onSelect:R,onToggle:I},e.name))}):(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(s.Search,{className:"size-10"}),title:p("plugins.emptyState"),action:(0,t.jsx)(d.Button,{variant:"outline",onClick:()=>{h(""),j(null),S(null)},children:p("plugins.clearFilters")})}),(0,t.jsx)(b,{plugin:P,installed:P?M(P.name):void 0,open:!!P,onClose:()=>R(null),onInstall:e=>{x(async()=>{let t=await N(e,"default");t.success?(n.toast.success(`${e} installed`),D((await w()).installedPlugins)):n.toast.error(t.error??"Installation failed")})},onUninstall:e=>{x(async()=>{let t=await k(e,"default");t.success?(n.toast.success(`${e} uninstalled`),D((await w()).installedPlugins)):n.toast.error(t.error??"Uninstallation failed")})}})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(i.AlertCircle,{className:"size-10"}),title:p("plugins.noProxy")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(i.AlertCircle,{className:"size-10"}),title:p("plugins.wrongAgent")})]})}],26530)}]);