cortex-react-components 2.26.4 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SME3D72Q.mjs → chunk-2BRDNDUB.mjs} +1 -1
- package/dist/{chunk-HTS3KCJL.mjs → chunk-2O54GV6Q.mjs} +1 -1
- package/dist/chunk-32G45Z2G.mjs +1 -0
- package/dist/{chunk-QDP657UR.mjs → chunk-3HNU2NYP.mjs} +1 -1
- package/dist/{chunk-HB57GPGK.mjs → chunk-3M5KHST3.mjs} +1 -1
- package/dist/{chunk-TIIYFAV6.mjs → chunk-3NRXQBBS.mjs} +1 -1
- package/dist/{chunk-IISYRLNU.mjs → chunk-3Y7QG6VP.mjs} +1 -1
- package/dist/{chunk-GULRIPMU.mjs → chunk-4FEVXBNU.mjs} +1 -1
- package/dist/{chunk-YH72WKGC.mjs → chunk-5MWZTJYP.mjs} +1 -1
- package/dist/chunk-6YHCNPFB.mjs +4 -0
- package/dist/{chunk-AABB4TFO.mjs → chunk-75F3LJMX.mjs} +1 -1
- package/dist/{chunk-NZJ7VVG6.mjs → chunk-7NWIK57W.mjs} +1 -1
- package/dist/{chunk-TQKXHMD7.mjs → chunk-7R47MHQE.mjs} +1 -1
- package/dist/{chunk-FB5PBKLV.mjs → chunk-AJQHGVZ5.mjs} +1 -1
- package/dist/chunk-B7RZ4K6Y.mjs +1 -0
- package/dist/{chunk-7MPZOMXK.mjs → chunk-C4RWEPVF.mjs} +1 -1
- package/dist/{chunk-VNKGAW4K.mjs → chunk-CXOVEABI.mjs} +1 -1
- package/dist/{chunk-J3VJUPR7.mjs → chunk-EM3T2XYC.mjs} +1 -1
- package/dist/{chunk-UTJZH3X5.mjs → chunk-EPJJKGCG.mjs} +1 -1
- package/dist/{chunk-VDN4LQSS.mjs → chunk-F6DMXMR4.mjs} +1 -1
- package/dist/{chunk-JU4TJYSZ.mjs → chunk-FE7ZGUPU.mjs} +1 -1
- package/dist/{chunk-HLRMUJPL.mjs → chunk-FZX3ZPEU.mjs} +1 -1
- package/dist/chunk-G6OGEIN4.mjs +4 -0
- package/dist/{chunk-7BYNW77I.mjs → chunk-GHOL5L32.mjs} +1 -1
- package/dist/chunk-GLZEHRPY.mjs +4 -0
- package/dist/{chunk-5MMNC65L.mjs → chunk-GTZJWMZR.mjs} +1 -1
- package/dist/chunk-HD6E7KI2.mjs +4 -0
- package/dist/{chunk-OP6ZWZIM.mjs → chunk-I75OOO4H.mjs} +1 -1
- package/dist/{chunk-NXAQ6ESJ.mjs → chunk-JDIPWJBD.mjs} +1 -1
- package/dist/{chunk-BGQC6IQK.mjs → chunk-KEK763EH.mjs} +1 -1
- package/dist/chunk-KQRQXBJ3.mjs +9 -0
- package/dist/{chunk-RWHPQAWZ.mjs → chunk-LAP57E2L.mjs} +1 -1
- package/dist/chunk-LCEEFZH7.mjs +4 -0
- package/dist/chunk-LEF6M5ZD.mjs +4 -0
- package/dist/{chunk-EM4CGGGV.mjs → chunk-LJXTXROJ.mjs} +1 -1
- package/dist/{chunk-DKRRVTCV.mjs → chunk-MS7YIAWP.mjs} +1 -1
- package/dist/chunk-MXMW65GM.mjs +4 -0
- package/dist/{chunk-YJ7XPZWV.mjs → chunk-NBJLXJQ3.mjs} +1 -1
- package/dist/{chunk-ITNR7N47.mjs → chunk-NINFDOV5.mjs} +1 -1
- package/dist/{chunk-5EM6P7SU.mjs → chunk-OQBCIB4L.mjs} +1 -1
- package/dist/{chunk-AN744MXS.mjs → chunk-OWL3KUE3.mjs} +1 -1
- package/dist/chunk-P2B3OITE.mjs +4 -0
- package/dist/{chunk-CC57QZMB.mjs → chunk-RGOKBIQ5.mjs} +1 -1
- package/dist/{chunk-MU47F4UR.mjs → chunk-RJGYVDOU.mjs} +1 -1
- package/dist/{chunk-CTTBF7F4.mjs → chunk-RS4WAAGI.mjs} +1 -1
- package/dist/chunk-SOTCQX2G.mjs +1 -0
- package/dist/{chunk-CMU5JFUC.mjs → chunk-SWE754OC.mjs} +1 -1
- package/dist/{chunk-ZA423OPA.mjs → chunk-TJZVV3XH.mjs} +1 -1
- package/dist/{chunk-WRCRZUGO.mjs → chunk-TTWEHUP5.mjs} +1 -1
- package/dist/{chunk-FBEHQRZ4.mjs → chunk-TVTTUSWM.mjs} +1 -1
- package/dist/{chunk-FR4X2HHQ.mjs → chunk-TYARLEAC.mjs} +1 -1
- package/dist/chunk-U3PUWUVM.mjs +4 -0
- package/dist/{chunk-VATGKKXW.mjs → chunk-UJITFLIZ.mjs} +1 -1
- package/dist/{chunk-IO5ZSALG.mjs → chunk-VKCDLKYH.mjs} +1 -1
- package/dist/{chunk-NDBSSX6Q.mjs → chunk-WIRQ5IRT.mjs} +1 -1
- package/dist/{chunk-VTFO5GXK.mjs → chunk-XMYXQR5W.mjs} +1 -1
- package/dist/{chunk-OVZKO3Z5.mjs → chunk-ZEALRBXW.mjs} +1 -1
- package/dist/components/AdvancedComponents/AppSidebar.d.ts +3 -2
- package/dist/components/AdvancedComponents/AppSidebar.js +1 -2
- package/dist/components/AdvancedComponents/AppSidebar.mjs +1 -1
- package/dist/components/AdvancedComponents/app-header.js +1 -1
- package/dist/components/AdvancedComponents/app-header.mjs +1 -1
- package/dist/components/AdvancedComponents/index.d.ts +1 -0
- package/dist/components/AdvancedComponents/index.js +12 -1
- package/dist/components/AdvancedComponents/index.mjs +1 -1
- package/dist/components/AdvancedComponents/navigation-tabs.js +1 -1
- package/dist/components/AdvancedComponents/navigation-tabs.mjs +1 -1
- package/dist/components/AdvancedComponents/org-chart-component/OrgChart.d.ts +15 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgChart.js +12 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgChart.mjs +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgNode.d.ts +3 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgNode.js +9 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgNode.mjs +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgTree.d.ts +10 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgTree.js +12 -0
- package/dist/components/AdvancedComponents/org-chart-component/OrgTree.mjs +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/examples/PayloadIntegration.js +233 -0
- package/dist/components/AdvancedComponents/org-chart-component/examples/PayloadIntegration.mjs +233 -0
- package/dist/components/AdvancedComponents/org-chart-component/index.d.ts +4 -0
- package/dist/components/AdvancedComponents/org-chart-component/index.js +12 -0
- package/dist/components/AdvancedComponents/org-chart-component/index.mjs +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/mockData.d.ts +7 -0
- package/dist/components/AdvancedComponents/org-chart-component/mockData.js +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/mockData.mjs +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/types/index.d.ts +33 -0
- package/dist/components/AdvancedComponents/org-chart-component/types/index.js +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/types/index.mjs +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/utils.d.ts +13 -0
- package/dist/components/AdvancedComponents/org-chart-component/utils.js +1 -0
- package/dist/components/AdvancedComponents/org-chart-component/utils.mjs +1 -0
- package/dist/components/AdvancedComponents/user-selection.js +1 -1
- package/dist/components/AdvancedComponents/user-selection.mjs +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/OrgChart.mjs +3 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.d.ts +0 -1
- package/dist/components/Blocks/index.js +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.js +3 -3
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +5 -5
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.js +5 -5
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.js +3 -3
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +3 -3
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +3 -3
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +3 -3
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.js +1 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.js +5 -5
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/ColleaguesView.js +1 -1
- package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.js +5 -5
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.js +5 -5
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +6 -6
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.d.ts +12 -1
- package/dist/components/Foundary/Views/ColleaguesView.js +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +5 -5
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/colleague-card.js +1 -1
- package/dist/components/Foundary/colleague-card.mjs +1 -1
- package/dist/components/Foundary/colleague-form.d.ts +12 -1
- package/dist/components/Foundary/colleague-form.js +1 -1
- package/dist/components/Foundary/colleague-form.mjs +1 -1
- package/dist/components/Foundary/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/file-edit.mjs +1 -1
- package/dist/components/Foundary/foundary-clone.js +1 -1
- package/dist/components/Foundary/foundary-clone.mjs +1 -1
- package/dist/components/Foundary/foundary-layout.d.ts +2 -1
- package/dist/components/Foundary/foundary-layout.js +1 -1
- package/dist/components/Foundary/foundary-layout.mjs +1 -1
- package/dist/components/Foundary/index.js +5 -5
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/Foundary/knowledge-search.js +1 -1
- package/dist/components/Foundary/knowledge-search.mjs +1 -1
- package/dist/components/Foundary/types.d.ts +14 -2
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/FileView.js +1 -1
- package/dist/components/Projects/FileView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.js +5 -5
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.js +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
- package/dist/components/Projects/file-list.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.js +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +33 -22
- package/dist/components/index.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +38 -27
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-4WA47ZQA.mjs +0 -4
- package/dist/chunk-53QLSQCO.mjs +0 -4
- package/dist/chunk-5HT2KC5I.mjs +0 -4
- package/dist/chunk-CRAFZGCI.mjs +0 -4
- package/dist/chunk-FGEFYI5E.mjs +0 -4
- package/dist/chunk-GPFPTU7U.mjs +0 -4
- package/dist/chunk-KKW3FINI.mjs +0 -4
- package/dist/chunk-NDZ26EG6.mjs +0 -4
- package/dist/chunk-Y7H3EUBR.mjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as p}from"./chunk-5MWZTJYP.mjs";import{a as v}from"./chunk-AJQHGVZ5.mjs";import{c as b,d as h}from"./chunk-2BRDNDUB.mjs";import{a as k}from"./chunk-X3JZSN3W.mjs";import{a}from"./chunk-MDJREBVI.mjs";import{Fragment as x}from"react";import R from"next/image";import{jsx as t,jsxs as g}from"react/jsx-runtime";var y={content:v,cta:b,mediaBlock:k,collapsibleArea:p,imageBlock:k,features:h,reusableContentBlock:C},P=e=>{let{blocks:n}=e;return n&&Array.isArray(n)&&n.length>0?t("section",{id:"render-blocks",className:a(e.fill?"h-full w-full":""),children:n.map((i,s)=>{let{blockType:r}=i,m=i?.theme;if(r&&r in y){let o=y[r];if(r==="reusableContentBlock")return t(x,{children:t(P,{blocks:i.reusableContent.layout})},s);if(o)return g("div",{className:a("py-6 relative",e.fill&&"flex h-full items-center justify-center"),children:[t(B,{block:i,index:s}),t("div",{className:a("container h-full relative",m?.settings?.theme||"dark"),children:t(o,{...i})})]},s)}return null})}):null},B=e=>{if(!("theme"in e.block))return t("div",{className:a("absolute inset-0 w-screen h-full dark bg-background")});let n=e.block?.theme;if(n.settings.background==="image"){let u={imagePosition:n.settings.imagePosition||"left",overlay:n.settings.overlay!==void 0?n.settings.overlay:!0};return g("div",{className:a("absolute inset-0 w-full h-full bg-background",n.settings.theme||"dark"),children:[t(R,{src:n.settings?.image?.url||"/placeholder.svg",alt:n.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),n.settings.overlay&&t("div",{className:"absolute inset-0",style:{background:u.imagePosition==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]})}return t("div",{className:a("absolute inset-0 w-screen h-full bg-background",n.settings.theme||"dark")})},E=e=>{let{blocks:n}=e;return n&&Array.isArray(n)&&n.length>0?t("main",{id:"content-blocks",className:a(e.fill?"h-full w-full":""),children:n.map((i,s)=>{let{blockType:r}=i,m=i?.theme;if(r&&r in y){let o=y[r];if(r==="reusableContentBlock")return t(x,{children:t(P,{blocks:i.reusableContent.layout})},s);if(o)return t(A,{block:i,allBlocks:n,index:s,children:t(o,{...i})})}return null})}):null},A=e=>{if(e.index===0)return g("section",{className:"relative flex w-full",children:[t("div",{className:a("absolute inset-0 w-screen h-full light bg-background")}),t("div",{className:a("container h-full relative pt-6 pb-12 min-h-[22em] content-center light bg-background"),children:e.children})]});let n=l=>l%2===0?"light":"dark",u=({index:l,allBlocks:c})=>l===1?t(N,{position:"left"}):s(l,c)==="dark"&&m(l,c)==="light"?t(w,{position:"left"}):s(l,c)==="light"&&m(l,c)==="dark"?t(N,{position:"left"}):null,i=({index:l,allBlocks:c})=>r(l,c)==="light"&&m(l,c)==="dark"?t(w,{position:"left"}):null,s=(l,c)=>{if(l===1)return"light";let d=c[l-1];return"theme"in d&&d.theme?.settings?.theme==="light"?"light":"dark"},r=(l,c)=>{if(l===c.length-1)return"dark";if(l===0)return"light";let d=c[l+1];return"theme"in d&&d.theme?.settings?.theme==="light"?"light":"dark"},m=(l,c)=>{if(l===c.length-1)return"dark";let d=c[l];return d.theme&&d.theme?.settings?.theme==="light"?"light":"dark"};if(!e.block.theme||!e.block.theme.settings)return s(e.index,e.allBlocks)==="dark"?g("section",{id:e.block.name||"content-block",className:"relative flex flex-col w-full pt-12",children:[t("div",{className:a("absolute inset-0 w-screen dark bg-background")}),t("div",{className:a("container relative","dark bg-background py-1"),children:e.children})]}):g("section",{id:e.block.name||"content-block-start",className:"relative flex flex-col w-full",children:[t(u,{index:e.index,allBlocks:e.allBlocks}),t("div",{className:a("absolute inset-0 w-screen")}),t("div",{className:"bg-black",children:t("div",{className:a("container relative","dark bg-background py-1"),children:e.children})})]});if(!("theme"in e.block)||s(e.index,e.allBlocks)===m(e.index,e.allBlocks)){let l=m(e.index,e.allBlocks);return g("section",{id:e.block.name||"content-block-continue",className:" relative flex flex-col w-full pt-20",children:[t("div",{className:a("absolute inset-0 w-screen bg-background",l)}),t("div",{className:a("container relative bg-background py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(s(e.index,e.allBlocks)!==m(e.index,e.allBlocks)){let l=m(e.index,e.allBlocks);return g("section",{id:e.block.blockName||"content-block-continue",className:"relative flex flex-col w-full",children:[t(u,{index:e.index,allBlocks:e.allBlocks}),t("div",{className:a("absolute inset-0 w-screen bg-background",l)}),t("div",{className:a("container relative bg-background min-h-[22em] content-center py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(!("theme"in e.block))return g("div",{className:a("container h-full relative","dark"),children:[t("div",{className:a("absolute inset-0 w-screen h-full dark bg-background py-1")}),e.children]});let o=e.block?.theme;if(o.settings.background==="image"){let l={imagePosition:o.settings.imagePosition||"left",overlay:o.settings.overlay!==void 0?o.settings.overlay:!0};return g("div",{className:a("absolute inset-0 w-full h-full bg-background",o.settings.theme||"dark"),children:[t(R,{src:o.settings?.image?.url||"/placeholder.svg",alt:o.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),o.settings.overlay&&t("div",{className:"absolute inset-0",style:{background:l.imagePosition==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]})}return t("div",{className:a("absolute inset-0 w-screen h-full bg-background",o.settings.theme||"dark")})},N=({position:e})=>t("div",{className:"w-full aspect-[1920/360] z-20 relative -top-[2px] bg-white",children:t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"2 2 1920 360",preserveAspectRatio:"none",style:{transform:"rotateX(180deg)",position:"absolute",bottom:"-2px"},className:a("w-full block overflow-hidden"),children:t("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})}),w=({position:e})=>t("div",{className:"w-full relative z-20 aspect-[1920/332] overflow-hidden ",children:g("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:a("absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end"},children:[t("defs",{children:g("mask",{id:"mask",children:[t("rect",{width:"100%",height:"100%",fill:"white"}),t("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),t("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});import{Fragment as F,jsx as f,jsxs as I}from"react/jsx-runtime";var C=e=>{let{customId:n,reusableContent:u}=e;return typeof u=="object"&&u!==null?f(S,{blocks:u.layout}):f(F,{})},T={content:v,cta:b,mediaBlock:k,imageBlock:k,features:h},S=e=>{let{blocks:n}=e;return n&&Array.isArray(n)&&n.length>0?f(F,{children:n.map((i,s)=>{let{blockType:r}=i,m=i?.theme;if(r&&r in T){let o=T[r];if(o)return I("div",{className:"py-6 relative",children:[f(B,{block:i,index:s}),f("div",{className:a(m?.settings?.theme==="dark"?"dark":m?.settings?.theme==="green"?"green":""),children:f(o,{...i})})]},s)}return null})}):null};export{C as a,P as b,B as c,E as d,A as e,N as f,w as g};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as d}from"./chunk-
|
|
4
|
+
import{a as d}from"./chunk-2O54GV6Q.mjs";import{a as D}from"./chunk-DCOFQFVJ.mjs";import{a as T}from"./chunk-Z22NSJMF.mjs";import{a as x}from"./chunk-GLZEHRPY.mjs";import{a as A}from"./chunk-L5JPAKPM.mjs";import{b as F}from"./chunk-ZUA4KNIR.mjs";import{a as u,e as g}from"./chunk-YO3GQYRJ.mjs";import{useEffect as V,useRef as j,useState as o}from"react";import{Plus as z,Search as G,File as W,Filter as q}from"lucide-react";import{motion as J,AnimatePresence as K}from"motion/react";import{jsx as e,jsxs as i}from"react/jsx-runtime";function Q({initialFiles:n=[],onFileAdd:k,onFileEdit:E,onFileDelete:S,onFileClick:H,onFileUpdate:c,compactView:m=!1,className:$}){let[I,h]=o(n),[s,v]=o(""),[y,O]=o("all"),[r,P]=o("all"),[B,C]=o(!1),b=j(""),M=l=>l.map(t=>`${t.id}-${new Date(t.createdAt).getTime()}-${new Date(t.updatedAt).getTime()}`).join("-");V(()=>{let l=M(n.map(t=>({...t,updatedAt:new Date().toISOString()})));l!==b.current&&(h(n),b.current=l)},[n]);let a=I.filter(l=>l.name.toLowerCase().includes(s.toLowerCase())),N=a.slice(0,10),U=a.filter(Boolean),w=()=>{C(!0)},X=l=>{E?.(l)},p=l=>{console.log("deleting file",l),h(t=>t.filter(R=>R.name!==l.name)),S?.(l.id.toString())},f=l=>{H?.(l)},L=()=>{v(""),O("all")};return i("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(K,{mode:"wait",children:e(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:i("div",{className:`space-y-6 ${$||""}`,children:[e(T,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:w},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),e(u,{children:e(g,{className:"pt-6",children:i("div",{className:"flex flex-col md:flex-row gap-4",children:[e("div",{className:"flex-1",children:i("div",{className:"relative",children:[e(G,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e(A,{placeholder:"Search files...",value:s,onChange:l=>v(l.target.value),className:"pl-9"})]})}),(s||y!=="all")&&i(F,{variant:"outline",onClick:L,className:"gap-2",children:[e(q,{className:"h-4 w-4"}),"Clear"]})]})})}),i("div",{className:"space-y-4",children:[e(x,{activeTab:r,onTabChange:P,tabOptions:[{value:"all",label:`All Files (${a.length})`},{value:"recent",label:`Recent (${N.length})`}],maxWidth:"500px",gridCols:3}),r==="all"&&e(d,{files:a,onFileClick:f,onFileUpdate:c,onFileDelete:p,showHeader:!m}),r==="recent"&&e(d,{files:N,onFileClick:f,onFileUpdate:c,onFileDelete:p,showHeader:!m}),r==="shared"&&e(d,{files:U,onFileClick:f,onFileUpdate:c,onFileDelete:p,showHeader:!m})]}),a.length===0&&e(u,{children:e(g,{className:"pt-6",children:i("div",{className:"text-center py-8",children:[e(W,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),e("p",{className:"text-muted-foreground mb-4",children:s||y!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),i(F,{onClick:w,className:"gap-2",children:[e(z,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),e(D,{isOpen:B,onClose:()=>C(!1),onAddFile:k})]})}export{Q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as V}from"./chunk-
|
|
4
|
+
import{a as V}from"./chunk-XMYXQR5W.mjs";import{a as A}from"./chunk-DFIXTV2M.mjs";import{a as I,c as _,d as L,g as O,i as M}from"./chunk-YFAZQYK4.mjs";import{a as z}from"./chunk-B4H6T2GP.mjs";import{a as k}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{motion as H}from"motion/react";import{Save as oe,X as J,Plus as ie,ChevronDown as le,ChevronRight as de,Info as $,File as P,FileText as ce,Type as me,Loader2 as ue}from"lucide-react";import{useEffect as w,useRef as p,useState as y}from"react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function De({document:C,onSave:S,mode:fe="edit",onCancel:U,availableDocuments:K=[],knowledgeContexts:W=[]}){let[s,l]=y({...C,updatedAt:new Date}),[x,X]=y(!1),[d,q]=y(s.richTextContent),[u,R]=y(!1),he=p(null),v=p(""),T=p(null),f=p(null),F=e=>{let a=new WeakSet,n=r=>r&&typeof r=="object"?a.has(r)?null:(a.add(r),Array.isArray(r)?r.map(n):Object.keys(r).sort().reduce((o,c)=>(o[c]=n(r[c]),o),{})):r;return JSON.stringify(n(e))},h=e=>e?e.replace(/\s+/g," ").trim():"",D=()=>s.format==="richText"?F(d):h(s.content),j=()=>{let e={title:h(s.title),description:h(s.description),format:s.format,content:D()},a=F(e),n=5381;for(let r=0;r<a.length;r++)n=n*33^a.charCodeAt(r);return(n>>>0).toString(16)},G=(e,a)=>{if(e===a)return!1;if(s.format!=="richText"){let n=Q(e),r=D();if(n==null)return!0;let o=n.length,c=r.length,g=Math.abs(c-o),b=o===0?1:g/o;return h(n)===h(r)&&g<3?!1:g>=10||b>=.02}return!0},B=p(new Map),Q=e=>{let a=B.current.get(e);return a==null?null:"x".repeat(a)};w(()=>(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{let e=j(),a=v.current;if(G(a,e)&&(R(!0),S({...s,richTextContent:d},"autosave"),v.current=e,s.format!=="richText")){let n=D();B.current.set(e,n.length)}},800),()=>{f.current&&clearTimeout(f.current)}),[s.title,s.description,s.format,s.content,s.metadata,d]),w(()=>{let e=()=>{let a=j();a!==v.current&&(S({...s,richTextContent:d},"autosave"),v.current=a)};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[s,d]),w(()=>(u&&(T.current=setTimeout(()=>{R(!1)},2e3)),()=>{T.current&&clearTimeout(T.current)}),[u]),w(()=>{l(C)},[C]);let ge=e=>{switch(e){case"markdown":case"mdx":return t(ce,{className:"h-6 w-6 text-primary"});case"richText":return t(P,{className:"h-6 w-6 text-success"});case"text":return t(me,{className:"h-6 w-6 text-muted-foreground"});default:return t(P,{className:"h-6 w-6 text-muted-foreground"})}},Y=e=>{switch(e){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},Z=()=>{let e=new Set,a=new Set;return W.forEach(n=>{n.menuConfig.groupBy.forEach(r=>e.add(r))}),K.forEach(n=>{n.metadata&&Object.keys(n.metadata).forEach(r=>a.add(r))}),{contextKeys:Array.from(e).sort(),documentKeys:Array.from(a).sort(),allKeys:Array.from(new Set([...e,...a])).sort()}},ee=e=>{let a=new Set;return K.forEach(n=>{n.metadata?.[e]&&a.add(String(n.metadata[e]))}),Array.from(a).sort()},te=Z(),ae=()=>{S({...s,richTextContent:d},"autosave")},N=(e,a)=>{l(n=>({...n,metadata:{...n.metadata,[e]:a}}))},ne=(e,a)=>{a==="__custom__"?N(e,""):N(e,a)},se=()=>{N("","")},re=e=>{l(a=>{let n={...a.metadata};return delete n[e],{...a,metadata:n}})};return i(H.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[i("div",{className:"border-b border-border bg-card p-8 pb-6",children:[i("div",{className:"flex items-start justify-between gap-4 mb-4",children:[t("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:i("div",{className:"flex-1 min-w-0",children:[i("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[t("div",{className:"flex-1 min-w-0",children:t(A,{fieldName:"title",value:s.title,label:"",onSave:(e,a)=>l(n=>({...n,title:a})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),t("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${Y(s.format)} flex-shrink-0 mt-1`,children:s.format.toUpperCase()})]}),t("div",{className:"mt-2",children:t(A,{fieldName:"description",value:s.description||"Click to add description...",label:"",multiline:!0,onSave:(e,a)=>l(n=>({...n,description:a})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),i("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i(m,{variant:"ghost",size:"sm",onClick:()=>X(!x),className:"gap-2",children:[t($,{className:"h-4 w-4"}),"Metadata",s.metadata&&Object.keys(s.metadata).length>0&&t("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(s.metadata).length}),x?t(le,{className:"h-4 w-4"}):t(de,{className:"h-4 w-4"})]}),i(m,{variant:"outline",size:"sm",onClick:U,className:"gap-2",children:[t(J,{className:"h-4 w-4"}),"Close"]}),i(m,{size:"sm",onClick:ae,className:"gap-2",disabled:u,children:[u?t(ue,{className:"h-4 w-4 animate-spin"}):t(oe,{className:"h-4 w-4"}),u?"Auto-saving...":"Save"]})]})]}),t(H.div,{initial:!1,animate:{height:x?"auto":0,opacity:x?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:i("div",{className:"pt-4 border-t border-border mt-4 max-h-full flex gap-2",children:[t("div",{className:"flex items-center justify-between mb-3",children:i("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[t($,{className:"h-4 w-4"}),"Document Metadata"]})}),i("div",{className:"flex flex-col gap-2",children:[t("div",{className:"bg-muted rounded-lg p-4 border border-border",children:s.metadata&&Object.keys(s.metadata).length>0?t("div",{className:"space-y-2",children:Object.entries(s.metadata).map(([e,a],n)=>{let r=ee(e);return i("div",{className:"flex gap-2 items-center",children:[t(k,{value:e,onChange:o=>{let c=o.target.value||"",g=s.metadata?.[e];l(b=>{let E={...b.metadata};return delete E[e],c&&(E[c]=g||""),{...b,metadata:E}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${e}`}),t("datalist",{id:`metadata-keys-${e}`,children:te.allKeys.map(o=>t("option",{value:o},o))}),t("span",{className:"text-muted-foreground text-sm",children:"="}),r.length>0?i(I,{value:String(a||""),onValueChange:o=>ne(e,o),children:[t(L,{className:"flex-1 h-8 text-sm",children:t(_,{placeholder:"Value"})}),i(O,{children:[r.map(o=>t(M,{value:o,children:o},o)),t(M,{value:"__custom__",children:t("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):t(k,{value:String(a||""),onChange:o=>N(e,o.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),t(m,{type:"button",variant:"ghost",size:"sm",onClick:()=>re(e),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:t(J,{className:"h-3 w-3"})})]},`metadata-key-${n}`)})}):i("div",{className:"text-center py-4",children:[t("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),t("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})}),i(m,{type:"button",variant:"outline",size:"sm",onClick:se,className:"gap-1 h-8",children:[t(ie,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),t("div",{className:"flex-1 overflow-hidden",children:t("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:s.format==="richText"?t(V,{setValue:q,value:d,name:"richTextContent"}):t(z,{value:s.content||"",onChange:e=>l(a=>({...a,content:e.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}export{De as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as w}from"./chunk-I6XKBCH4.mjs";import{a as x}from"./chunk-WLI2YTOQ.mjs";import{a as f}from"./chunk-
|
|
4
|
+
import{a as w}from"./chunk-I6XKBCH4.mjs";import{a as x}from"./chunk-WLI2YTOQ.mjs";import{a as f}from"./chunk-OQBCIB4L.mjs";import{a as c,b as p,i as u,j as m}from"./chunk-OCPX4QPC.mjs";import{b as g}from"./chunk-ZUA4KNIR.mjs";import{useEffect as S,useState as l}from"react";import{ChevronDown as j,Loader2 as P}from"lucide-react";import{Fragment as B,jsx as e,jsxs as t}from"react/jsx-runtime";function U({documents:v=[],contexts:o=[],onDocumentClick:C=n=>console.log("Document clicked:",n),onDocumentShare:D=n=>console.log("Share document:",n),onLoadDocumentContent:L,selectedDocumentId:K,onAddKnowledge:s,onDocumentUpdate:b,onAddTeamContext:h,onUpdateTeamContext:N,onDeleteTeamContext:y}){let[n,i]=l(o[0]),[M,r]=l(!1),[A,a]=l(!1),[k,I]=l(!1);S(()=>{if(!n&&o&&o.length>0)i(o[0]);else{let d=o.find(O=>O.id===n?.id);i(d||o[0])}},[o]);let T=d=>{s&&(I(!0),s(d)),r(!1)};return t("div",{className:"flex flex-col h-full",children:[t("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[k&&t("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[e(P,{className:"h-8 w-8 animate-spin text-primary"}),e("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),o&&o.length>0&&t("div",{className:"",children:[e("div",{className:"",children:t("nav",{className:"-mb-px flex justify-between items-center",children:[e("div",{className:"flex space-x-8 overflow-x-auto",children:o.map(d=>t("button",{onClick:()=>i(d),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${n?.id===d.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[d.icon,d.label]},d.id))}),t(c,{children:[e(p,{children:t("div",{className:"inline-flex border border-primary rounded-xl items-center justify-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:["Actions ",e(j,{className:"h-4 w-4"})]})}),t(u,{children:[e(m,{onClick:()=>r(!0),children:"Add Knowledge"}),e(m,{onClick:()=>a(!0),children:"Manage Contexts"})]})]})]})}),n?.description&&e("div",{className:"mt-3 px-1",children:e("p",{className:"text-sm text-primary",children:n?.description})})]})]}),n?e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:e("div",{className:"h-full rounded-xl border overflow-hidden",children:e(f,{documents:v,menuConfig:n?.menuConfig,onDocumentClick:C,onDocumentShare:D,selectedDocumentId:K,onDocumentUpdate:b})})}):t("div",{children:[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"})}),e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:e(g,{onClick:()=>a(!0),children:"Add Context"})})]}),t(B,{children:[e(x,{isOpen:A,onClose:()=>a(!1),knowledgeSources:o,onCreate:h,onUpdate:N,onDelete:y}),e(w,{isOpen:M,onClose:()=>r(!1),onAddKnowledge:T,knowledgeContexts:o})]})]})}export{U as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as m}from"./chunk-SOTCQX2G.mjs";import{b as l,c as i}from"./chunk-32G45Z2G.mjs";import{jsx as e,jsxs as t}from"react/jsx-runtime";var f=({node:r,onNodeClick:a,expandable:d=!1,isExpanded:o=!0,onToggleExpand:n})=>{let s=r.children.length>0,c=d&&s;return t("div",{className:"flex flex-col items-center",children:[t("div",{className:`
|
|
2
|
+
relative bg-card border border-border rounded-lg shadow-sm
|
|
3
|
+
transition-all duration-200 hover:shadow-md hover:border-primary/50
|
|
4
|
+
${a?"cursor-pointer":""}
|
|
5
|
+
w-64 p-4
|
|
6
|
+
`,onClick:()=>a?.(r),children:[t("div",{className:"flex items-start gap-3",children:[e("div",{className:"flex-shrink-0",children:r.profilePicture?.url?e("img",{src:r.profilePicture.url,alt:r.profilePicture.alt||r.name,className:"w-12 h-12 rounded-full object-cover border-2 border-primary/20"}):e("div",{className:"w-12 h-12 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center",children:e("span",{className:"text-sm font-semibold text-primary",children:l(r.name)})})}),t("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"font-semibold text-card-foreground text-sm truncate",children:r.name}),e("p",{className:"text-xs text-muted-foreground truncate",children:r.email}),r.jobRole&&e("div",{className:"mt-2",children:e("span",{className:`
|
|
7
|
+
inline-block px-2 py-0.5 rounded text-xs font-medium border
|
|
8
|
+
${i(r.jobRole)}
|
|
9
|
+
`,children:m[r.jobRole]})})]})]}),r.about&&e("div",{className:"mt-3 pt-3 border-t border-border",children:e("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.about})}),c&&e("button",{onClick:b=>{b.stopPropagation(),n?.()},className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-6 h-6 rounded-full bg-card border-2 border-border hover:border-primary/50 flex items-center justify-center transition-colors","aria-label":o?"Collapse":"Expand",children:e("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),s&&o&&e("div",{className:"w-0.5 h-8 bg-border"})]})};export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J}from"./chunk-
|
|
1
|
+
import{a as J}from"./chunk-VKCDLKYH.mjs";import{a as S}from"./chunk-KG7HG2VO.mjs";import{a as q}from"./chunk-KZCIHFTM.mjs";import{a as Q}from"./chunk-L3V5YDPH.mjs";import{a as G}from"./chunk-QC2UWZWL.mjs";import{a as V}from"./chunk-Z22NSJMF.mjs";import{a as w}from"./chunk-UVHMI3PU.mjs";import{b as z}from"./chunk-CSBGSBEU.mjs";import Te,{useEffect as c,useState as n,useRef as l}from"react";import{jsx as a,jsxs as v}from"react/jsx-runtime";var Ne=({initialTasks:p=[],initialEpics:T=[],initialSprints:h=[],initialUsers:he=[],initialColleagues:A=[],initialProjects:Ae=[],onAddTask:W,onUpdateTask:D,onDeleteTask:x,onTaskClick:X,onAddEpic:Y,onAddComment:Z,onUploadFile:_,onDeleteFile:ee,onFileUpdate:te})=>{let[se,u]=n([]),[d,y]=n([]),[O,ie]=n([]),[H,N]=n(!1),[P,U]=n(!1),[r,m]=n(null),[C,I]=n(null),[ae,De]=n([]),[M,ne]=n([]),[g,B]=n(0),o=l(null),re=l(null),oe=Te.useMemo(()=>[...d.map(e=>e.id),0],[d]),j=l(""),F=l(""),R=l(""),$=l(""),f=(e,t)=>e.map(s=>`${s.id}-${new Date(s.createdAt).getTime()}-${new Date(s.updatedAt).getTime()}`).join("-")+(t?`-${t}`:"");c(()=>{let e=p.map(s=>s.files?.filter(i=>typeof i=="object").map(i=>new Date(i.updatedAt).getTime())).flat(),t=f(p,e.join("-"));t!==j.current&&(u(p),r&&m(p.find(s=>s.id===r.id)||null),j.current=t)},[p]),c(()=>{let e=f(T);e!==F.current&&(y(T),F.current=e)},[T]),c(()=>{let e=f(h);e!==R.current&&(ie(h),R.current=e)},[h]),c(()=>{let e=f(A.map(t=>({id:t.id,updatedAt:t.updatedAt,createdAt:t.createdAt})));e!==$.current&&(ne(A),$.current=e)},[A]),c(()=>{let e=()=>{if(o.current){let i=o.current.offsetHeight;B(i)}};e();let t=new ResizeObserver(e);o.current&&t.observe(o.current);let s=()=>{setTimeout(e,100)};return window.addEventListener("storage",s),()=>{t.disconnect(),window.removeEventListener("storage",s)}},[]),c(()=>{let e=setTimeout(()=>{o.current&&B(o.current.offsetHeight)},300);return()=>clearTimeout(e)},[H,P]);let de=se.filter(e=>!0),ce=e=>de.filter(t=>t.status===e),le=e=>{let t={};return d.forEach(s=>{t[s.id]=e.filter(i=>w(i.epic)===s.id)}),t["no-epic"]=e.filter(s=>!w(s.epic)),t},K=e=>{I(e)},pe=e=>{C&&(u(t=>t.map(s=>s.id===C.id?{...s,status:e}:s)),D?.(C.id.toString(),{status:e}),I(null))},ue=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};u(s=>[...s,t]),W?.(e)},me=async(e,t)=>{u(s=>s.map(i=>i.id===Number(e)?{...i,...t}:i)),D&&await D(e,t),r?.id===Number(e)&&m(s=>({...s,...t}))},ge=async e=>{u(t=>t.filter(s=>s.id!==Number(e))),r?.id===Number(e)&&m(null),x&&await x(e)},fe=e=>{let t={...e,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(s=>[...s,t]),Y?.(e)},L=e=>{m(e),X?.(e)},ke=[{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"}],ve=g>0?`calc(100vh - ${g+120}px)`:"calc(100vh - 12rem)";return v("div",{ref:re,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[a("div",{ref:o,className:"flex-shrink-0",children:a(V,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>N(!0)},secondaryAction:{label:"Add epic",onClick:()=>U(!0)}})}),a("div",{className:"flex-1 min-h-0 mt-8",children:a("div",{className:"h-full",style:{height:g>0?`calc(100vh - ${g+120}px)`:"calc(100vh - 12rem)"},children:a("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:ke.map(e=>{let t=ce(e.status),s=le(t);return v(q,{title:e.title,status:e.status,taskCount:t.length,onDrop:pe,isCompact:e.status==="done",height:ve,children:[s["no-epic"].map(i=>a(S,{epic:null,task:i,onDragStart:K,onTaskClick:L,isCompact:e.status==="done"},i.id)),oe.map(i=>{let E=d.find(k=>k.id===i),b=s[i]||[];return b.length===0?null:v("div",{className:"mb-6",children:[v("div",{className:"flex items-center gap-2 mb-3",children:[a("div",{className:`w-3 h-3 rounded-full ${E?.color}`}),a("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:E?.name||"No Epic"}),a(z,{variant:"secondary",className:"text-xs",children:b.length})]})," ",a("div",{className:"space-y-3",children:b.map(k=>a(S,{task:k,epic:E,onDragStart:K,onTaskClick:L,isCompact:e.status==="done"},k.id))})]},i)})]},e.id)})})})}),a(G,{isOpen:H,onClose:()=>N(!1),onAddTask:ue,assignees:[...M,...ae],epics:d,sprints:O}),a(Q,{isOpen:P,onClose:()=>U(!1),onAddEpic:fe}),r&&a(J,{isOpen:!!r,onClose:()=>m(null),initialTask:r,epics:d,sprints:O,onUpdateTask:me,onDeleteTask:ge,colleagues:M,onUploadFile:_,onDeleteFile:ee,onFileUpdate:te,onAddComment:Z})]})};export{Ne as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as p}from"./chunk-L5JPAKPM.mjs";import{b as r}from"./chunk-ZUA4KNIR.mjs";import{a as v,c as C}from"./chunk-SOLZ4VQH.mjs";import{b as f}from"./chunk-CSBGSBEU.mjs";import{a as s,b as u,c as g,e as l}from"./chunk-YO3GQYRJ.mjs";import{useState as x,useMemo as S}from"react";import{Search as A,Bot as N,ChevronLeft as I,Copy as B}from"lucide-react";import{motion as h,AnimatePresence as L}from"motion/react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function K({digitalColleagues:n,onColleagueClone:b,onCancel:y,selectedColleagueId:w}){let[i,D]=x(""),[m,k]=x("all"),d=S(()=>n.filter(t=>t?.name.toLowerCase().includes(i.toLowerCase())||t.jobDescription?.toLowerCase().includes(i.toLowerCase())||t.workInstructions?.toLowerCase().includes(i.toLowerCase())),[n,i,m]),c=t=>{let o={...t,name:`${t?.name} (Copy)`};b(o)},T=t=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t);return e("div",{className:"px-2 md:px-4 py-4 space-y-6",children:e(L,{mode:"wait",children:a(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[a("div",{className:"flex items-center gap-4 mb-6",children:[a(r,{variant:"ghost",onClick:y,className:"gap-2",children:[e(I,{className:"h-4 w-4"}),"Back"]}),a("div",{children:[e("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),e("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),e(s,{children:e(l,{className:"pt-6",children:a("div",{className:"flex flex-col md:flex-row gap-4",children:[e("div",{className:"flex-1",children:a("div",{className:"relative",children:[e(A,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e(p,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:t=>D(t.target.value),className:"pl-9"})]})}),a("select",{value:m,onChange:t=>k(t.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[e("option",{value:"all",children:"All Status"}),e("option",{value:"active",children:"Active"}),e("option",{value:"inactive",children:"Inactive"})]})]})})}),e("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:d.map(t=>e(h.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:a(s,{className:`cursor-pointer transition-all hover:shadow-lg ${w?.toString()===t.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>c(t),children:[e(u,{className:"pb-3",children:a("div",{className:"flex items-start justify-between",children:[a("div",{className:"flex items-center gap-3",children:[e(v,{children:e(C,{className:"bg-blue-100",children:e(N,{className:"h-4 w-4 text-blue-600"})})}),e("div",{children:e(g,{className:"text-lg flex items-center gap-2",children:t?.name})})]}),a(r,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:o=>{o.stopPropagation(),c(t)},children:[e(B,{className:"h-3 w-3"}),"Clone"]})]})}),e(l,{className:"pt-0",children:a("div",{className:"space-y-3",children:[a("div",{children:[e("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),e("p",{className:"text-sm line-clamp-2",children:t.jobDescription})]}),t.capabilities&&t.capabilities.length>0&&a("div",{children:[e("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),e("div",{className:"flex flex-wrap gap-1",children:t.capabilities.length>3&&a(f,{variant:"outline",className:"text-xs",children:["+",t.capabilities.length-3]})})]}),e("div",{className:"flex items-center justify-between text-xs text-muted-foreground"}),t.workInstructions&&a("div",{children:[e("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),e("p",{className:"text-xs line-clamp-2",children:t.workInstructions})]})]})})]})},t.id))}),d.length===0&&e(s,{children:e(l,{className:"pt-6",children:a("div",{className:"text-center py-8",children:[e(N,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),e("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}export{K as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as O}from"./chunk-GAU24H4A.mjs";import{a as le}from"./chunk-LCEEFZH7.mjs";import{a as ae}from"./chunk-M2REXGQW.mjs";import{a as w}from"./chunk-3M5KHST3.mjs";import{a as I}from"./chunk-MXMW65GM.mjs";import{a as ee}from"./chunk-FSCDCSVK.mjs";import{a as Z}from"./chunk-Z22NSJMF.mjs";import{a as te}from"./chunk-P2B3OITE.mjs";import{a as _}from"./chunk-GLZEHRPY.mjs";import{a as E,c as H,d as $,g as F,i as u}from"./chunk-YFAZQYK4.mjs";import{a as Y}from"./chunk-L5JPAKPM.mjs";import{b as k}from"./chunk-ZUA4KNIR.mjs";import{a as g,b as h,c as b,e as c}from"./chunk-YO3GQYRJ.mjs";import{useEffect as ve,useState as o}from"react";import{Plus as ye,Search as he,Users as ie,Bot as be,User as we,Filter as xe}from"lucide-react";import{motion as Se,AnimatePresence as Ne}from"motion/react";import{jsx as l,jsxs as a}from"react/jsx-runtime";function De({initialColleagues:x,onColleagueAdd:S,onColleagueEdit:K,onColleagueDelete:oe,compactView:n=!1,departments:ne=["Design","Engineering","Marketing","Product","Sales","Operations"],className:re,availableUsers:L=[],existingDigitalColleagues:P=[],availableKnowledgeDocuments:j=[],availableCapabilities:M=[],availableModels:B=[]}){let[p,r]=o(x||[]),[s,G]=o(""),[N,W]=o("all"),[D,q]=o("all"),[v,se]=o("all"),[z,C]=o(null),[T,y]=o(null);ve(()=>{r(x||[])},[x]);let de=Array.isArray(L)?L:[],me=Array.isArray(P)?P:[],[d,t]=o("main"),f=p.filter(e=>!e||!e?.name?!1:e?.name.toLowerCase().includes(s.toLowerCase())||e.type==="human"&&e.email?.toLowerCase().includes(s.toLowerCase())||e.type==="digital"&&e.jobDescription?.toLowerCase().includes(s.toLowerCase())),J=f.filter(e=>e.type==="human"),Q=f.filter(e=>e.type==="digital"),R=()=>{t("typeSelection")},A=e=>{e.type==="digital"&&(C(e),t("form")),K?.(e)},U=e=>{e.type==="digital"&&(y(e),t("view"))},ge=e=>{if(!e||!e.id){console.error("Invalid user provided to handleUserSelect:",e);return}let i={id:`human-${Date.now()}`,type:"human",name:e?.name||"Unknown User",email:e?.email||"",updatedAt:e.updatedAt,createdAt:e.createdAt,accounts:e.accounts};r(m=>[...m,i]),S?.(i),t("main")},ce=e=>{if(!e||!e.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",e);return}r(i=>[...i,{...e,type:"digital"}]),S?.({...e,type:"digital"}),t("main")},ue=()=>{C(null),t("form")},X=e=>{if(!e||!e.id){console.error("Invalid colleague provided to handleSaveColleague:",e);return}z?(r(i=>i.map(m=>m.id===e.id?{...e,type:"digital"}:m)),K?.({...e,type:"digital"})):(r(i=>[...i,{...e,type:"digital"}]),S?.({...e,type:"digital"})),t("main"),C(null)},pe=()=>{t("main"),C(null),y(null)},Ce=()=>{t("main"),y(null)},Te=()=>{T&&(C(T),y(null),t("form"))},V=e=>{oe?.(e,p.find(i=>i.id.toString()===e.toString())?.type),r(i=>i.filter(m=>m.id!==e))},fe=()=>{G(""),W("all"),q("all")};return d==="typeSelection"?l(ee,{onSelectHuman:()=>t("userSelection"),onSelectDigital:()=>t("digitalOptions"),onCancel:()=>t("main")}):d==="userSelection"?l(te,{users:de,onUserSelect:ge,onCancel:()=>t("typeSelection")}):d==="digitalOptions"?l(ae,{onCloneExisting:()=>t("digitalClone"),onCreateNew:ue,onCancel:()=>t("typeSelection")}):d==="digitalClone"?l(le,{digitalColleagues:me,onColleagueClone:ce,onCancel:()=>t("digitalOptions")}):d==="form"?l(I,{colleague:z||void 0,onSave:X,onCancel:pe,availableKnowledgeDocuments:j,availableCapabilities:M,availableModels:B}):d==="view"?l(I,{colleague:T||void 0,onSave:X,onCancel:Ce,readOnly:!0,availableKnowledgeDocuments:j,availableCapabilities:M,availableModels:B}):l("div",{className:"px-2 md:px-4 py-4 space-y-8",children:l(Ne,{mode:"wait",children:l(Se.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 ${re||""}`,children:[l(Z,{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:R}}),a("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a(g,{children:[a(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l(b,{className:"text-sm font-medium",children:"Total Colleagues"}),l(ie,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[l("div",{className:"text-2xl font-bold",children:p.length}),l("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),a(g,{children:[a(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l(b,{className:"text-sm font-medium",children:"Human Members"}),l(we,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[l("div",{className:"text-2xl font-bold",children:p.filter(e=>e.type==="human").length}),l("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),a(g,{children:[a(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l(b,{className:"text-sm font-medium",children:"Digital Colleagues"}),l(be,{className:"h-4 w-4 text-muted-foreground"})]}),a(c,{children:[l("div",{className:"text-2xl font-bold",children:p.filter(e=>e.type==="digital").length}),l("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),l(g,{children:l(c,{className:"pt-6",children:a("div",{className:"flex flex-col md:flex-row gap-4",children:[l("div",{className:"flex-1",children:a("div",{className:"relative",children:[l(he,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),l(Y,{placeholder:"Search colleagues...",value:s,onChange:e=>G(e.target.value),className:"pl-9"})]})}),a(E,{value:N,onValueChange:W,children:[l($,{className:"w-full md:w-[180px]",children:l(H,{placeholder:"Department"})}),a(F,{children:[l(u,{value:"all",children:"All Departments"}),ne.map(e=>l(u,{value:e,children:e},e))]})]}),a(E,{value:D,onValueChange:q,children:[l($,{className:"w-full md:w-[140px]",children:l(H,{placeholder:"Status"})}),a(F,{children:[l(u,{value:"all",children:"All Status"}),l(u,{value:"active",children:"Active"}),l(u,{value:"inactive",children:"Inactive"})]})]}),(s||N!=="all"||D!=="all")&&a(k,{variant:"outline",onClick:fe,className:"gap-2",children:[l(xe,{className:"h-4 w-4"}),"Clear"]})]})})}),a("div",{className:"space-y-4",children:[l(_,{activeTab:v,onTabChange:se,tabOptions:[{value:"all",label:`All (${f.length})`},{value:"human",label:`Human (${J.length})`},{value:"digital",label:`Digital (${Q.length})`}],maxWidth:"400px",gridCols:3}),v==="all"&&l("div",{className:`grid gap-4 ${n?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:f.map(e=>l(w,{colleague:e,onEdit:A,onDelete:V,onViewDetails:U,compact:n,className:O([e.type==="digital"&&"border-teal-400"])},`${e}-${e.id}`))}),v==="human"&&l("div",{className:`grid gap-4 ${n?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:J.map(e=>l(w,{colleague:e,onEdit:A,onDelete:V,onViewDetails:U,compact:n},e.id))}),v==="digital"&&l("div",{className:`grid gap-4 ${n?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:Q.map(e=>l(w,{colleague:e,onEdit:A,onDelete:V,onViewDetails:U,compact:n,className:O([e.type==="digital"&&"border-teal-400"])},e.id))})]}),f.length===0&&l(g,{children:l(c,{className:"pt-6",children:a("div",{className:"text-center py-8",children:[l(ie,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),l("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),l("p",{className:"text-muted-foreground mb-4",children:s||N!=="all"||D!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),a(k,{onClick:R,className:"gap-2",children:[l(ye,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}export{De as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c}from"./chunk-SV7NMNDI.mjs";import{a as d}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-SV7NMNDI.mjs";import{a as d}from"./chunk-3HNU2NYP.mjs";import{c as g}from"./chunk-YNNW2C2U.mjs";import{a as p}from"./chunk-FMJBJ3HN.mjs";import{a as l}from"./chunk-WISCWNL2.mjs";import{a as i}from"./chunk-MDJREBVI.mjs";import f from"next/image";import{FaArrowRight as x}from"react-icons/fa6";import{jsx as e,jsxs as r}from"react/jsx-runtime";function z({blogs:a,sectionHeading:t,base:n="insights"}){return r(p,{children:[e("div",{className:"",children:t&&e("div",{"data-aos":"fade-up","data-aos-delay":"100",children:e(d,{...t,alignment:"start",hasBottomSpacing:!0})})}),a&&a.length>0&&e("div",{className:"-mx-4 flex flex-wrap justify-start gap-y-4",children:a.map((s,o)=>e("div",{"data-aos":"fade-up","data-aos-delay":c([200,400,600],o),className:"w-full h-full md:w-1/2 md:px-4 lg:w-1/3",children:e(v,{...s,base:n})},o))})]})}var u=i("inline-flex items-center gap-2 text-white"),L=i("text-sm text-white");function v({slug:a,meta:t,authors:n,title:s,publishedAt:o,categories:h,base:m}){return r("article",{className:"group/blog relative z-1 flex h-full min-h-[452px] flex-col overflow-hidden rounded-5 p-0",children:[e("span",{className:"absolute inset-0 z-[2] "}),e(f,{src:t?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:t?.image?.alt||"Blog image",fill:!0,sizes:`
|
|
2
2
|
(min-width:768px) 50vw,
|
|
3
3
|
(min-width:1024px) 33vw,
|
|
4
4
|
100vw
|
|
@@ -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-
|
|
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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as E}from"./chunk-U3PUWUVM.mjs";import{a as K,c as k,d as $,g as I,i as N}from"./chunk-YFAZQYK4.mjs";import{a as D}from"./chunk-B4H6T2GP.mjs";import{a as g}from"./chunk-TVZOULLL.mjs";import{a as S}from"./chunk-L5JPAKPM.mjs";import{b as p}from"./chunk-ZUA4KNIR.mjs";import{b as T}from"./chunk-CSBGSBEU.mjs";import{a as j,b as _,c as B,e as F}from"./chunk-YO3GQYRJ.mjs";import{useState as y,useEffect as le}from"react";import{Bot as oe,Plus as M,X as P,Edit as ne}from"lucide-react";import{jsx as a,jsxs as i}from"react/jsx-runtime";function he({colleague:u,onSave:V,onCancel:z,isLoading:d=!1,title:O,submitLabel:R,cancelLabel:q="Cancel",readOnly:H=!1,availableKnowledgeDocuments:J=[],availableCapabilities:f=[],availableModels:w=[]}){let[t,m]=y(()=>{let e=u?.model||u?.metadata?.model||null;return{type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...u,model:e}}),[ie,re]=y(""),[se,de]=y(""),[b,x]=y(""),[c,L]=y(!H),v=t.model,U=v?typeof v=="number"?`${v}`:typeof v=="object"&&v!==null&&"id"in v?`${v.id}`:"":"";le(()=>{if(u){let e=u?.model||u?.metadata?.model||null;m({...u,model:e})}},[u]);let W=e=>{e.preventDefault();let l={id:t.id||parseInt(Date.now().toString()),name:t?.name,type:"digital",description:t.description,jobDescription:t.jobDescription||"",workInstructions:t.workInstructions||"",capabilities:t.capabilities||[],capabilityLevel:t.capabilityLevel||0,coreKnowledge:t.coreKnowledge||null,model:t.model||null,metadata:t.metadata||{}};V(l)},A=(e,l,o)=>{if(!l.trim())return;let n=t[e]||[];m({...t,[e]:[...n,l.trim()]}),o("")},X=(e,l)=>{let o=t[e]||[];m({...t,[e]:o.filter((n,r)=>r!==l)})},G=()=>{if(!b)return;let[e,l]=b.split(":");if(!e)return;let o=f.find(s=>`${s.relationTo}:${typeof s.value=="number"?s.value:s.value.id}`===b);if(!o)return;let n=t.capabilities||[],r={relationTo:e,value:o.value};n.some(s=>{let h=typeof s.value=="object"?s.value.id:s.value,ae=typeof r.value=="object"?r.value.id:r.value;return s.relationTo===r.relationTo&&h===ae})||(m({...t,capabilities:[...n,r]}),x(""))},Q=e=>{let l=t.capabilities||[];m({...t,capabilities:l.filter((o,n)=>n!==e)})},Y=e=>{if(!e||e==="__none__"){m({...t,model:null});return}let l=w.find(o=>`${o.id}`===e);if(l){let o=typeof l.id=="string"?parseInt(l.id,10):l.id;m({...t,model:isNaN(o)?null:o})}},Z=e=>{e.preventDefault(),L(!c)},ce=(e,l,o,n,r)=>{let C=t[e]||[];return i("div",{className:"space-y-2",children:[a(g,{children:l}),c&&i("div",{className:"flex gap-2",children:[a(S,{value:o,onChange:s=>n(s.target.value),placeholder:r,onKeyPress:s=>{s.key==="Enter"&&(s.preventDefault(),A(e,o,n))},disabled:d}),a(p,{type:"button",variant:"outline",size:"icon",onClick:()=>A(e,o,n),disabled:d,children:a(M,{className:"h-4 w-4"})})]}),a("div",{className:"flex flex-wrap gap-2",children:C.map((s,h)=>i(T,{className:"gap-1",children:[s,c&&a(p,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>X(e,h),disabled:d,children:a(P,{className:"h-3 w-3"})})]},`${e}-${h}-${s}`))})]})},ee=O||(c?u?"Edit Colleague":"Add New Colleague":"View Colleague"),te=R||(u?"Update Colleague":"Add Colleague");return i(j,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll no-scrollbar",children:[a(_,{children:i(B,{className:"flex items-center gap-2",children:[a(oe,{className:"h-5 w-5"}),ee]})}),a(F,{className:"overflow-y-scroll no-scrollbar",children:i("form",{onSubmit:W,className:"space-y-6",children:[i("div",{className:"space-y-4",children:[i("div",{className:"space-y-2",children:[a(g,{htmlFor:"name",children:"Name *"}),a(S,{id:"name",value:t?.name||"",onChange:e=>m({...t,name:e.target.value}),required:!0,disabled:d||!c})]}),i("div",{className:"space-y-2",children:[a(g,{htmlFor:"description",children:"Description"}),a(D,{id:"description",value:t.description||"",onChange:e=>m({...t,description:e.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:d||!c})]})]}),i("div",{className:"space-y-4",children:[a("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),i("div",{className:"space-y-2",children:[a(g,{htmlFor:"jobDescription",children:"Job Description *"}),a(D,{id:"jobDescription",value:t.jobDescription||"",onChange:e=>m({...t,jobDescription:e.target.value}),rows:4,required:t.type==="digital",disabled:d||!c})]}),i("div",{className:"space-y-2",children:[a(g,{htmlFor:"workInstructions",children:"Work Instructions"}),a(D,{id:"workInstructions",value:t.workInstructions||"",onChange:e=>m({...t,workInstructions:e.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:d||!c})]}),i("div",{className:"space-y-2",children:[a(g,{children:"Capabilities"}),c&&f.length>0&&i("div",{className:"flex gap-2",children:[i(K,{value:b,onValueChange:x,disabled:d,children:[a($,{className:"flex-1",children:a(k,{placeholder:"Select a capability"})}),a(I,{children:f.filter(e=>{let l=t.capabilities||[],o=typeof e.value=="object"?e.value.id:e.value;return!l.some(n=>{let r=typeof n.value=="object"?n.value.id:n.value;return n.relationTo===e.relationTo&&r===o})}).map((e,l)=>{let o=typeof e.value=="object"?e.value.id:e.value,n=typeof e.value=="object"?e.value.name:void 0,r=`${e.relationTo}:${o}`,C=n?`${e.relationTo}: ${n}`:`${e.relationTo} (ID: ${o})`;return a(N,{value:r,children:C},r)})})]}),a(p,{type:"button",variant:"outline",size:"icon",onClick:G,disabled:d||!b,children:a(M,{className:"h-4 w-4"})})]}),c&&f.length===0&&a("div",{className:"text-sm text-muted-foreground",children:"No capabilities available. Please provide availableCapabilities prop."}),a("div",{className:"flex flex-wrap gap-2",children:t.capabilities?.map((e,l)=>{let o;if(typeof e=="string")o=e;else{let n=typeof e.value=="object"?e.value.id:e.value,r=typeof e.value=="object"?e.value.name:void 0;o=r?`${e.relationTo}: ${r}`:`${e.relationTo} (ID: ${n})`}return i(T,{className:"gap-1",children:[o,c&&a(p,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>Q(l),disabled:d,children:a(P,{className:"h-3 w-3"})})]},`capability-${l}`)})})]}),i("div",{className:"space-y-2",children:[a(g,{children:"Model"}),c&&w.length>0?i(K,{value:U||"__none__",onValueChange:Y,disabled:d,children:[a($,{children:a(k,{placeholder:"Select a model"})}),i(I,{children:[a(N,{value:"__none__",children:"None"}),w.map(e=>{let l=`${e.id}`;return a(N,{value:l,children:e.name},l)})]})]}):c&&w.length===0?a("div",{className:"text-sm text-muted-foreground",children:"No models available. Please provide availableModels prop."}):a("div",{className:"text-sm",children:t.model?typeof t.model=="number"?`Model ${t.model}`:typeof t.model=="object"&&t.model!==null&&"name"in t.model?t.model.name||`Model ${t.model.id}`:`Model ${t.model}`:"No model selected"})]}),a(E,{selectedDocuments:t.coreKnowledge?[{id:t.coreKnowledge?.id?.toString(),title:t.coreKnowledge?.name,format:"markdown",content:t.coreKnowledge?.content||"",createdAt:new Date(t.coreKnowledge?.createdAt),description:t.coreKnowledge?.description||"",metadata:t.coreKnowledge?.metadata||{},updatedAt:new Date(t.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:e=>{let l={createdAt:e[0]?.createdAt.toISOString(),id:parseInt(e[0]?.id),name:e[0]?.title,source:"payload",updatedAt:(e[0]?.updatedAt||new Date).toISOString()};m({...t,coreKnowledge:e&&e.length>0?l:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:d||!c,availableDocuments:J.map(e=>({id:e.id.toString(),title:e?.name,name:e?.name,format:"markdown",content:e.content||"",createdAt:new Date(e.createdAt),source:e.source,description:e.description||"",metadata:e.metadata||{},updatedAt:new Date(e.updatedAt)}))})]}),i("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[a(p,{type:"button",variant:"outline",onClick:z,disabled:d,children:c?q:"Close"}),c?a(p,{type:"submit",disabled:d,children:d?"Saving...":te}):i(p,{type:"button",onClick:Z,disabled:d,className:"gap-2",children:[a(ne,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}export{he as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as b}from"./chunk-
|
|
4
|
+
import{a as b}from"./chunk-RS4WAAGI.mjs";import{a as I}from"./chunk-56X4PU43.mjs";import{a as S}from"./chunk-UJITFLIZ.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{f as r}from"./chunk-
|
|
1
|
+
import{f as r}from"./chunk-2BRDNDUB.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,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as $}from"./chunk-
|
|
4
|
+
import{a as $}from"./chunk-SWE754OC.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,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as D}from"./chunk-
|
|
4
|
+
import{a as D}from"./chunk-XMYXQR5W.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]===`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as d}from"./chunk-L5JPAKPM.mjs";import{b as c}from"./chunk-ZUA4KNIR.mjs";import{a as u,c as f}from"./chunk-SOLZ4VQH.mjs";import{a as r,b as p,c as v,e as i}from"./chunk-YO3GQYRJ.mjs";import{useState as U,useMemo as w}from"react";import{Search as S,User as N,Check as b,ChevronLeft as k}from"lucide-react";import{motion as g,AnimatePresence as T}from"motion/react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function E({users:o,onUserSelect:y,onCancel:h,selectedUserId:l}){let[s,C]=U(""),m=Array.isArray(o)?o:[],n=w(()=>m.filter(a=>a!=null&&a!==void 0).filter(a=>a?.name?.toLowerCase().includes(s.toLowerCase())||a?.email?.toLowerCase().includes(s.toLowerCase())),[m,s]),x=a=>{y(a)};return e("div",{className:"px-2 md:px-4 py-4 space-y-6",children:e(T,{mode:"wait",children:t(g.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[t("div",{className:"flex items-center gap-4 mb-6",children:[t(c,{variant:"ghost",onClick:h,className:"gap-2",children:[e(k,{className:"h-4 w-4"}),"Back"]}),t("div",{children:[e("h1",{className:"text-3xl font-bold",children:"Select User"}),e("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),e(r,{className:"container",children:e(i,{className:"pt-6",children:e("div",{className:"flex flex-col md:flex-row gap-4",children:e("div",{className:"flex-1",children:t("div",{className:"relative",children:[e(S,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e(d,{placeholder:"Search users by name, email, role, or skills...",value:s,onChange:a=>C(a.target.value),className:"pl-9"})]})})})})}),e("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(a=>!a||!a.id?null:e(g.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:t(r,{className:`cursor-pointer transition-all hover:shadow-lg ${l===a.id?"ring-2 ring-primary":""}`,onClick:()=>x(a),children:[e(p,{className:"pb-3",children:t("div",{className:"flex items-start justify-between",children:[t("div",{className:"flex items-center gap-3",children:[e(u,{children:e(f,{children:e(N,{className:"h-4 w-4"})})}),e("div",{children:e(v,{className:"text-lg",children:a?.name||"Unknown User"})})]}),l===a.id&&e(b,{className:"h-5 w-5 text-primary"})]})}),e(i,{className:"pt-0",children:t("div",{className:"space-y-3",children:[t("div",{children:[e("p",{className:"text-sm text-muted-foreground",children:"Email"}),e("p",{className:"text-sm font-medium",children:a?.email||"No email"})]}),e("div",{children:e("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},a.id))}),n.length===0&&e(r,{className:"container mt-4",children:e(i,{className:"pt-6",children:t("div",{className:"text-center py-8",children:[e(N,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),e("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}export{E as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{f as l}from"./chunk-
|
|
4
|
+
import{f as l}from"./chunk-2BRDNDUB.mjs";import{a as r}from"./chunk-2QZUKVBA.mjs";import{a as s}from"./chunk-2BR55L74.mjs";import h from"next/image";import{jsx as e,jsxs as t}from"react/jsx-runtime";var x=({links:o,media:i,children:m,richText:a})=>e("div",{children:t("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[t("div",{className:"fixed inset-0 container mt-24 mb-8 z-10 flex items-start justify-center",children:[m||a&&e(l,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:a,enableGutter:!0}),Array.isArray(o)&&o.length>0&&e("ul",{className:"flex justify-center gap-4",children:o.map(({link:n},d)=>e("li",{children:e(r,{...n})},d))})]}),t("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[i&&typeof i=="object"&&e(s,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:i}),i&&typeof i=="string"&&e("div",{children:e(h,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:i})}),e("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),e(p,{})]})}),p=()=>e("div",{className:"w-full h-[1240px] z-10",children:t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",style:{fontSize:0,float:"left",zIndex:20},className:"absolute -bottom-[2px] flex",children:[e("defs",{children:t("mask",{id:"mask",children:[e("rect",{width:"1920",height:"332",fill:"white"}),e("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),e("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),e("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});export{x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-SV7NMNDI.mjs";import{a as r}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-SV7NMNDI.mjs";import{a as r}from"./chunk-3HNU2NYP.mjs";import{a as o}from"./chunk-KX2NCNCS.mjs";import{a as e}from"./chunk-FMJBJ3HN.mjs";import{jsx as i,jsxs as c}from"react/jsx-runtime";function S({sectionHeading:p,cards:a}){return i("section",{className:"section-padding-primary !pt-0",children:c(e,{children:[i("div",{className:"mx-auto max-w-[630px]","data-aos":"fade-up","data-aos-delay":"100",children:i(r,{...p,alignment:"center",hasBottomSpacing:!0})}),a&&a.length>0&&i("div",{className:"grid gap-30px",children:a.map((d,t)=>i("div",{"data-aos":"fade-up","data-aos-delay":n([200,400,600],t),className:"py-2",children:i(o,{...d})},t))})]})})}export{S as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-6YHCNPFB.mjs";import{a as f}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 e,jsxs as v}from"react/jsx-runtime";var b=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:e(P,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function E({sidebarItems:r,children:h,title:U="Digital Colleagues",notifications:C=[],currentBusinessUnit:N=b[0],onBusinessUnitChange:B,onSearch:c,businessUnits:D=b,activeTab:x,onTabChange:T,showTabs:y=!1,onActionClick:A,actionIcon:R,actionText:S="Action",onNotificationRemove:k,onRemoveAll:w,logo:n="/headerlogo.png",appName:o="Nuvia",tagline:s="Collaboration Platform",sidebarInitiallyClosed:M=!1}){let[i,O]=l(!M),[d,t]=l(!1),[u,I]=l(N),m=p=>{I(p),B?.(p)};return v("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[d&&e("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>t(!1)}),e("div",{className:"md:hidden",children:e(a,{items:r,isOpen:d,isMobile:!0,onClose:()=>t(!1),currentBusinessUnit:u,onBusinessUnitChange:m,onSearch:c,logo:n,appName:o,tagline:s})}),e("div",{className:"hidden md:block",children:e(a,{items:r,isOpen:i,isMobile:!1,currentBusinessUnit:u,onBusinessUnitChange:m,onSearch:c,logo:n,appName:o,tagline:s})}),v("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",i?"md:pl-64":"md:pl-0"),children:[e(f,{title:U,notifications:C,onToggleSidebar:()=>O(!i),onToggleMobileMenu:()=>t(!0),sidebarOpen:i,activeTab:x,onTabChange:T,showTabs:y,onActionClick:A,actionIcon:R,actionText:S,onNotificationRemove:k,onRemoveAll:w,logo:n,appName:o,tagline:s}),e("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:h})]})]})}export{E as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={C1:"Consultant 1",C2:"Consultant 2",C3:"Consultant 3",SC1:"Senior Consultant 1",SC2:"Senior Consultant 2",M:"Manager",SM:"Senior Manager",P:"Partner"};export{e as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as C}from"./chunk-
|
|
4
|
+
import{a as C}from"./chunk-JDIPWJBD.mjs";import{a as D}from"./chunk-XMYXQR5W.mjs";import{a as w,c as y,e as k}from"./chunk-3UMMMQEH.mjs";import{b as f}from"./chunk-ZUA4KNIR.mjs";import{a as N}from"./chunk-MDJREBVI.mjs";import{motion as R}from"motion/react";import{File as T,FileText as K,Edit3 as A,Type as G,ChevronDown as L,ChevronRight as Z,Info as P,Loader2 as H}from"lucide-react";import{startTransition as M,useEffect as Q,useMemo as V,useRef as W,useState as c}from"react";import*as E from"@radix-ui/react-dialog";import Y from"react-markdown";import _ from"remark-gfm";import{Fragment as ae,jsx as e,jsxs as o}from"react/jsx-runtime";var S=s=>e(Y,{remarkPlugins:[_],components:{h1:({children:t})=>e("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>e("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>e("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>e("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>e("ol",{className:"list-decimal",children:t}),ul:({children:t})=>e("ul",{className:"list-disc",children:t}),li:({children:t})=>e("li",{className:"ml-4",children:t}),p:({children:t})=>e("p",{className:"mb-4",children:t}),a:({children:t,href:i})=>e("a",{href:i,className:"text-blue-500",children:t}),img:({src:t,alt:i})=>e("img",{src:t,alt:i,className:"mb-4"}),blockquote:({children:t})=>e("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:s}),O=s=>e("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:s}),ee=s=>e("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:s&&e(D,{value:JSON.stringify(s),editable:!1,name:"richTextContent"},JSON.stringify(s))}),te=s=>o("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[e("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:o("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[e("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),S(s)]});function pe({document:s,onDocumentUpdate:t,editable:i=!0,mode:g="view",renderers:j,availableDocuments:I=[],knowledgeContexts:B=[]}){let[$,x]=c(!1),[d,q]=c(!1),[a,m]=c(s),[z,p]=c(!1),u=W(null),b=a.format==="richText"?a.richTextContent:a.content,F=V(()=>`${a.format}:${JSON.stringify(b)}`,[a.format,b]);Q(()=>{m(s)},[s]);let re=r=>{switch(r){case"markdown":case"mdx":return e(K,{className:"h-6 w-6 text-primary"});case"richText":return e(T,{className:"h-6 w-6 text-success"});case"text":return e(G,{className:"h-6 w-6 text-muted-foreground"});default:return e(T,{className:"h-6 w-6 text-muted-foreground"})}},J=r=>{switch(r){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},X=(r,n)=>{let l={markdown:S,mdx:te,text:O},h=j?.[n]||l[n];if(n==="richText"&&typeof r=="object")return ee(r);if(h&&typeof r=="string")return h(r);if(typeof r=="string")return O(r)},U=async(r,n="save")=>{n==="save"&&p(!0),u.current=a,M(()=>{m({...r,richTextContent:r.richTextContent?structuredClone(r.richTextContent):void 0})});try{let l=await t?.(r);if(n==="save"&&p(!1),!l)throw new Error("save failed")}catch{u.current&&M(()=>m(u.current))}},v=()=>{x(!1)};return o(ae,{children:[e(w,{open:$||g==="create",onOpenChange:r=>!r&&v(),children:o(y,{children:[e(k,{}),o(E.Content,{className:N("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[z&&e("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:e(H,{className:"h-8 w-8 animate-spin text-primary"})}),e(C,{mode:g==="create"?"create":"edit",document:a,onSave:U,onCancel:v,availableDocuments:I,knowledgeContexts:B})]})]})}),o(R.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[o("div",{className:"border-b border-border bg-card p-8 pb-6",children:[o("div",{className:"flex items-start justify-between gap-4",children:[e("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:o("div",{className:"flex-1 min-w-0",children:[o("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[a.title,e("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${J(a.format)}`,children:a.format.toUpperCase()})]}),a.description&&e("p",{className:"text-muted-foreground text-lg leading-relaxed",children:a.description})]})}),o("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[a.metadata&&Object.keys(a.metadata).length>0&&o(f,{variant:"ghost",size:"sm",onClick:()=>q(!d),className:"gap-2",children:[e(P,{className:"h-4 w-4"}),"Metadata",d?e(L,{className:"h-4 w-4"}):e(Z,{className:"h-4 w-4"})]}),i&&o(f,{variant:"outline",size:"sm",onClick:()=>x(!0),className:"gap-2",children:[e(A,{className:"h-4 w-4"}),"Edit"]})]})]}),a.metadata&&Object.keys(a.metadata).length>0&&e(R.div,{initial:!1,animate:{height:d?"auto":0,opacity:d?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:o("div",{className:"pt-4 border-t border-border mt-4",children:[o("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[e(P,{className:"h-4 w-4"}),"Document Metadata"]}),e("div",{className:"bg-muted rounded-lg p-4 border border-border",children:e("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(a.metadata).map(([r,n])=>o("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:r.replace(/([A-Z])/g," $1").trim()}),e("span",{className:"text-foreground font-medium",children:String(n)})]},r))})})]})})]}),e("div",{className:"flex-1 ",children:e("div",{className:"py-4 h-full",children:e("div",{className:"space-y-4",children:a.content||a.richTextContent?e("div",{className:"relative",children:e("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:X(a.format==="richText"?a.richTextContent:a.content,a.format)})},F):o("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[e("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:e(K,{className:"h-8 w-8 text-muted-foreground"})}),e("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),e("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}export{pe as a};
|