leedab 0.5.3 → 0.6.1

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 (821) hide show
  1. package/README.md +7 -2
  2. package/_schema/customer-brain-template/01_Customers/engagement.md +42 -0
  3. package/_schema/customer-brain-template/01_Customers/qbr-template.md +49 -0
  4. package/_schema/customer-brain-template/02_Sales/pipeline.md +43 -0
  5. package/_schema/customer-brain-template/04_Operations/runbook.md +54 -0
  6. package/_schema/customer-brain-template/05_Finance/runway-snapshot.md +40 -0
  7. package/_schema/customer-brain-template/CLAUDE.md +66 -0
  8. package/_schema/customer-brain-template/README.md +43 -0
  9. package/_schema/customer-brain-template/_inbox/champion-day-0.md +69 -0
  10. package/_schema/customer-brain-template/_inbox/weekly-digest-template.md +53 -0
  11. package/_schema/customer-brain-template/_templates/customer.md +33 -0
  12. package/_schema/customer-brain-template/_templates/decision.md +30 -0
  13. package/agents/INDEX.md +151 -0
  14. package/agents/automation-agent.md +199 -0
  15. package/agents/backend-agent.md +104 -0
  16. package/agents/brand-agent.md +130 -0
  17. package/agents/campaigns-agent.md +98 -0
  18. package/agents/champion-agent.md +123 -0
  19. package/agents/compliance-agent.md +124 -0
  20. package/agents/concierge-agent.md +120 -0
  21. package/agents/content-agent.md +98 -0
  22. package/agents/coo-agent.md +191 -0
  23. package/agents/cx-agent.md +85 -0
  24. package/agents/data-agent.md +129 -0
  25. package/agents/delivery-agent.md +154 -0
  26. package/agents/devops-agent.md +117 -0
  27. package/agents/email-agent.md +114 -0
  28. package/agents/engineering-agent.md +136 -0
  29. package/agents/finance-agent.md +94 -0
  30. package/agents/frontend-agent.md +98 -0
  31. package/agents/implementation-agent.md +130 -0
  32. package/agents/investor-agent.md +127 -0
  33. package/agents/legal-agent.md +109 -0
  34. package/agents/marketing-agent.md +91 -0
  35. package/agents/onboarding-agent.md +122 -0
  36. package/agents/ops-agent.md +92 -0
  37. package/agents/people-agent.md +127 -0
  38. package/agents/procurement-agent.md +147 -0
  39. package/agents/product-agent.md +133 -0
  40. package/agents/research-agent.md +147 -0
  41. package/agents/sales-agent.md +112 -0
  42. package/agents/solutions-agent.md +111 -0
  43. package/agents/strategy-agent.md +107 -0
  44. package/agents/video-agent.md +94 -0
  45. package/apps/console/.next/standalone/.next/BUILD_ID +1 -1
  46. package/apps/console/.next/standalone/.next/app-build-manifest.json +542 -143
  47. package/apps/console/.next/standalone/.next/app-path-routes-manifest.json +77 -19
  48. package/apps/console/.next/standalone/.next/build-manifest.json +8 -8
  49. package/apps/console/.next/standalone/.next/prerender-manifest.json +39 -10
  50. package/apps/console/.next/standalone/.next/required-server-files.json +4 -0
  51. package/apps/console/.next/standalone/.next/routes-manifest.json +44 -0
  52. package/apps/console/.next/standalone/.next/server/app/_not-found/page.js +2 -2
  53. package/apps/console/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  54. package/apps/console/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  55. package/apps/console/.next/standalone/.next/server/app/_not-found.html +1 -1
  56. package/apps/console/.next/standalone/.next/server/app/_not-found.rsc +8 -4
  57. package/apps/console/.next/standalone/.next/server/app/api/agent/route.js +2 -2
  58. package/apps/console/.next/standalone/.next/server/app/api/agent/route.js.nft.json +1 -1
  59. package/apps/console/.next/standalone/.next/server/app/api/agent/route_client-reference-manifest.js +1 -1
  60. package/apps/console/.next/standalone/.next/server/app/api/approvals/route.js +1 -1
  61. package/apps/console/.next/standalone/.next/server/app/api/approvals/route.js.nft.json +1 -1
  62. package/apps/console/.next/standalone/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  63. package/apps/console/.next/standalone/.next/server/app/api/approvals/stream/route.js +2 -2
  64. package/apps/console/.next/standalone/.next/server/app/api/approvals/stream/route.js.nft.json +1 -1
  65. package/apps/console/.next/standalone/.next/server/app/api/approvals/stream/route_client-reference-manifest.js +1 -1
  66. package/apps/console/.next/standalone/.next/server/app/api/automation/workflow-blueprint/route.js +1 -0
  67. package/apps/console/.next/standalone/.next/server/app/api/automation/workflow-blueprint/route.js.nft.json +1 -0
  68. package/apps/console/.next/standalone/.next/server/app/api/automation/workflow-blueprint/route_client-reference-manifest.js +1 -0
  69. package/apps/console/.next/standalone/.next/server/app/api/backend/endpoint-spec/route.js +1 -0
  70. package/apps/console/.next/standalone/.next/server/app/api/backend/endpoint-spec/route.js.nft.json +1 -0
  71. package/apps/console/.next/standalone/.next/server/app/api/backend/endpoint-spec/route_client-reference-manifest.js +1 -0
  72. package/apps/console/.next/standalone/.next/server/app/api/bootstrap-admin-token/route.js +1 -0
  73. package/apps/console/.next/standalone/.next/server/app/api/bootstrap-admin-token/route.js.nft.json +1 -0
  74. package/apps/console/.next/standalone/.next/server/app/api/bootstrap-admin-token/route_client-reference-manifest.js +1 -0
  75. package/apps/console/.next/standalone/.next/server/app/api/brand/brand-audit/route.js +1 -0
  76. package/apps/console/.next/standalone/.next/server/app/api/brand/brand-audit/route.js.nft.json +1 -0
  77. package/apps/console/.next/standalone/.next/server/app/api/brand/brand-audit/route_client-reference-manifest.js +1 -0
  78. package/apps/console/.next/standalone/.next/server/app/api/campaigns/campaign-brief/route.js +1 -0
  79. package/apps/console/.next/standalone/.next/server/app/api/campaigns/campaign-brief/route.js.nft.json +1 -0
  80. package/apps/console/.next/standalone/.next/server/app/api/campaigns/campaign-brief/route_client-reference-manifest.js +1 -0
  81. package/apps/console/.next/standalone/.next/server/app/api/champion/confidence/route.js +3 -0
  82. package/apps/console/.next/standalone/.next/server/app/api/champion/confidence/route.js.nft.json +1 -0
  83. package/apps/console/.next/standalone/.next/server/app/api/champion/confidence/route_client-reference-manifest.js +1 -0
  84. package/apps/console/.next/standalone/.next/server/app/api/champion/customer/route.js +3 -0
  85. package/apps/console/.next/standalone/.next/server/app/api/champion/customer/route.js.nft.json +1 -0
  86. package/apps/console/.next/standalone/.next/server/app/api/champion/customer/route_client-reference-manifest.js +1 -0
  87. package/apps/console/.next/standalone/.next/server/app/api/champion/dispatches/route.js +3 -0
  88. package/apps/console/.next/standalone/.next/server/app/api/champion/dispatches/route.js.nft.json +1 -0
  89. package/apps/console/.next/standalone/.next/server/app/api/champion/dispatches/route_client-reference-manifest.js +1 -0
  90. package/apps/console/.next/standalone/.next/server/app/api/champion/engagement/route.js +3 -0
  91. package/apps/console/.next/standalone/.next/server/app/api/champion/engagement/route.js.nft.json +1 -0
  92. package/apps/console/.next/standalone/.next/server/app/api/champion/engagement/route_client-reference-manifest.js +1 -0
  93. package/apps/console/.next/standalone/.next/server/app/api/champion/escalate/route.js +11 -0
  94. package/apps/console/.next/standalone/.next/server/app/api/champion/escalate/route.js.nft.json +1 -0
  95. package/apps/console/.next/standalone/.next/server/app/api/champion/escalate/route_client-reference-manifest.js +1 -0
  96. package/apps/console/.next/standalone/.next/server/app/api/champion/profile/route.js +4 -0
  97. package/apps/console/.next/standalone/.next/server/app/api/champion/profile/route.js.nft.json +1 -0
  98. package/apps/console/.next/standalone/.next/server/app/api/champion/profile/route_client-reference-manifest.js +1 -0
  99. package/apps/console/.next/standalone/.next/server/app/api/champion/screenshare/route.js +36 -0
  100. package/apps/console/.next/standalone/.next/server/app/api/champion/screenshare/route.js.nft.json +1 -0
  101. package/apps/console/.next/standalone/.next/server/app/api/champion/screenshare/route_client-reference-manifest.js +1 -0
  102. package/apps/console/.next/standalone/.next/server/app/api/champion/track-question/route.js +2 -0
  103. package/apps/console/.next/standalone/.next/server/app/api/champion/track-question/route.js.nft.json +1 -0
  104. package/apps/console/.next/standalone/.next/server/app/api/champion/track-question/route_client-reference-manifest.js +1 -0
  105. package/apps/console/.next/standalone/.next/server/app/api/champion/use-case-wiki/route.js +1 -0
  106. package/apps/console/.next/standalone/.next/server/app/api/champion/use-case-wiki/route.js.nft.json +1 -0
  107. package/apps/console/.next/standalone/.next/server/app/api/champion/use-case-wiki/route_client-reference-manifest.js +1 -0
  108. package/apps/console/.next/standalone/.next/server/app/api/chat/route.js +2 -2
  109. package/apps/console/.next/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  110. package/apps/console/.next/standalone/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
  111. package/apps/console/.next/standalone/.next/server/app/api/compliance/risk-register-seed/route.js +33 -0
  112. package/apps/console/.next/standalone/.next/server/app/api/compliance/risk-register-seed/route.js.nft.json +1 -0
  113. package/apps/console/.next/standalone/.next/server/app/api/compliance/risk-register-seed/route_client-reference-manifest.js +1 -0
  114. package/apps/console/.next/standalone/.next/server/app/api/computer-use/[id]/route.js +1 -1
  115. package/apps/console/.next/standalone/.next/server/app/api/computer-use/[id]/route.js.nft.json +1 -1
  116. package/apps/console/.next/standalone/.next/server/app/api/computer-use/[id]/route_client-reference-manifest.js +1 -1
  117. package/apps/console/.next/standalone/.next/server/app/api/computer-use/route.js +1 -1
  118. package/apps/console/.next/standalone/.next/server/app/api/computer-use/route.js.nft.json +1 -1
  119. package/apps/console/.next/standalone/.next/server/app/api/computer-use/route_client-reference-manifest.js +1 -1
  120. package/apps/console/.next/standalone/.next/server/app/api/concierge/morning-brief/route.js +3 -0
  121. package/apps/console/.next/standalone/.next/server/app/api/concierge/morning-brief/route.js.nft.json +1 -0
  122. package/apps/console/.next/standalone/.next/server/app/api/concierge/morning-brief/route_client-reference-manifest.js +1 -0
  123. package/apps/console/.next/standalone/.next/server/app/api/contacts/route.js +1 -1
  124. package/apps/console/.next/standalone/.next/server/app/api/contacts/route.js.nft.json +1 -1
  125. package/apps/console/.next/standalone/.next/server/app/api/contacts/route_client-reference-manifest.js +1 -1
  126. package/apps/console/.next/standalone/.next/server/app/api/content/seo-brief/route.js +1 -0
  127. package/apps/console/.next/standalone/.next/server/app/api/content/seo-brief/route.js.nft.json +1 -0
  128. package/apps/console/.next/standalone/.next/server/app/api/content/seo-brief/route_client-reference-manifest.js +1 -0
  129. package/apps/console/.next/standalone/.next/server/app/api/conversations/route.js +3 -9
  130. package/apps/console/.next/standalone/.next/server/app/api/conversations/route.js.nft.json +1 -1
  131. package/apps/console/.next/standalone/.next/server/app/api/conversations/route_client-reference-manifest.js +1 -1
  132. package/apps/console/.next/standalone/.next/server/app/api/coo/route.js +1 -0
  133. package/apps/console/.next/standalone/.next/server/app/api/coo/route.js.nft.json +1 -0
  134. package/apps/console/.next/standalone/.next/server/app/api/coo/route_client-reference-manifest.js +1 -0
  135. package/apps/console/.next/standalone/.next/server/app/api/cx/escalation-triage/route.js +1 -0
  136. package/apps/console/.next/standalone/.next/server/app/api/cx/escalation-triage/route.js.nft.json +1 -0
  137. package/apps/console/.next/standalone/.next/server/app/api/cx/escalation-triage/route_client-reference-manifest.js +1 -0
  138. package/apps/console/.next/standalone/.next/server/app/api/cx/health-score/route.js +1 -0
  139. package/apps/console/.next/standalone/.next/server/app/api/cx/health-score/route.js.nft.json +1 -0
  140. package/apps/console/.next/standalone/.next/server/app/api/cx/health-score/route_client-reference-manifest.js +1 -0
  141. package/apps/console/.next/standalone/.next/server/app/api/data/cohort-brief/route.js +1 -0
  142. package/apps/console/.next/standalone/.next/server/app/api/data/cohort-brief/route.js.nft.json +1 -0
  143. package/apps/console/.next/standalone/.next/server/app/api/data/cohort-brief/route_client-reference-manifest.js +1 -0
  144. package/apps/console/.next/standalone/.next/server/app/api/delivery/qbr-brief/route.js +57 -0
  145. package/apps/console/.next/standalone/.next/server/app/api/delivery/qbr-brief/route.js.nft.json +1 -0
  146. package/apps/console/.next/standalone/.next/server/app/api/delivery/qbr-brief/route_client-reference-manifest.js +1 -0
  147. package/apps/console/.next/standalone/.next/server/app/api/delivery/weekly-brief/route.js +1 -0
  148. package/apps/console/.next/standalone/.next/server/app/api/delivery/weekly-brief/route.js.nft.json +1 -0
  149. package/apps/console/.next/standalone/.next/server/app/api/delivery/weekly-brief/route_client-reference-manifest.js +1 -0
  150. package/apps/console/.next/standalone/.next/server/app/api/dev/invalidate-cache/route.js +3 -0
  151. package/apps/console/.next/standalone/.next/server/app/api/dev/invalidate-cache/route.js.nft.json +1 -0
  152. package/apps/console/.next/standalone/.next/server/app/api/dev/invalidate-cache/route_client-reference-manifest.js +1 -0
  153. package/apps/console/.next/standalone/.next/server/app/api/devops/runbook/route.js +1 -0
  154. package/apps/console/.next/standalone/.next/server/app/api/devops/runbook/route.js.nft.json +1 -0
  155. package/apps/console/.next/standalone/.next/server/app/api/devops/runbook/route_client-reference-manifest.js +1 -0
  156. package/apps/console/.next/standalone/.next/server/app/api/email/sequence-brief/route.js +1 -0
  157. package/apps/console/.next/standalone/.next/server/app/api/email/sequence-brief/route.js.nft.json +1 -0
  158. package/apps/console/.next/standalone/.next/server/app/api/email/sequence-brief/route_client-reference-manifest.js +1 -0
  159. package/apps/console/.next/standalone/.next/server/app/api/engineering/adr-draft/route.js +1 -0
  160. package/apps/console/.next/standalone/.next/server/app/api/engineering/adr-draft/route.js.nft.json +1 -0
  161. package/apps/console/.next/standalone/.next/server/app/api/engineering/adr-draft/route_client-reference-manifest.js +1 -0
  162. package/apps/console/.next/standalone/.next/server/app/api/finance/runway-snapshot/route.js +49 -0
  163. package/apps/console/.next/standalone/.next/server/app/api/finance/runway-snapshot/route.js.nft.json +1 -0
  164. package/apps/console/.next/standalone/.next/server/app/api/finance/runway-snapshot/route_client-reference-manifest.js +1 -0
  165. package/apps/console/.next/standalone/.next/server/app/api/frontend/component-spec/route.js +1 -0
  166. package/apps/console/.next/standalone/.next/server/app/api/frontend/component-spec/route.js.nft.json +1 -0
  167. package/apps/console/.next/standalone/.next/server/app/api/frontend/component-spec/route_client-reference-manifest.js +1 -0
  168. package/apps/console/.next/standalone/.next/server/app/api/health/route.js +1 -1
  169. package/apps/console/.next/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  170. package/apps/console/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  171. package/apps/console/.next/standalone/.next/server/app/api/implementation/brief/route.js +79 -0
  172. package/apps/console/.next/standalone/.next/server/app/api/implementation/brief/route.js.nft.json +1 -0
  173. package/apps/console/.next/standalone/.next/server/app/api/implementation/brief/route_client-reference-manifest.js +1 -0
  174. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-migration-script/route.js +1 -0
  175. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-migration-script/route.js.nft.json +1 -0
  176. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-migration-script/route_client-reference-manifest.js +1 -0
  177. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-n8n-workflow/route.js +1 -0
  178. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-n8n-workflow/route.js.nft.json +1 -0
  179. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-n8n-workflow/route_client-reference-manifest.js +1 -0
  180. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-skill-override/route.js +1 -0
  181. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-skill-override/route.js.nft.json +1 -0
  182. package/apps/console/.next/standalone/.next/server/app/api/implementation/scaffold-skill-override/route_client-reference-manifest.js +1 -0
  183. package/apps/console/.next/standalone/.next/server/app/api/inbox/route.js +1 -1
  184. package/apps/console/.next/standalone/.next/server/app/api/inbox/route.js.nft.json +1 -1
  185. package/apps/console/.next/standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  186. package/apps/console/.next/standalone/.next/server/app/api/inbox/stream/route.js +2 -2
  187. package/apps/console/.next/standalone/.next/server/app/api/inbox/stream/route.js.nft.json +1 -1
  188. package/apps/console/.next/standalone/.next/server/app/api/inbox/stream/route_client-reference-manifest.js +1 -1
  189. package/apps/console/.next/standalone/.next/server/app/api/investor/kpi-tracker/route.js +59 -0
  190. package/apps/console/.next/standalone/.next/server/app/api/investor/kpi-tracker/route.js.nft.json +1 -0
  191. package/apps/console/.next/standalone/.next/server/app/api/investor/kpi-tracker/route_client-reference-manifest.js +1 -0
  192. package/apps/console/.next/standalone/.next/server/app/api/leedab/channels/status/route.js +1 -1
  193. package/apps/console/.next/standalone/.next/server/app/api/leedab/channels/status/route_client-reference-manifest.js +1 -1
  194. package/apps/console/.next/standalone/.next/server/app/api/leedab/channels/telegram/connect/route.js +1 -1
  195. package/apps/console/.next/standalone/.next/server/app/api/leedab/channels/telegram/connect/route_client-reference-manifest.js +1 -1
  196. package/apps/console/.next/standalone/.next/server/app/api/leedab/channels/whatsapp/connect/route.js +1 -1
  197. package/apps/console/.next/standalone/.next/server/app/api/leedab/channels/whatsapp/connect/route_client-reference-manifest.js +1 -1
  198. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/leads/[id]/route.js +1 -0
  199. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/leads/[id]/route.js.nft.json +1 -0
  200. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/leads/[id]/route_client-reference-manifest.js +1 -0
  201. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/leads/[id]/status/route.js +1 -0
  202. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/leads/[id]/status/route.js.nft.json +1 -0
  203. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/leads/[id]/status/route_client-reference-manifest.js +1 -0
  204. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/templates/[name]/route.js +1 -0
  205. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/templates/[name]/route.js.nft.json +1 -0
  206. package/apps/console/.next/standalone/.next/server/app/api/leedab/gtm/templates/[name]/route_client-reference-manifest.js +1 -0
  207. package/apps/console/.next/standalone/.next/server/app/api/leedab/license/route.js +3 -1
  208. package/apps/console/.next/standalone/.next/server/app/api/leedab/license/route_client-reference-manifest.js +1 -1
  209. package/apps/console/.next/standalone/.next/server/app/api/leedab/providers/route.js +1 -1
  210. package/apps/console/.next/standalone/.next/server/app/api/leedab/providers/route_client-reference-manifest.js +1 -1
  211. package/apps/console/.next/standalone/.next/server/app/api/leedab/sessions/[id]/route.js +1 -1
  212. package/apps/console/.next/standalone/.next/server/app/api/leedab/sessions/[id]/route_client-reference-manifest.js +1 -1
  213. package/apps/console/.next/standalone/.next/server/app/api/leedab/sessions/route.js +1 -1
  214. package/apps/console/.next/standalone/.next/server/app/api/leedab/sessions/route_client-reference-manifest.js +1 -1
  215. package/apps/console/.next/standalone/.next/server/app/api/leedab/team/[id]/route.js +1 -1
  216. package/apps/console/.next/standalone/.next/server/app/api/leedab/team/[id]/route_client-reference-manifest.js +1 -1
  217. package/apps/console/.next/standalone/.next/server/app/api/leedab/team/route.js +1 -1
  218. package/apps/console/.next/standalone/.next/server/app/api/leedab/team/route_client-reference-manifest.js +1 -1
  219. package/apps/console/.next/standalone/.next/server/app/api/leedab/vault/route.js +2 -2
  220. package/apps/console/.next/standalone/.next/server/app/api/leedab/vault/route_client-reference-manifest.js +1 -1
  221. package/apps/console/.next/standalone/.next/server/app/api/leedab/workflows/route.js +1 -1
  222. package/apps/console/.next/standalone/.next/server/app/api/leedab/workflows/route_client-reference-manifest.js +1 -1
  223. package/apps/console/.next/standalone/.next/server/app/api/legal/clause-template/route.js +1 -0
  224. package/apps/console/.next/standalone/.next/server/app/api/legal/clause-template/route.js.nft.json +1 -0
  225. package/apps/console/.next/standalone/.next/server/app/api/legal/clause-template/route_client-reference-manifest.js +1 -0
  226. package/apps/console/.next/standalone/.next/server/app/api/marketing/cadence-planner/route.js +35 -0
  227. package/apps/console/.next/standalone/.next/server/app/api/marketing/cadence-planner/route.js.nft.json +1 -0
  228. package/apps/console/.next/standalone/.next/server/app/api/marketing/cadence-planner/route_client-reference-manifest.js +1 -0
  229. package/apps/console/.next/standalone/.next/server/app/api/marketing/competitive-snapshot/route.js +18 -0
  230. package/apps/console/.next/standalone/.next/server/app/api/marketing/competitive-snapshot/route.js.nft.json +1 -0
  231. package/apps/console/.next/standalone/.next/server/app/api/marketing/competitive-snapshot/route_client-reference-manifest.js +1 -0
  232. package/apps/console/.next/standalone/.next/server/app/api/onboarding/engagement-plan/route.js +17 -0
  233. package/apps/console/.next/standalone/.next/server/app/api/onboarding/engagement-plan/route.js.nft.json +1 -0
  234. package/apps/console/.next/standalone/.next/server/app/api/onboarding/engagement-plan/route_client-reference-manifest.js +1 -0
  235. package/apps/console/.next/standalone/.next/server/app/api/onboarding/kickoff-brief/route.js +63 -0
  236. package/apps/console/.next/standalone/.next/server/app/api/onboarding/kickoff-brief/route.js.nft.json +1 -0
  237. package/apps/console/.next/standalone/.next/server/app/api/onboarding/kickoff-brief/route_client-reference-manifest.js +1 -0
  238. package/apps/console/.next/standalone/.next/server/app/api/openclaw/status/route.js +1 -1
  239. package/apps/console/.next/standalone/.next/server/app/api/openclaw/status/route_client-reference-manifest.js +1 -1
  240. package/apps/console/.next/standalone/.next/server/app/api/ops/dispatch-brief/route.js +1 -0
  241. package/apps/console/.next/standalone/.next/server/app/api/ops/dispatch-brief/route.js.nft.json +1 -0
  242. package/apps/console/.next/standalone/.next/server/app/api/ops/dispatch-brief/route_client-reference-manifest.js +1 -0
  243. package/apps/console/.next/standalone/.next/server/app/api/pack/route.js +3 -31
  244. package/apps/console/.next/standalone/.next/server/app/api/pack/route.js.nft.json +1 -1
  245. package/apps/console/.next/standalone/.next/server/app/api/pack/route_client-reference-manifest.js +1 -1
  246. package/apps/console/.next/standalone/.next/server/app/api/people/job-brief/route.js +1 -0
  247. package/apps/console/.next/standalone/.next/server/app/api/people/job-brief/route.js.nft.json +1 -0
  248. package/apps/console/.next/standalone/.next/server/app/api/people/job-brief/route_client-reference-manifest.js +1 -0
  249. package/apps/console/.next/standalone/.next/server/app/api/preferences/route.js +1 -1
  250. package/apps/console/.next/standalone/.next/server/app/api/preferences/route.js.nft.json +1 -1
  251. package/apps/console/.next/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  252. package/apps/console/.next/standalone/.next/server/app/api/procurement/po-brief/route.js +1 -0
  253. package/apps/console/.next/standalone/.next/server/app/api/procurement/po-brief/route.js.nft.json +1 -0
  254. package/apps/console/.next/standalone/.next/server/app/api/procurement/po-brief/route_client-reference-manifest.js +1 -0
  255. package/apps/console/.next/standalone/.next/server/app/api/product/prd-draft/route.js +1 -0
  256. package/apps/console/.next/standalone/.next/server/app/api/product/prd-draft/route.js.nft.json +1 -0
  257. package/apps/console/.next/standalone/.next/server/app/api/product/prd-draft/route_client-reference-manifest.js +1 -0
  258. package/apps/console/.next/standalone/.next/server/app/api/research/prospect-intel/route.js +15 -0
  259. package/apps/console/.next/standalone/.next/server/app/api/research/prospect-intel/route.js.nft.json +1 -0
  260. package/apps/console/.next/standalone/.next/server/app/api/research/prospect-intel/route_client-reference-manifest.js +1 -0
  261. package/apps/console/.next/standalone/.next/server/app/api/research/search/route.js +1 -0
  262. package/apps/console/.next/standalone/.next/server/app/api/research/search/route.js.nft.json +1 -0
  263. package/apps/console/.next/standalone/.next/server/app/api/research/search/route_client-reference-manifest.js +1 -0
  264. package/apps/console/.next/standalone/.next/server/app/api/routing/route.js +1 -1
  265. package/apps/console/.next/standalone/.next/server/app/api/routing/route.js.nft.json +1 -1
  266. package/apps/console/.next/standalone/.next/server/app/api/routing/route_client-reference-manifest.js +1 -1
  267. package/apps/console/.next/standalone/.next/server/app/api/runs/route.js +1 -1
  268. package/apps/console/.next/standalone/.next/server/app/api/runs/route.js.nft.json +1 -1
  269. package/apps/console/.next/standalone/.next/server/app/api/runs/route_client-reference-manifest.js +1 -1
  270. package/apps/console/.next/standalone/.next/server/app/api/sales/pipeline-summary/route.js +63 -0
  271. package/apps/console/.next/standalone/.next/server/app/api/sales/pipeline-summary/route.js.nft.json +1 -0
  272. package/apps/console/.next/standalone/.next/server/app/api/sales/pipeline-summary/route_client-reference-manifest.js +1 -0
  273. package/apps/console/.next/standalone/.next/server/app/api/sales/prospect-brief/route.js +6 -0
  274. package/apps/console/.next/standalone/.next/server/app/api/sales/prospect-brief/route.js.nft.json +1 -0
  275. package/apps/console/.next/standalone/.next/server/app/api/sales/prospect-brief/route_client-reference-manifest.js +1 -0
  276. package/apps/console/.next/standalone/.next/server/app/api/solutions/build/route.js +66 -0
  277. package/apps/console/.next/standalone/.next/server/app/api/solutions/build/route.js.nft.json +1 -0
  278. package/apps/console/.next/standalone/.next/server/app/api/solutions/build/route_client-reference-manifest.js +1 -0
  279. package/apps/console/.next/standalone/.next/server/app/api/solutions/quickstart-regenerate/route.js +3 -0
  280. package/apps/console/.next/standalone/.next/server/app/api/solutions/quickstart-regenerate/route.js.nft.json +1 -0
  281. package/apps/console/.next/standalone/.next/server/app/api/solutions/quickstart-regenerate/route_client-reference-manifest.js +1 -0
  282. package/apps/console/.next/standalone/.next/server/app/api/solutions/refine/route.js +22 -0
  283. package/apps/console/.next/standalone/.next/server/app/api/solutions/refine/route.js.nft.json +1 -0
  284. package/apps/console/.next/standalone/.next/server/app/api/solutions/refine/route_client-reference-manifest.js +1 -0
  285. package/apps/console/.next/standalone/.next/server/app/api/strategy/market-pulse/route.js +17 -0
  286. package/apps/console/.next/standalone/.next/server/app/api/strategy/market-pulse/route.js.nft.json +1 -0
  287. package/apps/console/.next/standalone/.next/server/app/api/strategy/market-pulse/route_client-reference-manifest.js +1 -0
  288. package/apps/console/.next/standalone/.next/server/app/api/telegram/[customerId]/route.js +61 -0
  289. package/apps/console/.next/standalone/.next/server/app/api/telegram/[customerId]/route.js.nft.json +1 -0
  290. package/apps/console/.next/standalone/.next/server/app/api/telegram/[customerId]/route_client-reference-manifest.js +1 -0
  291. package/apps/console/.next/standalone/.next/server/app/api/templates/regenerate/route.js +23 -0
  292. package/apps/console/.next/standalone/.next/server/app/api/templates/regenerate/route.js.nft.json +1 -0
  293. package/apps/console/.next/standalone/.next/server/app/api/templates/regenerate/route_client-reference-manifest.js +1 -0
  294. package/apps/console/.next/standalone/.next/server/app/api/templates/route.js +1 -31
  295. package/apps/console/.next/standalone/.next/server/app/api/templates/route.js.nft.json +1 -1
  296. package/apps/console/.next/standalone/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  297. package/apps/console/.next/standalone/.next/server/app/api/uploads/[id]/route.js +1 -1
  298. package/apps/console/.next/standalone/.next/server/app/api/uploads/[id]/route.js.nft.json +1 -1
  299. package/apps/console/.next/standalone/.next/server/app/api/uploads/[id]/route_client-reference-manifest.js +1 -1
  300. package/apps/console/.next/standalone/.next/server/app/api/uploads/route.js +1 -1
  301. package/apps/console/.next/standalone/.next/server/app/api/uploads/route.js.nft.json +1 -1
  302. package/apps/console/.next/standalone/.next/server/app/api/uploads/route_client-reference-manifest.js +1 -1
  303. package/apps/console/.next/standalone/.next/server/app/api/usage/route.js +3 -9
  304. package/apps/console/.next/standalone/.next/server/app/api/usage/route.js.nft.json +1 -1
  305. package/apps/console/.next/standalone/.next/server/app/api/usage/route_client-reference-manifest.js +1 -1
  306. package/apps/console/.next/standalone/.next/server/app/api/video/video-script/route.js +1 -0
  307. package/apps/console/.next/standalone/.next/server/app/api/video/video-script/route.js.nft.json +1 -0
  308. package/apps/console/.next/standalone/.next/server/app/api/video/video-script/route_client-reference-manifest.js +1 -0
  309. package/apps/console/.next/standalone/.next/server/app/api/webhooks/workflow/[id]/route.js +3 -1
  310. package/apps/console/.next/standalone/.next/server/app/api/webhooks/workflow/[id]/route.js.nft.json +1 -1
  311. package/apps/console/.next/standalone/.next/server/app/api/webhooks/workflow/[id]/route_client-reference-manifest.js +1 -1
  312. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/history/[runId]/route.js +1 -1
  313. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/history/[runId]/route.js.nft.json +1 -1
  314. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/history/[runId]/route_client-reference-manifest.js +1 -1
  315. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/history/route.js +1 -1
  316. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/history/route.js.nft.json +1 -1
  317. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/history/route_client-reference-manifest.js +1 -1
  318. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/route.js +3 -1
  319. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/route.js.nft.json +1 -1
  320. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/route_client-reference-manifest.js +1 -1
  321. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/run/route.js +1 -1
  322. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/run/route.js.nft.json +1 -1
  323. package/apps/console/.next/standalone/.next/server/app/api/workflows/[id]/run/route_client-reference-manifest.js +1 -1
  324. package/apps/console/.next/standalone/.next/server/app/api/workflows/route.js +1 -1
  325. package/apps/console/.next/standalone/.next/server/app/api/workflows/route.js.nft.json +1 -1
  326. package/apps/console/.next/standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  327. package/apps/console/.next/standalone/.next/server/app/apple-icon.png/route.js +1 -0
  328. package/apps/console/.next/standalone/.next/server/app/apple-icon.png/route.js.nft.json +1 -0
  329. package/apps/console/.next/standalone/.next/server/app/apple-icon.png.body +0 -0
  330. package/apps/console/.next/standalone/.next/server/app/apple-icon.png.meta +1 -0
  331. package/apps/console/.next/standalone/.next/server/app/gtm/page.js +2 -0
  332. package/apps/console/.next/standalone/.next/server/app/gtm/page.js.nft.json +1 -0
  333. package/apps/console/.next/standalone/.next/server/app/gtm/page_client-reference-manifest.js +1 -0
  334. package/apps/console/.next/standalone/.next/server/app/icon.png/route.js +1 -1
  335. package/apps/console/.next/standalone/.next/server/app/index.html +1 -1
  336. package/apps/console/.next/standalone/.next/server/app/index.rsc +9 -5
  337. package/apps/console/.next/standalone/.next/server/app/page.js +5 -2
  338. package/apps/console/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  339. package/apps/console/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  340. package/apps/console/.next/standalone/.next/server/app-paths-manifest.json +77 -19
  341. package/apps/console/.next/standalone/.next/server/chunks/1372.js +9 -0
  342. package/apps/console/.next/standalone/.next/server/chunks/1558.js +38 -0
  343. package/apps/console/.next/standalone/.next/server/chunks/1692.js +1 -1
  344. package/apps/console/.next/standalone/.next/server/chunks/4768.js +17 -0
  345. package/apps/console/.next/standalone/.next/server/chunks/5611.js +3 -3
  346. package/apps/console/.next/standalone/.next/server/chunks/5670.js +3 -0
  347. package/apps/console/.next/standalone/.next/server/chunks/5873.js +10 -10
  348. package/apps/console/.next/standalone/.next/server/chunks/6150.js +22 -0
  349. package/apps/console/.next/standalone/.next/server/chunks/6235.js +9 -0
  350. package/apps/console/.next/standalone/.next/server/chunks/6255.js +1 -0
  351. package/apps/console/.next/standalone/.next/server/chunks/697.js +19 -0
  352. package/apps/console/.next/standalone/.next/server/chunks/7087.js +1 -9
  353. package/apps/console/.next/standalone/.next/server/chunks/7242.js +28 -0
  354. package/apps/console/.next/standalone/.next/server/chunks/7907.js +86 -0
  355. package/apps/console/.next/standalone/.next/server/chunks/854.js +1287 -0
  356. package/apps/console/.next/standalone/.next/server/chunks/897.js +3 -0
  357. package/apps/console/.next/standalone/.next/server/functions-config-manifest.json +73 -17
  358. package/apps/console/.next/standalone/.next/server/instrumentation.js +1 -1
  359. package/apps/console/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  360. package/apps/console/.next/standalone/.next/server/next-font-manifest.js +1 -1
  361. package/apps/console/.next/standalone/.next/server/next-font-manifest.json +1 -1
  362. package/apps/console/.next/standalone/.next/server/pages/404.html +1 -1
  363. package/apps/console/.next/standalone/.next/server/pages/500.html +1 -1
  364. package/apps/console/.next/standalone/.next/server/pages/_app.js +1 -1
  365. package/apps/console/.next/standalone/.next/server/pages/_document.js +1 -1
  366. package/apps/console/.next/standalone/.next/server/pages/_error.js +3 -3
  367. package/apps/console/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  368. package/apps/console/.next/standalone/.next/static/cSGyydhlqn2VGaYXt0uuW/_buildManifest.js +1 -0
  369. package/apps/console/.next/standalone/.next/static/chunks/1255-b28ea36bf0cdbd65.js +1 -0
  370. package/apps/console/.next/standalone/.next/static/chunks/8118-681f2688832ccc66.js +1 -0
  371. package/apps/console/.next/standalone/.next/static/chunks/app/api/agent/route-4178c1913c80eb12.js +1 -0
  372. package/apps/console/.next/standalone/.next/static/chunks/app/api/approvals/route-4178c1913c80eb12.js +1 -0
  373. package/apps/console/.next/standalone/.next/static/chunks/app/api/approvals/stream/route-4178c1913c80eb12.js +1 -0
  374. package/apps/console/.next/standalone/.next/static/chunks/app/api/automation/workflow-blueprint/route-4178c1913c80eb12.js +1 -0
  375. package/apps/console/.next/standalone/.next/static/chunks/app/api/backend/endpoint-spec/route-4178c1913c80eb12.js +1 -0
  376. package/apps/console/.next/standalone/.next/static/chunks/app/api/bootstrap-admin-token/route-4178c1913c80eb12.js +1 -0
  377. package/apps/console/.next/standalone/.next/static/chunks/app/api/brand/brand-audit/route-4178c1913c80eb12.js +1 -0
  378. package/apps/console/.next/standalone/.next/static/chunks/app/api/campaigns/campaign-brief/route-4178c1913c80eb12.js +1 -0
  379. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/confidence/route-4178c1913c80eb12.js +1 -0
  380. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/customer/route-4178c1913c80eb12.js +1 -0
  381. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/dispatches/route-4178c1913c80eb12.js +1 -0
  382. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/engagement/route-4178c1913c80eb12.js +1 -0
  383. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/escalate/route-4178c1913c80eb12.js +1 -0
  384. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/profile/route-4178c1913c80eb12.js +1 -0
  385. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/screenshare/route-4178c1913c80eb12.js +1 -0
  386. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/track-question/route-4178c1913c80eb12.js +1 -0
  387. package/apps/console/.next/standalone/.next/static/chunks/app/api/champion/use-case-wiki/route-4178c1913c80eb12.js +1 -0
  388. package/apps/console/.next/standalone/.next/static/chunks/app/api/chat/route-4178c1913c80eb12.js +1 -0
  389. package/apps/console/.next/standalone/.next/static/chunks/app/api/compliance/risk-register-seed/route-4178c1913c80eb12.js +1 -0
  390. package/apps/console/.next/standalone/.next/static/chunks/app/api/computer-use/[id]/route-4178c1913c80eb12.js +1 -0
  391. package/apps/console/.next/standalone/.next/static/chunks/app/api/computer-use/route-4178c1913c80eb12.js +1 -0
  392. package/apps/console/.next/standalone/.next/static/chunks/app/api/concierge/morning-brief/route-4178c1913c80eb12.js +1 -0
  393. package/apps/console/.next/standalone/.next/static/chunks/app/api/contacts/route-4178c1913c80eb12.js +1 -0
  394. package/apps/console/.next/standalone/.next/static/chunks/app/api/content/seo-brief/route-4178c1913c80eb12.js +1 -0
  395. package/apps/console/.next/standalone/.next/static/chunks/app/api/conversations/route-4178c1913c80eb12.js +1 -0
  396. package/apps/console/.next/standalone/.next/static/chunks/app/api/coo/route-4178c1913c80eb12.js +1 -0
  397. package/apps/console/.next/standalone/.next/static/chunks/app/api/cx/escalation-triage/route-4178c1913c80eb12.js +1 -0
  398. package/apps/console/.next/standalone/.next/static/chunks/app/api/cx/health-score/route-4178c1913c80eb12.js +1 -0
  399. package/apps/console/.next/standalone/.next/static/chunks/app/api/data/cohort-brief/route-4178c1913c80eb12.js +1 -0
  400. package/apps/console/.next/standalone/.next/static/chunks/app/api/delivery/qbr-brief/route-4178c1913c80eb12.js +1 -0
  401. package/apps/console/.next/standalone/.next/static/chunks/app/api/delivery/weekly-brief/route-4178c1913c80eb12.js +1 -0
  402. package/apps/console/.next/standalone/.next/static/chunks/app/api/dev/invalidate-cache/route-4178c1913c80eb12.js +1 -0
  403. package/apps/console/.next/standalone/.next/static/chunks/app/api/devops/runbook/route-4178c1913c80eb12.js +1 -0
  404. package/apps/console/.next/standalone/.next/static/chunks/app/api/email/sequence-brief/route-4178c1913c80eb12.js +1 -0
  405. package/apps/console/.next/standalone/.next/static/chunks/app/api/engineering/adr-draft/route-4178c1913c80eb12.js +1 -0
  406. package/apps/console/.next/standalone/.next/static/chunks/app/api/finance/runway-snapshot/route-4178c1913c80eb12.js +1 -0
  407. package/apps/console/.next/standalone/.next/static/chunks/app/api/frontend/component-spec/route-4178c1913c80eb12.js +1 -0
  408. package/apps/console/.next/standalone/.next/static/chunks/app/api/health/route-4178c1913c80eb12.js +1 -0
  409. package/apps/console/.next/standalone/.next/static/chunks/app/api/implementation/brief/route-4178c1913c80eb12.js +1 -0
  410. package/apps/console/.next/standalone/.next/static/chunks/app/api/implementation/scaffold-migration-script/route-4178c1913c80eb12.js +1 -0
  411. package/apps/console/.next/standalone/.next/static/chunks/app/api/implementation/scaffold-n8n-workflow/route-4178c1913c80eb12.js +1 -0
  412. package/apps/console/.next/standalone/.next/static/chunks/app/api/implementation/scaffold-skill-override/route-4178c1913c80eb12.js +1 -0
  413. package/apps/console/.next/standalone/.next/static/chunks/app/api/inbox/route-4178c1913c80eb12.js +1 -0
  414. package/apps/console/.next/standalone/.next/static/chunks/app/api/inbox/stream/route-4178c1913c80eb12.js +1 -0
  415. package/apps/console/.next/standalone/.next/static/chunks/app/api/investor/kpi-tracker/route-4178c1913c80eb12.js +1 -0
  416. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/channels/status/route-4178c1913c80eb12.js +1 -0
  417. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/channels/telegram/connect/route-4178c1913c80eb12.js +1 -0
  418. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/channels/whatsapp/connect/route-4178c1913c80eb12.js +1 -0
  419. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/gtm/leads/[id]/route-4178c1913c80eb12.js +1 -0
  420. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/gtm/leads/[id]/status/route-4178c1913c80eb12.js +1 -0
  421. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/gtm/templates/[name]/route-4178c1913c80eb12.js +1 -0
  422. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/license/route-4178c1913c80eb12.js +1 -0
  423. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/providers/route-4178c1913c80eb12.js +1 -0
  424. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/sessions/[id]/route-4178c1913c80eb12.js +1 -0
  425. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/sessions/route-4178c1913c80eb12.js +1 -0
  426. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/team/[id]/route-4178c1913c80eb12.js +1 -0
  427. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/team/route-4178c1913c80eb12.js +1 -0
  428. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/vault/route-4178c1913c80eb12.js +1 -0
  429. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/workflows/route-4178c1913c80eb12.js +1 -0
  430. package/apps/console/.next/standalone/.next/static/chunks/app/api/legal/clause-template/route-4178c1913c80eb12.js +1 -0
  431. package/apps/console/.next/standalone/.next/static/chunks/app/api/marketing/cadence-planner/route-4178c1913c80eb12.js +1 -0
  432. package/apps/console/.next/standalone/.next/static/chunks/app/api/marketing/competitive-snapshot/route-4178c1913c80eb12.js +1 -0
  433. package/apps/console/.next/standalone/.next/static/chunks/app/api/onboarding/engagement-plan/route-4178c1913c80eb12.js +1 -0
  434. package/apps/console/.next/standalone/.next/static/chunks/app/api/onboarding/kickoff-brief/route-4178c1913c80eb12.js +1 -0
  435. package/apps/console/.next/standalone/.next/static/chunks/app/api/openclaw/status/route-4178c1913c80eb12.js +1 -0
  436. package/apps/console/.next/standalone/.next/static/chunks/app/api/ops/dispatch-brief/route-4178c1913c80eb12.js +1 -0
  437. package/apps/console/.next/standalone/.next/static/chunks/app/api/pack/route-4178c1913c80eb12.js +1 -0
  438. package/apps/console/.next/standalone/.next/static/chunks/app/api/people/job-brief/route-4178c1913c80eb12.js +1 -0
  439. package/apps/console/.next/standalone/.next/static/chunks/app/api/preferences/route-4178c1913c80eb12.js +1 -0
  440. package/apps/console/.next/standalone/.next/static/chunks/app/api/procurement/po-brief/route-4178c1913c80eb12.js +1 -0
  441. package/apps/console/.next/standalone/.next/static/chunks/app/api/product/prd-draft/route-4178c1913c80eb12.js +1 -0
  442. package/apps/console/.next/standalone/.next/static/chunks/app/api/research/prospect-intel/route-4178c1913c80eb12.js +1 -0
  443. package/apps/console/.next/standalone/.next/static/chunks/app/api/research/search/route-4178c1913c80eb12.js +1 -0
  444. package/apps/console/.next/standalone/.next/static/chunks/app/api/routing/route-4178c1913c80eb12.js +1 -0
  445. package/apps/console/.next/standalone/.next/static/chunks/app/api/runs/route-4178c1913c80eb12.js +1 -0
  446. package/apps/console/.next/standalone/.next/static/chunks/app/api/sales/pipeline-summary/route-4178c1913c80eb12.js +1 -0
  447. package/apps/console/.next/standalone/.next/static/chunks/app/api/sales/prospect-brief/route-4178c1913c80eb12.js +1 -0
  448. package/apps/console/.next/standalone/.next/static/chunks/app/api/solutions/build/route-4178c1913c80eb12.js +1 -0
  449. package/apps/console/.next/standalone/.next/static/chunks/app/api/solutions/quickstart-regenerate/route-4178c1913c80eb12.js +1 -0
  450. package/apps/console/.next/standalone/.next/static/chunks/app/api/solutions/refine/route-4178c1913c80eb12.js +1 -0
  451. package/apps/console/.next/standalone/.next/static/chunks/app/api/strategy/market-pulse/route-4178c1913c80eb12.js +1 -0
  452. package/apps/console/.next/standalone/.next/static/chunks/app/api/telegram/[customerId]/route-4178c1913c80eb12.js +1 -0
  453. package/apps/console/.next/standalone/.next/static/chunks/app/api/templates/regenerate/route-4178c1913c80eb12.js +1 -0
  454. package/apps/console/.next/standalone/.next/static/chunks/app/api/templates/route-4178c1913c80eb12.js +1 -0
  455. package/apps/console/.next/standalone/.next/static/chunks/app/api/uploads/[id]/route-4178c1913c80eb12.js +1 -0
  456. package/apps/console/.next/standalone/.next/static/chunks/app/api/uploads/route-4178c1913c80eb12.js +1 -0
  457. package/apps/console/.next/standalone/.next/static/chunks/app/api/usage/route-4178c1913c80eb12.js +1 -0
  458. package/apps/console/.next/standalone/.next/static/chunks/app/api/video/video-script/route-4178c1913c80eb12.js +1 -0
  459. package/apps/console/.next/standalone/.next/static/chunks/app/api/webhooks/workflow/[id]/route-4178c1913c80eb12.js +1 -0
  460. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/history/[runId]/route-4178c1913c80eb12.js +1 -0
  461. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/history/route-4178c1913c80eb12.js +1 -0
  462. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/route-4178c1913c80eb12.js +1 -0
  463. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/run/route-4178c1913c80eb12.js +1 -0
  464. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/route-4178c1913c80eb12.js +1 -0
  465. package/apps/console/.next/standalone/.next/static/chunks/app/gtm/page-caca5eaacd3c81f2.js +1 -0
  466. package/apps/console/.next/standalone/.next/static/chunks/app/layout-bd27cc63fde6b953.js +1 -0
  467. package/apps/console/.next/standalone/.next/static/chunks/app/page-01558715b1be9361.js +1 -0
  468. package/apps/console/.next/{static/chunks/main-48aa5dd07474f897.js → standalone/.next/static/chunks/main-d8fbd90b2bd781f8.js} +1 -1
  469. package/apps/console/.next/standalone/.next/static/chunks/{webpack-cdf4ab3c7a3034db.js → webpack-43f535d639053361.js} +1 -1
  470. package/apps/console/.next/standalone/.next/static/css/4bdbd0680d42c54d.css +3 -0
  471. package/apps/console/.next/standalone/.next/static/media/0f1bdadaf30e2d5f-s.woff2 +0 -0
  472. package/apps/console/.next/standalone/.next/static/media/22a5144ee8d83bca-s.p.woff2 +0 -0
  473. package/apps/console/.next/standalone/.next/static/media/2c34d62a75506231-s.woff2 +0 -0
  474. package/apps/console/.next/standalone/.next/static/media/35f3de0ebb1cfc70-s.woff2 +0 -0
  475. package/apps/console/.next/standalone/.next/static/media/5ece437c7024c161-s.woff2 +0 -0
  476. package/apps/console/.next/standalone/.next/static/media/601f5c280d60caca-s.woff2 +0 -0
  477. package/apps/console/.next/standalone/.next/static/media/9766a7e9e2e0ad5a-s.woff2 +0 -0
  478. package/apps/console/.next/standalone/.next/static/media/9cc5b37ab1350db7-s.p.woff2 +0 -0
  479. package/apps/console/.next/standalone/.next/static/media/a115172161b307bb-s.woff2 +0 -0
  480. package/apps/console/.next/standalone/.next/static/media/aa016aab0e6d1295-s.woff2 +0 -0
  481. package/apps/console/.next/standalone/.next/static/media/b66cf8e69499582a-s.woff2 +0 -0
  482. package/apps/console/.next/standalone/.next/static/media/d100b2a099e34044-s.woff2 +0 -0
  483. package/apps/console/.next/standalone/.next/static/media/e6099e249fd938cc-s.p.woff2 +0 -0
  484. package/apps/console/.next/standalone/.next/static/media/f5271587012faf78-s.p.woff2 +0 -0
  485. package/apps/console/.next/standalone/.next/static/media/f639721981034f88-s.woff2 +0 -0
  486. package/apps/console/.next/standalone/data/conversations/coo.json +116 -1
  487. package/apps/console/.next/standalone/data/conversations/procurement.json +33 -1
  488. package/apps/console/.next/standalone/data/uploads/316e1ef7-870d-4666-93fa-e439548fc0b6.pdf +0 -0
  489. package/apps/console/.next/standalone/data/uploads/_index.json +11 -0
  490. package/apps/console/.next/standalone/data/usage.json +81 -0
  491. package/apps/console/.next/standalone/node_modules/@next/env/package.json +1 -1
  492. package/apps/console/.next/standalone/node_modules/next/dist/build/analysis/get-page-static-info.js +12 -1
  493. package/apps/console/.next/standalone/node_modules/next/dist/build/next-config-ts/transpile-config.js +2 -1
  494. package/apps/console/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  495. package/apps/console/.next/standalone/node_modules/next/dist/build/webpack-config.js +2 -2
  496. package/apps/console/.next/standalone/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +2 -2
  497. package/apps/console/.next/standalone/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +9 -2
  498. package/apps/console/.next/standalone/node_modules/next/dist/client/script.js +5 -4
  499. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js +11 -11
  500. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +11 -11
  501. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +13 -13
  502. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js +9 -9
  503. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +2 -2
  504. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +5 -5
  505. package/apps/console/.next/standalone/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +3 -3
  506. package/apps/console/.next/standalone/node_modules/next/dist/lib/typescript/required-packages.js +40 -0
  507. package/apps/console/.next/standalone/node_modules/next/dist/lib/verify-typescript-setup.js +7 -2
  508. package/apps/console/.next/standalone/node_modules/next/dist/pages/_document.js +1 -1
  509. package/apps/console/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +3 -6
  510. package/apps/console/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +2 -1
  511. package/apps/console/.next/standalone/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +8 -20
  512. package/apps/console/.next/standalone/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +8 -7
  513. package/apps/console/.next/standalone/node_modules/next/dist/server/app-render/use-flight-response.js +2 -2
  514. package/apps/console/.next/standalone/node_modules/next/dist/server/base-server.js +12 -4
  515. package/apps/console/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1 -1
  516. package/apps/console/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  517. package/apps/console/.next/standalone/node_modules/next/dist/server/image-optimizer.js +22 -2
  518. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  519. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/is-rsc-request.js +18 -0
  520. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/mock-request.js +30 -5
  521. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/router-server.js +6 -3
  522. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +18 -4
  523. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/server-ipc/utils.js +4 -1
  524. package/apps/console/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  525. package/apps/console/.next/standalone/node_modules/next/dist/server/next-server.js +2 -1
  526. package/apps/console/.next/standalone/node_modules/next/dist/server/route-modules/route-module.js +9 -3
  527. package/apps/console/.next/standalone/node_modules/next/dist/server/web/adapter.js +2 -1
  528. package/apps/console/.next/standalone/node_modules/next/dist/shared/lib/canary-only.js +1 -1
  529. package/apps/console/.next/standalone/node_modules/next/dist/{server → shared/lib}/htmlescape.js +15 -0
  530. package/apps/console/.next/standalone/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +56 -10
  531. package/apps/console/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  532. package/apps/console/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  533. package/apps/console/.next/standalone/node_modules/next/package.json +15 -15
  534. package/apps/console/.next/standalone/package.json +6 -0
  535. package/apps/console/.next/standalone/server.js +1 -1
  536. package/apps/console/.next/static/cSGyydhlqn2VGaYXt0uuW/_buildManifest.js +1 -0
  537. package/apps/console/.next/static/chunks/1255-b28ea36bf0cdbd65.js +1 -0
  538. package/apps/console/.next/static/chunks/8118-681f2688832ccc66.js +1 -0
  539. package/apps/console/.next/static/chunks/app/api/agent/route-4178c1913c80eb12.js +1 -0
  540. package/apps/console/.next/static/chunks/app/api/approvals/route-4178c1913c80eb12.js +1 -0
  541. package/apps/console/.next/static/chunks/app/api/approvals/stream/route-4178c1913c80eb12.js +1 -0
  542. package/apps/console/.next/static/chunks/app/api/automation/workflow-blueprint/route-4178c1913c80eb12.js +1 -0
  543. package/apps/console/.next/static/chunks/app/api/backend/endpoint-spec/route-4178c1913c80eb12.js +1 -0
  544. package/apps/console/.next/static/chunks/app/api/bootstrap-admin-token/route-4178c1913c80eb12.js +1 -0
  545. package/apps/console/.next/static/chunks/app/api/brand/brand-audit/route-4178c1913c80eb12.js +1 -0
  546. package/apps/console/.next/static/chunks/app/api/campaigns/campaign-brief/route-4178c1913c80eb12.js +1 -0
  547. package/apps/console/.next/static/chunks/app/api/champion/confidence/route-4178c1913c80eb12.js +1 -0
  548. package/apps/console/.next/static/chunks/app/api/champion/customer/route-4178c1913c80eb12.js +1 -0
  549. package/apps/console/.next/static/chunks/app/api/champion/dispatches/route-4178c1913c80eb12.js +1 -0
  550. package/apps/console/.next/static/chunks/app/api/champion/engagement/route-4178c1913c80eb12.js +1 -0
  551. package/apps/console/.next/static/chunks/app/api/champion/escalate/route-4178c1913c80eb12.js +1 -0
  552. package/apps/console/.next/static/chunks/app/api/champion/profile/route-4178c1913c80eb12.js +1 -0
  553. package/apps/console/.next/static/chunks/app/api/champion/screenshare/route-4178c1913c80eb12.js +1 -0
  554. package/apps/console/.next/static/chunks/app/api/champion/track-question/route-4178c1913c80eb12.js +1 -0
  555. package/apps/console/.next/static/chunks/app/api/champion/use-case-wiki/route-4178c1913c80eb12.js +1 -0
  556. package/apps/console/.next/static/chunks/app/api/chat/route-4178c1913c80eb12.js +1 -0
  557. package/apps/console/.next/static/chunks/app/api/compliance/risk-register-seed/route-4178c1913c80eb12.js +1 -0
  558. package/apps/console/.next/static/chunks/app/api/computer-use/[id]/route-4178c1913c80eb12.js +1 -0
  559. package/apps/console/.next/static/chunks/app/api/computer-use/route-4178c1913c80eb12.js +1 -0
  560. package/apps/console/.next/static/chunks/app/api/concierge/morning-brief/route-4178c1913c80eb12.js +1 -0
  561. package/apps/console/.next/static/chunks/app/api/contacts/route-4178c1913c80eb12.js +1 -0
  562. package/apps/console/.next/static/chunks/app/api/content/seo-brief/route-4178c1913c80eb12.js +1 -0
  563. package/apps/console/.next/static/chunks/app/api/conversations/route-4178c1913c80eb12.js +1 -0
  564. package/apps/console/.next/static/chunks/app/api/coo/route-4178c1913c80eb12.js +1 -0
  565. package/apps/console/.next/static/chunks/app/api/cx/escalation-triage/route-4178c1913c80eb12.js +1 -0
  566. package/apps/console/.next/static/chunks/app/api/cx/health-score/route-4178c1913c80eb12.js +1 -0
  567. package/apps/console/.next/static/chunks/app/api/data/cohort-brief/route-4178c1913c80eb12.js +1 -0
  568. package/apps/console/.next/static/chunks/app/api/delivery/qbr-brief/route-4178c1913c80eb12.js +1 -0
  569. package/apps/console/.next/static/chunks/app/api/delivery/weekly-brief/route-4178c1913c80eb12.js +1 -0
  570. package/apps/console/.next/static/chunks/app/api/dev/invalidate-cache/route-4178c1913c80eb12.js +1 -0
  571. package/apps/console/.next/static/chunks/app/api/devops/runbook/route-4178c1913c80eb12.js +1 -0
  572. package/apps/console/.next/static/chunks/app/api/email/sequence-brief/route-4178c1913c80eb12.js +1 -0
  573. package/apps/console/.next/static/chunks/app/api/engineering/adr-draft/route-4178c1913c80eb12.js +1 -0
  574. package/apps/console/.next/static/chunks/app/api/finance/runway-snapshot/route-4178c1913c80eb12.js +1 -0
  575. package/apps/console/.next/static/chunks/app/api/frontend/component-spec/route-4178c1913c80eb12.js +1 -0
  576. package/apps/console/.next/static/chunks/app/api/health/route-4178c1913c80eb12.js +1 -0
  577. package/apps/console/.next/static/chunks/app/api/implementation/brief/route-4178c1913c80eb12.js +1 -0
  578. package/apps/console/.next/static/chunks/app/api/implementation/scaffold-migration-script/route-4178c1913c80eb12.js +1 -0
  579. package/apps/console/.next/static/chunks/app/api/implementation/scaffold-n8n-workflow/route-4178c1913c80eb12.js +1 -0
  580. package/apps/console/.next/static/chunks/app/api/implementation/scaffold-skill-override/route-4178c1913c80eb12.js +1 -0
  581. package/apps/console/.next/static/chunks/app/api/inbox/route-4178c1913c80eb12.js +1 -0
  582. package/apps/console/.next/static/chunks/app/api/inbox/stream/route-4178c1913c80eb12.js +1 -0
  583. package/apps/console/.next/static/chunks/app/api/investor/kpi-tracker/route-4178c1913c80eb12.js +1 -0
  584. package/apps/console/.next/static/chunks/app/api/leedab/channels/status/route-4178c1913c80eb12.js +1 -0
  585. package/apps/console/.next/static/chunks/app/api/leedab/channels/telegram/connect/route-4178c1913c80eb12.js +1 -0
  586. package/apps/console/.next/static/chunks/app/api/leedab/channels/whatsapp/connect/route-4178c1913c80eb12.js +1 -0
  587. package/apps/console/.next/static/chunks/app/api/leedab/gtm/leads/[id]/route-4178c1913c80eb12.js +1 -0
  588. package/apps/console/.next/static/chunks/app/api/leedab/gtm/leads/[id]/status/route-4178c1913c80eb12.js +1 -0
  589. package/apps/console/.next/static/chunks/app/api/leedab/gtm/templates/[name]/route-4178c1913c80eb12.js +1 -0
  590. package/apps/console/.next/static/chunks/app/api/leedab/license/route-4178c1913c80eb12.js +1 -0
  591. package/apps/console/.next/static/chunks/app/api/leedab/providers/route-4178c1913c80eb12.js +1 -0
  592. package/apps/console/.next/static/chunks/app/api/leedab/sessions/[id]/route-4178c1913c80eb12.js +1 -0
  593. package/apps/console/.next/static/chunks/app/api/leedab/sessions/route-4178c1913c80eb12.js +1 -0
  594. package/apps/console/.next/static/chunks/app/api/leedab/team/[id]/route-4178c1913c80eb12.js +1 -0
  595. package/apps/console/.next/static/chunks/app/api/leedab/team/route-4178c1913c80eb12.js +1 -0
  596. package/apps/console/.next/static/chunks/app/api/leedab/vault/route-4178c1913c80eb12.js +1 -0
  597. package/apps/console/.next/static/chunks/app/api/leedab/workflows/route-4178c1913c80eb12.js +1 -0
  598. package/apps/console/.next/static/chunks/app/api/legal/clause-template/route-4178c1913c80eb12.js +1 -0
  599. package/apps/console/.next/static/chunks/app/api/marketing/cadence-planner/route-4178c1913c80eb12.js +1 -0
  600. package/apps/console/.next/static/chunks/app/api/marketing/competitive-snapshot/route-4178c1913c80eb12.js +1 -0
  601. package/apps/console/.next/static/chunks/app/api/onboarding/engagement-plan/route-4178c1913c80eb12.js +1 -0
  602. package/apps/console/.next/static/chunks/app/api/onboarding/kickoff-brief/route-4178c1913c80eb12.js +1 -0
  603. package/apps/console/.next/static/chunks/app/api/openclaw/status/route-4178c1913c80eb12.js +1 -0
  604. package/apps/console/.next/static/chunks/app/api/ops/dispatch-brief/route-4178c1913c80eb12.js +1 -0
  605. package/apps/console/.next/static/chunks/app/api/pack/route-4178c1913c80eb12.js +1 -0
  606. package/apps/console/.next/static/chunks/app/api/people/job-brief/route-4178c1913c80eb12.js +1 -0
  607. package/apps/console/.next/static/chunks/app/api/preferences/route-4178c1913c80eb12.js +1 -0
  608. package/apps/console/.next/static/chunks/app/api/procurement/po-brief/route-4178c1913c80eb12.js +1 -0
  609. package/apps/console/.next/static/chunks/app/api/product/prd-draft/route-4178c1913c80eb12.js +1 -0
  610. package/apps/console/.next/static/chunks/app/api/research/prospect-intel/route-4178c1913c80eb12.js +1 -0
  611. package/apps/console/.next/static/chunks/app/api/research/search/route-4178c1913c80eb12.js +1 -0
  612. package/apps/console/.next/static/chunks/app/api/routing/route-4178c1913c80eb12.js +1 -0
  613. package/apps/console/.next/static/chunks/app/api/runs/route-4178c1913c80eb12.js +1 -0
  614. package/apps/console/.next/static/chunks/app/api/sales/pipeline-summary/route-4178c1913c80eb12.js +1 -0
  615. package/apps/console/.next/static/chunks/app/api/sales/prospect-brief/route-4178c1913c80eb12.js +1 -0
  616. package/apps/console/.next/static/chunks/app/api/solutions/build/route-4178c1913c80eb12.js +1 -0
  617. package/apps/console/.next/static/chunks/app/api/solutions/quickstart-regenerate/route-4178c1913c80eb12.js +1 -0
  618. package/apps/console/.next/static/chunks/app/api/solutions/refine/route-4178c1913c80eb12.js +1 -0
  619. package/apps/console/.next/static/chunks/app/api/strategy/market-pulse/route-4178c1913c80eb12.js +1 -0
  620. package/apps/console/.next/static/chunks/app/api/telegram/[customerId]/route-4178c1913c80eb12.js +1 -0
  621. package/apps/console/.next/static/chunks/app/api/templates/regenerate/route-4178c1913c80eb12.js +1 -0
  622. package/apps/console/.next/static/chunks/app/api/templates/route-4178c1913c80eb12.js +1 -0
  623. package/apps/console/.next/static/chunks/app/api/uploads/[id]/route-4178c1913c80eb12.js +1 -0
  624. package/apps/console/.next/static/chunks/app/api/uploads/route-4178c1913c80eb12.js +1 -0
  625. package/apps/console/.next/static/chunks/app/api/usage/route-4178c1913c80eb12.js +1 -0
  626. package/apps/console/.next/static/chunks/app/api/video/video-script/route-4178c1913c80eb12.js +1 -0
  627. package/apps/console/.next/static/chunks/app/api/webhooks/workflow/[id]/route-4178c1913c80eb12.js +1 -0
  628. package/apps/console/.next/static/chunks/app/api/workflows/[id]/history/[runId]/route-4178c1913c80eb12.js +1 -0
  629. package/apps/console/.next/static/chunks/app/api/workflows/[id]/history/route-4178c1913c80eb12.js +1 -0
  630. package/apps/console/.next/static/chunks/app/api/workflows/[id]/route-4178c1913c80eb12.js +1 -0
  631. package/apps/console/.next/static/chunks/app/api/workflows/[id]/run/route-4178c1913c80eb12.js +1 -0
  632. package/apps/console/.next/static/chunks/app/api/workflows/route-4178c1913c80eb12.js +1 -0
  633. package/apps/console/.next/static/chunks/app/gtm/page-caca5eaacd3c81f2.js +1 -0
  634. package/apps/console/.next/static/chunks/app/layout-bd27cc63fde6b953.js +1 -0
  635. package/apps/console/.next/static/chunks/app/page-01558715b1be9361.js +1 -0
  636. package/apps/console/.next/{standalone/.next/static/chunks/main-48aa5dd07474f897.js → static/chunks/main-d8fbd90b2bd781f8.js} +1 -1
  637. package/apps/console/.next/static/chunks/{webpack-cdf4ab3c7a3034db.js → webpack-43f535d639053361.js} +1 -1
  638. package/apps/console/.next/static/css/4bdbd0680d42c54d.css +3 -0
  639. package/apps/console/.next/static/media/0f1bdadaf30e2d5f-s.woff2 +0 -0
  640. package/apps/console/.next/static/media/22a5144ee8d83bca-s.p.woff2 +0 -0
  641. package/apps/console/.next/static/media/2c34d62a75506231-s.woff2 +0 -0
  642. package/apps/console/.next/static/media/35f3de0ebb1cfc70-s.woff2 +0 -0
  643. package/apps/console/.next/static/media/5ece437c7024c161-s.woff2 +0 -0
  644. package/apps/console/.next/static/media/601f5c280d60caca-s.woff2 +0 -0
  645. package/apps/console/.next/static/media/9766a7e9e2e0ad5a-s.woff2 +0 -0
  646. package/apps/console/.next/static/media/9cc5b37ab1350db7-s.p.woff2 +0 -0
  647. package/apps/console/.next/static/media/a115172161b307bb-s.woff2 +0 -0
  648. package/apps/console/.next/static/media/aa016aab0e6d1295-s.woff2 +0 -0
  649. package/apps/console/.next/static/media/b66cf8e69499582a-s.woff2 +0 -0
  650. package/apps/console/.next/static/media/d100b2a099e34044-s.woff2 +0 -0
  651. package/apps/console/.next/static/media/e6099e249fd938cc-s.p.woff2 +0 -0
  652. package/apps/console/.next/static/media/f5271587012faf78-s.p.woff2 +0 -0
  653. package/apps/console/.next/static/media/f639721981034f88-s.woff2 +0 -0
  654. package/apps/console/README.md +199 -0
  655. package/bin/leedab.js +271 -2
  656. package/bin/onboard-cofounder.sh +263 -0
  657. package/bin/onboard-customer.sh +303 -0
  658. package/bin/scan-secrets-tree.sh +138 -0
  659. package/bin/seed-workflows.mjs +80 -0
  660. package/bin/validate-manifests.sh +256 -0
  661. package/bin/wiring-status.sh +123 -0
  662. package/clients/default/manifest.json +191 -0
  663. package/clients/tarheel/INSTALL.md +333 -0
  664. package/clients/tarheel/manifest.json +34 -0
  665. package/context/brand-guide.md +95 -0
  666. package/context/competitor-landscape.md +120 -0
  667. package/context/customer-personas.md +91 -0
  668. package/context/customers/acme-logistics/playbook.md +19 -0
  669. package/context/customers/bondi-bloom/playbook.md +30 -0
  670. package/context/customers/chip-pro/playbook.md +107 -0
  671. package/context/customers/coastal-built/playbook.md +31 -0
  672. package/context/customers/element-pilates/playbook.md +33 -0
  673. package/context/customers/hawkesbury-roofing/playbook.md +21 -0
  674. package/context/customers/howard-partners/playbook.md +33 -0
  675. package/context/customers/ledbetter-advisory/playbook.md +21 -0
  676. package/context/customers/sunset-cafe/playbook.md +27 -0
  677. package/context/customers/tarheel/playbook.md +28 -0
  678. package/context/metrics.md +74 -0
  679. package/context/product-brief.md +134 -0
  680. package/context/roadmap.md +76 -0
  681. package/context/skills/brand-skills.md +62 -0
  682. package/context/skills/campaigns-skills.md +161 -0
  683. package/context/skills/compliance-skills.md +83 -0
  684. package/context/skills/concierge-skills.md +55 -0
  685. package/context/skills/content-skills.md +179 -0
  686. package/context/skills/cx-skills.md +296 -0
  687. package/context/skills/dashboard-ops.md +43 -0
  688. package/context/skills/email-skills.md +137 -0
  689. package/context/skills/finance-skills.md +314 -0
  690. package/context/skills/marketing-skills.md +843 -0
  691. package/context/skills/n8n-skills.md +110 -0
  692. package/context/skills/ops-skills.md +324 -0
  693. package/context/skills/people-skills.md +52 -0
  694. package/context/skills/procurement-skills.md +69 -0
  695. package/context/skills/product-skills.md +569 -0
  696. package/context/skills/research-skills.md +62 -0
  697. package/context/skills/sales-skills.md +827 -0
  698. package/context/skills/strategy-investor-skills.md +530 -0
  699. package/context/skills/video-skills.md +109 -0
  700. package/context/use-cases/construction.md +97 -0
  701. package/context/use-cases/hospitality.md +76 -0
  702. package/context/use-cases/logistics.md +57 -0
  703. package/context/use-cases/professional.md +61 -0
  704. package/context/use-cases/retail.md +80 -0
  705. package/context/use-cases/trades.md +97 -0
  706. package/dist/console-launcher.js +9 -0
  707. package/dist/gateway.js +4 -1
  708. package/dist/gtm/templates.js +17 -3
  709. package/dist/license.d.ts +6 -0
  710. package/dist/license.js +10 -0
  711. package/package.json +13 -3
  712. package/wiki/README.md +27 -0
  713. package/wiki/customer-use-cases/README.md +26 -0
  714. package/wiki/customer-use-cases/_template.md +42 -0
  715. package/wiki/customer-use-cases/agencies.md +47 -0
  716. package/wiki/customer-use-cases/ecommerce.md +47 -0
  717. package/wiki/customer-use-cases/food-service.md +45 -0
  718. package/wiki/customer-use-cases/healthcare.md +49 -0
  719. package/wiki/customer-use-cases/hospitality.md +47 -0
  720. package/wiki/customer-use-cases/logistics.md +58 -0
  721. package/wiki/customer-use-cases/manufacturing.md +45 -0
  722. package/wiki/customer-use-cases/professional.md +48 -0
  723. package/wiki/customer-use-cases/retail.md +44 -0
  724. package/wiki/customer-use-cases/trades.md +47 -0
  725. package/apps/console/.next/standalone/.next/server/app/api/demo/route.js +0 -19
  726. package/apps/console/.next/standalone/.next/server/app/api/demo/route.js.nft.json +0 -1
  727. package/apps/console/.next/standalone/.next/server/app/api/demo/route_client-reference-manifest.js +0 -1
  728. package/apps/console/.next/standalone/.next/server/chunks/2126.js +0 -9
  729. package/apps/console/.next/standalone/.next/server/chunks/4296.js +0 -9
  730. package/apps/console/.next/standalone/.next/server/chunks/5267.js +0 -9
  731. package/apps/console/.next/standalone/.next/server/chunks/7515.js +0 -1
  732. package/apps/console/.next/standalone/.next/static/chunks/1255-5fe68596fe147850.js +0 -1
  733. package/apps/console/.next/standalone/.next/static/chunks/856-71ac9b098091e245.js +0 -1
  734. package/apps/console/.next/standalone/.next/static/chunks/app/api/agent/route-35bf83db0bc9ad19.js +0 -1
  735. package/apps/console/.next/standalone/.next/static/chunks/app/api/approvals/route-35bf83db0bc9ad19.js +0 -1
  736. package/apps/console/.next/standalone/.next/static/chunks/app/api/approvals/stream/route-35bf83db0bc9ad19.js +0 -1
  737. package/apps/console/.next/standalone/.next/static/chunks/app/api/chat/route-35bf83db0bc9ad19.js +0 -1
  738. package/apps/console/.next/standalone/.next/static/chunks/app/api/computer-use/[id]/route-35bf83db0bc9ad19.js +0 -1
  739. package/apps/console/.next/standalone/.next/static/chunks/app/api/computer-use/route-35bf83db0bc9ad19.js +0 -1
  740. package/apps/console/.next/standalone/.next/static/chunks/app/api/contacts/route-35bf83db0bc9ad19.js +0 -1
  741. package/apps/console/.next/standalone/.next/static/chunks/app/api/conversations/route-35bf83db0bc9ad19.js +0 -1
  742. package/apps/console/.next/standalone/.next/static/chunks/app/api/demo/route-35bf83db0bc9ad19.js +0 -1
  743. package/apps/console/.next/standalone/.next/static/chunks/app/api/health/route-35bf83db0bc9ad19.js +0 -1
  744. package/apps/console/.next/standalone/.next/static/chunks/app/api/inbox/route-35bf83db0bc9ad19.js +0 -1
  745. package/apps/console/.next/standalone/.next/static/chunks/app/api/inbox/stream/route-35bf83db0bc9ad19.js +0 -1
  746. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/channels/status/route-35bf83db0bc9ad19.js +0 -1
  747. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/channels/telegram/connect/route-35bf83db0bc9ad19.js +0 -1
  748. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/channels/whatsapp/connect/route-35bf83db0bc9ad19.js +0 -1
  749. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/license/route-35bf83db0bc9ad19.js +0 -1
  750. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/providers/route-35bf83db0bc9ad19.js +0 -1
  751. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/sessions/[id]/route-35bf83db0bc9ad19.js +0 -1
  752. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/sessions/route-35bf83db0bc9ad19.js +0 -1
  753. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/team/[id]/route-35bf83db0bc9ad19.js +0 -1
  754. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/team/route-35bf83db0bc9ad19.js +0 -1
  755. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/vault/route-35bf83db0bc9ad19.js +0 -1
  756. package/apps/console/.next/standalone/.next/static/chunks/app/api/leedab/workflows/route-35bf83db0bc9ad19.js +0 -1
  757. package/apps/console/.next/standalone/.next/static/chunks/app/api/openclaw/status/route-35bf83db0bc9ad19.js +0 -1
  758. package/apps/console/.next/standalone/.next/static/chunks/app/api/pack/route-35bf83db0bc9ad19.js +0 -1
  759. package/apps/console/.next/standalone/.next/static/chunks/app/api/preferences/route-35bf83db0bc9ad19.js +0 -1
  760. package/apps/console/.next/standalone/.next/static/chunks/app/api/routing/route-35bf83db0bc9ad19.js +0 -1
  761. package/apps/console/.next/standalone/.next/static/chunks/app/api/runs/route-35bf83db0bc9ad19.js +0 -1
  762. package/apps/console/.next/standalone/.next/static/chunks/app/api/templates/route-35bf83db0bc9ad19.js +0 -1
  763. package/apps/console/.next/standalone/.next/static/chunks/app/api/uploads/[id]/route-35bf83db0bc9ad19.js +0 -1
  764. package/apps/console/.next/standalone/.next/static/chunks/app/api/uploads/route-35bf83db0bc9ad19.js +0 -1
  765. package/apps/console/.next/standalone/.next/static/chunks/app/api/usage/route-35bf83db0bc9ad19.js +0 -1
  766. package/apps/console/.next/standalone/.next/static/chunks/app/api/webhooks/workflow/[id]/route-35bf83db0bc9ad19.js +0 -1
  767. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/history/[runId]/route-35bf83db0bc9ad19.js +0 -1
  768. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/history/route-35bf83db0bc9ad19.js +0 -1
  769. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/route-35bf83db0bc9ad19.js +0 -1
  770. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/[id]/run/route-35bf83db0bc9ad19.js +0 -1
  771. package/apps/console/.next/standalone/.next/static/chunks/app/api/workflows/route-35bf83db0bc9ad19.js +0 -1
  772. package/apps/console/.next/standalone/.next/static/chunks/app/layout-6be76a69bef30b9d.js +0 -1
  773. package/apps/console/.next/standalone/.next/static/chunks/app/page-4b700096636d1cae.js +0 -1
  774. package/apps/console/.next/standalone/.next/static/css/5c5c01673617cce6.css +0 -3
  775. package/apps/console/.next/standalone/.next/static/waL1Qm5zCQrO1oi52jYdI/_buildManifest.js +0 -1
  776. package/apps/console/.next/static/chunks/1255-5fe68596fe147850.js +0 -1
  777. package/apps/console/.next/static/chunks/856-71ac9b098091e245.js +0 -1
  778. package/apps/console/.next/static/chunks/app/api/agent/route-35bf83db0bc9ad19.js +0 -1
  779. package/apps/console/.next/static/chunks/app/api/approvals/route-35bf83db0bc9ad19.js +0 -1
  780. package/apps/console/.next/static/chunks/app/api/approvals/stream/route-35bf83db0bc9ad19.js +0 -1
  781. package/apps/console/.next/static/chunks/app/api/chat/route-35bf83db0bc9ad19.js +0 -1
  782. package/apps/console/.next/static/chunks/app/api/computer-use/[id]/route-35bf83db0bc9ad19.js +0 -1
  783. package/apps/console/.next/static/chunks/app/api/computer-use/route-35bf83db0bc9ad19.js +0 -1
  784. package/apps/console/.next/static/chunks/app/api/contacts/route-35bf83db0bc9ad19.js +0 -1
  785. package/apps/console/.next/static/chunks/app/api/conversations/route-35bf83db0bc9ad19.js +0 -1
  786. package/apps/console/.next/static/chunks/app/api/demo/route-35bf83db0bc9ad19.js +0 -1
  787. package/apps/console/.next/static/chunks/app/api/health/route-35bf83db0bc9ad19.js +0 -1
  788. package/apps/console/.next/static/chunks/app/api/inbox/route-35bf83db0bc9ad19.js +0 -1
  789. package/apps/console/.next/static/chunks/app/api/inbox/stream/route-35bf83db0bc9ad19.js +0 -1
  790. package/apps/console/.next/static/chunks/app/api/leedab/channels/status/route-35bf83db0bc9ad19.js +0 -1
  791. package/apps/console/.next/static/chunks/app/api/leedab/channels/telegram/connect/route-35bf83db0bc9ad19.js +0 -1
  792. package/apps/console/.next/static/chunks/app/api/leedab/channels/whatsapp/connect/route-35bf83db0bc9ad19.js +0 -1
  793. package/apps/console/.next/static/chunks/app/api/leedab/license/route-35bf83db0bc9ad19.js +0 -1
  794. package/apps/console/.next/static/chunks/app/api/leedab/providers/route-35bf83db0bc9ad19.js +0 -1
  795. package/apps/console/.next/static/chunks/app/api/leedab/sessions/[id]/route-35bf83db0bc9ad19.js +0 -1
  796. package/apps/console/.next/static/chunks/app/api/leedab/sessions/route-35bf83db0bc9ad19.js +0 -1
  797. package/apps/console/.next/static/chunks/app/api/leedab/team/[id]/route-35bf83db0bc9ad19.js +0 -1
  798. package/apps/console/.next/static/chunks/app/api/leedab/team/route-35bf83db0bc9ad19.js +0 -1
  799. package/apps/console/.next/static/chunks/app/api/leedab/vault/route-35bf83db0bc9ad19.js +0 -1
  800. package/apps/console/.next/static/chunks/app/api/leedab/workflows/route-35bf83db0bc9ad19.js +0 -1
  801. package/apps/console/.next/static/chunks/app/api/openclaw/status/route-35bf83db0bc9ad19.js +0 -1
  802. package/apps/console/.next/static/chunks/app/api/pack/route-35bf83db0bc9ad19.js +0 -1
  803. package/apps/console/.next/static/chunks/app/api/preferences/route-35bf83db0bc9ad19.js +0 -1
  804. package/apps/console/.next/static/chunks/app/api/routing/route-35bf83db0bc9ad19.js +0 -1
  805. package/apps/console/.next/static/chunks/app/api/runs/route-35bf83db0bc9ad19.js +0 -1
  806. package/apps/console/.next/static/chunks/app/api/templates/route-35bf83db0bc9ad19.js +0 -1
  807. package/apps/console/.next/static/chunks/app/api/uploads/[id]/route-35bf83db0bc9ad19.js +0 -1
  808. package/apps/console/.next/static/chunks/app/api/uploads/route-35bf83db0bc9ad19.js +0 -1
  809. package/apps/console/.next/static/chunks/app/api/usage/route-35bf83db0bc9ad19.js +0 -1
  810. package/apps/console/.next/static/chunks/app/api/webhooks/workflow/[id]/route-35bf83db0bc9ad19.js +0 -1
  811. package/apps/console/.next/static/chunks/app/api/workflows/[id]/history/[runId]/route-35bf83db0bc9ad19.js +0 -1
  812. package/apps/console/.next/static/chunks/app/api/workflows/[id]/history/route-35bf83db0bc9ad19.js +0 -1
  813. package/apps/console/.next/static/chunks/app/api/workflows/[id]/route-35bf83db0bc9ad19.js +0 -1
  814. package/apps/console/.next/static/chunks/app/api/workflows/[id]/run/route-35bf83db0bc9ad19.js +0 -1
  815. package/apps/console/.next/static/chunks/app/api/workflows/route-35bf83db0bc9ad19.js +0 -1
  816. package/apps/console/.next/static/chunks/app/layout-6be76a69bef30b9d.js +0 -1
  817. package/apps/console/.next/static/chunks/app/page-4b700096636d1cae.js +0 -1
  818. package/apps/console/.next/static/css/5c5c01673617cce6.css +0 -3
  819. package/apps/console/.next/static/waL1Qm5zCQrO1oi52jYdI/_buildManifest.js +0 -1
  820. /package/apps/console/.next/standalone/.next/static/{waL1Qm5zCQrO1oi52jYdI → cSGyydhlqn2VGaYXt0uuW}/_ssgManifest.js +0 -0
  821. /package/apps/console/.next/static/{waL1Qm5zCQrO1oi52jYdI → cSGyydhlqn2VGaYXt0uuW}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{6087:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eV});var a=n(5155),i=n(2115),o=n(856);let l={coo:{id:"coo",name:"COO",tagline:"Org coordination, daily briefs",description:"Cross-team coordination, priority calls, daily ops briefs, delegation recommendations.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#10b981",glyph:"CO",team:"executive",contextFiles:["context/product-brief.md","context/metrics.md","context/roadmap.md","context/skills/ops-skills.md","context/skills/dashboard-ops.md"],agentFile:"agents/coo-agent.md"},marketing:{id:"marketing",name:"Marketing",tagline:"Team lead, brand, ICP, strategy",description:"Marketing team lead. Brand voice, ICP definition, marketing strategy, and cross-channel oversight.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#f59e0b",glyph:"MK",team:"marketing",contextFiles:["context/product-brief.md","context/brand-guide.md","context/customer-personas.md","context/competitor-landscape.md","context/skills/marketing-skills.md","context/skills/content-skills.md"],agentFile:"agents/marketing-agent.md"},content:{id:"content",name:"Content",tagline:"Copywriting, SEO, social, newsletters",description:"Conversion copywriting, SEO blog posts, social media content, newsletters, and case studies.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#f59e0b",glyph:"CN",team:"marketing",contextFiles:["context/product-brief.md","context/brand-guide.md","context/customer-personas.md","context/skills/content-skills.md"],agentFile:"agents/content-agent.md"},video:{id:"video",name:"Video",tagline:"AI video, scripts, programmatic production",description:"Video production using AI tools: Hyperframes, HeyGen, Veo, Runway. Scripts, storyboards, and demo walkthroughs.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#f59e0b",glyph:"VD",team:"marketing",contextFiles:["context/product-brief.md","context/brand-guide.md","context/customer-personas.md","context/skills/video-skills.md"],agentFile:"agents/video-agent.md"},campaigns:{id:"campaigns",name:"Campaigns",tagline:"Paid ads, A/B tests, growth experiments",description:"Paid acquisition on Google/Meta/LinkedIn, A/B test programs, UTM taxonomy, CAC/LTV analysis, ad copy variants.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#f59e0b",glyph:"CM",team:"marketing",contextFiles:["context/product-brief.md","context/customer-personas.md","context/competitor-landscape.md","context/metrics.md","context/skills/campaigns-skills.md"],agentFile:"agents/campaigns-agent.md"},email:{id:"email",name:"Email",tagline:"Sequences, cold outreach, nurture flows",description:"Email sequences, cold outreach campaigns, lifecycle drips, and re-engagement flows.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#f59e0b",glyph:"EM",team:"marketing",contextFiles:["context/product-brief.md","context/brand-guide.md","context/customer-personas.md","context/skills/email-skills.md"],agentFile:"agents/marketing-agent.md"},product:{id:"product",name:"Product",tagline:"Specs, PRDs, release notes",description:"Turns fuzzy ideas into implementable specs. Feature docs, user stories, release notes.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#fbbf24",glyph:"PR",team:"product",contextFiles:["context/product-brief.md","context/roadmap.md","context/skills/product-skills.md"],agentFile:"agents/product-agent.md"},engineering:{id:"engineering",name:"Engineering",tagline:"Tech lead, architecture, code review",description:"Engineering team lead. Architecture decisions, code review, technical documentation, ADRs.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6","claude-opus-4-6"],accent:"#d97706",glyph:"EN",team:"engineering",contextFiles:["context/product-brief.md"],agentFile:"agents/engineering-agent.md"},frontend:{id:"frontend",name:"Frontend",tagline:"React, UI, design implementation",description:"React/Next.js/Tailwind specialist. Component specs, UI implementation, accessibility, performance.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#d97706",glyph:"FE",team:"engineering",contextFiles:["context/product-brief.md"],agentFile:"agents/frontend-agent.md"},backend:{id:"backend",name:"Backend",tagline:"APIs, databases, server architecture",description:"Node.js/TypeScript specialist. API design, database schemas, server architecture, security.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#d97706",glyph:"BE",team:"engineering",contextFiles:["context/product-brief.md"],agentFile:"agents/backend-agent.md"},devops:{id:"devops",name:"DevOps",tagline:"CI/CD, infra, monitoring, runbooks",description:"GitHub Actions, Docker, deployment pipelines, uptime monitoring, incident runbooks.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#d97706",glyph:"DV",team:"engineering",contextFiles:["context/product-brief.md"],agentFile:"agents/devops-agent.md"},strategy:{id:"strategy",name:"Strategy",tagline:"GTM, competitive, pricing",description:"GTM plans, competitive analysis, pricing strategy, roadmap prioritization, OKRs.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#f59e0b",glyph:"ST",team:"strategy",contextFiles:["context/product-brief.md","context/competitor-landscape.md","context/customer-personas.md","context/metrics.md","context/roadmap.md","context/skills/strategy-investor-skills.md"],agentFile:"agents/strategy-agent.md"},sales:{id:"sales",name:"Sales",tagline:"Deals, proposals, outreach, pipeline",description:"Deal-stage work: proposal decks, outreach sequences, demo scripts, objection handling, CRM notes.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#10b981",glyph:"SL",team:"sales",contextFiles:["context/product-brief.md","context/customer-personas.md","context/competitor-landscape.md","context/skills/sales-skills.md"],agentFile:"agents/sales-agent.md"},finance:{id:"finance",name:"Finance",tagline:"Runway, burn, scenario planning",description:"Internal financial ops: runway models, burn analysis, scenario planning, budget vs actuals.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#10b981",glyph:"FN",team:"finance",contextFiles:["context/product-brief.md","context/metrics.md","context/skills/finance-skills.md"],agentFile:"agents/finance-agent.md"},cx:{id:"cx",name:"Customer Success",tagline:"Onboarding, health scores, churn",description:"Customer health scoring, onboarding playbooks, churn risk memos, QBR decks, escalation templates.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#10b981",glyph:"CX",team:"cx",contextFiles:["context/product-brief.md","context/customer-personas.md","context/metrics.md","context/skills/cx-skills.md"],agentFile:"agents/cx-agent.md"},investor:{id:"investor",name:"Investor",tagline:"Deck, updates, fundraising",description:"Pitch decks, investor updates, financial models, due diligence prep.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#fde68a",glyph:"IN",team:"investor",contextFiles:["context/product-brief.md","context/metrics.md","context/competitor-landscape.md","context/customer-personas.md","context/skills/strategy-investor-skills.md"],agentFile:"agents/investor-agent.md"},legal:{id:"legal",name:"Legal",tagline:"Contracts, privacy, compliance",description:"Customer contracts, privacy policy, data handling compliance, term sheets, due diligence.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#6366f1",glyph:"LG",team:"legal",contextFiles:["context/product-brief.md"],agentFile:"agents/legal-agent.md"},automation:{id:"automation",name:"Automation",tagline:"Build & manage n8n workflows",description:"Build, deploy, and manage n8n workflows from natural language. Connect any app, trigger any automation, inspect execution history.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#f97316",glyph:"N8",team:"automation",contextFiles:["context/product-brief.md","context/skills/n8n-skills.md","context/skills/dashboard-ops.md"],agentFile:"agents/automation-agent.md"},data:{id:"data",name:"Data",tagline:"Metrics, cohorts, retention",description:"Product analytics, cohort analysis, funnel metrics, retention modeling, growth instrumentation.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#06b6d4",glyph:"DT",team:"data",contextFiles:["context/product-brief.md","context/metrics.md"],agentFile:"agents/data-agent.md"},ops:{id:"ops",name:"Operations",tagline:"Hiring, internal, partnerships",description:"Hiring posts, internal processes, support templates, partner outreach.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#fbbf24",glyph:"OP",team:"ops",contextFiles:["context/product-brief.md","context/brand-guide.md","context/skills/ops-skills.md"],agentFile:"agents/ops-agent.md"},concierge:{id:"concierge",name:"Concierge",tagline:"Calendar, travel, life logistics",description:"Founder-only personal assistant. Calendar defence, travel, expenses, meeting prep.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#10b981",glyph:"CC",team:"executive",contextFiles:["context/skills/concierge-skills.md"],agentFile:"agents/concierge-agent.md"},brand:{id:"brand",name:"Brand",tagline:"Visual identity, decks, guardrails",description:"Brand consistency, deck design, visual identity, asset briefs, brand audits.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#f59e0b",glyph:"BR",team:"marketing",contextFiles:["context/brand-guide.md","context/skills/brand-skills.md","context/skills/marketing-skills.md"],agentFile:"agents/brand-agent.md"},research:{id:"research",name:"Research",tagline:"Cited findings, prospect briefs, intel",description:"Competitive intel, market sizing, prospect briefs, vendor evaluation. Cite or shut up.",defaultModel:"claude-opus-4-7",availableModels:["claude-opus-4-7","claude-sonnet-4-6"],accent:"#4a7c8a",glyph:"RS",team:"strategy",contextFiles:["context/product-brief.md","context/competitor-landscape.md","context/skills/research-skills.md"],agentFile:"agents/research-agent.md"},people:{id:"people",name:"People",tagline:"Hiring, onboarding, leave, performance",description:"HR for SMBs. Job descriptions, onboarding plans, performance reviews, employee comms.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#8a5e7a",glyph:"PE",team:"people",contextFiles:["context/product-brief.md","context/brand-guide.md","context/skills/people-skills.md"],agentFile:"agents/people-agent.md"},procurement:{id:"procurement",name:"Procurement",tagline:"Suppliers, POs, freight, disputes",description:"Purchase orders, supplier scoring, freight rate sourcing, deduction disputes.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5-20251001"],accent:"#7a6248",glyph:"PR",team:"ops",contextFiles:["context/product-brief.md","context/skills/procurement-skills.md","context/skills/finance-skills.md"],agentFile:"agents/procurement-agent.md"},compliance:{id:"compliance",name:"Compliance",tagline:"SOC 2, ISO, insurance, risk register",description:"Compliance frameworks, audit prep, insurance tracking, vendor due diligence, risk register.",defaultModel:"claude-sonnet-4-6",availableModels:["claude-sonnet-4-6","claude-opus-4-7"],accent:"#5a6b80",glyph:"CP",team:"legal",contextFiles:["context/product-brief.md","context/skills/compliance-skills.md"],agentFile:"agents/compliance-agent.md"}},r=["coo","concierge","procurement","cx","finance","sales","people"],s=[{label:"EXECUTIVE",color:"#c95c0a",ids:["coo","concierge"]},{label:"SUPPLY",color:"#7a6248",ids:["procurement"]},{label:"SUPPORT",color:"#8a4a3a",ids:["cx"]},{label:"MONEY",color:"#7a8e5a",ids:["finance"]},{label:"SALES",color:"#b8633a",ids:["sales"]},{label:"PEOPLE",color:"#8a5e7a",ids:["people"]}],d=(0,i.createContext)({pack:null,loading:!0,refresh:async()=>{}});function c(e){let{children:t}=e,[n,o]=(0,i.useState)(null),[l,r]=(0,i.useState)(!0),s=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/pack");if(!e.ok)throw Error("pack ".concat(e.status));let t=await e.json();o(t)}catch(e){o(null)}finally{r(!1)}},[]);return(0,i.useEffect)(()=>{let e=!1;return(async()=>{let t=new AbortController,n=setTimeout(()=>t.abort(),3e3);try{await fetch("/api/leedab/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"revalidate"}),signal:t.signal})}catch(e){}finally{clearTimeout(n)}e||await s()})(),()=>{e=!0}},[s]),(0,a.jsx)(d.Provider,{value:{pack:n,loading:l,refresh:s},children:t})}function p(){return(0,i.useContext)(d)}let u="var(--paper)",h="var(--paper-2)",m="var(--paper-3)",g="var(--hair)",x="var(--hair-2)",f="#c95c0a",y="#c95c0a33",v="#c95c0a",b='"JetBrains Mono", ui-monospace, monospace',j='"Inter", system-ui, sans-serif',S='"Fraunces", Georgia, serif',k={coo:"COO",concierge:"CON",marketing:"MKT",content:"CNT",video:"VDO",campaigns:"CMP",email:"EML",brand:"BR",sales:"SLS",product:"PRD",engineering:"ENG",frontend:"FE",backend:"BE",devops:"DVP",automation:"N8N",strategy:"STR",research:"RES",people:"PPL",ops:"OPS",procurement:"PRC",finance:"CFN",investor:"INV",data:"DAT",cx:"CXS",legal:"LGL",compliance:"RSK"},w={coo:"\xa7 00",concierge:"\xa7 01",marketing:"\xa7 10",content:"\xa7 11",video:"\xa7 12",campaigns:"\xa7 13",email:"\xa7 14",brand:"\xa7 15",sales:"\xa7 20",product:"\xa7 30",engineering:"\xa7 40",frontend:"\xa7 41",backend:"\xa7 42",devops:"\xa7 43",automation:"\xa7 45",strategy:"\xa7 50",research:"\xa7 51",people:"\xa7 55",ops:"\xa7 60",procurement:"\xa7 61",finance:"\xa7 70",investor:"\xa7 71",data:"\xa7 72",cx:"\xa7 80",legal:"\xa7 90",compliance:"\xa7 91"},T={coo:"active",concierge:"active",marketing:"active",content:"active",video:"idle",campaigns:"active",email:"active",brand:"active",sales:"active",product:"active",engineering:"active",frontend:"active",backend:"idle",devops:"idle",automation:"active",strategy:"active",research:"active",people:"active",ops:"active",procurement:"active",finance:"idle",investor:"idle",data:"active",cx:"active",legal:"idle",compliance:"active"},F={coo:["Drafted weekly ops brief","Flagged 2 cross-team blockers"],concierge:["Daily brief sent 07:00","Booked Sydney→Melbourne flights"],marketing:["Drafted 3 email sequences","Updated ICP scoring"],content:["Published 2 SEO blog posts","Drafted newsletter #8"],video:["Scripted demo walkthrough","LinkedIn video brief"],campaigns:["Launched Google Search test","A/B test plan for headlines"],email:["Wrote 5-email welcome sequence","Cold outreach drafted for 3 segments"],brand:["Audited investor deck v3","Drafted social card spec"],sales:["3 outreach sequences ready","Demo script v2 done"],product:["Summarised 47 user tickets","Updated roadmap priorities"],engineering:["Reviewed 4 PRs","Provider abstraction ADR"],frontend:["Shipped agent belt redesign","Accessibility audit pass"],backend:["Built SSE streaming endpoint","Added Zod validation layer"],devops:["Set up CI pipeline","Deploy runbook written"],automation:["Built 3 n8n workflows","Lead capture → Sheets live"],strategy:["Scanned 12 competitor updates","TAM model draft"],research:["Prospect brief: Acme Logistics","Vendor eval: EU payroll tools"],people:["Drafted senior BE engineer JD","Q2 review template ready"],ops:["Drafted 2 job posts","Payroll files sent"],procurement:["Negotiated SYD→MEL rate","Coles deduction dispute drafted"],finance:["Runway model updated","Q2 budget vs actuals"],investor:["Board memo draft ready","KPI tracker updated"],data:["D7/D30 retention model","Funnel drop-off analysis"],cx:["Onboarding playbook v1","Health score framework"],legal:["Reviewed customer MSA","Privacy policy gap analysis"],compliance:["SOC 2 gap analysis v1","Risk register Q2 review"]},C={coo:["Draft today's ops brief — what's moving, what's blocked, what needs founder input.","We're launching a new campaign next week. Build a cross-team plan for Marketing, Product, and Engineering.","Which team is most bottlenecked right now and what should we do about it?"],marketing:["Write a LinkedIn post about why local-first AI beats cloud for SMBs.","Draft 3 subject line variants for a cold outreach email to logistics companies.","Write a one-paragraph product description for our website hero section."],content:["Write a 1000-word SEO post targeting 'how to automate payroll deductions without APIs'.","Draft newsletter #8 — main story: our new computer-use workflow. Two short items.","Write a case study for a 12-truck logistics fleet that cut payroll time by 80%."],video:["Write a 90-second LinkedIn video script: the problem with manual ops reconciliation.","Storyboard a 4-minute YouTube demo: LeedAB automating a driver hours workflow.","Write a talking-head outline for the founder: 'why we built LeedAB locally-first'."],campaigns:["Design a Google Search campaign targeting SMB ops managers. ICP, ad groups, copy variants.","Write an A/B test plan for our LinkedIn headline: pain-first vs outcome-first.","Build a UTM taxonomy for Q2. Channels: Google, LinkedIn, newsletter, referral."],email:["Write a 5-email welcome sequence for a new SMB customer who just signed up to LeedAB.","Write a cold outreach sequence targeting ops managers at 10-50 person logistics companies.","Build a re-engagement sequence for customers who haven't logged in for 30 days."],automation:["Build me a workflow: when a new lead fills out our contact form, add them to Google Sheets and send a Slack notification.","Create a daily 9am workflow that fetches our top metrics and sends a summary email.","List all my active n8n workflows and show me which ones have run in the last 24 hours."],product:["Draft a feature spec for voice message tasks via WhatsApp.","Write user stories for the onboarding flow for a new SMB customer.","Create acceptance criteria for computer-use task execution."],engineering:["Write an ADR for the provider abstraction layer (Anthropic / OpenAI / local).","Review the streaming architecture and suggest reliability improvements.","Design the data model for multi-tenant task queues."],frontend:["Write a component spec for the AgentCard — props, variants, hover/selected states.","Review our current Tailwind setup and flag performance or accessibility issues.","Design the empty state for a new agent with no messages yet."],backend:["Design the API for multi-agent broadcast: one prompt → all 18 agents in parallel.","Write a Zod schema for the /api/chat request body with full validation.","ADR: when should we migrate from SQLite to Postgres? What's the trigger?"],devops:["Write a GitHub Actions CI pipeline: typecheck → lint → test → build → deploy.","Write a runbook for: deploy failed on Railway, dashboard is down, it's 2am.","Design the Docker build for the Next.js dashboard — multi-stage, minimal image."],strategy:["Build a one-page competitive battlecard: LeedAB vs Zapier.","What's our ideal ICP and why? Give me a crisp two-paragraph answer.","Suggest three pricing tiers with rationale for each."],sales:["Write a 3-email cold outreach sequence for ops managers at 10–50 person logistics SMBs.","Write a demo script: one workflow, 6 minutes, maximum impact.","Build an objection handling guide for 'we already use Zapier'."],finance:["Build a runway model: $180k cash, $22k monthly burn. Three scenarios.","Calculate CAC and LTV: $8k/month spend, 4 new customers, $400 ACV, 24-month lifetime.","Write a budget vs actuals template for a 6-category monthly review."],"customer success":["Write an onboarding playbook for a new SMB customer — Day 1, Week 1, Month 1.","Design a customer health score framework for our ICP (5–50 person logistics SMB).","Write a QBR deck template for a quarterly review with a mid-tier customer."],investor:["Draft the April investor update. Wins: 30 customers. Ask: senior Node engineer hire.","Write a two-sentence answer to 'What makes LeedAB defensible?'","Summarise our traction story for a seed-stage VC intro email."],operations:["Write a job post for a senior Node.js engineer, AU remote, $160-200k + equity.","Draft a partnership outreach email to a WhatsApp Business API reseller.","Write an internal onboarding doc for a new founding team member."],legal:["Review our standard customer MSA — flag any clauses that expose us given our local-first data model.","Draft a privacy policy for a local-first AI agent that stores all data on the customer's machine.","What should we have in order before a seed raise? Give me a legal due diligence checklist."],data:["Design a retention dashboard for a local-first SMB tool. What D1/D7/D30 metrics matter most?","We have 30 customers. Build a cohort analysis framework to identify which segments stick longest.","Map our full activation funnel from install → first workflow live. What are the drop-off points?"],concierge:["Send my morning brief — schedule, top priority, one decision to make today.","I'm flying Sydney → Melbourne next Tuesday for a 2pm meeting. Build the trip itinerary.","Categorise my last 30 days of expenses and flag anything unusual."],brand:["Audit slide 4 of our investor deck — three things to fix, one to keep.","Write an asset brief for a launch banner: 1200\xd7630, ICP = logistics SMB, tone confident-direct.","Review our marketing site visuals and flag anything off-brand."],research:["Build a prospect brief on Acme Logistics — recent moves, tech stack signals, decision-makers.","Compare 3 competitor agentic ops platforms across deployment, voice channels, computer-use, pricing.","Size the AU SMB logistics ops automation market — TAM/SAM/SOM with sources."],people:["Write a job description for a senior backend engineer, Sydney remote, $160-200k + 0.25-0.75% equity.","Build an onboarding plan for a new ops hire starting Monday — day 1, week 1, month 1.","Draft a Q2 performance review template — quarterly cadence, 15-min written + 15-min call."],procurement:["Compare these 3 freight quotes for SYD→MEL 32 pallets and recommend one.","Build a supplier scorecard for our top carrier this quarter — on-time, defects, response time, pricing.","Coles deducted $2,400 against PO 8821. Draft the dispute response with evidence."],compliance:["Run a SOC 2 Type 1 gap analysis for us — top 5 gaps blocking certification today.","Build a risk register starter — 8-10 likely operational risks for a 12-person SaaS.","Draft an Acceptable Use Policy in plain English — one page, examples on every rule."]};function B(e){let{toasts:t,onDismiss:n}=e;return 0===t.length?null:(0,a.jsx)("div",{style:{position:"fixed",bottom:24,right:24,zIndex:2e3,display:"flex",flexDirection:"column",gap:8},children:t.map(e=>{let t="error"===e.type?{bg:"#fef2f2",border:"#fca5a5",icon:"⚠",fg:"#1a1713"}:"success"===e.type?{bg:"#f0fdf4",border:"#86efac",icon:"✓",fg:"#1a1713"}:{bg:"var(--paper-2)",border:"var(--hair)",icon:"ⓘ",fg:"var(--ink)"};return(0,a.jsxs)("div",{className:"animate-fade-up",style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",borderRadius:4,background:t.bg,border:"1px solid ".concat(t.border),boxShadow:"0 4px 16px rgba(26,23,19,0.1)",fontFamily:'"Inter", sans-serif',fontSize:13,color:t.fg,maxWidth:420},children:[(0,a.jsx)("span",{style:{fontSize:14,flexShrink:0},children:t.icon}),(0,a.jsx)("span",{style:{flex:1},children:e.message}),e.action&&(0,a.jsx)("button",{onClick:()=>{e.action.onClick(),n(e.id)},style:{background:"none",border:"none",cursor:"pointer",color:f,fontFamily:'"JetBrains Mono", monospace',fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",padding:"2px 6px",flexShrink:0},children:e.action.label}),(0,a.jsx)("button",{onClick:()=>n(e.id),style:{background:"none",border:"none",cursor:"pointer",color:"var(--ink-5)",fontSize:16,lineHeight:1,padding:0,flexShrink:0},children:"\xd7"})]},e.id)})})}function M(e){let{onClose:t}=e;return(0,a.jsx)("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1100,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"animate-palette-drop",style:{width:520,maxHeight:"80vh",background:"var(--paper-3)",border:"1px solid ".concat(g),borderRadius:6,overflow:"hidden",display:"flex",flexDirection:"column",boxShadow:"0 24px 80px rgba(0,0,0,0.6)"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid ".concat(g)},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:b,fontSize:9,color:f,letterSpacing:"0.16em"},children:"SHORTCUTS"}),(0,a.jsx)("div",{style:{fontFamily:S,fontSize:22,fontWeight:500,color:"var(--ink)",letterSpacing:"-0.01em"},children:"Keyboard reference."})]}),(0,a.jsx)("button",{onClick:t,style:{background:"none",border:"none",color:"var(--ink-5)",cursor:"pointer",fontSize:20,lineHeight:1},children:"\xd7"})]}),(0,a.jsx)("div",{style:{overflowY:"auto",padding:"16px 18px"},children:[{title:"Navigation",rows:[{keys:["⌘","L"],label:"Open command palette / search"},{keys:["?"],label:"Show this keyboard shortcuts panel"},{keys:["Esc"],label:"Close any open overlay / drawer"}]},{title:"Chat",rows:[{keys:["/"],label:"Focus the message input"},{keys:["b"],label:"Toggle broadcast mode"},{keys:["Enter"],label:"Send the message"},{keys:["Shift","Enter"],label:"New line in the message"}]},{title:"Files",rows:[{keys:["Drop"],label:"Drop files anywhere on the input to attach"},{keys:["⌘","V"],label:"Paste an image to attach inline"}]}].map(e=>(0,a.jsxs)("div",{style:{marginBottom:18},children:[(0,a.jsx)("div",{style:{fontFamily:b,fontSize:9,color:"var(--ink-5)",letterSpacing:"0.14em",marginBottom:8},children:e.title.toUpperCase()}),e.rows.map((t,n)=>(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:n===e.rows.length-1?"none":"1px solid ".concat(x)},children:[(0,a.jsx)("div",{style:{display:"flex",gap:4},children:t.keys.map((e,t)=>(0,a.jsx)("kbd",{style:{fontFamily:b,fontSize:10,padding:"2px 6px",background:"var(--paper-2)",border:"1px solid ".concat(g),borderRadius:3,color:"var(--ink-2)",minWidth:18,textAlign:"center"},children:e},t))}),(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink-3)"},children:t.label})]},n))]},e.title))})]})})}function R(e){let{draft:t,agentName:n,onCancel:o,onSave:l}=e,[r,s]=(0,i.useState)(t.name),[d,c]=(0,i.useState)(t.description),[p,u]=(0,i.useState)(t.promptTemplate),[h,m]=(0,i.useState)(!1),x=r.trim().length>0&&p.trim().length>0&&!h;return(0,a.jsx)("div",{onClick:o,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1100,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"animate-palette-drop",style:{width:600,maxWidth:"92vw",maxHeight:"85vh",background:"var(--paper-3)",border:"1px solid ".concat(g),borderRadius:6,overflow:"hidden",display:"flex",flexDirection:"column",boxShadow:"0 24px 80px rgba(0,0,0,0.6)"},children:[(0,a.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid ".concat(g)},children:[(0,a.jsx)("div",{style:{fontFamily:b,fontSize:9,color:f,letterSpacing:"0.16em",marginBottom:4},children:"SAVE AS WORKFLOW"}),(0,a.jsx)("div",{style:{fontFamily:S,fontSize:22,fontWeight:500,color:"var(--ink)",letterSpacing:"-0.01em"},children:"Promote this chat into a reusable template."}),(0,a.jsxs)("div",{style:{fontSize:12,color:"var(--ink-4)",marginTop:4,fontFamily:j},children:["Lives in the ",n," agent's templates. You can edit inputs and prompt later from the Templates view."]})]}),(0,a.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"18px 20px",display:"flex",flexDirection:"column",gap:14},children:[(0,a.jsx)(z,{label:"Name",children:(0,a.jsx)("input",{value:r,onChange:e=>s(e.target.value),autoFocus:!0,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&x&&(e.preventDefault(),y())},style:E})}),(0,a.jsx)(z,{label:"Description",children:(0,a.jsx)("input",{value:d,onChange:e=>c(e.target.value),style:E})}),(0,a.jsx)(z,{label:"Prompt template",children:(0,a.jsx)("textarea",{value:p,onChange:e=>u(e.target.value),rows:8,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&x&&(e.preventDefault(),y())},style:{...E,resize:"vertical",minHeight:140,fontFamily:j,fontSize:13,lineHeight:1.55}})}),(0,a.jsxs)("div",{style:{fontSize:11,color:"var(--ink-5)",fontFamily:b,letterSpacing:"0.08em"},children:["Tip: wrap variables with ",(0,a.jsx)("span",{style:{color:f},children:"{name}"})," to make them template inputs later."]})]}),(0,a.jsxs)("div",{style:{padding:"12px 20px",borderTop:"1px solid ".concat(g),display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,a.jsx)("button",{onClick:o,style:{padding:"6px 14px",border:"1px solid ".concat(g),background:"transparent",color:"var(--ink-4)",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:"pointer",textTransform:"uppercase"},children:"Cancel"}),(0,a.jsx)("button",{onClick:y,disabled:!x,style:{padding:"6px 14px",border:"1px solid ".concat(f),background:x?f:"var(--paper-2)",color:x?"#000":"var(--ink-6)",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:x?"pointer":"not-allowed",textTransform:"uppercase"},children:h?"Saving…":"Save \xb7 ⌘↵"})]})]})});async function y(){if(x){m(!0);try{await l({name:r.trim(),description:d.trim(),promptTemplate:p})}finally{m(!1)}}}}let E={width:"100%",padding:"9px 12px",background:"var(--paper-2)",border:"1px solid ".concat(g),borderRadius:3,color:"var(--ink)",fontFamily:j,fontSize:13,outline:"none"};function z(e){let{label:t,children:n}=e;return(0,a.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,a.jsx)("span",{style:{fontFamily:b,fontSize:9,color:"var(--ink-5)",letterSpacing:"0.14em",textTransform:"uppercase"},children:t}),n]})}function I(e){let{onClose:t,onLoadDemo:n}=e,{refresh:o}=p(),[l,r]=(0,i.useState)(0),[s,d]=(0,i.useState)(""),[c,u]=(0,i.useState)({}),[h,m]=(0,i.useState)([]),[y,v]=(0,i.useState)([]),[k,w]=(0,i.useState)(""),T=async()=>{let e=s.trim();if(!e)return!1;u({loading:!0});try{let n=await fetch("/api/leedab/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set-key",key:e})}),a=await n.json();if(!n.ok){var t;return u({error:null!=(t=a.error)?t:"Invalid key"}),!1}return u({tier:a.tier,orgName:a.orgName}),await o(),!0}catch(e){return u({error:"Could not reach licensing service"}),!1}};(0,i.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/leedab/license");if(!t.ok)return;let n=await t.json();if(e)return;n.valid&&n.tier&&(u({tier:n.tier,orgName:n.orgName}),r(1))}catch(e){}})(),()=>{e=!0}},[]);let F=(e,t,n)=>t(e.includes(n)?e.filter(e=>e!==n):[...e,n]),C=async()=>{let e="Just me"===k?50:"2–5"===k?200:"6–20"===k?400:"20+"===k?800:void 0;try{if(await fetch("/api/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({channels:h,workflows:y,teamSize:k,monthlyBudgetUsd:e})}),e)try{localStorage.setItem("leedab-budget",String(e))}catch(e){}}catch(e){}};return(0,a.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1200,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:(0,a.jsxs)("div",{className:"animate-palette-drop",style:{width:600,maxWidth:"92vw",maxHeight:"86vh",background:"var(--paper-3)",border:"1px solid ".concat(g),borderRadius:6,overflow:"hidden",display:"flex",flexDirection:"column",boxShadow:"0 24px 80px rgba(0,0,0,0.6)"},children:[(0,a.jsxs)("div",{style:{padding:"18px 22px",borderBottom:"1px solid ".concat(g)},children:[(0,a.jsx)("div",{style:{fontFamily:b,fontSize:9,color:f,letterSpacing:"0.16em",marginBottom:4},children:"WELCOME TO LEEDAB"}),(0,a.jsxs)("div",{style:{fontFamily:S,fontSize:26,fontWeight:500,color:"var(--ink)",letterSpacing:"-0.01em"},children:[0===l&&"Got a license key?",1===l&&"Three quick questions, then you're in.",2===l&&"Where do messages come from?",3===l&&"What should agents handle?",4===l&&"How many of you?"]})]}),(0,a.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"20px 22px"},children:[0===l&&(0,a.jsxs)("div",{style:{fontSize:13,color:"var(--ink-3)",lineHeight:1.6,fontFamily:j},children:[(0,a.jsxs)("p",{style:{marginBottom:14},children:["Paste your LeedAB license key to unlock your agent roster."," ","Don't have one yet? ",(0,a.jsx)("a",{href:"https://leedab.com/contact",target:"_blank",rel:"noopener noreferrer",style:{color:f,textDecoration:"underline"},children:"Request access"}),"."]}),(0,a.jsx)("input",{type:"text",value:s,onChange:e=>{d(e.target.value),u({})},placeholder:"am_live_...",spellCheck:!1,autoFocus:!0,style:{width:"100%",padding:"10px 12px",background:"var(--paper-2)",border:"1px solid ".concat(g),color:"var(--ink)",fontFamily:b,fontSize:13,borderRadius:3,outline:"none",letterSpacing:"0.04em"}}),c.error&&(0,a.jsx)("div",{style:{marginTop:10,fontSize:12,color:"#a52a1a",fontFamily:j},children:c.error}),c.tier&&(0,a.jsxs)("div",{style:{marginTop:10,fontSize:12,color:f,fontFamily:j},children:["✓ Unlocked ",(0,a.jsx)("strong",{children:c.tier}),c.orgName?" for ".concat(c.orgName):"","."]})]}),1===l&&(0,a.jsxs)("div",{style:{fontSize:13,color:"var(--ink-3)",lineHeight:1.6,fontFamily:j},children:[(0,a.jsx)("p",{children:"LeedAB connects messaging channels (Telegram, WhatsApp, email) to a team of specialised AI agents. Inbound messages route to the right agent; the agent drafts replies; you approve and ship."}),(0,a.jsx)("p",{children:"This wizard sets up sensible defaults so you can see the system working in 60 seconds. You can change everything later in the Roster and Templates views."})]}),2===l&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:12,color:"var(--ink-4)",marginBottom:12,fontFamily:j},children:"Pick the channels your team uses today."}),(0,a.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["Telegram","WhatsApp","Email","Slack"].map(e=>{let t=h.includes(e);return(0,a.jsx)("button",{onClick:()=>F(h,m,e),style:{padding:"8px 14px",background:t?"".concat(f,"1a"):"var(--paper-2)",border:"1px solid ".concat(t?f:g),color:t?f:"var(--ink-3)",borderRadius:3,cursor:"pointer",fontFamily:b,fontSize:11,letterSpacing:"0.06em"},children:e},e)})})]}),3===l&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:12,color:"var(--ink-4)",marginBottom:12,fontFamily:j},children:"Pick the work you want agents to do. We'll surface relevant templates next."}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:["Customer support replies","Logistics dispatch & ETA updates","Cold sales outreach","Finance reconciliation","Internal ops briefings","Hiring / recruiting"].map(e=>{let t=y.includes(e);return(0,a.jsxs)("button",{onClick:()=>F(y,v,e),style:{padding:"10px 14px",textAlign:"left",background:t?"".concat(f,"10"):"var(--paper-2)",border:"1px solid ".concat(t?f:g),color:t?f:"var(--ink-3)",borderRadius:3,cursor:"pointer",fontFamily:j,fontSize:13,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,a.jsx)("span",{children:e}),t&&(0,a.jsx)("span",{style:{color:f,fontFamily:b,fontSize:12},children:"✓"})]},e)})})]}),4===l&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:12,color:"var(--ink-4)",marginBottom:12,fontFamily:j},children:"Roughly how many people are on the operations team?"}),(0,a.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["Just me","2–5","6–20","20+"].map(e=>{let t=k===e;return(0,a.jsx)("button",{onClick:()=>w(e),style:{padding:"8px 14px",background:t?"".concat(f,"1a"):"var(--paper-2)",border:"1px solid ".concat(t?f:g),color:t?f:"var(--ink-3)",borderRadius:3,cursor:"pointer",fontFamily:b,fontSize:11,letterSpacing:"0.06em"},children:e},e)})}),(0,a.jsx)("div",{style:{marginTop:22,padding:14,background:"var(--paper-2)",border:"1px solid ".concat(x),borderRadius:3,fontSize:12,color:"var(--ink-3)",fontFamily:j,lineHeight:1.55},children:"Want to see the dashboard with realistic logistics activity right now? We'll seed sample inbound messages, pending approvals, and runs. You can clear it anytime from the DEMO toggle."})]})]}),(0,a.jsxs)("div",{style:{padding:"14px 22px",borderTop:"1px solid ".concat(g),display:"flex",gap:8,alignItems:"center"},children:[(0,a.jsxs)("span",{style:{fontFamily:b,fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em"},children:["STEP ",l+1," OF 5"]}),(0,a.jsxs)("div",{style:{marginLeft:"auto",display:"flex",gap:8},children:[l>0&&(0,a.jsx)("button",{onClick:()=>r(e=>Math.max(e-1,0)),style:{padding:"6px 12px",border:"1px solid ".concat(g),background:"transparent",color:"var(--ink-4)",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:"pointer",textTransform:"uppercase"},children:"Back"}),l>0&&(0,a.jsx)("button",{onClick:t,style:{padding:"6px 12px",border:"1px solid ".concat(g),background:"transparent",color:"var(--ink-5)",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:"pointer",textTransform:"uppercase"},children:"Skip"}),l<4?(0,a.jsx)("button",{onClick:async()=>{if(0===l&&!c.tier)return void await T();r(e=>Math.min(e+1,4))},disabled:c.loading||0===l&&!c.tier&&!s.trim(),style:{padding:"6px 14px",border:"1px solid ".concat(f),background:f,color:"#000",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:c.loading?"wait":"pointer",textTransform:"uppercase",opacity:!c.loading&&(0!==l||c.tier||s.trim())?1:.4},children:0!==l||c.tier?"Next →":"Validate →"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:async()=>{await C(),await n(),t()},style:{padding:"6px 14px",border:"1px solid ".concat(f),background:f,color:"#000",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:"pointer",textTransform:"uppercase"},children:"Load demo data →"}),(0,a.jsx)("button",{onClick:async()=>{await C(),t()},style:{padding:"6px 14px",border:"1px solid ".concat(g),background:"transparent",color:"var(--ink-3)",borderRadius:3,fontFamily:b,fontSize:11,letterSpacing:"0.08em",cursor:"pointer",textTransform:"uppercase"},children:"I'll set up later"})]})]})]})]})})}function A(e){let{notifs:t,onMarkAllRead:n,onClose:i}=e,o={success:f,warn:"#f59e0b",info:"#6366f1"};return(0,a.jsxs)("div",{className:"animate-slide-left no-scrollbar",style:{position:"fixed",top:0,right:0,bottom:0,width:320,background:"var(--paper-input)",borderLeft:"1px solid ".concat(g),zIndex:500,display:"flex",flexDirection:"column",overflowY:"auto"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid ".concat(g),flexShrink:0},children:[(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:12,fontWeight:700,color:"var(--ink)",letterSpacing:"0.04em"},children:"FEED"}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,a.jsx)("button",{onClick:n,style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-5)",background:"none",border:"none",cursor:"pointer",letterSpacing:"0.08em"},children:"MARK ALL READ"}),(0,a.jsx)("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",color:"var(--ink-5)",fontSize:18,lineHeight:1,padding:4},children:"\xd7"})]})]}),(0,a.jsxs)("div",{style:{flex:1,padding:"8px 0"},children:[0===t.length&&(0,a.jsx)("div",{style:{padding:"32px 20px",textAlign:"center",fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"var(--ink-6)",letterSpacing:"0.08em"},children:"All quiet. Activity from your channels and approvals will land here."}),t.map(e=>(0,a.jsx)("div",{style:{padding:"12px 20px",borderBottom:"1px solid ".concat(x),background:e.read?"transparent":"var(--paper-3)",opacity:e.read?.6:1,transition:"opacity 0.2s"},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:o[e.level],flexShrink:0,marginTop:4}}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:o[e.level],letterSpacing:"0.08em"},children:k[e.agent]}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)"},children:e.ts})]}),(0,a.jsx)("div",{style:{fontSize:12,color:e.read?"var(--ink-5)":"var(--ink-2)",fontFamily:'"Inter", sans-serif',lineHeight:1.5},children:e.msg})]})]})},e.id))]})]})}let D=[{id:"o1",name:"runway-model-apr-2026.csv",agent:"finance",type:"model",date:"Apr 22",size:"4.2 KB"},{id:"o2",name:"linkedin-post-local-first.txt",agent:"marketing",type:"draft",date:"Apr 19",size:"1.8 KB"},{id:"o3",name:"adr-0001-provider-abstraction.md",agent:"engineering",type:"spec",date:"Apr 18",size:"3.1 KB"},{id:"o4",name:"onboarding-playbook-template.html",agent:"cx",type:"template",date:"Apr 17",size:"5.6 KB"},{id:"o5",name:"retention-cohort-model-2026-04-22.csv",agent:"data",type:"report",date:"Apr 22",size:"7.3 KB"},{id:"o6",name:"cold-sequence-logistics-smbs.txt",agent:"sales",type:"draft",date:"Apr 20",size:"2.4 KB"},{id:"o7",name:"privacy-policy-draft.html",agent:"legal",type:"draft",date:"Apr 22",size:"8.1 KB"},{id:"o8",name:"seed-due-diligence-checklist.md",agent:"legal",type:"template",date:"Apr 22",size:"3.7 KB"},{id:"o9",name:"unit-economics-q2-2026.csv",agent:"finance",type:"model",date:"Apr 21",size:"5.2 KB"},{id:"o10",name:"competitor-battlecard-zapier.html",agent:"strategy",type:"report",date:"Apr 20",size:"4.8 KB"},{id:"o11",name:"blog-post-why-apis-failed-smbs.html",agent:"content",type:"draft",date:"Apr 19",size:"6.2 KB"},{id:"o12",name:"tracking-plan-v1.md",agent:"data",type:"spec",date:"Apr 22",size:"4.5 KB"}];function W(e){var t;let{agent:n,agentId:i,conversations:o,onClose:l}=e,r=null!=(t=o[i])?t:[],s=D.filter(e=>e.agent===i).slice(0,4);return(0,a.jsxs)("div",{className:"animate-slide-left no-scrollbar",style:{position:"fixed",top:0,right:0,bottom:0,width:300,background:"var(--paper-input)",borderLeft:"1px solid ".concat(g),zIndex:500,display:"flex",flexDirection:"column",overflowY:"auto"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid ".concat(g),flexShrink:0},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:f,letterSpacing:"0.1em",marginBottom:2},children:w[i]}),(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:14,fontWeight:700,color:"var(--ink)"},children:k[i]})]}),(0,a.jsx)("button",{onClick:l,style:{background:"none",border:"none",cursor:"pointer",color:"var(--ink-5)",fontSize:18,lineHeight:1,padding:4},children:"\xd7"})]}),(0,a.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid ".concat(x)},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginBottom:8},children:"AGENT"}),(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink-3)",fontFamily:'"Inter", sans-serif',lineHeight:1.6},children:n.description})]}),(0,a.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid ".concat(x)},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginBottom:8},children:"STATUS"}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"active"===T[i]?f:"var(--ink-5)",boxShadow:"active"===T[i]?"0 0 8px ".concat(f):"none",display:"inline-block"}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"active"===T[i]?f:"var(--ink-5)"},children:T[i].toUpperCase()})]}),(0,a.jsxs)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"var(--ink-6)"},children:[r.length," messages \xb7 ",r.filter(e=>"user"===e.role).length," exchanges"]})]}),(0,a.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid ".concat(x)},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginBottom:8},children:"DEFAULT MODEL"}),(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:11,color:"var(--ink-4)"},children:n.defaultModel.replace("claude-","").replace("-20251001","").toUpperCase()})]}),s.length>0&&(0,a.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid ".concat(x)},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginBottom:8},children:"RECENT OUTPUTS"}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:s.map(e=>(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",background:h,borderRadius:3,border:"1px solid ".concat(x)},children:[(0,a.jsx)("span",{style:{fontSize:11,color:"var(--ink-4)",fontFamily:'"Inter", sans-serif',overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:e.name}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",marginLeft:8,flexShrink:0},children:e.date})]},e.id))})]}),(0,a.jsxs)("div",{style:{padding:"16px 20px"},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginBottom:8},children:"RECENT TASKS"}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:F[i].map((e,t)=>(0,a.jsxs)("div",{style:{fontSize:11,color:"var(--ink-5)",fontFamily:'"Inter", sans-serif'},children:["→ ",e]},t))})]})]})}function O(e){var t,n;let{onChannelClick:o}=e,[l,r]=(0,i.useState)(null),[s,d]=(0,i.useState)(!0);(0,i.useEffect)(()=>{let e=!1;function t(){fetch("/api/openclaw/status").then(e=>e.json()).then(t=>{e||(r(t),d(!1))}).catch(()=>{e||d(!1)})}t();let n=setInterval(t,15e3);return()=>{e=!0,clearInterval(n)}},[]);let c=null!=(t=null==l?void 0:l.ok)&&t,p=(null!=(n=null==l?void 0:l.channels)?n:[]).filter(e=>e.enabled);return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:0,padding:"0 28px",height:32,borderBottom:"1px solid ".concat(x),background:m,flexShrink:0,overflowX:"auto"},children:[(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginRight:16,whiteSpace:"nowrap"},children:"CHANNELS"}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"0 12px",borderLeft:"1px solid ".concat(x),borderRight:"1px solid ".concat(x),height:"100%"},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:s?"var(--hair)":c?f:"#a52a1a",boxShadow:c?"0 0 6px ".concat(f,"88"):"none",display:"inline-block",flexShrink:0}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:c?"var(--ink-4)":"#a52a1a",letterSpacing:"0.08em",whiteSpace:"nowrap"},children:s?"...":c?"LIVE":"OFFLINE"})]}),p.map(e=>{let t=!0===e.connected,n=!c,i="#a52a1a",l=c&&t?f:"transparent",r=n?"1px solid var(--hair)":t?"1px solid ".concat(f):"1px solid ".concat(i),s=c&&t?"0 0 6px ".concat(f,"88"):"none",d=c&&t?"var(--ink-4)":n?"var(--ink-6)":i;return(0,a.jsxs)(o?"button":"div",{onClick:o?()=>o(e.name):void 0,title:o?"Manage ".concat(e.name).concat(c&&!t?" — not connected":""):void 0,style:{display:"flex",alignItems:"center",gap:6,padding:"0 12px",borderTop:"none",borderBottom:"none",borderLeft:"none",borderRight:"1px solid ".concat(x),height:"100%",background:"transparent",color:"inherit",cursor:o?"pointer":"default",fontFamily:"inherit"},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:l,border:r,boxSizing:"border-box",boxShadow:s,display:"inline-block",flexShrink:0}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:d,letterSpacing:"0.08em",whiteSpace:"nowrap",textTransform:"uppercase",opacity:c&&!t?.85:1},children:e.name})]},e.name)}),(0,a.jsxs)("div",{style:{marginLeft:"auto",fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.1em",whiteSpace:"nowrap"},children:[p.length," CHANNEL",1===p.length?"":"S"]})]})}function L(e){var t,n;let{query:o,onQueryChange:s,inputRef:d,conversations:c,onSelectAgent:u,onSelectView:h,onClose:m}=e,[y,v]=(0,i.useState)(0),[j,S]=(0,i.useState)([]),[F,C]=(0,i.useState)([]),[B,M]=(0,i.useState)([]);(0,i.useEffect)(()=>{let e=!1;return async function(){try{var t,n,a;let[i,o,l]=await Promise.all([fetch("/api/inbox?limit=200").then(e=>e.ok?e.json():{messages:[]}),fetch("/api/approvals?limit=200").then(e=>e.ok?e.json():{approvals:[]}),fetch("/api/runs?limit=100").then(e=>e.ok?e.json():{runs:[]})]);if(e)return;S(null!=(t=i.messages)?t:[]),C(null!=(n=o.approvals)?n:[]),M(null!=(a=l.runs)?a:[])}catch(e){}}(),()=>{e=!0}},[]);let R=o.toLowerCase().trim(),E=e=>!R||(null!=e?e:"").toLowerCase().includes(R),{pack:z}=p(),I=null!=(t=null==z?void 0:z.agentOrder)?t:r,A=null!=(n=null==z?void 0:z.agents)?n:l,D=I.filter(e=>{let t=A[e];return E(k[e])||E(null==t?void 0:t.name)||E(null==t?void 0:t.tagline)}),W=[{label:"Workflows",sub:"Pre-built workflows",view:"workflows"}].filter(e=>{let{label:t,sub:n}=e;return E(t)||E(n)}),O=R?j.filter(e=>E(e.fromName)||E(e.text)||E(e.channel)).slice(0,8):[],L=R?F.filter(e=>E(e.title)||E(e.body)||E(e.agentId)||E(e.meta.to)).slice(0,8):[],N=R?B.filter(e=>E(e.agentId)||E(e.triggerType)||E(e.status)).slice(0,8):[],P=W.length+D.length+O.length+L.length+N.length;(0,i.useEffect)(()=>{v(0)},[o]);let J={views:0,agents:W.length,inbox:W.length+D.length,approvals:W.length+D.length+O.length,runs:W.length+D.length+O.length+L.length},H=e=>{try{let t=new URL(window.location.href);t.searchParams.set("id",e),window.history.replaceState({},"",t.toString())}catch(e){}},U=e=>{if(e<J.agents)return void h(W[e].view);if(e<J.inbox)return void u(D[e-J.agents]);if(e<J.approvals){let t=O[e-J.inbox];t&&H(t.id),h("inbox");return}if(e<J.runs){let t=L[e-J.approvals];t&&H(t.id),h("approvals");return}let t=N[e-J.runs];t&&H(t.id),h("runs")};return(0,a.jsx)("div",{onClick:m,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1e3,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh",backdropFilter:"blur(4px)"},children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"animate-palette-drop",style:{width:580,maxHeight:"60vh",background:"var(--paper-3)",border:"1px solid #404040",borderRadius:6,overflow:"hidden",display:"flex",flexDirection:"column",boxShadow:"0 24px 80px rgba(0,0,0,0.8)"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"14px 16px",borderBottom:"1px solid ".concat(g)},children:[(0,a.jsx)("span",{style:{color:"var(--ink-5)",fontSize:14},children:"⌕"}),(0,a.jsx)("input",{ref:d,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),v(e=>Math.min(e+1,P-1))),"ArrowUp"===e.key&&(e.preventDefault(),v(e=>Math.max(e-1,0))),"Enter"===e.key&&U(y)},placeholder:"Search agents, views, actions…",style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:14,color:"var(--ink)",fontFamily:'"Inter", sans-serif'}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",border:"1px solid ".concat(g),borderRadius:2,padding:"2px 5px"},children:"ESC"})]}),(0,a.jsxs)("div",{className:"no-scrollbar",style:{overflowY:"auto"},children:[W.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{padding:"8px 16px 4px",fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em"},children:"VIEWS"}),W.map((e,t)=>{let{label:n,sub:i,view:o}=e;return(0,a.jsxs)("div",{onClick:()=>h(o),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",background:y===t?"".concat(f,"0a"):"transparent",borderLeft:"2px solid ".concat(y===t?f:"transparent"),transition:"all 0.1s"},children:[(0,a.jsx)("div",{style:{width:32,height:32,borderRadius:3,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,a.jsx)("span",{style:{fontSize:13},children:"workflows"===o?"⊞":"\xb7"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink)",fontFamily:'"Inter", sans-serif'},children:n}),(0,a.jsx)("div",{style:{fontSize:11,color:"var(--ink-5)"},children:i})]})]},o)})]}),D.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{padding:"8px 16px 4px",fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em"},children:"OPERATORS"}),D.map((e,t)=>{var n,i,o,l;let r=W.length+t,s=null==(n=c[e])?void 0:n.slice(-1)[0];return(0,a.jsxs)("div",{onClick:()=>u(e),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",background:y===r?"".concat(f,"0a"):"transparent",borderLeft:"2px solid ".concat(y===r?f:"transparent"),transition:"all 0.1s"},children:[(0,a.jsxs)("div",{style:{width:32,height:32,borderRadius:"50%",flexShrink:0,background:"radial-gradient(circle at 35% 28%, #f5f0e6 0%, #ebe2d3 50%, #d8ccb8 100%)",border:"1px solid ".concat(g),boxShadow:"inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 4px rgba(26,23,19,0.10)",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:8,fontWeight:700,color:"active"===T[e]?f:"var(--ink-5)"},children:k[e]}),(0,a.jsx)("span",{style:{position:"absolute",bottom:0,right:0,width:7,height:7,borderRadius:"50%",background:"active"===T[e]?f:"var(--ink-7)",border:"1.5px solid #ebe5d7"}})]}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,a.jsx)("span",{style:{fontSize:13,color:"var(--ink)",fontFamily:'"Inter", sans-serif'},children:null==(i=A[e])?void 0:i.name}),(0,a.jsx)("span",{style:{fontSize:9,color:"var(--ink-6)",fontFamily:'"JetBrains Mono", monospace'},children:w[e]})]}),(0,a.jsx)("div",{style:{fontSize:11,color:"var(--ink-5)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s?s.content.slice(0,60)+(s.content.length>60?"…":""):null!=(l=null==(o=A[e])?void 0:o.tagline)?l:""})]}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",whiteSpace:"nowrap"},children:w[e]})]},e)})]}),O.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{padding:"8px 16px 4px",fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em"},children:"INBOX"}),O.map((e,t)=>{let n=J.inbox+t;return(0,a.jsxs)("div",{onClick:()=>U(n),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",background:y===n?"".concat(f,"0a"):"transparent",borderLeft:"2px solid ".concat(y===n?f:"transparent"),transition:"all 0.1s"},children:[(0,a.jsx)("div",{style:{width:32,height:32,borderRadius:3,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontFamily:b,fontSize:8,color:"var(--ink-3)"},children:"telegram"===e.channel?"TG":"whatsapp"===e.channel?"WA":"EM"}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink)",fontFamily:'"Inter", sans-serif'},children:e.fromName}),(0,a.jsx)("div",{style:{fontSize:11,color:"var(--ink-5)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.text})]}),e.agentId&&(0,a.jsxs)("span",{style:{fontFamily:b,fontSize:9,color:f,whiteSpace:"nowrap"},children:["→ ",e.agentId]})]},e.id)})]}),L.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{padding:"8px 16px 4px",fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em"},children:"APPROVALS"}),L.map((e,t)=>{let n=J.approvals+t;return(0,a.jsxs)("div",{onClick:()=>U(n),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",background:y===n?"".concat(f,"0a"):"transparent",borderLeft:"2px solid ".concat(y===n?f:"transparent"),transition:"all 0.1s"},children:[(0,a.jsx)("div",{style:{width:32,height:32,borderRadius:3,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,a.jsx)("span",{style:{fontSize:13},children:"✓"})}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink)",fontFamily:'"Inter", sans-serif',whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),(0,a.jsxs)("div",{style:{fontSize:11,color:"var(--ink-5)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e.agentId," \xb7 ",e.status]})]})]},e.id)})]}),N.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{padding:"8px 16px 4px",fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em"},children:"RUNS"}),N.map((e,t)=>{let n=J.runs+t;return(0,a.jsxs)("div",{onClick:()=>U(n),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",background:y===n?"".concat(f,"0a"):"transparent",borderLeft:"2px solid ".concat(y===n?f:"transparent"),transition:"all 0.1s"},children:[(0,a.jsx)("div",{style:{width:32,height:32,borderRadius:3,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,a.jsx)("span",{style:{fontSize:13},children:"◌"})}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{style:{fontSize:13,color:"var(--ink)",fontFamily:'"Inter", sans-serif'},children:[e.agentId," \xb7 ",e.triggerType]}),(0,a.jsxs)("div",{style:{fontSize:11,color:"var(--ink-5)"},children:[e.status," \xb7 ",new Date(e.startedAt).toLocaleString()]})]})]},e.id)})]}),0===P&&(0,a.jsxs)("div",{style:{padding:"32px 16px",textAlign:"center",fontFamily:'"JetBrains Mono", monospace',fontSize:11,color:"var(--ink-6)"},children:['No results for "',o,'"']})]}),(0,a.jsxs)("div",{style:{padding:"8px 16px",borderTop:"1px solid ".concat(x),display:"flex",gap:16,fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)"},children:[(0,a.jsx)("span",{children:"↑↓ navigate"}),(0,a.jsx)("span",{children:"↵ open"}),(0,a.jsx)("span",{children:"esc close"})]})]})})}function N(e){let{disabled:t,onExport:n}=e,[o,l]=(0,i.useState)(!1),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!o)return;let e=e=>{r.current&&!r.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),(0,a.jsxs)("div",{ref:r,style:{position:"relative"},children:[(0,a.jsx)("button",{onClick:()=>!t&&l(e=>!e),disabled:t,style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,letterSpacing:"0.08em",padding:"5px 10px",border:"1px solid ".concat(g),background:"transparent",color:"var(--ink-5)",borderRadius:3,cursor:t?"not-allowed":"pointer",opacity:t?.3:1,transition:"all 0.15s"},children:"EXPORT ↗"}),o&&(0,a.jsx)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,background:m,border:"1px solid ".concat(g),borderRadius:4,boxShadow:"0 4px 16px rgba(26,23,19,0.12)",zIndex:100,minWidth:140,overflow:"hidden"},children:[{fmt:"md",label:".MD",desc:"Markdown"},{fmt:"html",label:".HTML",desc:"Webpage"},{fmt:"txt",label:".TXT",desc:"Plain text"},{fmt:"csv",label:".CSV",desc:"Spreadsheet"},{fmt:"json",label:".JSON",desc:"Structured"}].map(e=>{let{fmt:t,label:i,desc:o}=e;return(0,a.jsxs)("button",{onClick:()=>{n(t),l(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",background:"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.1s"},onMouseEnter:e=>{e.currentTarget.style.background=h},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:f,letterSpacing:"0.06em",width:36},children:i}),(0,a.jsx)("span",{style:{fontFamily:'"Inter", sans-serif',fontSize:11,color:"var(--ink-5)"},children:o})]},t)})})]})}function P(e){let{label:t,active:n,disabled:i,onClick:o}=e;return(0,a.jsx)("button",{onClick:o,disabled:i,style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,letterSpacing:"0.08em",padding:"5px 10px",border:"1px solid ".concat(n?f:g),background:n?"".concat(y):"transparent",color:n?f:"var(--ink-5)",borderRadius:3,cursor:i?"not-allowed":"pointer",opacity:i?.3:1,transition:"all 0.15s"},children:t})}function J(e){let{label:t,active:n,onClick:i}=e;return(0,a.jsx)("button",{onClick:i,style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,padding:"3px 8px",border:"1px solid ".concat(n?f:g),background:n?"".concat(y):"transparent",color:n?f:"var(--ink-5)",borderRadius:3,cursor:"pointer",letterSpacing:"0.06em",transition:"all 0.15s"},children:t})}function H(e){let{value:t,options:n,onChange:i}=e;return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("select",{value:t,onChange:e=>i(e.target.value),style:{appearance:"none",background:"var(--paper-input)",border:"1px solid ".concat(g),color:"var(--ink-4)",fontSize:10,letterSpacing:"0.08em",padding:"5px 24px 5px 10px",borderRadius:3,cursor:"pointer",outline:"none",fontFamily:'"JetBrains Mono", monospace'},children:n.map(e=>(0,a.jsx)("option",{value:e,children:e.replace("claude-","").replace("-20251001","").toUpperCase()},e))}),(0,a.jsx)("span",{style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--ink-5)",fontSize:10,pointerEvents:"none"},children:"▾"})]})}function U(e){var t;let{agentName:n,agentCode:i,agentSection:o,tagline:l,onChipClick:r}=e,s=null!=(t=C[n.toLowerCase()])?t:[];return(0,a.jsxs)("div",{className:"animate-fade-up",style:{padding:"40px 0",textAlign:"center"},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.12em",marginBottom:8},children:o}),(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:28,fontWeight:700,color:"var(--ink)",letterSpacing:"-0.02em",marginBottom:4},children:i}),(0,a.jsx)("div",{style:{fontSize:14,color:"var(--ink-4)",marginBottom:32},children:l}),(0,a.jsxs)("div",{style:{maxWidth:480,margin:"0 auto",textAlign:"left"},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"var(--ink-6)",letterSpacing:"0.14em",marginBottom:12,textAlign:"center"},children:"QUICK START"}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s.map(e=>(0,a.jsx)("button",{onClick:()=>r(e),style:{textAlign:"left",fontSize:13,color:"var(--ink-4)",border:"1px solid ".concat(g),background:"transparent",borderRadius:3,padding:"10px 14px",cursor:"pointer",lineHeight:1.5,transition:"all 0.15s"},onMouseEnter:e=>{let t=e.currentTarget;t.style.borderColor=f,t.style.color="var(--ink)"},onMouseLeave:e=>{let t=e.currentTarget;t.style.borderColor=g,t.style.color="var(--ink-4)"},children:e},e))})]})]})}function V(e){let t=Date.now()-e;return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):new Date(e).toLocaleDateString()}let Y=null;function K(e){let{message:t,agentCode:n,isSpeaking:l,onSpeak:r,onRunTemplate:s,conversationContext:d}=e,[c,p]=(0,i.useState)(!1),[u,h]=(0,i.useState)([]),m="user"===t.role;return((0,i.useEffect)(()=>{if(m||!t.content)return;let e=!1;return(Y?Promise.resolve(Y):fetch("/api/templates").then(e=>e.json()).then(e=>(Y=e.templates,e.templates)).catch(()=>[])).then(n=>{e||h(n.filter(e=>RegExp("\\b".concat(e.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\b"),"i").test(t.content)).map(e=>({id:e.id,name:e.name})))}),()=>{e=!0}},[t.content,m]),m)?(0,a.jsxs)("div",{className:"animate-fade-up",style:{display:"flex",gap:12,alignItems:"flex-start",flexDirection:"row-reverse"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:2,flexShrink:0,marginTop:1,background:"var(--user-bg)",border:"1px solid ".concat(f,"44"),display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:7,color:f,fontWeight:700},children:"ME"})}),(0,a.jsxs)("div",{style:{maxWidth:"72%",padding:"10px 14px",background:"var(--user-bg)",borderRadius:"4px 0 4px 4px",border:"1px solid ".concat(f,"22")},children:[(0,a.jsx)("pre",{style:{fontFamily:'"Inter", sans-serif',fontSize:13,color:"var(--ink)",lineHeight:1.65,margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t.content}),(0,a.jsx)("time",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",display:"block",marginTop:6},children:V(t.timestamp)})]})]}):t.content?(0,a.jsxs)("div",{className:"animate-fade-up",style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:2,flexShrink:0,marginTop:1,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:7,color:f,fontWeight:700},children:"AI"})}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{maxWidth:"80%",padding:"10px 14px",background:"var(--paper-input)",borderRadius:"0 4px 4px 4px",border:"1px solid ".concat(g)},children:(0,a.jsx)("div",{className:"prose-agent",children:(0,a.jsx)(o.oz,{children:t.content||""})})}),t.content&&(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:6,fontFamily:'"JetBrains Mono", monospace'},children:[(0,a.jsx)("time",{style:{fontSize:9,color:"var(--ink-6)"},children:V(t.timestamp)}),(0,a.jsxs)("div",{style:{display:"flex",gap:4,marginLeft:"auto"},children:[(0,a.jsx)(J,{label:c?"✓ COPIED":"COPY",active:c,onClick:()=>{navigator.clipboard.writeText(t.content),p(!0),setTimeout(()=>p(!1),1500)}}),(0,a.jsx)(J,{label:l?"◼ STOP":"▶ READ",active:l,onClick:()=>r(t)})]})]}),u.length>0&&s&&(0,a.jsx)("div",{style:{marginTop:8,display:"flex",flexWrap:"wrap",gap:6},children:u.map(e=>(0,a.jsxs)("button",{onClick:()=>s(e.id,null!=d?d:t.content),style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,letterSpacing:"0.08em",textTransform:"uppercase",padding:"5px 10px",border:"1px solid ".concat(f),background:"".concat(f,"1a"),color:f,borderRadius:2,cursor:"pointer"},children:['↳ Run "',e.name,'"']},e.id))})]})]}):null}let q=(0,i.forwardRef)(function(e,t){let{value:n,onChange:o,onSubmit:l,onVoice:r,onBroadcast:s,onAttach:d,hasAttachments:c,disabled:p,isListening:u,broadcastMode:m,agentName:x}=e,y=(0,i.useRef)(null),v=m?f:u?"#ef4444":g,b=(n.trim().length>0||!0===c)&&!p;return(0,a.jsxs)("div",{style:{position:"relative",border:"1px solid ".concat(v),borderRadius:3,background:"var(--paper-input)",transition:"border-color 0.15s"},children:[(0,a.jsx)("input",{ref:y,type:"file",multiple:!0,style:{display:"none"},onChange:e=>{e.target.files&&d&&(d(e.target.files),e.target.value="")}}),(0,a.jsx)("span",{style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",fontFamily:'"JetBrains Mono", monospace',fontSize:11,color:"var(--ink-6)",pointerEvents:"none",zIndex:1},children:"→"}),(0,a.jsx)("button",{onClick:r,disabled:p,style:{position:"absolute",left:36,top:7,width:28,height:28,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",background:u?"rgba(239,68,68,0.15)":h,border:"1px solid ".concat(u?"#ef4444":g),cursor:p?"not-allowed":"pointer",opacity:p?.3:1,color:u?"#ef4444":"var(--ink-5)",transition:"all 0.15s"},children:(0,a.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"9",y:"2",width:"6",height:"11",rx:"3"}),(0,a.jsx)("path",{d:"M5 10a7 7 0 0 0 14 0"}),(0,a.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),(0,a.jsx)("line",{x1:"8",y1:"22",x2:"16",y2:"22"})]})}),d&&(0,a.jsx)("button",{onClick:()=>{var e;return null==(e=y.current)?void 0:e.click()},disabled:p,title:"Attach file",style:{position:"absolute",left:70,top:7,width:28,height:28,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",background:h,border:"1px solid ".concat(g),cursor:p?"not-allowed":"pointer",opacity:p?.3:1,color:"var(--ink-5)",transition:"all 0.15s"},children:(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),(0,a.jsx)("textarea",{ref:t,value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),l())},onPaste:e=>{var t;if(!d)return;let n=null==(t=e.clipboardData)?void 0:t.items;if(!n)return;let a=[];for(let e=0;e<n.length;e++){let t=n[e];if("file"===t.kind){let e=t.getAsFile();e&&a.push(e)}}a.length>0&&(e.preventDefault(),d(a))},placeholder:m?"Broadcast to all agents…":"Message ".concat(x.toLowerCase()," agent…"),disabled:p,rows:1,style:{width:"100%",background:"transparent",border:"none",outline:"none",padding:"12px 132px 12px ".concat(d?106:72,"px"),fontSize:13,color:"var(--ink)",fontFamily:'"Inter", sans-serif',resize:"none",lineHeight:1.5,minHeight:44,maxHeight:240,cursor:p?"not-allowed":"text"},onInput:e=>{let t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,240)+"px"}}),(0,a.jsxs)("div",{style:{position:"absolute",right:10,top:7,display:"flex",alignItems:"center",gap:6},children:[(0,a.jsx)("button",{onClick:s,disabled:p,title:"Broadcast to all agents",style:{width:28,height:28,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",background:m?f:h,border:"1px solid ".concat(m?f:g),cursor:p?"not-allowed":"pointer",opacity:p?.3:1,fontSize:13,transition:"all 0.15s",flexShrink:0},children:"\uD83D\uDCE2"}),(0,a.jsx)("button",{onClick:l,disabled:!b,style:{padding:"7px 12px",borderRadius:3,background:b?f:"var(--paper-input)",border:"1px solid ".concat(b?f:g),color:b?"#000":"var(--ink-6)",fontFamily:'"JetBrains Mono", monospace',fontSize:10,letterSpacing:"0.08em",cursor:b?"pointer":"not-allowed",transition:"all 0.15s",whiteSpace:"nowrap",flexShrink:0},children:"SEND →"})]})]})});function G(e){var t,n;let{selectedAgent:o,chatOpen:r,conversations:d,onSelectAgent:c}=e,{pack:u}=p(),m=null!=(t=null==u?void 0:u.agentTeams)?t:s,y=null!=(n=null==u?void 0:u.agents)?n:l,[v,b]=(0,i.useState)(new Set),[j,S]=(0,i.useState)(""),w=(0,i.useRef)(null),[F,C]=(0,i.useState)({});(0,i.useEffect)(()=>{let e=e=>{let t=["TEXTAREA","INPUT"].includes(e.target.tagName);"/"!==e.key||t||!w.current||r||(e.preventDefault(),w.current.focus())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r]);let B=e=>{var t,n;if(!j.trim())return!0;let a=j.toLowerCase(),i=y[e];return k[e].toLowerCase().includes(a)||null!=(t=null==i?void 0:i.name.toLowerCase().includes(a))&&t||null!=(n=null==i?void 0:i.tagline.toLowerCase().includes(a))&&n};return(0,i.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch("/api/runs?limit=500");if(!t.ok)return;let n=await t.json(),a=Date.now(),i={};for(let e of n.runs){let t=a-e.startedAt;if(t>864e5)continue;let n=11-Math.floor(t/72e5);!(n<0)&&!(n>11)&&(i[e.agentId]||(i[e.agentId]=Array(12).fill(0)),i[e.agentId][n]++)}e||C(i)}catch(e){}};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[]),(0,a.jsxs)("div",{style:{width:220,flexShrink:0,borderRight:"1px solid ".concat(g),overflowY:"auto",background:h,display:"flex",flexDirection:"column"},children:[(0,a.jsxs)("div",{style:{padding:"8px 10px",borderBottom:"1px solid ".concat(x),flexShrink:0},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:"var(--ink-6)",letterSpacing:"0.14em",marginBottom:6},children:"OPERATORS"}),(0,a.jsx)("input",{ref:w,value:j,onChange:e=>S(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(S(""),e.currentTarget.blur())},placeholder:"filter… ( / )",style:{width:"100%",padding:"4px 8px",background:"var(--paper-input)",border:"1px solid ".concat(x),borderRadius:2,color:"var(--ink)",fontFamily:'"JetBrains Mono", monospace',fontSize:10,outline:"none"}})]}),m.map(e=>{let{label:t,ids:n,color:i}=e,l=n.filter(B);if(0===l.length)return null;let s=!v.has(t);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>b(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 10px",background:"transparent",border:"none",cursor:"pointer",textAlign:"left"},onMouseEnter:e=>{e.currentTarget.style.background="".concat(i,"1a")},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,color:i,opacity:.6,display:"inline-block",transition:"transform 0.15s",transform:s?"rotate(90deg)":"none",lineHeight:1},children:"›"}),(0,a.jsx)("span",{style:{display:"inline-block",width:3,height:11,background:i,borderRadius:1,flexShrink:0}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:9,fontWeight:600,color:i,letterSpacing:"0.12em"},children:t}),n.length>1&&(0,a.jsx)("span",{style:{marginLeft:"auto",fontFamily:'"JetBrains Mono", monospace',fontSize:8,color:i,opacity:.55,padding:"1px 5px",border:"1px solid ".concat(i,"66"),borderRadius:2},children:n.length})]}),s&&l.map(e=>{var t,n,i;let l=y[e];if(!l)return null;let s=null!=(n=null==(t=d[e])?void 0:t.length)?n:0,p=e===o&&r,u=T[e];return(0,a.jsxs)("button",{onClick:()=>c(e),style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"5px 10px 5px 20px",background:p?"".concat(f,"12"):"transparent",borderTop:"none",borderRight:"none",borderBottom:"none",borderLeft:"2px solid ".concat(p?f:"transparent"),cursor:"pointer",textAlign:"left",transition:"background 0.1s"},onMouseEnter:e=>{p||(e.currentTarget.style.background="".concat(f,"08"))},onMouseLeave:e=>{p||(e.currentTarget.style.background="transparent")},children:[(0,a.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",flexShrink:0,background:"active"===u?f:"var(--ink-7)",boxShadow:"active"===u?"0 0 4px ".concat(f,"88"):"none"}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:8,color:"var(--ink-5)",width:26,flexShrink:0,letterSpacing:"0.04em"},children:k[e]}),(0,a.jsx)("span",{title:"".concat(l.name," — ").concat(l.tagline),style:{fontSize:11,fontFamily:'"Inter", sans-serif',color:p?"var(--ink)":"var(--ink-3)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.name}),(0,a.jsx)($,{buckets:null!=(i=F[e])?i:[]}),s>0&&(0,a.jsx)("span",{style:{background:f,color:"#fff",borderRadius:8,fontSize:9,lineHeight:1,padding:"2px 6px",fontFamily:'"JetBrains Mono", monospace',fontWeight:600,flexShrink:0,minWidth:16,textAlign:"center"},children:s})]},e)})]},t)})]})}function $(e){let{buckets:t}=e;if(0===t.length)return(0,a.jsx)("div",{style:{width:36,height:14,flexShrink:0},"aria-hidden":!0});let n=Math.max(1,...t);return(0,a.jsx)("svg",{width:36,height:14,style:{flexShrink:0},"aria-label":"last 24h activity",children:Array.from({length:12}).map((e,i)=>{var o;let l=null!=(o=t[i])?o:0,r=0===l?1:Math.max(1,Math.round(l/n*12));return(0,a.jsx)("rect",{x:3*i,y:14-r,width:2.5,height:r,fill:0===l?"var(--ink-7)":f,opacity:0===l?.3:.85},i)})})}function X(e){var t,n;let{selectedAgent:o,chatOpen:r,conversations:d,onSelectAgent:c}=e,[u,h]=(0,i.useState)(new Set);(0,i.useEffect)(()=>{let e=!1;async function t(){try{let t=await fetch("/api/runs?limit=200");if(!t.ok)return;let n=await t.json(),a=Date.now()-36e5,i=new Set(n.runs.filter(e=>e.startedAt>a).map(e=>e.agentId));e||h(i)}catch(e){}}t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[]);let{pack:m}=p(),g=null!=(t=null==m?void 0:m.agentTeams)?t:s,x=null!=(n=null==m?void 0:m.agents)?n:l,y=g.length,v=g.map((e,t)=>{var n;let{label:a,ids:i,color:o}=e,l=-Math.PI/2+2*Math.PI*t/y,r=240*Math.cos(l),s=240*Math.sin(l),d=o||(null==(n=x[i[0]])?void 0:n.accent)||f,c=i.some(e=>u.has(e)),p=1===i.length?0:Math.PI/6,h=i.map((e,t)=>{let n=l+(1===i.length?0:t/(i.length-1)-.5)*p;return{id:e,pos:{x:Math.cos(n)*(240+(t%2==0?-8:8))+4*Math.cos(l),y:Math.sin(n)*(240+(t%2==0?-8:8))+4*Math.sin(l)}}});return{teamIndex:t,label:a,color:d,teamHasRecent:c,anchor:{x:r,y:s},angle:l,agents:h}});return(0,a.jsx)("div",{style:{flex:1,overflow:"auto",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px"},children:(0,a.jsxs)("div",{style:{position:"relative",width:720,height:720,flexShrink:0},children:[(0,a.jsx)("svg",{width:720,height:720,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:(0,a.jsxs)("g",{transform:"translate(".concat(360,", ").concat(360,")"),children:[(0,a.jsx)("circle",{cx:0,cy:0,r:240,fill:"none",stroke:"var(--ink-7)",strokeOpacity:.18,strokeDasharray:"2 6"}),v.map(e=>{let{anchor:t,color:n,label:i}=e;return(0,a.jsx)("line",{x1:0,y1:0,x2:t.x,y2:t.y,stroke:n,strokeOpacity:.18,strokeWidth:1},i)})]})}),(0,a.jsxs)("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",pointerEvents:"none",maxWidth:220},children:[(0,a.jsx)("div",{style:{fontFamily:b,fontSize:9,color:"var(--ink-6)",letterSpacing:"0.18em",marginBottom:8},children:"\xa7 00 / OPS FLOOR"}),(0,a.jsxs)("div",{style:{fontFamily:S,fontStyle:"italic",fontSize:30,fontWeight:500,color:"var(--ink)",letterSpacing:"-0.02em",lineHeight:1.05},children:["The ",(0,a.jsx)("span",{style:{color:f},children:"workforce"}),"."]})]}),v.map(e=>{let{label:t,color:n,teamHasRecent:i,angle:o}=e,l=316*Math.cos(o),r=316*Math.sin(o);return(0,a.jsxs)("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(calc(-50% + ".concat(l,"px), calc(-50% + ").concat(r,"px))"),fontFamily:b,fontSize:9,color:n,letterSpacing:"0.16em",whiteSpace:"nowrap",pointerEvents:"none"},children:[t,i&&(0,a.jsx)("span",{style:{marginLeft:6,fontSize:7,color:"#2f5b3b"},children:"●"})]},"label-".concat(t))}),v.flatMap(e=>{let{teamIndex:t,agents:n}=e;return n.map((e,n)=>{var i,l;let{id:s,pos:p}=e,[h,m]=function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193);return[(t>>>0)%29-14,(t>>>8)%29-12]}(s);return(0,a.jsx)("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(calc(-50% + ".concat(p.x+.4*h,"px), calc(-50% + ").concat(p.y+.4*m,"px))")},children:(0,a.jsx)(Q,{id:s,agent:x[s],isOpen:s===o&&r,hasMessages:(null!=(l=null==(i=d[s])?void 0:i.length)?l:0)>0,ranRecently:u.has(s),floatDelay:-(1.2*t+.3*n),orbSize:84,onClick:()=>c(s)})},s)})})]})})}function Q(e){var t;let{id:n,agent:o,isOpen:l,hasMessages:r,ranRecently:s=!1,floatDelay:d,orbSize:c=80,onClick:p}=e,[h,m]=(0,i.useState)(!1),g=T[n],x=null!=(t=o.accent)?t:f,y=Math.round(.1375*c),v=l?"radial-gradient(circle at 35% 28%, ".concat(x,"30 0%, ").concat(x,"14 35%, #ebe2d3 65%, #d8ccb8 100%)"):h?"radial-gradient(circle at 35% 28%, #f0e8d8 0%, #e3d6c2 50%, #cfc0a5 100%)":"radial-gradient(circle at 35% 28%, #f5f0e6 0%, #ebe2d3 50%, #d8ccb8 100%)",b=l?"0 0 0 1.5px ".concat(x,"44, 0 0 20px ").concat(x,"22, 0 6px 24px rgba(26,23,19,0.14), inset 0 1px 0 rgba(255,255,255,0.75)"):h?"0 0 0 1px #b5a892, 0 4px 20px rgba(26,23,19,0.16), inset 0 1px 0 rgba(255,255,255,0.85), inset 0 0 14px rgba(26,23,19,0.05)":"0 0 0 1px #c9bea6, 0 2px 12px rgba(26,23,19,0.10), inset 0 1px 0 rgba(255,255,255,0.80), inset 0 0 12px rgba(26,23,19,0.04)";return(0,a.jsxs)("div",{onClick:p,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0,cursor:"pointer",transform:"scale(".concat(l?1.15:h?1.08:1,")"),transition:"transform 0.22s cubic-bezier(0.4, 0, 0.2, 1)"},children:[(0,a.jsxs)("div",{style:{position:"relative",width:c,height:c,animation:"orb-float 4s ease-in-out ".concat(d,"s infinite"),willChange:"transform"},children:[l&&(0,a.jsx)("div",{style:{position:"absolute",inset:-12,borderRadius:"50%",background:"radial-gradient(ellipse, ".concat(x,"28 0%, transparent 70%)"),pointerEvents:"none"}}),"active"===g&&(0,a.jsx)("div",{className:"orb-pulse-ring",style:{position:"absolute",inset:-4,borderRadius:"50%",border:"1px solid ".concat(l?x+"44":x+"22"),pointerEvents:"none"}}),s&&!l&&(0,a.jsx)("div",{className:"orb-recent-halo",style:{position:"absolute",inset:-8,borderRadius:"50%",background:"radial-gradient(ellipse, ".concat(x,"24 0%, transparent 65%)"),pointerEvents:"none"}}),(0,a.jsxs)("div",{style:{width:c,height:c,borderRadius:"50%",background:v,boxShadow:b,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden",transition:"background 0.3s, box-shadow 0.3s"},children:[(0,a.jsx)("div",{style:{position:"absolute",top:"12%",left:"18%",width:"38%",height:"26%",borderRadius:"50%",background:"radial-gradient(ellipse, rgba(255,255,255,0.80) 0%, transparent 75%)",pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",bottom:"8%",right:"10%",width:"44%",height:"34%",borderRadius:"50%",background:"radial-gradient(ellipse, rgba(0,0,0,0.10) 0%, transparent 70%)",pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.45) 0%, transparent 55%)",pointerEvents:"none"}}),(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:y,fontWeight:700,color:l?x:h?"var(--ink-3)":"var(--ink-5)",letterSpacing:"0.04em",textShadow:l?"0 0 12px ".concat(x,"55"):"none",position:"relative",zIndex:1,transition:"color 0.25s, text-shadow 0.25s"},children:k[n]})]}),(0,a.jsxs)("div",{style:{position:"absolute",bottom:1,right:1,display:"flex",alignItems:"center",gap:3},children:[r&&!l&&(0,a.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:f,display:"inline-block",boxShadow:"0 0 6px ".concat(f)}}),(0,a.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",display:"inline-block",background:"active"===g?f:"var(--ink-7)",boxShadow:"active"===g?"0 0 8px ".concat(f,"aa"):"none",border:"1.5px solid ".concat(u),transition:"all 0.3s"}})]})]}),(0,a.jsx)("div",{style:{width:.7*c,height:6,borderRadius:"50%",background:"radial-gradient(ellipse, #00000077 0%, transparent 80%)",marginTop:6,animation:"orb-shadow 4s ease-in-out ".concat(d,"s infinite"),willChange:"transform, opacity"}}),(0,a.jsx)("div",{style:{marginTop:8,fontFamily:'"JetBrains Mono", monospace',fontSize:9,letterSpacing:"0.1em",textAlign:"center",color:l?"var(--ink-2)":h?"var(--ink-4)":"var(--ink-6)",transition:"color 0.2s",whiteSpace:"nowrap",textTransform:"uppercase"},children:o.name})]})}let _={B:"var(--paper)",S:"var(--paper-2)",P:"var(--paper-3)",BR:"var(--hair)",BR2:"var(--hair-2)",EM:"#c95c0a",EM3:"#c95c0a33",EM6:"#c95c0a66",T1:"var(--ink)",T2:"var(--ink-2)",T3:"var(--ink-3)",T4:"var(--ink-4)",T5:"var(--ink-5)",T6:"var(--ink-6)",T7:"var(--ink-7)",FM:'"JetBrains Mono", ui-monospace, monospace',FB:'"Inter", system-ui, sans-serif',FD:'"Fraunces", Georgia, serif'};function Z(e){let t=Date.now()-e;return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):t<6048e5?"".concat(Math.floor(t/864e5),"d ago"):new Date(e).toLocaleDateString()}function ee(e){let{section:t,title:n,subtitle:i,actions:o}=e;return(0,a.jsxs)("div",{"data-mobile-flat-header":!0,style:{borderBottom:"1px solid ".concat(_.BR2),padding:"20px 28px 18px",display:"grid",gridTemplateColumns:"200px 1fr auto",gap:20,alignItems:"start",flexShrink:0},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:12,color:_.EM,letterSpacing:"0.14em"},children:t}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:32,fontWeight:500,letterSpacing:"-0.02em",color:_.T1,lineHeight:1.05},children:n}),i&&(0,a.jsx)("div",{style:{marginTop:6,fontSize:13,color:_.T3,fontFamily:_.FB},children:i})]}),o&&(0,a.jsx)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:o})]})}function et(e){let{children:t,color:n,bg:i}=e;return(0,a.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",fontFamily:_.FM,fontSize:9,letterSpacing:"0.1em",textTransform:"uppercase",border:"1px solid ".concat(null!=n?n:_.T4),color:null!=n?n:_.T4,background:null!=i?i:"transparent",borderRadius:2,whiteSpace:"nowrap"},children:t})}function en(e){let{children:t,onClick:n,variant:i="secondary",disabled:o,size:l="md"}=e,r={primary:{background:_.EM,color:"#fff",borderColor:_.EM},secondary:{background:"transparent",color:_.T2,borderColor:_.BR},danger:{background:"transparent",color:"#a52a1a",borderColor:"#a52a1a"},ghost:{background:"transparent",color:_.T4,borderColor:"transparent"}};return(0,a.jsx)("button",{onClick:n,disabled:o,style:{...r[i],border:"1px solid ".concat(r[i].borderColor),padding:"sm"===l?"5px 10px":"8px 14px",fontFamily:_.FM,fontSize:"sm"===l?10:11,letterSpacing:"0.12em",textTransform:"uppercase",borderRadius:2,cursor:o?"not-allowed":"pointer",opacity:o?.4:1,transition:"all 0.15s"},children:t})}function ea(e){let{channel:t}=e,n={telegram:"#0088cc",whatsapp:"#25d366",email:_.T4};return(0,a.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:2,fontFamily:_.FM,fontSize:8,fontWeight:700,background:"".concat(n[t],"22"),color:n[t],border:"1px solid ".concat(n[t],"66"),flexShrink:0},children:{telegram:"TG",whatsapp:"WA",email:"EM"}[t]})}function ei(e){let{variant:t="row",count:n=5}=e,i=Array.from({length:n});return"row"===t?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:i.map((e,t)=>(0,a.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid ".concat(_.BR2),display:"flex",flexDirection:"column",gap:6},children:[(0,a.jsx)(eo,{w:"40%",h:10}),(0,a.jsx)(eo,{w:"85%",h:9}),(0,a.jsx)(eo,{w:"60%",h:9})]},t))}):"card"===t?(0,a.jsx)("div",{style:{display:"grid",gap:16,maxWidth:880,margin:"0 auto"},children:i.map((e,t)=>(0,a.jsxs)("div",{style:{border:"1px solid ".concat(_.BR),background:_.S,borderRadius:3,padding:"18px 22px",display:"flex",flexDirection:"column",gap:10},children:[(0,a.jsx)(eo,{w:"55%",h:14}),(0,a.jsx)(eo,{w:"30%",h:9}),(0,a.jsxs)("div",{style:{marginTop:6,padding:"12px 14px",background:_.B,border:"1px solid ".concat(_.BR2),borderRadius:2,display:"flex",flexDirection:"column",gap:6},children:[(0,a.jsx)(eo,{w:"100%",h:10}),(0,a.jsx)(eo,{w:"92%",h:10}),(0,a.jsx)(eo,{w:"78%",h:10})]})]},t))}):"list-row"===t?(0,a.jsx)("div",{children:i.map((e,t)=>(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 24px",borderBottom:"1px solid ".concat(_.BR2)},children:[(0,a.jsx)(eo,{w:26,h:9}),(0,a.jsx)(eo,{w:"30%",h:10}),(0,a.jsx)(eo,{w:"20%",h:9}),(0,a.jsx)(eo,{w:"15%",h:9})]},t))}):(0,a.jsxs)("div",{style:{padding:28,maxWidth:760},children:[(0,a.jsxs)("div",{style:{display:"flex",gap:10,marginBottom:14},children:[(0,a.jsx)(eo,{w:22,h:22,radius:2}),(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[(0,a.jsx)(eo,{w:"40%",h:14}),(0,a.jsx)(eo,{w:"55%",h:9})]})]}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:i.map((e,t)=>(0,a.jsxs)("div",{style:{padding:"12px 16px",background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsx)(eo,{w:"100%",h:10}),(0,a.jsx)(eo,{w:"80%",h:10})]},t))})]})}function eo(e){let{w:t,h:n,radius:i=2}=e;return(0,a.jsx)("span",{className:"skel-shimmer",style:{display:"block",width:t,height:n,borderRadius:i,background:"var(--paper-2)"}})}function el(e){let{icon:t,title:n,body:i}=e;return(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:48,color:_.T4},children:[t&&(0,a.jsx)("div",{style:{fontSize:44,marginBottom:12,color:_.T7},children:t}),(0,a.jsx)("div",{style:{fontFamily:_.FD,fontStyle:"italic",fontSize:22,color:_.T2,marginBottom:6},children:n}),i&&(0,a.jsx)("div",{style:{fontSize:13,fontFamily:_.FB,maxWidth:380,textAlign:"center"},children:i})]})}function er(e,t,n){let a=(0,i.useRef)(n);a.current=n,(0,i.useEffect)(()=>{if(!e)return;let n=null,i=()=>{for(let i of(null==n||n.close(),n=new EventSource(e),t))n.addEventListener(i,e=>{let t=e.data;try{t=JSON.parse(e.data)}catch(e){}a.current(i,t)});n.onerror=()=>{}};i();let o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o),null==n||n.close()}},[e,t.join("|")])}function es(e){var t;let{toast:n,onSelectAgent:o}=e,[l,r]=(0,i.useState)(null),[s,d]=(0,i.useState)("all"),[c,p]=(0,i.useState)(null),[u,h]=(0,i.useState)(new Set),m=(0,i.useCallback)(e=>{h(t=>{let n=new Set(t);return n.add(e),n}),setTimeout(()=>{h(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},1700)},[]);er("/api/inbox/stream",["snapshot","created","updated"],(0,i.useCallback)((e,t)=>{if("snapshot"===e){let{messages:e}=t;r(e);return}if("created"===e){r(e=>e?e.some(e=>e.id===t.id)?e:[t,...e]:[t]),m(t.threadId);return}if("updated"===e)return void r(e=>e?e.map(e=>e.id===t.id?t:e):e)},[m])),(0,i.useEffect)(()=>{if(!l||0===l.length)return;let e=new URL(window.location.href),t=e.searchParams.get("id");if(!t)return;let n=l.find(e=>e.id===t);n&&(p(n.threadId),e.searchParams.delete("id"),window.history.replaceState({},"",e.toString()))},[l]);let g=(0,i.useMemo)(()=>{var e=(null!=l?l:[]).filter(e=>"all"===s||e.status===s);let t=new Map;for(let n of e){let e=t.get(n.threadId);e?(e.messages.push(n),"new"===n.status&&e.newCount++):t.set(n.threadId,{id:n.threadId,channel:n.channel,chatId:n.chatId,fromName:n.fromName,fromHandle:n.fromHandle,agentId:n.agentId,messages:[n],newCount:+("new"===n.status),latestStatus:n.status,latestTimestamp:n.timestamp})}return Array.from(t.values()).sort((e,t)=>t.latestTimestamp-e.latestTimestamp)},[l,s]),x=(null!=l?l:[]).filter(e=>"new"===e.status).length,f=c&&null!=(t=g.find(e=>e.id===c))?t:null;async function y(e,t){try{let n=await fetch("/api/inbox",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,patch:{status:t}})});if(!n.ok)throw Error("HTTP ".concat(n.status))}catch(e){n.error(e instanceof Error?e.message:"update failed")}}async function v(e){let t=e.messages.map(e=>({id:e.id,status:e.status}));for(let t of e.messages)await y(t.id,"archived");n.info("Archived ".concat(e.fromName,"."),{ttlMs:6e3,action:{label:"Undo",onClick:async()=>{for(let e of t)await y(e.id,e.status)}}})}async function b(e){for(let t of e.messages)await y(t.id,"read")}return(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:_.B},children:[(0,a.jsx)(ee,{section:"\xa7 INBOX".concat(x>0?" \xb7 ".concat(x," NEW"):""),title:"The signal in your channels.",subtitle:"Incoming messages from Telegram, WhatsApp, and email — grouped by conversation.",actions:(0,a.jsx)("div",{style:{display:"flex",gap:4},children:["all","new","replied","archived"].map(e=>(0,a.jsx)("button",{onClick:()=>d(e),style:{padding:"5px 10px",fontFamily:_.FM,fontSize:9,letterSpacing:"0.1em",textTransform:"uppercase",border:"1px solid ".concat(s===e?_.EM:_.BR),background:s===e?_.EM3:"transparent",color:s===e?_.EM:_.T4,cursor:"pointer",borderRadius:2},children:e},e))})}),(0,a.jsxs)("div",{"data-mobile-stack":!0,style:{flex:1,display:"flex",overflow:"hidden"},children:[(0,a.jsxs)("div",{"data-mobile-fullwidth":!0,style:{width:360,borderRight:"1px solid ".concat(_.BR),overflowY:"auto",flexShrink:0},children:[null===l&&(0,a.jsx)(ei,{variant:"row",count:6}),null!==l&&0===g.length&&(0,a.jsx)(el,{title:"new"===s?"Nothing new.":"No conversations yet.",body:"Connect Telegram or WhatsApp and route a chat to an agent to see incoming messages here."}),g.map(e=>{let t=e.messages[0],n=e.newCount>0,i=u.has(e.id)&&c!==e.id;return(0,a.jsxs)("button",{onClick:()=>(function(e){for(let t of(p(e.id),e.messages))"new"===t.status&&y(t.id,"read")})(e),className:i?"sse-flash":void 0,style:{display:"block",width:"100%",textAlign:"left",padding:"12px 16px",background:c===e.id?_.EM3:"transparent",borderTop:"none",borderRight:"none",borderBottom:"1px solid ".concat(_.BR2),borderLeft:"3px solid ".concat(n?_.EM:"transparent"),cursor:"pointer",color:_.T1},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,a.jsx)(ea,{channel:e.channel}),(0,a.jsx)("span",{title:e.fromName,style:{fontSize:12,fontWeight:600,fontFamily:_.FB,color:_.T1,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.fromName}),e.messages.length>1&&(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T4,padding:"1px 5px",border:"1px solid ".concat(_.BR),borderRadius:2},children:e.messages.length}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T5},children:Z(e.latestTimestamp)})]}),(0,a.jsx)("div",{title:t.text,style:{fontSize:12,color:_.T3,lineHeight:1.4,fontFamily:_.FB,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t.text}),(0,a.jsxs)("div",{style:{marginTop:6,display:"flex",gap:6,alignItems:"center"},children:[n&&(0,a.jsxs)(et,{color:_.EM,children:[e.newCount," new"]}),!n&&"new"!==e.latestStatus&&(0,a.jsx)(et,{children:e.latestStatus}),e.agentId&&(0,a.jsxs)(et,{color:_.EM,children:["→ ",e.agentId]})]})]},e.id)})]}),(0,a.jsx)("div",{style:{flex:1,overflowY:"auto"},children:f?(0,a.jsx)(ed,{thread:f,toast:n,onSelectAgent:o,onArchiveThread:()=>v(f),onUnarchiveThread:()=>b(f)}):(0,a.jsx)(el,{icon:"✉",title:"Select a conversation.",body:"Pick a thread on the left to read it."})})]})]})}function ed(e){let{thread:t,toast:n,onSelectAgent:i,onArchiveThread:o,onUnarchiveThread:l}=e,r=[...t.messages].sort((e,t)=>e.timestamp-t.timestamp);return(0,a.jsxs)("div",{style:{padding:28,maxWidth:760},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[(0,a.jsx)(ea,{channel:t.channel}),(0,a.jsxs)("div",{style:{flex:1},children:[(0,a.jsx)("div",{style:{fontSize:16,fontWeight:600,color:_.T1,fontFamily:_.FB},children:t.fromName}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:11,color:_.T5},children:[t.fromHandle?"".concat(t.fromHandle," \xb7 "):"","chat ",t.chatId," \xb7 ",t.messages.length," message",1===t.messages.length?"":"s"]})]}),t.agentId&&(0,a.jsxs)(et,{color:_.EM,children:["routed → ",t.agentId]})]}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10,marginBottom:24},children:r.map(e=>(0,a.jsxs)("div",{style:{padding:"12px 16px",background:_.S,border:"1px solid ".concat(_.BR),borderLeft:"3px solid ".concat("new"===e.status?_.EM:_.BR),borderRadius:3,fontSize:14,lineHeight:1.6,color:_.T1,fontFamily:_.FB,whiteSpace:"pre-wrap"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6,fontSize:11,color:_.T5,fontFamily:_.FM},children:[(0,a.jsx)("span",{children:new Date(e.timestamp).toLocaleString()}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,a.jsx)(et,{children:e.status}),e.approvalId&&(0,a.jsx)(et,{color:"#a52a1a",children:"awaiting approval"})]})]}),e.text]},e.id))}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[t.agentId&&(0,a.jsxs)(en,{variant:"primary",onClick:()=>i(t.agentId),children:["Open in ",t.agentId," chat"]}),"archived"!==t.latestStatus&&(0,a.jsx)(en,{onClick:o,children:"Archive thread"}),"archived"===t.latestStatus&&(0,a.jsx)(en,{onClick:l,children:"Unarchive thread"})]})]})}function ec(e){let{toast:t}=e,[n,o]=(0,i.useState)(null),[l,r]=(0,i.useState)("pending"),[s,d]=(0,i.useState)(null),[c,p]=(0,i.useState)(null),[u,h]=(0,i.useState)(new Set),[m,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(new Set),[y,v]=(0,i.useState)({});(0,i.useEffect)(()=>{if(!n)return;let e=n.map(e=>e.inboxMessageId).filter(e=>!!e&&!y[e]);0!==e.length&&fetch("/api/inbox?limit=500").then(e=>e.json()).then(t=>{let n={...y},a=0;for(let i of t.messages)e.includes(i.id)&&!n[i.id]&&(n[i.id]=i,a++);a>0&&v(n)}).catch(()=>{})},[n]);let b=(0,i.useCallback)(e=>{f(t=>{let n=new Set(t);return n.add(e),n}),setTimeout(()=>{f(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},1700)},[]);er("/api/approvals/stream",["snapshot","created","updated"],(0,i.useCallback)((e,t)=>{if("snapshot"===e){let{approvals:e}=t;o(e);return}if("created"===e){o(e=>e?e.some(e=>e.id===t.id)?e:[t,...e]:[t]),b(t.id);return}if("updated"===e)return void o(e=>e?e.map(e=>e.id===t.id?t:e):e)},[])),(0,i.useEffect)(()=>{if(!n||0===n.length)return;let e=new URL(window.location.href),t=e.searchParams.get("id");t&&n.some(e=>e.id===t)&&(b(t),requestAnimationFrame(()=>{let e=document.getElementById("approval-".concat(t));e&&e.scrollIntoView({behavior:"smooth",block:"center"})}),e.searchParams.delete("id"),window.history.replaceState({},"",e.toString()))},[n,b]);let j=(null!=n?n:[]).filter(e=>"all"===l||"pending"===e.status),S=(null!=n?n:[]).filter(e=>"pending"===e.status).length;async function k(e,a,i){p(e);try{var o;let l=await fetch("/api/approvals",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:a,editedBody:i})}),r=await l.json();if(!l.ok)throw Error(null!=(o=r.error)?o:"HTTP ".concat(l.status));"reject"===a?t.info("Rejected.",{ttlMs:6e3,action:{label:"Undo",onClick:async()=>{try{let a=(null!=n?n:[]).find(t=>t.id===e);if(!a)return;await fetch("/api/approvals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:a.type,agentId:a.agentId,title:a.title,body:a.body,meta:a.meta,inboxMessageId:a.inboxMessageId})}),t.success("Restored as pending.")}catch(e){t.error(e instanceof Error?e.message:"undo failed")}}}}):t.success("edit"===a?"Edited & sent.":"Approved & sent."),d(null)}catch(e){t.error(e instanceof Error?e.message:"action failed")}finally{p(null)}}async function w(e){let a=(null!=n?n:[]).filter(e=>u.has(e.id)&&"pending"===e.status);if(0===a.length||"reject"===e&&!confirm("Reject ".concat(a.length," approval").concat(1===a.length?"":"s","?")))return;g(!0);let i=0,o=0;await Promise.all(a.map(async t=>{try{(await fetch("/api/approvals",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t.id,action:e})})).ok?i++:o++}catch(e){o++}})),g(!1),h(new Set),0===o?t.success("".concat(i," ").concat(e,"d.")):t.error("".concat(i," ok \xb7 ").concat(o," failed"))}return(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:_.B},children:[(0,a.jsx)(ee,{section:"\xa7 APPROVALS".concat(S>0?" \xb7 ".concat(S," PENDING"):""),title:"One tap to ship.",subtitle:"Drafts, replies, and actions waiting for your sign-off.",actions:(0,a.jsx)("div",{style:{display:"flex",gap:4},children:["pending","all"].map(e=>(0,a.jsx)("button",{onClick:()=>r(e),style:{padding:"5px 10px",fontFamily:_.FM,fontSize:9,letterSpacing:"0.1em",textTransform:"uppercase",border:"1px solid ".concat(l===e?_.EM:_.BR),background:l===e?_.EM3:"transparent",color:l===e?_.EM:_.T4,cursor:"pointer",borderRadius:2},children:e},e))})}),u.size>0&&(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",padding:"10px 28px",background:_.S,borderBottom:"1px solid ".concat(_.BR),fontFamily:_.FM,fontSize:11,color:_.T2},children:[(0,a.jsxs)("span",{style:{color:_.EM},children:[u.size," selected"]}),(0,a.jsxs)("div",{style:{marginLeft:"auto",display:"flex",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)(en,{size:"sm",variant:"primary",disabled:m,onClick:()=>w("approve"),children:"Approve selected"}),(0,a.jsx)(en,{size:"sm",variant:"danger",disabled:m,onClick:()=>w("reject"),children:"Reject selected"}),(0,a.jsx)(en,{size:"sm",onClick:()=>h(new Set),children:"Clear"})]})]}),(null!=n?n:[]).filter(e=>"pending"===e.status).length>1&&"pending"===l&&(0,a.jsx)("div",{style:{padding:"8px 28px",fontFamily:_.FM,fontSize:10,color:_.T5,borderBottom:"1px solid ".concat(_.BR2)},children:(0,a.jsx)("button",{onClick:function(){let e=(null!=n?n:[]).filter(e=>"pending"===e.status).map(e=>e.id);h(t=>e.every(e=>t.has(e))?new Set:new Set(e))},style:{background:"none",border:"none",color:_.T4,cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.1em",padding:0},children:u.size===(null!=n?n:[]).filter(e=>"pending"===e.status).length?"Unselect all":"Select all pending"})}),(0,a.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"24px 28px"},children:[null===n&&(0,a.jsx)(ei,{variant:"card",count:3}),null!==n&&0===j.length&&(0,a.jsx)(el,{icon:"✓",title:"Inbox zero.",body:"No drafts pending right now. New work from your agents lands here for review."}),(0,a.jsx)("div",{"data-mobile-grid-stack":!0,style:{display:"grid",gap:16,maxWidth:880,margin:"0 auto"},children:j.map(e=>{let t="pending"===e.status,n=(null==s?void 0:s.id)===e.id,i="pending"===e.status?_.EM:"sent"===e.status?"#2f5b3b":"rejected"===e.status?"#a52a1a":_.T4,o=x.has(e.id);return(0,a.jsxs)("div",{id:"approval-".concat(e.id),className:o?"sse-flash":void 0,style:{border:"1px solid ".concat(o?_.EM:_.BR),background:_.S,borderRadius:3,padding:"18px 22px",position:"relative",transition:"border-color 1.6s ease-out"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:12},children:[t&&(0,a.jsx)("input",{type:"checkbox",checked:u.has(e.id),onChange:()=>{var t;return t=e.id,void h(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},"aria-label":"select for bulk action",style:{width:16,height:16,accentColor:_.EM,cursor:"pointer",flexShrink:0}}),e.meta.channel&&(0,a.jsx)(ea,{channel:e.meta.channel}),(0,a.jsxs)("div",{style:{flex:1},children:[(0,a.jsx)("div",{title:e.title,style:{fontFamily:_.FD,fontSize:18,fontWeight:500,color:_.T1,letterSpacing:"-0.01em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:2},children:[e.agentId," \xb7 ",e.type," \xb7 ",Z(e.createdAt)]})]}),(0,a.jsx)(et,{color:i,children:e.status})]}),e.inboxMessageId&&y[e.inboxMessageId]&&(0,a.jsx)(ep,{msg:y[e.inboxMessageId],defaultOpen:t}),n?(0,a.jsx)("textarea",{value:s.body,onChange:t=>d({id:e.id,body:t.target.value}),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&"Enter"===t.key&&(t.preventDefault(),c!==e.id&&k(e.id,"edit",s.body)),"Escape"===t.key&&(t.preventDefault(),d(null))},rows:Math.max(6,s.body.split("\n").length+1),autoFocus:!0,style:{width:"100%",padding:"12px 14px",background:_.B,border:"1px solid ".concat(_.BR),borderRadius:2,color:_.T1,fontFamily:_.FB,fontSize:13,lineHeight:1.55,resize:"vertical"}}):(0,a.jsx)("div",{style:{padding:"12px 14px",background:_.B,border:"1px solid ".concat(_.BR2),borderRadius:2,fontSize:13,lineHeight:1.55,color:_.T2,fontFamily:_.FB,whiteSpace:"pre-wrap",maxHeight:280,overflowY:"auto"},children:e.body}),e.meta.to&&(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:8},children:["to: ",e.meta.to]}),e.meta.subject&&(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:2},children:["subject: ",e.meta.subject]}),t&&(0,a.jsx)("div",{style:{marginTop:14,display:"flex",gap:8,flexWrap:"wrap"},children:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(en,{variant:"primary",disabled:c===e.id,onClick:()=>k(e.id,"edit",s.body),children:"Save & send \xb7 ⌘↵"}),(0,a.jsx)(en,{onClick:()=>d(null),children:"Cancel \xb7 esc"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(en,{variant:"primary",disabled:c===e.id,onClick:()=>k(e.id,"approve"),children:"Approve & send"}),(0,a.jsx)(en,{onClick:()=>d({id:e.id,body:e.body}),children:"Edit"}),(0,a.jsx)(en,{variant:"danger",disabled:c===e.id,onClick:()=>k(e.id,"reject"),children:"Reject"})]})})]},e.id)})})]})]})}function ep(e){let{msg:t,defaultOpen:n}=e,[o,l]=(0,i.useState)(n);return(0,a.jsxs)("div",{style:{marginBottom:10,border:"1px dashed ".concat(_.BR),borderRadius:2,background:_.B},children:[(0,a.jsxs)("button",{onClick:()=>l(e=>!e),style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 12px",background:"transparent",border:"none",cursor:"pointer",fontFamily:_.FM,fontSize:9,letterSpacing:"0.12em",color:_.T4,textTransform:"uppercase",textAlign:"left"},children:[(0,a.jsx)(ea,{channel:t.channel}),(0,a.jsxs)("span",{children:["From ",t.fromName,t.fromHandle?" \xb7 ".concat(t.fromHandle):""]}),(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:11},children:o?"▾":"▸"})]}),o&&(0,a.jsx)("div",{style:{padding:"10px 14px",borderTop:"1px solid ".concat(_.BR2),fontSize:13,lineHeight:1.55,color:_.T2,fontFamily:_.FB,whiteSpace:"pre-wrap",maxHeight:200,overflowY:"auto"},children:t.text})]})}function eu(e){let{toast:t}=e,[n,o]=(0,i.useState)(null),[l,r]=(0,i.useState)(null),[s,d]=(0,i.useState)("contacts"),[c,p]=(0,i.useState)(null),[u,h]=(0,i.useState)(null),m=(0,i.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/contacts").then(e=>e.json()),fetch("/api/routing").then(e=>e.json())]);o(e.contacts),r(t.rules)}catch(e){t.error(e instanceof Error?e.message:"load failed"),o([]),r([])}},[t]);async function g(e){try{let n=await fetch("/api/contacts",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({contacts:e})});if(!n.ok)throw Error("HTTP ".concat(n.status));o(e),t.success("Saved.")}catch(e){t.error(e instanceof Error?e.message:"save failed")}}async function x(e){try{let n=await fetch("/api/routing",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({rules:e})});if(!n.ok)throw Error("HTTP ".concat(n.status));r(e),t.success("Saved.")}catch(e){t.error(e instanceof Error?e.message:"save failed")}}return(0,i.useEffect)(()=>{m()},[m]),(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:_.B},children:[(0,a.jsx)(ee,{section:"\xa7 ROSTER & ROUTING",title:"Who talks to whom.",subtitle:"Drivers, clients, and the rules that point their messages at the right agent.",actions:(0,a.jsx)("div",{style:{display:"flex",gap:4},children:["contacts","routing"].map(e=>(0,a.jsx)("button",{onClick:()=>d(e),style:{padding:"5px 10px",fontFamily:_.FM,fontSize:9,letterSpacing:"0.1em",textTransform:"uppercase",border:"1px solid ".concat(s===e?_.EM:_.BR),background:s===e?_.EM3:"transparent",color:s===e?_.EM:_.T4,cursor:"pointer",borderRadius:2},children:e},e))})}),(0,a.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"24px 28px"},children:"contacts"===s?(0,a.jsxs)("div",{style:{maxWidth:880,margin:"0 auto"},children:[(0,a.jsx)("div",{style:{marginBottom:16,display:"flex",justifyContent:"flex-end"},children:(0,a.jsx)(en,{variant:"primary",onClick:()=>p({id:crypto.randomUUID(),clientId:"",name:"",channels:{},tags:[],createdAt:Date.now()}),children:"+ Add contact"})}),null===n&&(0,a.jsx)(ei,{variant:"row",count:4}),null!==n&&0===n.length&&!c&&(0,a.jsx)(el,{icon:"◇",title:"No contacts yet.",body:"Add your drivers, dispatch leads, and clients here so the dashboard knows who's messaging."}),(0,a.jsx)("div",{style:{display:"grid",gap:12},children:null==n?void 0:n.map(e=>(0,a.jsxs)("div",{style:{background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,padding:"14px 18px",display:"grid",gridTemplateColumns:"1fr auto",alignItems:"center",gap:16},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:_.FB,fontSize:14,fontWeight:600,color:_.T1},children:e.name}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:2},children:[e.role&&"".concat(e.role," \xb7 "),e.company]}),(0,a.jsxs)("div",{style:{marginTop:6,display:"flex",gap:6,flexWrap:"wrap"},children:[e.channels.telegram&&(0,a.jsxs)(et,{color:"#0088cc",children:["TG ",e.channels.telegram]}),e.channels.whatsapp&&(0,a.jsxs)(et,{color:"#25d366",children:["WA ",e.channels.whatsapp]}),e.channels.email&&(0,a.jsxs)(et,{children:["EM ",e.channels.email]}),e.tags.map(e=>(0,a.jsx)(et,{children:e},e))]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,a.jsx)(en,{size:"sm",onClick:()=>p(e),children:"Edit"}),(0,a.jsx)(en,{size:"sm",variant:"danger",onClick:()=>g(n.filter(t=>t.id!==e.id)),children:"Remove"})]})]},e.id))}),c&&(0,a.jsx)(eh,{contact:c,onCancel:()=>p(null),onSave:async e=>{let t=null!=n?n:[],a=t.find(t=>t.id===e.id);await g(a?t.map(t=>t.id===e.id?e:t):[...t,e]),p(null)}})]}):(0,a.jsxs)("div",{style:{maxWidth:880,margin:"0 auto"},children:[(0,a.jsx)("div",{style:{marginBottom:16,display:"flex",justifyContent:"flex-end"},children:(0,a.jsx)(en,{variant:"primary",onClick:()=>h({id:crypto.randomUUID(),clientId:"",channel:"telegram",match:{},agentId:"coo",requireApproval:!0,enabled:!0,createdAt:Date.now()}),children:"+ Add rule"})}),null===l&&(0,a.jsx)(ei,{variant:"row",count:3}),null!==l&&0===l.length&&!u&&(0,a.jsx)(el,{icon:"⤳",title:"No routing rules yet.",body:"Tell the dashboard which Telegram chats go to which agent. Without a rule, messages sit in the inbox unrouted."}),(0,a.jsx)("div",{style:{display:"grid",gap:12},children:null==l?void 0:l.map(e=>(0,a.jsxs)("div",{style:{background:_.S,border:"1px solid ".concat(e.enabled?_.BR:_.BR2),borderRadius:3,padding:"14px 18px",display:"grid",gridTemplateColumns:"1fr auto",alignItems:"center",gap:16,opacity:e.enabled?1:.55},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:11,color:_.T1,letterSpacing:"0.04em"},children:[e.channel.toUpperCase(),e.match.chatId&&(0,a.jsxs)("span",{style:{color:_.T3},children:[" \xb7 chat ",e.match.chatId]}),e.match.keyword&&(0,a.jsxs)("span",{style:{color:_.T3},children:[' \xb7 keyword "',e.match.keyword,'"']}),(0,a.jsx)("span",{style:{color:_.T4},children:" → "}),(0,a.jsx)("span",{style:{color:_.EM},children:e.agentId})]}),(0,a.jsxs)("div",{style:{marginTop:6,display:"flex",gap:6},children:[(0,a.jsx)(et,{color:e.requireApproval?_.EM:"#2f5b3b",children:e.requireApproval?"approval gate":"auto-send"}),(0,a.jsx)(et,{children:e.enabled?"enabled":"disabled"})]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,a.jsx)(en,{size:"sm",onClick:()=>h(e),children:"Edit"}),(0,a.jsx)(en,{size:"sm",onClick:()=>x(l.map(t=>t.id===e.id?{...t,enabled:!t.enabled}:t)),children:e.enabled?"Disable":"Enable"}),(0,a.jsx)(en,{size:"sm",variant:"danger",onClick:()=>x(l.filter(t=>t.id!==e.id)),children:"Remove"})]})]},e.id))}),u&&(0,a.jsx)(em,{rule:u,onCancel:()=>h(null),onSave:async e=>{let t=null!=l?l:[],n=t.find(t=>t.id===e.id);await x(n?t.map(t=>t.id===e.id?e:t):[...t,e]),h(null)}})]})})]})}function eh(e){var t,n,o,l,r;let{contact:s,onCancel:d,onSave:c}=e,[p,u]=(0,i.useState)(s);return(0,a.jsxs)("div",{style:{marginTop:18,padding:20,background:_.S,border:"1px solid ".concat(_.EM),borderRadius:3},children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:18,color:_.T1,marginBottom:14,letterSpacing:"-0.01em"},children:s.name?"Edit contact":"New contact"}),(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,a.jsx)(eg,{label:"Name",children:(0,a.jsx)("input",{value:p.name,onChange:e=>u({...p,name:e.target.value}),style:ex})}),(0,a.jsx)(eg,{label:"Role",children:(0,a.jsx)("input",{value:null!=(t=p.role)?t:"",onChange:e=>u({...p,role:e.target.value}),style:ex})}),(0,a.jsx)(eg,{label:"Company",children:(0,a.jsx)("input",{value:null!=(n=p.company)?n:"",onChange:e=>u({...p,company:e.target.value}),style:ex})}),(0,a.jsx)(eg,{label:"Tags (comma-separated)",children:(0,a.jsx)("input",{value:p.tags.join(", "),onChange:e=>u({...p,tags:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}),style:ex})}),(0,a.jsx)(eg,{label:"Telegram (@handle)",children:(0,a.jsx)("input",{value:null!=(o=p.channels.telegram)?o:"",onChange:e=>u({...p,channels:{...p.channels,telegram:e.target.value}}),style:ex,placeholder:"@username"})}),(0,a.jsx)(eg,{label:"WhatsApp (+ number)",children:(0,a.jsx)("input",{value:null!=(l=p.channels.whatsapp)?l:"",onChange:e=>u({...p,channels:{...p.channels,whatsapp:e.target.value}}),style:ex,placeholder:"+61..."})}),(0,a.jsx)(eg,{label:"Email",children:(0,a.jsx)("input",{value:null!=(r=p.channels.email)?r:"",onChange:e=>u({...p,channels:{...p.channels,email:e.target.value}}),style:ex})})]}),(0,a.jsxs)("div",{style:{marginTop:14,display:"flex",gap:8},children:[(0,a.jsx)(en,{variant:"primary",onClick:()=>c(p),disabled:!p.name.trim(),children:"Save"}),(0,a.jsx)(en,{onClick:d,children:"Cancel"})]})]})}function em(e){var t,n;let{rule:o,onCancel:s,onSave:d}=e,[c,p]=(0,i.useState)(o);return(0,a.jsxs)("div",{style:{marginTop:18,padding:20,background:_.S,border:"1px solid ".concat(_.EM),borderRadius:3},children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:18,color:_.T1,marginBottom:14,letterSpacing:"-0.01em"},children:o.match.chatId||o.match.keyword?"Edit rule":"New rule"}),(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,a.jsx)(eg,{label:"Channel",children:(0,a.jsxs)("select",{value:c.channel,onChange:e=>p({...c,channel:e.target.value}),style:ex,children:[(0,a.jsx)("option",{value:"telegram",children:"Telegram"}),(0,a.jsx)("option",{value:"whatsapp",children:"WhatsApp"}),(0,a.jsx)("option",{value:"email",children:"Email"})]})}),(0,a.jsx)(eg,{label:"Route to agent",children:(0,a.jsx)("select",{value:c.agentId,onChange:e=>p({...c,agentId:e.target.value}),style:ex,children:r.map(e=>(0,a.jsx)("option",{value:e,children:l[e].name},e))})}),(0,a.jsx)(eg,{label:"Match: chat ID (optional)",children:(0,a.jsx)("input",{value:null!=(t=c.match.chatId)?t:"",onChange:e=>p({...c,match:{...c.match,chatId:e.target.value||void 0}}),style:ex,placeholder:"e.g. 1663098725"})}),(0,a.jsx)(eg,{label:"Match: keyword (optional)",children:(0,a.jsx)("input",{value:null!=(n=c.match.keyword)?n:"",onChange:e=>p({...c,match:{...c.match,keyword:e.target.value||void 0}}),style:ex,placeholder:"e.g. delay"})}),(0,a.jsx)(eg,{label:"Approval gate",children:(0,a.jsxs)("select",{value:c.requireApproval?"yes":"no",onChange:e=>p({...c,requireApproval:"yes"===e.target.value}),style:ex,children:[(0,a.jsx)("option",{value:"yes",children:"Yes — require approval before reply"}),(0,a.jsx)("option",{value:"no",children:"No — auto-send the reply"})]})}),(0,a.jsx)(eg,{label:"Enabled",children:(0,a.jsxs)("select",{value:c.enabled?"yes":"no",onChange:e=>p({...c,enabled:"yes"===e.target.value}),style:ex,children:[(0,a.jsx)("option",{value:"yes",children:"Yes"}),(0,a.jsx)("option",{value:"no",children:"No"})]})})]}),(0,a.jsxs)("div",{style:{marginTop:14,display:"flex",gap:8},children:[(0,a.jsx)(en,{variant:"primary",onClick:()=>d(c),children:"Save"}),(0,a.jsx)(en,{onClick:s,children:"Cancel"})]})]})}function eg(e){let{label:t,children:n}=e;return(0,a.jsxs)("label",{style:{display:"block"},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.12em",textTransform:"uppercase",marginBottom:4},children:t}),n]})}let ex={width:"100%",padding:"8px 10px",background:_.B,border:"1px solid ".concat(_.BR),color:_.T1,fontFamily:_.FB,fontSize:13,borderRadius:2,outline:"none"};function ef(e){let{toast:t,onSelectAgent:n}=e,[o,l]=(0,i.useState)(null),[r,s]=(0,i.useState)(null);(0,i.useEffect)(()=>{fetch("/api/templates").then(e=>e.json()).then(e=>{l(e.templates);try{let t=localStorage.getItem("leedab-pending-template"),n=localStorage.getItem("leedab-pending-template-context");if(t){let a=e.templates.find(e=>e.id===t);if(a){let e={},t=a.inputs.find(e=>"textarea"===e.type);t&&n&&(e[t.name]=n),s({template:a,vars:e})}localStorage.removeItem("leedab-pending-template"),localStorage.removeItem("leedab-pending-template-context")}}catch(e){}}).catch(e=>{var n;t.error(null!=(n=e.message)?n:"load failed"),l([])})},[t]);let d=(null!=o?o:[]).reduce((e,t)=>{var n,a;return(null!=(a=e[n=t.category])?a:e[n]=[]).push(t),e},{});async function c(){if(r){s({...r,loading:!0});try{var e;let t=r.template.promptTemplate.replace(/\{(\w+)\}/g,(e,t)=>{var n;return null!=(n=r.vars[t])?n:"{".concat(t,"}")}),n=await fetch("/api/agent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:r.template.agentId,message:t})}),a=await n.json();if(!n.ok)throw Error(null!=(e=a.error)?e:"HTTP ".concat(n.status));s({...r,output:a.response,loading:!1})}catch(e){t.error(e instanceof Error?e.message:"run failed"),s({...r,loading:!1})}}}return(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:_.B},children:[(0,a.jsx)(ee,{section:"\xa7 TEMPLATES",title:"Pre-built workflows.",subtitle:"One-click runs for the things logistics ops do every day."}),(0,a.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"24px 28px"},children:[null===o&&(0,a.jsx)("div",{style:{maxWidth:1100,margin:"0 auto"},children:(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:12},children:Array.from({length:6}).map((e,t)=>(0,a.jsxs)("div",{style:{padding:18,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsx)("span",{className:"skel-shimmer",style:{display:"block",width:"55%",height:14,borderRadius:2,background:"var(--paper-2)"}}),(0,a.jsx)("span",{className:"skel-shimmer",style:{display:"block",width:"100%",height:9,borderRadius:2,background:"var(--paper-2)"}}),(0,a.jsx)("span",{className:"skel-shimmer",style:{display:"block",width:"80%",height:9,borderRadius:2,background:"var(--paper-2)"}})]},t))})}),null!==o&&0===o.length&&(0,a.jsx)(el,{title:"No workflows yet."}),Object.entries(d).map(e=>{let[t,n]=e;return(0,a.jsxs)("div",{style:{marginBottom:32,maxWidth:1100,margin:"0 auto 32px"},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:11,color:_.EM,letterSpacing:"0.14em",marginBottom:10,textTransform:"uppercase"},children:t}),(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:12},children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>s({template:e,vars:{}}),style:{textAlign:"left",padding:18,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,cursor:"pointer",color:_.T1,transition:"all 0.15s"},children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:18,fontWeight:500,color:_.T1,marginBottom:6,letterSpacing:"-0.01em"},children:e.name}),(0,a.jsx)("div",{style:{fontSize:12,color:_.T3,lineHeight:1.5,marginBottom:12,fontFamily:_.FB},children:e.description}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,a.jsx)(et,{color:_.EM,children:e.agentId}),(0,a.jsxs)(et,{children:["→ ",e.outputType]})]})]},e.id))})]},t)}),null!==o&&o.length>0&&(0,a.jsx)("div",{style:{maxWidth:1100,margin:"0 auto"},children:(0,a.jsxs)("a",{href:"https://leedab.com/contact",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:18,background:"transparent",border:"1px dashed ".concat(_.BR),borderRadius:3,color:_.T3,textDecoration:"none",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.borderColor=_.EM,e.currentTarget.style.color=_.T1},onMouseLeave:e=>{e.currentTarget.style.borderColor=_.BR,e.currentTarget.style.color=_.T3},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:18,fontWeight:500,letterSpacing:"-0.01em"},children:"Request more workflows"}),(0,a.jsx)("div",{style:{fontSize:12,color:_.T4,marginTop:4,fontFamily:_.FB},children:"Tell us what you need built. We'll ship it for your team."})]}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:11,letterSpacing:"0.14em",color:_.EM},children:"leedab.com/contact →"})]})})]}),r&&(0,a.jsx)("div",{onClick:()=>r.loading||s(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:720,maxHeight:"85vh",overflowY:"auto",background:_.B,border:"1px solid ".concat(_.BR),borderRadius:4,padding:28},children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:26,fontWeight:500,color:_.T1,letterSpacing:"-0.02em",marginBottom:6},children:r.template.name}),(0,a.jsx)("div",{style:{fontSize:13,color:_.T3,marginBottom:22,fontFamily:_.FB},children:r.template.description}),r.output?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.EM,letterSpacing:"0.12em",marginBottom:8,textTransform:"uppercase"},children:"Result"}),(0,a.jsx)("div",{style:{padding:"14px 16px",background:_.S,border:"1px solid ".concat(_.BR),borderRadius:2,fontSize:13,color:_.T1,fontFamily:_.FB,lineHeight:1.55,whiteSpace:"pre-wrap",maxHeight:360,overflowY:"auto",marginBottom:16},children:r.output}),(0,a.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,a.jsx)(en,{onClick:()=>{var e;return navigator.clipboard.writeText(null!=(e=r.output)?e:"")},children:"Copy"}),(0,a.jsx)(en,{onClick:()=>s({template:r.template,vars:r.vars}),children:"Run again"}),(0,a.jsx)(en,{onClick:()=>s(null),children:"Close"})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:{display:"grid",gap:12,marginBottom:18},children:[r.template.inputs.map(e=>{var t,n;return(0,a.jsxs)("label",{children:[(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.12em",textTransform:"uppercase",marginBottom:4},children:[e.label,e.required&&" *"]}),"textarea"===e.type?(0,a.jsx)("textarea",{value:null!=(t=r.vars[e.name])?t:"",onChange:t=>s({...r,vars:{...r.vars,[e.name]:t.target.value}}),rows:5,style:{width:"100%",padding:"10px 12px",background:_.S,border:"1px solid ".concat(_.BR),color:_.T1,fontFamily:_.FB,fontSize:13,borderRadius:2,outline:"none",resize:"vertical"}}):(0,a.jsx)("input",{value:null!=(n=r.vars[e.name])?n:"",onChange:t=>s({...r,vars:{...r.vars,[e.name]:t.target.value}}),style:{width:"100%",padding:"8px 12px",background:_.S,border:"1px solid ".concat(_.BR),color:_.T1,fontFamily:_.FB,fontSize:13,borderRadius:2,outline:"none"}})]},e.name)}),0===r.template.inputs.length&&(0,a.jsx)("div",{style:{fontSize:13,color:_.T4,fontFamily:_.FB},children:"This template takes no inputs — just hit Run."})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,a.jsx)(en,{variant:"primary",disabled:r.loading,onClick:c,children:r.loading?"Running…":"Run"}),(0,a.jsx)(en,{onClick:()=>s(null),disabled:r.loading,children:"Close"}),(0,a.jsx)(en,{onClick:()=>n(r.template.agentId),disabled:r.loading,children:"Open in chat"})]})]})]})})]})}function ey(){let[e,t]=(0,i.useState)(null),[n,o]=(0,i.useState)(null),l=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/runs");if(!e.ok)throw Error("HTTP ".concat(e.status));let n=await e.json();t(n.runs),o(n.metrics)}catch(e){t([]),o(null)}},[]);return(0,i.useEffect)(()=>{l()},[l]),(0,i.useEffect)(()=>{let e=setInterval(l,8e3);return()=>clearInterval(e)},[l]),(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:_.B},children:[(0,a.jsx)(ee,{section:"\xa7 RUNS",title:"Every action, logged.",subtitle:"What ran, when, how long, how much it cost, how much time it saved."}),n&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",borderBottom:"1px solid ".concat(_.BR),flexShrink:0},children:[{label:"TOTAL RUNS",value:n.totalRuns.toString()},{label:"SUCCESS RATE",value:"".concat((100*n.successRate).toFixed(0),"%")},{label:"AVG DURATION",value:"".concat((n.avgDurationMs/1e3).toFixed(1),"s")},{label:"EST. COST",value:"$".concat(n.totalCost.toFixed(2))},{label:"TIME SAVED",value:"".concat(Math.round(n.totalMinutesSaved),"m")}].map(e=>(0,a.jsxs)("div",{style:{padding:"20px 24px",borderRight:"1px solid ".concat(_.BR2)},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em"},children:e.label}),(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:32,fontWeight:500,color:_.T1,letterSpacing:"-0.02em",marginTop:4},children:e.value})]},e.label))}),(0,a.jsxs)("div",{style:{flex:1,overflowY:"auto"},children:[null===e&&(0,a.jsx)(ei,{variant:"list-row",count:6}),null!==e&&0===e.length&&(0,a.jsx)(el,{icon:"◌",title:"No runs yet.",body:"Each agent task or workflow execution will appear here with timing and cost."}),e&&e.length>0&&(0,a.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:_.FM,fontSize:12},children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{style:{borderBottom:"1px solid ".concat(_.BR)},children:["TIME","AGENT","TRIGGER","STATUS","DURATION","TOKENS","COST"].map(e=>(0,a.jsx)("th",{style:{textAlign:"left",padding:"12px 18px",fontSize:9,color:_.T5,letterSpacing:"0.14em",fontWeight:400},children:e},e))})}),(0,a.jsx)("tbody",{children:e.map(e=>{var t;let n="success"===e.status?"#2f5b3b":"error"===e.status?"#a52a1a":"running"===e.status?_.EM:_.T4;return(0,a.jsxs)("tr",{style:{borderBottom:"1px solid ".concat(_.BR2),color:_.T2},children:[(0,a.jsx)("td",{style:{padding:"10px 18px"},children:Z(e.startedAt)}),(0,a.jsx)("td",{style:{padding:"10px 18px",color:_.T1,fontWeight:500},children:e.agentId}),(0,a.jsx)("td",{style:{padding:"10px 18px"},children:e.triggerType}),(0,a.jsx)("td",{style:{padding:"10px 18px"},children:(0,a.jsx)(et,{color:n,children:e.status})}),(0,a.jsx)("td",{style:{padding:"10px 18px"},children:e.durationMs?"".concat((e.durationMs/1e3).toFixed(1),"s"):"—"}),(0,a.jsx)("td",{style:{padding:"10px 18px"},children:e.inputTokens?"".concat(e.inputTokens,"/").concat(null!=(t=e.outputTokens)?t:0):"—"}),(0,a.jsx)("td",{style:{padding:"10px 18px",color:_.EM},children:e.estimatedCost?"$".concat(e.estimatedCost.toFixed(4)):"—"})]},e.id)})})]})]})]})}function ev(){let[e,t]=(0,i.useState)([]);return((0,i.useEffect)(()=>{let e=!1;async function n(){try{let[a,i,o]=await Promise.all([fetch("/api/runs?limit=5").then(e=>e.json()),fetch("/api/inbox?limit=5").then(e=>e.json()),fetch("/api/approvals?status=pending&limit=5").then(e=>e.json())]);if(e)return;let l=[];for(let e of a.runs){var n;l.push({id:"run-".concat(e.id),ts:e.startedAt,kind:"run",text:"".concat(e.agentId.toUpperCase()," ran via ").concat(e.triggerType," — ").concat("success"===e.status?"".concat((null!=(n=e.durationMs)?n:0)/1e3,"s"):e.status),tone:"error"===e.status?"warn":"running"===e.status?"live":"ok"})}for(let e of i.messages)l.push({id:"in-".concat(e.id),ts:e.timestamp,kind:"inbox",text:"".concat(e.channel.toUpperCase()," message from ").concat(e.fromName," — ").concat(e.text.slice(0,60)).concat(e.text.length>60?"…":""),tone:"new"===e.status?"live":"ok"});for(let e of o.approvals)l.push({id:"app-".concat(e.id),ts:e.createdAt,kind:"approval",text:"Approval pending — ".concat(e.title),tone:"warn"});l.sort((e,t)=>t.ts-e.ts),t(l.slice(0,12))}catch(e){}}n();let a=setInterval(n,8e3);return()=>{e=!0,clearInterval(a)}},[]),0===e.length)?null:(0,a.jsxs)("div",{"data-mobile-hide":!0,style:{display:"flex",alignItems:"center",gap:0,padding:"0 28px",height:28,borderBottom:"1px solid ".concat(_.BR2),background:_.B,flexShrink:0,overflow:"hidden",whiteSpace:"nowrap",fontFamily:_.FM,fontSize:11},children:[(0,a.jsx)("span",{style:{fontSize:9,color:_.T6,letterSpacing:"0.14em",marginRight:14,textTransform:"uppercase",flexShrink:0},children:"● LIVE"}),(0,a.jsx)("div",{style:{display:"inline-flex",gap:28,animation:"tick 60s linear infinite",paddingLeft:0},children:[...e,...e].map((e,t)=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,color:_.T3},children:[(0,a.jsx)("span",{style:{fontSize:8,padding:"1px 6px",border:"1px solid ".concat("live"===e.tone?_.EM:"warn"===e.tone?"#a52a1a":"#2f5b3b"),color:"live"===e.tone?_.EM:"warn"===e.tone?"#a52a1a":"#2f5b3b",letterSpacing:"0.1em",textTransform:"uppercase"},children:e.kind}),(0,a.jsx)("span",{children:e.text}),(0,a.jsxs)("span",{style:{color:_.T6},children:["\xb7 ",Z(e.ts)]}),(0,a.jsx)("span",{style:{color:_.T7},children:"◆"})]},"".concat(e.id,"-").concat(t)))})]})}let eb={click:"CLICK",type:"TYPE",scroll:"SCROLL",extract:"EXTRACT",wait:"WAIT",navigate:"NAVIGATE"},ej={click:"#6b85a0",type:"#8a6e9e",scroll:"#7a8e5a",extract:_.EM,wait:"#9a9081",navigate:"#4a7c8a"};function eS(e){let{toast:t,onSelectAgent:n}=e,[o,l]=(0,i.useState)(null),[r,s]=(0,i.useState)(null),[d,c]=(0,i.useState)(0),p=(0,i.useCallback)((e,t)=>{if("snapshot"===e){let{sessions:e}=t;l(e);return}return"created"===e?void l(e=>e?[t,...e.filter(e=>e.id!==t.id)]:[t]):"updated"===e?void l(e=>e?e.map(e=>e.id===t.id?t:e):e):void 0},[]);(0,i.useEffect)(()=>{fetch("/api/computer-use?limit=50").then(e=>e.json()).then(e=>l(e.sessions)).catch(()=>l([]))},[]),er(null,["snapshot","created","updated"],p);let u=(0,i.useMemo)(()=>{var e;return null!=(e=(null!=o?o:[]).find(e=>e.id===r))?e:null},[o,r]);(0,i.useEffect)(()=>{!r&&o&&o.length>0&&s(o[0].id)},[o,r]),(0,i.useEffect)(()=>{c(0)},[r]);let h=(null!=o?o:[]).filter(e=>"running"===e.status).length;return(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:_.B},children:[(0,a.jsx)(ee,{section:"\xa7 COMPUTER USE".concat(h>0?" \xb7 ".concat(h," LIVE"):""),title:"What the agent actually did.",subtitle:"Step-by-step replay of every action the agent took on your customer's software."}),(0,a.jsxs)("div",{"data-mobile-stack":!0,style:{flex:1,display:"flex",overflow:"hidden"},children:[(0,a.jsxs)("div",{"data-mobile-fullwidth":!0,style:{width:360,borderRight:"1px solid ".concat(_.BR),overflowY:"auto",flexShrink:0},children:[null===o&&(0,a.jsx)(ei,{variant:"row",count:4}),null!==o&&0===o.length&&(0,a.jsx)(el,{icon:"◫",title:"No sessions yet.",body:"Computer-use sessions appear here as agents drive your tools. Try the DEMO toggle to load a few."}),null==o?void 0:o.map(e=>{var t,n;let i=null==(t=[...e.steps].reverse().find(e=>e.screenshotUrl))?void 0:t.screenshotUrl,o=r===e.id;return(0,a.jsxs)("button",{onClick:()=>s(e.id),style:{display:"block",width:"100%",textAlign:"left",padding:"12px 16px",background:o?_.EM3:"transparent",borderTop:"none",borderRight:"none",borderBottom:"1px solid ".concat(_.BR2),borderLeft:"3px solid ".concat("running"===e.status?_.EM:"error"===e.status?"#a52a1a":"transparent"),cursor:"pointer",color:_.T1},children:[(0,a.jsxs)("div",{style:{display:"flex",gap:10,marginBottom:6},children:[i&&(0,a.jsx)("img",{src:i,alt:"",style:{width:56,height:36,objectFit:"cover",borderRadius:2,border:"1px solid ".concat(_.BR2),flexShrink:0}}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{title:e.taskTitle,style:{fontSize:12,fontWeight:600,fontFamily:_.FB,color:_.T1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.taskTitle}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,marginTop:2},children:[e.agentId," \xb7 ",null!=(n=e.surface)?n:"—"," \xb7 ",Z(e.startedAt)]})]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[(0,a.jsx)(et,{color:"running"===e.status?_.EM:"error"===e.status?"#a52a1a":"#2f5b3b",children:e.status}),(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T5},children:[e.steps.length," step",1===e.steps.length?"":"s"]}),e.finishedAt&&(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T5},children:["\xb7 ",Math.round((e.finishedAt-e.startedAt)/1e3),"s"]})]})]},e.id)})]}),(0,a.jsx)("div",{style:{flex:1,overflowY:"auto"},children:u?(0,a.jsx)(ek,{session:u,stepIdx:d,onStepChange:c}):(0,a.jsx)(el,{icon:"◫",title:"Select a session.",body:"Pick a session on the left to scrub through it."})})]})]})}function ek(e){var t;let{session:n,stepIdx:i,onStepChange:o}=e,l=Math.min(i,n.steps.length-1),r=n.steps[l];return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,a.jsxs)("div",{style:{padding:"20px 28px 14px",borderBottom:"1px solid ".concat(_.BR),flexShrink:0},children:[(0,a.jsx)("div",{style:{fontFamily:_.FD,fontSize:22,fontWeight:500,color:_.T1,letterSpacing:"-0.01em"},children:n.taskTitle}),n.taskDescription&&(0,a.jsx)("div",{style:{fontSize:13,color:_.T3,marginTop:4,fontFamily:_.FB,lineHeight:1.55},children:n.taskDescription}),(0,a.jsxs)("div",{style:{display:"flex",gap:10,marginTop:10,fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.1em"},children:[(0,a.jsxs)("span",{children:["AGENT \xb7 ",n.agentId.toUpperCase()]}),(0,a.jsxs)("span",{children:["SURFACE \xb7 ",(null!=(t=n.surface)?t:"—").toUpperCase()]}),(0,a.jsxs)("span",{children:["STARTED \xb7 ",new Date(n.startedAt).toLocaleString()]}),n.finishedAt&&(0,a.jsxs)("span",{children:["DURATION \xb7 ",Math.round((n.finishedAt-n.startedAt)/1e3),"S"]})]})]}),(0,a.jsxs)("div",{style:{flex:1,padding:"20px 28px",overflowY:"auto",display:"flex",flexDirection:"column",gap:14},children:[(null==r?void 0:r.screenshotUrl)?(0,a.jsx)("img",{src:r.screenshotUrl,alt:r.description,style:{width:"100%",maxWidth:880,alignSelf:"center",borderRadius:4,border:"1px solid ".concat(_.BR),boxShadow:"0 4px 24px rgba(26,23,19,0.10)",background:_.S}}):(0,a.jsx)("div",{style:{width:"100%",maxWidth:880,alignSelf:"center",height:360,borderRadius:4,border:"1px dashed ".concat(_.BR),display:"flex",alignItems:"center",justifyContent:"center",color:_.T5,fontFamily:_.FM,fontSize:11,letterSpacing:"0.1em"},children:"NO SCREENSHOT FOR THIS STEP"}),r&&(0,a.jsxs)("div",{style:{maxWidth:880,alignSelf:"center",width:"100%",display:"flex",gap:10,alignItems:"flex-start"},children:[(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,letterSpacing:"0.12em",color:ej[r.action],padding:"3px 8px",border:"1px solid ".concat(ej[r.action],"66"),borderRadius:2,flexShrink:0,lineHeight:1.4},children:eb[r.action]}),(0,a.jsx)("span",{style:{fontSize:14,color:_.T1,fontFamily:_.FB,lineHeight:1.55},children:r.description}),(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,marginLeft:"auto",flexShrink:0},children:["+",(r.ts/1e3).toFixed(1),"s"]})]}),n.outcome&&l===n.steps.length-1&&(0,a.jsxs)("div",{style:{maxWidth:880,alignSelf:"center",width:"100%",padding:"12px 16px",marginTop:6,background:"".concat(_.EM3),border:"1px solid ".concat(_.EM),borderRadius:3,fontSize:13,color:_.T1,fontFamily:_.FB,lineHeight:1.55},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.EM,letterSpacing:"0.14em",marginBottom:4},children:"OUTCOME"}),n.outcome]})]}),(0,a.jsxs)("div",{style:{borderTop:"1px solid ".concat(_.BR),background:_.S,flexShrink:0},children:[(0,a.jsxs)("div",{style:{padding:"10px 28px",display:"flex",alignItems:"center",gap:12},children:[(0,a.jsx)("button",{onClick:()=>o(Math.max(0,l-1)),disabled:0===l,style:{fontFamily:_.FM,fontSize:11,padding:"4px 10px",border:"1px solid ".concat(_.BR),background:"transparent",color:0===l?_.T6:_.T3,borderRadius:2,cursor:0===l?"not-allowed":"pointer"},children:"← PREV"}),(0,a.jsx)("input",{type:"range",min:0,max:Math.max(0,n.steps.length-1),value:l,onChange:e=>o(Number(e.target.value)),"aria-label":"Scrub through session",style:{flex:1,accentColor:_.EM}}),(0,a.jsx)("button",{onClick:()=>o(Math.min(n.steps.length-1,l+1)),disabled:l>=n.steps.length-1,style:{fontFamily:_.FM,fontSize:11,padding:"4px 10px",border:"1px solid ".concat(_.BR),background:"transparent",color:l>=n.steps.length-1?_.T6:_.T3,borderRadius:2,cursor:l>=n.steps.length-1?"not-allowed":"pointer"},children:"NEXT →"}),(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,letterSpacing:"0.08em",minWidth:60,textAlign:"right"},children:[l+1," / ",n.steps.length]})]}),(0,a.jsx)("div",{style:{borderTop:"1px solid ".concat(_.BR2),maxHeight:180,overflowY:"auto"},children:n.steps.map((e,t)=>{let n=t===l;return(0,a.jsxs)("button",{onClick:()=>o(t),style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"6px 28px",textAlign:"left",background:n?"".concat(_.EM,"1a"):"transparent",borderTop:"none",borderRight:"none",borderBottom:"none",borderLeft:"2px solid ".concat(n?_.EM:"transparent"),cursor:"pointer"},children:[(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T6,width:40,flexShrink:0},children:[(e.ts/1e3).toFixed(1),"s"]}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:8,letterSpacing:"0.12em",color:ej[e.action],padding:"1px 5px",border:"1px solid ".concat(ej[e.action],"55"),borderRadius:2,width:64,textAlign:"center",flexShrink:0},children:eb[e.action]}),(0,a.jsx)("span",{style:{fontSize:12,color:n?_.T1:_.T3,fontFamily:_.FB,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.description})]},t)})})]})]})}function ew(e){var t,n,o,l;let{toast:r}=e,[s,d]=(0,i.useState)(null),[c,p]=(0,i.useState)(null),[u,h]=(0,i.useState)("all");(0,i.useEffect)(()=>{let e=!1;function t(){fetch("/api/leedab/sessions").then(e=>e.json()).then(t=>{var n,a;!e&&(d(null!=(a=t.sessions)?a:[]),!c&&(null==(n=t.sessions)?void 0:n.length)&&p(t.sessions[0].sessionId))}).catch(()=>{e||d([])})}t();let n=setInterval(t,1e4);return()=>{e=!0,clearInterval(n)}},[c]);let m=(null!=s?s:[]).filter(e=>"all"===u||e.channel===u),g=null!=(n=null!=(t=m.find(e=>e.sessionId===c))?t:m[0])?n:null,x={};for(let e of null!=s?s:[]){let t=null!=(o=e.channel)?o:"other";x[t]=(null!=(l=x[t])?l:0)+1}return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[(0,a.jsx)(ee,{section:"sessions",title:"Sessions",subtitle:"Per-peer conversation threads. Each Telegram / WhatsApp user has their own."}),(0,a.jsx)("div",{style:{display:"flex",gap:8,padding:"10px 28px",borderBottom:"1px solid ".concat(_.BR),background:_.S,flexShrink:0,overflowX:"auto"},children:["all","telegram","whatsapp","direct"].map(e=>{var t,n;let i="all"===e?null!=(t=null==s?void 0:s.length)?t:0:null!=(n=x[e])?n:0,o=u===e;return(0,a.jsxs)("button",{onClick:()=>h(e),style:{fontFamily:_.FM,fontSize:10,letterSpacing:"0.08em",padding:"5px 10px",background:o?_.EM:"transparent",color:o?"#fff":_.T4,border:"1px solid ".concat(o?_.EM:_.BR),borderRadius:3,cursor:"pointer",textTransform:"uppercase",whiteSpace:"nowrap"},children:["direct"===e?"console":e," ",i>0&&(0,a.jsx)("span",{style:{opacity:.6},children:i})]},e)})}),(0,a.jsxs)("div",{style:{flex:1,display:"grid",gridTemplateColumns:"320px 1fr",overflow:"hidden",minHeight:0},children:[(0,a.jsx)("div",{style:{borderRight:"1px solid ".concat(_.BR),overflow:"auto",background:_.S},children:null===s?(0,a.jsx)("div",{style:{padding:16},children:(0,a.jsx)(ei,{count:5})}):0===m.length?(0,a.jsx)("div",{style:{padding:28},children:(0,a.jsx)(el,{title:"No sessions",body:"Channel traffic will appear here once a paired user messages the bot."})}):m.map(e=>{var t;let n=e.sessionId===c;return(0,a.jsxs)("button",{onClick:()=>p(e.sessionId),style:{width:"100%",display:"flex",flexDirection:"column",gap:4,padding:"12px 16px",background:n?_.P:"transparent",border:"none",borderBottom:"1px solid ".concat(_.BR2),borderLeft:"3px solid ".concat(n?_.EM:"transparent"),cursor:"pointer",textAlign:"left",color:_.T1},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,a.jsx)("span",{style:{fontFamily:_.FB,fontSize:13,fontWeight:600,color:_.T1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:null!=(t=e.senderName)?t:(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:11,color:_.T5},children:[e.sessionId.slice(0,8),"…"]})}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T6,flexShrink:0},children:Z(e.updatedAt)})]}),e.summary&&(0,a.jsx)("span",{style:{fontFamily:_.FB,fontSize:11,color:_.T5,lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.summary}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",marginTop:2},children:[e.channel&&(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T6,letterSpacing:"0.08em",textTransform:"uppercase"},children:e.channel}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T7},children:"\xb7"}),(0,a.jsxs)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T6},children:[e.messageCount," msg",1===e.messageCount?"":"s"]})]})]},e.sessionId)})}),(0,a.jsx)("div",{style:{overflow:"auto",padding:28},children:g?(0,a.jsx)(eT,{session:g,toast:r}):(0,a.jsx)(el,{title:"Select a session",body:"Pick a conversation on the left to see the full transcript."})})]})]})}function eT(e){var t;let{session:n,toast:o}=e,[l,r]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=!1;return r(null),fetch("/api/leedab/sessions/".concat(encodeURIComponent(n.sessionId))).then(e=>e.json()).then(t=>{if(!e)if(t.error)o.error(t.error),r([]);else{var n;r(null!=(n=t.messages)?n:[])}}).catch(()=>{e||r([])}),()=>{e=!0}},[n.sessionId,o]),(0,a.jsxs)("div",{style:{maxWidth:760,margin:"0 auto"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14,flexWrap:"wrap"},children:[(0,a.jsx)("h3",{style:{fontFamily:_.FB,fontSize:16,fontWeight:600,color:_.T1,margin:0},children:null!=(t=n.senderName)?t:n.sessionId.slice(0,8)+"…"}),n.channel&&(0,a.jsx)(et,{children:n.channel}),n.chatType&&"direct"!==n.chatType&&(0,a.jsx)(et,{children:n.chatType}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,letterSpacing:"0.08em"},children:Z(n.updatedAt)})]}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T7,marginBottom:18,letterSpacing:"0.06em"},children:["SESSION ID ",n.sessionId]}),null===l?(0,a.jsx)(ei,{count:4}):0===l.length?(0,a.jsx)(el,{title:"No messages",body:"The session exists but has no parsed user/assistant turns yet."}):(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:l.map((e,t)=>(0,a.jsxs)("div",{style:{padding:"12px 16px",background:"user"===e.role?_.S:_.B,border:"1px solid ".concat(_.BR),borderLeft:"3px solid ".concat("user"===e.role?_.T7:_.EM),borderRadius:3,fontSize:14,lineHeight:1.6,color:_.T1,fontFamily:_.FB,whiteSpace:"pre-wrap"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.12em",textTransform:"uppercase"},children:e.role}),e.timestamp&&(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:_.T6},children:new Date(e.timestamp).toLocaleString()})]}),e.thoughts&&e.thoughts.length>0&&(0,a.jsxs)("details",{style:{marginBottom:8,fontFamily:_.FM,fontSize:11,color:_.T5},children:[(0,a.jsxs)("summary",{style:{cursor:"pointer",letterSpacing:"0.08em",textTransform:"uppercase",fontSize:9},children:["Thinking (",e.thoughts.length,")"]}),(0,a.jsx)("div",{style:{marginTop:6,padding:"8px 10px",background:_.S,borderRadius:3,lineHeight:1.55},children:e.thoughts.map((t,n)=>(0,a.jsx)("div",{style:{marginBottom:8*(n<e.thoughts.length-1),whiteSpace:"pre-wrap"},children:t},n))})]}),e.text]},t))})]})}let eF=[{id:"channels",label:"Channels"},{id:"team",label:"Team"},{id:"providers",label:"Providers"},{id:"vault",label:"Vault"},{id:"license",label:"License"}];function eC(e){let{toast:t,initialChannel:n}=e,[o,l]=(0,i.useState)("channels");return(0,i.useEffect)(()=>{n&&l("channels")},[n]),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[(0,a.jsx)(ee,{section:"admin",title:"Admin",subtitle:"Channel allowlists, team members, credential vault, license"}),(0,a.jsx)("div",{style:{display:"flex",gap:0,padding:"0 28px",borderBottom:"1px solid ".concat(_.BR),background:_.S,flexShrink:0},children:eF.map(e=>(0,a.jsx)("button",{onClick:()=>l(e.id),style:{fontFamily:_.FM,fontSize:10,letterSpacing:"0.08em",padding:"10px 16px",background:"transparent",color:o===e.id?_.EM:_.T5,borderTop:"none",borderRight:"none",borderLeft:"none",borderBottom:"2px solid ".concat(o===e.id?_.EM:"transparent"),cursor:"pointer",textTransform:"uppercase"},children:e.label},e.id))}),(0,a.jsxs)("div",{style:{flex:1,overflow:"auto"},children:["channels"===o&&(0,a.jsx)(eB,{toast:t,initialChannel:n,onJumpToTeam:()=>l("team")}),"team"===o&&(0,a.jsx)(eE,{toast:t}),"providers"===o&&(0,a.jsx)(eW,{toast:t}),"vault"===o&&(0,a.jsx)(eA,{toast:t}),"license"===o&&(0,a.jsx)(eL,{toast:t})]})]})}function eB(e){let{toast:t,initialChannel:n,onJumpToTeam:o}=e,[l,r]=(0,i.useState)(null),[s,d]=(0,i.useState)(null!=n?n:null);async function c(){try{let e=await fetch("/api/leedab/channels/status"),t=await e.json();r(t.channels),!s&&t.channels.length>0&&d(t.channels[0].name)}catch(e){r([])}}if((0,i.useEffect)(()=>{c()},[]),(0,i.useEffect)(()=>{n&&d(n)},[n]),null===l)return(0,a.jsx)("div",{style:{padding:28},children:(0,a.jsx)(ei,{count:3})});if(0===l.length)return(0,a.jsx)("div",{style:{padding:28},children:(0,a.jsx)(el,{title:"No channels configured",body:"Run `leedab onboard` to add Telegram, WhatsApp, or other channels."})});let p=l.find(e=>e.name===s);return(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"260px 1fr",height:"100%",overflow:"hidden"},children:[(0,a.jsx)("div",{style:{borderRight:"1px solid ".concat(_.BR),overflow:"auto",background:_.S},children:l.map(e=>{let t=e.name===s;return(0,a.jsxs)("button",{onClick:()=>d(e.name),style:{width:"100%",display:"flex",alignItems:"center",gap:10,padding:"12px 16px",background:t?_.P:"transparent",border:"none",borderBottom:"1px solid ".concat(_.BR2),borderLeft:"3px solid ".concat(t?_.EM:"transparent"),cursor:"pointer",textAlign:"left",color:_.T1},children:[("telegram"===e.name||"whatsapp"===e.name||"email"===e.name)&&(0,a.jsx)(ea,{channel:e.name}),(0,a.jsxs)("div",{style:{flex:1},children:[(0,a.jsx)("div",{style:{fontFamily:_.FB,fontSize:13,fontWeight:600,textTransform:"capitalize"},children:e.name}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:2},children:[e.connected?"connected":"not connected"," \xb7 ",e.allowFromCount," allowed"]})]}),e.connected&&(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:_.EM,boxShadow:"0 0 6px ".concat(_.EM6)}})]},e.name)})}),(0,a.jsx)("div",{style:{overflow:"auto",padding:28},children:p?(0,a.jsx)(eM,{channel:p,onJumpToTeam:o,onChanged:c,toast:t}):null})]})}function eM(e){let{channel:t,onJumpToTeam:n,onChanged:o,toast:l}=e,[r,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=!1;return s(null),fetch("/api/leedab/team").then(e=>e.json()).then(n=>{var a;e||s((null!=(a=n.members)?a:[]).filter(e=>{var n;return(null!=(n=e.allowedChannels)?n:[]).includes(t.name)}).map(e=>{var n,a;return{id:e.id,name:e.name,email:e.email,role:e.role,handle:null!=(a=(null!=(n=e.handles)?n:{})[t.name])?a:""}}))}).catch(()=>{e||s([])}),()=>{e=!0}},[t.name]),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:12,alignItems:"center",marginBottom:18},children:[(0,a.jsx)("h3",{style:{fontFamily:_.FB,fontSize:16,fontWeight:600,color:_.T1,margin:0,textTransform:"capitalize"},children:t.name}),(0,a.jsx)(et,{color:t.connected?_.EM:"#a52a1a",children:t.connected?"connected":"disconnected"}),t.dmPolicy&&(0,a.jsx)(et,{children:t.dmPolicy}),(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,letterSpacing:"0.08em"},children:t.enabled?"ENABLED":"DISABLED"})]}),("telegram"===t.name||"whatsapp"===t.name)&&(0,a.jsx)(eJ,{channel:t,toast:l,onChanged:o}),(0,a.jsxs)("div",{style:{marginTop:18},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:10},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Allowed members"}),(0,a.jsx)(en,{size:"sm",onClick:n,children:"Manage in Team →"})]}),(0,a.jsxs)("p",{style:{fontFamily:_.FB,fontSize:12,color:_.T4,lineHeight:1.5,marginTop:0,marginBottom:14},children:["The ",t.name," allowlist is derived from team members who have a ",t.name," handle and ",t.name," access. To add or remove someone, edit the team in the Team tab — the runtime config rebuilds automatically."]}),null===r?(0,a.jsx)(ei,{count:2}):0===r.length?(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:11,color:_.T6,padding:"8px 0"},children:"no members allowed yet"}):(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:r.map(e=>(0,a.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3},children:(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{style:{fontFamily:_.FB,fontSize:13,fontWeight:600,color:_.T1},children:[e.name," ",(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,fontWeight:400,marginLeft:6},children:e.role})]}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:11,color:_.T5,marginTop:2},children:[e.handle,e.email&&(0,a.jsxs)("span",{children:[" \xb7 ",e.email]})]})]})},e.id))})]})]})}let eR=["whatsapp","telegram","teams","dashboard"];function eE(e){let{toast:t}=e,[n,o]=(0,i.useState)(null),[l,r]=(0,i.useState)([]),[s,d]=(0,i.useState)(!1),[c,p]=(0,i.useState)(null);async function u(){var e,t;let[n,a]=await Promise.all([fetch("/api/leedab/team").then(e=>e.json()).catch(()=>({members:[]})),fetch("/api/leedab/workflows").then(e=>e.json()).catch(()=>({workflows:[]}))]);o(null!=(e=n.members)?e:[]),r(null!=(t=a.workflows)?t:[])}async function h(e,n,a){try{var i;let o=await fetch("/api/leedab/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:n||void 0,role:a})}),l=await o.json();if(!o.ok)throw Error(null!=(i=l.error)?i:"HTTP ".concat(o.status));t.success("Added ".concat(e)),d(!1),u()}catch(e){t.error(e instanceof Error?e.message:"add failed")}}async function m(e,n){if(confirm("Remove ".concat(n," from the team?")))try{var a;let i=await fetch("/api/leedab/team/".concat(encodeURIComponent(e)),{method:"DELETE"}),o=await i.json();if(!i.ok)throw Error(null!=(a=o.error)?a:"HTTP ".concat(i.status));t.info("Removed ".concat(n)),u()}catch(e){t.error(e instanceof Error?e.message:"remove failed")}}async function g(e,n){try{var a;let t=await fetch("/api/leedab/team/".concat(encodeURIComponent(e)),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),i=await t.json();if(!t.ok)throw Error(null!=(a=i.error)?a:"HTTP ".concat(t.status));u()}catch(e){t.error(e instanceof Error?e.message:"update failed")}}return(0,i.useEffect)(()=>{u()},[]),(0,a.jsxs)("div",{style:{padding:28,maxWidth:920},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:18},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{style:{fontFamily:_.FB,fontSize:16,fontWeight:600,color:_.T1,margin:0},children:"Team"}),(0,a.jsx)("p",{style:{fontFamily:_.FB,fontSize:12,color:_.T4,lineHeight:1.5,marginTop:8,marginBottom:0},children:"Each member lists their per-channel handle and which channels + workflows they can use. Channel allowlists rebuild automatically when you save."})]}),(0,a.jsx)(en,{variant:"primary",onClick:()=>d(!0),children:"Add member"})]}),s&&(0,a.jsx)("div",{style:{marginBottom:14},children:(0,a.jsx)(ez,{onCancel:()=>d(!1),onSave:h})}),null===n?(0,a.jsx)(ei,{count:3}):0!==n.length||s?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:null==n?void 0:n.map(e=>(0,a.jsx)(eI,{member:e,workflows:l,editing:c===e.id,onEdit:()=>p(e.id),onCancel:()=>p(null),onRemove:()=>m(e.id,e.name),onSave:async t=>{await g(e.id,t),p(null)}},e.id))}):(0,a.jsx)(el,{title:"No team members",body:"Add yourself as the first member to set up channel access."})]})}function ez(e){let{onCancel:t,onSave:n}=e,[o,l]=(0,i.useState)(""),[r,s]=(0,i.useState)(""),[d,c]=(0,i.useState)("member");return(0,a.jsxs)("div",{style:{padding:14,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsx)("input",{value:o,onChange:e=>l(e.target.value),placeholder:"Name",style:eD}),(0,a.jsx)("input",{value:r,onChange:e=>s(e.target.value),placeholder:"Email (optional)",style:eD}),(0,a.jsxs)("select",{value:d,onChange:e=>c(e.target.value),style:eD,children:[(0,a.jsx)("option",{value:"member",children:"member"}),(0,a.jsx)("option",{value:"admin",children:"admin"}),(0,a.jsx)("option",{value:"owner",children:"owner"})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,a.jsx)(en,{onClick:t,children:"Cancel"}),(0,a.jsx)(en,{variant:"primary",onClick:()=>n(o,r,d),disabled:!o.trim(),children:"Add member"})]}),(0,a.jsx)("p",{style:{fontFamily:_.FM,fontSize:10,color:_.T6,margin:0},children:"After adding, edit the member to set channel handles + permissions."})]})}function eI(e){var t,n,o,l;let{member:r,workflows:s,editing:d,onEdit:c,onCancel:p,onRemove:u,onSave:h}=e,[m,g]=(0,i.useState)(r.name),[x,f]=(0,i.useState)(null!=(t=r.email)?t:""),[y,v]=(0,i.useState)(r.role),[b,j]=(0,i.useState)({...r.handles}),[S,k]=(0,i.useState)([...r.allowedChannels]),[w,T]=(0,i.useState)([...r.allowedWorkflows]),[F,C]=(0,i.useState)(!1);async function B(){C(!0);try{await h({name:m,email:x||void 0,role:y,handles:b,allowedChannels:S,allowedWorkflows:w})}finally{C(!1)}}return(0,i.useEffect)(()=>{if(d){var e;g(r.name),f(null!=(e=r.email)?e:""),v(r.role),j({...r.handles}),k([...r.allowedChannels]),T([...r.allowedWorkflows])}},[d,r]),d?(0,a.jsxs)("div",{style:{padding:14,background:_.S,border:"1px solid ".concat(_.EM),borderRadius:3,display:"flex",flexDirection:"column",gap:12},children:[(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 140px",gap:8},children:[(0,a.jsx)("input",{value:m,onChange:e=>g(e.target.value),placeholder:"Name",style:eD}),(0,a.jsx)("input",{value:x,onChange:e=>f(e.target.value),placeholder:"Email (optional)",style:eD}),(0,a.jsxs)("select",{value:y,onChange:e=>v(e.target.value),style:eD,children:[(0,a.jsx)("option",{value:"member",children:"member"}),(0,a.jsx)("option",{value:"admin",children:"admin"}),(0,a.jsx)("option",{value:"owner",children:"owner"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:6},children:"Channel handles"}),(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:8},children:[(0,a.jsx)("input",{value:null!=(n=b.telegram)?n:"",onChange:e=>j({...b,telegram:e.target.value}),placeholder:"Telegram user id",style:eD}),(0,a.jsx)("input",{value:null!=(o=b.whatsapp)?o:"",onChange:e=>j({...b,whatsapp:e.target.value}),placeholder:"WhatsApp number",style:eD}),(0,a.jsx)("input",{value:null!=(l=b.teams)?l:"",onChange:e=>j({...b,teams:e.target.value}),placeholder:"Teams username",style:eD})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:6},children:"Allowed channels"}),(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:eR.map(e=>{let t=S.includes(e);return(0,a.jsx)("button",{onClick:()=>{k(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},style:{fontFamily:_.FM,fontSize:11,padding:"4px 10px",background:t?_.EM:"transparent",color:t?"#fff":_.T4,border:"1px solid ".concat(t?_.EM:_.BR),borderRadius:3,cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.06em"},children:e},e)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:6},children:"Allowed workflows"}),0===s.length?(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:10,color:_.T6},children:"no workflows registered"}):(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:s.map(e=>{let t=w.includes(e.id);return(0,a.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:"6px 8px",background:t?"".concat(_.EM,"11"):"transparent",border:"1px solid ".concat(t?_.EM3:_.BR2),borderRadius:3,cursor:"pointer",fontFamily:_.FB,fontSize:12},children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{var t;return t=e.id,void T(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},style:{marginTop:2}}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{style:{color:_.T1,fontWeight:600},children:[e.title,e.isFinancial&&(0,a.jsx)("span",{style:{fontFamily:_.FM,fontSize:9,color:"#a52a1a",marginLeft:8,letterSpacing:"0.06em"},children:"$"})]}),(0,a.jsx)("div",{style:{fontFamily:_.FB,fontSize:11,color:_.T5,marginTop:2},children:e.description})]})]},e.id)})})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,a.jsx)(en,{onClick:p,disabled:F,children:"Cancel"}),(0,a.jsx)(en,{variant:"primary",onClick:B,disabled:!m.trim()||F,children:F?"Saving...":"Save changes"})]})]}):(0,a.jsx)("div",{style:{padding:14,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{style:{fontFamily:_.FB,fontSize:14,fontWeight:600,color:_.T1},children:[r.name,(0,a.jsx)(et,{children:r.role})]}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:11,color:_.T5,marginTop:4,display:"flex",flexWrap:"wrap",gap:12},children:[r.email&&(0,a.jsx)("span",{children:r.email}),r.allowedChannels.length>0&&(0,a.jsxs)("span",{children:["channels: ",r.allowedChannels.join(", ")]}),r.allowedWorkflows.length>0&&(0,a.jsxs)("span",{children:["workflows: ",r.allowedWorkflows.length]})]}),(r.handles.telegram||r.handles.whatsapp||r.handles.teams)&&(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T6,marginTop:4},children:[r.handles.telegram&&(0,a.jsxs)("span",{children:["tg:",r.handles.telegram," "]}),r.handles.whatsapp&&(0,a.jsxs)("span",{children:["wa:",r.handles.whatsapp," "]}),r.handles.teams&&(0,a.jsxs)("span",{children:["teams:",r.handles.teams]})]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,a.jsx)(en,{size:"sm",onClick:c,children:"Edit"}),(0,a.jsx)(en,{size:"sm",onClick:u,children:"Remove"})]})]})})}function eA(e){let{toast:t}=e,[n,o]=(0,i.useState)(null),[l,r]=(0,i.useState)(!1),[s,d]=(0,i.useState)(null),[c,p]=(0,i.useState)(!1),[u,h]=(0,i.useState)(!1),[m,g]=(0,i.useState)({service:"",url:"",username:"",password:"",notes:""});async function x(){try{var e,t;let n=await fetch("/api/leedab/vault"),a=await n.json();if(!n.ok)throw Error(null!=(e=a.error)?e:"HTTP ".concat(n.status));o(null!=(t=a.entries)?t:[]),r(!!a.encrypted),d(null)}catch(e){o([]),d(e instanceof Error?e.message:"vault read failed")}}async function f(){if(m.service.trim()&&!u){h(!0);try{var e;let n=await fetch("/api/leedab/vault",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}),a=await n.json();if(!n.ok)throw Error(null!=(e=a.error)?e:"HTTP ".concat(n.status));t.success("Saved credentials for ".concat(m.service)),g({service:"",url:"",username:"",password:"",notes:""}),p(!1),x()}catch(e){t.error(e instanceof Error?e.message:"save failed")}finally{h(!1)}}}async function y(e){if(!u&&confirm('Remove credentials for "'.concat(e,'"?'))){h(!0);try{var n;let a=await fetch("/api/leedab/vault?service=".concat(encodeURIComponent(e)),{method:"DELETE"}),i=await a.json();if(!a.ok)throw Error(null!=(n=i.error)?n:"HTTP ".concat(a.status));t.info("Removed ".concat(e)),x()}catch(e){t.error(e instanceof Error?e.message:"remove failed")}finally{h(!1)}}}return(0,i.useEffect)(()=>{x()},[]),(0,a.jsxs)("div",{style:{padding:28,maxWidth:760},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:18},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{style:{fontFamily:_.FB,fontSize:16,fontWeight:600,color:_.T1,margin:0},children:"Credential vault"}),(0,a.jsx)("p",{style:{fontFamily:_.FB,fontSize:12,color:_.T4,lineHeight:1.5,marginTop:8,marginBottom:0},children:"Stored credentials the browser tool uses for auto-login (Coles supplier portal, Xero, etc). Reads stay local; passwords never reach the browser UI."})]}),(0,a.jsx)(en,{variant:"primary",onClick:()=>p(!0),children:"Add credential"})]}),l&&(0,a.jsxs)("div",{style:{padding:"8px 12px",background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,marginBottom:14,fontFamily:_.FM,fontSize:11,color:_.T4},children:["Vault is encrypted. ",(0,a.jsx)("code",{children:"LEEDAB_VAULT_KEY"})," is set; reads + writes pass through transparently."]}),s&&(0,a.jsx)("div",{style:{padding:"8px 12px",background:"#a52a1a22",border:"1px solid #a52a1a",borderRadius:3,marginBottom:14,fontFamily:_.FM,fontSize:11,color:"#a52a1a"},children:s}),c&&(0,a.jsxs)("div",{style:{padding:14,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,marginBottom:14,display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsx)("input",{value:m.service,onChange:e=>g({...m,service:e.target.value}),placeholder:"Service name (e.g. coles)",style:eD}),(0,a.jsx)("input",{value:m.url,onChange:e=>g({...m,url:e.target.value}),placeholder:"Login URL (optional)",style:eD}),(0,a.jsx)("input",{value:m.username,onChange:e=>g({...m,username:e.target.value}),placeholder:"Username / email (optional)",style:eD}),(0,a.jsx)("input",{value:m.password,onChange:e=>g({...m,password:e.target.value}),placeholder:"Password (optional)",type:"password",style:eD}),(0,a.jsx)("textarea",{value:m.notes,onChange:e=>g({...m,notes:e.target.value}),placeholder:"Notes (optional)",rows:2,style:{...eD,resize:"vertical"}}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,a.jsx)(en,{onClick:()=>{p(!1),g({service:"",url:"",username:"",password:"",notes:""})},children:"Cancel"}),(0,a.jsx)(en,{variant:"primary",onClick:f,disabled:!m.service.trim()||u,children:u?"...":"Save"})]})]}),null===n?(0,a.jsx)(ei,{count:3}):0===n.length?(0,a.jsx)(el,{title:"No credentials",body:"Add one above, or use `leedab vault add <service>`."}):(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:n.map(e=>(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3},children:[(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontFamily:_.FB,fontSize:13,fontWeight:600,color:_.T1},children:e.service}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:2,display:"flex",gap:10,flexWrap:"wrap"},children:[e.url&&(0,a.jsx)("span",{children:e.url}),e.username&&(0,a.jsxs)("span",{children:["\xb7 ",e.username]}),e.hasPassword&&(0,a.jsx)("span",{children:"\xb7 password set"}),e.hasNotes&&(0,a.jsx)("span",{children:"\xb7 notes"})]})]}),(0,a.jsx)(en,{size:"sm",onClick:()=>y(e.service),disabled:u,children:"Remove"})]},e.service))})]})}let eD={width:"100%",padding:"8px 12px",background:_.B,border:"1px solid ".concat(_.BR),borderRadius:3,fontFamily:_.FM,fontSize:12,color:_.T1,outline:"none"};function eW(e){var t;let{toast:n}=e,[o,l]=(0,i.useState)(null),[r,s]=(0,i.useState)(null),[d,c]=(0,i.useState)(null),[p,u]=(0,i.useState)(""),[h,m]=(0,i.useState)(!1);async function g(){try{var e;let t=await fetch("/api/leedab/providers"),n=await t.json();if(!t.ok)throw Error(null!=(e=n.error)?e:"HTTP ".concat(t.status));l(n),s(null)}catch(e){s(e instanceof Error?e.message:"providers read failed")}}async function x(e){if(p.trim()&&!h){m(!0);try{var t;let a=await fetch("/api/leedab/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set-key",provider:e,apiKey:p.trim()})}),i=await a.json();if(!a.ok)throw Error(null!=(t=i.error)?t:"HTTP ".concat(a.status));n.success("Saved ".concat(e," key")),c(null),u(""),g()}catch(e){n.error(e instanceof Error?e.message:"save failed")}finally{m(!1)}}}async function f(e){if(!h&&confirm("Remove ".concat(e," auth profile? You'll need to re-add a key to use it."))){m(!0);try{var t;let a=await fetch("/api/leedab/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"remove-key",provider:e})}),i=await a.json();if(!a.ok)throw Error(null!=(t=i.error)?t:"HTTP ".concat(a.status));n.info("Removed ".concat(e)),g()}catch(e){n.error(e instanceof Error?e.message:"remove failed")}finally{m(!1)}}}async function y(e){if(!h){m(!0);try{var t;let a=await fetch("/api/leedab/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set-default-model",openclawId:e})}),i=await a.json();if(!a.ok)throw Error(null!=(t=i.error)?t:"HTTP ".concat(a.status));n.success("Default model set to ".concat(e)),g()}catch(e){n.error(e instanceof Error?e.message:"set default failed")}finally{m(!1)}}}if((0,i.useEffect)(()=>{g()},[]),!o)return(0,a.jsx)("div",{style:{padding:28},children:r?(0,a.jsx)(eO,{children:r}):(0,a.jsx)(ei,{count:3})});let v=o.providers.filter(e=>e.configured||e.envDetected||e.keyless).flatMap(e=>e.models);return(0,a.jsxs)("div",{style:{padding:28,maxWidth:760},children:[(0,a.jsx)("h3",{style:{fontFamily:_.FB,fontSize:16,fontWeight:600,color:_.T1,margin:0,marginBottom:6},children:"LLM providers"}),(0,a.jsxs)("p",{style:{fontFamily:_.FB,fontSize:12,color:_.T4,lineHeight:1.5,marginTop:0,marginBottom:18},children:["API keys live in the OpenClaw credential store, never in this UI. Adding a key here writes through the same path as ",(0,a.jsx)("code",{style:{fontFamily:_.FM},children:"leedab onboard"}),". Restart the gateway after changes."]}),(0,a.jsxs)("div",{style:{padding:14,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,marginBottom:18},children:[(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:8},children:"Default model"}),0===v.length?(0,a.jsx)("div",{style:{fontFamily:_.FB,fontSize:12,color:_.T4},children:"Configure at least one provider below to pick a default model."}):(0,a.jsxs)("select",{value:null!=(t=o.defaultModel)?t:"",onChange:e=>y(e.target.value),disabled:h,style:{...eD,maxWidth:420},children:[(0,a.jsx)("option",{value:"",disabled:!0,children:"Select a model."}),v.map(e=>(0,a.jsxs)("option",{value:e.openclawId,children:[e.label," . ",e.openclawId]},e.openclawId))]})]}),r&&(0,a.jsx)(eO,{children:r}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:o.providers.map(e=>{let t=d===e.id;return(0,a.jsxs)("div",{style:{padding:"12px 14px",background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontFamily:_.FB,fontSize:13,fontWeight:600,color:_.T1},children:e.label}),(0,a.jsxs)("div",{style:{fontFamily:_.FM,fontSize:10,color:_.T5,marginTop:4,display:"flex",gap:10,flexWrap:"wrap"},children:[(0,a.jsx)(et,{color:e.configured?_.EM:"#7a6248",children:e.configured?"configured":"not configured"}),e.envDetected&&e.envVarName&&(0,a.jsxs)(et,{color:_.EM,children:[e.envVarName," in env"]}),e.keyless&&(0,a.jsx)(et,{color:"#7a6248",children:"keyless . uses AWS env"})]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,flexShrink:0},children:[!e.keyless&&(0,a.jsx)(en,{size:"sm",onClick:()=>{c(t?null:e.id),u("")},disabled:h,children:t?"Cancel":e.configured?"Rotate key":"Add key"}),e.configured&&(0,a.jsx)(en,{size:"sm",onClick:()=>f(e.id),disabled:h,children:"Remove"})]})]}),t&&(0,a.jsxs)("div",{style:{marginTop:10,display:"flex",gap:6},children:[(0,a.jsx)("input",{value:p,onChange:e=>u(e.target.value),placeholder:"".concat(e.label," API key"),type:"password",style:{...eD,flex:1},autoFocus:!0}),(0,a.jsx)(en,{variant:"primary",onClick:()=>x(e.id),disabled:!p.trim()||h,children:h?"...":"Save"})]})]},e.id)})})]})}function eO(e){let{children:t}=e;return(0,a.jsx)("div",{style:{padding:"8px 12px",background:"#a52a1a22",border:"1px solid #a52a1a",borderRadius:3,marginBottom:14,fontFamily:_.FM,fontSize:11,color:"#a52a1a"},children:t})}function eL(){let{toast:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,n]=(0,i.useState)(null),[o,l]=(0,i.useState)(!1),[r,s]=(0,i.useState)(""),[d,c]=(0,i.useState)(!1),[p,u]=(0,i.useState)(null);async function h(){if(r.trim()&&!d){c(!0),u(null);try{var t;let a=await fetch("/api/leedab/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set-key",key:r.trim()})}),i=await a.json();if(!a.ok)throw Error(null!=(t=i.error)?t:"HTTP ".concat(a.status));null==e||e.success("License ".concat(i.status," . tier ").concat(i.tier)),n(i),l(!1),s("")}catch(n){let t=n instanceof Error?n.message:"save failed";u(t),null==e||e.error(t)}finally{c(!1)}}}async function m(){if(!d){c(!0),u(null);try{var t;let a=await fetch("/api/leedab/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"revalidate"})}),i=await a.json();if(!a.ok)throw Error(null!=(t=i.error)?t:"HTTP ".concat(a.status));null==e||e.info("Revalidated . ".concat(i.status)),n(i)}catch(n){let t=n instanceof Error?n.message:"revalidate failed";u(t),null==e||e.error(t)}finally{c(!1)}}}if((0,i.useEffect)(()=>{fetch("/api/leedab/license").then(e=>e.json()).then(e=>{n(e),u(null)}).catch(()=>n({valid:!1,tier:"none",status:"missing",seatsUsed:0,maxSeats:0}))},[]),!t)return(0,a.jsx)("div",{style:{padding:28},children:(0,a.jsx)(ei,{count:2})});let g=t.maxSeats>0?Math.min(100,t.seatsUsed/t.maxSeats*100):0,x=!!t.keyMasked;return(0,a.jsxs)("div",{style:{padding:28,maxWidth:600},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[(0,a.jsx)("h3",{style:{fontFamily:_.FB,fontSize:16,fontWeight:600,color:_.T1,margin:0},children:"License"}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[x&&(0,a.jsx)(en,{size:"sm",onClick:m,disabled:d,children:"Revalidate"}),(0,a.jsx)(en,{size:"sm",variant:"primary",onClick:()=>{l(!o),s(""),u(null)},disabled:d,children:o?"Cancel":x?"Replace key":"Enter key"})]})]}),o&&(0,a.jsxs)("div",{style:{padding:12,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3,marginBottom:18,display:"flex",gap:6},children:[(0,a.jsx)("input",{value:r,onChange:e=>s(e.target.value),placeholder:"License key (sk-leedab-...)",type:"password",style:{...eD,flex:1},autoFocus:!0}),(0,a.jsx)(en,{variant:"primary",onClick:h,disabled:!r.trim()||d,children:d?"...":"Validate & save"})]}),p&&(0,a.jsx)(eO,{children:p}),(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:10,columnGap:16,fontFamily:_.FM,fontSize:12},children:[(0,a.jsx)(eN,{children:"Status"}),(0,a.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8},children:(0,a.jsx)(et,{color:t.valid?_.EM:"#a52a1a",children:t.status})}),(0,a.jsx)(eN,{children:"Tier"}),(0,a.jsx)(eP,{children:t.tier}),(0,a.jsx)(eN,{children:"Seats"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{color:_.T1},children:[t.seatsUsed," / ",t.maxSeats||"∞"]}),t.maxSeats>0&&(0,a.jsx)("div",{style:{width:"100%",maxWidth:260,height:4,background:_.BR2,marginTop:6,borderRadius:2,overflow:"hidden"},children:(0,a.jsx)("div",{style:{width:"".concat(g,"%"),height:"100%",background:g>80?"#a52a1a":_.EM}})})]}),t.keyMasked&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eN,{children:"Key"}),(0,a.jsx)(eP,{mono:!0,children:t.keyMasked})]}),t.email&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eN,{children:"Email"}),(0,a.jsx)(eP,{children:t.email})]}),t.orgName&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eN,{children:"Org"}),(0,a.jsx)(eP,{children:t.orgName})]}),t.validatedAt&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eN,{children:"Validated"}),(0,a.jsx)(eP,{children:new Date(t.validatedAt).toLocaleDateString()})]})]})]})}function eN(e){let{children:t}=e;return(0,a.jsx)("div",{style:{fontFamily:_.FM,fontSize:9,color:_.T5,letterSpacing:"0.14em",textTransform:"uppercase",paddingTop:2},children:t})}function eP(e){let{children:t,mono:n}=e;return(0,a.jsx)("div",{style:{fontFamily:n?_.FM:_.FB,fontSize:13,color:_.T1},children:t})}function eJ(e){let{channel:t,toast:n,onChanged:o}=e,[l,r]=(0,i.useState)(!1);return(0,a.jsxs)("div",{style:{marginBottom:18},children:[(0,a.jsxs)("button",{onClick:()=>r(e=>!e),style:{fontFamily:_.FM,fontSize:10,letterSpacing:"0.08em",padding:"6px 12px",background:"transparent",color:_.T4,border:"1px solid ".concat(_.BR),borderRadius:3,cursor:"pointer",textTransform:"uppercase"},children:[t.connected?"Re-pair":"Connect"," ▾"]}),l&&(0,a.jsx)("div",{style:{marginTop:10,padding:14,background:_.S,border:"1px solid ".concat(_.BR),borderRadius:3},children:"telegram"===t.name?(0,a.jsx)(eH,{toast:n,onSuccess:()=>{r(!1),o()}}):(0,a.jsx)(eU,{toast:n,onSuccess:()=>{r(!1),o()}})})]})}function eH(e){let{toast:t,onSuccess:n}=e,[o,l]=(0,i.useState)(""),[r,s]=(0,i.useState)(!1);async function d(){if(o.trim()&&!r){s(!0);try{var e;let a=await fetch("/api/leedab/channels/telegram/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:o.trim()})}),i=await a.json();if(!a.ok)throw Error(null!=(e=i.error)?e:"HTTP ".concat(a.status));t.success(i.username?"Connected @".concat(i.username):"Telegram connected"),l(""),n()}catch(e){t.error(e instanceof Error?e.message:"telegram connect failed")}finally{s(!1)}}}return(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{style:{fontFamily:_.FB,fontSize:12,color:_.T4,lineHeight:1.5,marginTop:0,marginBottom:10},children:["Paste the bot token from ",(0,a.jsx)("code",{children:"@BotFather"}),". We validate via Telegram's getMe before saving."]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,a.jsx)("input",{value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&d()},placeholder:"123456789:ABC-DEF...",disabled:r,style:eD}),(0,a.jsx)(en,{variant:"primary",onClick:d,disabled:!o.trim()||r,children:r?"Validating...":"Connect"})]})]})}function eU(e){let{toast:t,onSuccess:n}=e,[o,l]=(0,i.useState)(null),[r,s]=(0,i.useState)(!1);async function d(){if(!r){s(!0),l(null);try{var e;let n=await fetch("/api/leedab/channels/whatsapp/connect",{method:"POST"}),a=await n.json();if(!n.ok)throw Error(null!=(e=a.error)?e:"HTTP ".concat(n.status));a.qr?(l(a.qr),t.info("Scan the QR with WhatsApp on your phone (Linked Devices).",{ttlMs:8e3})):t.error("No QR returned. Check the gateway log.")}catch(e){t.error(e instanceof Error?e.message:"whatsapp pairing failed")}finally{s(!1)}}}return(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{style:{fontFamily:_.FB,fontSize:12,color:_.T4,lineHeight:1.5,marginTop:0,marginBottom:10},children:["Click ",(0,a.jsx)("em",{children:"Get QR"}),", then on your phone open WhatsApp → Settings → Linked Devices → Link a device, and scan."]}),(0,a.jsx)(en,{variant:"primary",onClick:d,disabled:r,children:r?"Spawning pairing...":o?"Get new QR":"Get QR"}),o&&(0,a.jsx)("pre",{style:{marginTop:12,padding:10,background:_.B,border:"1px solid ".concat(_.BR),borderRadius:3,fontFamily:_.FM,fontSize:8,lineHeight:1,color:_.T1,overflowX:"auto",whiteSpace:"pre"},children:o}),(0,a.jsx)("p",{style:{fontFamily:_.FM,fontSize:10,color:_.T6,marginTop:8},children:"This page won't auto-refresh after the scan. Click off the channel and back to refresh status."})]})}function eV(){return(0,a.jsx)(c,{children:(0,a.jsx)(eY,{})})}function eY(){var e,t,n;let{pack:s}=p(),d=null!=(t=null==s?void 0:s.agentOrder)?t:r;null==s||s.agentTeams,null==s||s.agents;let[c,y]=(0,i.useState)("marketing"),[F,C]=(0,i.useState)(()=>{let e={};for(let t of r)e[t]=[];return e}),[E,z]=(0,i.useState)({}),[D,J]=(0,i.useState)(""),[V,Y]=(0,i.useState)(!1),[$,Q]=(0,i.useState)(!1),[_,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(null),[en,ea]=(0,i.useState)(!1),[ei,eo]=(0,i.useState)(!1),[el,er]=(0,i.useState)(()=>Object.fromEntries(r.map(e=>[e,""]))),[ed,ep]=(0,i.useState)(null),[eh,em]=(0,i.useState)(!1),[eg,ex]=(0,i.useState)(340),[eb,ej]=(0,i.useState)("agents"),[ek,eT]=(0,i.useState)(!1),[eF,eB]=(0,i.useState)(null),[eM,eR]=(0,i.useState)(!1),[eE,ez]=(0,i.useState)(""),[eI,eA]=(0,i.useState)(!1),[eD,eW]=(0,i.useState)(!1),[eO,eL]=(0,i.useState)([]),[eN,eP]=(0,i.useState)(0);(0,i.useEffect)(()=>{let e=[],t=Date.now(),n=(e,t,n)=>{let a={id:crypto.randomUUID(),agent:t,msg:n,level:e,ts:"just now",read:!1,createdAt:Date.now()};eL(e=>[a,...e].slice(0,30))},a=new EventSource("/api/inbox/stream");a.addEventListener("created",e=>{try{var a;let i=JSON.parse(e.data);if(i.timestamp<t-5e3)return;n("info",null!=(a=i.agentId)?a:"ops","New ".concat(i.channel," from ").concat(i.fromName))}catch(e){}}),e.push(a);let i=new EventSource("/api/approvals/stream");return i.addEventListener("snapshot",e=>{try{let{approvals:t}=JSON.parse(e.data);eP(t.filter(e=>"pending"===e.status).length)}catch(e){}}),i.addEventListener("created",e=>{try{let a=JSON.parse(e.data);if("pending"===a.status&&eP(e=>e+1),a.createdAt<t-5e3)return;n("warn",a.agentId,"Approval pending: ".concat(a.title))}catch(e){}}),i.addEventListener("updated",e=>{try{let t=JSON.parse(e.data);"pending"!==t.status&&eP(e=>Math.max(0,e-1))}catch(e){}}),e.push(i),()=>{e.forEach(e=>e.close())}},[]),(0,i.useEffect)(()=>{let e="LeedAB — Operations Room";document.title=eN>0?"(".concat(eN,") ").concat(e):e},[eN]),(0,i.useEffect)(()=>{let e=setInterval(()=>{eL(e=>e.map(e=>({...e,ts:function(e){let t=Date.now()-e;return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):"".concat(Math.floor(t/864e5),"d ago")}(e.createdAt)})))},3e4);return()=>clearInterval(e)},[]);let[eJ,eH]=(0,i.useState)(null),[eU,eV]=(0,i.useState)(!1),[eY,eK]=(0,i.useState)("light"),[eq,eG]=(0,i.useState)("orb"),[e$,eX]=(0,i.useState)([]),[eQ,e_]=(0,i.useState)(!1),[eZ,e0]=(0,i.useState)(!1),[e1,e2]=(0,i.useState)(!1),[e4,e6]=(0,i.useState)(!1),[e5,e8]=(0,i.useState)(!1),[e3,e9]=(0,i.useState)(!1),[e7,te]=(0,i.useState)(null),{toasts:tt,toast:tn,dismiss:ta}=function(){let[e,t]=(0,i.useState)([]),n=(0,i.useCallback)((e,n,a)=>{var i;let o=crypto.randomUUID(),l=null!=(i=null==a?void 0:a.ttlMs)?i:5e3;return t(t=>[...t,{id:o,type:e,message:n,action:null==a?void 0:a.action,ttlMs:l}]),setTimeout(()=>t(e=>e.filter(e=>e.id!==o)),l),o},[]);return{toasts:e,toast:{error:(e,t)=>n("error",e,t),success:(e,t)=>n("success",e,t),info:(e,t)=>n("info",e,t)},dismiss:e=>t(t=>t.filter(t=>t.id!==e))}}();(0,i.useEffect)(()=>{fetch("/api/demo").then(e=>e.json()).then(e=>e9(!!e.active)).catch(()=>{})},[]);let[ti,to]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if("1"===new URLSearchParams(window.location.search).get("onboarding")){try{localStorage.removeItem("leedab-onboarded")}catch(e){}to(!0);return}"1"!==localStorage.getItem("leedab-onboarded")&&Promise.all([fetch("/api/routing").then(e=>e.json()).catch(()=>({rules:[]})),fetch("/api/contacts").then(e=>e.json()).catch(()=>({contacts:[]})),fetch("/api/demo").then(e=>e.json()).catch(()=>({active:!1}))]).then(e=>{let[t,n,a]=e;t.rules&&0!==t.rules.length||n.contacts&&0!==n.contacts.length||a.active||to(!0)})},[]),(0,i.useEffect)(()=>{let e=window.matchMedia("(max-width: 900px)"),t=()=>e2(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let tl=(0,i.useCallback)(async e=>{if(e&&0!==e.length){e_(!0);try{let n=Array.from(e),a=[];for(let e of n){let n=new FormData;n.append("file",e);let i=await fetch("/api/uploads",{method:"POST",body:n});if(!i.ok){var t;let e=await i.json().catch(()=>({}));throw Error(null!=(t=e.error)?t:"HTTP ".concat(i.status))}let o=await i.json();a.push(o)}eX(e=>[...e,...a])}catch(e){tn.error(e instanceof Error?e.message:"upload failed")}finally{e_(!1)}}},[tn]),tr=(0,i.useCallback)(e=>{eX(t=>t.filter(t=>t.id!==e))},[]);(0,i.useEffect)(()=>{!d.includes(c)&&d.length>0&&y(d[0])},[d,c]),(0,i.useEffect)(()=>{var e,t;let n=localStorage.getItem("leedab-theme"),a=localStorage.getItem("leedab-view");"dark"===n||"light"===n?eK(n):(null==(e=(t=window).matchMedia)?void 0:e.call(t,"(prefers-color-scheme: dark)").matches)&&eK("dark"),"list"===a&&eG("list")},[]),(0,i.useEffect)(()=>{document.documentElement.setAttribute("data-theme","dark"===eY?"dark":"light");try{localStorage.setItem("leedab-theme",eY)}catch(e){}},[eY]),(0,i.useEffect)(()=>{try{localStorage.setItem("leedab-view",eq)}catch(e){}},[eq]);let ts=(0,i.useRef)(null);(0,i.useRef)(!1);let td=(0,i.useRef)(null),tc=(0,i.useRef)(null),tp=(0,i.useRef)(null),tu=l[c],th=F[c],tm=null!=(n=E[c])?n:tu.defaultModel;d.indexOf(c);let tg=d.filter(e=>"active"===T[e]).length,tx=eO.filter(e=>!e.read).length,tf=new Date().toLocaleDateString("en-US",{month:"short",day:"2-digit"}).toUpperCase(),ty=new Date().getFullYear();(0,i.useEffect)(()=>{let e=!1;return eV(!0),(async()=>{try{let t=await fetch("/api/conversations?agentId=".concat(c));if(e)return;if(!t.ok)throw Error("HTTP ".concat(t.status));let n=await t.json();!e&&Array.isArray(n.messages)&&C(e=>({...e,[c]:n.messages}))}catch(t){e||tn.error(t instanceof Error?t.message:"Failed to load conversation")}finally{e||eV(!1)}})(),()=>{e=!0}},[c]),(0,i.useEffect)(()=>{var e;null==(e=ts.current)||e.scrollTo({top:ts.current.scrollHeight,behavior:"smooth"})},[th,V]),(0,i.useEffect)(()=>{_&&fetch("/api/usage").then(e=>e.json()).then(et).catch(e=>{var t;return tn.error(null!=(t=e.message)?t:"Failed to load usage")})},[_]),(0,i.useEffect)(()=>{eM&&setTimeout(()=>{var e;return null==(e=tc.current)?void 0:e.focus()},50)},[eM]),(0,i.useEffect)(()=>{let e=e=>{var t,n;let a=["TEXTAREA","INPUT"].includes(e.target.tagName);if((e.metaKey||e.ctrlKey)&&"l"===e.key){e.preventDefault(),eR(e=>!e),ez("");return}if("Escape"===e.key)return e5?void e8(!1):eM?void eR(!1):eI?void eA(!1):eD?void eW(!1):(ei&&(eo(!1),ea(!1)),em(!1),void(null==(t=document.activeElement)||t.blur()));if("?"===e.key&&!a&&!eM){e.preventDefault(),e8(e=>!e);return}if("/"===e.key&&!a&&!eM){e.preventDefault(),null==(n=td.current)||n.focus();return}if("b"===e.key&&!a&&!eM)return void ea(e=>!e)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ei,eM,eI,eD,e5]);let tv=(0,i.useCallback)(e=>{e===c?em(e=>!e):(y(e),em(!0),eo(!1),ea(!1)),ej("agents"),setTimeout(()=>{var e;return null==(e=td.current)?void 0:e.focus()},0)},[c]),tb=(0,i.useCallback)(async()=>{let e=D.trim();if(!e&&0===e$.length||V)return;if(J(""),eX([]),en){eo(!0),er(Object.fromEntries(d.map(e=>[e,""]))),d.forEach(async t=>{var n,a;let i=l[t],o=null!=(n=E[t])?n:i.defaultModel;try{let n=await fetch("/api/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:t,model:o,messages:[{role:"user",content:e}]})});if(!n.ok||!n.body)return;let i=n.body.getReader(),l=new TextDecoder,r="";for(;;){let{value:e,done:n}=await i.read();if(n)break;let o=(r+=l.decode(e,{stream:!0})).split("\n\n");for(let e of(r=null!=(a=o.pop())?a:"",o))if(e.startsWith("data:"))try{let n=JSON.parse(e.slice(5).trim());"text"===n.type&&er(e=>({...e,[t]:e[t]+n.value}))}catch(e){}}}catch(e){}});return}let t=e$.length?"\n\n"+e$.map(e=>"[Attached: ".concat(e.name,"]")).join("\n"):"",n={id:crypto.randomUUID(),role:"user",content:e+t,timestamp:Date.now()},a={id:crypto.randomUUID(),role:"assistant",content:"",timestamp:Date.now(),model:tm};C(e=>({...e,[c]:[...e[c],n,a]})),Y(!0);try{let t=await fetch("/api/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:c,model:tm,messages:[...th.map(e=>({role:e.role,content:e.content})),{role:"user",content:e}],attachments:e$})});if(!t.ok||!t.body)throw Error(await t.text()||"HTTP ".concat(t.status));let n=t.body.getReader(),a=new TextDecoder,o="";for(;;){var i;let{value:e,done:t}=await n.read();if(t)break;let l=(o+=a.decode(e,{stream:!0})).split("\n\n");for(let e of(o=null!=(i=l.pop())?i:"",l))if(e.startsWith("data:"))try{let t=JSON.parse(e.slice(5).trim());"tool_call"===t.type?eH(t.tool):"text"===t.type?(eH(null),C(e=>{let n=e[c],a=n[n.length-1];return(null==a?void 0:a.role)!=="assistant"?e:{...e,[c]:[...n.slice(0,-1),{...a,content:a.content+t.value}]}})):"error"===t.type&&(eH(null),C(e=>{let n=e[c],a=n[n.length-1];return(null==a?void 0:a.role)!=="assistant"?e:{...e,[c]:[...n.slice(0,-1),{...a,content:"[Error] ".concat(t.value)}]}}))}catch(e){}}}catch(t){let e=t instanceof Error?t.message:"Unknown error";C(t=>{let n=t[c],a=n[n.length-1];return(null==a?void 0:a.role)!=="assistant"?t:{...t,[c]:[...n.slice(0,-1),{...a,content:"[Error] ".concat(e)}]}})}finally{Y(!1),eH(null)}},[D,V,c,tm,th,en,E,e$]),tj=(0,i.useCallback)(async()=>{confirm("Clear conversation with ".concat(tu.name," agent?"))&&(await fetch("/api/conversations?agentId=".concat(c),{method:"DELETE"}),C(e=>({...e,[c]:[]})))},[c,tu.name]),tS=(0,i.useCallback)(e=>{var t,n,a,i;if(0===th.length)return;let o=new Date().toISOString().slice(0,10),l=th.filter(e=>"assistant"===e.role).map(e=>e.content),r="",s="text/plain";if("md"===e)r=th.map(e=>"user"===e.role?"**You:** ".concat(e.content):"**".concat(tu.name,":** ").concat(e.content)).join("\n\n---\n\n"),s="text/markdown";else if("txt"===e)r=(null!=(t=l.at(-1))?t:th.map(e=>"user"===e.role?"You: ".concat(e.content):"".concat(tu.name,": ").concat(e.content)).join("\n\n")).replace(/#{1,6}\s+/g,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/`{3}[\s\S]*?`{3}/g,e=>e.replace(/`{3}[^\n]*\n?/,"").replace(/\n?`{3}/,"")).replace(/`(.+?)`/g,"$1").replace(/\[(.+?)\]\(.+?\)/g,"$1").replace(/^[-*]\s+/gm,"• ").replace(/^\d+\.\s+/gm,e=>e);else if("html"===e){let e=(null!=(n=l.at(-1))?n:"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/#{3}\s+(.+)/g,"<h3>$1</h3>").replace(/#{2}\s+(.+)/g,"<h2>$1</h2>").replace(/#{1}\s+(.+)/g,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2">$1</a>').replace(/^[-*]\s+(.+)/gm,"<li>$1</li>").replace(/(<li>[\s\S]+?<\/li>)/g,"<ul>$1</ul>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");r='<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>'.concat(tu.name," — LeedAB</title><style>body{font-family:system-ui,sans-serif;max-width:720px;margin:40px auto;padding:0 24px;color:#1a1713;line-height:1.7;background:#efe9dd}h1,h2,h3{font-weight:600;margin-top:2em}code{background:#e6dfcf;padding:2px 6px;border-radius:3px;font-size:.9em}pre{background:#e6dfcf;padding:16px;border-radius:4px;overflow-x:auto}ul{padding-left:1.5em}a{color:#10b981}</style></head><body><p>").concat(e,"</p></body></html>"),s="text/html"}else if("json"===e)r=JSON.stringify({agent:tu.name,exportedAt:new Date().toISOString(),messages:th},null,2),s="application/json";else if("csv"===e){let e=[["role","content","timestamp"]];for(let t of th)e.push([t.role,'"'.concat((null!=(a=t.content)?a:"").replace(/"/g,'""'),'"'),String(null!=(i=t.timestamp)?i:"")]);r=e.map(e=>e.join(",")).join("\n"),s="text/csv"}let d=new Blob([r],{type:s}),p=URL.createObjectURL(d),u=document.createElement("a");u.href=p,u.download="leedab-".concat(c,"-").concat(o,".").concat(e),u.click(),URL.revokeObjectURL(p)},[th,c,tu.name]),tk=(0,i.useCallback)(()=>{var e;let t=window,n=null!=(e=t.SpeechRecognition)?e:t.webkitSpeechRecognition;if(!n)return void alert("Use your WhisperFlow shortcut to dictate into the text field.");if($&&tp.current){tp.current.stop(),Q(!1);return}let a=new n;a.continuous=!1,a.interimResults=!0,a.lang="en-US",a.onstart=()=>Q(!0),a.onend=()=>Q(!1),a.onerror=()=>Q(!1),a.onresult=e=>J(Array.from(e.results).map(e=>e[0].transcript).join("")),tp.current=a,a.start()},[$]),tw=(0,i.useCallback)(e=>{if(ed===e.id){window.speechSynthesis.cancel(),ep(null);return}window.speechSynthesis.cancel();let t=new SpeechSynthesisUtterance(e.content);t.rate=.92,t.pitch=1.05;let n=window.speechSynthesis.getVoices().find(e=>"Samantha"===e.name);n&&(t.voice=n),t.onend=()=>ep(null),ep(e.id),window.speechSynthesis.speak(t)},[ed]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(B,{toasts:tt,onDismiss:ta}),e5&&(0,a.jsx)(M,{onClose:()=>e8(!1)}),e7&&(0,a.jsx)(R,{draft:e7,agentId:c,agentName:tu.name,onCancel:()=>te(null),onSave:async e=>{try{var t;let n=await fetch("/api/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,category:"general",agentId:c,promptTemplate:e.promptTemplate,inputs:[],outputType:"message"})});if(!n.ok)throw Error(null!=(t=(await n.json()).error)?t:"HTTP ".concat(n.status));tn.success('Saved "'.concat(e.name,'" to Templates.')),te(null)}catch(e){tn.error(e instanceof Error?e.message:"save failed")}}}),ti&&(0,a.jsx)(I,{onClose:()=>{to(!1);try{localStorage.setItem("leedab-onboarded","1")}catch(e){}},onLoadDemo:async()=>{try{await fetch("/api/demo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"seed"})}),e9(!0),tn.success("Demo data loaded.")}catch(e){tn.error(e instanceof Error?e.message:"demo load failed")}}}),eM&&(0,a.jsx)(L,{query:eE,onQueryChange:ez,inputRef:tc,conversations:F,onSelectAgent:e=>{tv(e),eR(!1),ez("")},onSelectView:e=>{ej(e),eR(!1),ez("")},onClose:()=>{eR(!1),ez("")}}),eI&&(0,a.jsx)(W,{agent:tu,agentId:c,conversations:F,onClose:()=>eA(!1)}),eD&&(0,a.jsx)(A,{notifs:eO,onMarkAllRead:()=>eL(e=>e.map(e=>({...e,read:!0}))),onClose:()=>eW(!1)}),(0,a.jsxs)("div",{style:{height:"100vh",display:"flex",flexDirection:"column",overflow:"hidden",background:u,color:"var(--ink)"},children:[(0,a.jsxs)("nav",{"data-app-nav":!0,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",height:52,borderBottom:"1px solid ".concat(g),background:m,flexShrink:0,fontFamily:'"JetBrains Mono", monospace',gap:12,minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,flex:1,minWidth:0},children:[e1&&(0,a.jsx)("button",{onClick:()=>{"agents"!==eb&&ej("agents"),"list"!==eq&&eG("list"),e6(!0)},"aria-label":"Open team rail",style:{background:"none",border:"1px solid ".concat(g),color:"var(--ink-3)",padding:"4px 8px",borderRadius:3,cursor:"pointer",fontSize:14},children:"☰"}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0,lineHeight:1},children:[(0,a.jsxs)("span",{style:{fontSize:18,fontFamily:S,fontStyle:"italic",fontWeight:500,letterSpacing:"-0.02em",color:"var(--ink)"},children:["LeedAB",(0,a.jsx)("span",{style:{color:v},children:"."})]}),(0,a.jsxs)("span",{"data-mobile-condense":!0,style:{fontSize:10,fontFamily:S,fontStyle:"italic",fontWeight:500,letterSpacing:"-0.02em",color:"var(--ink-5)",marginTop:1},children:["agentic ",(0,a.jsx)("span",{style:{color:v},children:"OS"})]})]}),(0,a.jsx)("div",{"data-mobile-tabs":!0,className:"no-scrollbar",style:{display:"flex",gap:2,overflowX:"auto",flex:1,minWidth:0,WebkitOverflowScrolling:"touch"},children:["agents","sessions","workflows","admin"].map(e=>(0,a.jsx)("button",{onClick:()=>{eb===e?eT(e=>!e):(ej(e),eT(!1))},style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,letterSpacing:"0.08em",padding:"4px 10px",background:"transparent",color:eb===e?f:"var(--ink-5)",borderTop:"none",borderRight:"none",borderLeft:"none",borderBottom:"2px solid ".concat(eb===e?f:"transparent"),cursor:"pointer",transition:"all 0.15s",textTransform:"uppercase",flexShrink:0,whiteSpace:"nowrap"},children:"agents"===e?"operators":e},e))})]}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexShrink:0},children:[(0,a.jsxs)("span",{"data-mobile-hide":!0,style:{fontSize:10,color:f,letterSpacing:"0.1em"},children:["● ",tg," ACTIVE"]}),(0,a.jsxs)("span",{"data-mobile-hide":!0,style:{fontSize:10,color:"var(--ink-6)"},children:[tf," \xb7 ",ty]}),(0,a.jsx)("div",{"data-mobile-hide":!0,style:{display:"flex",border:"1px solid ".concat(g),borderRadius:3,overflow:"hidden"},children:["list","orb"].map(e=>(0,a.jsx)("button",{onClick:()=>eG(e),style:{fontFamily:b,fontSize:9,letterSpacing:"0.08em",padding:"4px 8px",border:"none",background:eq===e?f:"transparent",color:eq===e?"var(--paper)":"var(--ink-5)",cursor:"pointer",textTransform:"uppercase",transition:"all 0.15s"},children:e},e))}),(0,a.jsx)("button",{onClick:()=>eK("dark"===eY?"light":"dark"),title:"Toggle theme",style:{background:"transparent",border:"1px solid ".concat(g),color:"var(--ink-4)",borderRadius:3,padding:"4px 8px",cursor:"pointer",fontFamily:b,fontSize:11,display:"flex",alignItems:"center",justifyContent:"center",width:28,height:24},children:"dark"===eY?"☀":"☾"}),(0,a.jsxs)("button",{onClick:()=>{eR(!0),ez("")},style:{background:h,border:"1px solid ".concat(g),color:"var(--ink-5)",borderRadius:3,padding:"4px 10px",cursor:"pointer",display:"flex",alignItems:"center",gap:6,fontFamily:'"JetBrains Mono", monospace',fontSize:10},children:[(0,a.jsx)("span",{style:{fontSize:11},children:"⌘"}),"L"]}),(0,a.jsx)("span",{"data-mobile-hide":!0,style:{display:"inline-flex"},children:(0,a.jsx)(P,{label:"USAGE",active:_,onClick:()=>Z(e=>!e)})}),(0,a.jsxs)("button",{onClick:()=>{eW(e=>!e),eD||eL(e=>e.map(e=>({...e,read:!0})))},style:{position:"relative",background:"none",border:"none",cursor:"pointer",color:tx>0?f:"var(--ink-5)",fontSize:14,padding:"4px 6px",transition:"color 0.15s"},children:["◎",tx>0&&(0,a.jsx)("span",{style:{position:"absolute",top:0,right:0,width:8,height:8,borderRadius:"50%",background:f,border:"2px solid ".concat(m),display:"block"}})]})]})]}),!ek&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{onChannelClick:e=>{eB(e),ej("admin")}}),(0,a.jsx)(ev,{})]}),_&&(0,a.jsx)("div",{className:"animate-fade-up",style:{borderBottom:"1px solid ".concat(g),background:m,padding:"20px 28px",flexShrink:0},children:ee?(0,a.jsxs)("div",{style:{maxWidth:900,margin:"0 auto"},children:[(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12,marginBottom:20},children:[{label:"Today \xb7 Requests",value:ee.todayTotals.requests.toString()},{label:"Today \xb7 Input",value:ee.todayTotals.inputTokens.toLocaleString()},{label:"Today \xb7 Output",value:ee.todayTotals.outputTokens.toLocaleString()},{label:"Today \xb7 Est. cost",value:"$".concat(ee.todayTotals.estimatedCost.toFixed(4))}].map(e=>{let{label:t,value:n}=e;return(0,a.jsxs)("div",{style:{background:h,border:"1px solid ".concat(g),borderRadius:3,padding:"12px 16px"},children:[(0,a.jsx)("div",{style:{fontSize:9,color:"var(--ink-5)",letterSpacing:"0.14em",marginBottom:6,fontFamily:'"JetBrains Mono", monospace'},children:t.toUpperCase()}),(0,a.jsx)("div",{style:{fontSize:20,fontWeight:700,color:"var(--ink)",fontFamily:'"JetBrains Mono", monospace'},children:n})]},t)})}),(0,a.jsx)("div",{style:{fontSize:9,color:"var(--ink-5)",letterSpacing:"0.14em",marginBottom:8,fontFamily:'"JetBrains Mono", monospace'},children:"ALL-TIME \xb7 BY AGENT"}),(0,a.jsxs)("table",{style:{width:"100%",fontSize:12,fontFamily:'"JetBrains Mono", monospace',borderCollapse:"collapse"},children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{style:{color:"var(--ink-5)",borderBottom:"1px solid ".concat(g)},children:["Agent","Requests","Input","Output","Est. Cost"].map(e=>(0,a.jsx)("th",{style:{textAlign:"Agent"!==e?"right":"left",paddingBottom:8,paddingRight:16,fontWeight:400},children:e},e))})}),(0,a.jsxs)("tbody",{children:[d.map(e=>{let t=ee.byAgent[e];return(0,a.jsxs)("tr",{style:{borderBottom:"1px solid ".concat(x)},children:[(0,a.jsxs)("td",{style:{padding:"8px 16px 8px 0",color:"var(--ink-3)"},children:[(0,a.jsx)("span",{style:{color:"var(--ink)",marginRight:8},children:k[e]}),l[e].name]}),(0,a.jsx)("td",{style:{padding:"8px 16px 8px 0",textAlign:"right",color:"var(--ink-5)"},children:t.requests}),(0,a.jsx)("td",{style:{padding:"8px 16px 8px 0",textAlign:"right",color:"var(--ink-5)"},children:t.inputTokens.toLocaleString()}),(0,a.jsx)("td",{style:{padding:"8px 16px 8px 0",textAlign:"right",color:"var(--ink-5)"},children:t.outputTokens.toLocaleString()}),(0,a.jsxs)("td",{style:{padding:"8px 0",textAlign:"right",color:f},children:["$",t.estimatedCost.toFixed(4)]})]},e)}),(0,a.jsxs)("tr",{style:{color:"var(--ink)"},children:[(0,a.jsx)("td",{style:{paddingTop:12,paddingRight:16},children:"Total"}),(0,a.jsx)("td",{style:{paddingTop:12,paddingRight:16,textAlign:"right"},children:ee.totals.requests}),(0,a.jsx)("td",{style:{paddingTop:12,paddingRight:16,textAlign:"right"},children:ee.totals.inputTokens.toLocaleString()}),(0,a.jsx)("td",{style:{paddingTop:12,paddingRight:16,textAlign:"right"},children:ee.totals.outputTokens.toLocaleString()}),(0,a.jsxs)("td",{style:{paddingTop:12,textAlign:"right",color:f,fontWeight:700},children:["$",ee.totals.estimatedCost.toFixed(4)]})]})]})]})]}):(0,a.jsx)("div",{style:{fontSize:12,color:"var(--ink-5)",fontFamily:'"JetBrains Mono", monospace'},children:"Loading…"})}),"inbox"===eb&&(0,a.jsx)(es,{toast:tn,onSelectAgent:tv}),"approvals"===eb&&(0,a.jsx)(ec,{toast:tn}),"roster"===eb&&(0,a.jsx)(eu,{toast:tn}),"workflows"===eb&&(0,a.jsx)(ef,{toast:tn,onSelectAgent:tv}),"runs"===eb&&(0,a.jsx)(ey,{}),"compute"===eb&&(0,a.jsx)(eS,{toast:tn,onSelectAgent:tv}),"sessions"===eb&&(0,a.jsx)(ew,{toast:tn}),"admin"===eb&&(0,a.jsx)(eC,{toast:tn,initialChannel:eF}),"agents"===eb&&(0,a.jsxs)("div",{style:{flex:1,display:"flex",overflow:"hidden"},children:["list"===eq&&!e1&&(0,a.jsx)(G,{selectedAgent:c,chatOpen:eh,conversations:F,onSelectAgent:tv}),"list"===eq&&e1&&e4&&(0,a.jsx)("div",{className:"team-rail-drawer",onClick:()=>e6(!1),children:(0,a.jsx)("div",{className:"team-rail-drawer-panel",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(G,{selectedAgent:c,chatOpen:eh,conversations:F,onSelectAgent:e=>{tv(e),e6(!1)}})})}),(0,a.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:eh?(0,a.jsxs)("div",{className:"animate-fade-up",style:{flex:1,margin:"16px 20px 16px 0",borderRadius:4,border:"1px solid ".concat(g),background:"var(--paper-3)",display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[ei?(0,a.jsxs)("div",{style:{flex:1,overflow:"hidden",background:"var(--paper-3)",display:"flex",flexDirection:"column"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid ".concat(g),flexShrink:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:14},children:[(0,a.jsx)("span",{style:{fontFamily:b,fontSize:10,color:f,letterSpacing:"0.14em"},children:"\xa7 BROADCAST"}),(0,a.jsxs)("span",{style:{fontFamily:S,fontSize:22,fontWeight:500,color:"var(--ink)",letterSpacing:"-0.01em"},children:[Object.values(el).filter(Boolean).length,"/",d.length," responded"]})]}),(0,a.jsx)("button",{onClick:()=>{eo(!1),ea(!1)},style:{fontFamily:b,fontSize:10,letterSpacing:"0.08em",padding:"5px 10px",border:"1px solid ".concat(g),background:"transparent",color:"var(--ink-5)",borderRadius:3,cursor:"pointer"},children:"CLOSE"})]}),(0,a.jsx)("div",{style:{flex:1,overflowX:"auto",overflowY:"hidden"},children:(0,a.jsx)("div",{style:{display:"flex",gap:12,padding:18,height:"100%"},children:[...d].sort((e,t)=>{var n,a,i,o;return(null!=(i=null==(n=el[t])?void 0:n.length)?i:0)-(null!=(o=null==(a=el[e])?void 0:a.length)?o:0)}).map(e=>{var t;let n=null!=(t=el[e])?t:"",i=n.length>0;return(0,a.jsxs)("div",{className:"animate-broadcast-slide",style:{width:360,flexShrink:0,background:"var(--paper-input)",border:"1px solid ".concat(i?"".concat(f,"66"):g),borderRadius:4,display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,a.jsxs)("div",{style:{padding:"10px 14px",borderBottom:"1px solid ".concat(x),display:"flex",alignItems:"center",gap:10,background:"var(--paper-2)",flexShrink:0},children:[(0,a.jsx)("span",{style:{fontFamily:b,fontWeight:700,fontSize:11,color:i?f:"var(--ink-5)",letterSpacing:"0.04em",width:28},children:k[e]}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink)",fontFamily:j,fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l[e].name}),(0,a.jsx)("div",{style:{fontFamily:b,fontSize:9,color:"var(--ink-6)",letterSpacing:"0.08em"},children:i?"".concat(n.length," chars"):"waiting…"})]}),!i&&(0,a.jsx)("span",{style:{display:"flex",gap:3,alignItems:"center"},children:[0,1,2].map(e=>(0,a.jsx)("span",{className:"typing-dot",style:{width:4,height:4,borderRadius:"50%",background:f,display:"inline-block"}},e))})]}),(0,a.jsx)("div",{className:"prose-agent",style:{flex:1,padding:"12px 14px",fontSize:12,overflowY:"auto"},children:n?(0,a.jsx)(o.oz,{children:n}):(0,a.jsx)("span",{style:{color:"var(--ink-7)"},children:"waiting…"})})]},e)})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 20px",borderBottom:"1px solid ".concat(g),flexShrink:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontFamily:'"JetBrains Mono", monospace',minWidth:0,flex:1},children:[(0,a.jsx)("span",{style:{fontSize:10,color:f,letterSpacing:"0.1em",flexShrink:0},children:w[c]}),(0,a.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"var(--ink)",letterSpacing:"0.06em",flexShrink:0},children:k[c]}),(0,a.jsxs)("span",{"data-mobile-hide":!0,style:{fontSize:13,color:"var(--ink-4)",fontFamily:'"Inter", sans-serif',overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["/ ",tu.name," agent"]})]}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[(0,a.jsx)("span",{"data-mobile-hide":!0,style:{display:"inline-flex"},children:(0,a.jsx)(H,{value:tm,options:tu.availableModels,onChange:e=>z(t=>({...t,[c]:e}))})}),(0,a.jsx)("span",{"data-mobile-hide":!0,style:{display:"inline-flex"},children:(0,a.jsx)(P,{label:"CONTEXT",active:eI,onClick:()=>eA(e=>!e)})}),(0,a.jsx)("span",{"data-mobile-hide":!0,style:{display:"inline-flex"},children:(0,a.jsx)(N,{disabled:0===th.length,onExport:tS})}),(0,a.jsx)("span",{"data-mobile-hide":!0,style:{display:"inline-flex"},children:(0,a.jsx)(P,{label:"SAVE AS WORKFLOW",disabled:0===th.filter(e=>"user"===e.role).length,onClick:()=>{let e=[...th].reverse().find(e=>"user"===e.role);if(!e)return void tn.error("Need at least one of your messages.");te({name:e.content.slice(0,60),description:"Saved from a ".concat(tu.name," chat thread."),promptTemplate:e.content})}})}),(0,a.jsx)("span",{"data-mobile-hide":!0,style:{display:"inline-flex"},children:(0,a.jsx)(P,{label:"CLEAR",disabled:0===th.length,onClick:tj})}),(0,a.jsx)("button",{onClick:()=>em(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--ink-5)",fontSize:18,lineHeight:1,padding:"0 2px",fontFamily:'"JetBrains Mono", monospace',transition:"color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--ink)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--ink-5)"},children:"\xd7"})]})]}),(0,a.jsx)("div",{ref:ts,style:{flex:1,overflowY:"auto",minHeight:0},children:(0,a.jsx)("div",{style:{maxWidth:720,margin:"0 auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:16},children:eU?(0,a.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:2,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:7,color:f,fontWeight:700},children:k[c]})}),(0,a.jsx)("div",{style:{padding:"10px 14px",background:"var(--paper-input)",borderRadius:"0 4px 4px 4px",border:"1px solid ".concat(g)},children:(0,a.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center",height:14},children:[0,1,2].map(e=>(0,a.jsx)("span",{className:"typing-dot",style:{width:5,height:5,borderRadius:"50%",background:g,display:"inline-block"}},e))})})]}):0===th.length?(0,a.jsx)(U,{agentName:tu.name,agentCode:k[c],agentSection:w[c],tagline:tu.tagline,onChipClick:e=>{var t;J(e),null==(t=td.current)||t.focus()}}):(0,a.jsxs)(a.Fragment,{children:[th.map((e,t)=>V&&t===th.length-1&&"assistant"===e.role&&""===e.content?null:(0,a.jsx)(K,{message:e,agentCode:k[c],isSpeaking:ed===e.id,onSpeak:tw,onRunTemplate:(e,t)=>{try{localStorage.setItem("leedab-pending-template",e),localStorage.setItem("leedab-pending-template-context",t)}catch(e){}ej("workflows")},conversationContext:th.slice(-4).map(e=>e.content).join("\n\n")},e.id)),V&&(null==(e=th[th.length-1])?void 0:e.content)===""&&(0,a.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:2,background:"var(--paper-input)",border:"1px solid ".concat(g),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,a.jsx)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:7,color:f,fontWeight:700},children:k[c]})}),(0,a.jsx)("div",{style:{padding:"10px 14px",background:"var(--paper-input)",borderRadius:"0 4px 4px 4px",border:"1px solid ".concat(g)},children:eJ?(0,a.jsxs)("span",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"var(--ink-5)",letterSpacing:"0.06em"},children:["⟳ ",eJ.replace(/_/g," "),"…"]}):(0,a.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center",height:14},children:[0,1,2].map(e=>(0,a.jsx)("span",{className:"typing-dot",style:{width:5,height:5,borderRadius:"50%",background:f,display:"inline-block"}},e))})})]})]})})})]}),(0,a.jsxs)("div",{onDragEnter:e=>{e.preventDefault(),e0(!0)},onDragOver:e=>{e.preventDefault(),e0(!0)},onDragLeave:e=>{e.currentTarget===e.target&&e0(!1)},onDrop:e=>{var t;e.preventDefault(),e0(!1),(null==(t=e.dataTransfer.files)?void 0:t.length)&&tl(e.dataTransfer.files)},style:{padding:"12px 20px",borderTop:"1px solid ".concat(g),flexShrink:0,position:"relative"},children:[eZ&&(0,a.jsx)("div",{style:{position:"absolute",inset:0,background:"".concat(f,"22"),border:"2px dashed ".concat(f),display:"flex",alignItems:"center",justifyContent:"center",fontFamily:b,fontSize:12,color:f,letterSpacing:"0.12em",pointerEvents:"none",zIndex:10},children:"DROP TO ATTACH"}),e$.length>0&&(0,a.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:[e$.map(e=>{let t=e.mimeType.startsWith("image/");return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",background:h,border:"1px solid ".concat(g),borderRadius:3,fontFamily:b,fontSize:10,color:"var(--ink-3)"},children:[t?(0,a.jsx)("img",{src:"/api/uploads/".concat(e.id),alt:"",style:{width:18,height:18,objectFit:"cover",borderRadius:2}}):(0,a.jsx)("span",{style:{fontSize:11},children:"\uD83D\uDCC4"}),(0,a.jsx)("span",{style:{maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,a.jsx)("button",{onClick:()=>tr(e.id),"aria-label":"remove",style:{background:"none",border:"none",color:"var(--ink-5)",cursor:"pointer",fontSize:13,lineHeight:1,padding:0},children:"\xd7"})]},e.id)}),eQ&&(0,a.jsx)("div",{style:{fontSize:10,color:"var(--ink-5)",fontFamily:b,alignSelf:"center"},children:"uploading…"})]}),(0,a.jsx)(q,{ref:td,value:D,onChange:J,onSubmit:tb,onVoice:tk,onBroadcast:()=>ea(e=>!e),onAttach:tl,hasAttachments:e$.length>0,disabled:V,isListening:$,broadcastMode:en,agentName:tu.name}),(0,a.jsxs)("div",{style:{marginTop:8,display:"flex",justifyContent:"space-between",fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"var(--ink-6)",letterSpacing:"0.08em"},children:[(0,a.jsxs)("span",{children:["ENTER TO SEND \xb7 ESC TO CLOSE \xb7 ⌘L SEARCH \xb7 DROP FILES TO ATTACH",$&&(0,a.jsx)("span",{style:{color:"#ef4444",marginLeft:8},children:"● REC"}),en&&(0,a.jsx)("span",{style:{color:f,marginLeft:8},children:"● BROADCAST"})]}),(0,a.jsx)("span",{children:tm.replace("claude-","").replace("-20251001","").toUpperCase()})]})]})]}):"orb"===eq?(0,a.jsx)(X,{selectedAgent:c,chatOpen:eh,conversations:F,onSelectAgent:tv}):(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"40px 32px"},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:10,color:"var(--ink-6)",letterSpacing:"0.14em",marginBottom:6},children:"\xa7 00 / OPERATORS"}),(0,a.jsxs)("div",{style:{fontFamily:S,fontStyle:"italic",fontSize:36,fontWeight:500,color:"var(--ink-2)",letterSpacing:"-0.02em",marginBottom:8},children:["Select an ",(0,a.jsx)("span",{style:{color:f},children:"operator"}),"."]}),(0,a.jsx)("div",{style:{fontSize:13,color:"var(--ink-4)",marginBottom:40,fontFamily:j},children:"The AI workforce, ready when you are."}),(0,a.jsx)("div",{style:{display:"flex",gap:16,flexWrap:"wrap",justifyContent:"center"},children:[{label:"OPERATORS ACTIVE",value:"".concat(tg,"/").concat(d.length)},{label:"CONVERSATIONS",value:"".concat(Object.values(F).filter(e=>e.length>0).length)}].map(e=>{let{label:t,value:n}=e;return(0,a.jsxs)("div",{style:{background:h,border:"1px solid ".concat(g),borderRadius:3,padding:"14px 24px",textAlign:"center",minWidth:140},children:[(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:8,color:"var(--ink-6)",letterSpacing:"0.14em",marginBottom:8},children:t}),(0,a.jsx)("div",{style:{fontFamily:'"JetBrains Mono", monospace',fontSize:22,fontWeight:700,color:"var(--ink)"},children:n})]},t)})}),(0,a.jsx)("p",{className:"animate-fade-in",style:{marginTop:40,fontSize:11,color:"var(--ink-6)",fontFamily:'"JetBrains Mono", monospace',letterSpacing:"0.1em"},children:"← select an agent \xb7 ⌘L to search"})]})})]})]})]})}},7659:(e,t,n)=>{Promise.resolve().then(n.bind(n,6087))}},e=>{e.O(0,[856,8441,1255,7358],()=>e(e.s=7659)),_N_E=e.O()}]);