@shepai/cli 1.144.0-pr458.cd35c8d → 1.145.0-pr452.8b628a7

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 (258) hide show
  1. package/apis/json-schema/Feature.yaml +25 -0
  2. package/apis/json-schema/PullRequest.yaml +11 -0
  3. package/apis/json-schema/SdlcLifecycle.yaml +1 -0
  4. package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts +5 -0
  5. package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -1
  6. package/dist/packages/core/src/application/ports/output/services/git-fork-service.interface.d.ts +79 -0
  7. package/dist/packages/core/src/application/ports/output/services/git-fork-service.interface.d.ts.map +1 -0
  8. package/dist/packages/core/src/application/ports/output/services/git-fork-service.interface.js +31 -0
  9. package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts.map +1 -1
  10. package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.js +5 -0
  11. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
  12. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +10 -0
  13. package/dist/packages/core/src/application/use-cases/features/create/types.d.ts +10 -0
  14. package/dist/packages/core/src/application/use-cases/features/create/types.d.ts.map +1 -1
  15. package/dist/packages/core/src/application/use-cases/features/poll-upstream-pr.use-case.d.ts +23 -0
  16. package/dist/packages/core/src/application/use-cases/features/poll-upstream-pr.use-case.d.ts.map +1 -0
  17. package/dist/packages/core/src/application/use-cases/features/poll-upstream-pr.use-case.js +84 -0
  18. package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.d.ts.map +1 -1
  19. package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.js +2 -0
  20. package/dist/packages/core/src/domain/generated/output.d.ts +33 -0
  21. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  22. package/dist/packages/core/src/domain/generated/output.js +1 -0
  23. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  24. package/dist/packages/core/src/infrastructure/di/container.js +2 -0
  25. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +8 -0
  26. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts.map +1 -1
  27. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.js +18 -0
  28. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/045-add-fork-and-pr-columns.d.ts +13 -0
  29. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/045-add-fork-and-pr-columns.d.ts.map +1 -0
  30. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/045-add-fork-and-pr-columns.js +30 -0
  31. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/046-add-per-feature-workflow-columns.d.ts +12 -0
  32. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/046-add-per-feature-workflow-columns.d.ts.map +1 -0
  33. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/046-add-per-feature-workflow-columns.js +23 -0
  34. package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -1
  35. package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.js +23 -4
  36. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts +25 -0
  37. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts.map +1 -1
  38. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +85 -0
  39. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
  40. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +5 -0
  41. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -1
  42. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +15 -0
  43. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +5 -0
  44. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
  45. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +23 -0
  46. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts +2 -0
  47. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  48. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +50 -0
  49. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +8 -0
  50. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
  51. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +40 -1
  52. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts.map +1 -1
  53. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.js +11 -9
  54. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  55. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +5 -1
  56. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts.map +1 -1
  57. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.js +8 -6
  58. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts.map +1 -1
  59. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.js +11 -9
  60. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts.map +1 -1
  61. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.js +8 -6
  62. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/schemas/spec.schema.d.ts.map +1 -1
  63. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/schemas/spec.schema.js +3 -1
  64. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/schemas/validation.d.ts +1 -0
  65. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/schemas/validation.d.ts.map +1 -1
  66. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/schemas/validation.js +9 -0
  67. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts +5 -0
  68. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
  69. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.js +20 -0
  70. package/dist/packages/core/src/infrastructure/services/git/git-fork.service.d.ts +25 -0
  71. package/dist/packages/core/src/infrastructure/services/git/git-fork.service.d.ts.map +1 -0
  72. package/dist/packages/core/src/infrastructure/services/git/git-fork.service.js +145 -0
  73. package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts +17 -3
  74. package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts.map +1 -1
  75. package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.js +98 -15
  76. package/dist/src/presentation/cli/commands/ui.command.d.ts.map +1 -1
  77. package/dist/src/presentation/cli/commands/ui.command.js +2 -1
  78. package/dist/src/presentation/web/app/actions/create-feature.d.ts +10 -0
  79. package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -1
  80. package/dist/src/presentation/web/app/actions/create-feature.js +8 -1
  81. package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
  82. package/dist/src/presentation/web/app/api/agent-events/route.js +1 -0
  83. package/dist/src/presentation/web/app/build-feature-node-data.d.ts.map +1 -1
  84. package/dist/src/presentation/web/app/build-feature-node-data.js +5 -3
  85. package/dist/src/presentation/web/app/build-graph-nodes.js +5 -3
  86. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.js +1 -1
  87. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +4 -0
  88. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  89. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +24 -7
  90. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +12 -0
  91. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  92. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +35 -0
  93. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +7 -1
  94. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +5 -1
  95. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
  96. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.js +12 -0
  97. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map +1 -1
  98. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +1 -0
  99. package/dist/src/presentation/web/dev-server.js +2 -1
  100. package/dist/tsconfig.build.tsbuildinfo +1 -1
  101. package/package.json +1 -1
  102. package/web/.next/BUILD_ID +1 -1
  103. package/web/.next/build-manifest.json +2 -2
  104. package/web/.next/fallback-build-manifest.json +2 -2
  105. package/web/.next/prerender-manifest.json +3 -3
  106. package/web/.next/required-server-files.js +2 -2
  107. package/web/.next/required-server-files.json +2 -2
  108. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
  109. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  110. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  111. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +28 -28
  112. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  113. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  114. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  115. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  116. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  117. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
  118. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  119. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  120. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  121. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  122. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  123. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +28 -28
  124. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  125. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  126. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  127. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  128. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  129. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
  130. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  131. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  132. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
  133. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  134. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  135. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  136. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  137. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  138. package/web/.next/server/app/_global-error.html +2 -2
  139. package/web/.next/server/app/_global-error.rsc +1 -1
  140. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  141. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  142. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  143. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  144. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  145. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
  146. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  147. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  148. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  149. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  150. package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
  151. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  152. package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
  153. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  154. package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
  155. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  156. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
  157. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
  158. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js +2 -2
  159. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js.map +1 -1
  160. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  161. package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js +1 -1
  162. package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js.map +1 -1
  163. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
  164. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  165. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  166. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js +1 -1
  168. package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js.map +1 -1
  169. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
  170. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +1 -1
  171. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
  172. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
  173. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  174. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
  175. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
  176. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
  177. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
  178. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
  179. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  180. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  181. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
  182. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
  183. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
  184. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
  185. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
  186. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
  187. package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js +3 -0
  188. package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js.map +1 -0
  189. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
  190. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
  191. package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
  192. package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
  193. package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
  194. package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
  195. package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
  196. package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
  197. package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
  198. package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
  199. package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
  200. package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
  201. package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
  202. package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +1 -1
  203. package/web/.next/server/chunks/ssr/{_a1b34bf7._.js → _6601673c._.js} +2 -2
  204. package/web/.next/server/chunks/ssr/{_a1b34bf7._.js.map → _6601673c._.js.map} +1 -1
  205. package/web/.next/server/chunks/ssr/_7dca1882._.js +1 -1
  206. package/web/.next/server/chunks/ssr/_7dca1882._.js.map +1 -1
  207. package/web/.next/server/chunks/ssr/_8fcc39d4._.js +3 -0
  208. package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -0
  209. package/web/.next/server/chunks/ssr/{_3223b0bb._.js → _9bbe1097._.js} +2 -2
  210. package/web/.next/server/chunks/ssr/{_3223b0bb._.js.map → _9bbe1097._.js.map} +1 -1
  211. package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
  212. package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
  213. package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
  215. package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
  216. package/web/.next/server/chunks/ssr/_f39a1adb._.js +1 -1
  217. package/web/.next/server/chunks/ssr/_f39a1adb._.js.map +1 -1
  218. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  219. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  220. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
  221. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
  223. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  225. package/web/.next/server/chunks/ssr/{src_presentation_web_31c9d413._.js → src_presentation_web_bb760f63._.js} +2 -2
  226. package/web/.next/server/chunks/ssr/{src_presentation_web_31c9d413._.js.map → src_presentation_web_bb760f63._.js.map} +1 -1
  227. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
  228. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
  229. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  230. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  231. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  232. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  233. package/web/.next/server/pages/500.html +2 -2
  234. package/web/.next/server/server-reference-manifest.js +1 -1
  235. package/web/.next/server/server-reference-manifest.json +44 -44
  236. package/web/.next/static/chunks/{74ee98538b63a4b2.css → 0b18c50740356276.css} +1 -1
  237. package/web/.next/static/chunks/{010d105c609e1bd6.js → 272969a3ec45bfb1.js} +2 -2
  238. package/web/.next/static/chunks/{2f446e4bf3ebac66.js → 2d74811df2aeea52.js} +1 -1
  239. package/web/.next/static/chunks/{f65b1423092f2a4d.js → 3a870fad0361102a.js} +1 -1
  240. package/web/.next/static/chunks/{e46684da592298f2.js → 3f340791cd48969f.js} +1 -1
  241. package/web/.next/static/chunks/{e5e33ea2dd24ac54.js → 4f69aeac8fb161bb.js} +1 -1
  242. package/web/.next/static/chunks/{17c5af33f87628c6.js → 4fbbaffba82909cc.js} +1 -1
  243. package/web/.next/static/chunks/{2b07e19607643fd1.js → 7026524b541ba6e0.js} +2 -2
  244. package/web/.next/static/chunks/{294094e93d072099.js → 7ca459865dbadc14.js} +1 -1
  245. package/web/.next/static/chunks/831b9f0d3f8c7d0a.js +1 -0
  246. package/web/.next/static/chunks/{9a8245951ae65468.js → a3a4ba7b54a09726.js} +1 -1
  247. package/web/.next/static/chunks/{a1df804f7ad7741d.js → b82119f8bb1d93e3.js} +1 -1
  248. package/web/.next/static/chunks/{470c9f7c774540be.js → d39caafcb2ac4843.js} +1 -1
  249. package/web/.next/static/chunks/fa556c575c788679.js +1 -0
  250. package/web/.next/server/chunks/ssr/[root-of-the-server]__cb850066._.js +0 -3
  251. package/web/.next/server/chunks/ssr/[root-of-the-server]__cb850066._.js.map +0 -1
  252. package/web/.next/server/chunks/ssr/_a9f57758._.js +0 -3
  253. package/web/.next/server/chunks/ssr/_a9f57758._.js.map +0 -1
  254. package/web/.next/static/chunks/4d877165e439230b.js +0 -1
  255. package/web/.next/static/chunks/6a370f2709c81d83.js +0 -1
  256. /package/web/.next/static/{SkQlsizd7DM_CgdpQpBtr → iMG6ZbET-956f-LkX_CmQ}/_buildManifest.js +0 -0
  257. /package/web/.next/static/{SkQlsizd7DM_CgdpQpBtr → iMG6ZbET-956f-LkX_CmQ}/_clientMiddlewareManifest.json +0 -0
  258. /package/web/.next/static/{SkQlsizd7DM_CgdpQpBtr → iMG6ZbET-956f-LkX_CmQ}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/download.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/code.ts","../../../../../../../src/presentation/web/components/common/attachment-chip/attachment-chip.tsx","../../../../../../../src/presentation/web/components/ui/textarea.tsx","../../../../../../../src/presentation/web/components/common/attachment-card/attachment-card.tsx","../../../../../../../src/presentation/web/components/common/feature-create-drawer/pick-files.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/file-text.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/image.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/paperclip.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/file.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-popover%401.1.15_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Brea_6845413866e39bfed03c608b19c71ed1/node_modules/%40radix-ui/react-popover/dist/index.mjs","../../../../../../../src/presentation/web/components/ui/popover.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/chevrons-up-down.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-switch%401.2.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_82f001e3bde9922eaefd6f7b0722a9bb/node_modules/%40radix-ui/react-switch/dist/index.mjs","../../../../../../../src/presentation/web/components/ui/switch.tsx","../../../../../../../src/presentation/web/components/features/settings/AgentModelPicker/index.tsx"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 15V3', key: 'm9g1x1' }],\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', key: 'ih7n3h' }],\n ['path', { d: 'm7 10 5 5 5-5', key: 'brsn70' }],\n];\n\n/**\n * @component @name Download\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTVWMyIgLz4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cGF0aCBkPSJtNyAxMCA1IDUgNS01IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/download\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Download = createLucideIcon('download', __iconNode);\n\nexport default Download;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'm16 18 6-6-6-6', key: 'eg8j8' }],\n ['path', { d: 'm8 6-6 6 6 6', key: 'ppft3o' }],\n];\n\n/**\n * @component @name Code\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTYgMTggNi02LTYtNiIgLz4KICA8cGF0aCBkPSJtOCA2LTYgNiA2IDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/code\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Code = createLucideIcon('code', __iconNode);\n\nexport default Code;\n","/* eslint-disable @next/next/no-img-element -- Local file preview requires raw <img>, not next/image */\n'use client';\n\nimport { X, Loader2Icon, DownloadIcon } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { Dialog, DialogTrigger, DialogContent, DialogTitle } from '@/components/ui/dialog';\nimport { VisuallyHidden } from 'radix-ui';\nimport {\n formatFileSize,\n getFileIcon,\n getFileIconColor,\n} from '@/components/common/attachment-card/attachment-card';\n\nexport interface AttachmentChipProps {\n name: string;\n size: number;\n mimeType: string;\n path: string;\n onRemove: () => void;\n loading?: boolean;\n disabled?: boolean;\n}\n\nconst IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp']);\n\nfunction isImage(name: string): boolean {\n const dot = name.lastIndexOf('.');\n return dot >= 0 && IMAGE_EXTS.has(name.slice(dot).toLowerCase());\n}\n\nfunction previewUrl(path: string, mimeType: string): string {\n const params = new URLSearchParams({ path, mimeType });\n return `/api/attachments/preview?${params.toString()}`;\n}\n\nfunction getExtension(filename: string): string {\n const dot = filename.lastIndexOf('.');\n return dot >= 0 ? filename.slice(dot).toLowerCase() : '';\n}\n\nexport function AttachmentChip({\n name,\n size,\n mimeType,\n path,\n onRemove,\n loading = false,\n disabled = false,\n}: AttachmentChipProps) {\n const ext = getExtension(name);\n const Icon = getFileIcon(ext);\n const iconColorClass = getFileIconColor(ext);\n const imageFile = isImage(name);\n\n if (loading) {\n return (\n <div className=\"flex h-12 w-12 items-center justify-center rounded-md border\">\n <Loader2Icon className=\"text-muted-foreground h-5 w-5 animate-spin\" />\n </div>\n );\n }\n\n if (imageFile) {\n return (\n <Dialog>\n <div className=\"group relative\">\n <DialogTrigger asChild>\n <img\n src={previewUrl(path, mimeType)}\n alt={name}\n title={name}\n className=\"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80\"\n />\n </DialogTrigger>\n {!disabled && (\n <button\n type=\"button\"\n onClick={onRemove}\n className=\"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex\"\n aria-label={`Remove ${name}`}\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n <DialogContent className=\"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90\">\n <VisuallyHidden.Root>\n <DialogTitle>Preview: {name}</DialogTitle>\n </VisuallyHidden.Root>\n <div className=\"relative bg-black/90\">\n <img\n src={previewUrl(path, mimeType)}\n alt={name}\n className=\"h-auto max-h-[70vh] w-full object-contain\"\n />\n </div>\n <div className=\"bg-background flex items-center gap-3 px-4 py-3\">\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-sm font-medium\">{name}</span>\n <span className=\"text-muted-foreground text-xs\">{formatFileSize(size)}</span>\n </div>\n <a\n href={previewUrl(path, mimeType)}\n download={name}\n className=\"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors\"\n aria-label={`Download ${name}`}\n >\n <DownloadIcon className=\"h-4 w-4\" />\n </a>\n </div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return (\n <div className=\"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2\">\n <div\n className={cn(\n 'flex h-6 w-6 shrink-0 items-center justify-center rounded-full',\n iconColorClass\n )}\n >\n <Icon className=\"h-3 w-3\" />\n </div>\n <span className=\"max-w-[120px] truncate text-sm\">{name}</span>\n <span className=\"text-muted-foreground text-xs\">{formatFileSize(size)}</span>\n {!disabled && (\n <button\n type=\"button\"\n onClick={onRemove}\n className=\"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex\"\n aria-label={`Remove ${name}`}\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import type { LucideIcon } from 'lucide-react';\nimport { FileIcon, FileTextIcon, ImageIcon, CodeIcon, Trash2Icon, Loader2Icon } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { Button } from '@/components/ui/button';\n\nexport interface AttachmentCardProps {\n name: string;\n size: number;\n mimeType: string;\n onRemove: () => void;\n loading?: boolean;\n disabled?: boolean;\n /** Optional secondary text shown below the filename (e.g. file path). */\n subtitle?: string;\n}\n\nexport function AttachmentCard({\n name,\n size,\n mimeType: _mimeType,\n onRemove,\n loading = false,\n disabled = false,\n subtitle,\n}: AttachmentCardProps) {\n const ext = getExtension(name);\n const Icon = getFileIcon(ext);\n const iconColorClass = getFileIconColor(ext);\n\n return (\n <div className=\"flex items-center gap-3 rounded-md border p-2\">\n <div\n className={cn('flex h-8 w-8 shrink-0 items-center justify-center rounded', iconColorClass)}\n >\n <Icon className=\"h-4 w-4\" />\n </div>\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-sm font-medium\">{name}</span>\n {subtitle ? (\n <span className=\"text-muted-foreground truncate text-xs\">{subtitle}</span>\n ) : null}\n <span className=\"text-muted-foreground text-xs\">\n {loading ? 'Uploading...' : formatFileSize(size)}\n </span>\n </div>\n {loading ? (\n <Loader2Icon className=\"text-muted-foreground h-4 w-4 animate-spin\" />\n ) : (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n onClick={onRemove}\n disabled={disabled}\n aria-label={`Remove ${name}`}\n >\n <Trash2Icon className=\"h-3 w-3\" />\n </Button>\n )}\n </div>\n );\n}\n\nfunction getExtension(filename: string): string {\n const dot = filename.lastIndexOf('.');\n return dot >= 0 ? filename.slice(dot).toLowerCase() : '';\n}\n\nconst IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp']);\nconst CODE_EXTS = new Set([\n '.ts',\n '.tsx',\n '.js',\n '.jsx',\n '.json',\n '.yaml',\n '.yml',\n '.xml',\n '.html',\n '.css',\n '.md',\n]);\n\nexport function getFileIcon(ext: string): LucideIcon {\n if (IMAGE_EXTS.has(ext)) return ImageIcon;\n if (ext === '.pdf') return FileTextIcon;\n if (CODE_EXTS.has(ext)) return CodeIcon;\n return FileIcon;\n}\n\nexport function getFileIconColor(ext: string): string {\n if (ext === '.pdf') return 'bg-red-50 text-red-600';\n if (IMAGE_EXTS.has(ext)) return 'bg-blue-50 text-blue-600';\n if (CODE_EXTS.has(ext)) return 'bg-emerald-50 text-emerald-600';\n return 'bg-gray-50 text-gray-600';\n}\n\nexport function formatFileSize(bytes: number): string {\n if (bytes === 0) return '0 B';\n const units = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n return `${(bytes / Math.pow(1024, i)).toFixed(i === 0 ? 0 : 1)} ${units[i]}`;\n}\n","import type { FileAttachment } from '@shepai/core/infrastructure/services/file-dialog.service';\n\n/**\n * Opens a native OS file picker dialog via API route.\n * Returns the selected files with metadata, or null if the user cancelled.\n */\nexport async function pickFiles(): Promise<FileAttachment[] | null> {\n const res = await fetch('/api/dialog/pick-files', { method: 'POST' });\n\n if (!res.ok) {\n throw new Error('Failed to open file dialog');\n }\n\n const data: { files: FileAttachment[] | null; cancelled: boolean } = await res.json();\n return data.cancelled ? null : data.files;\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n ['path', { d: 'M10 9H8', key: 'b1mrlr' }],\n ['path', { d: 'M16 13H8', key: 't4e002' }],\n ['path', { d: 'M16 17H8', key: 'z1uh3a' }],\n];\n\n/**\n * @component @name FileText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmg4YTIuNCAyLjQgMCAwIDEgMS43MDQuNzA2bDMuNTg4IDMuNTg4QTIuNCAyLjQgMCAwIDEgMjAgOHYxMmEyIDIgMCAwIDEtMiAyeiIgLz4KICA8cGF0aCBkPSJNMTQgMnY1YTEgMSAwIDAgMCAxIDFoNSIgLz4KICA8cGF0aCBkPSJNMTAgOUg4IiAvPgogIDxwYXRoIGQ9Ik0xNiAxM0g4IiAvPgogIDxwYXRoIGQ9Ik0xNiAxN0g4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-text\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileText = createLucideIcon('file-text', __iconNode);\n\nexport default FileText;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['circle', { cx: '9', cy: '9', r: '2', key: 'af1f0g' }],\n ['path', { d: 'm21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21', key: '1xmnt7' }],\n];\n\n/**\n * @component @name Image\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiByeT0iMiIgLz4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iOSIgcj0iMiIgLz4KICA8cGF0aCBkPSJtMjEgMTUtMy4wODYtMy4wODZhMiAyIDAgMCAwLTIuODI4IDBMNiAyMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/image\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Image = createLucideIcon('image', __iconNode);\n\nexport default Image;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'm16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551',\n key: '1miecu',\n },\n ],\n];\n\n/**\n * @component @name Paperclip\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTYgNi04LjQxNCA4LjU4NmEyIDIgMCAwIDAgMi44MjkgMi44MjlsOC40MTQtOC41ODZhNCA0IDAgMSAwLTUuNjU3LTUuNjU3bC04LjM3OSA4LjU1MWE2IDYgMCAxIDAgOC40ODUgOC40ODVsOC4zNzktOC41NTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/paperclip\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Paperclip = createLucideIcon('paperclip', __iconNode);\n\nexport default Paperclip;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n];\n\n/**\n * @component @name File\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmg4YTIuNCAyLjQgMCAwIDEgMS43MDQuNzA2bDMuNTg4IDMuNTg4QTIuNCAyLjQgMCAwIDEgMjAgOHYxMmEyIDIgMCAwIDEtMiAyeiIgLz4KICA8cGF0aCBkPSJNMTQgMnY1YTEgMSAwIDAgMCAxIDFoNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst File = createLucideIcon('file', __iconNode);\n\nexport default File;\n","\"use client\";\n\n// src/popover.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar POPOVER_NAME = \"Popover\";\nvar [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);\nvar Popover = (props) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: POPOVER_NAME\n });\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n PopoverProvider,\n {\n scope: __scopePopover,\n contentId: useId(),\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n hasCustomAnchor,\n onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),\n onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),\n modal,\n children\n }\n ) });\n};\nPopover.displayName = POPOVER_NAME;\nvar ANCHOR_NAME = \"PopoverAnchor\";\nvar PopoverAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nPopoverAnchor.displayName = ANCHOR_NAME;\nvar TRIGGER_NAME = \"PopoverTrigger\";\nvar PopoverTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const trigger = /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });\n }\n);\nPopoverTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"PopoverPortal\";\nvar [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar PopoverPortal = (props) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nPopoverPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"PopoverContent\";\nvar PopoverContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nPopoverContent.displayName = CONTENT_NAME;\nvar Slot = createSlot(\"PopoverContent.RemoveScroll\");\nvar PopoverContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false }\n ),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nvar PopoverContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar PopoverContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useFocusGuards();\n return /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n \"data-state\": getState(context.open),\n role: \"dialog\",\n id: context.contentId,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-popover-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-popover-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-popover-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-popover-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-popover-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n )\n }\n );\n }\n);\nvar CLOSE_NAME = \"PopoverClose\";\nvar PopoverClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nPopoverClose.displayName = CLOSE_NAME;\nvar ARROW_NAME = \"PopoverArrow\";\nvar PopoverArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nPopoverArrow.displayName = ARROW_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Popover;\nvar Anchor2 = PopoverAnchor;\nvar Trigger = PopoverTrigger;\nvar Portal = PopoverPortal;\nvar Content2 = PopoverContent;\nvar Close = PopoverClose;\nvar Arrow2 = PopoverArrow;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n Close,\n Content2 as Content,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverPortal,\n PopoverTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createPopoverScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { cn } from '@/lib/utils';\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'm7 15 5 5 5-5', key: '1hf1tw' }],\n ['path', { d: 'm7 9 5-5 5 5', key: 'sgt6xg' }],\n];\n\n/**\n * @component @name ChevronsUpDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyAxNSA1IDUgNS01IiAvPgogIDxwYXRoIGQ9Im03IDkgNS01IDUgNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chevrons-up-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronsUpDown = createLucideIcon('chevrons-up-down', __iconNode);\n\nexport default ChevronsUpDown;\n","\"use client\";\n\n// src/switch.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar SWITCH_NAME = \"Switch\";\nvar [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);\nvar [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);\nvar Switch = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSwitch,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n disabled,\n value = \"on\",\n onCheckedChange,\n form,\n ...switchProps\n } = props;\n const [button, setButton] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = button ? form || !!button.closest(\"form\") : true;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: SWITCH_NAME\n });\n return /* @__PURE__ */ jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [\n /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"switch\",\n \"aria-checked\": checked,\n \"aria-required\": required,\n \"data-state\": getState(checked),\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n value,\n ...switchProps,\n ref: composedRefs,\n onClick: composeEventHandlers(props.onClick, (event) => {\n setChecked((prevChecked) => !prevChecked);\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })\n }\n ),\n isFormControl && /* @__PURE__ */ jsx(\n SwitchBubbleInput,\n {\n control: button,\n bubbles: !hasConsumerStoppedPropagationRef.current,\n name,\n value,\n checked,\n required,\n disabled,\n form,\n style: { transform: \"translateX(-100%)\" }\n }\n )\n ] });\n }\n);\nSwitch.displayName = SWITCH_NAME;\nvar THUMB_NAME = \"SwitchThumb\";\nvar SwitchThumb = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSwitch, ...thumbProps } = props;\n const context = useSwitchContext(THUMB_NAME, __scopeSwitch);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-state\": getState(context.checked),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n ...thumbProps,\n ref: forwardedRef\n }\n );\n }\n);\nSwitchThumb.displayName = THUMB_NAME;\nvar BUBBLE_INPUT_NAME = \"SwitchBubbleInput\";\nvar SwitchBubbleInput = React.forwardRef(\n ({\n __scopeSwitch,\n control,\n checked,\n bubbles = true,\n ...props\n }, forwardedRef) => {\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n \"checked\"\n );\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event(\"click\", { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n return /* @__PURE__ */ jsx(\n \"input\",\n {\n type: \"checkbox\",\n \"aria-hidden\": true,\n defaultChecked: checked,\n ...props,\n tabIndex: -1,\n ref: composedRefs,\n style: {\n ...props.style,\n ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n }\n }\n );\n }\n);\nSwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;\nfunction getState(checked) {\n return checked ? \"checked\" : \"unchecked\";\n}\nvar Root = Switch;\nvar Thumb = SwitchThumb;\nexport {\n Root,\n Switch,\n SwitchThumb,\n Thumb,\n createSwitchScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\n\nimport { cn } from '@/lib/utils';\n\nfunction Switch({\n className,\n size = 'default',\n ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root> & {\n size?: 'sm' | 'default';\n}) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n data-size={size}\n className={cn(\n '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',\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n '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'\n )}\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n","'use client';\n\nimport * as React from 'react';\nimport { Check, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { getAllAgentModels } from '@/app/actions/get-all-agent-models';\nimport type { AgentModelGroup } from '@/app/actions/get-all-agent-models';\nimport { updateAgentAndModel } from '@/app/actions/update-agent-and-model';\nimport { getAgentTypeIcon } from '@/components/common/feature-node/agent-type-icons';\nimport { getModelMeta } from '@/lib/model-metadata';\nimport { Button } from '@/components/ui/button';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport interface AgentModelPickerProps {\n initialAgentType: string;\n initialModel: string;\n onAgentModelChange?: (agentType: string, model: string) => void;\n disabled?: boolean;\n className?: string;\n /** 'settings' persists to DB; 'override' only calls onAgentModelChange */\n mode: 'settings' | 'override';\n}\n\nexport function AgentModelPicker({\n initialAgentType,\n initialModel,\n onAgentModelChange,\n disabled,\n className,\n mode,\n}: AgentModelPickerProps) {\n const [open, setOpen] = React.useState(false);\n const [groups, setGroups] = React.useState<AgentModelGroup[]>([]);\n const [loading, setLoading] = React.useState(true);\n const [agentType, setAgentType] = React.useState(initialAgentType);\n const [model, setModel] = React.useState(initialModel);\n const [error, setError] = React.useState<string | null>(null);\n\n // 0 = agent list visible, 1 = model list visible\n const [level, setLevel] = React.useState(0);\n // Which agent's models to show (kept separate from level for animation)\n const [drillAgent, setDrillAgent] = React.useState<string | null>(null);\n\n React.useEffect(() => {\n getAllAgentModels()\n .then(setGroups)\n .finally(() => setLoading(false));\n }, []);\n\n // Reset drill-down when popover closes\n React.useEffect(() => {\n if (!open) {\n const t = setTimeout(() => {\n setLevel(0);\n setDrillAgent(null);\n }, 150);\n return () => clearTimeout(t);\n }\n }, [open]);\n\n const drillInto = (agent: string) => {\n setDrillAgent(agent);\n requestAnimationFrame(() => {\n requestAnimationFrame(() => setLevel(1));\n });\n };\n\n const drillBack = () => {\n setLevel(0);\n setTimeout(() => setDrillAgent(null), 220);\n };\n\n const handleSelect = async (newAgentType: string, newModel: string) => {\n setOpen(false);\n\n if (newAgentType === agentType && newModel === model) return;\n\n if (mode === 'override') {\n setAgentType(newAgentType);\n setModel(newModel);\n onAgentModelChange?.(newAgentType, newModel);\n return;\n }\n\n // mode === 'settings' — optimistically update, then persist\n const prevAgent = agentType;\n const prevModel = model;\n setAgentType(newAgentType);\n setModel(newModel);\n onAgentModelChange?.(newAgentType, newModel);\n\n setError(null);\n try {\n const result = await updateAgentAndModel(newAgentType, newModel || null);\n if (!result.ok) {\n // Revert on failure\n setAgentType(prevAgent);\n setModel(prevModel);\n onAgentModelChange?.(prevAgent, prevModel);\n setError(result.error ?? 'Failed to save');\n }\n } catch {\n setAgentType(prevAgent);\n setModel(prevModel);\n onAgentModelChange?.(prevAgent, prevModel);\n setError('Failed to save');\n }\n };\n\n const isDisabled = (disabled ?? false) || loading;\n\n const AgentIcon = getAgentTypeIcon(agentType);\n const agentLabel = groups.find((g) => g.agentType === agentType)?.label ?? agentType;\n const modelName = model ? getModelMeta(model).displayName || model : null;\n\n const activeGroup = drillAgent ? groups.find((g) => g.agentType === drillAgent) : null;\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n disabled={isDisabled}\n className=\"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30\"\n >\n <span className=\"flex items-center gap-2 truncate\">\n <AgentIcon className=\"h-4 w-4 shrink-0\" />\n {loading ? (\n 'Loading…'\n ) : (\n <span className=\"flex items-center gap-1\">\n <span className=\"text-muted-foreground text-xs\">{agentLabel}</span>\n {modelName ? (\n <>\n <span className=\"text-muted-foreground/50 text-xs\">·</span>\n <span className=\"text-xs font-medium\">{modelName}</span>\n </>\n ) : null}\n </span>\n )}\n </span>\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-(--radix-popover-trigger-width) overflow-hidden p-0\"\n align=\"start\"\n >\n {/* Sliding container — both panels side by side, translateX controlled by level */}\n <div\n className=\"flex transition-transform duration-200 ease-in-out\"\n style={{ transform: `translateX(${level === 1 ? '-50%' : '0%'})`, width: '200%' }}\n >\n {/* ── Level 1: Agent list ── */}\n <div className=\"w-1/2 shrink-0\">\n <div className=\"text-muted-foreground border-b px-3 py-2 text-xs font-medium\">\n Select agent\n </div>\n {groups.map((group) => {\n const GroupIcon = getAgentTypeIcon(group.agentType);\n const isActive = agentType === group.agentType;\n const hasModels = group.models.length > 0;\n\n return (\n <button\n key={group.agentType}\n type=\"button\"\n className={cn(\n 'flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors',\n 'hover:bg-accent hover:text-accent-foreground',\n isActive && 'bg-accent/50'\n )}\n onClick={() => {\n if (hasModels) {\n drillInto(group.agentType);\n } else {\n handleSelect(group.agentType, '');\n }\n }}\n >\n <GroupIcon className=\"h-4 w-4 shrink-0\" />\n <span className=\"flex-1 text-left\">{group.label}</span>\n {isActive && !hasModels ? (\n <Check className=\"text-primary h-3.5 w-3.5 shrink-0\" />\n ) : null}\n {hasModels ? (\n <ChevronRight className=\"text-muted-foreground h-3.5 w-3.5 shrink-0\" />\n ) : null}\n </button>\n );\n })}\n </div>\n\n {/* ── Level 2: Model list for selected agent ── */}\n <div className=\"w-1/2 shrink-0\">\n {activeGroup ? (\n <>\n {/* Back header */}\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors\"\n onClick={drillBack}\n >\n <ChevronLeft className=\"h-3.5 w-3.5\" />\n {activeGroup.label}\n </button>\n\n {/* Model items */}\n {activeGroup.models.map((m) => {\n const isSelected = agentType === activeGroup.agentType && model === m.id;\n return (\n <button\n key={m.id}\n type=\"button\"\n className={cn(\n 'flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors',\n 'hover:bg-accent hover:text-accent-foreground',\n isSelected && 'bg-accent/50'\n )}\n onClick={() => handleSelect(activeGroup.agentType, m.id)}\n >\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"text-xs font-medium\">{m.displayName}</span>\n <span className=\"text-muted-foreground text-xs\">{m.description}</span>\n </div>\n {isSelected ? (\n <Check className=\"text-primary h-3.5 w-3.5 shrink-0\" />\n ) : null}\n </button>\n );\n })}\n </>\n ) : null}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n {Boolean(error) && <p className=\"text-destructive text-sm\">{error}</p>}\n </div>\n );\n}\n"],"names":[],"mappings":"uCAoBA,CAAA,CAAA,CAAA,CAAA,AAAM,CAAN,CAAM,CAAA,EAAW,CAAA,CAAA,CAAA,AAAX,CAAA,AAAW,CAAX,AAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAjBE,CAiBU,AAhB5C,CAgB4C,AAhB3C,CAgB2C,AAhB3C,CAgB2C,AAhB3C,CAAA,AAgB2C,CAAA,AAhB3C,CAAA,AAgB2C,CAhB3C,AAgB2C,CAAA,AAhB3C,AAAQ,CAgBmC,AAhBnC,AAAE,CAgB2C,CAAA,AAhBxC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,AAAZ,CAAY,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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+CACA,GAAc,gBAEhB,QAAS,IAAM,EAAa,EAAY,SAAS,CAAE,EAAE,EAAE,YAEvD,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,yCACb,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,+BAAuB,EAAE,WAAW,GACpD,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,yCAAiC,EAAE,WAAW,MAE/D,EACC,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,KAAK,CAAA,CAAC,UAAU,sCACf,OAfC,EAAE,EAAE,CAkBf,MAEA,gBAKX,CAAQ,GAAU,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAE,UAAU,oCAA4B,MAGlE","ignoreList":[6,7,8,9,10,12,13]}
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,16298,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>r],16868);var a=e.i(20314),s=e.i(31777);function o({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>o],48306);var i=e.i(60253),n=e.i(15506),n=n,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let p=(0,t.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),u=(0,t.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>u],16298);let h=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:t,mimeType:r,path:o,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",P=x.has(N)?h:".pdf"===N?u:f.has(N)?m.default:p,T=".pdf"===N?"bg-red-50 text-red-600":x.has(N)?"bg-blue-50 text-blue-600":f.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&b.has(e.slice(k).toLowerCase());return w?(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,a.jsx)(n.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,a.jsxs)(d.Dialog,{children:[(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)(d.DialogTrigger,{asChild:!0,children:(0,a.jsx)("img",{src:v(o,r),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,a.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,a.jsx)(c.Root,{children:(0,a.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,a.jsx)("div",{className:"relative bg-black/90",children:(0,a.jsx)("img",{src:v(o,r),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,a.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,a.jsx)("a",{href:v(o,r),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,a.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,a.jsx)("div",{className:(0,s.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,a.jsx)(P,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(T,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":H(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=T;var R="PopoverPortal",[A,F]=v(R,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};E.displayName=R;var D="PopoverContent",O=r.forwardRef((e,r)=>{let a=F(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(M,{...o,ref:r})})});O.displayName=D;var I=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(L,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),M=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(L,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":H(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function H(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>E,"PopoverTrigger",()=>S,"Portal",()=>E,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var q=e.i(89920),q=q,G=e.i(31777);let _=q.Root,K=q.Trigger;q.Anchor;let W=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(q.Portal,{children:(0,t.jsx)(q.Content,{ref:o,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));W.displayName=q.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>W,"PopoverTrigger",()=>K],90382)},83843,e=>{"use strict";let t=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>t],83843)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:T,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":v(T),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.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),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.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")})})}e.s(["Switch",()=>y],51911);var C=e.i(23925),k=e.i(11345),N=e.i(76016),P=e.i(92649),T=e.i(60173),S=e.i(86782),R=e.i(29847),A=e.i(35364),F=e.i(90382);function E({initialAgentType:e,initialModel:a,onAgentModelChange:s,disabled:o,className:i,mode:n}){let[l,d]=r.useState(!1),[c,p]=r.useState([]),[u,h]=r.useState(!0),[m,x]=r.useState(e),[f,g]=r.useState(a),[b,v]=r.useState(null),[j,y]=r.useState(0),[E,D]=r.useState(null);r.useEffect(()=>{(0,P.getAllAgentModels)().then(p).finally(()=>h(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{y(0),D(null)},150);return()=>clearTimeout(e)}},[l]);let O=async(e,t)=>{if(d(!1),e!==m||t!==f){if("override"===n){x(e),g(t),s?.(e,t);return}x(e),g(t),s?.(e,t),v(null);try{let r=await (0,T.updateAgentAndModel)(e,t||null);r.ok||(x(m),g(f),s?.(m,f),v(r.error??"Failed to save"))}catch{x(m),g(f),s?.(m,f),v("Failed to save")}}},I=(0,S.getAgentTypeIcon)(m),z=c.find(e=>e.agentType===m)?.label??m,M=f?(0,R.getModelMeta)(f).displayName||f:null,L=E?c.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,w.cn)("flex flex-col gap-1",i),children:[(0,t.jsxs)(F.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(F.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(A.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(o??!1)||u,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(I,{className:"h-4 w-4 shrink-0"}),u?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:M})]}):null]})]})})}),(0,t.jsx)(F.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===j?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,S.getAgentTypeIcon)(e.agentType),a=m===e.agentType,s=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent/50"),onClick:()=>{s?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>y(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),a&&!s?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,s?(0,t.jsx)(N.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{y(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(k.ChevronLeft,{className:"h-3.5 w-3.5"}),L.label]}),L.models.map(e=>{let r=m===L.agentType&&f===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(L.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!b&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:b})]})}e.s(["AgentModelPicker",()=>E],41413)},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("402206447bab52914a6a76670fd2a51d7b7f86a6d9",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868),l=e.i(83843),d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428),m=e.i(31777),x=e.i(8361);e.i(1650);var f=e.i(11495),g=e.i(45811),b=e.i(35364),v=e.i(98127),j=e.i(48306),w=e.i(41957),y=e.i(81846),C=e.i(90382),k=e.i(51911),N=e.i(2828),P=e.i(30153);e.i(50032);var T=e.i(86254),S=e.i(41413),R=e.i(25235),A=e.i(78521);e.i(13322);var F=e.i(61201),E=e.i(75921),D=e.i(38150),O=e.i(42076);let I=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"]),z=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],M={allowPrd:!1,allowPlan:!1,allowMerge:!1};function L({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:v,currentModel:C,initialDescription:R}){let A=(0,x.useSoundAction)("create"),F=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",E=l?.approvalGates??M,D=l?.push??!1,L=l?.openPr??!1,$=l?.ciWatchEnabled!==!1,H=l?.enableEvidence??!1,q=l?.commitEvidence??!1,[G,_]=(0,r.useState)(R??"");(0,r.useEffect)(()=>{R&&_(R)},[R]);let[K,W]=(0,r.useState)([]),[V,X]=(0,r.useState)({...E}),[Y,Z]=(0,r.useState)(D),[J,Q]=(0,r.useState)(L),[ee,et]=(0,r.useState)(l?.ciWatchEnabled!==!1),[er,ea]=(0,r.useState)(H),[es,eo]=(0,r.useState)(q),[ei,en]=(0,r.useState)(void 0),[el,ed]=(0,r.useState)(!1),[ec,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(void 0),[em,ex]=(0,r.useState)(void 0),[ef,eg]=(0,r.useState)(F||void 0),[eb,ev]=(0,r.useState)(u??[]),[ej,ew]=(0,r.useState)(!1),[ey,eC]=(0,r.useState)(null),[ek,eN]=(0,r.useState)(!1),eP=(0,r.useRef)(crypto.randomUUID()),eT=(0,r.useRef)(0),eS=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(X({...l.approvalGates}),Z(l.push),Q(l.openPr),et(!1!==l.ciWatchEnabled),ea(l.enableEvidence),eo(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{ev(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&en(h)},[e,h]);let eR=(0,r.useCallback)(()=>{_(""),W([]),X({...E}),Z(D),Q(L),et($),ea(H),eo(q),en(void 0),eg(F||void 0),ev(u??[]),ed(!1),ep(!1),eh(void 0),ex(void 0),eC(null),eT.current=0,ew(!1)},[E,D,L,H,$,q,F,u]),eA=""!==G.trim()||K.length>0,{attemptClose:eF}=(0,P.useGuardedDrawerClose)({open:e,isDirty:eA,onClose:a,onReset:eR}),eE=(0,r.useCallback)(async e=>{for(let t of(eC(null),e)){if(t.size>0xa00000)return void eC(`"${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&&!I.has(e))return void eC(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();W(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",eP.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let s=await a.json();W(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{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current+=1,1===eT.current&&ew(!0)},[]),eO=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current-=1,0===eT.current&&ew(!1)},[]),eI=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),ez=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current=0,ew(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eE(t)},[eE]),eM=(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(),eE(r))},[eE]),eL=(0,r.useCallback)(e=>{if(e.preventDefault(),!G.trim())return;let t=ef??F;t&&(A.play(),s({description:G.trim(),attachments:K.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:V.allowPrd??!1,allowPlan:V.allowPlan??!1,allowMerge:V.allowMerge??!1},push:Y||J,openPr:J,ciWatchEnabled:ee,enableEvidence:er,commitEvidence:es,fast:el,...ec?{pending:ec}:{},...eu?{agentType:eu}:{},...em?{model:em}:{},...ei?{parentId:ei}:{},sessionId:eP.current}),eR())},[G,K,V,ef,F,s,Y,J,er,ee,es,el,ec,eu,em,ei,A,eR]),eU=(0,r.useCallback)(async()=>{try{let e=await (0,O.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();W(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:eP.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let a=await r.json();W(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{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}}catch{}},[]),eB=(0,r.useCallback)(e=>{W(t=>t.filter(t=>t.id!==e))},[]),e$=(0,r.useRef)(null),eH=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e$.current?.requestSubmit())},[]),eq=(0,r.useCallback)(()=>{eN(!0)},[]),eG=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eS.current?.contains(document.activeElement),t=eS.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eN(!1)},0)},[]),e_=d&&d.length>0,eK=!F&&!ef,eW=!F&&void 0!==u;return(0,t.jsx)(f.BaseDrawer,{open:e,onClose:eF,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)(g.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(g.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(y.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(b.Button,{variant:"outline",onClick:eF,disabled:i,children:"Cancel"}),(0,t.jsx)(b.Button,{type:"submit",form:"create-feature-form",disabled:!G.trim()||i||eK,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(N.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e$,id:"create-feature-form",onSubmit:eL,onKeyDown:eH,className:"flex flex-col gap-4",children:[eW?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(B,{repositories:eb,value:ef,onChange:eg,onAddRepository:e=>{ev(t=>[...t,e]),eg(e.path)},disabled:i})]}):F?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===F)?.name??F.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ej?"true":"false",onDragEnter:eD,onDragLeave:eO,onDragOver:eI,onDrop:ez,className:(0,m.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ej&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(w.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eS,onFocus:eq,onBlur:eG,className:(0,m.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",ek&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(j.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:G,onChange:e=>_(e.target.value),onPaste:eM,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),K.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:K.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eB(e.id),disabled:i,loading:e.loading},e.id))}),ey?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:ey}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(S.AgentModelPicker,{initialAgentType:eu??v??"claude-code",initialModel:em??C??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{eh(e),ex(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"pending-mode",checked:ec,onCheckedChange:ep,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"fast-mode",checked:el,onCheckedChange:ed,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eU,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e_&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(w.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(U,{features:d,value:ei,onChange:en,disabled:i})]}):null,(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)(N.Tooltip,{children:[(0,t.jsx)(N.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:"APPROVE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:z.map(e=>(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:`approve-${e.id}`,size:"sm",checked:V[e.id]??!1,onCheckedChange:t=>X(r=>({...r,[e.id]:t})),disabled:i||el&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(w.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:el&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=z.every(e=>V[e.id]),t={};for(let r of z)t[r.id]=!e;X(t)},disabled:i,className:(0,m.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",z.every(e=>V[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.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:"EVIDENCE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"enable-evidence",size:"sm",checked:er,onCheckedChange:e=>{ea(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"commit-evidence",size:"sm",checked:es,onCheckedChange:eo,disabled:i||!er||!J}),(0,t.jsx)(w.Label,{htmlFor:"commit-evidence",className:(0,m.cn)("cursor-pointer text-xs font-medium",(!er||!J)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:J?er?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"push",size:"sm",checked:Y||J,onCheckedChange:e=>{Z(e),!e&&J&&Q(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"open-pr",size:"sm",checked:J,onCheckedChange:e=>{Q(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"ci-watch",size:"sm",checked:ee,onCheckedChange:et,disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]})]})]})]})]})})})})}function U({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),x=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,f=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(C.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,m.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)})`:"Select parent feature..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.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)(v.Input,{ref:u,placeholder:"Search features...",value:c,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:()=>f(void 0),className:(0,m.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)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===x.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):x.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,m.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)(d.CheckIcon,{className:(0,m.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))]})]})})]})}function B({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,x]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),[b,j]=(0,r.useState)(null),[w,y]=(0,r.useState)(!1),k=(0,r.useRef)(null),{reactFileManager:N}=(0,E.useFeatureFlags)(),P=e.find(e=>e.path===a),T=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,S=(0,r.useCallback)(e=>{s(e),c(!1),x("")},[s]),O=(0,r.useCallback)(async e=>{let t=await (0,D.addRepository)({path:e});if(t.error){j(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),x("")}},[o,s]),I=(0,r.useCallback)(async()=>{if(!f){if(N)return void y(!0);g(!0),j(null);try{let e=await (0,A.pickFolder)();if(!e)return void g(!1);await O(e)}catch{y(!0)}finally{g(!1)}}},[f,N,O]),z=(0,r.useCallback)(async e=>{if(y(!1),e){g(!0),j(null);try{await O(e)}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[O]);return(0,r.useEffect)(()=>{n?setTimeout(()=>k.current?.focus(),0):x("")},[n]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(C.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,m.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",!P&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:P?P.name:"Select repository..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.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)(v.Input,{ref:k,placeholder:"Search repositories...",value:p,onChange:e=>x(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===T.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):T.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>S(e.path),className:(0,m.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)(d.CheckIcon,{className:(0,m.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)(R.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:I,disabled:f,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:[f?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]}),(0,t.jsx)(F.ReactFileManagerDialog,{open:w,onOpenChange:e=>{e||y(!1)},onSelect:z})]})}function $({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u}){let h=(0,a.useRouter)(),[m,x]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),g=!m&&f;(0,r.useEffect)(()=>{!f&&m&&x(!1)},[f,m]);let b=(0,r.useCallback)(()=>{h.push("/")},[h]),v=(0,r.useCallback)(e=>{x(!0),h.push("/"),i(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep: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"),x(!1)})},[h]);return(0,t.jsx)(L,{open:g,onClose:b,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:m,currentAgentType:p,currentModel:u})}e.s(["CreateDrawerClient",()=>$],15203)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},43416,e=>{"use strict";let t=(0,e.i(3645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],43416)},58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var a=e.i(93752);e.s(["Code",()=>a.default],44229)},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,16298,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let a=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>a],16868);var l=e.i(20314),r=e.i(31777);function s({className:e,...t}){return(0,l.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>s],48306);var i=e.i(60253),d=e.i(15506),d=d,o=e.i(95230);e.s(["DownloadIcon",()=>o.default],80436);var o=o,n=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let u=(0,t.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),h=(0,t.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>h],16298);let p=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var x=e.i(93752),x=x;e.i(35364);let m=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function y({name:e,size:t,mimeType:a,path:s,onRemove:y,loading:w=!1,disabled:j=!1}){let k,N,M=(k=e.lastIndexOf("."))>=0?e.slice(k).toLowerCase():"",C=m.has(M)?p:".pdf"===M?h:f.has(M)?x.default:u,T=".pdf"===M?"bg-red-50 text-red-600":m.has(M)?"bg-blue-50 text-blue-600":f.has(M)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",B=(N=e.lastIndexOf("."))>=0&&b.has(e.slice(N).toLowerCase());return w?(0,l.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,l.jsx)(d.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):B?(0,l.jsxs)(n.Dialog,{children:[(0,l.jsxs)("div",{className:"group relative",children:[(0,l.jsx)(n.DialogTrigger,{asChild:!0,children:(0,l.jsx)("img",{src:v(s,a),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!j&&(0,l.jsx)("button",{type:"button",onClick:y,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,l.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,l.jsxs)(n.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,l.jsx)(c.Root,{children:(0,l.jsxs)(n.DialogTitle,{children:["Preview: ",e]})}),(0,l.jsx)("div",{className:"relative bg-black/90",children:(0,l.jsx)("img",{src:v(s,a),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,l.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,l.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,l.jsx)("a",{href:v(s,a),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,l.jsx)(o.default,{className:"h-4 w-4"})})]})]})]}):(0,l.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,l.jsx)("div",{className:(0,r.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,l.jsx)(C,{className:"h-3 w-3"})}),(0,l.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!j&&(0,l.jsx)("button",{type:"button",onClick:y,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,l.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>y],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)}]);