@chorus-aidlc/chorus 0.18.1 → 0.19.0

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 (273) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +183 -183
  3. package/.next/standalone/.next/app-path-routes-manifest.json +33 -33
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +24 -24
  6. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +1 -1
  7. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +1 -1
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +2 -2
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js +2 -2
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +2 -2
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
  40. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  44. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  45. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
  48. package/.next/standalone/.next/server/app/admin/companies/new.rsc +1 -1
  49. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/admin/companies.html +2 -2
  51. package/.next/standalone/.next/server/app/admin/companies.rsc +1 -1
  52. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/admin.html +2 -2
  54. package/.next/standalone/.next/server/app/admin.rsc +1 -1
  55. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/index.html +2 -2
  153. package/.next/standalone/.next/server/app/index.rsc +1 -1
  154. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/login/admin.html +2 -2
  156. package/.next/standalone/.next/server/app/login/admin.rsc +1 -1
  157. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/login/callback.html +2 -2
  159. package/.next/standalone/.next/server/app/login/callback.rsc +1 -1
  160. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  161. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/login/pick-workspace.html +2 -2
  163. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +1 -1
  164. package/.next/standalone/.next/server/app/login.html +2 -2
  165. package/.next/standalone/.next/server/app/login.rsc +1 -1
  166. package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
  167. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  168. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  170. package/.next/standalone/.next/server/app/onboarding.rsc +2 -2
  171. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  172. package/.next/standalone/.next/server/app/projects.html +2 -2
  173. package/.next/standalone/.next/server/app/projects.rsc +2 -2
  174. package/.next/standalone/.next/server/app/settings.html +2 -2
  175. package/.next/standalone/.next/server/app/settings.rsc +3 -3
  176. package/.next/standalone/.next/server/app-paths-manifest.json +33 -33
  177. package/.next/standalone/.next/server/chunks/1318.js +1 -1
  178. package/.next/standalone/.next/server/chunks/1559.js +2 -2
  179. package/.next/standalone/.next/server/chunks/{2195.js → 1683.js} +1 -1
  180. package/.next/standalone/.next/server/chunks/3341.js +1 -0
  181. package/.next/standalone/.next/server/chunks/5453.js +1 -1
  182. package/.next/standalone/.next/server/chunks/5489.js +1 -1
  183. package/.next/standalone/.next/server/chunks/6607.js +1 -0
  184. package/.next/standalone/.next/server/chunks/679.js +1 -1
  185. package/.next/standalone/.next/server/chunks/{2460.js → 7400.js} +1 -1
  186. package/.next/standalone/.next/server/chunks/8185.js +1 -0
  187. package/.next/standalone/.next/server/chunks/{8030.js → 9848.js} +2 -2
  188. package/.next/standalone/.next/server/chunks/9931.js +1 -1
  189. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  190. package/.next/standalone/.next/server/pages/404.html +2 -2
  191. package/.next/standalone/.next/server/pages/500.html +1 -1
  192. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  193. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  194. package/.next/standalone/.next/static/chunks/18751-3616e33050e9611e.js +1 -0
  195. package/.next/standalone/.next/static/chunks/26020-7b4756ba0aa906cf.js +1 -0
  196. package/.next/standalone/.next/static/chunks/{25080-25ad29e64c855338.js → 44437-d13183f50281116f.js} +1 -1
  197. package/.next/standalone/.next/static/chunks/59713-426f81b6576173d8.js +1 -0
  198. package/.next/standalone/.next/static/chunks/60351-bdef539874e5027e.js +1 -0
  199. package/.next/standalone/.next/static/chunks/79919-1e7e294a06f2c4a0.js +1 -0
  200. package/.next/standalone/.next/static/chunks/99733-5a2e39f57fbda32d.js +1 -0
  201. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-072a6b8f0a48b1b6.js +1 -0
  202. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-198a3ff89ae871b9.js +1 -0
  203. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-a506de82e8997714.js +1 -0
  204. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/{page-57c698dea2fa6e29.js → page-dc54fafa22d21863.js} +1 -1
  205. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/{page-d2bb622855e746f1.js → page-6eb5d3cb036a78e0.js} +1 -1
  206. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-69c6f0190623e19b.js +1 -0
  207. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-2a52f747e6fac5a7.js +1 -0
  208. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/{page-46a0ddfd0421b0a8.js → page-22cce567a85ea291.js} +1 -1
  209. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-3a83748ce0ae1c4f.js → page-301f21a3ae52e318.js} +1 -1
  210. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-8af9bb9f96ab0258.js → page-dd123990c14e9768.js} +1 -1
  211. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-548231f8c9856489.js +1 -0
  212. package/.next/standalone/.next/static/chunks/app/onboarding/page-5914ff3d878a3c34.js +1 -0
  213. package/.next/standalone/package.json +1 -1
  214. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  215. package/.next/standalone/public/chorus-plugin/agents/code-reviewer.md +63 -6
  216. package/.next/standalone/public/chorus-plugin/agents/proposal-reviewer.md +60 -6
  217. package/.next/standalone/public/chorus-plugin/agents/task-reviewer.md +75 -8
  218. package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +1 -1
  219. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  220. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +1 -1
  221. package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +1 -1
  222. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +1 -1
  223. package/.next/standalone/public/chorus-plugin/skills/docs/SKILL.md +1 -1
  224. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +1 -1
  225. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
  226. package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +1 -1
  227. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +1 -1
  228. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  229. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
  230. package/.next/standalone/public/chorus-plugin/skills/spec-lite/SKILL.md +1 -1
  231. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +1 -1
  232. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus-code-reviewer.json +56 -1
  233. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus-proposal-reviewer.json +79 -1
  234. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus-task-reviewer.json +56 -1
  235. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
  236. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +1 -1
  237. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +1 -1
  238. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
  239. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +1 -1
  240. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +1 -1
  241. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +1 -1
  242. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +1 -1
  243. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +1 -1
  244. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +1 -1
  245. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-spec-lite/SKILL.md +1 -1
  246. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +1 -1
  247. package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +1 -1
  248. package/.next/standalone/public/skill/code-reviewer-chorus/SKILL.md +60 -4
  249. package/.next/standalone/public/skill/proposal-reviewer-chorus/SKILL.md +58 -5
  250. package/.next/standalone/public/skill/task-reviewer-chorus/SKILL.md +72 -6
  251. package/README.ja.md +3 -1
  252. package/README.ko.md +3 -1
  253. package/README.md +3 -1
  254. package/README.zh.md +3 -1
  255. package/package.json +1 -1
  256. package/.next/standalone/.next/server/chunks/2758.js +0 -1
  257. package/.next/standalone/.next/server/chunks/4066.js +0 -1
  258. package/.next/standalone/.next/server/chunks/7675.js +0 -1
  259. package/.next/standalone/.next/static/chunks/14628-283d3983d1fb36c9.js +0 -1
  260. package/.next/standalone/.next/static/chunks/28698-7fb271ffc6e63a26.js +0 -1
  261. package/.next/standalone/.next/static/chunks/32736-aeaaa1e4c4d5529b.js +0 -1
  262. package/.next/standalone/.next/static/chunks/75257-99c0ce24b436847b.js +0 -1
  263. package/.next/standalone/.next/static/chunks/79919-0c6dcda1dd8646f0.js +0 -1
  264. package/.next/standalone/.next/static/chunks/91328-f501e3c3ca519a92.js +0 -1
  265. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-f3c6431432d42c7c.js +0 -1
  266. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-5d723f974bdad33b.js +0 -1
  267. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-8d3b1f4d8b76d66c.js +0 -1
  268. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-fc255dc3612032b9.js +0 -1
  269. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-f032ee8a80d1f56a.js +0 -1
  270. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-b02939820affdae5.js +0 -1
  271. package/.next/standalone/.next/static/chunks/app/onboarding/page-d2c0c7951114e763.js +0 -1
  272. /package/.next/standalone/.next/static/{dot63ILT878Tloqi7Czj_ → Pmji9kEq8T2lM6AKQkZji}/_buildManifest.js +0 -0
  273. /package/.next/standalone/.next/static/{dot63ILT878Tloqi7Czj_ → Pmji9kEq8T2lM6AKQkZji}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14628],{10977:(e,t,n)=>{n.d(t,{d:()=>a});var r=n(52217);let a=(0,r.createServerReference)("70402b584ffe421700acebba56bbf972745b095cb5",r.callServer,void 0,r.findSourceMapURL,"getCommentsAction")},14628:(e,t,n)=>{n.d(t,{$m:()=>ea});var r=n(90508),a=n(1856),o=n(39268),l=n(94903),i=n(85226),s=n(95886),c=n(36755),u=n(90031),d=n(41816),m=n(97413),p=n(22922),f=n(73693),h=n(91385),x=n(42242),g=n(85783),v=n(99783),w=n(24377),y=n(67712),b=n(42305);function C(e){var t;if(!e)return{pinnedHost:null,pinnedCwd:null};let n=new URLSearchParams(e),r=n.has("cwd"),a=n.has("host");if(!r&&!a)return{pinnedHost:null,pinnedCwd:null};let o=null!=(t=n.get("cwd"))?t:"",l=n.get("host"),i={pinnedCwd:r&&""!==o?o:null,pinnedHost:a?null!=l?l:"":null};return"1"===n.get("runtime")&&(i.runtimeCwd=!0),i}function j(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return"@[".concat(e,"](").concat(t,":").concat(n).concat(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e&&null==t)return"";let r=e=>encodeURIComponent(e).replace(/\(/g,"%28").replace(/\)/g,"%29"),a=[];return a.push("cwd=".concat(null==t?"":r(t))),null!=e&&a.push("host=".concat(r(e))),n&&a.push("runtime=1"),"?".concat(a.join("&"))}(r,a,o),")")}var N=n(78307),E=n(97438);let k=v.A.extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),mentionType:{default:"user",parseHTML:e=>e.getAttribute("data-mention-type")||"user",renderHTML:e=>({"data-mention-type":e.mentionType||"user"})},pinnedHost:{default:null,parseHTML:e=>e.getAttribute("data-pinned-host"),renderHTML:e=>null==e.pinnedHost?{}:{"data-pinned-host":String(e.pinnedHost)}},pinnedCwd:{default:null,parseHTML:e=>e.getAttribute("data-pinned-cwd"),renderHTML:e=>null==e.pinnedCwd?{}:{"data-pinned-cwd":String(e.pinnedCwd)}},runtimeCwd:{default:!1,parseHTML:e=>"true"===e.getAttribute("data-runtime-cwd"),renderHTML:e=>e.runtimeCwd?{"data-runtime-cwd":"true"}:{}}}}});function A(e){let t=e.getJSON();return t.content?t.content.map(e=>(function e(t){if("mention"===t.type){let e=t.attrs;if(e){var n,r;return j(e.label||e.id,e.mentionType||"user",e.id,null!=(n=e.pinnedHost)?n:null,null!=(r=e.pinnedCwd)?r:null,!0===e.runtimeCwd)}return""}if("text"===t.type)return t.text||"";if("hardBreak"===t.type)return"\n";let a=t.content;return a?a.map(e).join(""):""})(e)).join("\n"):""}function R(e){if(!e)return{type:"doc",content:[{type:"paragraph"}]};let t=/@\[([^\]]+)\]\((user|agent):([a-f0-9-]+)(?:\?([^)]*))?\)/g;return{type:"doc",content:e.split("\n").map(e=>{let n,r=[],a=0,o=RegExp(t.source,"g");for(;null!==(n=o.exec(e));){n.index>a&&r.push({type:"text",text:e.slice(a,n.index)});let{pinnedHost:t,pinnedCwd:o,runtimeCwd:l}=C(n[4]);r.push({type:"mention",attrs:{id:n[3],label:n[1],mentionType:n[2],pinnedHost:t,pinnedCwd:o,runtimeCwd:!0===l}}),a=n.index+n[0].length}return a<e.length&&r.push({type:"text",text:e.slice(a)}),{type:"paragraph",content:r.length>0?r:void 0}})}}function S(e,t,n,r,a,o,l){if(a.innerHTML="",t){let e=document.createElement("div");e.className="flex items-center justify-center py-3 px-4",e.innerHTML='<div class="h-4 w-4 animate-spin rounded-full border-2 border-[#9A9A9A] border-t-transparent"></div>',a.appendChild(e);return}if(0===e.length){let e=document.createElement("div");e.className="py-2 px-3 text-xs text-muted-foreground",e.textContent="No results",a.appendChild(e);return}let i=document.createElement("div");i.className="py-1";let s=0,c=e=>{if(l)return void l(e,n);n({id:e.uuid,label:e.name,mentionType:e.type})},u=()=>{i.innerHTML="",e.forEach((e,t)=>{let n=document.createElement("button");n.type="button",n.className="flex w-full items-center gap-2.5 px-3 py-1.5 text-left text-sm transition-colors ".concat(t===s?"bg-background text-foreground":"text-muted-foreground hover:bg-background"),n.onclick=()=>c(e);let r=document.createElement("div");if(r.className="relative shrink-0","agent"===e.type){let t="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=(0,h.Pf)(e.name,t?"static":"animated");if(n){let t=document.createElement("div");t.className="h-6 w-6 overflow-hidden rounded-full bg-muted";let a=document.createElement("img");a.src=n,a.alt=e.name,a.draggable=!1,a.className="h-full w-full origin-top scale-[1.5] -translate-y-[10%]",t.appendChild(a),r.appendChild(t)}else{let e=document.createElement("div");e.className="flex h-6 w-6 items-center justify-center rounded-full bg-primary text-white",e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/></svg>',r.appendChild(e)}}else{let e=document.createElement("div");e.className="flex h-6 w-6 items-center justify-center rounded-full bg-border text-muted-foreground",e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',r.appendChild(e)}if("agent"===e.type&&e.online){let e=document.createElement("span");e.className="absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-[#22C55E] ring-2 ring-white",e.title=o.online,r.appendChild(e)}let a=document.createElement("div");a.className="min-w-0 flex-1";let l=document.createElement("div");if(l.className="truncate text-xs font-medium",l.textContent=e.name,a.appendChild(l),e.email){let t=document.createElement("div");t.className="truncate text-[10px] text-muted-foreground",t.textContent=e.email,a.appendChild(t)}if("agent"===e.type&&e.online){var u;let t=null!=(u=e.activeCount)?u:0,n=document.createElement("div");t>0?(n.className="mt-0.5 truncate text-[10px] font-medium text-[#15803D] dark:text-[#4FD07A]",n.textContent="▶ ".concat(o.activeCount(t))):(n.className="mt-0.5 truncate text-[10px] text-muted-foreground",n.textContent=o.idle),a.appendChild(n)}n.appendChild(r),n.appendChild(a),i.appendChild(n)})};u(),a.appendChild(i),r.current={onKeyDown:t=>{let{event:n}=t;return!(0,b.P)(n)&&("ArrowUp"===n.key?(s=s<=0?e.length-1:s-1,u(),!0):"ArrowDown"===n.key?(s=s>=e.length-1?0:s+1,u(),!0):"Enter"===n.key?(e[s]&&c(e[s]),!0):"Escape"===n.key)}}}function M(e){var t;let{open:n,agentName:l,instances:i,onConfirm:s,onCancel:c}=e,u=(0,o.c)("mentionInstance"),[d,m]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e;n&&m(null!=(e=i[0])?e:null)},[n,i]);let f=new Set(i.map(e=>e.host)).size;return(0,r.jsx)(E.lG,{open:n,onOpenChange:e=>{e||c()},children:(0,r.jsxs)(E.Cf,{className:"z-[110] flex max-h-[85svh] flex-col gap-0 sm:max-w-md",overlayClassName:"z-[110]",children:[(0,r.jsxs)(E.c7,{className:"shrink-0",children:[(0,r.jsx)(E.L3,{children:u("title")}),(0,r.jsx)(E.rr,{children:u("subtitle",{name:l,count:i.length,hosts:f})})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto py-3",onKeyDown:e=>{!("Enter"!==e.key||(0,b.P)(e))&&d&&(e.preventDefault(),s(d))},children:(0,r.jsx)(N.O,{instances:i,selectedConnectionUuid:null!=(t=null==d?void 0:d.connectionUuid)?t:null,onSelect:m,ariaLabel:u("title")})}),(0,r.jsxs)(E.Es,{className:"shrink-0",children:[(0,r.jsx)(p.$,{variant:"ghost",onClick:c,children:u("cancel")}),(0,r.jsx)(p.$,{disabled:!d,onClick:()=>{d&&s(d)},children:u("confirm")})]})]})})}let T=(0,a.forwardRef)((e,t)=>{var n,l;let{value:i,onChange:s,placeholder:c,className:u,disabled:d,onSubmit:m,entityType:p,entityUuid:f}=e,h=(0,a.useRef)([]),v=(0,a.useRef)(!1),C=(0,a.useRef)(null),N=(0,a.useRef)(null),E=(0,a.useRef)(null),T=(0,a.useRef)(null),[,D]=(0,a.useState)(0),_=(0,a.useRef)(!1),U=(0,o.c)("mention"),H=(0,a.useRef)({online:"",offline:"",idle:"",activeCount:()=>""});H.current={online:U("online"),offline:U("offline"),idle:U("idle"),activeCount:e=>U("activeCount",{count:e})};let F=(0,a.useCallback)((e,t)=>{let n="/api/mentionables?q=".concat(encodeURIComponent(e),"&limit=").concat(t,"&withInstances=1");return p&&f&&(n+="&entityType=".concat(encodeURIComponent(p),"&entityUuid=").concat(encodeURIComponent(f))),n},[p,f]),L=function(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(e);r.current=e;let o=(0,a.useCallback)(e=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>r.current(e),250)},[250]);return(0,a.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}((0,a.useCallback)(async e=>{v.current=!0,D(e=>e+1);try{let t=await fetch(F(e,10));if(t.ok){let e=await t.json();e.success&&(h.current=e.data)}}catch(e){h.current=[]}finally{v.current=!1,D(e=>e+1)}},[F]),250),[z,I]=(0,a.useState)(null),O=(0,a.useCallback)((e,t,n)=>{t({id:e.uuid,label:e.name,mentionType:e.type,pinnedHost:n?n.host:null,pinnedCwd:n?n.cwd:null,runtimeCwd:(null==n?void 0:n.runtimeCwd)===!0})},[]),$=(0,a.useRef)(()=>{});$.current=(e,t)=>{var n;let r=function(e){var t;if("agent"===e.type&&e.projectFixedCwd)return{kind:"insert",pin:{host:e.projectFixedCwd.host,cwd:e.projectFixedCwd.cwd,runtimeCwd:!0}};if(e.isIdeaAssignee&&e.ideaPin)return{kind:"insert",pin:{host:e.ideaPin.host,cwd:e.ideaPin.cwd}};let n="agent"===e.type?(null!=(t=e.instances)?t:[]).filter(e=>"online"===e.effectiveStatus):[];return n.length>=2?{kind:"pick",onlineInstances:n}:1===n.length?{kind:"insert",pin:n[0]}:{kind:"insert",pin:null}}(e);if("pick"===r.kind)return void I({item:e,onlineInstances:r.onlineInstances,command:t});O(e,t,null!=(n=r.pin)?n:void 0)};let B=(0,a.useCallback)((e,t)=>$.current(e,t),[]);(0,a.useEffect)(()=>{E.current&&T.current&&S(h.current,v.current,T.current,C,E.current,H.current,B)});let P=(0,x.hG)({immediatelyRender:!1,extensions:[g.A.configure({heading:!1,blockquote:!1,codeBlock:!1,bulletList:!1,orderedList:!1,listItem:!1,horizontalRule:!1}),k.configure({HTMLAttributes:{class:"text-blue-600 font-medium"},renderText(e){var t;let{node:n}=e;return"@".concat(null!=(t=n.attrs.label)?t:n.attrs.id)},suggestion:{char:"@",allowSpaces:!0,items:e=>{let{query:t}=e;return L(t),h.current},render:()=>({onStart:e=>{var t;let n=document.createElement("div");if(n.className="z-[100] rounded-md border border-border bg-card shadow-md min-w-[200px] max-w-[300px] overflow-hidden",E.current=n,T.current=e.command,e.clientRect){let t="function"==typeof e.clientRect?e.clientRect():e.clientRect;t&&(n.style.position="fixed",n.style.left="".concat(t.left,"px"),window.innerHeight-t.bottom<220?n.style.bottom="".concat(window.innerHeight-t.top+4,"px"):n.style.top="".concat(t.bottom+4,"px"))}(null!=(t=N.current)?t:document.body).appendChild(n),S(h.current,v.current,e.command,C,n,H.current,B)},onUpdate:e=>{if(T.current=e.command,E.current&&e.clientRect){let t="function"==typeof e.clientRect?e.clientRect():e.clientRect;t&&(E.current.style.left="".concat(t.left,"px"),window.innerHeight-t.bottom<220?(E.current.style.top="",E.current.style.bottom="".concat(window.innerHeight-t.top+4,"px")):(E.current.style.bottom="",E.current.style.top="".concat(t.bottom+4,"px")))}E.current&&S(h.current,v.current,e.command,C,E.current,H.current,B)},onKeyDown:e=>!!C.current&&C.current.onKeyDown(e),onExit:()=>{var e;null==(e=E.current)||e.remove(),E.current=null,T.current=null,h.current=[],v.current=!1}})}})],content:R(i),editable:!d,editorProps:{attributes:{class:(0,w.cn)("min-h-[36px] max-h-[120px] overflow-y-auto px-3 py-2 text-sm outline-none","prose prose-sm max-w-none [&_p]:my-0"),"data-placeholder":c||""},handleKeyDown:(e,t)=>!(0,b.P)(t)&&"Enter"===t.key&&!t.shiftKey&&!E.current&&!!m&&(t.preventDefault(),m(),!0)},onUpdate:e=>{let{editor:t}=e;_.current=!0,s(A(t))}});(0,a.useEffect)(()=>{if(!P||_.current){_.current=!1;return}A(P)!==i&&P.commands.setContent(R(i))},[i,P]),(0,a.useEffect)(()=>{P&&P.setEditable(!d)},[d,P]);let q=(0,a.useCallback)(e=>{var t;if(!P)return;let n=null!==e.pinnedHost||null!==e.pinnedCwd?{host:null!=(t=e.pinnedHost)?t:"",cwd:e.pinnedCwd,runtimeCwd:!0===e.runtimeCwd}:null,r=function(e,t){var n,r;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=t.type.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=t.uuid.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(RegExp("@\\[[^\\]]+\\]\\(".concat(o,":").concat(l,"(?:\\?[^)]*)?\\)\\s*$"),"i").test(e))return{value:e,appended:!1};let i=j(t.name,t.type,t.uuid,null!=(n=null==a?void 0:a.host)?n:null,null!=(r=null==a?void 0:a.cwd)?r:null,(null==a?void 0:a.runtimeCwd)===!0),s=e.length>0&&!/\s$/.test(e)?" ":"";return{value:"".concat(e).concat(s).concat(i," "),appended:!0}}(A(P),{type:e.mentionType,uuid:e.id,name:e.label},n);r.appended&&P.commands.setContent(R(r.value)),P.commands.focus("end")},[P]),G=(0,a.useCallback)(async e=>{let t=e;if("agent"===e.type){let n=await fetch(F(e.name,50));if(!n.ok)throw Error("Failed to load Agent mention routing");let r=await n.json();if(!r.success||!Array.isArray(r.data))throw Error("Invalid Agent mention routing response");t=function(e,t){let n=t.find(t=>t.type===e.type&&t.uuid===e.uuid);if(!n)throw Error("Reply author is unavailable for mention routing");return n}(e,r.data)}$.current(t,e=>{q(e)})},[F,q]);return(0,a.useImperativeHandle)(t,()=>({focus:()=>null==P?void 0:P.commands.focus(),clear:()=>{null==P||P.commands.clearContent(),s("")},replyToAuthor:G}),[P,s,G]),(0,r.jsxs)("div",{ref:N,className:(0,w.cn)("relative rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow]","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",d&&"cursor-not-allowed opacity-50",u),children:[(0,r.jsx)(x.$Z,{editor:P}),(0,r.jsx)(M,{open:null!==z,agentName:null!=(n=null==z?void 0:z.item.name)?n:"",instances:null!=(l=null==z?void 0:z.onlineInstances)?l:[],onConfirm:e=>{!function(e,t,n){n.close(),e&&n.defer(()=>{try{n.focusEditor(),n.insert(e,t)}catch(e){n.onError(e)}})}(z,e,{close:()=>I(null),insert:(e,t)=>O(e.item,e.command,t),defer:e=>requestAnimationFrame(e),focusEditor:()=>null==P?void 0:P.commands.focus(),onError:e=>y.q.error("MentionEditor: cwd-pinned mention insert failed",e)})},onCancel:()=>I(null)}),(0,r.jsx)("style",{children:"\n .tiptap p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: #9A9A9A;\n float: left;\n height: 0;\n pointer-events: none;\n }\n .tiptap .mention {\n color: #2563eb;\n font-weight: 500;\n }\n "})]})});T.displayName="MentionEditor";var D=n(10977),_=n(52217);let U=(0,_.createServerReference)("702a621be2035de428c30748715a0b309219df4dd9",_.callServer,void 0,_.findSourceMapURL,"createCommentAction"),H=(0,_.createServerReference)("40907c2f19d80c1e0e1c51e133c86e2859fe26b259",_.callServer,void 0,_.findSourceMapURL,"deleteCommentAction");var F=n(11227);let L=/@\[([^\]]+)\]\((user|agent):([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\?([^)]*))?\)/gi,z=/\u200B\u200BMENTION_(\d+)\u200B\u200B/g,I="chorus-mention";function O(e){let{children:t,renderMention:n}=e;if(!t||"string"!=typeof t)return null;if(!new RegExp(L.source,L.flags.replace("g","")).test(t))return(0,r.jsx)("div",{className:"overflow-hidden [&_pre]:overflow-x-auto",children:(0,r.jsx)(F.MarkdownContent,{children:t})});if(n)return(0,r.jsx)($,{renderMention:n,children:t});let{processed:a,mentions:o}=function(e){let t=[],n=new RegExp(L.source,L.flags);return{processed:e.replace(n,(e,n,r,a,o)=>{let l=t.length,{pinnedHost:i,pinnedCwd:s,runtimeCwd:c}=C(o),u={displayName:n,type:r,uuid:a};return(null!==i||null!==s)&&(u.pinnedHost=i,u.pinnedCwd=s,c&&(u.runtimeCwd=!0)),t.push(u),"".concat("​​MENTION_").concat(l).concat("​​")}),mentions:t}}(t);return(0,r.jsx)(B,{mentions:o,children:(0,r.jsx)(F.MarkdownContent,{children:a})})}function $(e){let{children:t,renderMention:n}=e,{processed:o,mentions:l}=a.useMemo(()=>(function(e){let t=[],n=new RegExp(L.source,L.flags);return{processed:e.replace(n,(e,n,r,a,o)=>{let l=t.length,{pinnedHost:i,pinnedCwd:s,runtimeCwd:c}=C(o),u={type:r.toLowerCase(),uuid:a.toLowerCase(),displayName:n};(null!==i||null!==s)&&(u.pinnedHost=i,u.pinnedCwd=s,c&&(u.runtimeCwd=!0)),t.push(u);let d="@".concat(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<".concat(I," ").concat("idx",'="').concat(l,'">').concat(d,"</").concat(I,">")}),mentions:t}})(t),[t]),i=a.useMemo(()=>({[I]:e=>{let{idx:t}=e,a=void 0===t?NaN:parseInt(t,10),o=Number.isInteger(a)?l[a]:void 0;return o?(0,r.jsx)(r.Fragment,{children:n({...o,index:a})}):null}}),[l,n]);return(0,r.jsx)("div",{className:"overflow-hidden [&_pre]:overflow-x-auto",children:(0,r.jsx)(F.MarkdownContent,{components:i,allowedTags:{[I]:["idx"]},literalTagContent:[I],children:o})})}function B(e){let{children:t,mentions:n}=e,o=a.useRef(null);return a.useEffect(()=>{let e;if(!o.current||0===n.length)return;let t=document.createTreeWalker(o.current,NodeFilter.SHOW_TEXT,null),r=[];for(;e=t.nextNode();)z.test(e.textContent||"")&&r.push(e),z.lastIndex=0;for(let e of r){var a;let t,r=e.textContent||"",o=document.createDocumentFragment(),l=0,i=RegExp(z.source,"g");for(;null!==(t=i.exec(r));){t.index>l&&o.appendChild(document.createTextNode(r.slice(l,t.index)));let e=n[parseInt(t[1],10)];if(e){let t=document.createElement("span");t.className="text-blue-600 font-medium",t.title="".concat(e.type,": ").concat(e.uuid),t.textContent="@".concat(e.displayName),o.appendChild(t)}else o.appendChild(document.createTextNode(t[0]));l=t.index+t[0].length}l<r.length&&o.appendChild(document.createTextNode(r.slice(l))),null==(a=e.parentNode)||a.replaceChild(o,e)}},[n]),(0,r.jsx)("div",{ref:o,className:"overflow-hidden [&_pre]:overflow-x-auto",children:t})}var P=n(94643),q=n(63964),G=n(96213),K=n(30423),Q=n(38106),W=n(67587),J=n(66343),V=n(68923),Z=n(51817);let X="(max-width: 639px)";function Y(e){var t;if(!window.matchMedia)return()=>{};let n=window.matchMedia(X);return null==(t=n.addEventListener)||t.call(n,"change",e),()=>{var t;return null==(t=n.removeEventListener)?void 0:t.call(n,"change",e)}}function ee(){var e,t;return!!(null==(e=(t=window).matchMedia)?void 0:e.call(t,X).matches)}function et(e){return"agent"===e.type?(0,r.jsx)(P.Gm,{mention:e,displayName:e.displayName},e.index):(0,r.jsxs)("span",{className:"text-blue-600 font-medium",title:"".concat(e.type,": ").concat(e.uuid),children:["@",e.displayName]},e.index)}function en(e,t){let n=new Map;for(let t of e)n.set(t.uuid,t);for(let e of t)n.set(e.uuid,e);return[...n.values()].sort((e,t)=>e.createdAt!==t.createdAt?e.createdAt<t.createdAt?1:-1:e.uuid<t.uuid?1:-1)}async function er(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=new Set(e.map(e=>e.uuid)),a=[],o=null,l=!1,i=0,s=!1,c=null,u=!1;for(let e=0;e<n;e++){let e=await t(o);if(!e)break;if(u=!0,i=e.total,a.push(...e.comments),s=e.hasMore,c=e.nextCursor,e.comments.some(e=>r.has(e.uuid))||!e.hasMore){l=!0;break}o=e.nextCursor}return u?l?{comments:en(e,a),total:i,contiguous:!0,resetOldestCursor:null,resetHasMore:!1}:{comments:en([],a),total:i,contiguous:!1,resetOldestCursor:c,resetHasMore:s}:null}function ea(e){let{targetType:t,targetUuid:n,currentUserUuid:u,onCountChange:d,compact:m=!1}=e,h=(0,o.c)(),[x,g]=(0,a.useState)(""),[v,w]=(0,a.useState)([]),[y,b]=(0,a.useState)(!0),[C,j]=(0,a.useState)(null),[N,E]=(0,a.useState)(!1),[k,A]=(0,a.useState)(!1),[R,S]=(0,a.useState)(null),[M,_]=(0,a.useState)(!1),[F,L]=(0,a.useState)(0),z=(0,a.useRef)(null),I=(0,a.useRef)(null),O=(0,a.useRef)(new Set),$=(0,a.useRef)(new Set),B=(0,a.useRef)(v);B.current=v;let P=(0,a.useRef)(R);P.current=R;let K=(0,a.useRef)(M);K.current=M;let Q=(0,a.useRef)(N);Q.current=N;let J=(0,a.useRef)(y);J.current=y;let V=m?"h-6 w-6":"h-[30px] w-[30px]",Z=m?"gap-2":"gap-2.5";(0,a.useEffect)(()=>{null==d||d(F)},[F,d]);let X=(0,a.useCallback)(async()=>{b(!0),j(null);let e=await (0,D.d)(t,n,{limit:10});e.success?(w(e.comments),S(e.nextCursor),_(e.hasMore),L(e.total)):j(e.error),b(!1)},[t,n]);(0,a.useEffect)(()=>{X()},[X]);let Y=(0,a.useCallback)(async()=>{if(Q.current||J.current||!K.current||!P.current)return;E(!0);let e=await (0,D.d)(t,n,{cursor:P.current,limit:10});e.success&&(w(t=>en(t,e.comments)),S(e.nextCursor),_(e.hasMore),L(e.total)),E(!1)},[t,n]);(0,a.useEffect)(()=>{let e=I.current;if(!e)return;let t=new IntersectionObserver(e=>{var t;(null==(t=e[0])?void 0:t.isIntersecting)&&Y()},{rootMargin:"120px"});return t.observe(e),()=>t.disconnect()},[Y,y]),(0,q.w0)(t,n,e=>{u&&e.actorUuid===u||er(B.current,async e=>{let r=await (0,D.d)(t,n,{cursor:e,limit:10});return r.success?r:null}).then(e=>{e&&(w(e.comments),L(e.total),e.contiguous||(S(e.resetOldestCursor),_(e.resetHasMore)))})});let ee=async()=>{if(!x.trim()||k)return;A(!0);let e=await U(t,n,x);if(A(!1),e.success){var r;let t=!B.current.some(t=>t.uuid===e.comment.uuid);w(t=>en(t,[e.comment])),t&&L(e=>e+1),g(""),null==(r=z.current)||r.clear()}else W.oR.error(e.error)},et=(0,a.useCallback)(e=>{var t;null==(t=z.current)||t.replyToAuthor(e).catch(()=>{W.oR.error(h("comments.replyFailed"))})},[h]),ea=(0,a.useCallback)(async e=>{if($.current.has(e))return!0;if(O.current.has(e))return!1;O.current.add(e);try{if(!(await H(e)).success)return W.oR.error(h("comments.deleteFailed")),!1;if($.current.add(e),B.current.some(t=>t.uuid===e)){let t=B.current.filter(t=>t.uuid!==e);B.current=t,w(t),L(e=>Math.max(0,e-1))}return!0}finally{O.current.delete(e)}},[h]);return(0,r.jsx)(G.D,{entityType:t,entityUuid:n,subEntityType:"comment",children:(0,r.jsxs)("div",{className:"flex flex-col gap-0",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(Z," pb-3 border-b border-[#F0EDE8] dark:border-[#26241f]"),children:[(0,r.jsx)(f.eu,{className:"".concat(m?"h-6 w-6":"h-7 w-7"," shrink-0"),children:(0,r.jsx)(f.q5,{className:"bg-border text-muted-foreground",children:(0,r.jsx)(l.A,{className:"".concat(m?"h-3 w-3":"h-3.5 w-3.5")})})}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)(T,{ref:z,value:x,onChange:g,onSubmit:ee,placeholder:h("comments.addComment"),className:"border border-border bg-card text-sm rounded-lg",disabled:k,entityType:t,entityUuid:n})}),(0,r.jsx)(p.$,{size:"sm",className:"shrink-0 gap-1 bg-[#E07A5F] text-white hover:bg-[#D06A4F]",disabled:!x.trim()||k,onClick:ee,children:k?(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(s.A,{className:"h-3.5 w-3.5"})})]}),y?(0,r.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,r.jsx)(i.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):C?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,r.jsx)(c.A,{className:"h-4 w-4"}),(0,r.jsx)("p",{children:h("comments.loadError")}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:X,children:h("comments.retry")})]}):0===v.length?(0,r.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground italic",children:h("comments.noComments")}):(0,r.jsxs)("div",{children:[v.map(e=>(0,r.jsx)(el,{comment:e,compact:m,avatarSize:V,gap:Z,t:h,currentUserUuid:u,onReply:et,onDelete:ea},e.uuid)),(0,r.jsx)("div",{ref:I,"aria-hidden":"true"}),N?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(i.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:h("comments.loadingMore")})]}):!M&&(0,r.jsx)("p",{className:"py-4 text-center text-xs text-muted-foreground italic",children:h("comments.noMoreComments")})]})]})})}function eo(e){let{author:t,canDelete:n,t:o,onReply:l,onDelete:s}=e,c=(0,a.useSyncExternalStore)(Y,ee,()=>!1),[f,h]=(0,a.useState)(!1),[x,g]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),y=(0,a.useRef)(null),b=(0,a.useRef)(!1),C=e=>{if(e.preventDefault(),!b.current){var t;null==(t=y.current)||t.focus()}b.current=!1},j=e=>{b.current=!0,h(!1);let t=()=>e();"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,0)},N=(0,r.jsx)(p.$,{ref:y,type:"button",variant:"ghost",size:"icon",className:"relative -my-1 size-6 shrink-0 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground before:absolute before:-inset-2.5 before:content-[''] sm:before:hidden","aria-label":o("comments.actionsLabel",{name:t.name}),children:(0,r.jsx)(u.A,{className:"size-4","aria-hidden":!0})}),E=()=>j(l),k=()=>j(()=>g(!0));return(0,r.jsxs)(r.Fragment,{children:[c?(0,r.jsxs)(V.cj,{open:f,onOpenChange:h,children:[(0,r.jsx)(V.CG,{asChild:!0,children:N}),(0,r.jsxs)(V.h,{side:"bottom","data-comment-actions-variant":"mobile",className:"max-h-[min(82svh,32rem)] gap-0 overflow-hidden rounded-t-2xl pb-[max(1rem,env(safe-area-inset-bottom))]",onCloseAutoFocus:C,children:[(0,r.jsx)("div",{className:"mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-muted-foreground/25","aria-hidden":!0}),(0,r.jsxs)(V.Fm,{className:"border-b px-4 pt-3 pb-3 text-left",children:[(0,r.jsx)(V.qp,{children:o("comments.actionsTitle")}),(0,r.jsx)(V.Qs,{children:o("comments.actionsDescription",{name:t.name})})]}),(0,r.jsxs)("div",{className:"overflow-y-auto overscroll-contain px-2 py-2",children:[(0,r.jsxs)(p.$,{type:"button",variant:"ghost",className:"min-h-11 w-full justify-start gap-3 rounded-lg px-3 text-sm",onClick:E,children:[(0,r.jsx)(d.A,{className:"size-5","aria-hidden":!0}),o("comments.reply")]}),n&&(0,r.jsx)("div",{className:"mt-1 border-t pt-1",children:(0,r.jsxs)(p.$,{type:"button",variant:"ghost",className:"min-h-11 w-full justify-start gap-3 rounded-lg px-3 text-sm text-destructive hover:bg-destructive/10 hover:text-destructive focus-visible:text-destructive",onClick:k,children:[(0,r.jsx)(m.A,{className:"size-5","aria-hidden":!0}),o("comments.delete")]})})]})]})]}):(0,r.jsxs)(J.rI,{open:f,onOpenChange:h,children:[(0,r.jsx)(J.ty,{asChild:!0,children:N}),(0,r.jsxs)(J.SQ,{align:"end","data-comment-actions-variant":"desktop",className:"z-[100] w-44",onCloseAutoFocus:C,children:[(0,r.jsxs)(J._2,{onSelect:E,children:[(0,r.jsx)(d.A,{"aria-hidden":!0}),o("comments.reply")]}),n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J.mB,{}),(0,r.jsxs)(J._2,{variant:"destructive",onSelect:k,children:[(0,r.jsx)(m.A,{"aria-hidden":!0}),o("comments.delete")]})]})]})]}),(0,r.jsx)(Z.Lt,{open:x,onOpenChange:e=>{v||g(e)},children:(0,r.jsxs)(Z.EO,{className:"z-[120]",overlayClassName:"z-[120]",onCloseAutoFocus:e=>{var t;e.preventDefault(),null==(t=y.current)||t.focus()},children:[(0,r.jsxs)(Z.wd,{children:[(0,r.jsx)(Z.r7,{children:o("comments.deleteTitle")}),(0,r.jsx)(Z.$v,{children:o("comments.deleteDescription")})]}),(0,r.jsxs)(Z.ck,{children:[(0,r.jsx)(Z.Zr,{disabled:v,children:o("common.cancel")}),(0,r.jsxs)(Z.Rx,{variant:"destructive",disabled:v,onClick:async e=>{e.preventDefault(),w(!0);let t=await s();w(!1),t&&g(!1)},children:[v&&(0,r.jsx)(i.A,{className:"animate-spin","aria-hidden":!0}),o("comments.deleteConfirm")]})]})]})})]})}function el(e){var t;let{comment:n,compact:o,avatarSize:l,gap:i,t:s,currentUserUuid:c,onReply:u,onDelete:d}=e,[m,x]=(0,a.useState)(!1),g="agent"===n.author.type,v=!!c&&("user"===n.author.type&&n.author.uuid===c||"agent"===n.author.type&&(null==(t=n.author.owner)?void 0:t.uuid)===c),w=g?(0,K.j)(n.author.name):null,y=n.content.length>200,b=w?"".concat(w,"18"):void 0;return(0,r.jsxs)("div",{className:"flex ".concat(i," py-3 border-b border-[#F0EDE8] dark:border-[#26241f] last:border-b-0"),children:[g?(0,r.jsx)(h.AgentAvatar,{name:n.author.name,size:o?24:30,className:"shrink-0 rounded-full"}):(0,r.jsx)(f.eu,{className:"".concat(l," shrink-0"),children:(0,r.jsx)(f.q5,{className:"bg-border text-muted-foreground text-[11px] font-medium",children:n.author.name.charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[(0,r.jsx)("span",{className:"".concat(o?"text-xs":"text-[13px]"," font-semibold text-[#1A1A1A] dark:text-[#CFCFCF]"),children:n.author.name}),(0,r.jsx)("span",{style:g?{backgroundColor:b,color:null!=w?w:void 0}:void 0,className:"inline-flex items-center rounded px-1.5 py-px text-[9px] font-medium ".concat(g?"":"bg-[#F0EDE8] dark:bg-[#1f1e1c] text-muted-foreground"),children:s(g?"comments.roleAgent":"comments.roleHuman")}),(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:function(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),a=Math.floor(r/6e4),o=Math.floor(r/36e5),l=Math.floor(r/864e5);return a<1?t("time.justNow"):a<60?t("time.minutesAgo",{minutes:a}):o<24?t("time.hoursAgo",{hours:o}):l<7?t("time.daysAgo",{days:l}):(0,Q.r)(n)}(n.createdAt,s)})]}),(0,r.jsx)(eo,{author:{type:g?"agent":"user",uuid:n.author.uuid,name:n.author.name},canDelete:v,t:s,onReply:()=>u({type:g?"agent":"user",uuid:n.author.uuid,name:n.author.name}),onDelete:()=>d(n.uuid)})]}),g&&n.author.owner&&(0,r.jsx)("div",{className:"flex items-center gap-1 mt-0.5",children:(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground italic",children:s("comments.onBehalfOf",{name:n.author.owner.name})})}),(0,r.jsx)("div",{className:"mt-1 ".concat(o?"text-xs":"text-[13px]"," leading-relaxed text-[#3D3D3D] dark:text-[#d8d2ca] max-w-none [&_h1]:text-sm [&_h1]:font-semibold [&_h1]:mt-2 [&_h1]:mb-1 [&_h2]:text-[13px] [&_h2]:font-semibold [&_h2]:mt-2 [&_h2]:mb-1 [&_h3]:text-[13px] [&_h3]:font-semibold [&_h3]:mt-1.5 [&_h3]:mb-0.5 [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0.5 [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_a]:text-primary [&_pre]:bg-secondary [&_pre]:text-foreground"),children:y&&!m?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{renderMention:et,children:n.content.slice(0,200)+"..."}),(0,r.jsx)(p.$,{variant:"link",size:"sm",onClick:()=>x(!0),className:"h-auto p-0 text-[#E07A5F] dark:text-[#F0A088] text-xs font-medium mt-1",children:s("comments.showMore")})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{renderMention:et,children:n.content}),y&&(0,r.jsx)(p.$,{variant:"link",size:"sm",onClick:()=>x(!1),className:"h-auto p-0 text-[#E07A5F] dark:text-[#F0A088] text-xs font-medium mt-1",children:s("comments.showLess")})]})})]})]})}},30423:(e,t,n)=>{n.d(t,{j:()=>a});let r=["#E06C75","#E5C07B","#98C379","#56B6C2","#61AFEF","#C678DD","#D19A66","#BE5046","#7EC8E3","#C3E88D","#F78C6C","#A9DC76"];function a(e){let t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}(e)%r.length;return r[t]}},38106:(e,t,n)=>{function r(e){let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return"".concat(n,"-").concat(r,"-").concat(a," ").concat(o,":").concat(l)}function a(e,t){let n="string"==typeof e?new Date(e):e;return isNaN(n.getTime())?"":n.toLocaleDateString(t,{month:"short",day:"numeric"})}n.d(t,{r:()=>r,s:()=>a})},47754:(e,t,n)=>{n.d(t,{fv:()=>h,xQ:()=>x});var r=n(1856),a=n(63964);let o=new Map,l=new Map,i=new Map,s=new Set,c=0;function u(e,t,n,r){return n?r?"".concat(e,":").concat(t,":").concat(n,":").concat(r):"".concat(e,":").concat(t,":").concat(n):"".concat(e,":").concat(t)}function d(){c++,s.forEach(e=>e())}function m(e){var t;let n=e.subEntityType,r=e.subEntityUuid,a=u(e.entityType,e.entityUuid,n,r),s=function(e,t,n,r,a){let o=u(e,t,r,a);return"".concat(o,":").concat(n)}(e.entityType,e.entityUuid,e.agentUuid,n,r),c=l.get(s);if(c&&Date.now()-c<3e3)return;l.set(s,Date.now());let m={agentUuid:e.agentUuid,agentName:e.agentName,action:e.action,timestamp:Date.now()},p=(null!=(t=o.get(a))?t:[]).filter(t=>t.agentUuid!==e.agentUuid);p.push(m),o.set(a,p);let f=i.get(s);f&&clearTimeout(f);let h=setTimeout(()=>{let t=o.get(a);if(t){let n=t.filter(t=>t.agentUuid!==e.agentUuid);0===n.length?o.delete(a):o.set(a,n)}l.delete(s),i.delete(s),d()},3e3);i.set(s,h),d()}function p(){return c}function f(e){return s.add(e),()=>{s.delete(e)}}function h(e){m({type:"presence",companyUuid:"",projectUuid:"",...e,timestamp:Date.now()})}function x(){return(0,r.useSyncExternalStore)(f,p,p),(0,a.S2)(m),{getPresence:(e,t,n,r)=>{if(n){var a;return null!=(a=o.get(u(e,t,n,r)))?a:[]}let l="".concat(e,":").concat(t),i=new Map;for(let[e,t]of o)if(e===l||e.startsWith(l+":"))for(let e of t){let t=i.get(e.agentUuid);(!t||e.timestamp>t.timestamp)&&i.set(e.agentUuid,e)}return[...i.values()]}}}},63964:(e,t,n)=>{n.d(t,{S2:()=>u,eV:()=>c,l9:()=>s,tS:()=>i,w0:()=>d});var r=n(90508),a=n(1856);n(91814);var o=n(95126);let l=(0,a.createContext)(null);function i(e){let{projectUuid:t,children:n}=e,i=(0,o.jj)(),s=null==i?void 0:i.subscribe,c=null==i?void 0:i.openGeneration,u=(0,a.useRef)(new Set),d=(0,a.useRef)(new Set),m=(0,a.useRef)(new Set),p=(0,a.useRef)(new Set),f=(0,a.useCallback)(()=>{u.current.forEach(e=>e())},[]),h=(0,a.useCallback)(e=>{d.current.forEach(t=>t(e))},[]),x=(0,a.useCallback)(()=>{for(let e of(f(),["task","idea","proposal","document","project","project_group"]))h({companyUuid:"",projectUuid:"",entityType:e,entityUuid:"",action:"updated"})},[f,h]);(0,a.useEffect)(()=>{let e,n,r=null,a=!1,o=0,l={};function i(n){if("presence"===n.type){if(t&&n.projectUuid!==t)return;m.current.forEach(e=>e(n));return}if("execution"===n.type)return void p.current.forEach(e=>e(n));if("string"!=typeof n.entityType||"string"!=typeof n.entityUuid||"string"!=typeof n.action||t&&n.projectUuid!==t)return;clearTimeout(e);let r=Date.now(),a=r-o;a>=3e3?(o=r,f()):e=setTimeout(()=>{o=Date.now(),f()},Math.max(1e3,3e3-a));let i=n.entityType;clearTimeout(l[i]),l[i]=setTimeout(()=>{h(n)},300)}function c(){u(),(r=new EventSource(t?"/api/events?projectUuid=".concat(encodeURIComponent(t)):"/api/events")).onopen=()=>{a&&x(),a=!0},r.onmessage=e=>{let t=null;try{t=JSON.parse(e.data)}catch(e){return}t&&i(t)},r.onerror=()=>{}}function u(){r&&(r.close(),r=null)}function d(){"visible"===document.visibilityState&&(r&&r.readyState!==EventSource.CLOSED||c())}return s?n=s(i):(c(),document.addEventListener("visibilitychange",d)),()=>{for(let t in null==n||n(),u(),clearTimeout(e),l)clearTimeout(l[t]);document.removeEventListener("visibilitychange",d)}},[t,s,f,h,x]);let g=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(s&&c){if(null===g.current){g.current=c;return}c>g.current&&(g.current=c,x())}},[s,c,x]);let v=(0,a.useCallback)(e=>(u.current.add(e),()=>{u.current.delete(e)}),[]),w=(0,a.useCallback)(e=>(d.current.add(e),()=>{d.current.delete(e)}),[]),y=(0,a.useCallback)(e=>(m.current.add(e),()=>{m.current.delete(e)}),[]),b=(0,a.useCallback)(e=>(p.current.add(e),()=>{p.current.delete(e)}),[]),C=(0,a.useMemo)(()=>({subscribe:v,subscribeEntity:w,subscribePresence:y,subscribeExecution:b}),[v,w,y,b]);return(0,r.jsx)(l.Provider,{value:C,children:n})}function s(e){let t=(0,a.useContext)(l),n=(0,a.useRef)(e);n.current=e,(0,a.useEffect)(()=>{if(!t)return;let e=()=>n.current();return e(),t.subscribe(e)},[t])}function c(e,t){let n=(0,a.useContext)(l),r=(0,a.useRef)(t);r.current=t;let o=(0,a.useRef)(e);o.current=e,(0,a.useEffect)(()=>{if(n)return n.subscribeEntity(e=>{let t=o.current;(Array.isArray(t)?t.includes(e.entityType):e.entityType===t)&&r.current(e)})},[n])}function u(e){let t=(0,a.useContext)(l),n=(0,a.useRef)(e);n.current=e,(0,a.useEffect)(()=>{if(t)return t.subscribePresence(e=>n.current(e))},[t])}function d(e,t,n){let r=(0,a.useContext)(l),o=(0,a.useRef)(n);o.current=n,(0,a.useEffect)(()=>{if(r)return r.subscribeEntity(n=>{n.entityType===e&&n.entityUuid===t&&o.current(n)})},[r,e,t])}},66343:(e,t,n)=>{n.d(t,{Hr:()=>f,Ht:()=>d,SQ:()=>c,_2:()=>u,lp:()=>m,mB:()=>p,rI:()=>i,ty:()=>s});var r=n(90508);n(1856);var a=n(97964),o=n(39025),l=n(24377);function i(e){let{...t}=e;return(0,r.jsx)(o.Root,{"data-slot":"dropdown-menu",...t})}function s(e){let{...t}=e;return(0,r.jsx)(o.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function c(e){let{className:t,sideOffset:n=4,...a}=e;return(0,r.jsx)(o.Portal,{children:(0,r.jsx)(o.Content,{"data-slot":"dropdown-menu-content",sideOffset:n,className:(0,l.cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","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",t),...a})})}function u(e){let{className:t,inset:n,variant:a="default",...i}=e;return(0,r.jsx)(o.Item,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":a,className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive","data-[inset]:pl-8 [&_svg]:size-4",t),...i})}function d(e){let{className:t,children:n,...i}=e;return(0,r.jsxs)(o.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",t),...i,children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(o.ItemIndicator,{children:(0,r.jsx)(a.A,{className:"size-2 fill-current"})})}),n]})}function m(e){let{className:t,inset:n,...a}=e;return(0,r.jsx)(o.Label,{"data-slot":"dropdown-menu-label","data-inset":n,className:(0,l.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...a})}function p(e){let{className:t,...n}=e;return(0,r.jsx)(o.Separator,{"data-slot":"dropdown-menu-separator",className:(0,l.cn)("bg-border -mx-1 my-1 h-px",t),...n})}function f(e){let{...t}=e;return(0,r.jsx)(o.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}},96213:(e,t,n)=>{n.d(t,{D:()=>i});var r=n(90508),a=n(47754),o=n(30423),l=n(91385);function i(e){let{entityType:t,entityUuid:n,subEntityType:l,subEntityUuid:i,children:c,badgeInside:u}=e,{getPresence:d}=(0,a.xQ)(),m=d(t,n,l,i),p=m.length>0,f=p&&m.some(e=>"mutate"===e.action),h=p?f?m.find(e=>"mutate"===e.action):m[m.length-1]:null,x=h?(0,o.j)(h.agentName):"transparent";return(0,r.jsxs)("div",{className:"relative",style:p?{outline:"2px ".concat(f?"solid":"dashed"," ").concat(x),outlineOffset:"-2px",borderRadius:"var(--radius)"}:void 0,children:[p&&(0,r.jsxs)("div",{className:"absolute flex gap-1 z-10 justify-end ".concat(u?"top-0.5 right-1.5 max-w-[70%]":"-top-2.5 right-2 max-w-[80%]"),children:[m.slice(0,3).map(e=>(0,r.jsx)(s,{entry:e},e.agentUuid)),m.length>3&&(0,r.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium text-white bg-gray-500 whitespace-nowrap",children:["+",m.length-3]})]}),c]})}function s(e){let{entry:t}=e,n=(0,o.j)(t.agentName);return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium text-white whitespace-nowrap animate-in fade-in duration-300 ease-out sm:text-[11px] sm:px-2",style:{backgroundColor:n},children:[(0,r.jsx)(l.AgentAvatar,{name:t.agentName,size:14,className:"rounded-full"}),t.agentName]})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28698],{2765:(e,s,t)=>{"use strict";t.d(s,{I:()=>n});var a=t(52217);let n=(0,a.createServerReference)("40f942231432fab310cf8637cacb8ba355a7dc081f",a.callServer,void 0,a.findSourceMapURL,"createAgentAndKeyAction")},10465:(e,s,t)=>{"use strict";t.d(s,{m:()=>m});var a=t(90508),n=t(81235),r=t(75320),i=t(39268),l=t(22922),o=t(32277),c=t(24377);let d="https://doc.chorus-ai.dev";function m(e){let{variant:s="inline",className:t}=e,m=(0,i.c)("resourceLinks"),{locale:u}=(0,o.Y)(),x="en"===u?d:"".concat(d,"/").concat(u);return(0,a.jsxs)("div",{className:(0,c.cn)("flex flex-wrap items-center gap-2","footer"===s&&"justify-center gap-3",t),children:[(0,a.jsx)(l.$,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsxs)("a",{href:"https://github.com/Chorus-AIDLC/Chorus",target:"_blank",rel:"noopener noreferrer","aria-label":m("githubAria"),children:[(0,a.jsx)(n.A,{className:"h-4 w-4"}),m("github")]})}),(0,a.jsx)(l.$,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsxs)("a",{href:x,target:"_blank",rel:"noopener noreferrer","aria-label":m("docsAria"),children:[(0,a.jsx)(r.A,{className:"h-4 w-4"}),m("docs")]})})]})}},15272:(e,s,t)=>{var a={"./en.json":[99373,99373],"./ja.json":[11595,11595],"./ko.json":[33456,33456],"./zh.json":[4860,4860]};function n(e){if(!t.o(a,e))return Promise.resolve().then(()=>{var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s});var s=a[e],n=s[0];return t.e(s[1]).then(()=>t.t(n,19))}n.keys=()=>Object.keys(a),n.id=15272,e.exports=n},25359:(e,s,t)=>{"use strict";t.d(s,{AL:()=>i,IB:()=>a,L$:()=>r,q:()=>n});let a=["en","zh","ko","ja"],n="en",r={en:"English",zh:"中文",ko:"한국어",ja:"日本語"};function i(){if("undefined"==typeof navigator)return n;let e=navigator.language.split("-")[0];return a.includes(e)?e:n}},32277:(e,s,t)=>{"use strict";t.d(s,{LocaleProvider:()=>m,Y:()=>d});var a=t(90508),n=t(1856),r=t(57472),i=t(25359),l=t(67712);let o="chorus-locale",c=(0,n.createContext)(null);function d(){let e=(0,n.useContext)(c);if(!e)throw Error("useLocale must be used within LocaleProvider");return e}function m(e){let{children:s}=e,[d,m]=(0,n.useState)(i.q),[u,x]=(0,n.useState)(null),[p,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e,s=localStorage.getItem(o);s&&i.IB.includes(s)?e=s:(e=(0,i.AL)(),localStorage.setItem(o,e)),m(e),document.cookie="chorus-locale=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax"),h(!0)},[]),(0,n.useEffect)(()=>{p&&t(15272)("./".concat(d,".json")).then(e=>{x(e.default)}).catch(e=>{l.q.error("Failed to load messages for locale ".concat(d,":"),e),t(15272)("./".concat(i.q,".json")).then(e=>{x(e.default)})})},[d,p]);let g=(0,n.useCallback)(e=>{m(e),localStorage.setItem(o,e),document.cookie="chorus-locale=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax"),document.documentElement.lang=e},[]);return p&&u?(0,a.jsx)(c.Provider,{value:{locale:d,setLocale:g},children:(0,a.jsx)(r.A,{locale:d,messages:u,children:s})}):null}},37750:(e,s,t)=>{"use strict";t.d(s,{Y:()=>u});var a=t(90508),n=t(1856),r=t(39268),i=t(22922),l=t(60532),o=t(9160),c=t(67712),d=t(75427),m=t(83792);function u(e){let{onAgentCreated:s,createAgentAndKey:t,onClose:u,embedded:x=!1,submitLabel:p,submittingLabel:h}=e,g=(0,r.c)(),[j,f]=(0,n.useState)(""),[b,v]=(0,n.useState)("admin_agent"),[N,k]=(0,n.useState)(["admin_agent"]),[y,w]=(0,n.useState)([]),[C,_]=(0,n.useState)(""),[S,T]=(0,n.useState)(!1),[A,R]=(0,n.useState)(null),[L,U]=(0,n.useState)(!1),I=async e=>{if((e.preventDefault(),j)&&("custom"!==b||0!==y.length)){T(!0);try{let e=await t({name:j,roles:N,permissions:"custom"===b?y:[],persona:C||null});e.success&&e.key?(x||R(e.key),s({uuid:e.agentUuid||"",name:j,roles:N,permissions:"custom"===b?y:[]},e.key)):c.q.error("Failed to create API key:",e.error)}catch(e){c.q.error("Failed to create API key:",e)}finally{T(!1)}}},P=async e=>{try{await navigator.clipboard.writeText(e),U(!0),setTimeout(()=>U(!1),2e3)}catch(e){c.q.error("Failed to copy to clipboard:",e)}},E=()=>{f(""),v("admin_agent"),k(["admin_agent"]),w([]),_(""),R(null),null==u||u()};return A&&!x?(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-green-600",children:[(0,a.jsx)(l.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"font-medium",children:g("settings.apiKeyCreated")})]}),(0,a.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:g("settings.apiKeyCreatedDesc")}),(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 rounded bg-foreground px-3 py-2 font-mono text-sm text-background",children:A}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>P(A),children:g(L?"common.copied":"common.copy")})]}),(0,a.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:g("settings.installGuideIntro")}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(m.Z,{apiKey:A})}),(0,a.jsx)(i.$,{onClick:E,className:"w-full",children:g("common.done")})]}):(0,a.jsxs)("form",{onSubmit:I,children:[!x&&(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-6 py-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:g("settings.createApiKey")}),u&&(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",onClick:E,className:"h-8 w-8",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:x?void 0:"p-6",children:(0,a.jsx)(d.L,{name:j,onNameChange:f,preset:b,permissions:y,onPermissionsChange:function(e){v(e.preset),k(e.roles),w(e.permissions)},persona:C,onPersonaChange:_,nameInputId:"keyName",personaInputId:"create-agent-persona"})}),(0,a.jsxs)("div",{className:x?"flex justify-end gap-3 pt-2":"flex justify-end gap-3 border-t border-border px-6 py-4",children:[!x&&u&&(0,a.jsx)(i.$,{type:"button",variant:"outline",onClick:E,children:g("common.cancel")}),(0,a.jsx)(i.$,{type:"submit",disabled:!j||"custom"===b&&0===y.length||S,className:x?"w-full":void 0,size:x?"lg":"default",children:S?null!=h?h:g("settings.creating"):null!=p?p:g("settings.createApiKey")})]})]})}},39077:(e,s,t)=>{"use strict";t.d(s,{S:()=>l});var a=t(90508);t(1856);var n=t(60532),r=t(98861),i=t(24377);function l(e){let{className:s,...t}=e;return(0,a.jsx)(r.Root,{"data-slot":"checkbox",className:(0,i.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,a.jsx)(r.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,a.jsx)(n.A,{className:"size-3.5"})})})}},39674:(e,s,t)=>{"use strict";t.d(s,{Xi:()=>o,av:()=>c,j7:()=>l,tU:()=>i});var a=t(90508);t(1856);var n=t(79834),r=t(24377);function i(e){let{className:s,...t}=e;return(0,a.jsx)(n.Root,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",s),...t})}function l(e){let{className:s,...t}=e;return(0,a.jsx)(n.List,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",s),...t})}function o(e){let{className:s,...t}=e;return(0,a.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...t})}function c(e){let{className:s,...t}=e;return(0,a.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",s),...t})}},44775:(e,s,t)=>{"use strict";t.d(s,{o:()=>a});let a={developer_agent:["idea:read","proposal:read","document:read","project:read","task:read","task:write"],pm_agent:["idea:read","idea:write","proposal:read","proposal:write","document:read","document:write","task:read","task:write","project:read","project:write"],admin_agent:["idea:read","idea:write","idea:admin","proposal:read","proposal:write","proposal:admin","document:read","document:write","document:admin","task:read","task:write","task:admin","project:read","project:write","project:admin"]}},50006:(e,s,t)=>{"use strict";t.d(s,{N:()=>r});var a=t(90508),n=t(11227);function r(e){let{code:s,language:t}=e,r="```".concat(t||"","\n").concat(s,"\n```");return(0,a.jsx)(n.MarkdownContent,{children:r})}},75427:(e,s,t)=>{"use strict";t.d(s,{L:()=>b});var a=t(90508),n=t(1856),r=t(39268),i=t(5425),l=t(91385),o=t(14554),c=t(88064),d=t(15972),m=t(39077),u=t(91846),x=t(44775),p=t(93810);let h={admin_agent:"agent.permissions.presetAdmin",pm_agent:"agent.permissions.presetPm",developer_agent:"agent.permissions.presetDev",custom:"agent.permissions.presetCustom"},g={admin_agent:"agent.permissions.help.admin",pm_agent:"agent.permissions.help.pm",developer_agent:"agent.permissions.help.dev",custom:"agent.permissions.help.custom"},j=["admin_agent","pm_agent","developer_agent","custom"];function f(e){let{preset:s,permissions:t,onChange:n,readOnly:i=!1}=e,l=(0,r.c)(),o=null!=s?s:"custom",d=new Set("custom"===o?t:x.o[o]);return(0,a.jsxs)("div",{"data-testid":"agent-permission-picker",className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(c.J,{className:"text-[13px] font-medium",children:l("agent.permissions.title")}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l("agent.permissions.description")})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c.J,{htmlFor:"agent-permission-preset",children:l("agent.permissions.presetLabel")}),(0,a.jsxs)(u.l6,{value:o,onValueChange:function(e){if("custom"===e)return void n({preset:"custom",roles:[],permissions:Array.from(d)});e in x.o&&n({preset:e,roles:[e],permissions:[]})},disabled:i,children:[(0,a.jsx)(u.bq,{id:"agent-permission-preset",className:"w-full","aria-label":l("agent.permissions.presetLabel"),children:(0,a.jsx)(u.yv,{placeholder:l(h[o]),children:l(h[o])})}),(0,a.jsx)(u.gC,{children:j.map(e=>(0,a.jsx)(u.eb,{value:e,textValue:l(h[e]),children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 py-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-semibold",children:l(h[e])}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:l(g[e])})]})},e))})]})]}),(0,a.jsxs)("div",{role:"grid","aria-label":l("agent.permissions.title"),className:"overflow-hidden rounded-md border",children:[(0,a.jsxs)("div",{role:"row",className:"bg-muted/50 text-muted-foreground grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-xs font-medium",children:[(0,a.jsx)("div",{role:"columnheader",children:l("agent.permissions.resourceHeader")}),p.kl.map(e=>(0,a.jsx)("div",{role:"columnheader",className:"text-center",children:l("agent.permissions.actions.".concat(e))},e))]}),p.eZ.map(e=>(0,a.jsxs)("div",{role:"row",className:"border-t grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-sm",children:[(0,a.jsx)("div",{role:"rowheader",className:"font-medium",children:l("agent.permissions.resources.".concat(e))}),p.kl.map(s=>{let t="".concat(e,":").concat(s),r="perm-".concat(e,"-").concat(s);return(0,a.jsx)("div",{role:"gridcell",className:"flex items-center justify-center",children:(0,a.jsx)(m.S,{id:r,checked:d.has(t),disabled:i,"aria-label":"".concat(l("agent.permissions.resources.".concat(e))," ").concat(l("agent.permissions.actions.".concat(s))),onCheckedChange:e=>{if(!i){let s=new Set(d);!0===e?s.add(t):s.delete(t),n({preset:"custom",roles:[],permissions:Array.from(s)})}}})},s)})]},e))]})]})]})}function b(e){let{name:s,onNameChange:t,preset:m,permissions:u,onPermissionsChange:p,persona:h,onPersonaChange:g,nameInputId:j="agent-form-name",personaInputId:b="agent-form-persona",readOnly:v=!1}=e,N=(0,r.c)(),k=(0,n.useMemo)(()=>"custom"===m?u:[...x.o[m]],[m,u]);return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[s.trim()?(0,a.jsx)(l.AgentAvatar,{name:s,size:56,className:"rounded-2xl"}):(0,a.jsx)("div",{"aria-hidden":!0,className:"flex size-14 items-center justify-center rounded-2xl bg-muted text-muted-foreground",children:(0,a.jsx)(i.A,{className:"size-7"})}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:N("settings.agentAvatarPreview")})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c.J,{htmlFor:j,className:"text-[13px]",children:N("settings.name")}),(0,a.jsx)(o.p,{id:j,value:s,onChange:e=>t(e.target.value),placeholder:N("settings.namePlaceholder"),className:"border-border",required:!0,disabled:v})]}),(0,a.jsx)(f,{preset:m,permissions:k,onChange:p,readOnly:v}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c.J,{htmlFor:b,className:"text-[13px]",children:N("settings.agentPersona")}),(0,a.jsx)(d.T,{id:b,value:h,onChange:e=>g(e.target.value),placeholder:N("settings.personaPlaceholder"),rows:4,disabled:v}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:N("settings.personaHint")})]})]})}},83792:(e,s,t)=>{"use strict";t.d(s,{Z:()=>d});var a=t(90508),n=t(39268),r=t(48416),i=t(39674),l=t(81750),o=t(17730),c=t(50006);function d(e){let{apiKey:s}=e,t=(0,n.c)("onboarding"),d=window.location.origin,m=s||"<YOUR_API_KEY>",u=(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.profileStep.title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_AGENT_PROFILE="<agent-uuid>"'}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.profileStep.desc")})]});return(0,a.jsx)(r.Zp,{className:"w-full",children:(0,a.jsx)(r.Wu,{className:"p-6",children:(0,a.jsxs)(i.tU,{defaultValue:"claude-code",className:"w-full",children:[(0,a.jsxs)(i.j7,{className:"w-full justify-start overflow-x-auto",children:[(0,a.jsx)(i.Xi,{value:"claude-code",className:"shrink-0",children:t("install.tabs.claudeCode")}),(0,a.jsx)(i.Xi,{value:"codex",className:"shrink-0",children:t("install.tabs.codex")}),(0,a.jsx)(i.Xi,{value:"kiro",className:"shrink-0",children:t("install.tabs.kiro")}),(0,a.jsx)(i.Xi,{value:"pi",className:"shrink-0",children:t("install.tabs.pi")}),(0,a.jsx)(i.Xi,{value:"dsh",className:"shrink-0",children:t("install.tabs.dsh")}),(0,a.jsx)(i.Xi,{value:"opencode",className:"shrink-0",children:t("install.tabs.opencode")}),(0,a.jsx)(i.Xi,{value:"openclaw",className:"shrink-0",children:t("install.tabs.openClaw")}),(0,a.jsx)(i.Xi,{value:"other",className:"shrink-0",children:t("install.tabs.other")})]}),(0,a.jsxs)(i.av,{value:"claude-code",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.claudeCode.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.claudeCode.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.claudeCode.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents claude"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.claudeCode.step2Tip")})]})]}),(0,a.jsxs)(i.av,{value:"codex",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.codex.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.codex.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.codex.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents codex"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.codex.step2Tip")})]})]}),(0,a.jsxs)(i.av,{value:"kiro",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.kiro.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.kiro.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.kiro.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents kiro"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.kiro.step2Tip")})]}),u]}),(0,a.jsxs)(i.av,{value:"pi",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.pi.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.pi.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.pi.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus\nchorus agents add --agents pi"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.pi.step2Tip")})]}),u]}),(0,a.jsxs)(i.av,{value:"dsh",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.dsh.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"dsh plugin --profile <name> add @chorus-aidlc/chorus-dsh -w"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.dsh.step2Tip",{name:"<name>"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step3Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents dsh --dsh-profile <name>"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.dsh.step3Tip",{name:"<name>"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step4Title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("install.dsh.step4Desc",{name:"<name>"})})]})]}),(0,a.jsxs)(i.av,{value:"opencode",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.opencode.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.opencode.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.opencode.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents opencode"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.opencode.step2Tip")})]}),u,(0,a.jsxs)(l.Nt,{children:[(0,a.jsxs)(l.R6,{className:"flex w-full items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[(0,a.jsx)(o.A,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"}),t("install.opencode.troubleshootingTitle")]}),(0,a.jsx)(l.Ke,{children:(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.opencode.issueCache.title")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.opencode.issueCache.fix")})]}),(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.opencode.issueEnv.title")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.opencode.issueEnv.fix")})]}),(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.opencode.issueCheckin.title")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.opencode.issueCheckin.fix")})]})]})})]})]}),(0,a.jsxs)(i.av,{value:"openclaw",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.openClaw.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:"openclaw plugins install @chorus-aidlc/chorus-openclaw-plugin"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.openClaw.step2Title")}),(0,a.jsx)(c.N,{language:"json",code:'{\n "hooks": { "enabled": true, "token": "<your-token>" },\n "plugins": {\n "enabled": true,\n "entries": {\n "chorus-openclaw-plugin": {\n "enabled": true,\n "config": {\n "chorusUrl": "'.concat(d,'",\n "apiKey": "').concat(m,'",\n "autoStart": true\n }\n }\n }\n }\n}')})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.openClaw.step3Title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("install.openClaw.step3Desc")})]}),(0,a.jsxs)(l.Nt,{children:[(0,a.jsxs)(l.R6,{className:"flex w-full items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[(0,a.jsx)(o.A,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"}),t("install.openClaw.troubleshootingTitle")]}),(0,a.jsx)(l.Ke,{children:(0,a.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.openClaw.troubleshootingError")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.openClaw.troubleshootingFix")})]})})]})]}),(0,a.jsxs)(i.av,{value:"other",className:"mt-4 space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("install.other.description")}),(0,a.jsx)(c.N,{code:"Please install and configure the Chorus AI-DLC collaboration platform.\n\nChorus URL: ".concat(d,"\nAPI Key: ").concat(m,"\n\nRead the setup instructions from:\n").concat(d,'/skill/chorus/SKILL.md\n\nFollow the "Setup" section to configure the MCP server,\nthen call chorus_checkin() to verify the connection.')})]})]})})})}},88064:(e,s,t)=>{"use strict";t.d(s,{J:()=>i});var a=t(90508);t(1856);var n=t(58057),r=t(24377);function i(e){let{className:s,...t}=e;return(0,a.jsx)(n.Root,{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),...t})}},93810:(e,s,t)=>{"use strict";t.d(s,{eZ:()=>a,kl:()=>n,lp:()=>r});let a=["idea","proposal","document","task","project"],n=["read","write","admin"],r=a.flatMap(e=>n.map(s=>"".concat(e,":").concat(s)))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[32736],{6985:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},15695:(e,s,t)=>{t.d(s,{v:()=>ew});var a=t(90508),r=t(1856),i=t(91814),n=t(39268),c=t(76111),l=t(9160),d=t(5616),o=t(70633),u=t(57893),m=t(56770),x=t(85226),p=t(62898),h=t(42533),g=t(1861),f=t(66206);let v=(0,f.A)("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"}]]);var b=t(17475),j=t(60532),N=t(94903),k=t(62482),A=t(6985);let y=(0,f.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var w=t(97413),F=t(57731),C=t(48416),S=t(22922),E=t(14554),D=t(15972),_=t(88064),R=t(64993),T=t(91846),U=t(51817),q=t(73693),M=t(91385),B=t(94643),L=t(29532),P=t(52217);let z=(0,P.createServerReference)("603a51cdb0ea96a50c72167a2c2783abebcbff1a09",P.callServer,void 0,P.findSourceMapURL,"updateTaskStatusAction"),I=(0,P.createServerReference)("40ff535fbdb1f4610368f11983012d81b7ebfdd25c",P.callServer,void 0,P.findSourceMapURL,"createTaskAction"),$=(0,P.createServerReference)("400cd4d5c786720786f1e11cef1583a6ecd7e6e434",P.callServer,void 0,P.findSourceMapURL,"updateTaskFieldsAction"),V=(0,P.createServerReference)("6016da3e4fa3da2b178f50dd30880170682eb716fe",P.callServer,void 0,P.findSourceMapURL,"deleteTaskAction"),W=(0,P.createServerReference)("60d32f1549dbc6b8a967a32514f1972ef1d7e46c68",P.callServer,void 0,P.findSourceMapURL,"markCriteriaAction"),J=(0,P.createServerReference)("60d63380389174d217fb317229063305a6c93948bb",P.callServer,void 0,P.findSourceMapURL,"resetCriterionAction");var O=t(14628),H=t(36995);let G=(0,P.createServerReference)("40dc8276980c5f66b71089207007448eec93ce44f6",P.callServer,void 0,P.findSourceMapURL,"getTaskActivitiesAction"),X=(0,P.createServerReference)("4096d1056fc9ed4de09677cc4db736ff6e34e5475d",P.callServer,void 0,P.findSourceMapURL,"getTaskSourceAction");var Z=t(11227),K=t(13108),Q=t(30028),Y=t(17722),ee=t(41033),es=t(78307),et=t(24900),ea=t(6930);let er=(0,P.createServerReference)("00c6ec23efa594b94638b5738caef1f238fc3a5cff",P.callServer,void 0,P.findSourceMapURL,"getDeveloperAgentsAction"),ei=(0,P.createServerReference)("6087024e78129fda7cb49cd940d0a11992ae50c95b",P.callServer,void 0,P.findSourceMapURL,"getAgentInstancesAction"),en=(0,P.createServerReference)("40a36905412f0777ec0aa848f225fbfa3534d82ac3",P.callServer,void 0,P.findSourceMapURL,"claimTaskAction"),ec=(0,P.createServerReference)("701eb3ac314bb8fc4d54cdf9a67b1123b965252a9f",P.callServer,void 0,P.findSourceMapURL,"claimTaskToAgentAction"),el=(0,P.createServerReference)("606db3b38a04c28f17dd296cd022eff2d90c7cd7ae",P.callServer,void 0,P.findSourceMapURL,"claimTaskToUserAction"),ed=(0,P.createServerReference)("40479a5c896612d4a8332120131524dcea226026c4",P.callServer,void 0,P.findSourceMapURL,"releaseTaskAction");function eo(e){var s,t;let{task:c,projectUuid:l,currentUserUuid:d,onClose:o}=e,u=(0,n.c)(),m=(0,i.r)(),[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)("self"),[v,b]=(0,r.useState)(""),[j,k]=(0,r.useState)(""),[A,y]=(0,r.useState)([]),[w,F]=(0,r.useState)([]),[C,E]=(0,r.useState)(!0),[D,R]=(0,r.useState)(null),[U,q]=(0,r.useState)([]),[B,L]=(0,r.useState)(!1),[P,z]=(0,r.useState)(null),[I,$]=(0,r.useState)(null),V=!!c.assignee;(0,r.useEffect)(()=>{!async function(){E(!0);let e=await er();y(e.agents||[]),F((e.users||[]).filter(e=>e.uuid!==d)),E(!1)}()},[d]),(0,r.useEffect)(()=>{if("agent"!==g||!v){q([]),$(null),z(null);return}let e=!1;return L(!0),$(null),ei(v,l).then(s=>{e||(q((0,es.C)(s.instances)),z(s.resolvedTarget))}).finally(()=>{e||L(!1)}),()=>{e=!0}},[l,g,v]);let W=null!=(t=U.find(e=>e.connectionUuid===I))?t:null,J=new Set(U.map(e=>e.host)).size>1,O=async()=>{let e;if(h(!0),R(null),"self"===g)e=await en(c.uuid);else if("agent"===g&&v){var s;e=await ec(c.uuid,v,null!=(s=null==W?void 0:W.agentInstanceUuid)?s:void 0)}else if("user"===g&&j)e=await el(c.uuid,j);else{if("release"!==g)return void h(!1);e=await ed(c.uuid)}h(!1),(null==e?void 0:e.success)?(o(),m.refresh()):(null==e?void 0:e.error)&&R(e.error)},H="self"===g||"agent"===g&&v||"user"===g&&j||"release"===g&&V;return(0,a.jsxs)(Y._8,{open:!0,onOpenChange:e=>{e||o()},className:"bg-card sm:max-w-[400px]",header:(0,a.jsx)(Y.AI,{className:"text-base font-semibold text-foreground",children:u("tasks.assignTask")}),footer:(0,a.jsxs)("div",{className:"flex w-full items-center justify-end gap-4",children:[(0,a.jsx)(S.$,{variant:"outline",onClick:o,disabled:p,className:"border-border",children:u("common.cancel")}),(0,a.jsx)(S.$,{onClick:O,disabled:p||!H,className:"bg-primary hover:bg-[#B56A42] text-white",children:p?(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin"}):"release"===g?u("common.release"):function(){if("agent"!==g||!W)return u("common.assign");let e=(0,et.kn)(W.cwd),s=e.isUnknown?u(e.label):e.label,t=(0,et.g9)(W.host),a=t.isUnknown?u(t.label):t.label;return J?u("assignInstance.assignToWithHost",{path:s,host:a}):u("assignInstance.assignTo",{path:s})}()})]}),bodyClassName:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-lg bg-background p-3",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-foreground",children:c.title}),c.description&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground line-clamp-2",children:c.description})]}),V&&(0,a.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] dark:bg-[#13253a] p-3",children:(0,a.jsxs)("p",{className:"text-xs text-[#1976D2] dark:text-[#5AA9F0]",children:[u("common.currentAssignee"),": ",(0,a.jsx)("span",{className:"font-medium",children:null==(s=c.assignee)?void 0:s.name})]})}),D&&(0,a.jsx)("div",{className:"rounded-lg bg-[#FEE2E2] dark:bg-[#331619] p-3",children:(0,a.jsx)("p",{className:"text-xs text-[#D32F2F] dark:text-[#F08078]",children:D})}),(0,a.jsx)("p",{className:"text-[13px] text-muted-foreground",children:u("assign.selectAssignee")}),C?(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsx)(x.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(ee.z,{value:g,onValueChange:e=>f(e),className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("self"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"),onClick:()=>f("self"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(ee.C,{value:"self",id:"self",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"self",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.assignToMyself")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("assign.assignToMyselfDesc")})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("agent"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("agent"),children:[(0,a.jsx)(ee.C,{value:"agent",id:"agent",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"agent",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.orAssignToAgent")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("tasks.onlySelectedAgentCanWork")}),"agent"===g&&(0,a.jsxs)("div",{className:"mt-3 ml-6 space-y-3",children:[(0,a.jsxs)(T.l6,{value:v,onValueChange:b,children:[(0,a.jsx)(T.bq,{className:"w-full border-border",children:(0,a.jsx)(T.yv,{placeholder:u("tasks.selectAgent")})}),(0,a.jsx)(T.gC,{className:"z-[120]",children:A.length>0?A.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(M.AgentAvatar,{name:e.name,size:16,className:"rounded-full"}),(0,a.jsx)("span",{children:e.name})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:u("tasks.noAgentsAvailable")})})]}),v&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:u("assignInstance.workingDirectory")}),B?(0,a.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-[#9A9A9A]",children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin"}),u("assignInstance.loadingInstances")]}):(null==P?void 0:P.source)==="project_fixed"?(0,a.jsx)(ea.Y,{target:P}):0===U.length?(0,a.jsx)("p",{className:"rounded-lg bg-background p-2.5 text-[11px] leading-relaxed text-muted-foreground",children:u("assignInstance.noInstances")}):(0,a.jsx)(es.O,{instances:U,selectedConnectionUuid:I,onSelect:e=>$(e.connectionUuid),ariaLabel:u("assignInstance.workingDirectory")}),(null==P?void 0:P.source)!=="project_fixed"&&(0,a.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-[#9A8C7E]",children:[(0,a.jsx)(Q.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:u("assignInstance.pinNote")})]})]})]})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("user"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("user"),children:[(0,a.jsx)(ee.C,{value:"user",id:"user",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"user",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.orAssignToUser")})]}),"user"===g&&(0,a.jsx)("div",{className:"mt-3 ml-6",children:(0,a.jsxs)(T.l6,{value:j,onValueChange:k,children:[(0,a.jsx)(T.bq,{className:"w-full border-border",children:(0,a.jsx)(T.yv,{placeholder:u("tasks.selectUser")})}),(0,a.jsx)(T.gC,{className:"z-[120]",children:w.length>0?w.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("span",{children:e.name||e.email})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:u("tasks.noUsersAvailable")})})]})})]}),V&&(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("release"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"),onClick:()=>f("release"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(ee.C,{value:"release",id:"release",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"release",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.releaseAssignee")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("assign.releaseAssigneeDesc")})]})]})]})}let eu=(0,P.createServerReference)("4074835395325a4a6516397d126841637cddb34b62",P.callServer,void 0,P.findSourceMapURL,"getTaskDependenciesAction"),em=(0,P.createServerReference)("40c7ea5481c09a8c7968c60b7602fddbd61693dfdb",P.callServer,void 0,P.findSourceMapURL,"getProjectTasksForDependencyAction");var ex=t(89380);let ep=(0,P.createServerReference)("60741e48536a1fcd53a98fbbf59f106070d8ef70f9",P.callServer,void 0,P.findSourceMapURL,"removeTaskDependencyAction"),eh=(0,P.createServerReference)("401ca7b9a7e23539752fa83521d90c2e16c961c0a9",P.callServer,void 0,P.findSourceMapURL,"getTaskSessionsAction");var eg=t(38106),ef=t(16544),ev=t(65626),eb=t(90795);let ej={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},eN={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},ek={low:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]",medium:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",high:"bg-[#FEE2E2] dark:bg-[#331619] text-[#D32F2F] dark:text-[#F08078]",critical:"bg-[#FFCDD2] dark:bg-[#3a181c] text-[#B71C1C] dark:text-[#F08078]"},eA={low:"lowPriority",medium:"mediumPriority",high:"highPriority",critical:"criticalPriority"};function ey(e,s){let t=new Date(e),a=new Date().getTime()-t.getTime(),r=Math.floor(a/6e4),i=Math.floor(a/36e5),n=Math.floor(a/864e5);return r<1?s("time.justNow"):r<60?s("time.minutesAgo",{minutes:r}):i<24?s("time.hoursAgo",{hours:i}):n<7?s("time.daysAgo",{days:n}):(0,eg.r)(t)}function ew(e){var s,t;let{task:f,projectUuid:P,currentUserUuid:Q,mode:Y="overlay",onClose:ee,onCreated:es,onDependencyChange:et,onBack:ea}=e,er=(0,n.c)(),ei=(0,i.r)(),[en,ec]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=setTimeout(()=>ec(!0),300);return()=>clearTimeout(e)},[]);let[el,ed]=(0,r.useState)(!1),[ew,eF]=(0,r.useState)([]),[eC,eS]=(0,r.useState)(!0),[eE,eD]=(0,r.useState)(null),[e_,eR]=(0,r.useState)(!1),[eT,eU]=(0,r.useState)([]),[eq,eM]=(0,r.useState)([]),[eB,eL]=(0,r.useState)(!1),[eP,ez]=(0,r.useState)([]),[eI,e$]=(0,r.useState)(null),[eV,eW]=(0,r.useState)([]),[eJ,eO]=(0,r.useState)([]),eH=null===f,[eG,eX]=(0,r.useState)(eH),[eZ,eK]=(0,r.useState)((null==f?void 0:f.title)||""),[eQ,eY]=(0,r.useState)((null==f?void 0:f.description)||""),[e0,e1]=(0,r.useState)((null==f?void 0:f.priority)||"medium"),[e2,e9]=(0,r.useState)((null==f?void 0:f.storyPoints)!=null?String(f.storyPoints):""),[e5,e3]=(0,r.useState)((null!=(s=null==f?void 0:f.acceptanceCriteriaItems)?s:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),[e6,e4]=(0,r.useState)(!1),[e7,e8]=(0,r.useState)(null),[se,ss]=(0,r.useState)(!1),st=(0,L.RU)(null!=(t=null==f?void 0:f.assignee)?t:null,{type:"user",uuid:Q}),sa=st&&(null==f?void 0:f.status)==="assigned",sr=st&&(null==f?void 0:f.status)==="in_progress",si=(null==f?void 0:f.status)==="to_verify";(0,r.useEffect)(()=>{async function e(){eS(!0),eF((await G(f.uuid)).activities),eS(!1)}async function s(){f.proposalUuid&&eD(await X(f.proposalUuid))}async function t(){eL(!0);let[e,s]=await Promise.all([eu(f.uuid),em(P)]);eU(e.dependsOn),eM(e.dependedBy),ez(s.tasks),eL(!1)}async function a(){let e=await eh(f.uuid);e.success&&e.data&&eW(e.data)}f&&(e(),s(),t(),a())},[null==f?void 0:f.uuid,null==f?void 0:f.proposalUuid,P]),(0,r.useEffect)(()=>{eH&&e();async function e(){ez((await em(P)).tasks)}},[eH,P]),(0,r.useEffect)(()=>{if(f){var e;eX(!1),eK(f.title),eY(f.description||""),e1(f.priority),e9(null!=f.storyPoints?String(f.storyPoints):""),e3((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),e8(null)}},[null==f?void 0:f.uuid,null==f?void 0:f.title,null==f?void 0:f.description,null==f?void 0:f.priority,null==f?void 0:f.storyPoints,null==f?void 0:f.acceptanceCriteriaItems]);let sn=async e=>{if(!f)return;ed(!0);let s=await z(f.uuid,e);ed(!1),s.success&&(ee(),ei.refresh())},sc=()=>{if(eH)return void ee();if(eX(!1),f){var e;eK(f.title),eY(f.description||""),e1(f.priority),e9(null!=f.storyPoints?String(f.storyPoints):""),e3((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}))}e8(null)},sl=async()=>{if(!eZ.trim())return void e8(er("tasks.titleRequired"));e4(!0),e8(null);let e=e2.trim()?parseFloat(e2):null;if(eH){let s=await I({projectUuid:P,title:eZ.trim(),description:eQ.trim()||void 0,priority:e0,storyPoints:e,acceptanceCriteria:null});e4(!1),s.success?(eJ.length>0&&s.taskUuid&&(await Promise.all(eJ.map(e=>(0,ex.w)(s.taskUuid,e.uuid))),null==et||et()),null==es||es(),ee(),ei.refresh()):e8(s.error||er("tasks.createFailed"))}else{var s;let t=(null!=(s=f.acceptanceCriteriaItems)?s:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}),a=e5.filter(e=>e.description.trim().length>0),r=(0,K.K)(t,a);if(r&&0===a.length){e4(!1),e8(er("acceptanceCriteria.atLeastOneRequired"));return}let i=await $({taskUuid:f.uuid,projectUuid:P,title:eZ.trim(),description:eQ.trim()||null,priority:e0,storyPoints:e,...r?{acceptanceCriteriaItems:a.map(e=>({description:e.description.trim(),required:e.required}))}:{}});e4(!1),i.success?(eX(!1),ei.refresh()):e8(i.error||er("tasks.updateFailed"))}},sd=async()=>{if(!f)return;ss(!0);let e=await V(f.uuid,P);ss(!1),e.success&&(ee(),ei.refresh())},so=async e=>{if(!f)return;e$(null);let s=await (0,ex.w)(f.uuid,e);if(s.success){let s=eP.find(s=>s.uuid===e);s&&eU(e=>[...e,s]),null==et||et()}else e$(s.error||er("tasks.failedToAddDep"))},su=async e=>{if(!f)return;e$(null);let s=await ep(f.uuid,e);s.success?(eU(s=>s.filter(s=>s.uuid!==e)),null==et||et()):e$(s.error||er("tasks.failedToRemoveDep"))},sm=async e=>{if(!f)return;e$(null);let s=await ep(e,f.uuid);s.success?(eM(s=>s.filter(s=>s.uuid!==e)),null==et||et()):e$(s.error||er("tasks.failedToRemoveDep"))},sx=eP.filter(e=>e.uuid!==(null==f?void 0:f.uuid)&&!eT.some(s=>s.uuid===e.uuid)),sp=eP.filter(e=>!eJ.some(s=>s.uuid===e.uuid)),sh="sidebyside"===Y;return(0,a.jsxs)(a.Fragment,{children:[!sh&&(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:ee}),(0,a.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ".concat(sh?"z-40 ".concat(en?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(en?"":"animate-in slide-in-from-right duration-300")),style:sh?{right:"".concat(eb.L8,"px")}:void 0,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[ea&&(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:ea,children:(0,a.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:eG?(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground",children:eH?er("tasks.createTaskTitle"):er("tasks.editTask")}):f?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:f.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,a.jsx)(F.E,{className:ej[f.status]||"",children:er("status.".concat(eN[f.status]||f.status))}),(0,a.jsx)(F.E,{className:ek[f.priority]||"",children:er("priority.".concat(eA[f.priority]||f.priority))}),f.storyPoints&&(0,a.jsxs)("span",{className:"rounded bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[f.storyPoints,"h"]})]})]}):null}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[f&&!eG&&(0,a.jsxs)(S.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border text-foreground",onClick:()=>{var e;f&&(eK(f.title),eY(f.description||""),e1(f.priority),e9(null!=f.storyPoints?String(f.storyPoints):""),e3((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),e8(null),eX(!0))},children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs",children:er("common.edit")})]}),(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:eG&&!eH?sc:ee,children:(0,a.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,a.jsx)(R.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,a.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:eG?(0,a.jsxs)("div",{className:"space-y-5",children:[e7&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:e7}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:er("tasks.titleLabel")}),(0,a.jsx)(E.p,{id:"edit-title",value:eZ,onChange:e=>eK(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-foreground",children:er("tasks.descriptionLabel")}),(0,a.jsx)(D.T,{id:"edit-description",value:eQ,onChange:e=>eY(e.target.value),rows:4,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-foreground",children:er("tasks.priorityLabel")}),(0,a.jsxs)(T.l6,{value:e0,onValueChange:e1,children:[(0,a.jsx)(T.bq,{className:"border-border text-sm focus:ring-primary",children:(0,a.jsx)(T.yv,{})}),(0,a.jsxs)(T.gC,{children:[(0,a.jsx)(T.eb,{value:"low",children:er("priority.low")}),(0,a.jsx)(T.eb,{value:"medium",children:er("priority.medium")}),(0,a.jsx)(T.eb,{value:"high",children:er("priority.high")})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-foreground",children:er("tasks.storyPointsLabel")}),(0,a.jsx)(E.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:e2,onChange:e=>e9(e.target.value),className:"border-border text-sm focus-visible:ring-primary"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{className:"text-[13px] font-medium text-foreground",children:er("acceptanceCriteria.title")}),(0,a.jsx)(K.C,{items:e5,onChange:e3})]}),eH&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{className:"text-[13px] font-medium text-foreground",children:er("tasks.dependencies")}),eJ.length>0&&(0,a.jsx)("div",{className:"space-y-1.5",children:eJ.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(ej[e.status]||""),children:er("status.".concat(eN[e.status]||e.status))})]}),(0,a.jsx)(S.$,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>eO(s=>s.filter(s=>s.uuid!==e.uuid)),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))}),sp.length>0&&(0,a.jsxs)(T.l6,{onValueChange:e=>{let s=eP.find(s=>s.uuid===e);s&&eO(e=>[...e,s])},children:[(0,a.jsx)(T.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:er("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sp.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eJ.length)]})]}):f?(0,a.jsxs)(ef.P.div,{variants:ev.qG,initial:"initial",animate:"animate",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.assignee")}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3",children:f.assignee?(0,a.jsxs)(a.Fragment,{children:[(0,L.bB)(f.assignee)?(0,a.jsx)(M.AgentAvatar,{name:f.assignee.name,size:28,className:"rounded-full"}):(0,a.jsx)(q.eu,{className:"h-7 w-7",children:(0,a.jsx)(q.q5,{className:"bg-border text-muted-foreground",children:f.assignee.name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:f.assignee.name}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,L.bB)(f.assignee)?"".concat(er("common.agent")," • ").concat(f.assignee.assignedAt?(0,eg.r)(f.assignee.assignedAt):""):er("common.user")}),"agent_instance"===f.assignee.type&&f.assignee.instance&&(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)(B.jQ,{cwd:f.assignee.instance.cwd,host:f.assignee.instance.host})})]})]}):(0,a.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:er("common.unassigned")})})]}),eV.length>0&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("sessions.activeWorkers")}),(0,a.jsx)("div",{className:"mt-2 space-y-1.5",children:eV.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-background p-2.5",children:[(0,a.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,a.jsx)(M.AgentAvatar,{name:e.agentName,size:28,className:"rounded-full"}),(0,a.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-green-500 ring-2 ring-background"})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-foreground truncate",children:e.sessionName}),(0,a.jsxs)("div",{className:"text-[10px] text-[#9A9A9A]",children:[e.agentName," \xb7 ",ey(e.checkinAt,er)]})]})]},e.sessionUuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.description")}),(0,a.jsx)("div",{className:"mt-2",children:f.description?(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,a.jsx)(Z.MarkdownContent,{children:f.description})}):(0,a.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:er("common.noDescription")})})]}),f.acceptanceCriteria&&!(f.acceptanceCriteriaItems&&f.acceptanceCriteriaItems.length>0)&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.acceptanceCriteria")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,a.jsx)(Z.MarkdownContent,{children:f.acceptanceCriteria})})})]}),eE&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.source")}),(0,a.jsx)("a",{href:"/projects/".concat(P,"/proposals/").concat(eE.uuid),className:"mt-2 flex items-center justify-between rounded-lg bg-background p-3 hover:bg-[#F0EDE5] dark:hover:bg-[#26241f] transition-colors",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground",children:eE.title})]})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.dependencies")}),eI&&(0,a.jsx)("div",{className:"mt-2 rounded-lg bg-destructive/10 p-2.5 text-xs text-destructive",children:eI}),eB?(0,a.jsx)("div",{className:"mt-2 flex items-center justify-center py-4",children:(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(a.Fragment,{children:[eT.length>0&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.dependsOn")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eT.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(ej[e.status]||""),children:er("status.".concat(eN[e.status]||e.status))})]}),(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>su(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),eq.length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 rotate-180 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.blockedByThis")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eq.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(ej[e.status]||""),children:er("status.".concat(eN[e.status]||e.status))})]}),(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>sm(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),0===eT.length&&0===eq.length&&(0,a.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:er("tasks.noDependencies")}),sx.length>0&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(T.l6,{onValueChange:e=>so(e),children:[(0,a.jsx)(T.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:er("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sx.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eT.length)})]})]}),f&&f.acceptanceCriteriaItems&&f.acceptanceCriteriaItems.length>0&&(()=>{let e=f.acceptanceCriteriaItems,s=f.acceptanceSummary,t=e=>"passed"===e?(0,a.jsx)(h.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A]"}):"failed"===e?(0,a.jsx)(g.A,{className:"h-4 w-4 text-red-600 dark:text-[#F08078]"}):(0,a.jsx)(v,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E]"}),r=e=>"passed"===e?"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]":"failed"===e?"bg-red-50 text-red-700 dark:bg-[#331619] dark:text-[#F08078]":"bg-yellow-50 text-yellow-700 dark:bg-[#332a12] dark:text-[#E0B44E]",i=async(e,s)=>{(await W(f.uuid,[{uuid:e,status:s}])).success&&ei.refresh()};return(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("acceptanceCriteria.title")}),s&&(0,a.jsx)(F.E,{className:r(f.acceptanceStatus||"pending"),variant:"secondary",children:er("acceptanceCriteria.progress",{passed:s.passed,total:s.total})})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[e.map(e=>(0,a.jsx)(C.Zp,{className:"p-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0",children:t(e.status)}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-xs text-foreground",children:e.description}),(0,a.jsx)(F.E,{variant:"outline",className:"text-[10px] shrink-0",children:e.required?er("acceptanceCriteria.required"):er("acceptanceCriteria.optional")})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:er("acceptanceCriteria.devSelfCheck")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.devStatus)),variant:"secondary",children:[t(e.devStatus),(0,a.jsx)("span",{className:"ml-1",children:er("acceptanceCriteria.status.".concat(e.devStatus))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:er("acceptanceCriteria.verification")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.status)),variant:"secondary",children:[t(e.status),(0,a.jsx)("span",{className:"ml-1",children:er("acceptanceCriteria.status.".concat(e.status))})]})]})]}),e.devEvidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:er("acceptanceCriteria.devEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.devEvidence})]}),e.evidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:er("acceptanceCriteria.verifyEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.evidence})]}),"pending"===e.status?(0,a.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-green-700 dark:text-[#6FD19A] border-green-200 dark:border-[#2a4a34] hover:bg-green-50 dark:hover:bg-[#14281a]",onClick:()=>i(e.uuid,"passed"),children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 mr-1"}),er("acceptanceCriteria.pass")]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-red-700 dark:text-[#F08078] border-red-200 dark:border-[#5a2a2e] hover:bg-red-50 dark:hover:bg-[#331619]",onClick:()=>i(e.uuid,"failed"),children:[(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 mr-1"}),er("acceptanceCriteria.fail")]})]}):(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(S.$,{size:"sm",variant:"ghost",className:"h-7 min-h-[44px] sm:min-h-0 text-xs text-[#9A9A9A] hover:text-foreground",onClick:async()=>{(await J(f.uuid,e.uuid)).success&&ei.refresh()},children:er("acceptanceCriteria.undoVerification")})})]})]})},e.uuid)),s&&(s.requiredPending>0||s.requiredFailed>0)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-yellow-50 dark:bg-[#332a12] p-3 mt-2",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E] shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-yellow-700 dark:text-[#E0B44E]",children:er("acceptanceCriteria.gateBlocked",{count:s.requiredPending+s.requiredFailed})})]}),s&&0===s.requiredPending&&0===s.requiredFailed&&s.required>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-green-50 dark:bg-[#14281a] p-3 mt-2",children:[(0,a.jsx)(h.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A] shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-green-700 dark:text-[#6FD19A]",children:er("acceptanceCriteria.gateReady")})]})]})]})})(),(0,a.jsxs)("div",{className:"mt-5 flex-1",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.activity")}),(0,a.jsx)("div",{className:"mt-2 space-y-3",children:eC?(0,a.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===ew.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:er("common.noActivity")}):ew.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-secondary",children:(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(function(e){switch(e){case"task_created":return"bg-primary";case"task_assigned":case"task_claimed":return"bg-[#1976D2]";case"task_started":return"bg-[#5A9E6F]";case"task_submitted":return"bg-[#7B1FA2]";case"task_completed":case"task_verified":return"bg-[#00796B]";case"task_released":return"bg-[#E65100]";default:return"bg-muted-foreground"}}(e.action))})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-xs text-foreground",children:function(e,s){let t=e.sessionName?"".concat(e.actorName," / ").concat(e.sessionName):e.actorName,{action:a}=e;switch(a){case"task_created":return s("activity.taskCreated",{actor:t});case"task_assigned":return s("activity.taskAssigned",{actor:t});case"task_claimed":return s("activity.taskClaimed",{actor:t});case"task_started":return s("activity.taskStarted",{actor:t});case"task_submitted":return s("activity.taskSubmitted",{actor:t});case"task_completed":case"task_verified":return s("activity.taskCompleted",{actor:t});case"task_released":return s("activity.taskReleased",{actor:t});case"task_status_changed":return s("activity.taskStatusChanged",{actor:t});default:return"".concat(t,": ").concat(a)}}(e,er)}),(0,a.jsx)("p",{className:"text-[10px] text-[#9A9A9A]",children:ey(e.createdAt,er)})]})]},e.uuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("references.title")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(H.ReferencesSection,{targetType:"task",targetUuid:f.uuid,canWrite:!0,compact:!0})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("comments.title")}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(O.$m,{targetType:"task",targetUuid:f.uuid,currentUserUuid:Q,compact:!0})})]})]}):null})}),(0,a.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:eG?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.$,{variant:"outline",className:"border-border",onClick:sc,disabled:e6,children:er("common.cancel")}),(0,a.jsx)(S.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:sl,disabled:e6||!eZ.trim(),children:e6?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),er("common.saving")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.A,{className:"mr-2 h-4 w-4"}),eH?er("common.create"):er("tasks.saveChanges")]})})]}):f?(0,a.jsxs)(a.Fragment,{children:["done"!==f.status&&"closed"!==f.status&&(0,a.jsxs)(S.$,{variant:"outline",className:"border-border",onClick:()=>eR(!0),disabled:el,children:[(0,a.jsx)(N.A,{className:"mr-2 h-4 w-4"}),er("common.assign")]}),sa&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#1976D2] hover:bg-[#1565C0] text-white",onClick:()=>sn("in_progress"),disabled:el,children:[(0,a.jsx)(k.A,{className:"mr-2 h-4 w-4"}),er("tasks.startWork")]}),sr&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#7B1FA2] hover:bg-[#6A1B9A] text-white",onClick:()=>sn("to_verify"),disabled:el,children:[(0,a.jsx)(A.A,{className:"mr-2 h-4 w-4"}),er("tasks.submitForReview")]}),si&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#22C55E] hover:bg-[#16A34A] text-white",onClick:()=>sn("done"),disabled:el,children:[(0,a.jsx)(y,{className:"mr-2 h-4 w-4"}),er("tasks.markAsVerified")]}),("done"===f.status||"closed"===f.status)&&(0,a.jsx)("div",{className:"text-sm text-[#9A9A9A] text-center w-full",children:er("tasks.taskCompleted")}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(U.Lt,{children:[(0,a.jsx)(U.tv,{asChild:!0,children:(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-9 w-9 border-border text-[#D32F2F] dark:text-[#F08078] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#D32F2F] hover:border-[#D32F2F]",children:(0,a.jsx)(w.A,{className:"h-4 w-4"})})}),(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:er("tasks.deleteTask")}),(0,a.jsx)(U.$v,{children:er("tasks.deleteTaskConfirm",{title:f.title})})]}),(0,a.jsxs)(U.ck,{children:[(0,a.jsx)(U.Zr,{children:er("common.cancel")}),(0,a.jsx)(U.Rx,{variant:"destructive",onClick:sd,disabled:se,children:se?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),er("common.delete")]}):er("common.delete")})]})]})]})})]}):null})})]}),f&&e_&&(0,a.jsx)(eo,{task:f,projectUuid:P,currentUserUuid:Q,onClose:()=>eR(!1)})]})}},70633:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},81531:(e,s,t)=>{t.d(s,{T:()=>i});var a=t(1856),r=t(23675);function i(e,s){var t;let i=(0,r.useSearchParams)(),n=(0,a.useRef)(!1),c=!n.current;n.current=!0;let l=null!=(t=i.get("panel"))?t:c&&null!=s?s:null,d=i.get("tab"),o=(0,a.useCallback)((s,t)=>{let a=new URLSearchParams(window.location.search);s?a.set("panel",s):a.delete("panel"),t?a.set("tab",t):a.delete("tab");let r=a.toString();return r?"".concat(e,"?").concat(r):e},[e]),u=(0,a.useCallback)((e,s)=>{window.history.replaceState(null,"",o(e,s))},[o]),m=(0,a.useCallback)(()=>{window.history.replaceState(null,"",o(null))},[o]),x=(0,a.useCallback)(e=>{l&&window.history.replaceState(null,"",o(l,e))},[o,l]);return{selectedId:l,selectedTab:d,openPanel:u,closePanel:m,switchTab:x}}},89380:(e,s,t)=>{t.d(s,{w:()=>r});var a=t(52217);let r=(0,a.createServerReference)("60710f73908300a408c278b718099732a2326cc12b",a.callServer,void 0,a.findSourceMapURL,"addTaskDependencyAction")},90795:(e,s,t)=>{t.d(s,{Bj:()=>l,L8:()=>r,Wl:()=>d,_5:()=>c,eT:()=>i,fw:()=>n});var a=t(38106);let r=480;function i(e){switch(e){case"done":return"bg-[#00796B]";case"in_progress":return"bg-[#1976D2]";case"to_verify":return"bg-[#7B1FA2]";case"open":case"assigned":return"bg-[#E65100]";case"closed":return"bg-[#9A9A9A]";default:return"bg-[#D9D9D9]"}}function n(e,s){let t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4),n=Math.floor(r/36e5),c=Math.floor(r/864e5);return i<1?s("time.justNow"):i<60?s("time.minutesAgo",{minutes:i}):n<24?s("time.hoursAgo",{hours:n}):c<7?s("time.daysAgo",{days:c}):(0,a.r)(t)}let c={todo:"bg-[#FFF3E0] text-[#E65100] dark:bg-[#3a2a12] dark:text-[#F0A050]",in_progress:"bg-[#E3F2FD] text-[#1976D2] dark:bg-[#13253a] dark:text-[#5AA9F0]",human_conduct_required:"bg-[#F3E5F5] text-[#7B1FA2] dark:bg-[#281630] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] text-[#00796B] dark:bg-[#12292a] dark:text-[#4FD1C0]"},l={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"},d={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done"}},92745:(e,s,t)=>{t.d(s,{_u:()=>A,c_:()=>f,nF:()=>k,qK:()=>j});var a=t(90508),r=t(1856),i=t(26145),n=t(75380);t(33805);var c=t(10196),l=t.n(c),d=t(39268),o=t(57731),u=t(49914);let m={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"},x={open:"#E65100",assigned:"#1976D2",in_progress:"#5A9E6F",to_verify:"#7B1FA2",done:"#00796B",closed:"#9A9A9A"},p={low:"priority.low",medium:"priority.medium",high:"priority.high",critical:"priority.critical"},h={open:"status.open",assigned:"status.assigned",in_progress:"status.inProgress",to_verify:"status.toVerify",done:"status.done",closed:"status.closed"},g={low:"bg-[#9A9A9A]",medium:"bg-[#E65100]",high:"bg-[#D32F2F]",critical:"bg-[#B71C1C]"},f={taskNode:function(e){let{data:s}=e,t=(0,d.c)();return(0,a.jsxs)("div",{className:"rounded-lg border-2 border-[#E5E2DC] dark:border-[#2a2a2e] bg-card px-4 py-3 shadow-sm min-w-[200px] max-w-[260px] cursor-pointer hover:border-primary transition-colors",children:[(0,a.jsx)(i.h7,{type:"target",position:n.yX.Top,className:"!bg-primary !w-2 !h-2"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)(o.E,{className:"text-[10px] ".concat(m[s.status]||""),children:t(h[s.status]||s.status)}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"h-1.5 w-1.5 rounded-full ".concat(g[s.priority]||"")}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground",children:t(p[s.priority]||s.priority)})]})]}),(0,a.jsx)("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:s.title}),(0,a.jsx)(i.h7,{type:"source",position:n.yX.Bottom,className:"!bg-primary !w-2 !h-2"})]})}},v={taskNode:function(e){let{data:s}=e,t=x[s.status]||"#E5E0D8";return(0,a.jsxs)("div",{className:"rounded-md border-[1.5px] bg-card px-2.5 py-1.5 shadow-sm",style:{borderColor:t,width:b},children:[(0,a.jsx)(i.h7,{type:"target",position:n.yX.Top,className:"!bg-primary !w-1.5 !h-1.5"}),(0,a.jsx)("p",{className:"text-[10px] font-medium text-foreground leading-tight line-clamp-2",children:s.title}),(0,a.jsx)(i.h7,{type:"source",position:n.yX.Bottom,className:"!bg-primary !w-1.5 !h-1.5"})]})}},b=150,j={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}},N={animated:!0,style:{stroke:"#C67A52",strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function k(e,s,t){var a,r,i,n;let c=null!=(a=null==t?void 0:t.nodeWidth)?a:240,d=null!=(r=null==t?void 0:t.nodeHeight)?r:80,o=new(l()).graphlib.Graph;return o.setDefaultEdgeLabel(()=>({})),o.setGraph({rankdir:"TB",nodesep:null!=(i=null==t?void 0:t.nodesep)?i:50,ranksep:null!=(n=null==t?void 0:t.ranksep)?n:80}),e.forEach(e=>{o.setNode(e.id,{width:c,height:d})}),s.forEach(e=>{o.setEdge(e.source,e.target)}),l().layout(o),{nodes:e.map(e=>{let s=o.node(e.id);return{...e,position:{x:s.x-c/2,y:s.y-d/2}}}),edges:s}}function A(e){let{tasks:s,edges:t,readonly:n=!1,compact:c=!1,height:l,onNodeClick:o,className:m}=e,x=(0,d.c)(),p=(0,u.W)(),{layoutedNodes:h,layoutedEdges:g}=(0,r.useMemo)(()=>{let e=s.map(e=>{var s;return{id:e.uuid,type:"taskNode",position:{x:0,y:0},data:{title:e.title,status:e.status,priority:e.priority,proposalUuid:null!=(s=e.proposalUuid)?s:null}}}),a=k(e,t.map((e,s)=>({id:"e-".concat(s),source:e.to,target:e.from,...c?N:j})),c?{nodeWidth:b,nodeHeight:50,nodesep:20,ranksep:40}:void 0);return{layoutedNodes:a.nodes,layoutedEdges:a.edges}},[s,t,c]);return 0===s.length?(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-muted-foreground ".concat(m||""),style:l?{height:l}:void 0,children:x("tasks.noTasksToDisplay")}):(0,a.jsx)("div",{className:"rounded-[10px] border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] ".concat(m||""),style:l?{height:l}:void 0,children:(0,a.jsxs)(i.Gc,{colorMode:p?"dark":"light",nodes:h,edges:g,nodeTypes:c?v:f,onNodeClick:o?(e,s)=>o(s.id):void 0,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},nodesDraggable:!n,nodesConnectable:!n,elementsSelectable:!n,panOnDrag:!0,zoomOnScroll:!0,children:[(0,a.jsx)(i.VS,{color:p?"#40392f":"#E5E0D8",gap:20}),!n&&(0,a.jsx)(i.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})})}},93372:(e,s,t)=>{t.d(s,{h:()=>r});var a=t(52217);let r=(0,a.createServerReference)("403bb8eed37146b5b22efb591bf87dc5803877cdd5",a.callServer,void 0,a.findSourceMapURL,"getBatchWorkerCountsAction")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75257],{875:(e,t,a)=>{a.d(t,{i:()=>v});var s=a(90508),n=a(1856),r=a(39268),i=a(85226),l=a(22922),o=a(97438),d=a(14554),c=a(15972),u=a(88064),x=a(39077),m=a(39674),p=a(42305),h=a(62990),f=a(59208),g=a(94643);function v(e){var t;let{open:a,onOpenChange:v,onCloseAutoFocus:b,projectUuid:j,onCreated:y,parentUuid:k,parentTitle:N}=e,w=(0,r.c)("ideaTracker"),C=(0,r.c)("ideaTracker.lineage"),S=!!k,A=(0,r.c)("common"),[F,E]=(0,n.useState)(""),[_,D]=(0,n.useState)(""),[T,U]=(0,n.useState)(!1),[R,P]=(0,n.useState)(!1),[I,M]=(0,n.useState)(null),[B,L]=(0,n.useState)(!1),[z,O]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!a||S)return;let e=!1;return(0,h.tm)("/api/projects/".concat(encodeURIComponent(j),"/agent-cwds")).then(async t=>{if(!t.ok)return;let a=await t.json();if(!e){var s,n;O((null!=(n=null==a||null==(s=a.data)?void 0:s.agents)?n:[]).some(e=>e.preference))}}).catch(()=>{e||O(!1)}),()=>{e=!0}},[S,a,j]);let V=(0,f.kz)(),q=(null!=(t=null==V?void 0:V.connections)?t:[]).some(e=>"online"===e.effectiveStatus),[$,K]=(0,n.useState)("form"),H=!S,G=S?"form":$,J=async()=>{let e=F.trim();if(e){P(!0),M(null);try{var t;let a=await fetch("/api/projects/".concat(j,"/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,content:_.trim()||void 0,...k?{parentUuid:k}:{},...T?{isContainer:!0}:{}})}),s=await a.json();s.success&&(null==(t=s.data)?void 0:t.uuid)?(E(""),D(""),U(!1),v(!1),null==y||y(s.data.uuid)):M(s.error||w("error.createFailed"))}catch(e){M(w("error.createFailed"))}finally{P(!1)}}},Q=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4 py-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(u.J,{htmlFor:"idea-title",children:w("newIdea.ideaTitle")}),(0,s.jsx)(d.p,{id:"idea-title",value:F,onChange:e=>E(e.target.value),placeholder:w("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:e=>{!(0,p.P)(e)&&"Enter"===e.key&&!e.shiftKey&&F.trim()&&(e.preventDefault(),J())}})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(u.J,{htmlFor:"idea-content",children:[w("newIdea.description"),(0,s.jsxs)("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:["(",A("optional"),")"]})]}),(0,s.jsx)(c.T,{id:"idea-content",value:_,onChange:e=>D(e.target.value),placeholder:w("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(x.S,{id:"idea-is-container",checked:T,onCheckedChange:e=>U(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,s.jsx)(u.J,{htmlFor:"idea-is-container",className:"cursor-pointer",children:C("makeContainer")}),(0,s.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:C("containerHint")})]})]}),I&&(0,s.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:I})]}),(0,s.jsxs)(o.Es,{children:[(0,s.jsx)(l.$,{variant:"outline",onClick:()=>v(!1),disabled:R,children:A("cancel")}),(0,s.jsxs)(l.$,{onClick:J,disabled:R||!F.trim(),className:"bg-primary hover:bg-[#B56A42] text-white",children:[R?(0,s.jsx)(i.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,A("create")]})]})]}),W=async e=>{let t=await (0,h.tm)("/api/ideas/conversational",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectUuid:j,agentUuid:e.agentUuid,connectionUuid:e.connectionUuid,descriptionText:e.userText,...B?{decompose:!0}:{}})});if(!t.ok){let e=null;try{let a=await t.json();"string"==typeof(null==a?void 0:a.error)&&a.error&&(e=a.error)}catch(e){}throw new g.fF(t.status,e)}let a=null;try{var s;let e=await t.json();(null==e?void 0:e.success)&&(null==(s=e.data)?void 0:s.session)&&(a=e.data.session)}catch(e){}if(!a)throw new g.fF(t.status,null);return a},X=(0,s.jsxs)("div",{className:"space-y-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(x.S,{id:"idea-decompose",checked:B,onCheckedChange:e=>L(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,s.jsx)(u.J,{htmlFor:"idea-decompose",className:"cursor-pointer",children:w("newIdea.decompose")}),(0,s.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:w("newIdea.decomposeHint")})]})]}),(0,s.jsx)(g.jH,{projectUuid:j,dispatch:W,onStarted:e=>{v(!1),null==V||V.openChatForSession(e)}})]});return(0,s.jsx)(o.lG,{open:a,onOpenChange:v,children:(0,s.jsxs)(o.Cf,{className:"sm:max-w-[480px]",onCloseAutoFocus:b,children:[(0,s.jsxs)(o.c7,{children:[(0,s.jsx)(o.L3,{children:S?C("deriveIdea"):w("newIdea.title")}),S&&N&&(0,s.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[C("derivedFrom")," \xb7 ",N]})]}),H&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.tU,{value:G,onValueChange:e=>K(e),children:(0,s.jsxs)(m.j7,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(m.Xi,{value:"form",children:w("newIdea.modeForm")}),(0,s.jsx)(m.Xi,{value:"conversation",disabled:!q&&!z,children:w("newIdea.modeConversation")})]})}),!q&&(0,s.jsxs)("div",{className:"rounded-xl border border-[#EFEBE4] dark:border-[#2a2a2e] bg-[#FCFBF8] dark:bg-[#1e1d1b] px-3 py-2",children:[(0,s.jsx)("p",{className:"px-1 pt-1 text-[12px] font-medium text-muted-foreground",children:w("newIdea.modeConversationOfflineHint")}),(0,s.jsx)(g.Bs,{variant:"compact"})]})]}),"form"===G?Q:X]})})}},5725:(e,t,a)=>{a.d(t,{b:()=>d});var s=a(1856),n=a(93367),r=a(90508),i="horizontal",l=["horizontal","vertical"],o=s.forwardRef((e,t)=>{var a;let{decorative:s,orientation:o=i,...d}=e,c=(a=o,l.includes(a))?o:i;return(0,r.jsx)(n.sG.div,{"data-orientation":c,...s?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...d,ref:t})});o.displayName="Separator";var d=o},19352:(e,t,a)=>{a.d(t,{Q:()=>n});var s=a(52217);let n=(0,s.createServerReference)("402d221559af2e1f9487f4911b76b769f6bed33cf7",s.callServer,void 0,s.findSourceMapURL,"getTaskAction")},24522:(e,t,a)=>{a.d(t,{K:()=>p});var s=a(90508),n=a(1856),r=a(39268),i=a(70633),l=a(9160),o=a(22922),d=a(57731),c=a(64993),u=a(11227),x=a(82523),m=a(90795);function p(e){let{title:t,type:a,content:p,mode:h="overlay",onClose:f,onBack:g}=e,v=(0,r.c)("documents"),[b,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=setTimeout(()=>j(!0),300);return()=>clearTimeout(e)},[]),(0,n.useEffect)(()=>{let e=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),f())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);let y="sidebyside"===h;return(0,s.jsxs)(s.Fragment,{children:[!y&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:f}),(0,s.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ".concat(y?"z-40 ".concat(b?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(b?"":"animate-in slide-in-from-right duration-300")),style:y?{right:"".concat(m.L8,"px")}:void 0,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[g&&(0,s.jsx)(o.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:g,children:(0,s.jsx)(i.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:t}),(0,s.jsx)("div",{className:"mt-1.5",children:(0,s.jsx)(d.E,{variant:"outline",className:"text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:v(x.y[a]||"typeOther")})})]}),(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-border",onClick:f,children:(0,s.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,s.jsx)(c.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,s.jsx)("div",{className:"px-6 py-5 text-[13px] leading-relaxed text-foreground prose prose-sm max-w-none [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-sm [&_h3]:font-medium [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:text-[13px] [&_p]:text-foreground/80 [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-foreground/80 [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-foreground [&_code]:text-[12px] [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_pre]:bg-secondary [&_pre]:text-foreground [&_pre]:p-3 [&_pre]:rounded-lg [&_pre]:my-2 [&_a]:text-primary",children:(0,s.jsx)(u.MarkdownContent,{children:(0,x.j)(p)})})})]})]})}},39077:(e,t,a)=>{a.d(t,{S:()=>l});var s=a(90508);a(1856);var n=a(60532),r=a(98861),i=a(24377);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"checkbox",className:(0,i.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,s.jsx)(n.A,{className:"size-3.5"})})})}},39674:(e,t,a)=>{a.d(t,{Xi:()=>o,av:()=>d,j7:()=>l,tU:()=>i});var s=a(90508);a(1856);var n=a(79834),r=a(24377);function i(e){let{className:t,...a}=e;return(0,s.jsx)(n.Root,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(n.List,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",t),...a})}},48127:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(66206).A)("corner-down-right",[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]])},64131:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(66206).A)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]])},71921:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(66206).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},77390:(e,t,a)=>{a.d(t,{C:()=>r});var s=a(90508),n=a(24377);function r(e){let{done:t,total:a,size:r=14,stroke:i=2,className:l,color:o="#B26B3D",trackColor:d="#EAD9C8"}=e,c=(r-i)/2,u=2*Math.PI*c,x=a>0?Math.min(1,Math.max(0,t/a)):0,m=a>0&&t>=a;return(0,s.jsxs)("svg",{width:r,height:r,viewBox:"0 0 ".concat(r," ").concat(r),className:(0,n.cn)("shrink-0",l),role:"img","aria-label":"".concat(t,"/").concat(a),children:[(0,s.jsx)("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:d,strokeWidth:i}),x>0&&(0,s.jsx)("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:m?"#1D9E75":o,strokeWidth:i,strokeDasharray:u,strokeDashoffset:u*(1-x),strokeLinecap:"round",transform:"rotate(-90 ".concat(r/2," ").concat(r/2,")")})]})}},79834:(e,t,a)=>{a.r(t),a.d(t,{Content:()=>D,List:()=>E,Root:()=>F,Tabs:()=>b,TabsContent:()=>C,TabsList:()=>y,TabsTrigger:()=>N,Trigger:()=>_,createTabsScope:()=>h});var s=a(1856),n=a(33328),r=a(21032),i=a(94782),l=a(19900),o=a(93367),d=a(72599),c=a(66249),u=a(40577),x=a(90508),m="Tabs",[p,h]=(0,r.A)(m,[i.RG]),f=(0,i.RG)(),[g,v]=p(m),b=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,onValueChange:n,defaultValue:r,orientation:i="horizontal",dir:l,activationMode:p="automatic",...h}=e,f=(0,d.jH)(l),[v,b]=(0,c.i)({prop:s,onChange:n,defaultProp:null!=r?r:"",caller:m});return(0,x.jsx)(g,{scope:a,baseId:(0,u.B)(),value:v,onValueChange:b,orientation:i,dir:f,activationMode:p,children:(0,x.jsx)(o.sG.div,{dir:f,"data-orientation":i,...h,ref:t})})});b.displayName=m;var j="TabsList",y=s.forwardRef((e,t)=>{let{__scopeTabs:a,loop:s=!0,...n}=e,r=v(j,a),l=f(a);return(0,x.jsx)(i.bL,{asChild:!0,...l,orientation:r.orientation,dir:r.dir,loop:s,children:(0,x.jsx)(o.sG.div,{role:"tablist","aria-orientation":r.orientation,...n,ref:t})})});y.displayName=j;var k="TabsTrigger",N=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,disabled:r=!1,...l}=e,d=v(k,a),c=f(a),u=S(d.baseId,s),m=A(d.baseId,s),p=s===d.value;return(0,x.jsx)(i.q7,{asChild:!0,...c,focusable:!r,active:p,children:(0,x.jsx)(o.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...l,ref:t,onMouseDown:(0,n.mK)(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(s)}),onKeyDown:(0,n.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(s)}),onFocus:(0,n.mK)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||r||!e||d.onValueChange(s)})})})});N.displayName=k;var w="TabsContent",C=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,forceMount:r,children:i,...d}=e,c=v(w,a),u=S(c.baseId,n),m=A(c.baseId,n),p=n===c.value,h=s.useRef(p);return s.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,x.jsx)(l.C,{present:r||p,children:a=>{let{present:s}=a;return(0,x.jsx)(o.sG.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!s,id:m,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:s&&i})}})});function S(e,t){return"".concat(e,"-trigger-").concat(t)}function A(e,t){return"".concat(e,"-content-").concat(t)}C.displayName=w;var F=b,E=y,_=N,D=C},82523:(e,t,a)=>{function s(e){return e.replace(/\\n/g,"\n")}a.d(t,{j:()=>s,y:()=>n});let n={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"}},90612:(e,t,a)=>{a.d(t,{U:()=>u});var s=a(90508),n=a(1856),r=a(39268),i=a(91385),l=a(22922),o=a(17001),d=a(24377);function c(e){var t;return null!=(t=e.agentName)?t:e.agentUuid}function u(e){let{sessions:t,onSelect:a,surface:u,className:x}=e,m=(0,r.c)("activeSessions"),[p,h]=(0,n.useState)(!1),f=(0,n.useRef)(null);if((0,n.useEffect)(()=>()=>{null!==f.current&&clearTimeout(f.current)},[]),0===t.length)return null;let g=t.some(e=>e.canOpen),v=1===t.length&&t[0].canOpen,b=t[0],j=()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},y=()=>{j(),f.current=setTimeout(()=>h(!1),120)},k=e=>{e.canOpen&&(h(!1),a(e))},N=(0,s.jsxs)(l.$,{type:"button",variant:"outline",size:"tracker"===u?"xs":"icon-sm","data-testid":"".concat(u,"-active-session-indicator"),"aria-label":m(g?"indicatorLabel":"statusOnlyIndicatorLabel",{count:t.length}),"aria-disabled":!g,"aria-haspopup":t.length>1?"dialog":void 0,onPointerDown:e=>e.stopPropagation(),onPointerEnter:v?void 0:e=>{"touch"!==e.pointerType&&(j(),h(!0))},onPointerLeave:v?void 0:e=>{"touch"!==e.pointerType&&y()},onFocus:v?void 0:()=>h(!0),onClick:e=>{if(e.stopPropagation(),j(),v)return void k(b);p&&e.preventDefault()},onKeyDown:e=>e.stopPropagation(),className:(0,d.cn)("group/active relative gap-1.5 overflow-visible border-emerald-500/35 bg-emerald-500/10 font-semibold text-emerald-700 shadow-none transition-[background-color,border-color,box-shadow] hover:border-emerald-500/60 hover:bg-emerald-500/15 hover:text-emerald-700 hover:shadow-[0_3px_10px_-5px_rgba(16,185,129,0.8)] focus-visible:border-emerald-500 focus-visible:ring-emerald-500/50 dark:border-emerald-500/35 dark:bg-emerald-500/10 dark:text-emerald-300 dark:hover:border-emerald-500/60 dark:hover:bg-emerald-500/15 dark:hover:text-emerald-300","tracker"===u?"h-7 min-w-7 px-1 text-[11px]":"sidebar"===u?"h-8 min-w-8 px-1 text-[11px]":"h-9 min-w-9 px-1 text-[11px] shadow-sm",x),children:[(0,s.jsxs)("span",{className:"relative shrink-0","aria-hidden":!0,children:[(0,s.jsx)(i.AgentAvatar,{name:c(b),size:"graph"===u?22:20,className:"rounded-full ring-1 ring-emerald-600/25"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2 rounded-full border-2 border-card bg-emerald-500"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2 rounded-full bg-emerald-400/75 motion-safe:animate-ping motion-reduce:animate-none"})]}),t.length>1&&(0,s.jsx)("span",{children:t.length})]});return v?N:(0,s.jsxs)(o.AM,{open:p,onOpenChange:h,children:[(0,s.jsx)(o.Wv,{asChild:!0,children:N}),(0,s.jsxs)(o.hl,{align:"start",sideOffset:6,onCloseAutoFocus:e=>e.preventDefault(),onPointerDown:e=>e.stopPropagation(),onPointerEnter:j,onPointerLeave:y,onClick:e=>e.stopPropagation(),className:"w-[min(22rem,calc(100vw-2rem))] p-1.5","aria-label":m("chooserLabel"),children:[(0,s.jsx)("p",{className:"px-2 pb-1.5 pt-1 text-xs font-medium text-muted-foreground",children:m("runningCount",{count:t.length})}),(0,s.jsx)("div",{className:"max-h-64 overflow-y-auto",children:t.map(e=>{var t,a;return(0,s.jsxs)(l.$,{type:"button",variant:"ghost",disabled:!e.canOpen,"aria-label":e.canOpen?c(e):m("statusOnlyEntry",{agent:c(e)}),onClick:()=>k(e),className:"group/session h-auto w-full min-w-0 items-start justify-start gap-2.5 whitespace-normal px-2 py-2 text-left disabled:cursor-not-allowed disabled:opacity-65",children:[(0,s.jsxs)("span",{className:"relative mt-0.5 shrink-0","aria-hidden":!0,children:[(0,s.jsx)(i.AgentAvatar,{name:c(e),size:30,className:"rounded-lg ring-1 ring-border transition-shadow group-hover/session:ring-emerald-500/45"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2.5 rounded-full border-2 border-card bg-emerald-500"})]}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block truncate text-xs font-medium text-foreground",children:c(e)}),(0,s.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:e.connectionAvailable?m("location",{host:null!=(t=e.host)?t:m("unknownHost"),cwd:null!=(a=e.cwd)?a:m("unknownCwd")}):m("agentFallback")}),!e.canOpen&&(0,s.jsx)("span",{className:"block text-[11px] font-medium text-muted-foreground",children:m("statusOnly")})]})]},e.sessionUuid)})})]})]})}},94221:(e,t,a)=>{a.d(t,{D:()=>tr});var s=a(90508),n=a(1856),r=a(39268),i=a(91814),l=a(67587),o=a(9160),d=a(85226),c=a(64131),u=a(66206);let x=(0,u.A)("corner-left-up",[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);var m=a(48127),p=a(34956),h=a(22922),f=a(64993),g=a(57731),v=a(14554),b=a(15972),j=a(88064),y=a(12210),k=a(51817),N=a(63964),w=a(5425),C=a(84247),S=a(59390),A=a(11227),F=a(16544),E=a(65626),_=a(73693),D=a(91385),T=a(92691),U=a(94643),R=a(29532);function P(e){let{assignee:t,onReassign:a,editable:n}=e,i=(0,r.c)("common"),l=!0===n&&"function"==typeof a,o=i(t?"reassign":"assign"),d=t?(0,s.jsxs)(s.Fragment,{children:[(0,R.bB)(t)?(0,s.jsx)(D.AgentAvatar,{name:t.name,size:28,className:"rounded-full"}):(0,s.jsx)(_.eu,{className:"h-7 w-7",children:(0,s.jsx)(_.q5,{className:"bg-border text-muted-foreground",children:t.name.charAt(0).toUpperCase()})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t.name}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:i((0,R.bB)(t)?"agent":"user")}),"agent_instance"===t.type&&t.instance&&(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(U.jQ,{cwd:t.instance.cwd,host:t.instance.host})})]})]}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:i("unassigned")}),c="mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3";return(0,s.jsxs)("div",{children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:i("assignee")}),l?(0,s.jsx)(T.Bc,{delayDuration:300,children:(0,s.jsxs)(T.m_,{children:[(0,s.jsx)(T.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:a,"aria-label":o,className:"".concat(c," w-full cursor-pointer text-left"),children:d})}),(0,s.jsx)(T.ZI,{children:o})]})}):(0,s.jsx)("div",{className:c,children:d})]})}function I(e){let{idea:t,elaboration:a,isLoading:n,onRefresh:i,onReassign:l,canReassign:o}=e,c=(0,r.c)("ideaTracker"),u=(0,r.c)("common");return n?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-primary"})}):(0,s.jsxs)(F.P.div,{variants:E.qG,initial:"initial",animate:"animate",children:[(0,s.jsx)(P,{assignee:t.assignee,onReassign:l,editable:o}),(0,s.jsx)(C.Separator,{className:"my-5 bg-secondary"}),a&&a.rounds.length>0?(0,s.jsx)("div",{children:(0,s.jsx)(S.R,{ideaUuid:t.uuid,elaboration:a,onRefresh:i})}):"open"===t.status?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0] dark:bg-[#3a2a12]",children:(0,s.jsx)(w.A,{className:"h-5 w-5 text-[#E65100] dark:text-[#F0A050]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:c("panel.elaborationNotStarted")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("panel.elaborationNotStartedDesc")})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD] dark:bg-[#13253a]",children:(0,s.jsx)(w.A,{className:"h-5 w-5 text-[#1976D2] dark:text-[#5AA9F0]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:c("panel.elaborationWaiting")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("panel.elaborationWaitingDesc")})]})]}),t.content&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(C.Separator,{className:"my-5 bg-secondary"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:u("content")}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,s.jsx)(A.MarkdownContent,{children:t.content})})})]})]})]})}var M=a(12790),B=a.n(M),L=a(71921),z=a(78948),O=a(37915),V=a(17730),q=a(32470),$=a(96213),K=a(47754),H=a(92745),G=a(82523),J=a(31475),Q=a(14663),W=a(67712);function X(e){let{idea:t,projectUuid:a,onTaskClick:i,onDocClick:l,initialProposals:o}=e,c=(0,r.c)("ideaTracker"),[u,x]=(0,n.useState)(null!=o?o:[]),[m,p]=(0,n.useState)(!o),h=(0,n.useCallback)(async()=>{try{let e=await (0,J.U)(a,t.uuid);if(e.success)return x(e.data),e.data}catch(e){W.q.error("Failed to fetch proposals:",e)}finally{p(!1)}return[]},[a,t.uuid]);(0,n.useEffect)(()=>{o||h()},[h,o]);let f=(0,n.useRef)(u);f.current=u;let{getPresence:g}=(0,K.xQ)();return((0,N.eV)("proposal",async()=>{let e=f.current;for(let r of(await h())){var t,a,s,n;let i=e.find(e=>e.uuid===r.uuid);if(!i)continue;let l=new Set((null!=(t=i.documentDrafts)?t:[]).map(e=>e.uuid)),o=new Set((null!=(a=i.taskDrafts)?a:[]).map(e=>e.uuid)),d=(null!=(s=r.documentDrafts)?s:[]).filter(e=>e.uuid&&!l.has(e.uuid)),c=(null!=(n=r.taskDrafts)?n:[]).filter(e=>e.uuid&&!o.has(e.uuid)),u=[...d.map(e=>e.uuid),...c.map(e=>e.uuid)];if(u.length>0){let e=g("proposal",r.uuid)[0];if(e)for(let t of u)(0,K.fv)({entityType:"proposal",entityUuid:r.uuid,subEntityType:"draft",subEntityUuid:t,agentUuid:e.agentUuid,agentName:e.agentName,action:"mutate"})}}}),m)?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-primary"})}):0===u.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5] dark:bg-[#281630]",children:(0,s.jsx)(L.A,{className:"h-5 w-5 text-[#7B1FA2] dark:text-[#C98FE0]"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:c("panel.noProposals")})]}):(0,s.jsx)("div",{className:"space-y-5",children:u.map(e=>(0,s.jsx)(Y,{proposal:e,projectUuid:a,onTaskClick:i,onDocClick:l},e.uuid))})}let Z={draft:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",pending:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",approved:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",rejected:"bg-[#FFEBEE] dark:bg-[#331619] text-[#C4574C] dark:text-[#F0897E]",revised:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"};function Y(e){let{proposal:t,projectUuid:a,onTaskClick:i,onDocClick:l}=e,o=(0,r.c)("ideaTracker"),d=(0,r.c)(),c=(0,r.c)("proposals"),u=(0,r.c)("tasks"),x=(0,r.c)("documents"),m=t.documentDrafts||[],p=t.taskDrafts||[],[f,v]=(0,n.useState)(new Set),[b,j]=(0,n.useState)("cards"),[y,k]=(0,n.useState)([]),N="approved"===t.status;(0,n.useEffect)(()=>{N&&(0,Q.c)(a,t.uuid).then(e=>{e.success&&k(e.data||[])}).catch(e=>W.q.error("Failed to fetch materialized tasks:",e))},[N,a,t.uuid]);let w=(0,n.useMemo)(()=>{let e=new Map;for(let t of y)e.set(t.title,t);return e},[y]),{dagTasks:C,dagEdges:S,dagHeight:F}=(0,n.useMemo)(()=>{let e=p.map(e=>{let t=w.get(e.title);return{uuid:(null==t?void 0:t.uuid)||e.uuid,title:e.title,status:(null==t?void 0:t.status)||"open",priority:e.priority||"medium"}}),t=[],a=new Map(p.map(e=>[e.uuid,e]));for(let e of p)if(e.dependsOnDraftUuids)for(let s of e.dependsOnDraftUuids){let n=w.get(e.title),r=a.get(s),i=r?w.get(r.title):void 0;t.push({from:(null==n?void 0:n.uuid)||e.uuid,to:(null==i?void 0:i.uuid)||s})}return{dagTasks:e,dagEdges:t,dagHeight:Math.max(350,90*e.length)}},[p,w]),E=N?y.filter(e=>"done"===e.status||"closed"===e.status).length:0;return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"text-[14px] font-semibold text-foreground truncate flex-1",children:t.title}),(0,s.jsx)(g.E,{className:"text-[11px] font-semibold border-0 shrink-0 ".concat(Z[t.status]||""),children:d("status.".concat(t.status))})]}),t.description&&(0,s.jsx)("div",{className:"max-h-[120px] overflow-y-auto text-[13px] leading-relaxed text-foreground/80 prose prose-sm max-w-none [&_h1]:text-sm [&_h2]:text-[13px] [&_h3]:text-xs [&_p]:text-[13px] [&_p]:text-foreground/80 [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-foreground/80 [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-foreground [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_a]:text-primary",children:(0,s.jsx)(A.MarkdownContent,{children:(0,G.j)(t.description)})}),(0,s.jsxs)(B(),{href:"/projects/".concat(a,"/proposals/").concat(t.uuid),className:"flex items-center gap-1 text-[13px] font-medium text-primary hover:underline",children:[o("panel.viewProposal"),(0,s.jsx)(z.A,{className:"h-3.5 w-3.5"})]}),m.length>0&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:c(N?"documents":"documentDrafts")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:m.length})]}),(0,s.jsx)("div",{className:"space-y-0",children:m.map((e,a)=>(0,s.jsx)($.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid||"draft-".concat(a),badgeInside:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-background transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>e.content&&(null==l?void 0:l({title:e.title,type:e.type,content:e.content})),children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)(g.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:x(G.y[e.type]||"typeOther")}),(0,s.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:e.title})]})},e.uuid||a))})]}),(p.length>0||y.length>0)&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:c(N?"tasks":"taskDrafts")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:N&&y.length>0?y.length:p.length})]}),(0,s.jsxs)("span",{className:"text-[12px] text-muted-foreground",children:[E,"/",N&&y.length>0?y.length:p.length]})]}),(0,s.jsx)("div",{className:"-mx-6 border-t border-border"}),S.length>0&&(0,s.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] p-0.5 mt-3 w-fit",children:[(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>j("cards"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("cards"===b?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:c("cardsView")}),(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>j("dag"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("dag"===b?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:u("dagView")})]}),"cards"===b&&(0,s.jsx)("div",{className:"space-y-0",children:N&&y.length>0?y.map(e=>(0,s.jsx)($.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,s.jsx)(ea,{task:{uuid:e.uuid,title:e.title},expanded:!1,onToggle:()=>{},onNavigate:i?()=>i(e.uuid):void 0,taskStatus:e.status})},e.uuid)):p.map((e,a)=>(0,s.jsx)($.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid,badgeInside:!0,children:(0,s.jsx)(ea,{task:e,expanded:f.has(a),onToggle:()=>{v(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t})}})},e.uuid))}),"dag"===b&&(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(H._u,{tasks:C,edges:S,readonly:!0,height:F,onNodeClick:i})})]}),0===m.length&&0===p.length&&0===y.length&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground italic",children:c("emptyContainer")})]})}let ee={open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",assigned:"border-[#1976D2] bg-[#1976D2]",in_progress:"border-[#5A9E6F] bg-[#5A9E6F]",to_verify:"border-[#7B1FA2] bg-[#7B1FA2]",done:"border-[#00796B] bg-[#00796B]",closed:"border-[#9A9A9A] bg-[#9A9A9A] dark:border-[#6b6862] dark:bg-[#6b6862]"},et={open:null,assigned:null,in_progress:{className:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",key:"inProgress"},to_verify:{className:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",key:"toVerify"},done:{className:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",key:"done"},closed:{className:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",key:"done"}};function ea(e){let{task:t,expanded:a,onToggle:n,onNavigate:i,taskStatus:l}=e,o=(0,r.c)("proposals"),d=(0,r.c)("acceptanceCriteria"),c=(0,r.c)("status"),u=t.acceptanceCriteriaItems||[],x=!!(t.description||u.length>0),m=l?ee[l]||ee.open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",p=l?et[l]:null,f=(0,s.jsx)("span",{className:"shrink-0 h-2 w-2 rounded-full border-[1.5px] ".concat(m," transition-colors")}),g=(0,s.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-muted-foreground",children:t.title}),v=p?(0,s.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ".concat(p.className),children:c(p.key)}):null;return i?(0,s.jsxs)(h.$,{variant:"ghost",onClick:i,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg transition-colors",children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),f,g,v]}):(0,s.jsxs)("div",{children:[(0,s.jsxs)(h.$,{variant:"ghost",onClick:x?n:void 0,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ".concat(x?"cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg":""," transition-colors"),children:[a?(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,s.jsx)(z.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),f,g,v]}),a&&x&&(0,s.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[t.description&&(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:t.description}),u.length>0&&(0,s.jsxs)("div",{className:"rounded-lg bg-background p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"text-[11px] font-semibold text-foreground",children:o("taskAcceptanceCriteria")})]}),(0,s.jsx)("div",{className:"space-y-1.5",children:u.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-[11px] leading-snug text-foreground/80 flex-1",children:e.description}),!1!==e.required&&(0,s.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100] dark:text-[#F0A050]",children:d("required")})]},t))})]})]})]})}var es=a(29767);let en=(0,u.A)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var er=a(56770),ei=a(60532),el=a(97964),eo=a(52217);let ed=(0,eo.createServerReference)("4010b1f49335f7077c1969615ef46d16e1474b81a7",eo.callServer,void 0,eo.findSourceMapURL,"getElaborationAction");var ec=a(90795);function eu(e){let{idea:t,proposals:a,tasks:i,onSelectTask:l}=e,o=(0,r.c)("ideaTracker"),d=(0,r.c)(),[c,u]=(0,n.useState)(null),[x,m]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{"open"!==t.status&&ed(t.uuid).then(e=>{e.success&&e.data&&u(e.data)})},[t.uuid,t.status]);let p=(0,n.useMemo)(()=>"open"===t.status?"idea_created":"elaborating"===t.status||0===a.length?"elaboration":a.some(e=>"approved"===e.status)&&i.length>0?"tasks":"proposal",[t.status,a,i]),h=(0,n.useMemo)(()=>{let e=["idea_created","elaboration","proposal","tasks"],t=e.indexOf(p);return e.map((e,a)=>({id:e,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[e],status:a<t?"completed":a===t?"active":"upcoming",icon:({idea_created:(0,s.jsx)(es.A,{className:"h-3.5 w-3.5"}),elaboration:(0,s.jsx)(en,{className:"h-3.5 w-3.5"}),proposal:(0,s.jsx)(L.A,{className:"h-3.5 w-3.5"}),tasks:(0,s.jsx)(q.A,{className:"h-3.5 w-3.5"})})[e]}))},[p]);(0,n.useEffect)(()=>{let e=h.find(e=>"active"===e.status);e&&m(new Set([e.id]))},[p]);let f=(0,n.useCallback)(e=>{m(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},[]),g=(0,n.useMemo)(()=>"open"===t.status?o("panel.timeline.noElaboration"):"skipped"===t.elaborationStatus?o("panel.timeline.elaborationSkipped"):"resolved"===t.elaborationStatus&&c?o("panel.timeline.elaborationComplete",{count:c.summary.totalQuestions}):"elaborating"===t.status?o("panel.timeline.elaborationInProgress"):c&&c.summary.totalQuestions>0?o("panel.timeline.elaborationComplete",{count:c.summary.totalQuestions}):o("panel.timeline.noElaboration"),[t.status,t.elaborationStatus,c,o]),v=(0,n.useMemo)(()=>{if(0===a.length)return o("panel.timeline.noProposal");let e=a.filter(e=>"approved"===e.status).length,t=a.filter(e=>"pending"===e.status).length;if(e>0&&1===a.length)return o("panel.timeline.proposalApproved");if(e>0)return o("panel.timeline.proposalsApproved",{count:e,total:a.length});if(t>0)return o("panel.timeline.proposalPending");switch(a[0].status){case"draft":default:return o("panel.timeline.proposalDraft");case"rejected":return o("panel.timeline.proposalRejected")}},[a,o]),b=(0,n.useMemo)(()=>{let e=0,t=0;for(let l of a){var s,n,r,i;e+=null!=(r=null==(s=l.documentDrafts)?void 0:s.length)?r:0,t+=null!=(i=null==(n=l.taskDrafts)?void 0:n.length)?i:0}return{docCount:e,taskDraftCount:t}},[a]),j=(0,n.useMemo)(()=>{let e=i.filter(e=>"done"===e.status||"closed"===e.status).length,t=i.filter(e=>"in_progress"===e.status).length;return{done:e,inProgress:t,toVerify:i.filter(e=>"to_verify"===e.status).length,open:i.filter(e=>"open"===e.status||"assigned"===e.status).length,total:i.length}},[i]);return(0,s.jsx)("div",{className:"space-y-0",children:h.map((e,n)=>{let r=x.has(e.id),u=n===h.length-1;return(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,s.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,s.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] dark:bg-[#12292a] flex items-center justify-center",children:(0,s.jsx)(ei.A,{className:"h-3 w-3 text-[#00796B] dark:text-[#4FD1C0]"})}):"active"===e.status?(0,s.jsx)("div",{className:"h-5 w-5 rounded-full bg-primary flex items-center justify-center",children:(0,s.jsx)(el.A,{className:"h-2 w-2 fill-white text-white"})}):(0,s.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-dashed border-[#D9D9D9] dark:border-[#3a3a40] flex items-center justify-center",children:(0,s.jsx)(el.A,{className:"h-2 w-2 text-muted-foreground"})})}),!u&&(0,s.jsx)("div",{className:"flex-1 w-px bg-border mt-1 min-h-[8px]"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 ".concat(u?"pb-0":"pb-4"),children:[(0,s.jsxs)("button",{onClick:()=>f(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[r?(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):(0,s.jsx)(z.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-[13px] font-medium ".concat("active"===e.status?"text-primary":"completed"===e.status?"text-foreground":"text-muted-foreground"),children:o(e.labelKey)}),!r&&(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground truncate ml-1",children:(e=>{switch(e.id){case"idea_created":return t.createdBy?t.createdBy.name:"";case"elaboration":return g;case"proposal":return v;case"tasks":return i.length>0?o("panel.timeline.tasksComplete",{done:j.done,total:j.total}):o("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let n=x.has(e.id);switch(e.id){case"idea_created":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[t.createdBy&&(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.createdBy",{name:t.createdBy.name})}),(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:(0,ec.fw)(t.createdAt,d)}),t.content&&(0,s.jsxs)("p",{className:"text-[12px] text-muted-foreground line-clamp-2",children:[t.content.slice(0,120),t.content.length>120?"...":""]})]}):null;case"elaboration":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:g}),c&&c.rounds.length>0&&(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.rounds",{count:c.rounds.length})})]}):null;case"proposal":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:v}),a.length>0&&(0,s.jsxs)("div",{className:"space-y-1",children:[b.docCount>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,s.jsx)(er.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:o("panel.timeline.documents",{count:b.docCount})})]}),b.taskDraftCount>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,s.jsx)(q.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:o("panel.timeline.tasks",{count:b.taskDraftCount})})]})]})]}):null;case"tasks":return n?(0,s.jsx)("div",{className:"mt-2 space-y-2",children:0===i.length?(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.noTasks")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] overflow-hidden flex",children:[j.done>0&&(0,s.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:"".concat(j.done/j.total*100,"%")}}),j.inProgress>0&&(0,s.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:"".concat(j.inProgress/j.total*100,"%")}}),j.toVerify>0&&(0,s.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:"".concat(j.toVerify/j.total*100,"%")}})]}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0",children:o("panel.timeline.tasksComplete",{done:j.done,total:j.total})})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[i.slice(0,5).map(e=>(0,s.jsxs)("button",{onClick:()=>l(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2 py-1.5 hover:bg-secondary transition-colors group cursor-pointer",children:[(0,s.jsx)(O.A,{className:"h-3 w-3 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,s.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,ec.eT)(e.status))}),(0,s.jsx)("span",{className:"flex-1 text-[12px] text-foreground truncate group-hover:text-primary",children:e.title})]},e.uuid)),i.length>5&&(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground px-2",children:o("panel.timeline.moreItems",{count:i.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}let ex=(0,eo.createServerReference)("60d6c20b61391ca050e15c30e3d228d688f8c5cc07",eo.callServer,void 0,eo.findSourceMapURL,"getReportsForIdeaAction");function em(e){let{projectUuid:t,ideaUuid:a,proposals:i,onDocClick:l}=e,o=(0,r.c)("idea"),c=(0,r.c)("documents"),[u,x]=(0,n.useState)([]),[m,p]=(0,n.useState)(!0),f=i.some(e=>"approved"===e.status),v=(0,n.useCallback)(async()=>{if(!f){x([]),p(!1);return}try{let e=await ex(t,a);if(e.success){let t=[...e.data].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());x(t.map(e=>{var t;return{uuid:e.uuid,title:e.title,type:e.type,content:null!=(t=e.content)?t:null,createdAt:e.createdAt}}))}}catch(e){W.q.error("Failed to fetch reports for idea:",e)}finally{p(!1)}},[t,a,f]);return((0,n.useEffect)(()=>{p(!0),v()},[v]),(0,N.eV)("document",v),m)?f?(0,s.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin text-primary"})}):null:0===u.length?null:(0,s.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:o("reportsList")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:u.length}),(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["\xb7 ",o("reportsAcrossProposals")]})]}),(0,s.jsx)("div",{className:"space-y-0",children:u.map(e=>(0,s.jsxs)(h.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-background transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>{var t;return l({title:e.title,type:"report",content:null!=(t=e.content)?t:""})},children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)(g.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:c(G.y[e.type]||"typeOther")}),(0,s.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:e.title})]},e.uuid))})]})}var ep=a(94903),eh=a(93372);let ef=["in_progress","to_verify","open","assigned","done","closed"];function eg(e){let{tasks:t,projectUuid:a,proposalUuids:i,onSelectTask:l}=e,o=(0,r.c)("ideaTracker"),[d,c]=(0,n.useState)({}),u=(0,n.useMemo)(()=>t.map(e=>e.uuid),[t]),x=(0,n.useCallback)(async()=>{if(0===u.length)return;let e=await (0,eh.h)(u);e.success&&e.data&&c(e.data)},[u]);(0,n.useEffect)(()=>{x()},[x]),(0,N.eV)("task",x);let m=(0,n.useMemo)(()=>{let e=[];for(let a of ef){let s=t.filter(e=>e.status===a);s.length>0&&e.push({status:a,tasks:s})}let a=new Set(ef),s=t.filter(e=>!a.has(e.status));return s.length>0&&e.push({status:"other",tasks:s}),e},[t]),[p,h]=(0,n.useState)(new Set),f=(0,n.useMemo)(()=>{let e=t.length,a=t.filter(e=>"done"===e.status||"closed"===e.status).length,s=0,n=0,r=0,i=0;for(let e of t)e.acceptanceSummary&&(s+=e.acceptanceSummary.total,n+=e.acceptanceSummary.passed,r+=e.acceptanceSummary.required,i+=e.acceptanceSummary.requiredPassed);return{total:e,done:a,acTotal:s,acPassed:n,acRequired:r,acRequiredPassed:i}},[t]);return 0===t.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,s.jsx)(q.A,{className:"h-8 w-8 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:o("panel.taskList.noTasks")})]}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] dark:bg-[#1e1e1c] px-3 py-2",children:[(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:o("panel.taskList.summary",{done:f.done,total:f.total})}),f.acTotal>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:"\xb7"}),(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:o("panel.taskList.acSummary",{passed:f.acRequiredPassed,total:f.acRequired})})]}),i.length>0&&(0,s.jsxs)(B(),{href:"/projects/".concat(a,"/tasks?proposalUuids=").concat(i.join(",")),className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-primary shrink-0",children:[o("panel.taskList.viewKanban"),(0,s.jsx)(z.A,{className:"h-3.5 w-3.5"})]})]}),m.map(e=>{let t=p.has(e.status);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.status,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[t?(0,s.jsx)(z.A,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,ec.eT)(e.status))}),(0,s.jsx)("span",{className:"text-[13px] font-medium text-foreground",children:function(e,t){switch(e){case"in_progress":return t("panel.taskList.inProgress");case"to_verify":return t("panel.taskList.toVerify");case"open":return t("panel.taskList.open");case"assigned":return t("panel.taskList.assigned");case"done":return t("panel.taskList.done");case"closed":return t("panel.taskList.closed");default:return e}}(e.status,o)}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground ml-auto",children:e.tasks.length})]}),!t&&(0,s.jsx)("div",{className:"ml-3 space-y-0.5",children:e.tasks.map(e=>{let t=d[e.uuid]||0,a=e.acceptanceSummary;return(0,s.jsx)($.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,s.jsxs)("button",{onClick:()=>l(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2.5 py-2 hover:bg-secondary transition-colors group cursor-pointer",children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat((0,ec.eT)(e.status))}),(0,s.jsx)("span",{className:"flex-1 text-[13px] text-foreground truncate group-hover:text-primary",children:e.title}),a&&a.total>0&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 shrink-0 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[(0,s.jsx)(ei.A,{className:"h-2.5 w-2.5"}),a.requiredPassed,"/",a.required]}),e.assignee&&(0,s.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-muted-foreground max-w-[72px] truncate",title:e.assignee.name,children:[(0,R.bB)(e.assignee)?(0,s.jsx)(D.AgentAvatar,{name:e.assignee.name,size:14,className:"shrink-0 rounded-full"}):(0,s.jsx)(ep.A,{className:"h-2.5 w-2.5 shrink-0"}),e.assignee.name.split(/[@\s]/)[0]]}),t>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-[#E8F5E9] dark:bg-[#14281a] text-[#2E7D32] dark:text-[#5FD07E] text-[9px] font-semibold shrink-0",title:o("panel.taskList.workersActive",{count:t}),children:t})]})},e.uuid)})})]},e.status)})]})}var ev=a(36378);function eb(e){let{ideaUuid:t}=e,a=(0,r.c)(),[i,l]=(0,n.useState)([]),[o,c]=(0,n.useState)(!0),u=(0,n.useCallback)(async()=>{c(!0),l((await (0,ev.x)(t)).activities),c(!1)},[t]);return(0,n.useEffect)(()=>{u()},[u]),(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("common.activity")}),(0,s.jsx)("div",{className:"mt-2",children:o?(0,s.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):0===i.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:a("common.noActivity")}):i.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,s.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] dark:border-[#3a3a40] bg-card"}),t<i.length-1&&(0,s.jsx)("div",{className:"flex-1 w-px bg-border mt-1"})]}),(0,s.jsxs)("div",{className:"flex-1 pb-3",children:[(0,s.jsx)("p",{className:"text-[13px] text-foreground",children:function(e,t){let{action:a,actorName:s}=e;switch(a){case"created":case"idea_created":return t("activity.ideaCreated",{actor:s});case"assigned":case"idea_assigned":return t("activity.ideaAssigned",{actor:s});case"claimed":case"idea_claimed":return t("activity.ideaClaimed",{actor:s});case"released":case"idea_released":return t("activity.ideaReleased",{actor:s});case"status_changed":case"idea_status_changed":return t("activity.ideaStatusChanged",{actor:s});case"edited":case"idea_edited":return t("activity.ideaEdited",{actor:s});case"reparented":case"idea_reparented":return t("activity.ideaReparented",{actor:s});case"elaboration_started":return t("activity.elaborationStarted",{actor:s});case"elaboration_answered":return t("activity.elaborationAnswered",{actor:s});case"elaboration_skipped":return t("activity.elaborationSkipped",{actor:s});case"elaboration_resolved":return t("activity.elaborationResolved",{actor:s});case"elaboration_followup":return t("activity.elaborationFollowup",{actor:s});default:return t("activity.genericAction",{actor:s,action:a})}}(e,a)}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:(0,ec.fw)(e.createdAt,a)})]})]},e.uuid))})]})}var ej=a(14628);function ey(e){let{ideaUuid:t,currentUserUuid:a,commentCount:i,onCommentCountChange:l}=e,o=(0,r.c)("ideaTracker"),[d,c]=(0,n.useState)("comments");return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-1 rounded-lg bg-secondary p-0.5",children:[(0,s.jsxs)("button",{onClick:()=>c("comments"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors flex items-center justify-center gap-1.5 cursor-pointer ".concat("comments"===d?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:[o("panel.activityTab.comments"),i>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-secondary text-muted-foreground text-[10px] font-semibold leading-none",children:i})]}),(0,s.jsx)("button",{onClick:()=>c("activity"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ".concat("activity"===d?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:o("panel.activityTab.activity")})]}),(0,s.jsx)("div",{children:"activity"===d?(0,s.jsx)(eb,{ideaUuid:t}):(0,s.jsx)(ej.$m,{targetType:"idea",targetUuid:t,currentUserUuid:a,onCountChange:l,compact:!0})})]})}var ek=a(15695),eN=a(24522),ew=a(57034);let eC=(0,u.A)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eS=a(30028),eA=a(97438),eF=a(4365),eE=a(24377);let e_=(0,eo.createServerReference)("406f95b9addaa8ce757103c99912f4934acdfb4efe",eo.callServer,void 0,eo.findSourceMapURL,"getProjectIdeasForPickerAction"),eD=(0,eo.createServerReference)("601c773a610859beeea545fced97ac43b9ce3a89a8",eo.callServer,void 0,eo.findSourceMapURL,"setIdeaParentAction");function eT(e){let{open:t,onOpenChange:a,ideaUuid:o,ideaTitle:c,projectUuid:u,currentParentUuid:x,descendantUuids:m,onChanged:p,onCloseAutoFocus:f}=e,g=(0,r.c)("ideaTracker.lineage"),v=(0,r.c)("common"),b=(0,i.r)(),[j,y]=(0,n.useState)([]),[k,N]=(0,n.useState)(!1),[w,C]=(0,n.useState)(!1),[S,A]=(0,n.useState)(!1),[F,E]=(0,n.useState)(null),_=new Set([o,...m]),D=(0,n.useCallback)(async()=>{C(!0),E(null);try{let e=await e_(u);e.success?(y(e.data),N(e.hasMore)):E(e.error)}catch(e){W.q.error("Failed to load parent candidates:",e),E(g("saveFailed"))}C(!1)},[u,g]);(0,n.useEffect)(()=>{t&&D()},[t,D]);let T=async e=>{if(!S){A(!0),E(null);try{let t=await eD(o,e);t.success?(l.oR.success(e?g("save"):g("detach")),a(!1),b.refresh(),p()):E(t.error||g("saveFailed"))}catch(e){E(e instanceof Error?e.message:g("saveFailed"))}A(!1)}};return(0,s.jsx)(eA.lG,{open:t,onOpenChange:a,children:(0,s.jsxs)(eA.Cf,{onCloseAutoFocus:f,children:[(0,s.jsxs)(eA.c7,{children:[(0,s.jsx)(eA.L3,{children:g("setParentTitle")}),(0,s.jsx)(eA.rr,{children:g("setParentDescription",{title:c})})]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-3 pt-1",children:[w?(0,s.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):(0,s.jsx)("div",{className:"rounded-md border border-border",children:(0,s.jsxs)(eF.uB,{children:[(0,s.jsx)(eF.G7,{placeholder:g("searchPlaceholder")}),(0,s.jsxs)(eF.oI,{children:[(0,s.jsx)(eF.xL,{children:g("noCandidates")}),(0,s.jsx)(eF.L$,{children:j.map(e=>{let t=_.has(e.uuid),a=e.uuid===x;return(0,s.jsxs)(eF.h_,{value:e.title,disabled:t,onSelect:()=>{t||T(e.uuid)},className:(0,eE.cn)("flex min-w-0 items-center justify-between gap-2",t&&"opacity-55",a&&"bg-primary/10"),children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",children:e.title}),t&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-[11px] font-medium text-[#B0654A] dark:text-[#EBA890]",children:[(0,s.jsx)(eC,{className:"h-3 w-3"}),g("cycleBlocked")]})]},e.uuid)})})]})]})}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-[#FBF0EB] dark:bg-[#221e1b] px-3 py-2.5",children:[(0,s.jsx)(eS.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[#B0654A] dark:text-[#EBA890]"}),(0,s.jsx)("p",{className:"text-[12px] leading-relaxed text-[#9A5238] dark:text-[#E9A088]",children:g("cycleWarning")})]}),k&&(0,s.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",role:"status",children:g("pickerTruncated")}),F&&(0,s.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:F})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-2",children:[x?(0,s.jsx)(h.$,{variant:"outline",className:"border-border",onClick:()=>T(null),disabled:S,children:g("detach")}):(0,s.jsx)("span",{}),(0,s.jsx)(h.$,{variant:"outline",className:"border-border",onClick:()=>a(!1),disabled:S,children:v("cancel")})]})]})})}var eU=a(875),eR=a(93485),eP=a(25378);let eI=(0,eo.createServerReference)("40a50c432460d16750433cb857a3ecf91c2b042b1d",eo.callServer,void 0,eo.findSourceMapURL,"getIdeaAction");var eM=a(19352),eB=a(43544),eL=a(64729),ez=a(44773),eO=a(11166),eV=a(42533),eq=a(62482),e$=a(84052),eK=a(95900),eH=a(57893),eG=a(25373),eJ=a(97413),eQ=a(66343),eW=a(68923),eX=a(89752),eZ=a(24176),eY=a(42305);let e0={default:"",verify:"text-[#1976D2] focus:text-[#155FA0] focus:bg-[#E3F2FD] dark:text-[#64B5F6] dark:focus:text-[#90CAF9] dark:focus:bg-[#102A43]",develop:"text-[#2E7D32] focus:text-[#256628] focus:bg-[#E8F5E9] dark:text-[#72D572] dark:focus:text-[#9AE69A] dark:focus:bg-[#17351D]",yolo:"text-[#6A4FB6] focus:text-[#584098] focus:bg-[#F1ECFA] dark:text-[#B39DDB] dark:focus:text-[#D1C4E9] dark:focus:bg-[#2A2040]",destructive:"text-destructive focus:text-destructive focus:bg-destructive/10"},e1="(max-width: 639px)";function e2(e){var t;if(!window.matchMedia)return()=>{};let a=window.matchMedia(e1);return null==(t=a.addEventListener)||t.call(a,"change",e),()=>{var t;return null==(t=a.removeEventListener)?void 0:t.call(a,"change",e)}}function e5(){var e,t;return!!(null==(e=(t=window).matchMedia)?void 0:e.call(t,e1).matches)}function e3(e){let{label:t,icon:a,reason:r,onSelect:i,onTooltipEscape:l,tone:o="default"}=e,d=(0,n.useId)(),c=(0,s.jsxs)(eQ._2,{"aria-label":t,"aria-disabled":!!r,"aria-describedby":r?d:void 0,variant:"destructive"===o?"destructive":"default",className:(0,eE.cn)(e0[o],r&&"cursor-default text-muted-foreground focus:bg-accent focus:text-muted-foreground dark:focus:bg-accent dark:text-muted-foreground dark:focus:text-muted-foreground"),onKeyDown:e=>{"Enter"===e.key&&(0,eY.P)(e)&&e.preventDefault()},onSelect:e=>{r?e.preventDefault():i()},children:[a,(0,s.jsx)("span",{children:t}),r&&(0,s.jsx)("span",{id:d,className:"sr-only",children:r})]});return r?(0,s.jsxs)(T.m_,{children:[(0,s.jsx)(T.k$,{asChild:!0,children:c}),(0,s.jsx)(T.ZI,{side:"left",className:"z-[120] max-w-64",onEscapeKeyDown:l,children:r})]}):c}function e9(e){let{label:t,icon:a,reason:r,onSelect:i,tone:l="default"}=e,o=(0,n.useId)();return(0,s.jsxs)(h.$,{type:"button",variant:"ghost","aria-label":t,"aria-disabled":!!r,"aria-describedby":r?o:void 0,className:(0,eE.cn)("focus-visible:ring-ring flex min-h-12 w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm outline-none transition-colors","hover:bg-accent focus-visible:ring-2 [&_svg]:size-5 [&_svg]:shrink-0",e0[l],r&&"cursor-default text-muted-foreground hover:bg-transparent focus:bg-accent focus:text-muted-foreground dark:focus:bg-accent dark:text-muted-foreground dark:focus:text-muted-foreground"),onKeyDown:e=>{"Enter"===e.key&&(0,eY.P)(e)&&e.preventDefault()},onClick:()=>{r||i()},children:[a,(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block font-medium",children:t}),r&&(0,s.jsx)("span",{id:o,className:"mt-0.5 block text-xs leading-4 text-muted-foreground",children:r})]})]})}function e4(e){let t=(0,r.c)(),a=(0,r.c)("ideaTracker.panel.actions"),[i,o]=(0,n.useState)(!1),d=(0,n.useSyncExternalStore)(e2,e5,()=>!1),u=e.busy?a("busy"):void 0,m=u||e.stageReason||e.stageDataReason,f=async t=>{try{let s=t?new URL("/projects/".concat(e.projectUuid,"/dashboard?panel=").concat(e.ideaUuid),window.location.origin).href:e.ideaUuid;await navigator.clipboard.writeText(s),l.oR.success(a(t?"linkCopied":"uuidCopied"))}catch(e){l.oR.error(a("copyFailed"))}},g={ideaUuid:e.ideaUuid,assignee:e.assignee,assigneeName:e.assigneeName,proposals:e.proposals,tasks:e.tasks,onStarted:e.onStarted,disabledReason:m,onCloseAutoFocus:e.onCloseAutoFocus};return(0,s.jsx)(eX.w,{...g,renderAction:r=>(0,s.jsx)(eZ.s,{...g,disabledReason:m||(r.busy?a("busy"):void 0),renderAction:l=>{let m=u||(r.busy||l.busy?a("busy"):void 0),g=[[{label:t("elaboration.verifyButton"),icon:(0,s.jsx)(eV.A,{}),reason:m||e.stageReason||e.verifyReason,onSelect:e.onVerify,tone:"verify"},{label:r.label,icon:(0,s.jsx)(eq.A,{}),reason:m||r.disabledReason,onSelect:r.onSelect,tone:"develop"},{label:l.label,icon:(0,s.jsx)(e$.A,{}),reason:m||l.disabledReason,onSelect:l.onSelect,tone:"yolo"}],[{label:t("ideaTracker.lineage.deriveIdea"),icon:(0,s.jsx)(c.A,{}),reason:m,onSelect:e.onDerive,tone:"default"},{label:t("ideaTracker.lineage.setParentTitle"),icon:(0,s.jsx)(x,{}),reason:m,onSelect:e.onSetParent,tone:"default"},{label:t("ideas.actions.move"),icon:(0,s.jsx)(eK.A,{}),reason:m,onSelect:e.onMove,tone:"default"},{label:t("ideas.editIdea"),icon:(0,s.jsx)(eH.A,{}),reason:m||e.editReason,onSelect:e.onEdit,tone:"default"}],[{label:a("copyLink"),icon:(0,s.jsx)(p.A,{}),onSelect:()=>{f(!0)},tone:"default"},{label:a("copyUuid"),icon:(0,s.jsx)(eG.A,{}),onSelect:()=>{f(!1)},tone:"default"}],[{label:t("ideas.deleteIdea"),icon:(0,s.jsx)(eJ.A,{}),reason:m,onSelect:e.onDelete,tone:"destructive"}]];return d?(0,s.jsxs)(eW.cj,{open:i,onOpenChange:o,children:[(0,s.jsx)(eW.CG,{asChild:!0,children:(0,s.jsxs)(h.$,{ref:e.triggerRef,variant:"outline",size:"sm",className:"h-11 gap-1.5 border-border px-3",children:[t("common.actions"),(0,s.jsx)(V.A,{className:"size-4","aria-hidden":!0})]})}),(0,s.jsxs)(eW.h,{side:"bottom",className:"max-h-[min(82svh,44rem)] gap-0 overflow-hidden rounded-t-2xl pb-[max(1rem,env(safe-area-inset-bottom))]",onCloseAutoFocus:e.onCloseAutoFocus,children:[(0,s.jsx)("div",{className:"mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-muted-foreground/25","aria-hidden":!0}),(0,s.jsxs)(eW.Fm,{className:"border-b px-4 pt-3 pb-3 text-left",children:[(0,s.jsx)(eW.qp,{children:t("common.actions")}),(0,s.jsx)(eW.Qs,{className:"sr-only",children:t("common.actions")})]}),(0,s.jsx)("div",{className:"overflow-y-auto overscroll-contain px-2 py-2",children:g.map((e,t)=>(0,s.jsx)("div",{className:(0,eE.cn)(t>0&&"mt-1 border-t pt-1"),children:e.map(e=>(0,s.jsx)(e9,{...e,onSelect:()=>{o(!1),e.onSelect()}},e.label))},t))})]})]}):(0,s.jsx)(T.Bc,{delayDuration:300,children:(0,s.jsxs)(eQ.rI,{open:i,onOpenChange:o,children:[(0,s.jsx)(eQ.ty,{asChild:!0,children:(0,s.jsxs)(h.$,{ref:e.triggerRef,variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border px-2.5",children:[t("common.actions"),(0,s.jsx)(V.A,{className:"h-3.5 w-3.5","aria-hidden":!0})]})}),(0,s.jsx)(eQ.SQ,{align:"end",className:"z-[100] w-64 max-w-[calc(100vw-1rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",children:g.map((e,t)=>(0,s.jsxs)(n.Fragment,{children:[t>0&&(0,s.jsx)(eQ.mB,{}),e.map(e=>(0,s.jsx)(e3,{...e,onTooltipEscape:()=>o(!1)},e.label))]},t))})]})})}})})}var e6=a(36995),e8=a(90612),e7=a(59208),te=a(2201),tt=a(21180),ta=a(16386),ts=a(38106),tn=a(77390);function tr(e){return(0,s.jsx)(ti,{...e},e.ideaUuid)}function ti(e){var t,a,u,w,C,S,A;let{ideaUuid:F,projectUuid:E,currentUserUuid:_,onClose:D,onNavigate:T}=e,U=(0,r.c)(),R=(0,r.c)("ideaTracker"),P=(0,r.c)("status"),M=(0,r.c)("ideaTracker.lineage"),B=(0,i.r)(),L=(0,e7.kz)(),z=null!=(u=null==L?void 0:L.activeSessionsByIdea.get(F))?u:[],[O,V]=(0,n.useState)(null),[q,$]=(0,n.useState)(!0),[K,H]=(0,n.useState)(null),[G,Z]=(0,n.useState)([]),[Y,ee]=(0,n.useState)([]),[et,ea]=(0,n.useState)(null),[es,en]=(0,n.useState)(null),er=(0,n.useRef)(0),ei=(0,n.useRef)(0),[el,eo]=(0,n.useState)("overview"),[ed,ex]=(0,n.useState)(new Set(["overview"])),[ep,eh]=(0,n.useState)(!1),[ef,ev]=(0,n.useState)(0),[eb,ej]=(0,n.useState)(!1),[eC,eS]=(0,n.useState)(!1),[eA,eF]=(0,n.useState)(!1),eE=(0,n.useRef)(null),e_=(0,n.useCallback)(e=>{var t;e.preventDefault(),null==(t=eE.current)||t.focus()},[]),[eD,eV]=(0,n.useState)(null),[eq,e$]=(0,n.useState)(!0),[eK,eH]=(0,n.useState)(!1),[eG,eJ]=(0,n.useState)(null),[eQ,eW]=(0,n.useState)(!1),{start:eX,pickerState:eZ,confirmPick:eY,cancelPick:e0,isResolving:e1}=(0,te.E)({reassignNoWake:ta.U,previewIdeaUuid:null==O?void 0:O.uuid}),[e2,e5]=(0,n.useState)(!1),[e3,e9]=(0,n.useState)(""),[tr,ti]=(0,n.useState)(""),[tl,to]=(0,n.useState)(!1),[td,tc]=(0,n.useState)(null),[tu,tx]=(0,n.useState)(!1),[tm,tp]=(0,n.useState)(!1),[th,tf]=(0,n.useState)(!1),[tg,tv]=(0,n.useState)(!1),[tb,tj]=(0,n.useState)(null),[ty,tk]=(0,n.useState)(null),[tN,tw]=(0,n.useState)(null),tC=(0,n.useCallback)(e=>{tw(null),tj(e)},[]),tS=(0,n.useCallback)(e=>{tj(null),tk(null),tw(e)},[]),[tA,tF]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=window.matchMedia("(min-width: 960px)");tF(e.matches);let t=e=>tF(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[tE,t_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=setTimeout(()=>t_(!0),300);return()=>clearTimeout(e)},[]);let tD=(0,n.useCallback)(e=>{let t=new URLSearchParams(window.location.search);t.set("tab",e),window.history.replaceState(null,"","".concat(window.location.pathname,"?").concat(t.toString()))},[]),tT=(0,n.useCallback)(async()=>{try{let e=await eI(F);e.success?(V(e.data),H(null)):H(R("Not found"===e.error?"panel.notFound":"panel.loadFailed"))}catch(e){H(R("panel.loadFailed"))}finally{$(!1)}},[F,R]);(0,n.useEffect)(()=>{$(!0),tT()},[tT]),(0,N.eV)("idea",tT),(0,N.eV)("proposal",tT),(0,N.eV)("task",tT);let tU=null==O?void 0:O.uuid,tR=null==O?void 0:O.status,tP="".concat(tU,":").concat(tR),tI=(0,n.useCallback)(async()=>{let e=++er.current;if(ea(null),tU){if("open"===tR){Z([]),ea(tP);return}try{let t=await (0,J.U)(E,tU);e===er.current&&t.success&&(Z(t.data),ea(tP))}catch(e){W.q.error("Failed to fetch proposals:",e)}}},[E,tU,tR,tP]);(0,n.useEffect)(()=>{tI()},[tI]),(0,N.eV)("proposal",tI);let tM=(0,n.useCallback)(async()=>{let e=++ei.current;en(null);let t=G.filter(e=>"approved"===e.status);if(0===t.length){ee([]),en(G);return}try{let a=await Promise.all(t.map(e=>(0,Q.c)(E,e.uuid)));if(e!==ei.current||a.some(e=>!e.success))return;let s=a.flatMap(e=>e.success&&e.data?e.data.map(e=>{var t,a,s;return{uuid:e.uuid,title:e.title,status:e.status,commentCount:null!=(t=e.commentCount)?t:0,assignee:null!=(a=e.assignee)?a:null,acceptanceSummary:null!=(s=e.acceptanceSummary)?s:null}}):[]);ee(s),en(G)}catch(e){W.q.error("Failed to fetch tasks:",e)}},[E,G]);(0,n.useEffect)(()=>{tM()},[tM]),(0,N.eV)("task",tM);let tB=(0,n.useCallback)(async()=>{if(!tU)return;let e=await (0,eB.z)(tU);e.success&&e.data&&eV(e.data),e$(!1)},[tU]);(0,n.useEffect)(()=>{tB()},[tB]),(0,N.eV)("idea",tB);let tL=(0,n.useMemo)(()=>O?function(e,t,a){let s=["overview"];return s.push("elaboration"),t.length>0&&s.push("proposal"),a.length>0&&s.push("tasks"),s.push("activity"),s}(0,G,Y):["overview","activity"],[O,G,Y]),tz=(0,n.useRef)(new URLSearchParams(window.location.search).get("tab")),tO=O?function(e){switch(e){case"open":case"researching":case"answer_questions":return"elaboration";case"planning":case"review_proposal":return"proposal";case"building":case"verify_work":return"tasks";default:return"overview"}}(O.badgeHint):"overview";(0,n.useEffect)(()=>{let e;if(!O||ep)return;let t=tz.current;if(t)if(!tL.includes(t))return;else e=t,tz.current=null,eh(!0);else if(tL.includes(tO))e=tO;else{if("overview"!==tO)return;e="overview"}eo(e),ex(t=>new Set([...t,e])),tD(e)},[null==O?void 0:O.uuid,tO,tL]),(0,n.useEffect)(()=>{eh(!1)},[F]),(0,n.useEffect)(()=>{tL.includes(el)||eo("overview")},[tL,el]);let tV=(0,n.useMemo)(()=>Y.filter(e=>"in_progress"===e.status||"assigned"===e.status||"to_verify"===e.status).length,[Y]),tq=(0,n.useCallback)(()=>{if(!tb)return void tk(null);(0,eM.Q)(tb).then(e=>{e.success&&tk(e.data)}).catch(e=>W.q.error("Failed to load task details:",e))},[tb]);(0,n.useEffect)(()=>{tq()},[tq]),(0,N.eV)("task",tq),(0,n.useEffect)(()=>{e5(!1),e9((null==O?void 0:O.title)||""),ti((null==O?void 0:O.content)||""),tc(null)},[null==O?void 0:O.uuid,null==O?void 0:O.title,null==O?void 0:O.content]);let t$=()=>{e5(!1),e9((null==O?void 0:O.title)||""),ti((null==O?void 0:O.content)||""),tc(null)},tK=async()=>{if(!O||!e3.trim())return void tc(U("ideas.titleRequired"));to(!0),tc(null);let e=await (0,eR.J)({ideaUuid:O.uuid,projectUuid:E,title:e3.trim(),content:tr.trim()||null});to(!1),e.success?(e5(!1),await tT(),B.refresh()):tc(e.error||U("ideas.updateFailed"))},tH=async()=>{if(!O||eC)return;eS(!0);let e=await (0,eP.Z)(O.uuid,E);eS(!1),e.success&&(D(),B.refresh())},tG=async()=>{if(!O)return;eH(!0),eJ(null);let e=await (0,eL.e)(O.uuid);eH(!1),e.success?(eW(!0),await tT(),B.refresh()):eJ(e.error||U("elaboration.verifyFailed"))},tJ=async e=>{var t;if(!O)return;tx(!0),V({...O,isContainer:e});let a=await (0,eR.J)({ideaUuid:O.uuid,projectUuid:E,title:O.title,content:null!=(t=O.content)?t:null,isContainer:e});tx(!1),a.success?(await tT(),B.refresh()):(V({...O,isContainer:!e}),l.oR.error(a.error||U("ideas.updateFailed")))},tQ=(null==O?void 0:O.derivedStatus)||"todo",tW=(null==O?void 0:O.isContainer)===!0,tX=null!==O,tZ=(0,eO.o)({ideaStatus:null==O?void 0:O.status,elaborationStatus:null==O?void 0:O.elaborationStatus,elaboration:eD});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:D}),(0,s.jsxs)("div",{className:"fixed right-0 top-14 md:top-0 z-50 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col border-l border-border bg-card shadow-xl ".concat(tE?"":"animate-in slide-in-from-right duration-300"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:q?(0,s.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-secondary"}):O?e2?(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:U("ideas.editIdea")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider ".concat(tW?"text-primary":"text-muted-foreground"),children:tW?M("typeTheme"):M("typeIdea")}),(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:O.title}),(0,s.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[(0,s.jsx)(g.E,{className:ec._5[tQ]||ec._5.todo,children:O.badgeHint?R("badge.".concat(ec.Wl[O.badgeHint]||"open")):P(ec.Bj[tQ]||"todo")}),tW&&O.childProgress&&O.childProgress.total>0&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-xs font-medium text-primary",title:M("childrenDone",{done:O.childProgress.done,total:O.childProgress.total}),children:[(0,s.jsx)(tn.C,{done:O.childProgress.done,total:O.childProgress.total,size:13,stroke:2}),O.childProgress.done,"/",O.childProgress.total]}),(0,s.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-xs text-muted-foreground",title:(0,ts.r)(O.createdAt),children:(0,ts.r)(O.createdAt)})]}),z.length>0&&L&&(0,s.jsx)(e8.U,{sessions:z,onSelect:L.openChatForActiveSession,surface:"sidebar",className:"shrink-0"})]})]}):(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:R("panel.notFound")})}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 ml-3",children:[O&&!q&&!e2&&(0,s.jsx)(e4,{ideaUuid:O.uuid,projectUuid:E,assignee:O.assignee,assigneeName:null==(t=O.assignee)?void 0:t.name,proposals:G,tasks:Y,triggerRef:eE,busy:eC||eK||e1||tl||tu||null!==eZ,stageReason:tW?M("containerHint"):void 0,stageDataReason:et!==tP||es!==G?R("panel.actions.loadingStage"):void 0,verifyReason:eq?R("loading"):eQ?U("elaboration.verifiedQueuedHint"):tZ?void 0:R("panel.actions.verifyUnavailable"),editReason:"elaborated"===O.status?R("panel.actions.editUnavailable"):void 0,onVerify:()=>{!O||O.isContainer||!tZ||eQ||eq||eK||e1||tu||eX({ideaUuid:O.uuid,wake:tG})},onDerive:()=>tv(!0),onSetParent:()=>tf(!0),onMove:()=>tp(!0),onEdit:()=>{O&&"elaborated"!==O.status&&(e9(O.title),ti(O.content||""),tc(null),e5(!0))},onDelete:()=>eF(!0),onStarted:tT,onCloseAutoFocus:e_},O.uuid),(0,s.jsx)(h.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:e2?t$:D,"aria-label":U("common.close"),children:(0,s.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),O&&!q&&!e2&&(0,s.jsx)("div",{className:"border-b border-secondary px-6",children:(0,s.jsx)("div",{className:"flex gap-0 -mb-px",children:tL.map(e=>(0,s.jsxs)("button",{onClick:()=>{eo(e),eh(!0),ex(t=>new Set([...t,e])),tD(e)},className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ".concat(el===e?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-muted-foreground"),children:[R("panel.tabs.".concat(e)),"tasks"===e&&tV>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0] text-[10px] font-semibold leading-none",children:tV}),"activity"===e&&ef>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-secondary text-muted-foreground text-[10px] font-semibold leading-none",children:ef})]},e))})}),(0,s.jsx)(f.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,s.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:q?(0,s.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,s.jsx)(d.A,{className:"h-6 w-6 animate-spin text-primary"}),(0,s.jsx)("span",{className:"ml-2 text-sm text-muted-foreground",children:R("loading")})]}):K?(0,s.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:K})}):O?e2?(0,s.jsxs)("div",{className:"space-y-5",children:[td&&(0,s.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:td}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(j.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:U("ideas.titleLabel")}),(0,s.jsx)(v.p,{id:"edit-title",value:e3,onChange:e=>e9(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(j.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-foreground",children:U("common.content")}),(0,s.jsx)(b.T,{id:"edit-content",value:tr,onChange:e=>ti(e.target.value),rows:8,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,s.jsx)(h.$,{variant:"outline",onClick:t$,disabled:tl,children:U("common.cancel")}),(0,s.jsxs)(h.$,{onClick:tK,disabled:tl||!e3.trim(),children:[tl&&(0,s.jsx)(d.A,{className:"mr-2 h-4 w-4 animate-spin"}),U("common.save")]})]})]}):(0,s.jsxs)(s.Fragment,{children:[eQ&&(0,s.jsx)("p",{role:"status",className:"mb-4 text-xs text-muted-foreground",children:U("elaboration.verifiedQueuedHint")}),eG&&(0,s.jsx)("p",{role:"alert",className:"mb-4 text-xs text-destructive",children:eG}),tW&&(0,s.jsx)("p",{className:"mb-4 text-xs text-muted-foreground",children:M("containerHint")}),ed.has("overview")&&(0,s.jsxs)("div",{style:{display:"overview"===el?"block":"none"},children:[(0,s.jsxs)("div",{className:"mb-5 flex items-start justify-between gap-3 rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e] bg-background px-3.5 py-3",children:[(0,s.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,s.jsxs)(j.J,{htmlFor:"container-toggle",className:"flex items-center gap-1.5 text-[13px] font-medium text-foreground",children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 text-primary","aria-hidden":!0}),M("container")]}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:M("containerDescription")})]}),(0,s.jsx)(y.d,{id:"container-toggle",checked:tW,disabled:tu,onCheckedChange:tJ,"aria-label":M("makeContainer")})]}),(0,s.jsx)(eu,{idea:O,proposals:G,tasks:Y,onSelectTask:tC}),(0,s.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:M("title")})]})}),O.parent?(0,s.jsxs)("button",{type:"button",onClick:()=>null==T?void 0:T(O.parent.uuid),className:"flex w-full items-center gap-2 rounded-lg bg-background px-3 py-2.5 text-left transition-colors hover:bg-secondary",children:[(0,s.jsx)(x,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:M("derivedFrom")}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-foreground/80",children:O.parent.title})]}):(0,s.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",children:M("noParent")}),O.children&&O.children.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-1 pt-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-[12px] font-medium text-foreground/80",children:M("derivedIdeas")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:O.children.length})]}),(()=>{let e=O.children.filter(e=>"done"===e.derivedStatus).length,t=O.children.length;return(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",title:M("childrenDone",{done:e,total:t}),children:[(0,s.jsx)(tn.C,{done:e,total:t,size:14,stroke:2}),e,"/",t]})})()]}),(0,s.jsx)("div",{className:"overflow-hidden rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e]",children:O.children.map((e,t)=>(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{className:"h-px bg-[#F0EEEA] dark:bg-[#1f1e1c]"}),(0,s.jsxs)("button",{type:"button",onClick:()=>null==T?void 0:T(e.uuid),className:"flex w-full items-center justify-between gap-2 px-3 py-2.5 text-left transition-colors hover:bg-background",children:[(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"truncate text-[12px] text-foreground",children:e.title})]}),(0,s.jsx)(g.E,{className:"shrink-0 border-0 text-[10px] ".concat(ec._5[e.derivedStatus]||ec._5.todo),children:P(ec.Bj[e.derivedStatus]||"todo")})]})]},e.uuid))})]})]}),(0,s.jsx)(em,{projectUuid:E,ideaUuid:O.uuid,proposals:G,onDocClick:tS}),(0,s.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(p.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:U("references.title")})]}),(0,s.jsx)(e6.ReferencesSection,{targetType:"idea",targetUuid:O.uuid,canWrite:!0,compact:!0})]})]}),tL.includes("elaboration")&&ed.has("elaboration")&&(0,s.jsx)("div",{style:{display:"elaboration"===el?"block":"none"},children:(0,s.jsx)(I,{idea:O,elaboration:eD,isLoading:eq,onRefresh:async()=>{await tB(),await tT()},onReassign:()=>ej(!0),canReassign:tX})}),tL.includes("proposal")&&ed.has("proposal")&&(0,s.jsx)("div",{style:{display:"proposal"===el?"block":"none"},children:(0,s.jsx)(X,{idea:O,projectUuid:E,onTaskClick:tC,onDocClick:tS,initialProposals:G})}),tL.includes("tasks")&&ed.has("tasks")&&(0,s.jsx)("div",{style:{display:"tasks"===el?"block":"none"},children:(0,s.jsx)(eg,{tasks:Y,projectUuid:E,proposalUuids:G.filter(e=>"approved"===e.status).map(e=>e.uuid),onSelectTask:tC})}),ed.has("activity")&&(0,s.jsx)("div",{style:{display:"activity"===el?"block":"none"},children:(0,s.jsx)(ey,{ideaUuid:O.uuid,currentUserUuid:_,commentCount:ef,onCommentCountChange:ev})})]}):null})}),O&&(0,s.jsx)(k.Lt,{open:eA,onOpenChange:eF,children:(0,s.jsxs)(k.EO,{onCloseAutoFocus:e_,children:[(0,s.jsxs)(k.wd,{children:[(0,s.jsx)(k.r7,{children:U("ideas.deleteIdea")}),(0,s.jsx)(k.$v,{children:U("ideas.deleteIdeaConfirm",{title:O.title})})]}),(0,s.jsxs)(k.ck,{children:[(0,s.jsx)(k.Zr,{children:U("common.cancel")}),(0,s.jsx)(k.Rx,{variant:"destructive",onClick:tH,disabled:eC,children:U("common.delete")})]})]})})]}),(0,s.jsx)(ew.h,{open:tm,onOpenChange:tp,onCloseAutoFocus:e_,ideaUuid:F,projectUuid:E,onMoved:()=>D()}),O&&(0,s.jsx)(eT,{open:th,onOpenChange:tf,ideaUuid:O.uuid,ideaTitle:O.title,projectUuid:E,currentParentUuid:null!=(w=O.parentUuid)?w:null,descendantUuids:null!=(C=O.descendantUuids)?C:[],onChanged:tT,onCloseAutoFocus:e_}),O&&(0,s.jsx)(eU.i,{open:tg,onOpenChange:tv,onCloseAutoFocus:e_,projectUuid:E,parentUuid:O.uuid,parentTitle:O.title,onCreated:e=>{l.oR.success(M("deriveIdea")),B.refresh(),null==T||T(e)}}),eb&&O&&(0,s.jsx)(ez.i,{idea:{uuid:O.uuid,title:O.title,content:O.content,status:O.status,assignee:O.assignee?{type:O.assignee.type,uuid:O.assignee.uuid,name:O.assignee.name}:null},projectUuid:E,currentUserUuid:_,onClose:()=>{ej(!1),tT()}}),(0,s.jsx)(tt.V,{open:null!==eZ,onCloseAutoFocus:e_,agentName:null!=(S=null==O||null==(a=O.assignee)?void 0:a.name)?S:"",instances:null!=(A=null==eZ?void 0:eZ.instances)?A:[],onConfirm:eY,onCancel:e0}),tb&&ty&&(0,s.jsx)(ek.v,{task:ty,projectUuid:E,currentUserUuid:_,mode:tA?"sidebyside":"overlay",onClose:()=>{tj(null),tk(null)},onBack:()=>{tj(null),tk(null)}}),tN&&(0,s.jsx)(eN.K,{title:tN.title,type:tN.type,content:tN.content,mode:tA?"sidebyside":"overlay",onClose:()=>tw(null),onBack:()=>tw(null)})]})}},98861:(e,t,a)=>{a.r(t),a.d(t,{Checkbox:()=>y,CheckboxIndicator:()=>N,Indicator:()=>N,Root:()=>y,createCheckboxScope:()=>h,unstable_BubbleInput:()=>C,unstable_CheckboxBubbleInput:()=>C,unstable_CheckboxProvider:()=>v,unstable_CheckboxTrigger:()=>j,unstable_Provider:()=>v,unstable_Trigger:()=>j});var s=a(1856),n=a(34124),r=a(21032),i=a(33328),l=a(66249),o=a(72009),d=a(3705),c=a(19900),u=a(93367),x=a(90508),m="Checkbox",[p,h]=(0,r.A)(m),[f,g]=p(m);function v(e){let{__scopeCheckbox:t,checked:a,children:n,defaultChecked:r,disabled:i,form:o,name:d,onCheckedChange:c,required:u,value:p="on",internal_do_not_use_render:h}=e,[g,v]=(0,l.i)({prop:a,defaultProp:null!=r&&r,onChange:c,caller:m}),[b,j]=s.useState(null),[y,k]=s.useState(null),N=s.useRef(!1),w=!b||!!o||!!b.closest("form"),C={checked:g,disabled:i,setChecked:v,control:b,setControl:j,name:d,form:o,value:p,hasConsumerStoppedPropagationRef:N,required:u,defaultChecked:!S(r)&&r,isFormControl:w,bubbleInput:y,setBubbleInput:k};return(0,x.jsx)(f,{scope:t,...C,children:"function"==typeof h?h(C):n})}var b="CheckboxTrigger",j=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,onKeyDown:r,onClick:l,...o}=e,{control:d,value:c,disabled:m,checked:p,required:h,setControl:f,setChecked:v,hasConsumerStoppedPropagationRef:j,isFormControl:y,bubbleInput:k}=g(b,a),N=(0,n.s)(t,f),w=s.useRef(p);return s.useEffect(()=>{let e=null==d?void 0:d.form;if(e){let t=()=>v(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,v]),(0,x.jsx)(u.sG.button,{type:"button",role:"checkbox","aria-checked":S(p)?"mixed":p,"aria-required":h,"data-state":A(p),"data-disabled":m?"":void 0,disabled:m,value:c,...o,ref:N,onKeyDown:(0,i.mK)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.mK)(l,e=>{v(e=>!!S(e)||!e),k&&y&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})})});j.displayName=b;var y=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,name:s,checked:n,defaultChecked:r,required:i,disabled:l,value:o,onCheckedChange:d,form:c,...u}=e;return(0,x.jsx)(v,{__scopeCheckbox:a,checked:n,defaultChecked:r,disabled:l,required:i,onCheckedChange:d,name:s,form:c,value:o,internal_do_not_use_render:e=>{let{isFormControl:s}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(j,{...u,ref:t,__scopeCheckbox:a}),s&&(0,x.jsx)(C,{__scopeCheckbox:a})]})}})});y.displayName=m;var k="CheckboxIndicator",N=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,forceMount:s,...n}=e,r=g(k,a);return(0,x.jsx)(c.C,{present:s||S(r.checked)||!0===r.checked,children:(0,x.jsx)(u.sG.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});N.displayName=k;var w="CheckboxBubbleInput",C=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,...r}=e,{control:i,hasConsumerStoppedPropagationRef:l,checked:c,defaultChecked:m,required:p,disabled:h,name:f,value:v,form:b,bubbleInput:j,setBubbleInput:y}=g(w,a),k=(0,n.s)(t,y),N=(0,o.Z)(c),C=(0,d.X)(i);s.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!l.current;if(N!==c&&e){let a=new Event("click",{bubbles:t});j.indeterminate=S(c),e.call(j,!S(c)&&c),j.dispatchEvent(a)}},[j,N,c,l]);let A=s.useRef(!S(c)&&c);return(0,x.jsx)(u.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=m?m:A.current,required:p,disabled:h,name:f,value:v,form:b,...r,tabIndex:-1,ref:k,style:{...r.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function S(e){return"indeterminate"===e}function A(e){return S(e)?"indeterminate":e?"checked":"unchecked"}C.displayName=w}}]);