cortex-react-components 2.28.4 → 2.29.0-beta.2

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 (281) hide show
  1. package/dist/{chunk-KY3ELFX5.mjs → chunk-2FHOBKU5.mjs} +1 -1
  2. package/dist/{chunk-UENQZNU3.mjs → chunk-2ZBHHV3P.mjs} +1 -1
  3. package/dist/{chunk-R4SE63GR.mjs → chunk-3W5SE2HO.mjs} +1 -1
  4. package/dist/{chunk-RUZVSK25.mjs → chunk-4AACW32B.mjs} +1 -1
  5. package/dist/{chunk-2TUBS2HM.mjs → chunk-4DESBE4R.mjs} +1 -1
  6. package/dist/{chunk-HD6E7KI2.mjs → chunk-4KVVVRGU.mjs} +1 -1
  7. package/dist/{chunk-COBOHCBL.mjs → chunk-5G7LCLOY.mjs} +1 -1
  8. package/dist/{chunk-QOZ2O3FG.mjs → chunk-5WTGNFUL.mjs} +1 -1
  9. package/dist/{chunk-CK2TD4BY.mjs → chunk-6A2O63AU.mjs} +1 -1
  10. package/dist/{chunk-VGWDYD6Z.mjs → chunk-6LJCQVKZ.mjs} +1 -1
  11. package/dist/{chunk-TKY52BNP.mjs → chunk-7HIL4GBK.mjs} +1 -1
  12. package/dist/{chunk-CTAIR3TE.mjs → chunk-7HLSAUWP.mjs} +1 -1
  13. package/dist/{chunk-DMCFEJ2C.mjs → chunk-7YSJAVXO.mjs} +1 -1
  14. package/dist/{chunk-MS7YIAWP.mjs → chunk-ABWLO5GA.mjs} +1 -1
  15. package/dist/{chunk-CNLALZ24.mjs → chunk-AGKZDANI.mjs} +1 -1
  16. package/dist/{chunk-75XBZHOC.mjs → chunk-AJ7A2ZQ3.mjs} +1 -1
  17. package/dist/chunk-AKQARBH3.mjs +4 -0
  18. package/dist/{chunk-LLED3RQS.mjs → chunk-BQJDTDBP.mjs} +1 -1
  19. package/dist/{chunk-UJW3KUW3.mjs → chunk-BXHRPSV4.mjs} +1 -1
  20. package/dist/{chunk-P7S6XFU4.mjs → chunk-CGL3R3BQ.mjs} +1 -1
  21. package/dist/{chunk-2VOOH4YJ.mjs → chunk-CKJEMPZR.mjs} +1 -1
  22. package/dist/{chunk-SNFBF6KT.mjs → chunk-CLMGLIGH.mjs} +1 -1
  23. package/dist/{chunk-4IVQWIYV.mjs → chunk-CTQADMXV.mjs} +1 -1
  24. package/dist/{chunk-SNTLCFXF.mjs → chunk-DDQVEARQ.mjs} +1 -1
  25. package/dist/chunk-DHYTERFI.mjs +4 -0
  26. package/dist/{chunk-FJ2HHNPX.mjs → chunk-DLX4NQ3T.mjs} +1 -1
  27. package/dist/{chunk-Q7KKN6MH.mjs → chunk-DNZWIOML.mjs} +1 -1
  28. package/dist/{chunk-QWFFSMKK.mjs → chunk-E4QGOITF.mjs} +1 -1
  29. package/dist/{chunk-LQASBVUG.mjs → chunk-EDTWODQF.mjs} +1 -1
  30. package/dist/{chunk-SX2LOHXX.mjs → chunk-FNOAYUJ3.mjs} +1 -1
  31. package/dist/{chunk-46N4YPMB.mjs → chunk-FOO5RONL.mjs} +1 -1
  32. package/dist/{chunk-CO6AQNZ5.mjs → chunk-G53ROINJ.mjs} +1 -1
  33. package/dist/{chunk-5EKGFFJD.mjs → chunk-G5UB3YKZ.mjs} +1 -1
  34. package/dist/{chunk-QKDYTCZC.mjs → chunk-GFYO6B7H.mjs} +1 -1
  35. package/dist/{chunk-NSMXJCXE.mjs → chunk-GLKM2IVW.mjs} +1 -1
  36. package/dist/{chunk-4USR4WTH.mjs → chunk-GMLLRSAH.mjs} +1 -1
  37. package/dist/{chunk-FX6IXEMQ.mjs → chunk-GPXPR7VT.mjs} +1 -1
  38. package/dist/{chunk-Z22NSJMF.mjs → chunk-HF33ZXKX.mjs} +1 -1
  39. package/dist/{chunk-EOXVYLPB.mjs → chunk-HFND7WDK.mjs} +1 -1
  40. package/dist/{chunk-K4MFTVNB.mjs → chunk-HOKWKEDE.mjs} +1 -1
  41. package/dist/{chunk-57PJ7CHJ.mjs → chunk-I75BFMO7.mjs} +1 -1
  42. package/dist/{chunk-MXMW65GM.mjs → chunk-IKVDX3WJ.mjs} +1 -1
  43. package/dist/{chunk-TUACRDU3.mjs → chunk-IXCX7SAL.mjs} +1 -1
  44. package/dist/{chunk-MCOHKE2T.mjs → chunk-JGKLAY6J.mjs} +1 -1
  45. package/dist/{chunk-VBSFVJM5.mjs → chunk-JJSIBEFX.mjs} +1 -1
  46. package/dist/{chunk-6XUIHSKG.mjs → chunk-JKVQOOCZ.mjs} +1 -1
  47. package/dist/{chunk-NCJAMNMQ.mjs → chunk-K7NFBXL3.mjs} +1 -1
  48. package/dist/{chunk-GJHJUG72.mjs → chunk-KGFSSFVZ.mjs} +1 -1
  49. package/dist/{chunk-3M5KHST3.mjs → chunk-KHJKOKJN.mjs} +1 -1
  50. package/dist/{chunk-6YHCNPFB.mjs → chunk-KOLP657S.mjs} +1 -1
  51. package/dist/{chunk-JDMIQLAZ.mjs → chunk-KSYES4GX.mjs} +1 -1
  52. package/dist/{chunk-AOQPH32M.mjs → chunk-LCHPGIER.mjs} +1 -1
  53. package/dist/{chunk-KX2NCNCS.mjs → chunk-LF55USCD.mjs} +1 -1
  54. package/dist/{chunk-B2TBKNIJ.mjs → chunk-LFXMB6YE.mjs} +1 -1
  55. package/dist/{chunk-6ZMZX5TB.mjs → chunk-LL7CRB4U.mjs} +1 -1
  56. package/dist/{chunk-VRHJOUL3.mjs → chunk-LMDGHBG2.mjs} +1 -1
  57. package/dist/{chunk-MH4YPGH4.mjs → chunk-LPCO4T25.mjs} +1 -1
  58. package/dist/{chunk-KPTGYVDM.mjs → chunk-MQG7MKTK.mjs} +1 -1
  59. package/dist/{chunk-TZKQXT7Y.mjs → chunk-N25B5TQ5.mjs} +1 -1
  60. package/dist/{chunk-U3PUWUVM.mjs → chunk-NCHC4HCU.mjs} +1 -1
  61. package/dist/{chunk-M2REXGQW.mjs → chunk-PKI57UXP.mjs} +1 -1
  62. package/dist/{chunk-LCSO56PM.mjs → chunk-PQYMYQXD.mjs} +1 -1
  63. package/dist/{chunk-56X4PU43.mjs → chunk-Q35D7SUU.mjs} +1 -1
  64. package/dist/{chunk-2R3MJSQ7.mjs → chunk-QHIZOLWH.mjs} +1 -1
  65. package/dist/{chunk-P2B3OITE.mjs → chunk-R422HRMQ.mjs} +1 -1
  66. package/dist/{chunk-6DQ7FEQQ.mjs → chunk-R7YCUNIS.mjs} +1 -1
  67. package/dist/{chunk-NPGGDQ6F.mjs → chunk-RKLOWJVN.mjs} +1 -1
  68. package/dist/{chunk-F6DMXMR4.mjs → chunk-S3OBSLA5.mjs} +1 -1
  69. package/dist/{chunk-D6PIOACL.mjs → chunk-S3R55V74.mjs} +1 -1
  70. package/dist/{chunk-NHEG5ZJ6.mjs → chunk-S4CCJK44.mjs} +1 -1
  71. package/dist/{chunk-6SWKEZN6.mjs → chunk-S7SHOCHM.mjs} +1 -1
  72. package/dist/{chunk-SPAOEUCG.mjs → chunk-SG5BHIQF.mjs} +1 -1
  73. package/dist/{chunk-53ERRCTV.mjs → chunk-SKTNOZL2.mjs} +1 -1
  74. package/dist/{chunk-EZC3YWSQ.mjs → chunk-SRCJSWQF.mjs} +1 -1
  75. package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
  76. package/dist/{chunk-LCEEFZH7.mjs → chunk-SRXU4X35.mjs} +1 -1
  77. package/dist/{chunk-6PS55VJZ.mjs → chunk-T46EPXCV.mjs} +1 -1
  78. package/dist/{chunk-LJFBHY4P.mjs → chunk-TBKC2B4Z.mjs} +1 -1
  79. package/dist/{chunk-TR6RBROH.mjs → chunk-U3OEUDKT.mjs} +1 -1
  80. package/dist/{chunk-47OE4ZPY.mjs → chunk-UE66RIJN.mjs} +1 -1
  81. package/dist/{chunk-ZHBYZ4HE.mjs → chunk-UW65QW5M.mjs} +1 -1
  82. package/dist/{chunk-MUHR5KA5.mjs → chunk-UXSJRXJQ.mjs} +1 -1
  83. package/dist/{chunk-XGGWZIPM.mjs → chunk-V4OXGW5U.mjs} +1 -1
  84. package/dist/{chunk-2HWSTGAP.mjs → chunk-VKUF2Y5T.mjs} +1 -1
  85. package/dist/{chunk-HSQAHQNP.mjs → chunk-W7QAGMX7.mjs} +1 -1
  86. package/dist/{chunk-2LINLX4S.mjs → chunk-WHOWQZV6.mjs} +1 -1
  87. package/dist/{chunk-MU5WPW4N.mjs → chunk-WPH2ALD6.mjs} +1 -1
  88. package/dist/{chunk-2UNIT7NC.mjs → chunk-XSPGO55P.mjs} +1 -1
  89. package/dist/{chunk-RS4WAAGI.mjs → chunk-XTUH2DJE.mjs} +1 -1
  90. package/dist/{chunk-FSCDCSVK.mjs → chunk-YCD46AKJ.mjs} +1 -1
  91. package/dist/{chunk-GS3P2V76.mjs → chunk-YONYS5B2.mjs} +1 -1
  92. package/dist/{chunk-6NIVIZQB.mjs → chunk-YZDNY3K4.mjs} +1 -1
  93. package/dist/{chunk-N52FSTLG.mjs → chunk-Z5W2WY26.mjs} +1 -1
  94. package/dist/{chunk-E6NVWHRS.mjs → chunk-ZERDRART.mjs} +1 -1
  95. package/dist/{chunk-FRXZ2OKW.mjs → chunk-ZGDSCGLC.mjs} +1 -1
  96. package/dist/{chunk-S4ES6P3Y.mjs → chunk-ZI77NERP.mjs} +1 -1
  97. package/dist/{chunk-X3YJJBFJ.mjs → chunk-ZKTIH47I.mjs} +1 -1
  98. package/dist/{chunk-CLGBBNRB.mjs → chunk-ZW24FGHA.mjs} +1 -1
  99. package/dist/components/AdvancedComponents/AppSidebar.mjs +1 -1
  100. package/dist/components/AdvancedComponents/CommentSection.mjs +1 -1
  101. package/dist/components/AdvancedComponents/app-header.mjs +1 -1
  102. package/dist/components/AdvancedComponents/index.mjs +1 -1
  103. package/dist/components/AdvancedComponents/notifications-panel.mjs +1 -1
  104. package/dist/components/AdvancedComponents/user-selection.mjs +1 -1
  105. package/dist/components/Blocks/Banner.mjs +1 -1
  106. package/dist/components/Blocks/CallToAction.mjs +1 -1
  107. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  108. package/dist/components/Blocks/Content.mjs +1 -1
  109. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  110. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  111. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  112. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  113. package/dist/components/Blocks/index.mjs +1 -1
  114. package/dist/components/CRM/CogeBoard.mjs +1 -1
  115. package/dist/components/CRM/DealDetails.mjs +1 -1
  116. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  117. package/dist/components/CRM/index.mjs +1 -1
  118. package/dist/components/Cards/ContentCard.mjs +1 -1
  119. package/dist/components/Cards/FeatureCard.mjs +1 -1
  120. package/dist/components/Cards/PricingCard.mjs +1 -1
  121. package/dist/components/Cards/ServiceCard.mjs +1 -1
  122. package/dist/components/Cards/index.mjs +1 -1
  123. package/dist/components/Chat/ChatInterface.mjs +1 -1
  124. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  125. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  126. package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
  127. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  128. package/dist/components/Chat/capability-menu.mjs +1 -1
  129. package/dist/components/Chat/chat-session-sidebar.mjs +1 -1
  130. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  131. package/dist/components/Chat/demo-tests.mjs +1 -1
  132. package/dist/components/Chat/demo.mjs +1 -1
  133. package/dist/components/Chat/example-usage.mjs +1 -1
  134. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  135. package/dist/components/Chat/index.mjs +1 -1
  136. package/dist/components/DigitalColleagues/DashboardHeader.mjs +1 -1
  137. package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
  138. package/dist/components/DigitalColleagues/MainPage.js +1 -1
  139. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  140. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  141. package/dist/components/DigitalColleagues/SearchableSelect.mjs +1 -1
  142. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  143. package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
  144. package/dist/components/DigitalColleagues/Views/TeamsIndexView.mjs +1 -1
  145. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  146. package/dist/components/DigitalColleagues/colleague-card.mjs +1 -1
  147. package/dist/components/DigitalColleagues/colleague-form.mjs +1 -1
  148. package/dist/components/DigitalColleagues/colleague-type-selection.mjs +1 -1
  149. package/dist/components/DigitalColleagues/digital-colleague-clone.mjs +1 -1
  150. package/dist/components/DigitalColleagues/digital-colleague-options.mjs +1 -1
  151. package/dist/components/DigitalColleagues/index.js +1 -1
  152. package/dist/components/DigitalColleagues/index.mjs +1 -1
  153. package/dist/components/DigitalColleagues/knowledge-search.mjs +1 -1
  154. package/dist/components/DigitalColleagues/team-form.mjs +1 -1
  155. package/dist/components/Foundary/DashboardHeader.mjs +1 -1
  156. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  157. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  158. package/dist/components/Foundary/LandingMenu.mjs +1 -1
  159. package/dist/components/Foundary/Login.mjs +1 -1
  160. package/dist/components/Foundary/MainPage.js +1 -1
  161. package/dist/components/Foundary/MainPage.mjs +1 -1
  162. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  163. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  164. package/dist/components/Foundary/RichText/index.mjs +1 -1
  165. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  166. package/dist/components/Foundary/SearchableSelect.mjs +1 -1
  167. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  168. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  169. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  170. package/dist/components/Foundary/Views/index.mjs +1 -1
  171. package/dist/components/Foundary/colleague-card.mjs +1 -1
  172. package/dist/components/Foundary/colleague-form.mjs +1 -1
  173. package/dist/components/Foundary/colleague-type-selection.mjs +1 -1
  174. package/dist/components/Foundary/document-edit.mjs +1 -1
  175. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  176. package/dist/components/Foundary/document-preview.mjs +1 -1
  177. package/dist/components/Foundary/file-edit.mjs +1 -1
  178. package/dist/components/Foundary/foundary-clone.mjs +1 -1
  179. package/dist/components/Foundary/foundary-layout.mjs +1 -1
  180. package/dist/components/Foundary/foundary-options.mjs +1 -1
  181. package/dist/components/Foundary/index.js +4 -4
  182. package/dist/components/Foundary/index.mjs +1 -1
  183. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  184. package/dist/components/Foundary/knowledge-search.mjs +1 -1
  185. package/dist/components/HeaderFooter/Header.js +1 -1
  186. package/dist/components/HeaderFooter/Header.mjs +1 -1
  187. package/dist/components/HeaderFooter/HeaderDesktop.js +1 -1
  188. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  189. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  190. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  191. package/dist/components/HeaderFooter/enhanced-header.mjs +1 -1
  192. package/dist/components/HeaderFooter/index.js +1 -1
  193. package/dist/components/HeaderFooter/index.mjs +1 -1
  194. package/dist/components/Heros/DashboardHero/DashboardHero.mjs +1 -1
  195. package/dist/components/Heros/DashboardHero/index.mjs +1 -1
  196. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  197. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  198. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  199. package/dist/components/Heros/PostHero/index.mjs +1 -1
  200. package/dist/components/Heros/RenderHero.mjs +1 -1
  201. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  202. package/dist/components/Heros/index.mjs +1 -1
  203. package/dist/components/Holidays/ApproveLeave.mjs +1 -1
  204. package/dist/components/Holidays/HolidayGrid.mjs +1 -1
  205. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  206. package/dist/components/Holidays/index.mjs +1 -1
  207. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  208. package/dist/components/Layouts/Print.mjs +1 -1
  209. package/dist/components/Layouts/SlideShow.mjs +1 -1
  210. package/dist/components/Layouts/index.mjs +1 -1
  211. package/dist/components/Menus/SidebarRight.mjs +1 -1
  212. package/dist/components/Menus/index.mjs +1 -1
  213. package/dist/components/Other/index.mjs +1 -1
  214. package/dist/components/Payload/RichText/index.mjs +1 -1
  215. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  216. package/dist/components/Payload/index.mjs +1 -1
  217. package/dist/components/Projects/EpicsView.mjs +1 -1
  218. package/dist/components/Projects/FileView.mjs +1 -1
  219. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  220. package/dist/components/Projects/PlanningView.mjs +1 -1
  221. package/dist/components/Projects/ProjectPage.mjs +1 -1
  222. package/dist/components/Projects/ProjectView.mjs +1 -1
  223. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  224. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  225. package/dist/components/Projects/TaskSidebar.mjs +1 -1
  226. package/dist/components/Projects/TasksView.mjs +1 -1
  227. package/dist/components/Projects/TeamSwitcher.mjs +1 -1
  228. package/dist/components/Projects/file-list.mjs +1 -1
  229. package/dist/components/Projects/index.mjs +1 -1
  230. package/dist/components/Projects/project-card.mjs +1 -1
  231. package/dist/components/Projects/team-card.mjs +1 -1
  232. package/dist/components/dc-temp/creative.mjs +1 -1
  233. package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
  234. package/dist/components/dc-temp/index.mjs +1 -1
  235. package/dist/components/index.js +29 -29
  236. package/dist/components/index.mjs +1 -1
  237. package/dist/components/ui/carousel.css +1 -0
  238. package/dist/components/ui/carousel.d.ts +20 -0
  239. package/dist/components/ui/carousel.js +4 -0
  240. package/dist/components/ui/carousel.mjs +2 -0
  241. package/dist/components/ui/index.d.ts +1 -0
  242. package/dist/components/ui/index.js +1 -1
  243. package/dist/components/ui/index.mjs +1 -1
  244. package/dist/decorators/Intranet.css +1 -0
  245. package/dist/decorators/Intranet.d.ts +7 -0
  246. package/dist/decorators/Intranet.js +4 -0
  247. package/dist/decorators/Intranet.mjs +1 -0
  248. package/dist/globals.css +1 -1
  249. package/dist/index.js +37 -37
  250. package/dist/index.mjs +1 -1
  251. package/dist/metafile-cjs.json +1 -1
  252. package/dist/metafile-esm.json +1 -1
  253. package/dist/pages/Blog.js +1 -1
  254. package/dist/pages/Blog.mjs +1 -1
  255. package/dist/pages/Documentation.js +1 -1
  256. package/dist/pages/Documentation.mjs +1 -1
  257. package/dist/pages/IndexPage.mjs +1 -1
  258. package/dist/pages/Intranet.js +2 -1
  259. package/dist/pages/Intranet.mjs +1 -1
  260. package/dist/pages/LandingPage.mjs +1 -1
  261. package/dist/pages/Page.js +1 -1
  262. package/dist/pages/Page.mjs +1 -1
  263. package/dist/pages/Publish.mjs +1 -1
  264. package/dist/pages/Website.js +1 -1
  265. package/dist/pages/Website.mjs +1 -1
  266. package/dist/sections/AboutSection.mjs +1 -1
  267. package/dist/sections/BlogDetail.mjs +1 -1
  268. package/dist/sections/BlogList.mjs +1 -1
  269. package/dist/sections/BlogListSection.mjs +1 -1
  270. package/dist/sections/ContactSection.mjs +1 -1
  271. package/dist/sections/MainPageSection.mjs +1 -1
  272. package/dist/sections/PageSections.js +1 -1
  273. package/dist/sections/PageSections.mjs +1 -1
  274. package/dist/sections/PricingSection.mjs +1 -1
  275. package/dist/sections/ServiceDetail.mjs +1 -1
  276. package/dist/sections/ServiceDetailSection.mjs +1 -1
  277. package/dist/sections/ServiceSection.mjs +1 -1
  278. package/dist/sections/form/index.mjs +1 -1
  279. package/dist/sections/index.mjs +1 -1
  280. package/package.json +3 -1
  281. package/dist/chunk-WUA65ZZB.mjs +0 -4
@@ -1 +1 @@
1
- import{a as n}from"./chunk-SV7NMNDI.mjs";import{f as s,g as m}from"./chunk-FRXZ2OKW.mjs";import{a as o}from"./chunk-MDJREBVI.mjs";import{jsx as e,jsxs as p}from"react/jsx-runtime";function x({services:t,className:f,title:r,content:i}){let d={settings:{width:"full",card:"light"}};return p("div",{className:"pb-4 md:pb-0",children:[p("div",{className:o("w-full text-left prose"),children:[r&&e("h2",{className:"text-primary",children:r}),e("div",{className:"pb-12 ",children:i&&e(s,{enableGutter:!1,content:i,enableProse:!1,className:o("prose prose-headings:text-foreground prose-p:text-foreground")})})]}),t&&t.length>0&&e("div",{className:"-mx-4 flex flex-wrap justify-between gap-y-8",children:t.map((a,l)=>e("div",{"data-aos":"fade-up","data-aos-delay":n([200,400,600],l),className:"w-full px-4 md:w-1/2 lg:w-1/3 flex",children:e(m,{...d,icon:{type:"none"},title:a.title,image:a.image,content:a.content,link:a.link,className:"w-full"})},l))})]})}export{x as a};
1
+ import{a as n}from"./chunk-SV7NMNDI.mjs";import{f as s,g as m}from"./chunk-ZGDSCGLC.mjs";import{a as o}from"./chunk-MDJREBVI.mjs";import{jsx as e,jsxs as p}from"react/jsx-runtime";function x({services:t,className:f,title:r,content:i}){let d={settings:{width:"full",card:"light"}};return p("div",{className:"pb-4 md:pb-0",children:[p("div",{className:o("w-full text-left prose"),children:[r&&e("h2",{className:"text-primary",children:r}),e("div",{className:"pb-12 ",children:i&&e(s,{enableGutter:!1,content:i,enableProse:!1,className:o("prose prose-headings:text-foreground prose-p:text-foreground")})})]}),t&&t.length>0&&e("div",{className:"-mx-4 flex flex-wrap justify-between gap-y-8",children:t.map((a,l)=>e("div",{"data-aos":"fade-up","data-aos-delay":n([200,400,600],l),className:"w-full px-4 md:w-1/2 lg:w-1/3 flex",children:e(m,{...d,icon:{type:"none"},title:a.title,image:a.image,content:a.content,link:a.link,className:"w-full"})},l))})]})}export{x as a};
@@ -1 +1 @@
1
- import{a as l}from"./chunk-ZNSW443Y.mjs";import{a as r}from"./chunk-Z22NSJMF.mjs";import{useState as u}from"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function p({documents:a=[],contexts:d=[],onDocumentClick:i=o=>console.log("Document clicked:",o),onDocumentShare:m=o=>console.log("Share document:",o),onLoadDocumentContent:g,selectedDocumentId:c}){let[o,s]=u(d[0]);return!d||d.length===0?t("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[e("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:e(r,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:e("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):t("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[t("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[e(r,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),t("div",{className:"mt-6",children:[e("div",{className:"border-b border-border",children:e("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:d.map(n=>t("button",{onClick:()=>s(n),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${o.id===n.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[n.icon,n.label]},n.id))})}),o.description&&e("div",{className:"mt-3 px-1",children:e("p",{className:"text-sm text-muted-foreground",children:o.description})})]})]}),e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:e("div",{className:"h-full rounded-3xl border overflow-hidden",children:e(l,{documents:a,menuConfig:o.menuConfig,onDocumentClick:i,onDocumentShare:m,selectedDocumentId:c})})})]})}export{p as a};
1
+ import{a as l}from"./chunk-ZNSW443Y.mjs";import{a as r}from"./chunk-HF33ZXKX.mjs";import{useState as u}from"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function p({documents:a=[],contexts:d=[],onDocumentClick:i=o=>console.log("Document clicked:",o),onDocumentShare:m=o=>console.log("Share document:",o),onLoadDocumentContent:g,selectedDocumentId:c}){let[o,s]=u(d[0]);return!d||d.length===0?t("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[e("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:e(r,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:e("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):t("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[t("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[e(r,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),t("div",{className:"mt-6",children:[e("div",{className:"border-b border-border",children:e("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:d.map(n=>t("button",{onClick:()=>s(n),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${o.id===n.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[n.icon,n.label]},n.id))})}),o.description&&e("div",{className:"mt-3 px-1",children:e("p",{className:"text-sm text-muted-foreground",children:o.description})})]})]}),e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:e("div",{className:"h-full rounded-3xl border overflow-hidden",children:e(l,{documents:a,menuConfig:o.menuConfig,onDocumentClick:i,onDocumentShare:m,selectedDocumentId:c})})})]})}export{p as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as c}from"./chunk-5RTGHMF3.mjs";import{b as o}from"./chunk-ZUA4KNIR.mjs";import{b as m}from"./chunk-CSBGSBEU.mjs";import{a as s,b as t,c as i,d as n,e as d,f as l}from"./chunk-YO3GQYRJ.mjs";import{motion as f}from"motion/react";import{Star as N}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function A({app:r,onOpen:p,onFavorite:C,showProgress:u=!1,className:v}){return e(f.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:v,children:a(s,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[e(t,{className:"pb-2",children:a("div",{className:"flex items-center justify-between",children:[e("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:r.icon}),r.new?e(m,{className:"rounded-xl bg-amber-500",children:"New"}):e(o,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>C?.(r),children:e(N,{className:"h-4 w-4"})})]})}),a(d,{className:"pb-2",children:[e(i,{className:"text-lg",children:r.name}),e(n,{children:r.description}),u&&r.progress<100&&a("div",{className:"mt-2",children:[a("div",{className:"flex items-center justify-between text-sm",children:[e("span",{children:"Installation"}),a("span",{children:[r.progress,"%"]})]}),e(c,{value:r.progress,className:"h-2 mt-1 rounded-xl"})]})]}),e(l,{children:e(o,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>p?.(r),children:r.progress<100?"Continue Install":"Open"})})]})})}export{A as a};
4
+ import{a as c}from"./chunk-5RTGHMF3.mjs";import{b as m}from"./chunk-CSBGSBEU.mjs";import{a as s,b as t,c as i,d as n,e as d,f as l}from"./chunk-YO3GQYRJ.mjs";import{b as o}from"./chunk-ZUA4KNIR.mjs";import{motion as f}from"motion/react";import{Star as N}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function A({app:r,onOpen:p,onFavorite:C,showProgress:u=!1,className:v}){return e(f.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:v,children:a(s,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[e(t,{className:"pb-2",children:a("div",{className:"flex items-center justify-between",children:[e("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:r.icon}),r.new?e(m,{className:"rounded-xl bg-amber-500",children:"New"}):e(o,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>C?.(r),children:e(N,{className:"h-4 w-4"})})]})}),a(d,{className:"pb-2",children:[e(i,{className:"text-lg",children:r.name}),e(n,{children:r.description}),u&&r.progress<100&&a("div",{className:"mt-2",children:[a("div",{className:"flex items-center justify-between text-sm",children:[e("span",{children:"Installation"}),a("span",{children:[r.progress,"%"]})]}),e(c,{value:r.progress,className:"h-2 mt-1 rounded-xl"})]})]}),e(l,{children:e(o,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>p?.(r),children:r.progress<100?"Continue Install":"Open"})})]})})}export{A as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{f as t}from"./chunk-FRXZ2OKW.mjs";import{a}from"./chunk-MDJREBVI.mjs";import n from"react";import*as l from"@radix-ui/react-collapsible";import{ChevronDownIcon as c,ChevronUpIcon as m}from"@radix-ui/react-icons";import{jsx as e,jsxs as s}from"react/jsx-runtime";var h=({title:p,richText:r})=>{let[o,i]=n.useState(!1);return e("div",{className:"border rounded-lg overflow-hidden",children:s(l.Root,{className:a("w-full"),open:o,onOpenChange:i,children:[s(l.Trigger,{className:"flex w-full items-center justify-between bg-white px-4 py-3 text-left hover:bg-gray-50",children:[e("h2",{className:"text-lg font-medium",children:p}),o?e(m,{className:"h-6 w-6"}):e(c,{className:"h-6 w-6"})]}),e(l.Content,{className:"overflow-hidden data-[state=closed]:animate-collapse data-[state=open]:animate-expand border-t",children:e("div",{className:"px-4 py-3 bg-white",children:e(t,{content:r||{},enableGutter:!1})})})]})})};export{h as a};
4
+ import{f as t}from"./chunk-ZGDSCGLC.mjs";import{a}from"./chunk-MDJREBVI.mjs";import n from"react";import*as l from"@radix-ui/react-collapsible";import{ChevronDownIcon as c,ChevronUpIcon as m}from"@radix-ui/react-icons";import{jsx as e,jsxs as s}from"react/jsx-runtime";var h=({title:p,richText:r})=>{let[o,i]=n.useState(!1);return e("div",{className:"border rounded-lg overflow-hidden",children:s(l.Root,{className:a("w-full"),open:o,onOpenChange:i,children:[s(l.Trigger,{className:"flex w-full items-center justify-between bg-white px-4 py-3 text-left hover:bg-gray-50",children:[e("h2",{className:"text-lg font-medium",children:p}),o?e(m,{className:"h-6 w-6"}):e(c,{className:"h-6 w-6"})]}),e(l.Content,{className:"overflow-hidden data-[state=closed]:animate-collapse data-[state=open]:animate-expand border-t",children:e("div",{className:"px-4 py-3 bg-white",children:e(t,{content:r||{},enableGutter:!1})})})]})})};export{h as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{b as n}from"./chunk-JQL4XGAF.mjs";import{a as i,b as d,c}from"./chunk-YNCJATT7.mjs";import{b as m}from"./chunk-CSBGSBEU.mjs";import{a as s}from"./chunk-MDJREBVI.mjs";import{CheckCircleIcon as u,ChevronDownIcon as v,CircleIcon as x,ClockIcon as g,WrenchIcon as N,XCircleIcon as f}from"lucide-react";import{isValidElement as P}from"react";import{jsx as e,jsxs as r}from"react/jsx-runtime";var U=({className:t,...o})=>e(i,{className:s("not-prose mb-4 w-full rounded-md border",t),...o}),C=t=>{let o={"input-streaming":"Pending","input-available":"Running","approval-requested":"Awaiting Approval","approval-responded":"Responded","output-available":"Completed","output-error":"Error","output-denied":"Denied"};return r(m,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":e(x,{className:"size-4"}),"input-available":e(g,{className:"size-4 animate-pulse"}),"approval-requested":e(g,{className:"size-4 text-yellow-600"}),"approval-responded":e(u,{className:"size-4 text-blue-600"}),"output-available":e(u,{className:"size-4 text-green-600"}),"output-error":e(f,{className:"size-4 text-red-600"}),"output-denied":e(f,{className:"size-4 text-orange-600"})}[t],o[t]]})},h=({className:t,title:o,type:a,state:p,...l})=>r(d,{className:s("flex w-full items-center justify-between gap-4 p-3",t),...l,children:[r("div",{className:"flex items-center gap-2",children:[e(N,{className:"size-4 text-muted-foreground"}),e("span",{className:"font-medium text-sm",children:o??a.split("-").slice(1).join("-")}),C(p)]}),e(v,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),R=({className:t,...o})=>e(c,{className:s("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",t),...o}),O=({className:t,input:o,...a})=>r("div",{className:s("space-y-2 overflow-hidden p-4",t),...a,children:[e("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),e("div",{className:"rounded-md bg-muted/50",children:e(n,{code:JSON.stringify(o,null,2),language:"json"})})]}),j=({className:t,output:o,errorText:a,...p})=>{if(!(o||a))return null;let l=e("div",{children:o});return typeof o=="object"&&!P(o)?l=e(n,{code:JSON.stringify(o,null,2),language:"json"}):typeof o=="string"&&(l=e(n,{code:o,language:"json"})),r("div",{className:s("space-y-2 p-4",t),...p,children:[e("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),r("div",{className:s("overflow-x-auto rounded-md text-xs [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&e("div",{children:a}),l]})]})};export{U as a,h as b,R as c,O as d,j as e};
4
+ import{b as n}from"./chunk-JQL4XGAF.mjs";import{b as m}from"./chunk-CSBGSBEU.mjs";import{a as i,b as d,c}from"./chunk-YNCJATT7.mjs";import{a as s}from"./chunk-MDJREBVI.mjs";import{CheckCircleIcon as u,ChevronDownIcon as v,CircleIcon as x,ClockIcon as g,WrenchIcon as N,XCircleIcon as f}from"lucide-react";import{isValidElement as P}from"react";import{jsx as e,jsxs as r}from"react/jsx-runtime";var U=({className:t,...o})=>e(i,{className:s("not-prose mb-4 w-full rounded-md border",t),...o}),C=t=>{let o={"input-streaming":"Pending","input-available":"Running","approval-requested":"Awaiting Approval","approval-responded":"Responded","output-available":"Completed","output-error":"Error","output-denied":"Denied"};return r(m,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":e(x,{className:"size-4"}),"input-available":e(g,{className:"size-4 animate-pulse"}),"approval-requested":e(g,{className:"size-4 text-yellow-600"}),"approval-responded":e(u,{className:"size-4 text-blue-600"}),"output-available":e(u,{className:"size-4 text-green-600"}),"output-error":e(f,{className:"size-4 text-red-600"}),"output-denied":e(f,{className:"size-4 text-orange-600"})}[t],o[t]]})},h=({className:t,title:o,type:a,state:p,...l})=>r(d,{className:s("flex w-full items-center justify-between gap-4 p-3",t),...l,children:[r("div",{className:"flex items-center gap-2",children:[e(N,{className:"size-4 text-muted-foreground"}),e("span",{className:"font-medium text-sm",children:o??a.split("-").slice(1).join("-")}),C(p)]}),e(v,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),R=({className:t,...o})=>e(c,{className:s("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",t),...o}),O=({className:t,input:o,...a})=>r("div",{className:s("space-y-2 overflow-hidden p-4",t),...a,children:[e("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),e("div",{className:"rounded-md bg-muted/50",children:e(n,{code:JSON.stringify(o,null,2),language:"json"})})]}),j=({className:t,output:o,errorText:a,...p})=>{if(!(o||a))return null;let l=e("div",{children:o});return typeof o=="object"&&!P(o)?l=e(n,{code:JSON.stringify(o,null,2),language:"json"}):typeof o=="string"&&(l=e(n,{code:o,language:"json"})),r("div",{className:s("space-y-2 p-4",t),...p,children:[e("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),r("div",{className:s("overflow-x-auto rounded-md text-xs [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&e("div",{children:a}),l]})]})};export{U as a,h as b,R as c,O as d,j as e};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a}from"./chunk-6YHCNPFB.mjs";import{a as b}from"./chunk-F6DMXMR4.mjs";import{a as g}from"./chunk-MDJREBVI.mjs";import{useState as l}from"react";import{User as P}from"lucide-react";import{jsx as i,jsxs as h}from"react/jsx-runtime";var v=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:i(P,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function E({sidebarItems:r,children:U,title:C="Digital Colleagues",notifications:N=[],currentBusinessUnit:B=v[0],onBusinessUnitChange:y,onSearch:c,businessUnits:F=v,activeTab:x,onTabChange:T,showTabs:k=!1,onActionClick:A,actionIcon:R,actionText:S="Action",onNotificationRemove:w,onRemoveAll:M,logo:n="/headerlogo.png",logoLink:d="/teams",appName:o="Nuvia",tagline:s="Collaboration Platform",sidebarInitiallyClosed:O=!1}){let[e,I]=l(!O),[m,t]=l(!1),[u,L]=l(B),p=f=>{L(f),y?.(f)};return h("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[m&&i("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>t(!1)}),i("div",{className:"md:hidden",children:i(a,{items:r,isOpen:m,isMobile:!0,onClose:()=>t(!1),currentBusinessUnit:u,onBusinessUnitChange:p,onSearch:c,logo:n,logoLink:d,appName:o,tagline:s})}),i("div",{className:"hidden md:block",children:i(a,{items:r,isOpen:e,isMobile:!1,currentBusinessUnit:u,onBusinessUnitChange:p,onSearch:c,logo:n,logoLink:d,appName:o,tagline:s})}),h("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",e?"md:pl-64":"md:pl-0"),children:[i(b,{title:C,notifications:N,onToggleSidebar:()=>I(!e),onToggleMobileMenu:()=>t(!0),sidebarOpen:e,activeTab:x,onTabChange:T,showTabs:k,onActionClick:A,actionIcon:R,actionText:S,onNotificationRemove:w,onRemoveAll:M,logo:n,appName:o,tagline:s}),i("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-y-scroll",children:U})]})]})}export{E as a};
4
+ import{a}from"./chunk-KOLP657S.mjs";import{a as b}from"./chunk-S3OBSLA5.mjs";import{a as g}from"./chunk-MDJREBVI.mjs";import{useState as l}from"react";import{User as P}from"lucide-react";import{jsx as i,jsxs as h}from"react/jsx-runtime";var v=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:i(P,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function E({sidebarItems:r,children:U,title:C="Digital Colleagues",notifications:N=[],currentBusinessUnit:B=v[0],onBusinessUnitChange:y,onSearch:c,businessUnits:F=v,activeTab:x,onTabChange:T,showTabs:k=!1,onActionClick:A,actionIcon:R,actionText:S="Action",onNotificationRemove:w,onRemoveAll:M,logo:n="/headerlogo.png",logoLink:d="/teams",appName:o="Nuvia",tagline:s="Collaboration Platform",sidebarInitiallyClosed:O=!1}){let[e,I]=l(!O),[m,t]=l(!1),[u,L]=l(B),p=f=>{L(f),y?.(f)};return h("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[m&&i("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>t(!1)}),i("div",{className:"md:hidden",children:i(a,{items:r,isOpen:m,isMobile:!0,onClose:()=>t(!1),currentBusinessUnit:u,onBusinessUnitChange:p,onSearch:c,logo:n,logoLink:d,appName:o,tagline:s})}),i("div",{className:"hidden md:block",children:i(a,{items:r,isOpen:e,isMobile:!1,currentBusinessUnit:u,onBusinessUnitChange:p,onSearch:c,logo:n,logoLink:d,appName:o,tagline:s})}),h("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",e?"md:pl-64":"md:pl-0"),children:[i(b,{title:C,notifications:N,onToggleSidebar:()=>I(!e),onToggleMobileMenu:()=>t(!0),sidebarOpen:e,activeTab:x,onTabChange:T,showTabs:k,onActionClick:A,actionIcon:R,actionText:S,onNotificationRemove:w,onRemoveAll:M,logo:n,appName:o,tagline:s}),i("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-y-scroll",children:U})]})]})}export{E as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as b}from"./chunk-RS4WAAGI.mjs";import{a as I}from"./chunk-56X4PU43.mjs";import{a as S}from"./chunk-MCOHKE2T.mjs";import{useChat as me}from"@ai-sdk/react";import{useState as l}from"react";import{motion as fe,AnimatePresence as he}from"motion/react";import{Users as ye}from"lucide-react";import{jsx as n,jsxs as Ce}from"react/jsx-runtime";function Le({aiConfig:w,useCustomChat:F,enableAI:T=!0,messages:D=[],businessUnits:R=[],capabilities:B=[],sidebarItems:x=[],notifications:N=[],sessions:M=[],onNewChat:A,onSessionSelect:L,onSessionDelete:P,onSessionEdit:k=()=>{},onBusinessUnitChange:E=()=>{},onNotificationRemove:K=()=>{},onRemoveAll:O=()=>{},onActionClick:$=()=>{},onSearch:q=p=>console.log("Search query:",p),initialTeam:z="design",currentSession:m=null,showCapabilities:ve=!0,title:W="Digital Colleagues",enableFileUpload:f=!0,maxFileSize:h=10,allowedFileTypes:y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:H="/headerlogo.png",appName:X="Nuvia",tagline:G="AI-Powered Workspace",actionIcon:J=n(ye,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate",sidebarInitiallyClosed:V=!1}){let p={...w,onError:e=>{i?.setMessages(t=>[...t,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:e.message}]}]),console.error("Error in CopilotInterface:",e)}},Y=me(p||{}),i=T?F||Y:null,[Z,u]=l(""),[_,C]=l(!1),j=i?.messages||D,r=Z,ee=i?.status==="submitted"||_,se=i?.addToolResult?(e,t,s)=>{i.addToolResult({tool:t,toolCallId:e,output:s}),console.log("Tool result added:",{toolCallId:e,tool:t,output:s}),i.sendMessage()}:()=>{console.log("addToolResult not available")},o=R||[],te={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[ie,ne]=l(()=>o.length===0?te:o.find(e=>e.id===z)||o[0]),[a,c]=l([]),[oe,ae]=l(!1),le=e=>{if(!e||!f)return;let t=[];Array.from(e).forEach(s=>{if(s.size>h*1024*1024){alert(`File ${s.name} is too large. Maximum size is ${h}MB.`);return}if(y.length>0&&!y.some(d=>s.type.match(d))){alert(`File type ${s.type} is not allowed.`);return}let U={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:s,status:"pending",progress:0};if(s.type.startsWith("image/")){let d=new FileReader;d.onload=ue=>{c(ge=>ge.map(g=>g.id===U.id?{...g,preview:ue.target?.result}:g))},d.readAsDataURL(s)}t.push(U)}),c(s=>[...s,...t])},re=e=>{c(t=>t.filter(s=>s.id!==e))},v=()=>{if(!(!r.trim()&&a.length===0)){if(i){let e=a.length>0?ce(a.map(t=>t.file)):void 0;i.sendMessage({text:r,files:e},{body:{timestamp:Date.now()}}),u("")}else console.log("Message to send:",r),console.log("Files to upload:",a),u(""),C(!0),setTimeout(()=>{C(!1)},1500);c([])}},ce=e=>{let t=new DataTransfer;return e.forEach(s=>t.items.add(s)),t.files},de=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),v())},pe=e=>{u(e)};return n(b,{sidebarItems:x||[],title:W,notifications:N||[],businessUnits:o,currentBusinessUnit:ie,onBusinessUnitChange:e=>{e&&(ne(e),E?.(e))},onSearch:q,showTabs:!1,onActionClick:$,actionIcon:J,actionText:Q,onNotificationRemove:K,onRemoveAll:O,logo:H,appName:X,tagline:G,sidebarInitiallyClosed:V,children:n(he,{mode:"wait",children:n(fe.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:Ce("div",{className:"h-full flex",children:[n("div",{className:"w-80 flex-shrink-0 h-full p-2",children:n(I,{sessions:M||[],currentSession:m,teams:o,onNewChat:A,onSessionSelect:L,onSessionEdit:k,onSessionDelete:P})}),n("div",{className:"flex-1 h-full p-2",children:n(S,{messages:j||[],input:r,isTyping:ee,currentSessionTitle:m?.title,capabilities:B||[],onInputChange:pe,addToolResult:se,onSendMessage:v,onKeyPress:de,fileUploads:a,isDragOver:oe,enableFileUpload:f,onFileUpload:le,onRemoveFile:re,onDragOver:ae})})]})},"chat-interface")})})}export{Le as a};
4
+ import{a as b}from"./chunk-XTUH2DJE.mjs";import{a as I}from"./chunk-Q35D7SUU.mjs";import{a as S}from"./chunk-JGKLAY6J.mjs";import{useChat as me}from"@ai-sdk/react";import{useState as l}from"react";import{motion as fe,AnimatePresence as he}from"motion/react";import{Users as ye}from"lucide-react";import{jsx as n,jsxs as Ce}from"react/jsx-runtime";function Le({aiConfig:w,useCustomChat:F,enableAI:T=!0,messages:D=[],businessUnits:R=[],capabilities:B=[],sidebarItems:x=[],notifications:N=[],sessions:M=[],onNewChat:A,onSessionSelect:L,onSessionDelete:P,onSessionEdit:k=()=>{},onBusinessUnitChange:E=()=>{},onNotificationRemove:K=()=>{},onRemoveAll:O=()=>{},onActionClick:$=()=>{},onSearch:q=p=>console.log("Search query:",p),initialTeam:z="design",currentSession:m=null,showCapabilities:ve=!0,title:W="Digital Colleagues",enableFileUpload:f=!0,maxFileSize:h=10,allowedFileTypes:y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:H="/headerlogo.png",appName:X="Nuvia",tagline:G="AI-Powered Workspace",actionIcon:J=n(ye,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate",sidebarInitiallyClosed:V=!1}){let p={...w,onError:e=>{i?.setMessages(t=>[...t,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:e.message}]}]),console.error("Error in CopilotInterface:",e)}},Y=me(p||{}),i=T?F||Y:null,[Z,u]=l(""),[_,C]=l(!1),j=i?.messages||D,r=Z,ee=i?.status==="submitted"||_,se=i?.addToolResult?(e,t,s)=>{i.addToolResult({tool:t,toolCallId:e,output:s}),console.log("Tool result added:",{toolCallId:e,tool:t,output:s}),i.sendMessage()}:()=>{console.log("addToolResult not available")},o=R||[],te={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[ie,ne]=l(()=>o.length===0?te:o.find(e=>e.id===z)||o[0]),[a,c]=l([]),[oe,ae]=l(!1),le=e=>{if(!e||!f)return;let t=[];Array.from(e).forEach(s=>{if(s.size>h*1024*1024){alert(`File ${s.name} is too large. Maximum size is ${h}MB.`);return}if(y.length>0&&!y.some(d=>s.type.match(d))){alert(`File type ${s.type} is not allowed.`);return}let U={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:s,status:"pending",progress:0};if(s.type.startsWith("image/")){let d=new FileReader;d.onload=ue=>{c(ge=>ge.map(g=>g.id===U.id?{...g,preview:ue.target?.result}:g))},d.readAsDataURL(s)}t.push(U)}),c(s=>[...s,...t])},re=e=>{c(t=>t.filter(s=>s.id!==e))},v=()=>{if(!(!r.trim()&&a.length===0)){if(i){let e=a.length>0?ce(a.map(t=>t.file)):void 0;i.sendMessage({text:r,files:e},{body:{timestamp:Date.now()}}),u("")}else console.log("Message to send:",r),console.log("Files to upload:",a),u(""),C(!0),setTimeout(()=>{C(!1)},1500);c([])}},ce=e=>{let t=new DataTransfer;return e.forEach(s=>t.items.add(s)),t.files},de=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),v())},pe=e=>{u(e)};return n(b,{sidebarItems:x||[],title:W,notifications:N||[],businessUnits:o,currentBusinessUnit:ie,onBusinessUnitChange:e=>{e&&(ne(e),E?.(e))},onSearch:q,showTabs:!1,onActionClick:$,actionIcon:J,actionText:Q,onNotificationRemove:K,onRemoveAll:O,logo:H,appName:X,tagline:G,sidebarInitiallyClosed:V,children:n(he,{mode:"wait",children:n(fe.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:Ce("div",{className:"h-full flex",children:[n("div",{className:"w-80 flex-shrink-0 h-full p-2",children:n(I,{sessions:M||[],currentSession:m,teams:o,onNewChat:A,onSessionSelect:L,onSessionEdit:k,onSessionDelete:P})}),n("div",{className:"flex-1 h-full p-2",children:n(S,{messages:j||[],input:r,isTyping:ee,currentSessionTitle:m?.title,capabilities:B||[],onInputChange:pe,addToolResult:se,onSendMessage:v,onKeyPress:de,fileUploads:a,isDragOver:oe,enableFileUpload:f,onFileUpload:le,onRemoveFile:re,onDragOver:ae})})]})},"chat-interface")})})}export{Le as a};
@@ -1 +1 @@
1
- import{a as $}from"./chunk-Z22NSJMF.mjs";import{a as R,c as S,d as T,g as I,i as p}from"./chunk-YFAZQYK4.mjs";import{a as P}from"./chunk-B4H6T2GP.mjs";import{a as u}from"./chunk-TVZOULLL.mjs";import{a as A,f as B,g as E,i as O}from"./chunk-3UMMMQEH.mjs";import{a as h}from"./chunk-L5JPAKPM.mjs";import{b as x}from"./chunk-ZUA4KNIR.mjs";import{a as C,e as q}from"./chunk-YO3GQYRJ.mjs";import{useEffect as M,useState as D}from"react";import{Plus as W,Clock as Y,Calendar as G,User as J,Edit2 as Q,Trash2 as X}from"lucide-react";import{Fragment as de,jsx as e,jsxs as t}from"react/jsx-runtime";var Z=a=>a.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),_=a=>{let[o,m]=a.split(":"),c=new Date;return c.setHours(parseInt(o),parseInt(m)),c.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},U=(a,o)=>{let m=new Date,c=new Date(a);if(o){let[r,d]=o.split(":");c.setHours(parseInt(r),parseInt(d))}return c<m},H=a=>{let o=new Date;return a.toDateString()===o.toDateString()},ee=a=>{let o=new Date;return o.setDate(o.getDate()+1),a.toDateString()===o.toDateString()},te=({colleagues:a,onAddReminder:o,open:m,setOpen:c})=>{let[r,d]=D({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,v]=D(!1),N=n=>{if(n.preventDefault(),!a.find(F=>F?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),v(!0);return}v(!1);let k={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};o(k),c(!1),d({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};M(()=>{r.colleagueId&&v(!1)},[r.colleagueId]);let l=a.filter(Boolean);return e(A,{open:m,onOpenChange:c,children:t(B,{className:"max-w-2xl",children:[e(E,{children:e(O,{children:"Add New Reminder"})}),t("form",{onSubmit:N,className:"space-y-4",children:[e("div",{className:"grid grid-cols-2 gap-4",children:t("div",{children:[e(u,{htmlFor:"title",children:"Title"}),e(h,{id:"title",value:r.title,onChange:n=>d({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),t("div",{children:[e(u,{htmlFor:"description",children:"Description"}),e(P,{id:"description",value:r.description,onChange:n=>d({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),t("div",{className:"grid grid-cols-2 gap-4",children:[t("div",{children:[e(u,{htmlFor:"dueDate",children:"Due Date"}),e(h,{id:"dueDate",type:"date",value:r.dueDate,onChange:n=>d({...r,dueDate:n.target.value}),required:!0})]}),t("div",{children:[e(u,{htmlFor:"dueTime",children:"Due Time (optional)"}),e(h,{id:"dueTime",type:"time",value:r.dueTime,onChange:n=>d({...r,dueTime:n.target.value})})]})]}),t("div",{children:[e(u,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),t(R,{value:r.colleagueId,onValueChange:n=>{d({...r,colleagueId:n})},required:!0,children:[e(T,{className:`${s?"text-destructive border-red-500":""}`,children:e(S,{className:`${s?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:a.find(n=>n?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),e(I,{children:l.map(n=>e(p,{value:n.id.toString(),children:n.name},n.id))})]}),s&&e("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),t("div",{className:"space-y-2",children:[t("div",{className:"flex items-center space-x-2",children:[e("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:n=>d({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),e(u,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&t("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[t("div",{children:[e(u,{htmlFor:"recurrencePattern",children:"Frequency"}),t(R,{value:r.recurrencePattern,onValueChange:n=>d({...r,recurrencePattern:n}),children:[e(T,{children:e(S,{})}),t(I,{children:[e(p,{value:"daily",children:"Daily"}),e(p,{value:"weekly",children:"Weekly"}),e(p,{value:"monthly",children:"Monthly"}),e(p,{value:"yearly",children:"Yearly"})]})]})]}),t("div",{children:[e(u,{htmlFor:"recurrenceInterval",children:"Every"}),e(h,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>d({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),t("div",{className:"flex justify-end space-x-2",children:[e(x,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e(x,{type:"submit",children:"Add Reminder"})]})]})]})})},ae=({reminder:a,colleagues:o,onUpdateReminder:m,open:c,onClose:r})=>{let[d,s]=D({title:a.title,description:a.description,dueDate:a.dueDate?.toString().split("T")[0],dueTime:a.dueTime||"",isRecurring:a.isRecurring}),v=l=>{l.preventDefault(),m(a.id.toString(),{title:d.title,description:d.description,dueDate:new Date(d.dueDate||"").toISOString(),dueTime:d.dueTime||void 0,isRecurring:d.isRecurring}),r()},N=o.filter(Boolean);return e(A,{open:c,onOpenChange:r,children:t(B,{className:"max-w-2xl",children:[e(E,{children:e(O,{children:"Edit Reminder"})}),t("form",{onSubmit:v,className:"space-y-4",children:[e("div",{className:"grid grid-cols-2 gap-4",children:t("div",{children:[e(u,{htmlFor:"edit-title",children:"Title"}),e(h,{id:"edit-title",value:d.title,onChange:l=>s({...d,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),t("div",{children:[e(u,{htmlFor:"edit-description",children:"Description"}),e(P,{id:"edit-description",value:d.description||"",onChange:l=>s({...d,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),t("div",{className:"grid grid-cols-2 gap-4",children:[t("div",{children:[e(u,{htmlFor:"edit-dueDate",children:"Due Date"}),e(h,{id:"edit-dueDate",type:"date",value:d.dueDate,onChange:l=>s({...d,dueDate:l.target.value}),required:!0})]}),t("div",{children:[e(u,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),e(h,{id:"edit-dueTime",type:"time",value:d.dueTime,onChange:l=>s({...d,dueTime:l.target.value})})]})]}),e("div",{className:"space-y-2",children:t("div",{className:"flex items-center space-x-2",children:[e("input",{type:"checkbox",id:"edit-isRecurring",checked:d.isRecurring||!1,onChange:l=>s({...d,isRecurring:l.target.checked}),className:"rounded border-border"}),e(u,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),t("div",{className:"flex justify-end space-x-2",children:[e(x,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),e(x,{type:"submit",children:"Save Changes"})]})]})]})})},re=({reminder:a,colleagues:o,onUpdateReminder:m,onDeleteReminder:c})=>{let[r,d]=D(!1);if(!a||!a.id)return null;let s=U(new Date(a.dueDate||""),a.dueTime||""),v=H(new Date(a.dueDate||"")),N=ee(new Date(a.dueDate||"")),l=()=>{m(a.id.toString(),{})},n=()=>v?"Today":N?"Tomorrow":Z(new Date(a.dueDate||""));return t(de,{children:[e(ae,{reminder:a,colleagues:o,onUpdateReminder:m,open:r,onClose:()=>d(!1)}),e(C,{children:e(q,{className:"p-4",children:t("div",{className:"flex items-start justify-between",children:[t("div",{className:"flex items-start space-x-3 flex-1",children:[e("button",{onClick:l,className:"mt-1 text-primary hover:text-primary/80"}),t("div",{className:"flex-1",children:[e("div",{className:"flex items-center space-x-2 mb-1",children:e("h3",{children:a.title})}),e("p",{className:"text-sm text-muted-foreground mb-2",children:a.description}),t("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[t("div",{className:"flex items-center space-x-1",children:[e(G,{className:"h-4 w-4"}),e("span",{className:s?"text-destructive font-medium":"",children:n()})]}),a.dueTime&&t("div",{className:"flex items-center space-x-1",children:[e(Y,{className:"h-4 w-4"}),e("span",{children:_(a.dueTime)})]}),t("div",{className:"flex items-center space-x-1",children:[e(J,{className:"h-4 w-4"}),e("span",{children:typeof a.assignedColleague!="number"?a.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),t("div",{className:"flex items-center space-x-1",children:[e(x,{variant:"ghost",size:"sm",onClick:()=>d(!0),className:"h-8 w-8 p-0",children:e(Q,{className:"h-4 w-4"})}),e(x,{variant:"ghost",size:"sm",onClick:()=>c(a.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:e(X,{className:"h-4 w-4"})})]})]})})})]})},ie=({initialReminders:a=[],initialColleagues:o=[],onAddReminder:m,onUpdateReminder:c,onDeleteReminder:r})=>{let[d,s]=D(a.filter(Boolean)),[v,N]=D(o.filter(Boolean)),[l,n]=D("all"),[b,k]=D(""),[F,L]=D(!1);M(()=>{s(a.filter(Boolean))},[a]),M(()=>{N(o.filter(Boolean))},[o]);let j=i=>{if(!i.title){console.error("Invalid reminder data:",i);return}let g={...i,id:Date.now(),createdAt:new Date().toISOString()};s(y=>[...y,g]),m?.(i)},z=(i,g)=>{if(!i){console.error("No reminder ID provided for update");return}s(y=>y.map(w=>w?.id.toString()===i?{...w,...g}:w)),c?.(i,g)},K=i=>{if(!i){console.error("No reminder ID provided for deletion");return}s(g=>g.filter(y=>y?.id.toString()!==i)),r?.(i)},V=d.filter(i=>{if(!i)return!1;if(b){let g=b.toLowerCase();if(!(i.title.toLowerCase().includes(g)||i.description?.toLowerCase().includes(g)))return!1}switch(l){case"pending":case"completed":case"overdue":return U(new Date(i.dueDate||""),i.dueTime||"");case"today":return H(new Date(i.dueDate||""));default:return!0}}).sort((i,g)=>{if(!i||!g)return 0;let y={high:3,medium:2,low:1},w=0;return w!==0?w:new Date(i.dueDate||"").getTime()-new Date(g.dueDate||"").getTime()}),f={total:d.filter(Boolean).length,overdue:d.filter(i=>i&&U(new Date(i.dueDate||""),i.dueTime||"")).length,today:d.filter(i=>i&&H(new Date(i.dueDate||""))).length},oe=v.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return t("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e($,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{L(!0)}}}),t("div",{className:"h-full bg-background",children:[e(te,{colleagues:v,onAddReminder:j,open:F,setOpen:L}),t("div",{className:"p-6",children:[t("div",{className:"flex items-center justify-between mb-6",children:[t("div",{children:[e("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),e("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),t(x,{className:"flex items-center space-x-2",onClick:()=>L(!0),children:[e(W,{className:"h-4 w-4"}),e("span",{children:"Add Reminder"})]})]}),t("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-foreground",children:f.total}),e("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-primary",children:f.overdue}),e("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-success",children:f.today}),e("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-destructive",children:f.overdue}),e("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-warning",children:f.today}),e("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),t("div",{className:"flex items-center space-x-4 mb-6",children:[e("div",{className:"flex-1",children:e(h,{placeholder:"Search reminders...",value:b,onChange:i=>k(i.target.value),className:"max-w-md"})}),t(R,{value:l,onValueChange:i=>n(i),children:[e(T,{className:"w-40",children:e(S,{})}),t(I,{children:[t(p,{value:"all",children:["All (",f.total,")"]}),t(p,{value:"overdue",children:["Overdue (",f.overdue,")"]}),t(p,{value:"overdue",children:["Overdue (",f.overdue,")"]}),t(p,{value:"today",children:["Today (",f.today,")"]})]})]})]}),e("div",{className:"space-y-4",children:V.length===0?t(C,{className:"p-8 text-center",children:[e("div",{className:"text-muted-foreground",children:b||l!=="all"?"No reminders match your filters":"No reminders yet"}),!b&&l==="all"&&e("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):V.map(i=>i&&e(re,{reminder:i,colleagues:v,onUpdateReminder:z,onDeleteReminder:K},i.id))})]})]})]})},Te=ie;export{ie as a,Te as b};
1
+ import{a as $}from"./chunk-HF33ZXKX.mjs";import{a as R,c as S,d as T,g as I,i as p}from"./chunk-YFAZQYK4.mjs";import{a as P}from"./chunk-B4H6T2GP.mjs";import{a as u}from"./chunk-TVZOULLL.mjs";import{a as A,f as B,g as E,i as O}from"./chunk-3UMMMQEH.mjs";import{a as C,e as q}from"./chunk-YO3GQYRJ.mjs";import{a as h}from"./chunk-L5JPAKPM.mjs";import{b as x}from"./chunk-ZUA4KNIR.mjs";import{useEffect as M,useState as D}from"react";import{Plus as W,Clock as Y,Calendar as G,User as J,Edit2 as Q,Trash2 as X}from"lucide-react";import{Fragment as de,jsx as e,jsxs as t}from"react/jsx-runtime";var Z=a=>a.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),_=a=>{let[o,m]=a.split(":"),c=new Date;return c.setHours(parseInt(o),parseInt(m)),c.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},U=(a,o)=>{let m=new Date,c=new Date(a);if(o){let[r,d]=o.split(":");c.setHours(parseInt(r),parseInt(d))}return c<m},H=a=>{let o=new Date;return a.toDateString()===o.toDateString()},ee=a=>{let o=new Date;return o.setDate(o.getDate()+1),a.toDateString()===o.toDateString()},te=({colleagues:a,onAddReminder:o,open:m,setOpen:c})=>{let[r,d]=D({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,v]=D(!1),N=n=>{if(n.preventDefault(),!a.find(F=>F?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),v(!0);return}v(!1);let k={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};o(k),c(!1),d({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};M(()=>{r.colleagueId&&v(!1)},[r.colleagueId]);let l=a.filter(Boolean);return e(A,{open:m,onOpenChange:c,children:t(B,{className:"max-w-2xl",children:[e(E,{children:e(O,{children:"Add New Reminder"})}),t("form",{onSubmit:N,className:"space-y-4",children:[e("div",{className:"grid grid-cols-2 gap-4",children:t("div",{children:[e(u,{htmlFor:"title",children:"Title"}),e(h,{id:"title",value:r.title,onChange:n=>d({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),t("div",{children:[e(u,{htmlFor:"description",children:"Description"}),e(P,{id:"description",value:r.description,onChange:n=>d({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),t("div",{className:"grid grid-cols-2 gap-4",children:[t("div",{children:[e(u,{htmlFor:"dueDate",children:"Due Date"}),e(h,{id:"dueDate",type:"date",value:r.dueDate,onChange:n=>d({...r,dueDate:n.target.value}),required:!0})]}),t("div",{children:[e(u,{htmlFor:"dueTime",children:"Due Time (optional)"}),e(h,{id:"dueTime",type:"time",value:r.dueTime,onChange:n=>d({...r,dueTime:n.target.value})})]})]}),t("div",{children:[e(u,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),t(R,{value:r.colleagueId,onValueChange:n=>{d({...r,colleagueId:n})},required:!0,children:[e(T,{className:`${s?"text-destructive border-red-500":""}`,children:e(S,{className:`${s?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:a.find(n=>n?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),e(I,{children:l.map(n=>e(p,{value:n.id.toString(),children:n.name},n.id))})]}),s&&e("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),t("div",{className:"space-y-2",children:[t("div",{className:"flex items-center space-x-2",children:[e("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:n=>d({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),e(u,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&t("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[t("div",{children:[e(u,{htmlFor:"recurrencePattern",children:"Frequency"}),t(R,{value:r.recurrencePattern,onValueChange:n=>d({...r,recurrencePattern:n}),children:[e(T,{children:e(S,{})}),t(I,{children:[e(p,{value:"daily",children:"Daily"}),e(p,{value:"weekly",children:"Weekly"}),e(p,{value:"monthly",children:"Monthly"}),e(p,{value:"yearly",children:"Yearly"})]})]})]}),t("div",{children:[e(u,{htmlFor:"recurrenceInterval",children:"Every"}),e(h,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>d({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),t("div",{className:"flex justify-end space-x-2",children:[e(x,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e(x,{type:"submit",children:"Add Reminder"})]})]})]})})},ae=({reminder:a,colleagues:o,onUpdateReminder:m,open:c,onClose:r})=>{let[d,s]=D({title:a.title,description:a.description,dueDate:a.dueDate?.toString().split("T")[0],dueTime:a.dueTime||"",isRecurring:a.isRecurring}),v=l=>{l.preventDefault(),m(a.id.toString(),{title:d.title,description:d.description,dueDate:new Date(d.dueDate||"").toISOString(),dueTime:d.dueTime||void 0,isRecurring:d.isRecurring}),r()},N=o.filter(Boolean);return e(A,{open:c,onOpenChange:r,children:t(B,{className:"max-w-2xl",children:[e(E,{children:e(O,{children:"Edit Reminder"})}),t("form",{onSubmit:v,className:"space-y-4",children:[e("div",{className:"grid grid-cols-2 gap-4",children:t("div",{children:[e(u,{htmlFor:"edit-title",children:"Title"}),e(h,{id:"edit-title",value:d.title,onChange:l=>s({...d,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),t("div",{children:[e(u,{htmlFor:"edit-description",children:"Description"}),e(P,{id:"edit-description",value:d.description||"",onChange:l=>s({...d,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),t("div",{className:"grid grid-cols-2 gap-4",children:[t("div",{children:[e(u,{htmlFor:"edit-dueDate",children:"Due Date"}),e(h,{id:"edit-dueDate",type:"date",value:d.dueDate,onChange:l=>s({...d,dueDate:l.target.value}),required:!0})]}),t("div",{children:[e(u,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),e(h,{id:"edit-dueTime",type:"time",value:d.dueTime,onChange:l=>s({...d,dueTime:l.target.value})})]})]}),e("div",{className:"space-y-2",children:t("div",{className:"flex items-center space-x-2",children:[e("input",{type:"checkbox",id:"edit-isRecurring",checked:d.isRecurring||!1,onChange:l=>s({...d,isRecurring:l.target.checked}),className:"rounded border-border"}),e(u,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),t("div",{className:"flex justify-end space-x-2",children:[e(x,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),e(x,{type:"submit",children:"Save Changes"})]})]})]})})},re=({reminder:a,colleagues:o,onUpdateReminder:m,onDeleteReminder:c})=>{let[r,d]=D(!1);if(!a||!a.id)return null;let s=U(new Date(a.dueDate||""),a.dueTime||""),v=H(new Date(a.dueDate||"")),N=ee(new Date(a.dueDate||"")),l=()=>{m(a.id.toString(),{})},n=()=>v?"Today":N?"Tomorrow":Z(new Date(a.dueDate||""));return t(de,{children:[e(ae,{reminder:a,colleagues:o,onUpdateReminder:m,open:r,onClose:()=>d(!1)}),e(C,{children:e(q,{className:"p-4",children:t("div",{className:"flex items-start justify-between",children:[t("div",{className:"flex items-start space-x-3 flex-1",children:[e("button",{onClick:l,className:"mt-1 text-primary hover:text-primary/80"}),t("div",{className:"flex-1",children:[e("div",{className:"flex items-center space-x-2 mb-1",children:e("h3",{children:a.title})}),e("p",{className:"text-sm text-muted-foreground mb-2",children:a.description}),t("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[t("div",{className:"flex items-center space-x-1",children:[e(G,{className:"h-4 w-4"}),e("span",{className:s?"text-destructive font-medium":"",children:n()})]}),a.dueTime&&t("div",{className:"flex items-center space-x-1",children:[e(Y,{className:"h-4 w-4"}),e("span",{children:_(a.dueTime)})]}),t("div",{className:"flex items-center space-x-1",children:[e(J,{className:"h-4 w-4"}),e("span",{children:typeof a.assignedColleague!="number"?a.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),t("div",{className:"flex items-center space-x-1",children:[e(x,{variant:"ghost",size:"sm",onClick:()=>d(!0),className:"h-8 w-8 p-0",children:e(Q,{className:"h-4 w-4"})}),e(x,{variant:"ghost",size:"sm",onClick:()=>c(a.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:e(X,{className:"h-4 w-4"})})]})]})})})]})},ie=({initialReminders:a=[],initialColleagues:o=[],onAddReminder:m,onUpdateReminder:c,onDeleteReminder:r})=>{let[d,s]=D(a.filter(Boolean)),[v,N]=D(o.filter(Boolean)),[l,n]=D("all"),[b,k]=D(""),[F,L]=D(!1);M(()=>{s(a.filter(Boolean))},[a]),M(()=>{N(o.filter(Boolean))},[o]);let j=i=>{if(!i.title){console.error("Invalid reminder data:",i);return}let g={...i,id:Date.now(),createdAt:new Date().toISOString()};s(y=>[...y,g]),m?.(i)},z=(i,g)=>{if(!i){console.error("No reminder ID provided for update");return}s(y=>y.map(w=>w?.id.toString()===i?{...w,...g}:w)),c?.(i,g)},K=i=>{if(!i){console.error("No reminder ID provided for deletion");return}s(g=>g.filter(y=>y?.id.toString()!==i)),r?.(i)},V=d.filter(i=>{if(!i)return!1;if(b){let g=b.toLowerCase();if(!(i.title.toLowerCase().includes(g)||i.description?.toLowerCase().includes(g)))return!1}switch(l){case"pending":case"completed":case"overdue":return U(new Date(i.dueDate||""),i.dueTime||"");case"today":return H(new Date(i.dueDate||""));default:return!0}}).sort((i,g)=>{if(!i||!g)return 0;let y={high:3,medium:2,low:1},w=0;return w!==0?w:new Date(i.dueDate||"").getTime()-new Date(g.dueDate||"").getTime()}),f={total:d.filter(Boolean).length,overdue:d.filter(i=>i&&U(new Date(i.dueDate||""),i.dueTime||"")).length,today:d.filter(i=>i&&H(new Date(i.dueDate||""))).length},oe=v.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return t("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e($,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{L(!0)}}}),t("div",{className:"h-full bg-background",children:[e(te,{colleagues:v,onAddReminder:j,open:F,setOpen:L}),t("div",{className:"p-6",children:[t("div",{className:"flex items-center justify-between mb-6",children:[t("div",{children:[e("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),e("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),t(x,{className:"flex items-center space-x-2",onClick:()=>L(!0),children:[e(W,{className:"h-4 w-4"}),e("span",{children:"Add Reminder"})]})]}),t("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-foreground",children:f.total}),e("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-primary",children:f.overdue}),e("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-success",children:f.today}),e("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-destructive",children:f.overdue}),e("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),t(C,{className:"p-4",children:[e("div",{className:"text-2xl font-bold text-warning",children:f.today}),e("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),t("div",{className:"flex items-center space-x-4 mb-6",children:[e("div",{className:"flex-1",children:e(h,{placeholder:"Search reminders...",value:b,onChange:i=>k(i.target.value),className:"max-w-md"})}),t(R,{value:l,onValueChange:i=>n(i),children:[e(T,{className:"w-40",children:e(S,{})}),t(I,{children:[t(p,{value:"all",children:["All (",f.total,")"]}),t(p,{value:"overdue",children:["Overdue (",f.overdue,")"]}),t(p,{value:"overdue",children:["Overdue (",f.overdue,")"]}),t(p,{value:"today",children:["Today (",f.today,")"]})]})]})]}),e("div",{className:"space-y-4",children:V.length===0?t(C,{className:"p-8 text-center",children:[e("div",{className:"text-muted-foreground",children:b||l!=="all"?"No reminders match your filters":"No reminders yet"}),!b&&l==="all"&&e("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):V.map(i=>i&&e(re,{reminder:i,colleagues:v,onUpdateReminder:z,onDeleteReminder:K},i.id))})]})]})]})},Te=ie;export{ie as a,Te as b};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as $}from"./chunk-MH4YPGH4.mjs";import{a as O}from"./chunk-FT3AE7L2.mjs";import{a as H}from"./chunk-L5JPAKPM.mjs";import{motion as v}from"motion/react";import{ChevronRight as A,File as M,FileText as K,Search as Q}from"lucide-react";import{useState as N,useMemo as P,useEffect as T}from"react";import{Fragment as E,jsx as e,jsxs as r}from"react/jsx-runtime";function j({label:x,documents:a,children:l,level:p,onDocumentClick:w,selectedDocumentId:f,showDocumentCount:y=!0}){let[c,i]=N(p===0),D=l&&Object.keys(l).length>0,u=a.length+(l?Object.values(l).reduce((t,n)=>t+n.documents.length,0):0),b=t=>{switch(t){case"markdown":case"mdx":return e(K,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return e(M,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return e(M,{className:"h-3.5 w-3.5 text-muted-foreground"})}},g=t=>{let n=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return n[t%n.length]};return r("div",{className:"space-y-1",children:[(D||a.length>0)&&r(v.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${c?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${p*20}px`},onClick:()=>i(!c),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:`w-1 h-6 rounded-full ${g(p)}`}),e(v.div,{animate:{rotate:c?90:0},transition:{duration:.2},className:"flex-shrink-0",children:e(A,{className:"h-4 w-4 text-muted-foreground"})}),r("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:e("span",{className:"font-medium text-foreground truncate",children:x})}),y&&u>0&&e("div",{className:"flex-shrink-0 ml-2",children:e("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:u})})]})]}),e(v.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:r("div",{className:"pt-2 space-y-1",children:[a.map((t,n)=>r(v.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:n*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${f===t.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${p*20+20}px`},onClick:()=>w?.(t),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:"flex-shrink-0",children:b(t.format)}),r("div",{className:"flex-1 min-w-0",children:[e("p",{className:`text-sm truncate transition-colors ${f===t.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:t.title}),t.description&&e("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t.description})]}),t.tags&&t.tags.length>0&&e("div",{className:"flex-shrink-0",children:e("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:t.tags[0]})})]},t.id)),l&&Object.entries(l).map(([t,n])=>e(j,{label:t,documents:n.documents,children:n.children,level:p+1,onDocumentClick:w,selectedDocumentId:f,showDocumentCount:y},t))]})})]})}function Z({documents:x,menuConfig:a,onDocumentClick:l,onDocumentShare:p,onDocumentUpdate:w,selectedDocumentId:f,className:y,editable:c=!0}){let[i,D]=N(""),[u,b]=N(null),[g,t]=N(x);T(()=>{t(x)},[x]),T(()=>{if(u?.id){let o=g.find(s=>s.id===u.id);o&&b(o)}},[g]);let n=P(()=>i?g.filter(o=>o.title.toLowerCase().includes(i.toLowerCase())||o.description?.toLowerCase().includes(i.toLowerCase())||o.tags?.some(s=>s.toLowerCase().includes(i.toLowerCase()))||Object.values(o.metadata||{}).some(s=>String(s).toLowerCase().includes(i.toLowerCase()))):g,[g,i]),S=P(()=>{let o=(s,L)=>{if(L.length===0)return{};let[F,...B]=L;return s.reduce((d,C)=>{let U=C.metadata?.[F]||"Uncategorized",m=String(U);if(d[m]||(d[m]={documents:[],children:{}}),B.length===0)d[m].documents.push(C);else{let k=o([C],B),h=Object.keys(k)[0];h&&(d[m].children||(d[m].children={}),d[m].children[h]?d[m].children[h].documents.push(...k[h].documents):d[m].children[h]=k[h])}return d},{})};return o(n,a.groupBy)},[n,a.groupBy]),I=o=>{b(o),l?.(o)};return r("div",{className:`flex h-full ${y||""}`,children:[r("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[e("div",{className:"p-6 border-b border-border",children:r("div",{className:"relative",children:[e("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e(Q,{className:"h-4 w-4 text-muted-foreground"})}),e(H,{placeholder:"Search knowledge base...",value:i,onChange:o=>D(o.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),e(O,{className:"h-[calc(100%-100px)]",children:e("div",{className:"p-4 space-y-3",children:a.groupBy.length===0?e(E,{children:e(j,{label:"Document",documents:n,level:0,onDocumentClick:I,selectedDocumentId:f,showDocumentCount:a.showDocumentCount},"Document")}):r(E,{children:[Object.entries(S).map(([o,s])=>e(j,{label:o,documents:s.documents,children:s.children,level:0,onDocumentClick:I,selectedDocumentId:f,showDocumentCount:a.showDocumentCount},o)),Object.keys(S).length===0&&r(v.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[e("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:e(K,{className:"h-8 w-8 text-muted-foreground"})}),e("p",{className:"text-sm font-medium",children:"No documents found"}),e("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),e("div",{className:"flex-1 bg-background overflow-scroll",children:u?e($,{document:u,onDocumentUpdate:w,editable:c}):e("div",{className:"h-full flex items-center justify-center text-center",children:r(v.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[e("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:e(K,{className:"h-10 w-10 text-primary"})}),e("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),e("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}export{Z as a};
4
+ import{a as $}from"./chunk-LPCO4T25.mjs";import{a as O}from"./chunk-FT3AE7L2.mjs";import{a as H}from"./chunk-L5JPAKPM.mjs";import{motion as v}from"motion/react";import{ChevronRight as A,File as M,FileText as K,Search as Q}from"lucide-react";import{useState as N,useMemo as P,useEffect as T}from"react";import{Fragment as E,jsx as e,jsxs as r}from"react/jsx-runtime";function j({label:x,documents:a,children:l,level:p,onDocumentClick:w,selectedDocumentId:f,showDocumentCount:y=!0}){let[c,i]=N(p===0),D=l&&Object.keys(l).length>0,u=a.length+(l?Object.values(l).reduce((t,n)=>t+n.documents.length,0):0),b=t=>{switch(t){case"markdown":case"mdx":return e(K,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return e(M,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return e(M,{className:"h-3.5 w-3.5 text-muted-foreground"})}},g=t=>{let n=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return n[t%n.length]};return r("div",{className:"space-y-1",children:[(D||a.length>0)&&r(v.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${c?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${p*20}px`},onClick:()=>i(!c),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:`w-1 h-6 rounded-full ${g(p)}`}),e(v.div,{animate:{rotate:c?90:0},transition:{duration:.2},className:"flex-shrink-0",children:e(A,{className:"h-4 w-4 text-muted-foreground"})}),r("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:e("span",{className:"font-medium text-foreground truncate",children:x})}),y&&u>0&&e("div",{className:"flex-shrink-0 ml-2",children:e("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:u})})]})]}),e(v.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:r("div",{className:"pt-2 space-y-1",children:[a.map((t,n)=>r(v.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:n*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${f===t.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${p*20+20}px`},onClick:()=>w?.(t),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:"flex-shrink-0",children:b(t.format)}),r("div",{className:"flex-1 min-w-0",children:[e("p",{className:`text-sm truncate transition-colors ${f===t.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:t.title}),t.description&&e("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t.description})]}),t.tags&&t.tags.length>0&&e("div",{className:"flex-shrink-0",children:e("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:t.tags[0]})})]},t.id)),l&&Object.entries(l).map(([t,n])=>e(j,{label:t,documents:n.documents,children:n.children,level:p+1,onDocumentClick:w,selectedDocumentId:f,showDocumentCount:y},t))]})})]})}function Z({documents:x,menuConfig:a,onDocumentClick:l,onDocumentShare:p,onDocumentUpdate:w,selectedDocumentId:f,className:y,editable:c=!0}){let[i,D]=N(""),[u,b]=N(null),[g,t]=N(x);T(()=>{t(x)},[x]),T(()=>{if(u?.id){let o=g.find(s=>s.id===u.id);o&&b(o)}},[g]);let n=P(()=>i?g.filter(o=>o.title.toLowerCase().includes(i.toLowerCase())||o.description?.toLowerCase().includes(i.toLowerCase())||o.tags?.some(s=>s.toLowerCase().includes(i.toLowerCase()))||Object.values(o.metadata||{}).some(s=>String(s).toLowerCase().includes(i.toLowerCase()))):g,[g,i]),S=P(()=>{let o=(s,L)=>{if(L.length===0)return{};let[F,...B]=L;return s.reduce((d,C)=>{let U=C.metadata?.[F]||"Uncategorized",m=String(U);if(d[m]||(d[m]={documents:[],children:{}}),B.length===0)d[m].documents.push(C);else{let k=o([C],B),h=Object.keys(k)[0];h&&(d[m].children||(d[m].children={}),d[m].children[h]?d[m].children[h].documents.push(...k[h].documents):d[m].children[h]=k[h])}return d},{})};return o(n,a.groupBy)},[n,a.groupBy]),I=o=>{b(o),l?.(o)};return r("div",{className:`flex h-full ${y||""}`,children:[r("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[e("div",{className:"p-6 border-b border-border",children:r("div",{className:"relative",children:[e("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e(Q,{className:"h-4 w-4 text-muted-foreground"})}),e(H,{placeholder:"Search knowledge base...",value:i,onChange:o=>D(o.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),e(O,{className:"h-[calc(100%-100px)]",children:e("div",{className:"p-4 space-y-3",children:a.groupBy.length===0?e(E,{children:e(j,{label:"Document",documents:n,level:0,onDocumentClick:I,selectedDocumentId:f,showDocumentCount:a.showDocumentCount},"Document")}):r(E,{children:[Object.entries(S).map(([o,s])=>e(j,{label:o,documents:s.documents,children:s.children,level:0,onDocumentClick:I,selectedDocumentId:f,showDocumentCount:a.showDocumentCount},o)),Object.keys(S).length===0&&r(v.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[e("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:e(K,{className:"h-8 w-8 text-muted-foreground"})}),e("p",{className:"text-sm font-medium",children:"No documents found"}),e("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),e("div",{className:"flex-1 bg-background overflow-scroll",children:u?e($,{document:u,onDocumentUpdate:w,editable:c}):e("div",{className:"h-full flex items-center justify-center text-center",children:r(v.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[e("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:e(K,{className:"h-10 w-10 text-primary"})}),e("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),e("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}export{Z as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{b as t}from"./chunk-ZUA4KNIR.mjs";import{a as r,b as i,c as m,d as l,e as n,f as o}from"./chunk-YO3GQYRJ.mjs";import{motion as p}from"motion/react";import{Users as u,Bot as f,FolderOpen as v}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function y({team:s,onOpen:d,className:c}){return e(p.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:c,children:a(r,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[a(i,{children:[e(m,{className:"text-lg",children:s.name}),e(l,{className:"mt-1 text-sm",children:s.description})]}),a(n,{className:"space-y-4",children:[a("div",{className:"grid grid-cols-2 gap-4",children:[a("div",{className:"flex items-center justify-between text-sm",children:[a("div",{className:"flex items-center gap-2",children:[e(u,{className:"h-4 w-4 text-blue-500"}),e("span",{children:"Human"})]}),e("span",{className:"font-medium",children:s.humanColleagues})]}),a("div",{className:"flex items-center justify-between text-sm",children:[a("div",{className:"flex items-center gap-2",children:[e(f,{className:"h-4 w-4 text-purple-500"}),e("span",{children:"Digital"})]}),e("span",{className:"font-medium",children:s.digitalColleagues})]})]}),a("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[a("div",{className:"flex items-center gap-2",children:[e(v,{className:"h-4 w-4 text-green-500"}),e("span",{children:"Projects"})]}),e("span",{className:"font-medium",children:s.projects})]})]}),e(o,{className:"flex gap-2",children:e(t,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>d?.(s),children:"View Team"})})]})})}export{y as a};
4
+ import{a as r,b as i,c as m,d as l,e as n,f as o}from"./chunk-YO3GQYRJ.mjs";import{b as t}from"./chunk-ZUA4KNIR.mjs";import{motion as p}from"motion/react";import{Users as u,Bot as f,FolderOpen as v}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function y({team:s,onOpen:d,className:c}){return e(p.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:c,children:a(r,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[a(i,{children:[e(m,{className:"text-lg",children:s.name}),e(l,{className:"mt-1 text-sm",children:s.description})]}),a(n,{className:"space-y-4",children:[a("div",{className:"grid grid-cols-2 gap-4",children:[a("div",{className:"flex items-center justify-between text-sm",children:[a("div",{className:"flex items-center gap-2",children:[e(u,{className:"h-4 w-4 text-blue-500"}),e("span",{children:"Human"})]}),e("span",{className:"font-medium",children:s.humanColleagues})]}),a("div",{className:"flex items-center justify-between text-sm",children:[a("div",{className:"flex items-center gap-2",children:[e(f,{className:"h-4 w-4 text-purple-500"}),e("span",{children:"Digital"})]}),e("span",{className:"font-medium",children:s.digitalColleagues})]})]}),a("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[a("div",{className:"flex items-center gap-2",children:[e(v,{className:"h-4 w-4 text-green-500"}),e("span",{children:"Projects"})]}),e("span",{className:"font-medium",children:s.projects})]})]}),e(o,{className:"flex gap-2",children:e(t,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>d?.(s),children:"View Team"})})]})})}export{y as a};
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as D}from"./chunk-X3YJJBFJ.mjs";import{a as $}from"./chunk-DFIXTV2M.mjs";import{a as F}from"./chunk-B4H6T2GP.mjs";import{b as k}from"./chunk-ZUA4KNIR.mjs";import{motion as A}from"motion/react";import{File as S,FileText as I,Type as L,Loader2 as E,X as K,Save as M}from"lucide-react";import{useEffect as _,useRef as B,useState as b}from"react";import{Fragment as W,jsx as u,jsxs as T}from"react/jsx-runtime";var w=n=>"mimeType"in n&&"url"in n&&!("format"in n),P=n=>{if(!n?.root?.children)return"";let l=[],i=e=>{if(!e)return"";switch(e.type){case"heading":{let t=e.tag?parseInt(e.tag.replace("h","")):1,s=a(e.children||[]);return"#".repeat(t)+" "+s}case"paragraph":return e.children&&e.children.some(o=>o.type==="text"?o.text&&o.text.trim().length>0:(o.type==="linebreak",!0))?a(e.children||[]):"";case"list":{let t=[],s=e.listType==="number"?"1.":"-";return e.children?.forEach((o,m)=>{if(o.type==="listitem"){let p=a(o.children||[]),x=e.listType==="number"?`${m+1}.`:s;t.push(`${x} ${p}`)}}),t.join(`
4
+ import{a as D}from"./chunk-ZKTIH47I.mjs";import{a as $}from"./chunk-DFIXTV2M.mjs";import{a as F}from"./chunk-B4H6T2GP.mjs";import{b as k}from"./chunk-ZUA4KNIR.mjs";import{motion as A}from"motion/react";import{File as S,FileText as I,Type as L,Loader2 as E,X as K,Save as M}from"lucide-react";import{useEffect as _,useRef as B,useState as b}from"react";import{Fragment as W,jsx as u,jsxs as T}from"react/jsx-runtime";var w=n=>"mimeType"in n&&"url"in n&&!("format"in n),P=n=>{if(!n?.root?.children)return"";let l=[],i=e=>{if(!e)return"";switch(e.type){case"heading":{let t=e.tag?parseInt(e.tag.replace("h","")):1,s=a(e.children||[]);return"#".repeat(t)+" "+s}case"paragraph":return e.children&&e.children.some(o=>o.type==="text"?o.text&&o.text.trim().length>0:(o.type==="linebreak",!0))?a(e.children||[]):"";case"list":{let t=[],s=e.listType==="number"?"1.":"-";return e.children?.forEach((o,m)=>{if(o.type==="listitem"){let p=a(o.children||[]),x=e.listType==="number"?`${m+1}.`:s;t.push(`${x} ${p}`)}}),t.join(`
5
5
  `)}case"listitem":return a(e.children||[]);case"text":{let t=e.text||"";if(e.format){let s=(e.format&1)!==0,o=(e.format&2)!==0,m=(e.format&4)!==0,p=(e.format&8)!==0;(e.format&16)!==0?t=`\`${t}\``:(s&&(t=`**${t}**`),o&&(t=`*${t}*`),m&&(t=`~~${t}~~`),p&&(t=`<u>${t}</u>`))}return t}default:return e.children?a(e.children):""}},a=e=>e.map(t=>{if(t.type==="text"){let s=t.text||"";if(t.format){let o=(t.format&1)!==0,m=(t.format&2)!==0,p=(t.format&4)!==0,x=(t.format&8)!==0;(t.format&16)!==0?s=`\`${s}\``:(o&&(s=`**${s}**`),m&&(s=`*${s}*`),p&&(s=`~~${s}~~`),x&&(s=`<u>${s}</u>`))}return s}else{if(t.type==="paragraph")return a(t.children||[]);if(t.type==="listitem")return a(t.children||[]);if(t.type==="linebreak")return`
6
6
  `}return i(t)}).filter(Boolean).join("");n.root.children.forEach(e=>{let t=i(e);e.type==="paragraph"?l.push(t||""):t&&l.push(t)});let r=[];for(let e=0;e<l.length;e++)r.push(l[e]),e<l.length-1&&(l[e]===""||l[e+1]===""||r.push(""));return r.join(`
7
7
  `)},y=n=>{let l=[],i=0;for(;i<n.length;){let r=n.slice(i).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(r&&r[0]){let c=r[1]||"",d=c?y(c):[];d.length>0?(d.forEach(f=>{f.type==="text"&&(f.format=(f.format||0)|8)}),l.push(...d)):c===""&&l.push({type:"text",text:"",format:8}),i+=r[0].length;continue}if(n.slice(i).startsWith("</u>")){i+=4;continue}let e=n.slice(i).match(/^(`+)([^`]+)\1/);if(e){let c=e[2];c&&l.push({type:"text",text:c,format:16}),i+=e[0].length;continue}let t=n.slice(i).match(/^(~~)(.+?)\1/);if(t){let c=t[2],d=y(c);d.forEach(f=>{f.type==="text"&&(f.format=(f.format||0)|4)}),l.push(...d),i+=t[0].length;continue}let s=n.slice(i).match(/^(\*\*|__)(.+?)\1/);if(s){let c=s[2],d=y(c);d.forEach(f=>{f.type==="text"&&(f.format=(f.format||0)|1)}),l.push(...d),i+=s[0].length;continue}let o=n.slice(i).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(o&&o[0].length>2){let c=o[2],d=y(c);d.forEach(f=>{f.type==="text"&&(f.format=(f.format||0)|2)}),l.push(...d),i+=o[0].length;continue}if(n[i]===`
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as d}from"./chunk-YRMNCHFO.mjs";import{a as c}from"./chunk-B4H6T2GP.mjs";import{a as r}from"./chunk-TVZOULLL.mjs";import{a as u}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{a as p,b as f,c as h,e as g}from"./chunk-YO3GQYRJ.mjs";import{useState as b,useEffect as M}from"react";import{Users as S,Edit as j}from"lucide-react";import{jsx as a,jsxs as t}from"react/jsx-runtime";function L({team:n,onSave:C,onCancel:v,isLoading:l=!1,title:y,submitLabel:w,cancelLabel:T="Cancel",readOnly:F=!1}){let[e,i]=b({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...n}),[o,N]=b(!F);M(()=>{n&&i(n)},[n]);let x=s=>{s.preventDefault();let D={id:e.id||Date.now(),name:e.name,description:e.description||null,systemMsg:e.systemMsg||null,useProjects:e.useProjects||!1,useKnowledge:e.useKnowledge||!1,useFiles:e.useFiles||!1,useChat:e.useChat||!1,updatedAt:new Date().toISOString(),createdAt:e.createdAt||new Date().toISOString()};C(D)},E=s=>{s.preventDefault(),N(!o)},k=y||(o?n?"Edit Team":"Create New Team":"View Team"),P=w||(n?"Update Team":"Create Team");return t(p,{className:"m-8 w-full max-w-4xl mx-auto",children:[a(f,{children:t(h,{className:"flex items-center gap-2",children:[a(S,{className:"h-5 w-5"}),k]})}),a(g,{children:t("form",{onSubmit:x,className:"space-y-6",children:[t("div",{className:"space-y-4",children:[t("div",{className:"space-y-2",children:[a(r,{htmlFor:"name",children:"Team Name *"}),a(u,{id:"name",value:e.name||"",onChange:s=>i({...e,name:s.target.value}),required:!0,disabled:l||!o,placeholder:"Enter team name..."})]}),t("div",{className:"space-y-2",children:[a(r,{htmlFor:"description",children:"Description"}),a(c,{id:"description",value:e.description||"",onChange:s=>i({...e,description:s.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:l||!o})]}),t("div",{className:"space-y-2",children:[a(r,{htmlFor:"systemMsg",children:"Ways of working"}),a(c,{id:"systemMsg",value:e.systemMsg||"",onChange:s=>i({...e,systemMsg:s.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:l||!o})]})]}),t("div",{className:"space-y-4",children:[a("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),t("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useProjects",checked:e.useProjects||!1,onCheckedChange:s=>i({...e,useProjects:s}),disabled:l||!o}),a(r,{htmlFor:"useProjects",children:"Enable Projects"})]}),t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useKnowledge",checked:e.useKnowledge||!1,onCheckedChange:s=>i({...e,useKnowledge:s}),disabled:l||!o}),a(r,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useFiles",checked:e.useFiles||!1,onCheckedChange:s=>i({...e,useFiles:s}),disabled:l||!o}),a(r,{htmlFor:"useFiles",children:"Enable File Management"})]}),t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useChat",checked:e.useChat||!1,onCheckedChange:s=>i({...e,useChat:s}),disabled:l||!o}),a(r,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),t("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[a(m,{type:"button",variant:"outline",onClick:v,disabled:l,children:o?T:"Close"}),o?a(m,{type:"submit",disabled:l||!e.name?.trim(),children:l?"Saving...":P}):t(m,{type:"button",onClick:E,disabled:l,className:"gap-2",children:[a(j,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}export{L as a};
4
+ import{a as d}from"./chunk-YRMNCHFO.mjs";import{a as c}from"./chunk-B4H6T2GP.mjs";import{a as r}from"./chunk-TVZOULLL.mjs";import{a as p,b as f,c as h,e as g}from"./chunk-YO3GQYRJ.mjs";import{a as u}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{useState as b,useEffect as M}from"react";import{Users as S,Edit as j}from"lucide-react";import{jsx as a,jsxs as t}from"react/jsx-runtime";function L({team:n,onSave:C,onCancel:v,isLoading:l=!1,title:y,submitLabel:w,cancelLabel:T="Cancel",readOnly:F=!1}){let[e,i]=b({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...n}),[o,N]=b(!F);M(()=>{n&&i(n)},[n]);let x=s=>{s.preventDefault();let D={id:e.id||Date.now(),name:e.name,description:e.description||null,systemMsg:e.systemMsg||null,useProjects:e.useProjects||!1,useKnowledge:e.useKnowledge||!1,useFiles:e.useFiles||!1,useChat:e.useChat||!1,updatedAt:new Date().toISOString(),createdAt:e.createdAt||new Date().toISOString()};C(D)},E=s=>{s.preventDefault(),N(!o)},k=y||(o?n?"Edit Team":"Create New Team":"View Team"),P=w||(n?"Update Team":"Create Team");return t(p,{className:"m-8 w-full max-w-4xl mx-auto",children:[a(f,{children:t(h,{className:"flex items-center gap-2",children:[a(S,{className:"h-5 w-5"}),k]})}),a(g,{children:t("form",{onSubmit:x,className:"space-y-6",children:[t("div",{className:"space-y-4",children:[t("div",{className:"space-y-2",children:[a(r,{htmlFor:"name",children:"Team Name *"}),a(u,{id:"name",value:e.name||"",onChange:s=>i({...e,name:s.target.value}),required:!0,disabled:l||!o,placeholder:"Enter team name..."})]}),t("div",{className:"space-y-2",children:[a(r,{htmlFor:"description",children:"Description"}),a(c,{id:"description",value:e.description||"",onChange:s=>i({...e,description:s.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:l||!o})]}),t("div",{className:"space-y-2",children:[a(r,{htmlFor:"systemMsg",children:"Ways of working"}),a(c,{id:"systemMsg",value:e.systemMsg||"",onChange:s=>i({...e,systemMsg:s.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:l||!o})]})]}),t("div",{className:"space-y-4",children:[a("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),t("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useProjects",checked:e.useProjects||!1,onCheckedChange:s=>i({...e,useProjects:s}),disabled:l||!o}),a(r,{htmlFor:"useProjects",children:"Enable Projects"})]}),t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useKnowledge",checked:e.useKnowledge||!1,onCheckedChange:s=>i({...e,useKnowledge:s}),disabled:l||!o}),a(r,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useFiles",checked:e.useFiles||!1,onCheckedChange:s=>i({...e,useFiles:s}),disabled:l||!o}),a(r,{htmlFor:"useFiles",children:"Enable File Management"})]}),t("div",{className:"flex items-center space-x-2",children:[a(d,{id:"useChat",checked:e.useChat||!1,onCheckedChange:s=>i({...e,useChat:s}),disabled:l||!o}),a(r,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),t("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[a(m,{type:"button",variant:"outline",onClick:v,disabled:l,children:o?T:"Close"}),o?a(m,{type:"submit",disabled:l||!e.name?.trim(),children:l?"Saving...":P}):t(m,{type:"button",onClick:E,disabled:l,className:"gap-2",children:[a(j,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}export{L as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as g}from"./chunk-AQQCH7Z2.mjs";import{a as d,b as o,c as a,d as m,e as t,f as l}from"./chunk-76M7JE4D.mjs";import{a as u}from"./chunk-OYZDAMCS.mjs";import{b as n,d as b,f as c}from"./chunk-ZFUP5NVF.mjs";import{a as s}from"./chunk-4UIARERB.mjs";import{a as p}from"./chunk-CLGBBNRB.mjs";import{a as f}from"./chunk-WU3JMLSC.mjs";import{a as S}from"./chunk-BZAYEKYC.mjs";import{jsx as e,jsxs as r}from"react/jsx-runtime";function h({...i}){return r("div",{className:"bg-sidebar",children:[e(p,{isMenuOpen:!0,logoLight:S,logoDark:f,...i.header,className:"bg-sidebar",wide:!0}),r(n,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[e(g,{...i.sidebarLeft,className:"flex-none top-24"}),r(c,{className:"grow overflow-hidden",children:[e("header",{className:"flex h-16 shrink-0 items-center gap-2",children:r("div",{className:"flex items-center gap-2 px-4",children:[e(b,{className:"-ml-1"}),e(s,{orientation:"vertical",className:"mr-2 h-4"}),e(d,{children:r(o,{children:[e(a,{className:"hidden md:block",children:e(m,{href:"#",children:"Building Your Application"})}),e(l,{className:"hidden md:block"}),e(a,{children:e(t,{children:"Data Fetching"})})]})})]})}),r("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[r("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),e("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),e(u,{})]})}export{h as a};
4
+ import{a as g}from"./chunk-AQQCH7Z2.mjs";import{a as p}from"./chunk-ZW24FGHA.mjs";import{a as d,b as o,c as a,d as m,e as t,f as l}from"./chunk-76M7JE4D.mjs";import{a as u}from"./chunk-OYZDAMCS.mjs";import{b as n,d as b,f as c}from"./chunk-ZFUP5NVF.mjs";import{a as s}from"./chunk-4UIARERB.mjs";import{a as f}from"./chunk-WU3JMLSC.mjs";import{a as S}from"./chunk-BZAYEKYC.mjs";import{jsx as e,jsxs as r}from"react/jsx-runtime";function h({...i}){return r("div",{className:"bg-sidebar",children:[e(p,{isMenuOpen:!0,logoLight:S,logoDark:f,...i.header,className:"bg-sidebar",wide:!0}),r(n,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[e(g,{...i.sidebarLeft,className:"flex-none top-24"}),r(c,{className:"grow overflow-hidden",children:[e("header",{className:"flex h-16 shrink-0 items-center gap-2",children:r("div",{className:"flex items-center gap-2 px-4",children:[e(b,{className:"-ml-1"}),e(s,{orientation:"vertical",className:"mr-2 h-4"}),e(d,{children:r(o,{children:[e(a,{className:"hidden md:block",children:e(m,{href:"#",children:"Building Your Application"})}),e(l,{className:"hidden md:block"}),e(a,{children:e(t,{children:"Data Fetching"})})]})})]})}),r("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[r("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),e("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),e(u,{})]})}export{h as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as M}from"./chunk-6XUIHSKG.mjs";import{a as q}from"./chunk-CO6AQNZ5.mjs";import{a as P}from"./chunk-Z22NSJMF.mjs";import{a as B}from"./chunk-P2B3OITE.mjs";import{a as j}from"./chunk-GLZEHRPY.mjs";import{a as A,c as T,d as k,g as I,i as g}from"./chunk-YFAZQYK4.mjs";import{a as L}from"./chunk-L5JPAKPM.mjs";import{b}from"./chunk-ZUA4KNIR.mjs";import{a as m,b as v,c as y,e as c}from"./chunk-YO3GQYRJ.mjs";import{useEffect as re,useState as r}from"react";import{Plus as ne,Search as se,Users as G,Bot as de,User as me,Filter as ce}from"lucide-react";import{motion as ge,AnimatePresence as ue}from"motion/react";import{jsx as t,jsxs as a}from"react/jsx-runtime";function pe({initialColleagues:h,onColleagueAdd:w,onColleagueEdit:V,onColleagueDelete:W,compactView:x=!1,departments:z=["Design","Engineering","Marketing","Product","Sales","Operations"],className:J,availableUsers:E=[],existingDigitalColleagues:H=[]}){let[n,s]=r(h||[]),[d,K]=r(""),[S,U]=r("all"),[N,F]=r("all"),[p,Q]=r("all"),[R,u]=r(null),[O,C]=r(null);re(()=>{s(h||[])},[h]);let X=Array.isArray(E)?E:[],Y=Array.isArray(H)?H:[],[D,i]=r("main"),f=n.filter(e=>!e||!e.name?!1:e.name.toLowerCase().includes(d.toLowerCase())||e.type==="human"&&e.email?.toLowerCase().includes(d.toLowerCase())||e.type==="digital"&&e.jobDescription?.toLowerCase().includes(d.toLowerCase())),Z=f.filter(e=>e.type==="human"),_=f.filter(e=>e.type==="digital"),$=()=>{i("typeSelection")},Ce=e=>{e.type==="digital"&&(u(e),i("form")),console.log("Editing colleague:",e),V?.(e)},fe=e=>{e.type==="digital"&&(C(e),i("view"))},ee=e=>{let o={id:`human-${Date.now()}`,type:"human",name:e.name||"",email:e.email,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};s(l=>[...l,o]),w?.(o),i("main")},ve=e=>{if(!e||!e.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",e);return}s(o=>[...o,e]),w?.(e),i("main")},te=()=>{u(null),i("form")},ye=e=>{if(!e||!e.id){console.error("Invalid colleague provided to handleSaveColleague:",e);return}R?(s(o=>o.map(l=>l.id===e.id?e:l)),V?.(e)):(s(o=>[...o,e]),w?.(e)),i("main"),u(null)},he=()=>{i("main"),u(null),C(null)},we=()=>{i("main"),C(null)},xe=()=>{O&&(u(O),C(null),i("form"))},Se=e=>{W?.(e,n.find(o=>o.id===e).type),s(o=>o.filter(l=>l.id!==e))},le=()=>{K(""),U("all"),F("all")},Ne=()=>{let e=[];return Y.forEach(l=>{l.knowledge&&Array.isArray(l.knowledge)&&e.push(...l.knowledge),l.coreKnowledge&&Array.isArray(l.coreKnowledge)&&e.push(...l.coreKnowledge)}),n.forEach(l=>{l.type==="digital"&&(l.knowledge&&Array.isArray(l.knowledge)&&e.push(...l.knowledge),l.coreKnowledge&&Array.isArray(l.coreKnowledge)&&e.push(...l.coreKnowledge))}),e.filter((l,ae,ie)=>ae===ie.findIndex(oe=>oe.id===l.id))};return D==="typeSelection"?t(M,{onSelectHuman:()=>i("userSelection"),onSelectDigital:()=>i("digitalOptions"),onCancel:()=>i("main")}):D==="userSelection"?t(B,{users:X,onUserSelect:ee,onCancel:()=>i("typeSelection")}):D==="digitalOptions"?t(q,{onCloneExisting:()=>i("digitalClone"),onCreateNew:te,onCancel:()=>i("typeSelection")}):t("div",{className:"px-2 md:px-4 py-4 space-y-8",children:t(ue,{mode:"wait",children:t(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:a("div",{className:`space-y-6 ${J||""}`,children:[t(P,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:$}}),a("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a(m,{children:[a(v,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[t(y,{className:"text-sm font-medium",children:"Total Colleagues"}),t(G,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[t("div",{className:"text-2xl font-bold",children:n.length}),t("p",{className:"text-xs text-muted-foreground"})]})]}),a(m,{children:[a(v,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[t(y,{className:"text-sm font-medium",children:"Human Members"}),t(me,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[t("div",{className:"text-2xl font-bold",children:n.filter(e=>e.type==="human").length}),t("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),a(m,{children:[a(v,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[t(y,{className:"text-sm font-medium",children:"Digital Colleagues"}),t(de,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[t("div",{className:"text-2xl font-bold",children:n.filter(e=>e.type==="digital").length}),t("p",{className:"text-xs text-muted-foreground",children:"active"})]})]})]}),t(m,{children:t(c,{className:"pt-6",children:a("div",{className:"flex flex-col md:flex-row gap-4",children:[t("div",{className:"flex-1",children:a("div",{className:"relative",children:[t(se,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),t(L,{placeholder:"Search colleagues...",value:d,onChange:e=>K(e.target.value),className:"pl-9"})]})}),a(A,{value:S,onValueChange:U,children:[t(k,{className:"w-full md:w-[180px]",children:t(T,{placeholder:"Department"})}),a(I,{children:[t(g,{value:"all",children:"All Departments"}),z.map(e=>t(g,{value:e,children:e},e))]})]}),a(A,{value:N,onValueChange:F,children:[t(k,{className:"w-full md:w-[140px]",children:t(T,{placeholder:"Status"})}),a(I,{children:[t(g,{value:"all",children:"All Status"}),t(g,{value:"active",children:"Active"}),t(g,{value:"inactive",children:"Inactive"})]})]}),(d||S!=="all"||N!=="all")&&a(b,{variant:"outline",onClick:le,className:"gap-2",children:[t(ce,{className:"h-4 w-4"}),"Clear"]})]})})}),a("div",{className:"space-y-4",children:[t(j,{activeTab:p,onTabChange:Q,tabOptions:[{value:"all",label:`All (${f.length})`},{value:"human",label:`Human (${Z.length})`},{value:"digital",label:`Digital (${_.length})`}],maxWidth:"400px",gridCols:3}),p==="all"&&t("div",{className:`grid gap-4 ${x?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`}),p==="human"&&t("div",{className:`grid gap-4 ${x?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`}),p==="digital"&&t("div",{className:`grid gap-4 ${x?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`})]}),f.length===0&&t(m,{children:t(c,{className:"pt-6",children:a("div",{className:"text-center py-8",children:[t(G,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),t("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),t("p",{className:"text-muted-foreground mb-4",children:d||S!=="all"||N!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),a(b,{onClick:$,className:"gap-2",children:[t(ne,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}export{pe as a};
4
+ import{a as M}from"./chunk-YCD46AKJ.mjs";import{a as q}from"./chunk-G53ROINJ.mjs";import{a as P}from"./chunk-HF33ZXKX.mjs";import{a as B}from"./chunk-R422HRMQ.mjs";import{a as j}from"./chunk-GLZEHRPY.mjs";import{a as A,c as T,d as k,g as I,i as g}from"./chunk-YFAZQYK4.mjs";import{a as m,b as v,c as y,e as c}from"./chunk-YO3GQYRJ.mjs";import{a as L}from"./chunk-L5JPAKPM.mjs";import{b}from"./chunk-ZUA4KNIR.mjs";import{useEffect as re,useState as r}from"react";import{Plus as ne,Search as se,Users as G,Bot as de,User as me,Filter as ce}from"lucide-react";import{motion as ge,AnimatePresence as ue}from"motion/react";import{jsx as t,jsxs as a}from"react/jsx-runtime";function pe({initialColleagues:h,onColleagueAdd:w,onColleagueEdit:V,onColleagueDelete:W,compactView:x=!1,departments:z=["Design","Engineering","Marketing","Product","Sales","Operations"],className:J,availableUsers:E=[],existingDigitalColleagues:H=[]}){let[n,s]=r(h||[]),[d,K]=r(""),[S,U]=r("all"),[N,F]=r("all"),[p,Q]=r("all"),[R,u]=r(null),[O,C]=r(null);re(()=>{s(h||[])},[h]);let X=Array.isArray(E)?E:[],Y=Array.isArray(H)?H:[],[D,i]=r("main"),f=n.filter(e=>!e||!e.name?!1:e.name.toLowerCase().includes(d.toLowerCase())||e.type==="human"&&e.email?.toLowerCase().includes(d.toLowerCase())||e.type==="digital"&&e.jobDescription?.toLowerCase().includes(d.toLowerCase())),Z=f.filter(e=>e.type==="human"),_=f.filter(e=>e.type==="digital"),$=()=>{i("typeSelection")},Ce=e=>{e.type==="digital"&&(u(e),i("form")),console.log("Editing colleague:",e),V?.(e)},fe=e=>{e.type==="digital"&&(C(e),i("view"))},ee=e=>{let o={id:`human-${Date.now()}`,type:"human",name:e.name||"",email:e.email,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};s(l=>[...l,o]),w?.(o),i("main")},ve=e=>{if(!e||!e.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",e);return}s(o=>[...o,e]),w?.(e),i("main")},te=()=>{u(null),i("form")},ye=e=>{if(!e||!e.id){console.error("Invalid colleague provided to handleSaveColleague:",e);return}R?(s(o=>o.map(l=>l.id===e.id?e:l)),V?.(e)):(s(o=>[...o,e]),w?.(e)),i("main"),u(null)},he=()=>{i("main"),u(null),C(null)},we=()=>{i("main"),C(null)},xe=()=>{O&&(u(O),C(null),i("form"))},Se=e=>{W?.(e,n.find(o=>o.id===e).type),s(o=>o.filter(l=>l.id!==e))},le=()=>{K(""),U("all"),F("all")},Ne=()=>{let e=[];return Y.forEach(l=>{l.knowledge&&Array.isArray(l.knowledge)&&e.push(...l.knowledge),l.coreKnowledge&&Array.isArray(l.coreKnowledge)&&e.push(...l.coreKnowledge)}),n.forEach(l=>{l.type==="digital"&&(l.knowledge&&Array.isArray(l.knowledge)&&e.push(...l.knowledge),l.coreKnowledge&&Array.isArray(l.coreKnowledge)&&e.push(...l.coreKnowledge))}),e.filter((l,ae,ie)=>ae===ie.findIndex(oe=>oe.id===l.id))};return D==="typeSelection"?t(M,{onSelectHuman:()=>i("userSelection"),onSelectDigital:()=>i("digitalOptions"),onCancel:()=>i("main")}):D==="userSelection"?t(B,{users:X,onUserSelect:ee,onCancel:()=>i("typeSelection")}):D==="digitalOptions"?t(q,{onCloneExisting:()=>i("digitalClone"),onCreateNew:te,onCancel:()=>i("typeSelection")}):t("div",{className:"px-2 md:px-4 py-4 space-y-8",children:t(ue,{mode:"wait",children:t(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:a("div",{className:`space-y-6 ${J||""}`,children:[t(P,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:$}}),a("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a(m,{children:[a(v,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[t(y,{className:"text-sm font-medium",children:"Total Colleagues"}),t(G,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[t("div",{className:"text-2xl font-bold",children:n.length}),t("p",{className:"text-xs text-muted-foreground"})]})]}),a(m,{children:[a(v,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[t(y,{className:"text-sm font-medium",children:"Human Members"}),t(me,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[t("div",{className:"text-2xl font-bold",children:n.filter(e=>e.type==="human").length}),t("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),a(m,{children:[a(v,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[t(y,{className:"text-sm font-medium",children:"Digital Colleagues"}),t(de,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[t("div",{className:"text-2xl font-bold",children:n.filter(e=>e.type==="digital").length}),t("p",{className:"text-xs text-muted-foreground",children:"active"})]})]})]}),t(m,{children:t(c,{className:"pt-6",children:a("div",{className:"flex flex-col md:flex-row gap-4",children:[t("div",{className:"flex-1",children:a("div",{className:"relative",children:[t(se,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),t(L,{placeholder:"Search colleagues...",value:d,onChange:e=>K(e.target.value),className:"pl-9"})]})}),a(A,{value:S,onValueChange:U,children:[t(k,{className:"w-full md:w-[180px]",children:t(T,{placeholder:"Department"})}),a(I,{children:[t(g,{value:"all",children:"All Departments"}),z.map(e=>t(g,{value:e,children:e},e))]})]}),a(A,{value:N,onValueChange:F,children:[t(k,{className:"w-full md:w-[140px]",children:t(T,{placeholder:"Status"})}),a(I,{children:[t(g,{value:"all",children:"All Status"}),t(g,{value:"active",children:"Active"}),t(g,{value:"inactive",children:"Inactive"})]})]}),(d||S!=="all"||N!=="all")&&a(b,{variant:"outline",onClick:le,className:"gap-2",children:[t(ce,{className:"h-4 w-4"}),"Clear"]})]})})}),a("div",{className:"space-y-4",children:[t(j,{activeTab:p,onTabChange:Q,tabOptions:[{value:"all",label:`All (${f.length})`},{value:"human",label:`Human (${Z.length})`},{value:"digital",label:`Digital (${_.length})`}],maxWidth:"400px",gridCols:3}),p==="all"&&t("div",{className:`grid gap-4 ${x?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`}),p==="human"&&t("div",{className:`grid gap-4 ${x?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`}),p==="digital"&&t("div",{className:`grid gap-4 ${x?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`})]}),f.length===0&&t(m,{children:t(c,{className:"pt-6",children:a("div",{className:"text-center py-8",children:[t(G,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),t("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),t("p",{className:"text-muted-foreground mb-4",children:d||S!=="all"||N!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),a(b,{onClick:$,className:"gap-2",children:[t(ne,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}export{pe as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as N}from"./chunk-SNFBF6KT.mjs";import{a as x}from"./chunk-QKDYTCZC.mjs";import{a as g}from"./chunk-HD6E7KI2.mjs";import{a as f,b as y}from"./chunk-QY3UXH77.mjs";import{a as n}from"./chunk-R4SE63GR.mjs";import{a as r,b as h,d as v}from"./chunk-DXRAJQMA.mjs";import{a as u}from"./chunk-LJFBHY4P.mjs";import{a as b}from"./chunk-KPTGYVDM.mjs";import{a}from"./chunk-Z22NSJMF.mjs";import{useState as C}from"react";import{motion as G,AnimatePresence as Y}from"motion/react";import{Bot as z}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function K({title:k="Digital Colleagues",businessUnits:c,projects:m,fileCount:A,teamMemberCount:w,onCreateProject:P,onOpenProject:j,sidebarItems:W,initialColleagues:F,users:T,onColleagueAdd:S,onColleagueEdit:U,onColleagueDelete:I}){let[i,s]=C("home"),[l,O]=C(c[0]),d=t=>{console.log("Opening app:",t.name)},p=t=>{console.log("Favoriting app:",t.name)},B=t=>{console.log("Opening file:",t.name)},_=t=>{console.log("Sharing file:",t.name)},D=t=>{console.log("Opening project:",t.name),j(t)},R=t=>{console.log("Sharing project:",t.name)},L=t=>{O(t),console.log("Business unit changed to:",t.name)},E=()=>{console.log("Copilot clicked - navigating to chat"),s("chat")},H=t=>{console.log("Notification removed:",t)},M=()=>{console.log("All notifications removed")},V=()=>{switch(i){case"home":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[o("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",l.name," team"]}),e("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),o("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),e("p",{className:"text-3xl font-bold text-primary",children:m.length}),e("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),e("p",{className:"text-3xl font-bold text-primary",children:w}),e("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),e("p",{className:"text-3xl font-bold text-primary",children:A}),e("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),e(a,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>s("chat")}})]});case"colleagues":return e(N,{initialColleagues:F,availableUsers:T,onColleagueAdd:S,onColleagueEdit:U,onColleagueDelete:I});case"chat":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[e("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),o("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",l.name," team members and collaborate in real-time."]})]}),e(a,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return o("div",{className:"space-y-8",children:[e(a,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"New Releases"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:r.filter(t=>t.new).map(t=>e(n,{app:t,showProgress:!0,onOpen:d,onFavorite:p},t.name))})]}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"All Apps"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:r.map(t=>e(n,{app:t,onOpen:d,onFavorite:p},t.name))})]})]});case"knowledge":return e(x,{});case"files":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(a,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),o("section",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:e("h2",{className:"text-2xl font-semibold",children:"All Files"})}),e(u,{files:h,onFileClick:B})]})]});case"projects":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(a,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:P}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),e("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:m.map(t=>e(b,{project:t,onOpen:D,onShare:R},t.name))})]})]});case"learn":return o("div",{className:"space-y-8",children:[e(a,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),e("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:v.slice(0,3).map(t=>o("div",{className:"rounded-3xl border p-6",children:[e("h3",{className:"font-semibold mb-2",children:t.title}),e("p",{className:"text-sm text-muted-foreground mb-4",children:t.description}),o("div",{className:"flex items-center justify-between text-sm",children:[e("span",{children:t.duration}),e("span",{children:t.level})]})]},t.title))})]})]});default:return null}};return e(g,{sidebarItems:f,title:k,notifications:y,businessUnits:c,currentBusinessUnit:l,onBusinessUnitChange:L,activeTab:i,onTabChange:s,showTabs:!0,onActionClick:E,actionIcon:e(z,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:H,onRemoveAll:M,children:e(Y,{mode:"wait",children:e(G.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:V()},i)})})}export{K as a};
4
+ import{a as N}from"./chunk-CLMGLIGH.mjs";import{a as x}from"./chunk-GFYO6B7H.mjs";import{a as f,b as y}from"./chunk-QY3UXH77.mjs";import{a as g}from"./chunk-4KVVVRGU.mjs";import{a as n}from"./chunk-3W5SE2HO.mjs";import{a as b}from"./chunk-MQG7MKTK.mjs";import{a as u}from"./chunk-TBKC2B4Z.mjs";import{a as r,b as h,d as v}from"./chunk-DXRAJQMA.mjs";import{a}from"./chunk-HF33ZXKX.mjs";import{useState as C}from"react";import{motion as G,AnimatePresence as Y}from"motion/react";import{Bot as z}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function K({title:k="Digital Colleagues",businessUnits:c,projects:m,fileCount:A,teamMemberCount:w,onCreateProject:P,onOpenProject:j,sidebarItems:W,initialColleagues:F,users:T,onColleagueAdd:S,onColleagueEdit:U,onColleagueDelete:I}){let[i,s]=C("home"),[l,O]=C(c[0]),d=t=>{console.log("Opening app:",t.name)},p=t=>{console.log("Favoriting app:",t.name)},B=t=>{console.log("Opening file:",t.name)},_=t=>{console.log("Sharing file:",t.name)},D=t=>{console.log("Opening project:",t.name),j(t)},R=t=>{console.log("Sharing project:",t.name)},L=t=>{O(t),console.log("Business unit changed to:",t.name)},E=()=>{console.log("Copilot clicked - navigating to chat"),s("chat")},H=t=>{console.log("Notification removed:",t)},M=()=>{console.log("All notifications removed")},V=()=>{switch(i){case"home":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[o("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",l.name," team"]}),e("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),o("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),e("p",{className:"text-3xl font-bold text-primary",children:m.length}),e("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),e("p",{className:"text-3xl font-bold text-primary",children:w}),e("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),e("p",{className:"text-3xl font-bold text-primary",children:A}),e("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),e(a,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>s("chat")}})]});case"colleagues":return e(N,{initialColleagues:F,availableUsers:T,onColleagueAdd:S,onColleagueEdit:U,onColleagueDelete:I});case"chat":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[e("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),o("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",l.name," team members and collaborate in real-time."]})]}),e(a,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return o("div",{className:"space-y-8",children:[e(a,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"New Releases"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:r.filter(t=>t.new).map(t=>e(n,{app:t,showProgress:!0,onOpen:d,onFavorite:p},t.name))})]}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"All Apps"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:r.map(t=>e(n,{app:t,onOpen:d,onFavorite:p},t.name))})]})]});case"knowledge":return e(x,{});case"files":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(a,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),o("section",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:e("h2",{className:"text-2xl font-semibold",children:"All Files"})}),e(u,{files:h,onFileClick:B})]})]});case"projects":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(a,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:P}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),e("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:m.map(t=>e(b,{project:t,onOpen:D,onShare:R},t.name))})]})]});case"learn":return o("div",{className:"space-y-8",children:[e(a,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),e("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:v.slice(0,3).map(t=>o("div",{className:"rounded-3xl border p-6",children:[e("h3",{className:"font-semibold mb-2",children:t.title}),e("p",{className:"text-sm text-muted-foreground mb-4",children:t.description}),o("div",{className:"flex items-center justify-between text-sm",children:[e("span",{children:t.duration}),e("span",{children:t.level})]})]},t.title))})]})]});default:return null}};return e(g,{sidebarItems:f,title:k,notifications:y,businessUnits:c,currentBusinessUnit:l,onBusinessUnitChange:L,activeTab:i,onTabChange:s,showTabs:!0,onActionClick:E,actionIcon:e(z,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:H,onRemoveAll:M,children:e(Y,{mode:"wait",children:e(G.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:V()},i)})})}export{K as a};
@@ -1 +1 @@
1
- import{f as r}from"./chunk-FRXZ2OKW.mjs";import{jsx as e}from"react/jsx-runtime";var c=({children:o,richText:t})=>e("div",{className:"min-w-full py-10 bg-muted mt-24",children:e("div",{className:"container",children:o||t&&e(r,{content:t,enableGutter:!1})})});export{c as a};
1
+ import{f as r}from"./chunk-ZGDSCGLC.mjs";import{jsx as e}from"react/jsx-runtime";var c=({children:o,richText:t})=>e("div",{className:"min-w-full py-10 bg-muted mt-24",children:e("div",{className:"container",children:o||t&&e(r,{content:t,enableGutter:!1})})});export{c as a};
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ "use strict";
3
+
4
+ import{b as v}from"./chunk-ZUA4KNIR.mjs";import{a as u}from"./chunk-MDJREBVI.mjs";import*as e from"react";import w from"embla-carousel-react";import{ArrowLeft as z,ArrowRight as E}from"lucide-react";import{default as H}from"embla-carousel-autoplay";import{jsx as l,jsxs as P}from"react/jsx-runtime";var y=e.createContext(null);function f(){let t=e.useContext(y);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function D({orientation:t="horizontal",opts:r,setApi:a,plugins:n,className:i,children:c,...p}){let[x,o]=w({...r,axis:t==="horizontal"?"x":"y"},n),[R,b]=e.useState(!1),[N,h]=e.useState(!1),C=e.useCallback(s=>{s&&(b(s.canScrollPrev()),h(s.canScrollNext()))},[]),m=e.useCallback(()=>{o?.scrollPrev()},[o]),d=e.useCallback(()=>{o?.scrollNext()},[o]),S=e.useCallback(s=>{s.key==="ArrowLeft"?(s.preventDefault(),m()):s.key==="ArrowRight"&&(s.preventDefault(),d())},[m,d]);return e.useEffect(()=>{!o||!a||a(o)},[o,a]),e.useEffect(()=>{if(o)return C(o),o.on("reInit",C),o.on("select",C),()=>{o?.off("select",C)}},[o,C]),l(y.Provider,{value:{carouselRef:x,api:o,opts:r,orientation:t||(r?.axis==="y"?"vertical":"horizontal"),scrollPrev:m,scrollNext:d,canScrollPrev:R,canScrollNext:N},children:l("div",{onKeyDownCapture:S,className:u("relative",i),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...p,children:c})})}function T({className:t,...r}){let{carouselRef:a,orientation:n}=f();return l("div",{ref:a,className:"overflow-hidden","data-slot":"carousel-content",children:l("div",{className:u("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r})})}function U({className:t,...r}){let{orientation:a}=f();return l("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:u("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"pt-4",t),...r})}function K({className:t,variant:r="outline",size:a="icon",...n}){let{orientation:i,scrollPrev:c,canScrollPrev:p}=f();return P(v,{"data-slot":"carousel-previous",variant:r,size:a,className:u("absolute size-8 rounded-full",i==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!p,onClick:c,...n,children:[l(z,{}),l("span",{className:"sr-only",children:"Previous slide"})]})}function L({className:t,variant:r="outline",size:a="icon",...n}){let{orientation:i,scrollNext:c,canScrollNext:p}=f();return P(v,{"data-slot":"carousel-next",variant:r,size:a,className:u("absolute size-8 rounded-full",i==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!p,onClick:c,...n,children:[l(E,{}),l("span",{className:"sr-only",children:"Next slide"})]})}export{D as a,T as b,U as c,K as d,L as e,H as f};
@@ -1 +1 @@
1
- import{a as u,c as g,d as p,g as v,i as b}from"./chunk-YFAZQYK4.mjs";import{a as B}from"./chunk-INCYANPB.mjs";import{a as F}from"./chunk-B4H6T2GP.mjs";import{a as l}from"./chunk-TVZOULLL.mjs";import{a as S}from"./chunk-FT3AE7L2.mjs";import{a as w,f as P,g as L,i as A}from"./chunk-3UMMMQEH.mjs";import{a as d}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{b as I}from"./chunk-CSBGSBEU.mjs";import{useState as x,useEffect as M}from"react";import{UserIcon as Q,CalendarIcon as $,SaveIcon as j,PlusIcon as q}from"lucide-react";import{jsx as a,jsxs as r}from"react/jsx-runtime";function ie({deal:c,users:f,customer:T,categories:U,onClose:E,onSave:O,onAddComment:V}){let[t,h]=x({...c,value:c.value||0,comments:c.comments||[],customer:c.customer||{}}),[C,D]=x(""),[H,y]=x(!1),[i,s]=x(null);M(()=>{y(JSON.stringify(c)!==JSON.stringify(t))},[c,t]);let R=async()=>{try{let e=await O(t);e.success?(y(!1),s(null)):console.error("Failed to save deal:",e.errors)}catch(e){console.error("Failed to save deal:",e)}},n=(e,o)=>{h(N=>({...N,[e]:o}))},G=e=>{let o=(t.categories||[]).includes(e)?(t.categories||[]).filter(N=>N!==e):[...t.categories||[],e];n("categories",o)},J=async()=>{if(C.trim()){let e={text:C,timestamp:new Date().toISOString()};try{let o=await V(e);if(!o.success){console.error("Failed to add comment:",o.errors);return}}catch(o){console.error("Failed to add comment:",o)}h(o=>({...o,comments:[...o.comments||[],e]})),D("")}},k=e=>{switch(e){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},W=e=>f?.find(o=>o.id===Number(e));return a(w,{open:!0,children:r(P,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[r(L,{className:"flex flex-row items-center justify-between",children:[a(A,{className:"text-2xl font-bold",children:T?.name||"no customer"}),r("div",{className:"flex space-x-2",children:[a(m,{variant:"outline",onClick:E,children:"Close"}),r(m,{onClick:R,disabled:!H,children:[a(j,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),r(S,{className:"flex-grow pr-4",children:[r("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a("div",{className:"grid gap-2 m-1",children:i==="value"?a(d,{type:"number",value:t.value,onChange:e=>n("value",Number(e.target.value)),onBlur:()=>s(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):r("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("value"),children:["\xA3",t.value?.toLocaleString()]})}),r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Assignee"}),i==="assignee"?r(u,{value:t?.assignee?.id?.toString()||"",onValueChange:e=>n("assignee",W(e)),children:[a(p,{children:a(g,{placeholder:"Select assignee"})}),a(v,{children:f&&f.map(e=>a(b,{value:e?.id?.toString()||"",children:e.name},e.id))})]}):r("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("assignee"),children:[a(Q,{className:"w-4 h-4 text-gray-400"}),a("span",{children:t?.assignee?.name})]})]}),r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Closure Date"}),i==="closureDate"?a(d,{type:"date",value:t.closureDate?.split("T")[0]??"",onChange:e=>n("closureDate",e.target.value),onBlur:()=>s(null),className:"mr-2",autoFocus:!0}):r("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("closureDate"),children:[a($,{className:"w-4 h-4 text-gray-400"}),a("span",{children:t.closureDate?new Date(t.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),a("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Description"}),i==="description"?a(F,{value:t.description||"",onChange:e=>n("description",e.target.value),onBlur:()=>s(null),className:"min-h-[100px]",autoFocus:!0}):a("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>s("description"),children:t.description})]})}),r("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Status"}),i==="status"?r(u,{value:t.status,onValueChange:e=>{n("status",e),s(null)},children:[a(p,{children:a(g,{placeholder:"Select status"})}),a(v,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(e=>a(b,{value:e,children:e},e))})]}):a("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("status"),children:t.status})]}),r("div",{className:"grid col-span-2 gap-2",children:[a(l,{className:"text-sm font-medium text-accent",children:"Categories"}),i==="categories"?a("div",{className:"grid grid-cols-2 gap-2 m-1",children:U.map(e=>r("div",{className:"flex items-center space-x-2",children:[a(B,{id:e.id?.toString()||"",checked:(t.categories||[]).some(o=>o.id===e.id),onCheckedChange:()=>e.id!==void 0&&G(e)}),a("label",{htmlFor:(e.id??"").toString(),className:`text-sm font-medium ${k(e.type||"sector")} px-2 py-1 rounded`,children:e.name})]},e.id))}):a("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("categories"),children:t.categories&&t.categories.map(e=>{let o=e;return o?a(I,{variant:"outline",className:k(o.type||"sector"),children:o.name},o.id):null})})]}),r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"COGE Status"}),i==="gecoStatus"?r(u,{value:t.gecoStatus??void 0,onValueChange:e=>{n("gecoStatus",e),s(null)},children:[a(p,{children:a(g,{placeholder:"Select status"})}),a(v,{children:["firm","forecast","other"].map(e=>a(b,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}):a("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("gecoStatus"),children:t.gecoStatus?t.gecoStatus.charAt(0).toUpperCase()+t.gecoStatus.slice(1):"N/A"})]})]}),r("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[r("div",{className:"grid gap-2",children:[a(l,{className:"text-sm font-medium text-accent",children:"Comments"}),a(S,{className:"h-[200px] overflow-y-auto",children:a("div",{className:"space-y-2",children:t.comments&&t.comments.slice().sort((e,o)=>new Date(o.timestamp||"").getTime()-new Date(e.timestamp||"").getTime()).map(e=>r("div",{className:"p-3 rounded-lg",children:[a("p",{className:"text-sm text-foreground",children:e.text}),r("p",{className:"text-xs text-foreground mt-1",children:[e?.author?.name," - ",new Date(e.timestamp||"").toLocaleString()]})]},e.id))})}),r("div",{className:"flex mt-2",children:[a(d,{value:C,onChange:e=>D(e.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),r(m,{onClick:J,className:"ml-2",children:[a(q,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),r("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(t.updatedAt||"").toLocaleString()]})]})]})]})})}export{ie as a};
1
+ import{a as u,c as g,d as p,g as v,i as b}from"./chunk-YFAZQYK4.mjs";import{a as B}from"./chunk-INCYANPB.mjs";import{a as F}from"./chunk-B4H6T2GP.mjs";import{a as l}from"./chunk-TVZOULLL.mjs";import{a as S}from"./chunk-FT3AE7L2.mjs";import{a as w,f as P,g as L,i as A}from"./chunk-3UMMMQEH.mjs";import{b as I}from"./chunk-CSBGSBEU.mjs";import{a as d}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{useState as x,useEffect as M}from"react";import{UserIcon as Q,CalendarIcon as $,SaveIcon as j,PlusIcon as q}from"lucide-react";import{jsx as a,jsxs as r}from"react/jsx-runtime";function ie({deal:c,users:f,customer:T,categories:U,onClose:E,onSave:O,onAddComment:V}){let[t,h]=x({...c,value:c.value||0,comments:c.comments||[],customer:c.customer||{}}),[C,D]=x(""),[H,y]=x(!1),[i,s]=x(null);M(()=>{y(JSON.stringify(c)!==JSON.stringify(t))},[c,t]);let R=async()=>{try{let e=await O(t);e.success?(y(!1),s(null)):console.error("Failed to save deal:",e.errors)}catch(e){console.error("Failed to save deal:",e)}},n=(e,o)=>{h(N=>({...N,[e]:o}))},G=e=>{let o=(t.categories||[]).includes(e)?(t.categories||[]).filter(N=>N!==e):[...t.categories||[],e];n("categories",o)},J=async()=>{if(C.trim()){let e={text:C,timestamp:new Date().toISOString()};try{let o=await V(e);if(!o.success){console.error("Failed to add comment:",o.errors);return}}catch(o){console.error("Failed to add comment:",o)}h(o=>({...o,comments:[...o.comments||[],e]})),D("")}},k=e=>{switch(e){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},W=e=>f?.find(o=>o.id===Number(e));return a(w,{open:!0,children:r(P,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[r(L,{className:"flex flex-row items-center justify-between",children:[a(A,{className:"text-2xl font-bold",children:T?.name||"no customer"}),r("div",{className:"flex space-x-2",children:[a(m,{variant:"outline",onClick:E,children:"Close"}),r(m,{onClick:R,disabled:!H,children:[a(j,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),r(S,{className:"flex-grow pr-4",children:[r("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a("div",{className:"grid gap-2 m-1",children:i==="value"?a(d,{type:"number",value:t.value,onChange:e=>n("value",Number(e.target.value)),onBlur:()=>s(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):r("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("value"),children:["\xA3",t.value?.toLocaleString()]})}),r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Assignee"}),i==="assignee"?r(u,{value:t?.assignee?.id?.toString()||"",onValueChange:e=>n("assignee",W(e)),children:[a(p,{children:a(g,{placeholder:"Select assignee"})}),a(v,{children:f&&f.map(e=>a(b,{value:e?.id?.toString()||"",children:e.name},e.id))})]}):r("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("assignee"),children:[a(Q,{className:"w-4 h-4 text-gray-400"}),a("span",{children:t?.assignee?.name})]})]}),r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Closure Date"}),i==="closureDate"?a(d,{type:"date",value:t.closureDate?.split("T")[0]??"",onChange:e=>n("closureDate",e.target.value),onBlur:()=>s(null),className:"mr-2",autoFocus:!0}):r("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("closureDate"),children:[a($,{className:"w-4 h-4 text-gray-400"}),a("span",{children:t.closureDate?new Date(t.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),a("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Description"}),i==="description"?a(F,{value:t.description||"",onChange:e=>n("description",e.target.value),onBlur:()=>s(null),className:"min-h-[100px]",autoFocus:!0}):a("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>s("description"),children:t.description})]})}),r("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"Status"}),i==="status"?r(u,{value:t.status,onValueChange:e=>{n("status",e),s(null)},children:[a(p,{children:a(g,{placeholder:"Select status"})}),a(v,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(e=>a(b,{value:e,children:e},e))})]}):a("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("status"),children:t.status})]}),r("div",{className:"grid col-span-2 gap-2",children:[a(l,{className:"text-sm font-medium text-accent",children:"Categories"}),i==="categories"?a("div",{className:"grid grid-cols-2 gap-2 m-1",children:U.map(e=>r("div",{className:"flex items-center space-x-2",children:[a(B,{id:e.id?.toString()||"",checked:(t.categories||[]).some(o=>o.id===e.id),onCheckedChange:()=>e.id!==void 0&&G(e)}),a("label",{htmlFor:(e.id??"").toString(),className:`text-sm font-medium ${k(e.type||"sector")} px-2 py-1 rounded`,children:e.name})]},e.id))}):a("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("categories"),children:t.categories&&t.categories.map(e=>{let o=e;return o?a(I,{variant:"outline",className:k(o.type||"sector"),children:o.name},o.id):null})})]}),r("div",{className:"grid gap-2 m-1",children:[a(l,{className:"text-sm font-medium text-accent",children:"COGE Status"}),i==="gecoStatus"?r(u,{value:t.gecoStatus??void 0,onValueChange:e=>{n("gecoStatus",e),s(null)},children:[a(p,{children:a(g,{placeholder:"Select status"})}),a(v,{children:["firm","forecast","other"].map(e=>a(b,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}):a("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>s("gecoStatus"),children:t.gecoStatus?t.gecoStatus.charAt(0).toUpperCase()+t.gecoStatus.slice(1):"N/A"})]})]}),r("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[r("div",{className:"grid gap-2",children:[a(l,{className:"text-sm font-medium text-accent",children:"Comments"}),a(S,{className:"h-[200px] overflow-y-auto",children:a("div",{className:"space-y-2",children:t.comments&&t.comments.slice().sort((e,o)=>new Date(o.timestamp||"").getTime()-new Date(e.timestamp||"").getTime()).map(e=>r("div",{className:"p-3 rounded-lg",children:[a("p",{className:"text-sm text-foreground",children:e.text}),r("p",{className:"text-xs text-foreground mt-1",children:[e?.author?.name," - ",new Date(e.timestamp||"").toLocaleString()]})]},e.id))})}),r("div",{className:"flex mt-2",children:[a(d,{value:C,onChange:e=>D(e.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),r(m,{onClick:J,className:"ml-2",children:[a(q,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),r("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(t.updatedAt||"").toLocaleString()]})]})]})]})})}export{ie as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as Q}from"./chunk-QOZ2O3FG.mjs";import{a as H}from"./chunk-VRHJOUL3.mjs";import{a as z}from"./chunk-GJHJUG72.mjs";import{a as L}from"./chunk-2R3MJSQ7.mjs";import{a as J}from"./chunk-6PS55VJZ.mjs";import{a as q}from"./chunk-L3V5YDPH.mjs";import{a as W}from"./chunk-QC2UWZWL.mjs";import{a as K}from"./chunk-EOR2BAI2.mjs";import{a as O}from"./chunk-UVHMI3PU.mjs";import{useEffect as o,useState as s}from"react";import{useRouter as Je}from"next/navigation";import{jsx as a,jsxs as Qe}from"react/jsx-runtime";function Le({title:Xe="",initialTasks:f=[],initialEpics:h=[],initialSprints:A=[],initialProjects:D=[],initialReminders:v=[],initialColleagues:S=[],initialUsers:E=[],initialFiles:w=[],initialView:C="kanban",onAddTask:X,onUpdateTask:Y,onDeleteTask:Z,onTaskClick:Ye,onAddEpic:_,onUpdateEpic:$,onDeleteEpic:ee,onAddTaskToEpic:Ze,onAddSprint:te,onUpdateSprint:ne,onDeleteSprint:ie,onAddProject:se,onUpdateProject:ae,onDeleteProject:oe,onFileAdd:de,onFileEdit:re,onFileDelete:le,onFileClick:ce,onAddReminder:pe,onUpdateReminder:me,onDeleteReminder:ke,onViewChange:Te,onToggleMobileMenu:ue,onTeamClick:_e,onTeamChange:$e,onCopilotClick:et,handleAddComment:ge}){let[c,d]=s(f),[l,p]=s(h),[m,k]=s(A),[fe,T]=s(D),[he,u]=s(v),[P,Ae]=s(S),[F,De]=s(E),[ve,y]=s(w),[Se,R]=s(!1),[Ee,M]=s(!1),[we,N]=s(null),[Ce,Pe]=s(null),[V,j]=s(null),[r,I]=s(C||"kanban"),[tt,Ue]=s(!1),be=Je();o(()=>{d(f)},[f]),o(()=>{k(A)},[A]),o(()=>{p(h)},[h]),o(()=>{T(D)},[D]),o(()=>{y(w)},[w]),o(()=>{De(E)},[E]),o(()=>{Ae(S)},[S]),o(()=>{u(v)},[v]),o(()=>{I(C)},[C]);let Oe=c.filter(e=>{}),nt=e=>Oe.filter(t=>t.status===e),it=e=>{let t={};return l.forEach(n=>{}),t},st=e=>{j(e)},at=e=>{V&&(d(t=>t.map(n=>n.id===V.id?{...n,status:e}:n)),j(null))},B=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};d(n=>[...n,t]),X?.(t)},g=async(e,t)=>(d(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),await Y?.(e,t)),ot=async(e,t)=>{g(e,t)},x=e=>{d(t=>t.filter(n=>n.id!==Number(e))),we?.id===Number(e)&&N(null),Z?.(e)},dt=async e=>{x(e)},rt=e=>{let t={...e,id:Date.now()};T(n=>[...n,t]),se?.(e)},lt=(e,t)=>{T(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),ae?.(e,t)},ct=e=>{T(t=>t.filter(n=>n.id!==Number(e))),oe?.(e)},G=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};p(n=>[...n,t]),_?.({...t})},Fe=()=>{M(!0)},ye=(e,t)=>{p(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),$?.(e,t)},Re=e=>{p(t=>t.filter(n=>n.id!==Number(e))),d(t=>t.filter(n=>O(n.epic)!==Number(e))),ee?.(e)},Me=e=>{let t={...e,id:Date.now()};k(n=>[...n,t]),te?.(e)},Ne=(e,t)=>{k(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),ne?.(e,t)},Ve=e=>{e==="backlog"||e==="all-tasks"||(k(t=>t.filter(n=>n.id!==Number(e))),d(t=>t.map(n=>O(n.sprint)===Number(e)?{...n,sprint:void 0}:n)),ie?.(e))},U=e=>{N(e)},je=e=>{e==="planning"&&window.innerWidth<768||(I(e),Te?.(e))},pt=()=>{Ue(e=>!e),ue?.()},mt=()=>{be.push("/")},kt=e=>{console.log("Switching to team:",e)},Tt=e=>{console.log("Switching to team:",e)},Ie=e=>{R(!0)},Be=()=>{R(!1),Pe(null)},xe=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString()};u(n=>[...n,t]),pe?.(e)},Ge=(e,t)=>{u(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),me?.(e,t)},He=e=>{u(t=>t.filter(n=>n.id!==Number(e))),ke?.(e)},Ke=()=>{de?.()},We=e=>{re?.(e)},qe=e=>{y(t=>t.filter(n=>n.name!==e)),le?.(e)},ze=e=>{ce?.(e)},ut=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],gt=()=>{switch(r){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},b=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],ft=b.sort((e,t)=>t.lastUsed.getTime()-e.lastUsed.getTime()).slice(0,3),ht=b.length>3,At=b.slice(3);return Qe(K,{currentView:r,onViewChange:je,children:[r==="kanban"&&a("div",{className:"h-full overflow-hidden",children:a(z,{initialProjects:fe,initialEpics:l,initialSprints:m.map(e=>({...e,isSelected:!1})),initialTasks:c,initialColleagues:P,initialUsers:F,onAddTask:B,onUpdateTask:g,onDeleteTask:x,onTaskClick:U,onAddEpic:G,onAddComment:ge})}),r==="planning"&&a("div",{className:"hidden md:block h-full",children:a(L,{tasks:c,epics:l,sprints:m,onUpdateTask:g,onTaskClick:U,onAddSprint:Me,onUpdateSprint:Ne,onDeleteSprint:Ve})}),r==="tasks"&&a("div",{className:"h-full",children:a(Q,{initialReminders:he,initialColleagues:P,onAddReminder:xe,onUpdateReminder:Ge,onDeleteReminder:He})}),r==="files"&&a("div",{className:"h-full",children:a(H,{initialFiles:ve,onFileAdd:Ke,onFileEdit:We,onFileDelete:qe,onFileClick:ze,compactView:!1})}),r==="epics"&&a("div",{className:"h-full",children:a(J,{tasks:c,epics:l,sprints:m,onUpdateTask:g,onTaskClick:U,onAddTaskToEpic:Ie,onAddEpic:Fe,onUpdateEpic:ye,onDeleteEpic:Re})}),a(W,{isOpen:Se,onClose:Be,onAddTask:B,epics:l,sprints:m,assignees:[...P,...F],defaultEpicId:Ce||void 0}),a(q,{isOpen:Ee,onClose:()=>M(!1),onAddEpic:G})]})}export{Le as a};
4
+ import{a as Q}from"./chunk-5WTGNFUL.mjs";import{a as z}from"./chunk-KGFSSFVZ.mjs";import{a as L}from"./chunk-QHIZOLWH.mjs";import{a as J}from"./chunk-T46EPXCV.mjs";import{a as q}from"./chunk-L3V5YDPH.mjs";import{a as W}from"./chunk-QC2UWZWL.mjs";import{a as H}from"./chunk-LMDGHBG2.mjs";import{a as K}from"./chunk-EOR2BAI2.mjs";import{a as O}from"./chunk-UVHMI3PU.mjs";import{useEffect as o,useState as s}from"react";import{useRouter as Je}from"next/navigation";import{jsx as a,jsxs as Qe}from"react/jsx-runtime";function Le({title:Xe="",initialTasks:f=[],initialEpics:h=[],initialSprints:A=[],initialProjects:D=[],initialReminders:v=[],initialColleagues:S=[],initialUsers:E=[],initialFiles:w=[],initialView:C="kanban",onAddTask:X,onUpdateTask:Y,onDeleteTask:Z,onTaskClick:Ye,onAddEpic:_,onUpdateEpic:$,onDeleteEpic:ee,onAddTaskToEpic:Ze,onAddSprint:te,onUpdateSprint:ne,onDeleteSprint:ie,onAddProject:se,onUpdateProject:ae,onDeleteProject:oe,onFileAdd:de,onFileEdit:re,onFileDelete:le,onFileClick:ce,onAddReminder:pe,onUpdateReminder:me,onDeleteReminder:ke,onViewChange:Te,onToggleMobileMenu:ue,onTeamClick:_e,onTeamChange:$e,onCopilotClick:et,handleAddComment:ge}){let[c,d]=s(f),[l,p]=s(h),[m,k]=s(A),[fe,T]=s(D),[he,u]=s(v),[P,Ae]=s(S),[F,De]=s(E),[ve,y]=s(w),[Se,R]=s(!1),[Ee,M]=s(!1),[we,N]=s(null),[Ce,Pe]=s(null),[V,j]=s(null),[r,I]=s(C||"kanban"),[tt,Ue]=s(!1),be=Je();o(()=>{d(f)},[f]),o(()=>{k(A)},[A]),o(()=>{p(h)},[h]),o(()=>{T(D)},[D]),o(()=>{y(w)},[w]),o(()=>{De(E)},[E]),o(()=>{Ae(S)},[S]),o(()=>{u(v)},[v]),o(()=>{I(C)},[C]);let Oe=c.filter(e=>{}),nt=e=>Oe.filter(t=>t.status===e),it=e=>{let t={};return l.forEach(n=>{}),t},st=e=>{j(e)},at=e=>{V&&(d(t=>t.map(n=>n.id===V.id?{...n,status:e}:n)),j(null))},B=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};d(n=>[...n,t]),X?.(t)},g=async(e,t)=>(d(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),await Y?.(e,t)),ot=async(e,t)=>{g(e,t)},x=e=>{d(t=>t.filter(n=>n.id!==Number(e))),we?.id===Number(e)&&N(null),Z?.(e)},dt=async e=>{x(e)},rt=e=>{let t={...e,id:Date.now()};T(n=>[...n,t]),se?.(e)},lt=(e,t)=>{T(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),ae?.(e,t)},ct=e=>{T(t=>t.filter(n=>n.id!==Number(e))),oe?.(e)},G=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};p(n=>[...n,t]),_?.({...t})},Fe=()=>{M(!0)},ye=(e,t)=>{p(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),$?.(e,t)},Re=e=>{p(t=>t.filter(n=>n.id!==Number(e))),d(t=>t.filter(n=>O(n.epic)!==Number(e))),ee?.(e)},Me=e=>{let t={...e,id:Date.now()};k(n=>[...n,t]),te?.(e)},Ne=(e,t)=>{k(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),ne?.(e,t)},Ve=e=>{e==="backlog"||e==="all-tasks"||(k(t=>t.filter(n=>n.id!==Number(e))),d(t=>t.map(n=>O(n.sprint)===Number(e)?{...n,sprint:void 0}:n)),ie?.(e))},U=e=>{N(e)},je=e=>{e==="planning"&&window.innerWidth<768||(I(e),Te?.(e))},pt=()=>{Ue(e=>!e),ue?.()},mt=()=>{be.push("/")},kt=e=>{console.log("Switching to team:",e)},Tt=e=>{console.log("Switching to team:",e)},Ie=e=>{R(!0)},Be=()=>{R(!1),Pe(null)},xe=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString()};u(n=>[...n,t]),pe?.(e)},Ge=(e,t)=>{u(n=>n.map(i=>i.id===Number(e)?{...i,...t}:i)),me?.(e,t)},He=e=>{u(t=>t.filter(n=>n.id!==Number(e))),ke?.(e)},Ke=()=>{de?.()},We=e=>{re?.(e)},qe=e=>{y(t=>t.filter(n=>n.name!==e)),le?.(e)},ze=e=>{ce?.(e)},ut=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],gt=()=>{switch(r){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},b=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],ft=b.sort((e,t)=>t.lastUsed.getTime()-e.lastUsed.getTime()).slice(0,3),ht=b.length>3,At=b.slice(3);return Qe(K,{currentView:r,onViewChange:je,children:[r==="kanban"&&a("div",{className:"h-full overflow-hidden",children:a(z,{initialProjects:fe,initialEpics:l,initialSprints:m.map(e=>({...e,isSelected:!1})),initialTasks:c,initialColleagues:P,initialUsers:F,onAddTask:B,onUpdateTask:g,onDeleteTask:x,onTaskClick:U,onAddEpic:G,onAddComment:ge})}),r==="planning"&&a("div",{className:"hidden md:block h-full",children:a(L,{tasks:c,epics:l,sprints:m,onUpdateTask:g,onTaskClick:U,onAddSprint:Me,onUpdateSprint:Ne,onDeleteSprint:Ve})}),r==="tasks"&&a("div",{className:"h-full",children:a(Q,{initialReminders:he,initialColleagues:P,onAddReminder:xe,onUpdateReminder:Ge,onDeleteReminder:He})}),r==="files"&&a("div",{className:"h-full",children:a(H,{initialFiles:ve,onFileAdd:Ke,onFileEdit:We,onFileDelete:qe,onFileClick:ze,compactView:!1})}),r==="epics"&&a("div",{className:"h-full",children:a(J,{tasks:c,epics:l,sprints:m,onUpdateTask:g,onTaskClick:U,onAddTaskToEpic:Ie,onAddEpic:Fe,onUpdateEpic:ye,onDeleteEpic:Re})}),a(W,{isOpen:Se,onClose:Be,onAddTask:B,epics:l,sprints:m,assignees:[...P,...F],defaultEpicId:Ce||void 0}),a(q,{isOpen:Ee,onClose:()=>M(!1),onAddEpic:G})]})}export{Le as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{c as R,h as v,i as w,j as B,k as P,l,m as s,o as b,p as o,q as n,r as u,v as C,w as g,x as y}from"./chunk-ZFUP5NVF.mjs";import{a as f}from"./chunk-7GSXNSLD.mjs";import{a as p,b as d,c}from"./chunk-YNCJATT7.mjs";import{a as M}from"./chunk-FVM5SQT2.mjs";import{PencilLine as z,ChevronDown as h,FilePlus as E,Edit as H,Printer as _}from"lucide-react";import $ from"clsx";import{Fragment as T,jsx as e,jsxs as a}from"react/jsx-runtime";var q=()=>e(M,{iconName:"github",size:"10x"});function Z({relatedContent:i,tableOfContents:x,editorComponent:N,loading:m=!1,editMode:k=!1,onAddDocument:A,onEditDocument:L,onPrintDocument:O,onGithubClick:G,onNavClick:S,LinkComponent:I,...D}){let F=I?t=>e(I,{...t}):S?({item:t,children:r,...j})=>e("button",{onClick:()=>S&&S(t),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...j,children:r}):t=>e("a",{href:t.href,...t});return a(R,{side:"right",variant:"inset",...D,children:[a(v,{className:"border-b border-sidebar-border",children:[a(o,{className:"flex-row space-x-1",children:[e(n,{children:a(u,{onClick:A,children:[e(E,{})," ",e("span",{children:"Add Document"})]})}),G&&e(n,{children:e(u,{onClick:G,tooltip:"Open in GitHub",children:e(q,{})})})]}),a(o,{className:"flex-row space-x-1",children:[e(n,{className:"w-5/12",children:a(u,{onClick:()=>L(),variant:k?"outline":"default",className:$(k&&"text-accent"),children:[e(H,{})," ",e("span",{children:"Edit"})]})}),e(n,{className:"w-5/12",children:a(u,{onClick:O,children:[e(_,{})," ",e("span",{children:"Print"})]})})]})]}),N&&a(T,{children:[e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Editor Controls",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:N})})]})}),e(B,{className:"mx-0"})]}),a(P,{className:"overflow-auto",children:[m&&a(T,{children:[a(l,{children:[e(s,{children:"Related Content"}),e(b,{children:e(o,{children:Array.from({length:3}).map((t,r)=>e(n,{children:e(f,{className:"bg-gray-200 w-full h-10"})},r))})})]}),a(l,{children:[e(s,{children:"Table of Contents"}),e(b,{children:e(o,{children:Array.from({length:3}).map((t,r)=>e(n,{children:e(f,{className:"bg-gray-200 w-full h-10"})},r))})})]})]}),i&&!m&&Object.keys(i).length>0&&e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Related Content",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:e(o,{children:i&&Object.keys(i).map(t=>a(n,{children:[a("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",t.charAt(0).toUpperCase()+t.slice(1)]}),t&&i[t]&&e(C,{children:i[t].map(r=>e(g,{children:e(y,{asChild:!0,isActive:!1,size:"sm",children:a(F,{href:r.url,item:r,className:"flex justify-between items-center w-full text-xs",children:[e("span",{children:r.label}),r.type==="note"&&e(z,{className:"ml-2 text-gray-400 !important",size:16}),r.type==="draft"&&e(M,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},r.label))})]},t))})})})]})}),x&&!m&&e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Table of Contents",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:e(o,{children:x.map(t=>a(n,{children:[e(u,{asChild:!0,children:e("a",{href:`#${t.url}`,className:"text-xs",children:t.title})}),t.items?.length?e(C,{children:t.items.map(r=>e(g,{children:e(y,{asChild:!0,isActive:r.isActive,size:"sm",children:e("a",{href:`#${r.url}`,className:"flex justify-between items-center w-full text-xs",children:e("span",{children:r.title})})})},r.title))}):null]},t.title))})})})]})})]}),e(w,{})]})}export{Z as a};
4
+ import{a as M}from"./chunk-FVM5SQT2.mjs";import{c as R,h as v,i as w,j as B,k as P,l,m as s,o as b,p as o,q as n,r as u,v as C,w as g,x as y}from"./chunk-ZFUP5NVF.mjs";import{a as f}from"./chunk-7GSXNSLD.mjs";import{a as p,b as d,c}from"./chunk-YNCJATT7.mjs";import{PencilLine as z,ChevronDown as h,FilePlus as E,Edit as H,Printer as _}from"lucide-react";import $ from"clsx";import{Fragment as T,jsx as e,jsxs as a}from"react/jsx-runtime";var q=()=>e(M,{iconName:"github",size:"10x"});function Z({relatedContent:i,tableOfContents:x,editorComponent:N,loading:m=!1,editMode:k=!1,onAddDocument:A,onEditDocument:L,onPrintDocument:O,onGithubClick:G,onNavClick:S,LinkComponent:I,...D}){let F=I?t=>e(I,{...t}):S?({item:t,children:r,...j})=>e("button",{onClick:()=>S&&S(t),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...j,children:r}):t=>e("a",{href:t.href,...t});return a(R,{side:"right",variant:"inset",...D,children:[a(v,{className:"border-b border-sidebar-border",children:[a(o,{className:"flex-row space-x-1",children:[e(n,{children:a(u,{onClick:A,children:[e(E,{})," ",e("span",{children:"Add Document"})]})}),G&&e(n,{children:e(u,{onClick:G,tooltip:"Open in GitHub",children:e(q,{})})})]}),a(o,{className:"flex-row space-x-1",children:[e(n,{className:"w-5/12",children:a(u,{onClick:()=>L(),variant:k?"outline":"default",className:$(k&&"text-accent"),children:[e(H,{})," ",e("span",{children:"Edit"})]})}),e(n,{className:"w-5/12",children:a(u,{onClick:O,children:[e(_,{})," ",e("span",{children:"Print"})]})})]})]}),N&&a(T,{children:[e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Editor Controls",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:N})})]})}),e(B,{className:"mx-0"})]}),a(P,{className:"overflow-auto",children:[m&&a(T,{children:[a(l,{children:[e(s,{children:"Related Content"}),e(b,{children:e(o,{children:Array.from({length:3}).map((t,r)=>e(n,{children:e(f,{className:"bg-gray-200 w-full h-10"})},r))})})]}),a(l,{children:[e(s,{children:"Table of Contents"}),e(b,{children:e(o,{children:Array.from({length:3}).map((t,r)=>e(n,{children:e(f,{className:"bg-gray-200 w-full h-10"})},r))})})]})]}),i&&!m&&Object.keys(i).length>0&&e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Related Content",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:e(o,{children:i&&Object.keys(i).map(t=>a(n,{children:[a("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",t.charAt(0).toUpperCase()+t.slice(1)]}),t&&i[t]&&e(C,{children:i[t].map(r=>e(g,{children:e(y,{asChild:!0,isActive:!1,size:"sm",children:a(F,{href:r.url,item:r,className:"flex justify-between items-center w-full text-xs",children:[e("span",{children:r.label}),r.type==="note"&&e(z,{className:"ml-2 text-gray-400 !important",size:16}),r.type==="draft"&&e(M,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},r.label))})]},t))})})})]})}),x&&!m&&e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Table of Contents",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:e(o,{children:x.map(t=>a(n,{children:[e(u,{asChild:!0,children:e("a",{href:`#${t.url}`,className:"text-xs",children:t.title})}),t.items?.length?e(C,{children:t.items.map(r=>e(g,{children:e(y,{asChild:!0,isActive:r.isActive,size:"sm",children:e("a",{href:`#${r.url}`,className:"flex justify-between items-center w-full text-xs",children:e("span",{children:r.title})})})},r.title))}):null]},t.title))})})})]})})]}),e(w,{})]})}export{Z as a};
@@ -1,5 +1,5 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{b as w,c as C}from"./chunk-SPAOEUCG.mjs";import{b as y}from"./chunk-Q7KKN6MH.mjs";import{a as P}from"./chunk-MDJREBVI.mjs";import{a as b}from"./chunk-Q3G5UAAD.mjs";import{useEffect as d,useRef as s,useState as H,useCallback as x}from"react";import{Previewer as p}from"pagedjs";import{Fragment as N,jsx as n,jsxs as l}from"react/jsx-runtime";function T(r){var e=document.createElement("div");e.style.display="block",e.style.height=r,document.body.appendChild(e);var i=parseFloat(window.getComputedStyle(e,null).height);return e.parentNode&&e.parentNode.removeChild(e),Math.floor(i)}var m=r=>{let e=document.createElement("div");e.style.height="1mm",document.body.appendChild(e);let i=parseFloat(window.getComputedStyle(e).height);return document.body.removeChild(e),Math.floor(r/i)},F=({page:r,layout:e="portrait",logoImage:i})=>e==="flow"?n(E,{page:r,layout:e,logoImage:i}):n(B,{page:r,layout:e,logoImage:i}),E=({page:r,layout:e="portrait",logoImage:i})=>{let{contentWithIds:c}=b(r),u=s(null),a=s(null),h=s(new p),f={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};d(()=>{let o=document.getElementById("printable-content");if(o){let t=document.createElement("style");return t.textContent=`@page { size: ${m(o.offsetWidth)}mm ${m(o.offsetHeight)}mm ; margin: 0mm; width: ${m(o.offsetWidth)}mm }; .container : { max-width: ${m(o.offsetWidth)}mm; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(t),()=>{document.head.removeChild(t)}}},[e]);let k=x(()=>{if(!a.current)return;a.current&&(a.current.innerHTML="");let o=document.getElementById("printable-content");o&&h.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${m(o.offsetWidth)}mm ${m(o.offsetHeight)}mm ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],a.current).catch(t=>console.error("Paged.js error:",t))},[e]);d(()=>{h.current=new p},[k,e]);let g=[f,...c];return l("div",{children:[n("div",{className:"w-[1123px] print:w-[1123px]",children:l("div",{id:"printable-content",ref:u,children:[g.map((o,t)=>n(N,{children:t===0?n("section",{className:"title-page w-full h-full",children:n(C,{hero:r.hero,title:r.title})},t):l("section",{className:"normal-page overflow-hidden",children:[o.blockName&&n(w,{title:o.blockName}),n(y,{blocks:[o],fill:!0})]},t)})),n("section",{className:"normal-page",children:l("div",{className:`w-full py-2 px-8 flex justify-between items-center
4
+ import{b as w,c as C}from"./chunk-SG5BHIQF.mjs";import{b as y}from"./chunk-DNZWIOML.mjs";import{a as P}from"./chunk-MDJREBVI.mjs";import{a as b}from"./chunk-Q3G5UAAD.mjs";import{useEffect as d,useRef as s,useState as H,useCallback as x}from"react";import{Previewer as p}from"pagedjs";import{Fragment as N,jsx as n,jsxs as l}from"react/jsx-runtime";function T(r){var e=document.createElement("div");e.style.display="block",e.style.height=r,document.body.appendChild(e);var i=parseFloat(window.getComputedStyle(e,null).height);return e.parentNode&&e.parentNode.removeChild(e),Math.floor(i)}var m=r=>{let e=document.createElement("div");e.style.height="1mm",document.body.appendChild(e);let i=parseFloat(window.getComputedStyle(e).height);return document.body.removeChild(e),Math.floor(r/i)},F=({page:r,layout:e="portrait",logoImage:i})=>e==="flow"?n(E,{page:r,layout:e,logoImage:i}):n(B,{page:r,layout:e,logoImage:i}),E=({page:r,layout:e="portrait",logoImage:i})=>{let{contentWithIds:c}=b(r),u=s(null),a=s(null),h=s(new p),f={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};d(()=>{let o=document.getElementById("printable-content");if(o){let t=document.createElement("style");return t.textContent=`@page { size: ${m(o.offsetWidth)}mm ${m(o.offsetHeight)}mm ; margin: 0mm; width: ${m(o.offsetWidth)}mm }; .container : { max-width: ${m(o.offsetWidth)}mm; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(t),()=>{document.head.removeChild(t)}}},[e]);let k=x(()=>{if(!a.current)return;a.current&&(a.current.innerHTML="");let o=document.getElementById("printable-content");o&&h.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${m(o.offsetWidth)}mm ${m(o.offsetHeight)}mm ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],a.current).catch(t=>console.error("Paged.js error:",t))},[e]);d(()=>{h.current=new p},[k,e]);let g=[f,...c];return l("div",{children:[n("div",{className:"w-[1123px] print:w-[1123px]",children:l("div",{id:"printable-content",ref:u,children:[g.map((o,t)=>n(N,{children:t===0?n("section",{className:"title-page w-full h-full",children:n(C,{hero:r.hero,title:r.title})},t):l("section",{className:"normal-page overflow-hidden",children:[o.blockName&&n(w,{title:o.blockName}),n(y,{blocks:[o],fill:!0})]},t)})),n("section",{className:"normal-page",children:l("div",{className:`w-full py-2 px-8 flex justify-between items-center
5
5
  dark bg-background text-primary`,children:[l("div",{className:"flex px-6 items-center space-x-2",children:[i&&n("img",{src:i.src,alt:"Cortex Reply Logo",className:"h-8"}),n("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),n("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),n("div",{ref:a,className:"preview-container"})]})},B=({page:r,layout:e="portrait"})=>{let{contentWithIds:i}=b(r),c=s(null),u=s(null),a=s(new p),[h,f]=H(0),g=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...i],o=x(()=>{c.current&&(c.current&&(c.current.innerHTML=""),a.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",e==="landscape"?"./landscape.css":"./portrait.css"],c.current).then(t=>f(t.pageCount)).catch(t=>console.error("Paged.js error:",t)))},[e]);return d(()=>{a.current=new p,o()},[o,e]),d(()=>{let t=document.createElement("style");return t.textContent=`@page { size: A4 ${e} ; margin: 0mm; };`,document.head.appendChild(t),()=>{document.head.removeChild(t)}},[]),l("div",{className:"pagedjs-container",children:[n("div",{id:"printable-content",ref:u,style:{display:"none"},className:"pagedjs-content",children:g.map((t,v)=>n(N,{children:v===0?n("section",{className:"pagedjs-section title-page w-full h-full",children:n(C,{hero:r.hero,title:r.title})},v):l("section",{className:P("pagedjs-section normal-page h-[699px]",`h-[${T("185mm")}px]`,t.theme?.settings?.theme==="dark"?"dark":"light"),children:[t.blockName&&n(w,{title:t.blockName}),n(y,{blocks:[t],fill:!0})]},v)}))}),n("div",{ref:c,className:"preview-container"})]})};export{F as a,E as b,B as c};