cortex-react-components 2.0.7 → 2.0.8
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-ERURPIHS.mjs → chunk-36PL6SXU.mjs} +1 -1
- package/dist/{chunk-OJZQH57M.mjs → chunk-3TFLP3CZ.mjs} +1 -1
- package/dist/{chunk-2L2HGIOO.mjs → chunk-4FP5GLMD.mjs} +1 -1
- package/dist/{chunk-OEFXIEY3.mjs → chunk-5B6FLVPH.mjs} +1 -1
- package/dist/{chunk-5JQAH3EN.mjs → chunk-5O4QU3FO.mjs} +1 -1
- package/dist/{chunk-4FOM4XM6.mjs → chunk-72SLLEHW.mjs} +1 -1
- package/dist/{chunk-5G3COZF4.mjs → chunk-7RRPNMIO.mjs} +1 -1
- package/dist/chunk-AAIHHUX2.mjs +4 -0
- package/dist/{chunk-UENDC4U4.mjs → chunk-B3IP63Q2.mjs} +1 -1
- package/dist/{chunk-7WTM3LJ4.mjs → chunk-C3KGAABY.mjs} +1 -1
- package/dist/{chunk-EB2UGKCE.mjs → chunk-CSNHOTMZ.mjs} +1 -1
- package/dist/{chunk-L3SSJ5A3.mjs → chunk-FONUFLBI.mjs} +1 -1
- package/dist/{chunk-GGXCPUR2.mjs → chunk-GLMVATBC.mjs} +1 -1
- package/dist/{chunk-XBCYPOFD.mjs → chunk-GTK2SGS5.mjs} +1 -1
- package/dist/{chunk-ISBVFNWD.mjs → chunk-IDG2O4B7.mjs} +1 -1
- package/dist/{chunk-FATHLUEL.mjs → chunk-IUDZWH6J.mjs} +1 -1
- package/dist/{chunk-HKM6FA5J.mjs → chunk-MXISPX3W.mjs} +1 -1
- package/dist/{chunk-WYHDFQVL.mjs → chunk-MZ7ZHGT7.mjs} +1 -1
- package/dist/{chunk-AWMFKQHJ.mjs → chunk-OE6DHWF3.mjs} +1 -1
- package/dist/{chunk-TEL4MSNV.mjs → chunk-OO7RQCK6.mjs} +1 -1
- package/dist/{chunk-N2336R53.mjs → chunk-P53OTWDE.mjs} +1 -1
- package/dist/{chunk-GEFCIPUN.mjs → chunk-PZCNIPIA.mjs} +1 -1
- package/dist/{chunk-NC7WGIM5.mjs → chunk-RAMI7KEB.mjs} +1 -1
- package/dist/{chunk-AHJIHY2A.mjs → chunk-RV2TWILK.mjs} +1 -1
- package/dist/{chunk-GWAEXG22.mjs → chunk-S36H4JAL.mjs} +1 -1
- package/dist/{chunk-XEZD3D7C.mjs → chunk-TIPBA4EM.mjs} +1 -1
- package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
- package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
- package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
- package/dist/{chunk-67YQLYKU.mjs → chunk-WIIGZJLT.mjs} +1 -1
- package/dist/{chunk-AL6YBBXL.mjs → chunk-YYBKYJU2.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/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -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.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/CopilotInterface.js +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/demo.js +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.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/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/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/Other/index.mjs +1 -1
- package/dist/components/Payload/Card/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/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/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +1 -1
- 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-6RXY6Z7T.mjs +0 -4
package/dist/components/index.js
CHANGED
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
dark bg-background text-primary`,children:[(0,Ut.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Ut.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"Ut-8"}),(0,Ut.jsx)("span",{className:"vs-12 text-sm",children:"Power Bd your people"})]}),(0,Ut.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,Ut.jsx)("div",{ref:s,className:"preview-container"})]})},pm=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=Gi(e),o=(0,vs.useRef)(null),r=(0,vs.useRef)(null),s=(0,vs.useRef)(new Zy.Previewer),[l,i]=(0,vs.useState)(0),m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],c=(0,vs.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(p=>i(p.pageCount)).catch(p=>console.error("Paged.js error:",p)))},[t]);return(0,vs.useEffect)(()=>{s.current=new Zy.Previewer,c()},[c,t]),(0,vs.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,Ut.jsxs)("div",{className:"pagedjs-container",children:[(0,Ut.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((p,g)=>(0,Ut.jsx)(Ut.Fragment,{children:g===0?(0,Ut.jsx)("section",{className:"pagedjs-section title-page w-full Ut-full",children:(0,Ut.jsx)(Jr,{hero:e.hero,title:e.title})},g):(0,Ut.jsxs)("section",{className:n("pagedjs-section normal-page Ut-[699px]",`Ut-[${wg("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,Ut.jsx)(qr,{title:p.blockName}),(0,Ut.jsx)(go,{blocks:[p],fill:!0})]},g)}))}),(0,Ut.jsx)("div",{ref:o,className:"preview-container"})]})};var yl=P(require("clsx"));function kg({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:l,loading:i=!1,LinkComponent:d,...m}){let p=d?g=>(0,Ut.jsx)(d,{...g}):l?({href:g,children:f,...b})=>(0,Ut.jsx)("button",{onClick:()=>l&&l(g),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:f}):g=>(0,Ut.jsx)("a",{...g});return(0,Ut.jsxs)(ko,{...m,variant:"inset",children:[(0,Ut.jsx)(Po,{children:(0,Ut.jsx)(Rt,{children:(0,Ut.jsx)(mt,{children:i?(0,Ut.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Ut.jsx)(Fe,{className:"bg-gray-200 my-2 w-full Ut-7"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 my-2 Ut-5"})]}):(0,Ut.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Ut.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Ut.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),i&&(0,Ut.jsxs)(ao,{children:[(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"}),(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-3/4 Ut-5"})]}),(0,Ut.jsxs)(ao,{children:[e&&!i&&e.map((g,f)=>(0,Ut.jsx)(Pg,{subNav:g,pathName:r,Link:p},f)),(0,Ut.jsx)(Ot,{className:"mt-auto",children:(0,Ut.jsx)(sa,{children:(0,Ut.jsx)(Rt,{children:t&&!i&&t.map(g=>(0,Ut.jsx)(mt,{children:(0,Ut.jsx)(Gt,{asChild:!0,size:"sm",children:(0,Ut.jsxs)(p,{href:g.url||"",children:[g.icon&&(0,Ut.jsx)(g.icon,{}),(0,Ut.jsx)("span",{children:g.label})]})})},g.label))})})})]}),(0,Ut.jsx)(So,{})]})}function Pg({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,Ut.jsx)(Aa,{defaultOpen:!0,className:"group/collapsible",children:(0,Ut.jsx)(Ot,{className:"py-0",children:(0,Ut.jsx)(Rt,{children:(0,Ut.jsx)(Aa,{asChild:!0,defaultOpen:o.isActive,children:(0,Ut.jsxs)(mt,{children:[(0,Ut.jsx)(Gt,{asChild:!0,tooltip:o.label,className:(0,yl.default)(r&&"font-bold text-accent"),children:(0,Ut.jsxs)(a,{href:o.url,children:[o.icon&&(0,Ut.jsx)(o.icon,{}),(0,Ut.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(qa,{asChild:!0,children:(0,Ut.jsxs)(Ar,{className:"data-[state=open]:rotate-90",children:[(0,Ut.jsx)(Bd.ChevronRight,{}),(0,Ut.jsx)("span",{className:"Ut-only",children:"Toggle"})]})}),(0,Ut.jsx)(Ja,{children:(0,Ut.jsx)(oo,{children:o.links?.map(s=>(0,Ut.jsx)(ro,{children:(0,Ut.jsx)(so,{asChild:!0,className:(0,yl.default)(s.url===t&&"font-bold text-accent"),children:(0,Ut.jsx)(a,{href:s.url,children:(0,Ut.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var gm=P(require("clsx"));var Sg=()=>(0,Ut.jsx)(ut,{iconName:"github",size:"10x"});function Rg({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:l,onPrintDocument:i,onGithubClick:d,onNavClick:m,LinkComponent:c,...p}){let b=c?u=>(0,Ut.jsx)(c,{...u}):m?({item:u,children:y,...T})=>(0,Ut.jsx)("button",{onClick:()=>m&&m(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...T,children:y}):u=>(0,Ut.jsx)("a",{href:u.href,...u});return(0,Ut.jsxs)(ko,{side:"right",variant:"inset",...p,children:[(0,Ut.jsxs)(Po,{className:"border-b border-sidebar-border",children:[(0,Ut.jsxs)(Rt,{className:"flex-row space-x-1",children:[(0,Ut.jsx)(mt,{children:(0,Ut.jsxs)(Gt,{onClick:s,children:[(0,Ut.jsx)(Bd.FilePlus,{})," ",(0,Ut.jsx)("span",{children:"Add Document"})]})}),d&&(0,Ut.jsx)(mt,{children:(0,Ut.jsx)(Gt,{onClick:d,tooltip:"Open in GitHub",children:(0,Ut.jsx)(Sg,{})})})]}),(0,Ut.jsxs)(Rt,{className:"flex-row space-x-1",children:[(0,Ut.jsx)(mt,{className:"w-5/12",children:(0,Ut.jsxs)(Gt,{onClick:()=>l(),variant:r?"outline":"default",className:(0,gm.default)(r&&"text-accent"),children:[(0,Ut.jsx)(Bd.Edit,{})," ",(0,Ut.jsx)("span",{children:"Edit"})]})}),(0,Ut.jsx)(mt,{className:"w-5/12",children:(0,Ut.jsxs)(Gt,{onClick:i,children:[(0,Ut.jsx)(Bd.Printer,{})," ",(0,Ut.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(Aa,{defaultOpen:!0,className:"group/collapsible",children:(0,Ut.jsxs)(Ot,{children:[(0,Ut.jsx)(Ba,{asChild:!0,children:(0,Ut.jsxs)(qa,{children:["Editor Controls",(0,Ut.jsx)(Bd.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Ut.jsx)(sa,{children:(0,Ut.jsx)(Ja,{children:a})})]})}),(0,Ut.jsx)(Tr,{className:"mx-0"})]}),(0,Ut.jsxs)(ao,{className:"overflow-auto",children:[o&&(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsxs)(Ot,{children:[(0,Ut.jsx)(Ba,{children:"Related Content"}),(0,Ut.jsx)(sa,{children:(0,Ut.jsx)(Rt,{children:Array.from({length:3}).map((u,y)=>(0,Ut.jsx)(mt,{children:(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-full Ut-10"})},y))})})]}),(0,Ut.jsxs)(Ot,{children:[(0,Ut.jsx)(Ba,{children:"Table of Contents"}),(0,Ut.jsx)(sa,{children:(0,Ut.jsx)(Rt,{children:Array.from({length:3}).map((u,y)=>(0,Ut.jsx)(mt,{children:(0,Ut.jsx)(Fe,{className:"bg-gray-200 w-full Ut-10"})},y))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,Ut.jsx)(Aa,{defaultOpen:!0,className:"group/collapsible",children:(0,Ut.jsxs)(Ot,{children:[(0,Ut.jsx)(Ba,{asChild:!0,children:(0,Ut.jsxs)(qa,{children:["Related Content",(0,Ut.jsx)(Bd.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Ut.jsx)(sa,{children:(0,Ut.jsx)(Ja,{children:(0,Ut.jsx)(Rt,{children:e&&Object.keys(e).map(u=>(0,Ut.jsxs)(mt,{children:[(0,Ut.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",u.charAt(0).toUpperCase()+u.slice(1)]}),u&&e[u]&&(0,Ut.jsx)(oo,{children:e[u].map(y=>(0,Ut.jsx)(ro,{children:(0,Ut.jsx)(so,{asChild:!0,isActive:!1,size:"sm",children:(0,Ut.jsxs)(b,{href:y.url,item:y,className:"flex justify-between items-center w-full text-xs",children:[(0,Ut.jsx)("span",{children:y.label}),y.type==="note"&&(0,Ut.jsx)(Bd.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),y.type==="draft"&&(0,Ut.jsx)(ut,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},y.label))})]},u))})})})]})}),t&&!o&&(0,Ut.jsx)(Aa,{defaultOpen:!0,className:"group/collapsible",children:(0,Ut.jsxs)(Ot,{children:[(0,Ut.jsx)(Ba,{asChild:!0,children:(0,Ut.jsxs)(qa,{children:["Table of Contents",(0,Ut.jsx)(Bd.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Ut.jsx)(sa,{children:(0,Ut.jsx)(Ja,{children:(0,Ut.jsx)(Rt,{children:t.map(u=>(0,Ut.jsxs)(mt,{children:[(0,Ut.jsx)(Gt,{asChild:!0,children:(0,Ut.jsx)("a",{href:`#${u.url}`,className:"text-xs",children:u.title})}),u.items?.length?(0,Ut.jsx)(oo,{children:u.items.map(y=>(0,Ut.jsx)(ro,{children:(0,Ut.jsx)(so,{asChild:!0,isActive:y.isActive,size:"sm",children:(0,Ut.jsx)("a",{href:`#${y.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,Ut.jsx)("span",{children:y.title})})})},y.title))}):null]},u.title))})})})]})})]}),(0,Ut.jsx)(So,{})]})}var bm=P(require("next/image"));function Dg({title:e,members:t}){return(0,Ut.jsx)(ne,{className:"mb-6",children:(0,Ut.jsxs)("div",{className:"p-6",children:[(0,Ut.jsxs)("div",{className:"flex items-center mb-4",children:[(0,Ut.jsx)(Bd.Users,{className:"w-6 Ut-6 text-accent qc-2"}),(0,Ut.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Ut.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,Ut.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Ut.jsx)("div",{className:"relative w-12 Ut-12 rounded-full overflow-hidden",children:a.avatar&&(0,Ut.jsx)(bm.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Ut.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var vm=P(require("next/link"));var Tg=({links:e,title:t="Related Content"})=>(0,$a.jsxs)(ne,{children:[(0,$a.jsx)(Re,{children:(0,$a.jsx)(De,{className:"text-accent",children:t})}),(0,$a.jsx)(ve,{children:(0,$a.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,$a.jsxs)(vm.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,$a.jsx)(Bd.ExternalLink,{className:"ml-1 Ut-3 w-3"})]},o))})})]});var xl=n("grid Ut-[45px] w-[45px] place-items-center border border-[#3b3b3b] font-secondary text-base text-foreground rounded-full transition-colors duration-300 hover:bg-accent hover:border-accent hover:text-accent-foreground");function Ag({pages:e}){let t=(0,qc.useSearchParams)(),a=(0,qc.usePathname)(),{replace:o}=(0,qc.useRouter)(),{totalPages:r,page:s}=e,[l,i]=(0,vs.useState)({start:s>3?s-3:1,end:s+2}),d=p=>{p==="left"&&l.start>1?i(g=>({start:g.start-1,end:g.end-1})):p==="right"&&l.end<r&&i(g=>({start:g.start+1,end:g.end+1}))};function m(p){let g=new URLSearchParams(t);p?g.set("page",p):g.delete("page"),o(`${a}?${g.toString()}`)}if(r<=1)return null;let c=[];for(let p=l.start;p<=l.end;p++)c.push(p);return(0,Ut.jsx)("div",{className:"mt-12",children:(0,Ut.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[l.start>1&&(0,Ut.jsx)("Bd",{children:(0,Ut.jsx)("button",{className:n(xl,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>d("left"),children:(0,Ut.jsx)(fc.FaArrowLeft,{})})}),c.map((p,g)=>(0,Ut.jsx)("Bd",{children:(0,Ut.jsx)("a",{className:n(xl,p===s?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:f=>{f.preventDefault(),m(p.toString())},children:p})},g)),l.end<r&&(0,Ut.jsx)("Bd",{children:(0,Ut.jsx)("button",{className:n(xl,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>d("right"),children:(0,Ut.jsx)(fc.FaArrowRight,{})})})]})})}var Lx=n("transition-colors duration-400 hover:text-primary ease-in-out");function Ig({title:e,links:t}){let a=(0,qc.useSearchParams)(),o=(0,qc.usePathname)(),{replace:r}=(0,qc.useRouter)();function s(l){let i=new URLSearchParams(a);l?i.set("category",l):i.delete("category"),r(`${o}?${i.toString()}`)}return(0,Ut.jsxs)(ne,{children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-accent",children:e&&e})}),(0,Ut.jsx)(ve,{children:t&&t.length>0&&(0,Ut.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Ut.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((l,i)=>(0,Ut.jsxs)("Bd",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:pt-0 hover:cursor-pointer",onClick:d=>{d.preventDefault(),s(l.href)},children:[l.label,(0,Ut.jsx)(Bd.ExternalLink,{className:"ml-1 Ut-3 w-3"})]},i))})})})]})}function Mg({types:e}){let[t,a]=(0,vs.useState)(e&&e[0].href),o=(0,qc.useSearchParams)(),r=(0,qc.usePathname)(),{replace:s}=(0,qc.useRouter)();function l(i){let d=new URLSearchParams(o);i?d.set("type",i):d.delete("type"),a(i),s(`${r}?${d.toString()}`)}return(0,Ut.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((i,d)=>(0,Ut.jsx)(w,{variant:i.href===t?"default":"ghost",className:n("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",i.href===t&&"bg-accent text-accent-foreground"),onClick:()=>l(i.href),children:i.label},d))})}var wm=P(require("next/image"));var wl=({links:e,media:t,children:a,richText:o})=>(0,Ut.jsx)("div",{children:(0,Ut.jsxs)("div",{className:"sticky top-0 Ut-[70vh] min-Ut-[600px]",children:[(0,Ut.jsxs)("div",{className:"fixed inset-0 container mt-24 mb-8 Ut-10 flex items-start justify-center",children:[a||o&&(0,Ut.jsx)(be,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,Ut.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,Ut.jsx)("Bd",{children:(0,Ut.jsx)(ma,{...r})},s))})]}),(0,Ut.jsxs)("div",{className:"fixed inset-0 Ut-[70vh] min-Ut-[600px] select-none",children:[t&&typeof t=="object"&&(0,Ut.jsx)(Fa,{fill:!0,imgClassName:"Ut-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Ut.jsx)("div",{children:(0,Ut.jsx)(wm.default,{className:"-Ut-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Ut.jsx)("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),(0,Ut.jsx)(Bg,{})]})}),Bg=()=>(0,Ut.jsx)("div",{className:"w-full Ut-[1240px] Ut-10",children:(0,Ut.jsxs)("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:[(0,Ut.jsx)("defs",{children:(0,Ut.jsxs)("mask",{id:"mask",children:[(0,Ut.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Ut.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Ut.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Cl=P(require("next/image"));var Lg=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,Ut.jsx)(Cl.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,Ut.jsx)("div",{children:(0,Ut.jsx)(Cl.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},kl=({links:e,media:t,children:a,richText:o})=>(0,Ut.jsxs)("div",{className:"relative bg-brand-one pb-12 mt-20 pt-10",children:[t&&(0,Ut.jsx)(Lg,{media:t}),(0,Ut.jsx)("div",{className:"mx-0 min-w-full relative Ut-9",children:(0,Ut.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,Ut.jsx)(be,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Pl=({children:e,richText:t})=>(0,Ut.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,Ut.jsx)("div",{className:"container",children:e||t&&(0,Ut.jsx)(be,{content:t,enableGutter:!1})})});var km=P(require("react")),Pm=P(require("next/image"));var Cm=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,l=r<10?`0${r}`:r,i=a.getFullYear();return`${l}/${s}/${i}`};var zg=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,Ut.jsxs)("div",{className:"relative grid pt-24",children:[(0,Ut.jsx)("div",{className:"relative Ut-10 flex flex-col justify-end min-Ut-[50vh] text-foreground dark:text-foreground pt-24 p-6 lg:p-12",children:(0,Ut.jsxs)("div",{className:"container mx-auto",children:[(0,Ut.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,Ut.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Ut.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ut.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,Ut.jsx)("p",{children:o.map((l,i)=>(0,Ut.jsxs)(km.default.Fragment,{children:[l.name,i<o.length-2&&", ",i===o.length-2&&(o.length>2?", and ":" and ")]},l.id))})]}),r&&(0,Ut.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ut.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,Ut.jsx)("time",{dateTime:r,children:Cm(r)})]}),t&&t.length>0&&(0,Ut.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ut.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,Ut.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((l,i)=>typeof l=="object"&&l!==null&&(0,Ut.jsx)(me,{className:"px-3 py-1 mx-1",children:l.title||"Untitled category"},l.id||i))})]})]})]})}),(0,Ut.jsxs)("div",{className:"absolute inset-0 w-full Ut-full",children:[(0,Ut.jsx)(Pm.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Ut.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full Ut-1/2 bg-gradient-to-t from-background dark:from-black to-transparent"})]})]})};var ai=require("@heroicons/react/20/solid");var Rl=P(require("next/image"));function Sl({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=n("container",t&&"full-width",a&&"Ut-padding",o);return(0,Ut.jsx)("div",{className:r,children:e})}var Rm=require("next-themes");function Eg({children:e,...t}){return(0,Ut.jsx)(Rm.ThemeProvider,{...t,children:e})}var Zr=({position:e,className:t=""})=>{let a=["","scale(-1, 1)","scale(1, -1)","scale(-1, -1)"],o=a[Math.floor(Math.random()*a.length)];if(e==="header")return(0,Ut.jsx)("div",{className:"w-full Ut-[1240px] Ut-20",children:(0,Ut.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",preserveAspectRatio:"xMidYMax meet",style:{fontSize:0,float:"left"},className:n(t,"absolute -bottom-[2px] flex"),children:[(0,Ut.jsx)("defs",{children:(0,Ut.jsxs)("mask",{id:"mask",children:[(0,Ut.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Ut.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Ut.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Ut.jsxs)("div",{className:"w-full Ut-20 aspect-[1920/332] overflow-hidden ",children:[(0,Ut.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:n(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Ut.jsx)("defs",{children:(0,Ut.jsxs)("mask",{id:"mask",children:[(0,Ut.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Ut.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full Ut-[6px] Ut-10 bg-white"})]});if(e==="dark-top")return(0,Ut.jsx)("div",{className:"w-full aspect-[1920/332] Ut-20 content-end block overflow-hidden",children:(0,Ut.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:n(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Ut.jsx)("defs",{children:(0,Ut.jsxs)("mask",{id:"mask",children:[(0,Ut.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});if(e==="dark-bottom")return(0,Ut.jsx)("div",{className:"w-full aspect-[1920/332] Ut-20 content-start block overflow-hidden bg-white",children:(0,Ut.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"scale(1, -1)"},className:n(t,"w-full block overflow-hidden"),children:(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="light-bottom")return(0,Ut.jsx)("div",{className:"w-full aspect-[1920/332] Ut-20 content-end block overflow-hidden",children:(0,Ut.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain"},className:n(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="bottom-left"||e==="bottom-right")return(0,Ut.jsx)("div",{className:"w-full aspect-[1920/332] Ut-20 relative -bottom-[1px]",children:(0,Ut.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"rotateX(180deg)"},className:n(t,"w-full block overflow-hidden"),children:(0,Ut.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Fg=({className:e})=>(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:n(e,"absolute w-full Ut-full"),children:[(0,Ut.jsx)("defs",{children:(0,Ut.jsxs)("mask",{id:"mask",children:[(0,Ut.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Ut.jsx)("polygon",{fill:"white",points:"0 0 0 201.561092 0 1036.200679 0 1087.625789 1255.099121 1240.909908 1920 908.450984 1920 201.561092 1920 0 0 0"})]})}),(0,Ut.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var Dl=({title:e,image:t})=>(0,Ut.jsx)("div",{children:(0,Ut.jsxs)("div",{className:"sticky top-0 Ut-[50vh] min-Ut-[400px]",children:[(0,Ut.jsx)("div",{className:"fixed inset-0 container mt-24 mb-8 Ut-10 flex items-start justify-start",children:(0,Ut.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Ut.jsxs)("div",{className:"fixed inset-0 Ut-[50vh] min-Ut-[400px] select-none",children:[t&&typeof t=="object"&&(0,Ut.jsx)(Rl.default,{priority:!0,src:t.src,alt:`${process.env.NEXT_PUBLIC_SITE_NAME}`,layout:"fill",style:{objectFit:"cover"},sizes:"100vw",className:"pointer-events-none object-cover"}),t&&typeof t=="string"&&(0,Ut.jsx)("div",{children:(0,Ut.jsx)(Rl.default,{className:"-Ut-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Ut.jsx)("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),(0,Ut.jsx)(Zr,{className:"text-black Ut-10",position:"header"})]})});var Hg={highImpact:wl,lowImpact:Pl,mediumImpact:kl,sectionHero:Dl},jg=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Hg[t];return a?(0,Ut.jsx)(a,{...e}):null};function Ug({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Ut.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Ut.jsxs)("Ut",{role:"list",className:"flex items-center space-x-4",children:[(0,Ut.jsx)("Bd",{children:(0,Ut.jsx)("div",{children:(0,Ut.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Ut.jsx)(ai.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Ut.jsx)("span",{className:"Ut-only",children:"Home"})]})})}),t.map((a,o)=>(0,Ut.jsx)("Bd",{children:(0,Ut.jsxs)("div",{className:"flex items-center",children:[(0,Ut.jsx)(ai.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Ut.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,Ut.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Ut.jsx)(Ut.Fragment,{})}function ri(e,t){let[a,o]=(0,vs.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,vs.useEffect)(()=>{r(a)},[]),[a,r]}var si=require("react-icons/Ut");function Og({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:l,className:i}){let[d,m]=ri(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),c=!r&&!t||d;return(0,Ut.jsxs)(nr.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${i||""}`,children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Ut.jsx)(me,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Ut.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,Ut.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,Ut.jsx)("button",{"aria-label":d?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>m(!d),style:{lineHeight:0},children:d?(0,Ut.jsx)(si.FaChevronDown,{size:22}):(0,Ut.jsx)(si.FaChevronUp,{size:22})})]})]}),!c&&(0,Ut.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Ut.jsxs)("div",{className:"space-y-4",children:[(0,Ut.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Ut.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Ut.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,Ut.jsx)(w,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),l&&(0,Ut.jsx)("div",{className:"hidden lg:block",children:l})]})]})}var Ht=require("@headlessui/react"),ni=require("@heroicons/react/24/outline");var Gg=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Ut.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Ut.jsxs)("span",{className:"relative",children:[e,(0,Ut.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 Ut-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,Ut.jsxs)(Ht.Popover,{children:[(0,Ut.jsxs)(Ht.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Ut.jsxs)("span",{className:"relative",children:[e,(0,Ut.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 Ut-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,Ut.jsx)(ai.ChevronDownIcon,{"aria-hidden":"true",className:"Ut-5 w-5 flex-none text-accent"})]}),(0,Ut.jsxs)(Ht.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -Ut-10 bg-popover mt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,Ut.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 Ut-50",children:t&&t.map(r=>(0,Ut.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Ut.jsx)("div",{className:"flex Ut-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Ut.jsx)(Am,{icon:r.icon,size:"4x"})}),(0,Ut.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Ut.jsx)("span",{className:"absolute inset-0"})]}),(0,Ut.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Ut.jsx)("div",{className:"bg-gray-50",children:(0,Ut.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Ut.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Ut.jsxs)("a",{href:r.href,className:"flex items-center max-Ut-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Ut.jsx)(Am,{icon:r.icon,className:"Ut-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Am=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Ut.jsx)(ut,{...e,size:a});if("src"in e)return(0,Ut.jsx)("div",{className:n(t,"Ut-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Ut.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},gr=Gg;var ii=["light","dark","green"];function $g({title:e,logo:t,menuItems:a}){let[o,r]=(0,vs.useState)(!1),[s,l]=(0,vs.useState)(!1),[i,d]=(0,vs.useState)("light"),m=t?.split(".")[0],c=t?.split(".")[1],[p,g]=(0,vs.useState)(`${m}.${c}`),f=u=>{ii.includes(u)?g(u==="light"?`${m}.${c}`:`${m}-${u}.${c}`):g(`${m}.${c}`)};(0,vs.useEffect)(()=>{let u=localStorage.getItem("theme")||"light";d(u),document.documentElement.setAttribute("class",u),f(u)},[]);let b=()=>{let u=ii[(ii.indexOf(i)+1)%ii.length];d(u),document.documentElement.setAttribute("class",u),localStorage.setItem("theme",u),f(u)};return(0,Ut.jsxs)("header",{className:"relative isolate Ut-10 bg-background Ut-14",children:[(0,Ut.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Ut.jsx)("div",{className:"flex lg:flex-1",children:(0,Ut.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:e}),(0,Ut.jsx)("img",{alt:e,src:p,className:"Ut-9 w-auto"})]})}),(0,Ut.jsx)("div",{className:"flex lg:hidden",children:(0,Ut.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Open main menu"}),(0,Ut.jsx)(ni.Bars3Icon,{"aria-hidden":"true",className:"Ut-6 w-6"})]})}),(0,Ut.jsx)(Ht.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(u=>(0,Ut.jsx)(gr,{...u},u.name))}),(0,Ut.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Ut.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:i==="dark"?(0,Ut.jsx)(ai.SunIcon,{className:"Ut-6 w-6"}):i==="green"?(0,Ut.jsx)(ai.MoonIcon,{className:"Ut-6 w-6"}):(0,Ut.jsx)(ai.SunIcon,{className:"Ut-6 w-6"})})})]}),(0,Ut.jsxs)(Ht.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,Ut.jsx)("div",{className:"fixed inset-0 Ut-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Ut.jsxs)(Ht.DialogPanel,{className:"fixed inset-y-0 right-0 Ut-20 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Your Company"}),(0,Ut.jsx)("img",{alt:e,src:t,className:"Ut-8 w-auto"})]}),(0,Ut.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Close menu"}),(0,Ut.jsx)(ni.XMarkIcon,{"aria-hidden":"true",className:"Ut-6 w-6"})]})]}),(0,Ut.jsx)("div",{className:"mt-6 flow-root",children:(0,Ut.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Ut.jsx)("div",{className:"space-y-2 py-6",children:a.map(u=>(0,Ut.jsx)(Vg,{...u},u.name))})})})]})]})]})}function Vg({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Ut.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,Ut.jsxs)(Ht.Disclosure,{Ut:"div",className:"-mx-3",children:[(0,Ut.jsx)(Ht.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 vs-3 qc-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Ut.jsx)(Ht.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Ut.jsx)(Ht.DisclosureButton,{Ut:"a",href:r.href,className:"block rounded-lg py-2 vs-6 qc-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function _g({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let l=()=>{let i=document.getElementById("next-section");i&&i.scrollIntoView({behavior:"smooth"})};return(0,Ut.jsx)("div",{children:(0,Ut.jsxs)("div",{className:"sticky top-0 Ut-screen",children:[(0,Ut.jsxs)("video",{className:"fixed inset-0 object-cover w-full Ut-full Ut-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Ut.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Ut.jsx)("div",{className:"fixed inset-0 Ut-full Ut-10 flex flex-col items-start justify-center text-white px-4",children:(0,Ut.jsx)(Sl,{children:(0,Ut.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 Ut-0 md:mb-0",children:[(0,Ut.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,Ut.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:s&&s})]})})}),(0,Ut.jsx)(Zr,{className:"text-black Ut-10",position:"header"})]})})}var Tl=P(require("next/image"));function fo({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Ut.jsxs)(Kt,{href:"/",className:n(a?"py-1":"py-2"),children:[(0,Ut.jsx)(Tl.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,Ut.jsx)(Tl.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function Al({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[l,i]=(0,vs.useState)(!1),[d,m]=(0,vs.useState)(""),c=["light","dark"],{theme:p,setTheme:g}=(0,Rm.useTheme)();(0,vs.useEffect)(()=>{m(p||"dark")},[p]);let f=()=>{let b=c[(c.indexOf(d)+1)%c.length];m(b),g(b)};return(0,vs.useEffect)(()=>{let b=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,Ut.jsx)(Ut.Fragment,{children:(0,Ut.jsx)("header",{className:`Ut-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Ut.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Ut.jsxs)("div",{className:n("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,Ut.jsx)(fo,{logoDark:a,logoLight:t}),(0,Ut.jsx)(Ht.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,Ut.jsx)(gr,{...b},b.name))}),r&&(0,Ut.jsx)("button",{className:"fixed right-4 Ut-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:f,children:(0,Ut.jsxs)("div",{className:"relative",children:[(0,Ut.jsx)(Bd.Sun,{className:"absolute Ut-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Ut.jsx)(Bd.Moon,{className:"absoulte Ut-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Il=["light","dark"];function Ml({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,vs.useState)(!1),{theme:l,setTheme:i}=(0,Rm.useTheme)(),[d,m]=(0,vs.useState)(!1),[c,p]=(0,vs.useState)("light");(0,vs.useEffect)(()=>{let f=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",f,{passive:!0}),()=>window.removeEventListener("scroll",f)},[]),(0,vs.useEffect)(()=>{p(l||"dark")},[l]);let g=()=>{let f=Il[(Il.indexOf(c)+1)%Il.length];p(f),i(f)};return(0,Ut.jsx)(Ut.Fragment,{children:(0,Ut.jsxs)("header",{className:`Ut-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Ut.jsx)("nav",{className:n("backdrop-blur-sm text-white p-0",d&&"hidden"),children:(0,Ut.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&Ut.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,Ut.jsx)(fo,{logoDark:t,logoLight:e,mobile:!0}),(0,Ut.jsx)("div",{className:"flex items-center space-x-4",children:(0,Ut.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"fixed right-4 Ut-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Open main menu"}),(0,Ut.jsx)(ni.Bars3Icon,{"aria-hidden":"true",className:"Ut-4 w-4"})]})})]})}),(0,Ut.jsxs)(Ht.Dialog,{open:d,onClose:m,className:"lg:hidden",children:[(0,Ut.jsx)("div",{className:"fixed inset-0 Ut-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Ut.jsxs)(Ht.DialogPanel,{className:"fixed inset-y-0 right-0 Ut-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Ut.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Ut.jsx)(fo,{logoDark:t,logoLight:e,mobile:!0}),(0,Ut.jsxs)("button",{type:"button",onClick:()=>m(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Close menu"}),(0,Ut.jsx)(ni.XMarkIcon,{"aria-hidden":"true",className:"Ut-6 w-6"})]})]}),(0,Ut.jsx)("div",{className:"mt-6 flow-root",children:(0,Ut.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Ut.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(f=>(0,Ut.jsx)(Wg,{...f},f.name))})})})]})]})]})})}function Wg({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Ut.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,Ut.jsxs)(Ht.Disclosure,{Ut:"div",className:"-mx-3",children:[(0,Ut.jsx)(Ht.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 vs-3 qc-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Ut.jsx)(Ht.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Ut.jsx)(Ht.DisclosureButton,{Ut:"a",href:r.href,className:"block rounded-lg py-2 vs-6 qc-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var ON=n("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),zm=n("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),Bl=n("bg-brand-green rounded-full p-3 qc-4 text-2xl"),Ll=n("flex items-center text-white gap-3"),ci=n("transition-colors duration-300 hover:text-accent dark:hover:text-white");function Xg({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:l,footerBottom:i}=t,d=void 0;return(0,Ut.jsxs)("footer",{className:n("sticky Ut-2 flex flex-col dark bg-black overflow-hidden pt-12 prose-base",e),children:[(0,Ut.jsx)("div",{className:"py-16 md:py-20",children:(0,Ut.jsx)("div",{className:"container",children:(0,Ut.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Ut.jsxs)("div",{"data-aos":"fade-Bd","data-aos-delay":"200",children:[(0,Ut.jsx)(fo,{logoDark:o,logoLight:a}),(0,Ut.jsx)("p",{className:"mb-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,Ut.jsx)("nav",{"aria-label":"social links",children:(0,Ut.jsx)("ul",{className:"inline-flex vs-0 min-Ut-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((m,c)=>(0,Ut.jsx)("Bd",{className:"bg-primary rounded-full p-3",children:(0,Ut.jsx)(Kt,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,Ut.jsx)("span",{children:m.icon})})},c))})})]}),(0,Ut.jsxs)("div",{"data-aos":"fade-Bd","data-aos-delay":"400",children:[(0,Ut.jsx)("h3",{className:zm,children:s.title}),s.links&&s.links.length>0&&(0,Ut.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Ut.jsx)("ul",{className:"grid vs-0 gap-2",children:s.links.map(m=>(0,Ut.jsxs)("Bd",{className:"flex items-center gap-2.5",children:[(0,Ut.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,Ut.jsx)(fc.FaChevronRight,{})}),(0,Ut.jsx)(Kt,{href:m.href,openNewTab:m.openNewTab,className:ci,children:m.label})]},m.label))})})]}),(0,Ut.jsxs)("div",{"data-aos":"fade-Bd","data-aos-delay":"600",children:[(0,Ut.jsx)("h3",{className:zm,children:l.title}),(0,Ut.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 vs-0",children:[(0,Ut.jsxs)("Bd",{className:Ll,children:[(0,Ut.jsx)("span",{className:Bl,children:(0,Ut.jsx)(fc.FaPaperPlane,{})}),(0,Ut.jsx)("address",{className:"not-italic",children:l.location})]}),(0,Ut.jsxs)("Bd",{className:Ll,children:[(0,Ut.jsx)("span",{className:Bl,children:(0,Ut.jsx)(fc.FaEnvelope,{})}),l.mails&&l.mails.length>0&&(0,Ut.jsx)("div",{className:"grid gap-1",children:l.mails.map((m,c)=>(0,Ut.jsx)("a",{href:`mailto:${m}`,className:ci,children:m},c))})]}),l.phoneNumbers&&l.phoneNumbers.length>0&&(0,Ut.jsxs)("Bd",{className:Ll,children:[(0,Ut.jsx)("span",{className:Bl,children:(0,Ut.jsx)(fc.FaPhone,{})}),(0,Ut.jsx)("div",{className:"grid gap-1",children:l.phoneNumbers.map((m,c)=>(0,Ut.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:ci,children:m},c))})]})]})]})]})})}),(0,Ut.jsx)("div",{className:"flex min-Ut-[90px] items-center border-t border-accent-800 border-opacity-20 py-5 dark:border-body dark:border-opacity-20",children:(0,Ut.jsx)("div",{className:"container",children:(0,Ut.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,Ut.jsx)("p",{children:i.copyrightText}),i.links&&i.links.length>0&&(0,Ut.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Ut.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:i.links.map(m=>(0,Ut.jsx)("Bd",{children:(0,Ut.jsx)(Kt,{"aria-label":`vs to page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:ci,children:m.label})},m.label))})})]})})})]})}function Yg({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:l=!1}){return(0,Ut.jsxs)("div",{className:n("fixed top-0 left-0 right-0 Ut-50",r),children:[(0,Ut.jsx)(Al,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:s}),(0,Ut.jsx)(Ml,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function Kg({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Ut.jsx)(Ut.Fragment,{children:(0,Ut.jsx)("menu",{className:n("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,Ut.jsx)("div",{className:"container backdrop-blur-sm",children:(0,Ut.jsx)("div",{className:n("flex items-center justify-between py-0",!t&&"container"),children:(0,Ut.jsx)(Ht.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Ut.jsx)(gr,{...o},o.name))})})})})})}function zl({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,vs.useState)([]),s=(0,qc.useRouter)(),l=()=>{o.length===e.length?r([]):r(e.map(c=>c.id))},i=c=>{r(p=>p.includes(c)?p.filter(g=>g!==c):[...p,c])},d=async()=>{let c=await t(o);c.success?(Us.toast.success(c.message),s.refresh()):Us.toast.error(`Error: ${c.message}`),r([])},m=async()=>{let c=await a(o);c.success?(Us.toast.success(c.message),s.refresh()):Us.toast.error(`Error: ${c.message}`),r([])};return(0,Ut.jsxs)("div",{className:"space-y-4",children:[(0,Ut.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Ut.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Ut.jsxs)("div",{className:"space-x-2",children:[(0,Ut.jsx)(w,{onClick:d,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Ut.jsx)(w,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Ut.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Ut.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Ut.jsx)("Bd",{className:"px-4 py-4 sm:px-6",children:(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsxs)("div",{className:"flex items-center",children:[(0,Ut.jsx)(Et,{id:"select-all",checked:o.length===e.length,onCheckedChange:l,className:"border-accent"}),(0,Ut.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Ut.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(c=>(0,Ut.jsx)("Bd",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsxs)("div",{className:"flex items-center",children:[(0,Ut.jsx)(Et,{id:`select-${c.id}`,checked:o.includes(c.id),onCheckedChange:()=>i(c.id),className:"border-accent"}),(0,Ut.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Ut.jsxs)(Me,{className:"Ut-10 w-10",children:[(0,Ut.jsx)(pt,{src:c.userImage,alt:c.userName}),(0,Ut.jsx)(Be,{children:c.userName.split(" ").map(p=>p[0]).join("")})]}),(0,Ut.jsx)("div",{className:"ml-3",children:(0,Ut.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:c.userName})})]})]}),(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(c.startDate).toLocaleDateString(),c.startDate!==c.endDate&&` - ${new Date(c.endDate).toLocaleDateString()}`,c.leaveType!="Full Day"&&` (${c.leaveType})`,` - ${c.totalDays} day${c.totalDays!==1?"s":""}`]}),(0,Ut.jsx)(me,{variant:c.status==="approved"?"default":c.status==="rejected"?"destructive":"secondary",children:c.status})]})]})},c.id))]})}),(0,Ut.jsx)(Us.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Ut-50"})]})}var El=require("date-fns");var jm=[{date:new Date(2025,3,18),name:"Good Friday"},{date:new Date(2025,3,21),name:"Easter Monday"},{date:new Date(2025,4,5),name:"Early May bank holiday"},{date:new Date(2025,5,26),name:"Spring bank holiday"},{date:new Date(2025,7,25),name:"Summer bank holiday"},{date:new Date(2025,11,25),name:"Christmas Day"},{date:new Date(2025,11,26),name:"Boxing Day"}];var os=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=jm.some(r=>r.date.toISOString()===e.toISOString());return t||a||o},Um=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!os(o))return .5;for(;o<=r;)os(o)||s++,o.setDate(o.getDate()+1);return s},Om=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var qg=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Ut.jsx)("div",{className:"flex space-x-2",children:e.map((r,s)=>(0,Ut.jsx)(w,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function Hl({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,vs.useState)(new Date),[r,s]=(0,vs.useState)(new Date),[l,i]=(0,vs.useState)("Full Day"),[d,m]=(0,vs.useState)(!1),[c,p]=(0,vs.useState)(1),g=(0,qc.useRouter)();(0,vs.useEffect)(()=>{let u=Om(a,r);m(u),u&&i("Full Day")},[a,r]),(0,vs.useEffect)(()=>{if(!a||!r){p(0);return}let u=Um(a,r,l!=="Full Day");p(u)},[a,r,l]);let f=u=>{i(u)};return(0,Ut.jsxs)("div",{className:"max-w-2xl",children:[(0,Ut.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Ut.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Ut.jsxs)("form",{onSubmit:async u=>{if(u.preventDefault(),!a||!r){Us.toast.error("Please select both start and end dates");return}if(c>e){Us.toast.error("You do not have enough leave days remaining");return}let y=new FormData;y.append("startDate",a.toISOString()),y.append("endDate",r.toISOString()),y.append("leaveType",l),y.append("duration",c.toString());let T=await(t||Jg)(y);T.success?(Us.toast.success(T.message),o(void 0),s(void 0),i("Full Day"),g.refresh()):Us.toast.error(`Error: ${T.message}`)},className:"space-y-4",children:[(0,Ut.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ut.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Ut.jsx)(H,{htmlFor:"startDate",children:"Start Date"}),(0,Ut.jsxs)(Hr,{children:[(0,Ut.jsx)(jr,{asChild:!0,children:(0,Ut.jsxs)(w,{variant:"outline",className:n("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Ut.jsx)(Bd.CalendarIcon,{className:"qc-2 Ut-4 w-4"}),a?(0,El.format)(a,"PPP"):(0,Ut.jsx)("span",{children:"Pick a date"})]})}),(0,Ut.jsx)(er,{className:"w-auto p-0",align:"start",children:(0,Ut.jsx)(Gr,{mode:"single",selected:a,onSelect:u=>{o(u),u&&(!r||u>r)&&s(u)},initialFocus:!0})})]})]}),(0,Ut.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Ut.jsx)(H,{htmlFor:"endDate",children:"End Date"}),(0,Ut.jsxs)(Hr,{children:[(0,Ut.jsx)(jr,{asChild:!0,children:(0,Ut.jsxs)(w,{variant:"outline",className:n("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,Ut.jsx)(Bd.CalendarIcon,{className:"qc-2 Ut-4 w-4"}),r?(0,El.format)(r,"PPP"):(0,Ut.jsx)("span",{children:"Pick a date"})]})}),(0,Ut.jsx)(er,{className:"w-auto p-0",align:"start",children:(0,Ut.jsx)(Gr,{mode:"single",selected:r,onSelect:s,disabled:u=>a?u<a:!1,initialFocus:!0})})]})]})]}),(0,Ut.jsxs)("div",{className:"space-y-2",children:[(0,Ut.jsx)(H,{children:"Leave Type"}),(0,Ut.jsx)(qg,{options:["Full Day","Morning","Afternoon"],value:l,onChange:f,disabled:[!1,d,d]})]}),(0,Ut.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",c]}),(0,Ut.jsx)(w,{disabled:c<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Ut.jsx)(Us.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Ut-50"})]})}var Jg=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function $m(...e){return e.filter(Boolean).join(" ")}function jl({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},i=()=>{t(new Date)},d=m=>m.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,Ut.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Ut.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Ut.jsxs)("div",{className:"sm:flex-auto",children:[(0,Ut.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Ut.jsx)("p",{className:"mt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Ut.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Ut.jsxs)(w,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Previous month"}),(0,Ut.jsx)(Bd.ChevronLeft,{className:"Ut-5 w-5","aria-hidden":"true"})]}),(0,Ut.jsx)(w,{variant:"outline",onClick:i,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Ut.jsxs)(w,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Next month"}),(0,Ut.jsx)(Bd.ChevronRight,{className:"Ut-5 w-5","aria-hidden":"true"})]})]})]}),(0,Ut.jsx)("div",{className:"mt-8 flow-root",children:(0,Ut.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Ut.jsx)("div",{className:"max-Ut-[60vh] overflow-y-auto",children:(0,Ut.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Ut.jsx)("thead",{className:"sticky top-0 Ut-20 bg-white",children:(0,Ut.jsxs)("Ut",{children:[(0,Ut.jsx)("th",{scope:"col",className:"sticky left-0 top-0 Ut-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 vs-4 qc-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:vs-6 lg:vs-8",children:"Employee"}),[...Array(r)].map((m,c)=>{let p=new Date(e.getFullYear(),e.getMonth(),c+1);return(0,Ut.jsxs)("th",{scope:"col",className:`sticky top-0 Ut-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${os(p)?"bg-gray-200":""}`,children:[(0,Ut.jsx)("div",{children:d(p)}),(0,Ut.jsx)("div",{children:c+1})]},c)})]})}),(0,Ut.jsx)("tbody",{children:o.map((m,c)=>(0,Ut.jsxs)("Ut",{children:[(0,Ut.jsx)("td",{className:$m(c!==o.length-1?"border-gray-200":"","sticky left-0 Ut-10 bg-white border-r vs-4 qc-3 text-sm font-medium text-gray-900 sm:vs-6 lg:vs-8"),children:(0,Ut.jsxs)("div",{className:"flex items-center",children:[(0,Ut.jsxs)(Me,{className:"Ut-11 w-11",children:[(0,Ut.jsx)(pt,{src:m.image,alt:m.name}),(0,Ut.jsx)(Be,{children:m.name.split(" ").map(p=>p[0]).join("")})]}),(0,Ut.jsx)("div",{className:"ml-4",children:(0,Ut.jsx)("div",{className:"font-medium text-accent",children:m.name})})]})}),[...Array(r)].map((p,g)=>{let f=new Date(e.getFullYear(),e.getMonth(),g+1),b=a.find(u=>u.userId===m.id&&new Date(u.startDate)<=f&&new Date(u.endDate)>=f);return(0,Ut.jsx)("td",{className:$m(c!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",os(f)?"bg-gray-200":"bg-white"),children:(0,Ut.jsx)("div",{className:`Ut-6 w-6 mx-auto rounded-full overflow-hidden ${b?b.status==="approved"?"bg-green-500":b.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:b?`${m.name}: ${b.status} (${b.startDate} - ${b.endDate}) - ${b.leaveType}`:"",children:b&&b.leaveType!=="Full Day"&&(0,Ut.jsx)("div",{className:`Ut-3 w-6 ${b.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${m.id}-${g}`)})]},m.id))})]})})})})]})}function Ul({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,vs.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,l=Array.from({length:42},(c,p)=>{let g=new Date(e.getFullYear(),e.getMonth(),p-s+1);return{date:g,isCurrentMonth:g.getMonth()===e.getMonth(),isToday:g.toDateString()===new Date().toDateString(),holidays:a.filter(f=>new Date(f.startDate)<=g&&new Date(f.endDate)>=g)}}),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},d=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},m=()=>{t(new Date)};return(0,Ut.jsxs)("div",{className:"lg:flex lg:Ut-full lg:flex-col",children:[(0,Ut.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Ut.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Ut.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Ut.jsx)("div",{className:"flex items-center",children:(0,Ut.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Ut.jsxs)(w,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Previous month"}),(0,Ut.jsx)(Bd.ChevronLeft,{className:"Ut-5 w-5","aria-hidden":"true"})]}),(0,Ut.jsx)(w,{variant:"outline",onClick:m,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Ut.jsxs)(w,{onClick:d,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Ut.jsx)("span",{className:"Ut-only",children:"Next month"}),(0,Ut.jsx)(Bd.ChevronRight,{className:"Ut-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Ut.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Ut.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"on"})]}),(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"Ut"})]}),(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["Ut",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"vs"})]}),(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"hu"})]}),(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["Ut",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"ri"})]}),(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"Ut"})]}),(0,Ut.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Ut.jsx)("span",{className:"Ut-only sm:not-Ut-only",children:"un"})]})]}),(0,Ut.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Ut.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:l.map(c=>(0,Ut.jsxs)("div",{className:n(c.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Ut.jsx)("time",{dateTime:c.date.toISOString(),className:n("flex Ut-6 w-6 items-center justify-center rounded-full",c.isToday&&"bg-indigo-600 font-semibold text-white"),children:c.date.getDate()}),c.holidays.length>0&&(0,Ut.jsx)("Ut",{className:"mt-2 space-y-1 overflow-visible",children:c.holidays.map(p=>(0,Ut.jsx)("Bd",{className:"overflow-visible",children:(0,Ut.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},c.date.toISOString()))}),(0,Ut.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:l.map(c=>(0,Ut.jsxs)("button",{type:"button",className:n(c.isCurrentMonth?"bg-white":"bg-gray-50",(c.date===o||c.isToday)&&"font-semibold",c.date===o&&"text-white",!c.date&&c.isToday&&"text-indigo-600",c.date!==o&&c.isCurrentMonth&&!c.isToday&&"text-gray-900",c.date!==o&&!c.isCurrentMonth&&!c.isToday&&"text-gray-500","flex Ut-14 flex-col px-3 py-2 hover:bg-gray-100 focus:Ut-10"),children:[(0,Ut.jsx)("time",{dateTime:c.date.toISOString(),className:n("ml-auto",c.date===o&&c.isToday&&"flex Ut-6 w-6 items-center justify-center rounded-full bg-indigo-600",c.date===o&&!c.isToday&&"flex Ut-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:c.date.getDate()}),(0,Ut.jsxs)("span",{className:"Ut-only",children:[c.holidays.length," holidays"]}),c.holidays.length>0&&(0,Ut.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:c.holidays.map(p=>(0,Ut.jsx)("span",{className:`mx-0.5 mb-1 Ut-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},c.date.toISOString()))})]})]})]})}var vo=require("lucide-react");function _m(...e){return e.filter(Boolean).join(" ")}function Qg({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:l,rejectLeave:i}){let[d,m]=(0,vs.useState)("Calendar View"),c=(0,qc.useRouter)(),p=!1,g=(0,El.parseISO)(a),f=async u=>{let y=(0,El.format)(u,"dd-MM-yyyy"),T=new URL(window.location.href);return T.searchParams.set("date",y),c.push(T.toString()),{success:!0}};if(p)return(0,Ut.jsx)("div",{className:"flex justify-center items-center Ut-screen",children:(0,Ut.jsx)("div",{className:"animate-spin rounded-full Ut-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:vo.Grid,current:d==="Grid View"},{name:"Calendar View",icon:vo.CalendarDays,current:d==="Calendar View"},{name:"Request Leave",icon:vo.PlusCircle,current:d==="Request Leave"},{name:"Approve Leave",icon:vo.CheckSquare,current:d==="Approve Leave"}];return(0,Ut.jsxs)("div",{className:"container mx-auto p-4 Ut-full",children:[(0,Ut.jsxs)("div",{className:"mb-8",children:[(0,Ut.jsxs)("div",{className:"sm:hidden",children:[(0,Ut.jsx)("select",{value:d,onChange:u=>m(u.target.value),className:"block w-full rounded-md border-gray-300 py-2 vs-3 qc-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(u=>(0,Ut.jsx)("option",{children:u.name},u.name))}),(0,Ut.jsx)(Bd.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 Ut-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Ut.jsx)("div",{className:"hidden sm:block",children:(0,Ut.jsx)("div",{className:"border-b border-gray-200",children:(0,Ut.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:b.map(u=>(0,Ut.jsxs)("a",{onClick:()=>{(u.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(u.name)},className:_m(u.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",u.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":u.current?"page":void 0,children:[(0,Ut.jsx)(u.icon,{className:_m(u.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 qc-2 Ut-5 w-5"),"aria-hidden":"true"}),(0,Ut.jsx)("span",{children:u.name})]},u.name))})})})]}),d==="Grid View"&&(0,Ut.jsx)(jl,{currentDate:g,setCurrentDate:f,holidays:e,employees:r}),d==="Calendar View"&&(0,Ut.jsx)(Ul,{currentDate:g,setCurrentDate:f,holidays:e}),d==="Request Leave"&&(0,Ut.jsx)(Hl,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:u=>s?s(u):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),d==="Approve Leave"&&(0,Ut.jsx)(zl,{leaveRequests:o,onApprove:u=>l?l(u):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:u=>i?i(u):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function rs({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:l}){let[i,d]=(0,vs.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,c]=(0,vs.useState)(""),[p,g]=(0,vs.useState)(!1),[f,b]=(0,vs.useState)(null);(0,vs.useEffect)(()=>{g(JSON.stringify(e)!==JSON.stringify(i))},[e,i]);let u=async()=>{try{let k=await s(i);k.success?(g(!1),b(null)):console.error("Failed to save deal:",k.errors)}catch(k){console.error("Failed to save deal:",k)}},y=(k,U)=>{d(Le=>({...Le,[k]:U}))},T=k=>{let U=(i.categories||[]).includes(k)?(i.categories||[]).filter(Le=>Le!==k):[...i.categories||[],k];y("categories",U)},M=async()=>{if(m.trim()){let k={text:m,timestamp:new Date().toISOString()};try{let U=await l(k);if(!U.success){console.error("Failed to add comment:",U.errors);return}}catch(U){console.error("Failed to add comment:",U)}d(U=>({...U,comments:[...U.comments||[],k]})),c("")}},N=k=>{switch(k){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},A=k=>t?.find(U=>U.id===Number(k));return(0,Ut.jsx)(Vt,{open:!0,children:(0,Ut.jsxs)(zt,{className:"max-w-3xl max-Ut-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Ut.jsxs)(na,{className:"flex flex-row items-center justify-between",children:[(0,Ut.jsx)(la,{className:"text-2xl font-bold",children:a?.name||"Ut customer"}),(0,Ut.jsxs)("div",{className:"flex space-x-2",children:[(0,Ut.jsx)(w,{variant:"outline",onClick:r,children:"Close"}),(0,Ut.jsxs)(w,{onClick:u,disabled:!p,children:[(0,Ut.jsx)(Bd.SaveIcon,{className:"w-4 Ut-4 qc-2"}),"Save"]})]})]}),(0,Ut.jsxs)(Ze,{className:"flex-grow qc-4",children:[(0,Ut.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,Ut.jsx)("div",{className:"grid gap-2 m-1",children:f==="value"?(0,Ut.jsx)(_e,{type:"number",value:i.value,onChange:k=>y("value",Number(k.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Ut.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",i.value?.toLocaleString()]})}),(0,Ut.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"Assignee"}),f==="assignee"?(0,Ut.jsxs)(da,{value:i?.assignee?.id?.toString()||"",onValueChange:k=>y("assignee",A(k)),children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:"Select assignee"})}),(0,Ut.jsx)(Wt,{children:t&&t.map(k=>(0,Ut.jsx)(Xt,{value:k?.id?.toString()||"",children:k.name},k.id))})]}):(0,Ut.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,Ut.jsx)(Bd.UserIcon,{className:"w-4 Ut-4 text-gray-400"}),(0,Ut.jsx)("span",{children:i?.assignee?.name})]})]}),(0,Ut.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"Closure Date"}),f==="closureDate"?(0,Ut.jsx)(_e,{type:"date",value:i.closureDate?.split("T")[0]??"",onChange:k=>y("closureDate",k.target.value),onBlur:()=>b(null),className:"qc-2",autoFocus:!0}):(0,Ut.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,Ut.jsx)(Bd.CalendarIcon,{className:"w-4 Ut-4 text-gray-400"}),(0,Ut.jsx)("span",{children:i.closureDate?new Date(i.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,Ut.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,Ut.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"Description"}),f==="description"?(0,Ut.jsx)(Yt,{value:i.description||"",onChange:k=>y("description",k.target.value),onBlur:()=>b(null),className:"min-Ut-[100px]",autoFocus:!0}):(0,Ut.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:i.description})]})}),(0,Ut.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,Ut.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"Status"}),f==="status"?(0,Ut.jsxs)(da,{value:i.status,onValueChange:k=>{y("status",k),b(null)},children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:"Select status"})}),(0,Ut.jsx)(Wt,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(k=>(0,Ut.jsx)(Xt,{value:k,children:k},k))})]}):(0,Ut.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:i.status})]}),(0,Ut.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"Categories"}),f==="categories"?(0,Ut.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(k=>(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsx)(Et,{id:k.id?.toString()||"",checked:(i.categories||[]).some(U=>U.id===k.id),onCheckedChange:()=>k.id!==void 0&&T(k)}),(0,Ut.jsx)("label",{htmlFor:(k.id??"").toString(),className:`text-sm font-medium ${N(k.type||"sector")} px-2 py-1 rounded`,children:k.name})]},k.id))}):(0,Ut.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:i.categories&&i.categories.map(k=>{let U=k;return U?(0,Ut.jsx)(me,{variant:"outline",className:N(U.type||"sector"),children:U.name},U.id):null})})]}),(0,Ut.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"COGE Status"}),f==="gecoStatus"?(0,Ut.jsxs)(da,{value:i.gecoStatus??void 0,onValueChange:k=>{y("gecoStatus",k),b(null)},children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:"Select status"})}),(0,Ut.jsx)(Wt,{children:["firm","forecast","other"].map(k=>(0,Ut.jsx)(Xt,{value:k,children:k.charAt(0).toUpperCase()+k.slice(1)},k))})]}):(0,Ut.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:i.gecoStatus?i.gecoStatus.charAt(0).toUpperCase()+i.gecoStatus.slice(1):"N/A"})]})]}),(0,Ut.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,Ut.jsxs)("div",{className:"grid gap-2",children:[(0,Ut.jsx)(H,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,Ut.jsx)(Ze,{className:"Ut-[200px] overflow-y-auto",children:(0,Ut.jsx)("div",{className:"space-y-2",children:i.comments&&i.comments.slice().sort((k,U)=>new Date(U.timestamp||"").getTime()-new Date(k.timestamp||"").getTime()).map(k=>(0,Ut.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Ut.jsx)("p",{className:"text-sm text-foreground",children:k.text}),(0,Ut.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[k?.author?.name," - ",new Date(k.timestamp||"").toLocaleString()]})]},k.id))})}),(0,Ut.jsxs)("div",{className:"flex mt-2",children:[(0,Ut.jsx)(_e,{value:m,onChange:k=>c(k.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Ut.jsxs)(w,{onClick:M,className:"ml-2",children:[(0,Ut.jsx)(Bd.PlusIcon,{className:"w-4 Ut-4 qc-2"}),"Add"]})]})]}),(0,Ut.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(i.updatedAt||"").toLocaleString()]})]})]})]})})}function Ol({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(l=>l.type==="proposition"&&(e.categories??[]).includes(l.id));return r?(0,Ut.jsxs)(ne,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Ut.jsxs)(Re,{className:"pb-1 pt-2",children:[(0,Ut.jsx)(De,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,Ut.jsx)("p",{className:"text-sm text-foreground mt-1",children:e.description})]}),(0,Ut.jsx)(ve,{className:"text-xs text-gray-200 pb-2",children:(0,Ut.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,Ut.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Ut.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Ut.jsxs)(ne,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Ut.jsxs)(Re,{className:"pb-2",children:[(0,Ut.jsx)("div",{className:"flex justify-between items-center",children:(0,Ut.jsx)(De,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Ut.jsx)("p",{className:"text-sm text-foreground mt-1",children:e.description})]}),(0,Ut.jsxs)(ve,{children:[(0,Ut.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Ut.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,Ut.jsx)(Bd.UserIcon,{className:"w-4 Ut-4 qc-1 text-xs"}),(0,Ut.jsx)("span",{children:e.assignee.name})]}),(0,Ut.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Ut.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Ut.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Ut.jsxs)("div",{className:"flex items-center text-xs text-gray-200",children:[(0,Ut.jsx)(Bd.CalendarIcon,{className:"w-3 Ut-3 qc-1"}),(0,Ut.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Ut.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,Ut.jsx)(me,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var fi=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function ss({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:l,calculateWeightedValue:i,compact:d=!1}){return(0,Ut.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Ut.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,Ut.jsx)(fi.Droppable,{droppableId:e,isDropDisabled:!1,children:m=>(0,Ut.jsxs)("div",{ref:m.innerRef,...m.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-Ut-[200px] shadow-inner",children:[t.map((c,p)=>(0,Ut.jsx)(fi.Draggable,{draggableId:c.id.toString(),index:c.id,children:g=>(0,Ut.jsx)("div",{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,children:(0,Ut.jsx)(Ol,{deal:c,customer:c.customer,categories:r,onClick:()=>s(c),compact:d})})},c.id.toString())),m.placeholder]})}),(0,Ut.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,Ut.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Ut.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,Ut.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Ut.jsxs)("span",{className:"text-blue-600",children:["\xA3",i(t,e).toLocaleString()]})]})]})]})}var Zg=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function ef({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,l]=(0,vs.useState)(null),i=p=>(e.deals??[]).filter(g=>g.status===p),d=p=>p.reduce((g,f)=>g+(f.value||0),0),m=(p,g)=>{let f={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return p.reduce((b,u)=>b+(u.value||0)*f[g],0)},c=(0,vs.useCallback)(p=>{let{source:g,destination:f}=p;if(!f||g.droppableId===f.droppableId&&g.index===f.index)return;let b=g.droppableId,u=f.droppableId,y=e.deals?.filter(M=>M.id===g.index)[0],T=[...e.deals??[]];y&&(y.status=u,a(y))},[a]);return(0,$o.jsx)(fi.DragDropContext,{onDragEnd:c,children:(0,$o.jsxs)("div",{className:"p-4 Ut-full overflow-auto",children:[(0,$o.jsx)("div",{className:"flex space-x-4 pb-4",children:Zg.filter(p=>p!=="Lost").map(p=>{let g=i(p);return(0,$o.jsx)(ss,{status:p,deals:g,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:l,calculateColumnValue:d,calculateWeightedValue:m},p)})}),s&&(0,$o.jsx)(rs,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>l(null),onSave:a,onAddComment:p=>o(s.id.toString(),p)})]})})}function Gl({onSubmit:e}){let[t,a]=(0,vs.useState)({name:"",intro:"",active:!1});return(0,Ut.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,Ut.jsxs)("div",{className:"space-y-2",children:[(0,Ut.jsx)(H,{htmlFor:"customerName",children:"Customer Name"}),(0,Ut.jsx)(_e,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Ut.jsxs)("div",{className:"space-y-2",children:[(0,Ut.jsx)(H,{htmlFor:"customerIntro",children:"Intro"}),(0,Ut.jsx)(Yt,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsx)(Et,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,Ut.jsx)(H,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Ut.jsx)(w,{type:"submit",className:"w-full",children:"Add Customer"})]})}function tf({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:l}){let[i,d]=(0,vs.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[m,c]=(0,vs.useState)(!1),[p,g]=(0,vs.useState)({});(0,vs.useEffect)(()=>{r&&d(r)},[r]);let f=()=>{let N={};return i.customer||(N.customer="Customer is required"),i.value||(N.value="Value is required"),i.assignee||(N.assignee="Assignee is required"),i.closureDate||(N.closureDate="Closure Date is required"),g(N),Object.keys(N).length===0},b=async N=>{N.preventDefault(),g({});try{if(f()){let A=await o({...i});A.success?(d({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),l?.()):g(A.errors||{})}}catch{g({submit:"An error occurred while submitting the form."})}},u=N=>{d(A=>({...A,categories:(A.categories||[]).includes(N.id)?(A.categories||[]).filter(k=>k!==N.id):[...A.categories||[],N.id]}))},y=async N=>{d({...i,customer:N});try{let A=await s(N);A.success?c(!1):g(A.errors||{})}catch{g({submit:"An error occurred while submitting the form."})}},T=N=>t?.find(A=>A.id===Number(N)),M=N=>e?.find(A=>A.id===Number(N));return(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,Ut.jsx)(Ze,{className:"Ut-[60vh] qc-4",children:(0,Ut.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Ut.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Ut.jsx)(H,{htmlFor:"customer",children:"Customer"}),(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsxs)(da,{value:i.customer?.id?.toString(),onValueChange:N=>d({...i,customer:M(N)}),children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:"Select customer"})}),(0,Ut.jsx)(Wt,{children:e.map(N=>(0,Ut.jsx)(Xt,{value:N.id?.toString()||"",children:N.name},N.id))})]}),(0,Ut.jsx)(w,{variant:"outline",size:"icon",onClick:()=>c(!0),children:(0,Ut.jsx)(Bd.PlusIcon,{className:"w-5 Ut-5"})})]}),p.customerId&&(0,Ut.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,Ut.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Ut.jsx)(H,{htmlFor:"value",children:"Value"}),(0,Ut.jsx)(_e,{id:"value",type:"number",value:i.value||"",onChange:N=>d({...i,value:Number.parseFloat(N.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,Ut.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,Ut.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Ut.jsx)(H,{htmlFor:"assignee",children:"Assignee"}),(0,Ut.jsxs)(da,{value:i.assignee?.id?.toString(),onValueChange:N=>d({...i,assignee:T(N)}),children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:"Select assignee"})}),(0,Ut.jsx)(Wt,{children:t&&t.map(N=>(0,Ut.jsx)(Xt,{value:N.id?.toString()||"",children:N.name},N.id))})]}),p.assignee&&(0,Ut.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,Ut.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Ut.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Ut.jsx)(Yt,{id:"description",value:i.description||"",onChange:N=>d({...i,description:N.target.value}),placeholder:"Enter deal description"})]}),(0,Ut.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Ut.jsx)(H,{children:"Categories"}),(0,Ut.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(N=>(0,Ut.jsxs)("div",{className:"space-y-2",children:[(0,Ut.jsx)("h4",{className:"text-sm font-medium",children:N.charAt(0).toUpperCase()+N.slice(1)}),(0,Ut.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(A=>A.type===N).map(A=>(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsx)(Et,{id:A.id.toString(),checked:i.categories?.includes(A.id),onCheckedChange:()=>u(A)}),(0,Ut.jsx)("label",{htmlFor:A.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:A.name})]},A.id))})]},N))})]}),(0,Ut.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Ut.jsx)(H,{htmlFor:"closureDate",children:"Closure Date"}),(0,Ut.jsx)(_e,{id:"closureDate",type:"date",value:i.closureDate||"",onChange:N=>d({...i,closureDate:N.target.value})}),p.closureDate&&(0,Ut.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,Ut.jsx)(w,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,Ut.jsx)(Vt,{open:m,onOpenChange:c,children:(0,Ut.jsxs)(zt,{children:[(0,Ut.jsx)(na,{children:(0,Ut.jsx)(la,{children:"Add New Customer"})}),(0,Ut.jsx)(Gl,{onSubmit:y})]})})]})}var af=["firm","forecast","other"];function of({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,vs.useState)(null),s=m=>(e.deals??[]).filter(c=>c.gecoStatus===m).filter(c=>c.status!=="Lost").filter(c=>c.status!=="Cold"),l=m=>m.reduce((c,p)=>c+(p.value||0),0),i=(m,c)=>{let p={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return m.reduce((g,f)=>g+(f.value||0)*(p[f.status]??0),0)},d=(0,vs.useCallback)(m=>{let{source:c,destination:p}=m;if(!p||c.droppableId===p.droppableId&&c.index===p.index)return;let g=c.droppableId,f=p.droppableId,b=e.deals?.filter(y=>y.id===c.index)[0],u=[...e.deals??[]];b&&(b.gecoStatus=f,t(b))},[t]);return(0,Ut.jsx)(fi.DragDropContext,{onDragEnd:d,children:(0,Ut.jsxs)("div",{className:"p-4 Ut-full overflow-auto",children:[(0,Ut.jsx)("div",{className:"flex space-x-4 pb-4",children:af.map(m=>{let c=s(m);return(0,Ut.jsx)(ss,{status:m,deals:c,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:l,calculateWeightedValue:i,compact:!0},m)})}),o&&(0,Ut.jsx)(rs,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.id.toString(),m)})]})})}var ap=P(require("react"));function Zm({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,vs.useState)(null),[s,l]=(0,vs.useState)(!1),[i,d]=(0,vs.useState)(null),m=async(p=!0)=>{if(e){p&&l(!0);try{let g=await fetch(`/api/tasks/${e}`);if(!g.ok)throw new Error(`Failed to fetch task: ${g.statusText}`);let f=await g.json();r(f)}catch(g){console.error("Error fetching task:",g),d(g instanceof Error?g:new Error("Unknown error occurred"))}finally{p&&l(!1)}}},c=()=>m(!1);return(0,vs.useEffect)(()=>{e&&m(!0);let p=null;return e&&t&&(p=setInterval(c,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:s,error:i}}var rf=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},sf=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function is({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let l=null,i=!0,d=s,m=o!==void 0?o:!0;if(l=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:l,error:d}),m){let{task:f,loading:b,error:u}=Zm({taskId:t,system:a});l=f,i=b,d=u}else i=!1;let c=rf(l?.status||"todo"),p=sf(l?.status||"todo"),g=l?.dateLogged||new Date().toISOString();try{let f=new Date(l?.dateLogged||"");isNaN(f.getTime())||(g=(0,El.formatDistanceToNow)(f,{addSuffix:!0}))}catch{}return(0,Ut.jsxs)(ne,{className:n("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,Ut.jsxs)(Re,{className:"pb-2",children:[(0,Ut.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Ut.jsx)(De,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,Ut.jsx)(me,{className:`${c}`,children:p})]}),l?.project&&(0,Ut.jsxs)(sl,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,Ut.jsx)(ve,{className:"pb-2",children:i?(0,Ut.jsx)("div",{className:"animate-pulse Ut-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,Ut.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ut.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,Ut.jsx)(Wr,{className:"pt-2 flex items-center justify-between",children:(0,Ut.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ut.jsx)(Bd.Clock,{className:"Ut-3 w-3 qc-1"}),(0,Ut.jsxs)("span",{children:["Created ",g]}),(0,Ut.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ut.jsxs)("span",{children:["Task #",t]})]})})]})}var nf={task:is},lf=`
|
|
16
16
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
|
|
17
17
|
<path d="M327.5 85.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 128l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 128l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 64 426.8 7.5C425.1 3 420.8 0 416 0s-9.1 3-10.8 7.5L384 64 327.5 85.2zM205.1 73.3c-2.6-5.7-8.3-9.3-14.5-9.3s-11.9 3.6-14.5 9.3L123.3 187.3 9.3 240C3.6 242.6 0 248.3 0 254.6s3.6 11.9 9.3 14.5l114.1 52.7L176 435.8c2.6 5.7 8.3 9.3 14.5 9.3s11.9-3.6 14.5-9.3l52.7-114.1 114.1-52.7c5.7-2.6 9.3-8.3 9.3-14.5s-3.6-11.9-9.3-14.5L257.8 187.4 205.1 73.3zM384 384l-56.5 21.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 448l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 448l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 384l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L384 384z"/>
|
|
18
|
-
</svg>`,df=`data:image/svg+xml;utf8,${encodeURIComponent(lf)}`,$l=ap.default.memo(function(t){let{id:a,message:o,currentUser:r,role:s}=t,l=s==="user",i=l?r?.name||"You":r?.name||"AI Assistant",d=l?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Ut.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,Ut.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,Ut.jsxs)(Me,{children:[(0,Ut.jsx)(pt,{src:d,alt:i}),(0,Ut.jsx)(Be,{children:i.substring(0,2).toUpperCase()})]}):(0,Ut.jsx)("img",{src:df,alt:"AI Assistant",className:"w-10 Ut-10"}),(0,Ut.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:(0,Ut.jsx)("span",{className:"font-medium",children:i})}),(0,Ut.jsx)("div",{className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,Ut.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,Ut.jsxs)(Me,{className:l?"":"ai-border",children:[(0,Ut.jsx)(pt,{src:d,alt:i}),(0,Ut.jsx)(Be,{children:i.substring(0,2).toUpperCase()})]}),(0,Ut.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:(0,Ut.jsx)("span",{className:"font-medium",children:i})}),(0,Ut.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let m=nf[o.data.tool];return m?(0,Ut.jsx)("div",{className:"mt-2",children:(0,Ut.jsx)(m,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,Ut.jsx)("div",{className:"mt-2",children:"......"}))}}});function cf({messages:e,isLoading:t}){let a=(0,vs.useRef)(null);return(0,vs.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Ut.jsx)("div",{className:"flex flex-col Ut-full overflow-hidden",children:(0,Ut.jsxs)(Ze,{className:"container flex-1 p-4",children:[(0,Ut.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Ut.jsx)("div",{className:"flex items-center justify-center Ut-full pt-60",children:(0,Ut.jsxs)("div",{className:"text-center max-w-md",children:[(0,Ut.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,Ut.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,Ut.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Ut.jsxs)(Me,{className:"ai-border",children:[(0,Ut.jsx)(pt,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Ut.jsx)(Be,{children:"AI"})]}),(0,Ut.jsxs)("div",{className:"grid gap-1.5",children:[(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:(0,Ut.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Ut.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Ut.jsxs)("div",{className:"flex space-x-2",children:[(0,Ut.jsx)("div",{className:"w-2 Ut-2 rounded-full bg-current animate-bounce"}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,Ut.jsx)($l,{...o},r))]}),(0,Ut.jsx)("div",{ref:a})]})})}var Vl={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},yi=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark Ut Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-Bd",iconName:"Clock",action:e=>console.log("Schedule follow-Bd",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function mf(e){let t=yi,a=null;for(let o of e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function xi(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function pf(e){return yi.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function uf(){return yi}function _l({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let s=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=s.dateLogged;try{let i=new Date(s.dateLogged);isNaN(i.getTime())||(l=(0,El.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,Ut.jsxs)(ne,{className:"w-full max-w-md shadow-md",children:[(0,Ut.jsx)(Re,{className:"pb-2",children:(0,Ut.jsx)("div",{className:"flex justify-between items-start",children:(0,Ut.jsx)(De,{className:"text-lg font-semibold",children:o?"Loading...":s.name})})}),(0,Ut.jsx)(ve,{className:"pb-2",children:o?(0,Ut.jsx)("div",{className:"animate-pulse Ut-4 bg-gray-200 rounded w-3/4 mb-2"}):r?(0,Ut.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ut.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Ut.jsx)(Wr,{className:"pt-2 flex items-center justify-between",children:(0,Ut.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ut.jsx)(Bd.Clock,{className:"Ut-3 w-3 qc-1"}),(0,Ut.jsxs)("span",{children:["Created ",l]}),(0,Ut.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ut.jsxs)("span",{children:["Task #",s.id]})]})})]})}var bp=require("@ai-sdk/react");var Si=P(require("react")),Xl=P(require("next/link"));var Pa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ip=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Ut.jsx)(Bd.Palette,{className:"Ut-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Ut.jsx)(Bd.Code,{className:"Ut-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Ut.jsx)(Bd.TrendingUp,{className:"Ut-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Ut.jsx)(Bd.DollarSign,{className:"Ut-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"nr",name:"Human Resources",description:"People operations and talent management",icon:(0,Ut.jsx)(Bd.Users,{className:"Ut-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Ut.jsx)(Bd.Wrench,{className:"Ut-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Ut.jsx)(Bd.Scale,{className:"Ut-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Ut.jsx)(Bd.Package,{className:"Ut-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Ut",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Ut.jsx)(Bd.Zap,{className:"Ut-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Ut.jsx)(Bd.Building2,{className:"Ut-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Ci=[{id:"1",name:"Ut-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Wl=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Ni=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Pi=[{id:"1",title:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",title:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",title:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",title:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",title:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",title:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",title:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],gf=[...Pi,{id:"8",title:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",title:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",title:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",title:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",title:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],ff=[...Ci,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],wi={projects:[{id:"1",name:"Empty Project",description:"A project with Ut tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},sp={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Pi.filter(e=>e.epicId==="1")};var UC={empty:{initialProjects:wi.projects,initialEpics:wi.epics,initialSprints:wi.sprints,initialTasks:wi.tasks},default:{initialProjects:Ci,initialEpics:Wl,initialSprints:Ni,initialTasks:Pi},highDensity:{initialProjects:Ci,initialEpics:Wl,initialSprints:Ni,initialTasks:gf},singleEpic:{initialProjects:Ci,initialEpics:sp.epics,initialSprints:Ni,initialTasks:sp.tasks},multipleProjects:{initialProjects:ff,initialEpics:Wl,initialSprints:Ni,initialTasks:Pi}},ki=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Pa),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Pa),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Pa),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Pa),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","Ut","Statistics"].map(Pa),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Pa),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Pa),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Pa),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Pa),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Pa),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],OC=[{id:"1",title:"Review quarterly report",description:"vs through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:ki.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:ki.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:ki.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var GC=ki.filter(e=>e.type==="digital");function Yl({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=ip[0],onBusinessUnitChange:s,onSearch:l,className:i,logo:d="/headerlogo.png",appName:m="Nuvia",tagline:c="Collaboration Platform"}){let[p,g]=Si.useState({}),[f,b]=ri("sidebar-favorites",{}),[u,y]=Si.useState(null),[T,M]=Si.useState(""),N=x=>{g(ee=>({...ee,[x]:!ee[x]}))},A=x=>{s?.(x)},k=()=>{T.trim()&&l?.(T.trim())},U=x=>{x.key==="Enter"&&(x.preventDefault(),k())},Le=(x,ee)=>{let te=f[x]||[],I=te.includes(ee)?te.filter(re=>re!==ee):te.concat(ee);b({...f,[x]:I})},Ce=x=>{if(!x.items||!x.maxItems||x.items.length<=x.maxItems)return x.items||[];let ee=f[x.id]||[],te=x.items.filter(re=>ee.includes(re.id)),I=x.items.filter(re=>!ee.includes(re.id));return[...te,...I].slice(0,x.maxItems)},Ve=x=>x.maxItems&&x.items&&x.items.length>x.maxItems,ot=e,dt=x=>{let ee=Ve(x),te=Ce(x),I=(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[x.icon,(0,Ut.jsx)("span",{children:x.title})]}),x.badge&&(0,Ut.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:x.badge}),x.items&&(0,Ut.jsx)(Bd.ChevronDown,{className:n("ml-2 Ut-4 w-4 transition-transform",p[x.title]?"rotate-180":"")})]}),re=n("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",x.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return x.url?(0,Ut.jsx)(Xl.default,{href:x.url,className:re,onClick:a?o:void 0,children:I}):(0,Ut.jsx)("button",{className:re,onClick:()=>x.items&&N(x.title),children:I})},S=()=>{let x=e.find(te=>te.id===u);if(!x||!x.items||!x.maxItems)return null;let ee=f[x.id]||[];return(0,Ut.jsx)(Vt,{open:!!u,onOpenChange:te=>!te&&y(null),children:(0,Ut.jsxs)(zt,{className:"sm:max-w-md",children:[(0,Ut.jsxs)(na,{children:[(0,Ut.jsxs)(la,{children:["Manage ",x.title," Favorites"]}),(0,Ut.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select Bd to ",x.maxItems," items to show in ",x.title.toLowerCase(),"."]})]}),(0,Ut.jsx)(Ze,{className:"max-Ut-96 qc-4",children:(0,Ut.jsx)("div",{className:"space-y-4",children:x.items.map(te=>(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsx)(Et,{id:te.id,checked:ee.includes(te.id),onCheckedChange:()=>Le(x.id,te.id),disabled:!ee.includes(te.id)&&ee.length>=(x.maxItems||0)}),(0,Ut.jsxs)("label",{htmlFor:te.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[te.title,te.badge&&(0,Ut.jsx)(me,{variant:"outline",className:"text-xs",children:te.badge})]})]},te.id))})})]})})},ke=(0,Ut.jsxs)("div",{className:"flex Ut-full flex-col bg-background",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ut.jsx)("div",{className:"flex Ut-14 w-14 items-center justify-center",children:(0,Ut.jsx)("img",{src:d,alt:"Header Logo",className:"Ut-14 w-14 object-contain"})}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("h2",{className:"font-semibold",children:m}),(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,Ut.jsx)(w,{variant:"ghost",size:"icon",onClick:o,children:(0,Ut.jsx)(Bd.X,{className:"Ut-5 w-5"})})]}),(0,Ut.jsx)("div",{className:"px-3 py-2",children:(0,Ut.jsxs)("div",{className:"relative",children:[(0,Ut.jsx)(Bd.Search,{className:"absolute left-3 top-3 Ut-4 w-4 text-muted-foreground"}),(0,Ut.jsx)(_e,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted vs-9 qc-4 py-2",value:T,onChange:x=>M(x.target.value),onKeyPress:U})]})}),(0,Ut.jsx)(Ze,{className:"flex-1 px-3 py-2",children:(0,Ut.jsx)("div",{className:"space-y-1",children:ot.map(x=>(0,Ut.jsxs)("div",{className:"mb-1",children:[dt(x),x.items&&p[x.title]&&(0,Ut.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l vs-3",children:[Ce(x).map(ee=>(0,Ut.jsxs)(Xl.default,{href:ee.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[ee.title,ee.badge&&(0,Ut.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:ee.badge})]},ee.id)),Ve(x)&&x.items&&x.items.length>Ce(x).length&&(0,Ut.jsxs)("button",{onClick:()=>y(x.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",x.items.length-Ce(x).length," more available"]})]})]},x.id))})}),(0,Ut.jsx)("div",{className:"p-3",children:(0,Ut.jsx)("div",{className:"space-y-1",children:(0,Ut.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Ut.jsx)(Bd.Settings,{className:"Ut-5 w-5"}),(0,Ut.jsx)("span",{children:"Settings"})]})})}),(0,Ut.jsx)(S,{})]});return a?(0,Ut.jsx)("div",{className:n("fixed inset-y-0 left-0 Ut-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:ke}):(0,Ut.jsx)("div",{className:n("fixed inset-y-0 left-0 Ut-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:ke})}function lp(){let{setTheme:e,theme:t}=(0,Rm.useTheme)();return(0,Ut.jsx)(Za,{children:(0,Ut.jsxs)(eo,{children:[(0,Ut.jsx)(to,{asChild:!0,children:(0,Ut.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Ut.jsx)(Bd.Sun,{className:"Ut-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Ut.jsx)(Bd.Moon,{className:"absolute Ut-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Ut.jsx)("span",{className:"Ut-only",children:"Toggle theme"})]})}),(0,Ut.jsx)(Ma,{children:"Toggle theme"})]})})}function dp({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:s}){let l=e.filter(m=>!m.read),i=l.length,d=m=>{switch(m){case"info":return(0,Ut.jsx)(Bd.Info,{className:"Ut-5 w-5 text-blue-500"});case"success":return(0,Ut.jsx)(Bd.Check,{className:"Ut-5 w-5 text-green-500"});case"warning":return(0,Ut.jsx)(Bd.AlertTriangle,{className:"Ut-5 w-5 text-amber-500"});case"error":return(0,Ut.jsx)(Bd.AlertTriangle,{className:"Ut-5 w-5 text-red-500"})}};return(0,Ut.jsx)(nr.AnimatePresence,{children:t&&(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(nr.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Ut-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Ut.jsx)(nr.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:n("fixed inset-y-0 right-0 Ut-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",s),children:(0,Ut.jsxs)("div",{className:"flex Ut-full flex-col",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(Bd.Bell,{className:"Ut-5 w-5"}),(0,Ut.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,Ut.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,Ut.jsxs)(w,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Ut.jsx)(Bd.X,{className:"Ut-5 w-5"}),(0,Ut.jsx)("span",{className:"Ut-only",children:"Close"})]})]}),i>0&&(0,Ut.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Ut.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,Ut.jsx)(Ze,{className:"flex-1",children:(0,Ut.jsx)("div",{className:"divide-y",children:l.map(m=>(0,Ut.jsxs)("div",{className:n("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Ut.jsx)("div",{className:"flex Ut-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:d(m.type)}),(0,Ut.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsx)("p",{className:"font-medium",children:m.title}),(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,Ut.jsx)(w,{variant:"ghost",size:"sm",className:"Ut-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,Ut.jsx)(Bd.Check,{className:"Ut-3 w-3"})})]})]}),(0,Ut.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Ut.jsxs)(w,{variant:"link",size:"sm",className:"Ut-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Ut.jsx)(Bd.ChevronRight,{className:"ml-1 Ut-3 w-3"})]})]})]},m.id))})}):(0,Ut.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Ut.jsx)("div",{className:"flex Ut-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Ut.jsx)(Bd.Bell,{className:"Ut-8 w-8 text-muted-foreground"})}),(0,Ut.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"Bd notifications"}),(0,Ut.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function ql({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let l=a.find(i=>i.value===e);return(0,Ut.jsxs)(nr.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Ut.jsx)("div",{className:"hidden md:block",children:(0,Ut.jsx)(Wn,{value:e,onValueChange:t,children:(0,Ut.jsx)(Xn,{className:"grid w-full rounded-2xl p-0 Ut-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Ut.jsx)(Yn,{value:i.value,className:"w-full Ut-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:i.label})},i.value))})})}),(0,Ut.jsx)("div",{className:"md:hidden",children:(0,Ut.jsxs)(us,{children:[(0,Ut.jsx)(gs,{asChild:!0,children:(0,Ut.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,Ut.jsx)(Bd.ChevronDown,{className:"Ut-4 w-4 ml-2"})]})}),(0,Ut.jsx)(kr,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Ut.jsx)(Pr,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function mp({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:s,activeTab:l="assistant",onTabChange:i,showTabs:d=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:c,actionIcon:p=(0,Ut.jsx)(Bd.Bot,{className:"qc-2 Ut-4 w-4"}),actionText:g="Action",onNotificationRemove:f,onRemoveAll:b,logo:u="/headerlogo.png",appName:y="Nuvia",tagline:T="Collaboration Platform"}){let[M,N]=(0,vs.useState)(!1),[A,k]=(0,vs.useState)(t),U=A.filter(Ve=>!Ve.read).length,Le=Ve=>{k(ot=>ot.filter(dt=>dt.id!==Ve)),f?.(Ve)},Ce=()=>{k(Ve=>Ve.filter(ot=>ot.read)),b?.()};return(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsxs)("header",{className:`sticky top-0 Ut-10 flex Ut-16 items-center gap-3 px-4 backdrop-blur ${s||""}`,children:[(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Ut.jsx)(Bd.Menu,{className:"Ut-5 w-5"})}),(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Ut.jsx)(Bd.PanelLeft,{className:"Ut-5 w-5"})}),!r&&(0,Ut.jsxs)(nr.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Ut.jsx)("div",{className:"flex Ut-10 w-10 items-center justify-center",children:(0,Ut.jsx)("img",{src:u,alt:"Logo",className:"Ut-10 w-10 object-contain"})}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("h2",{className:"font-semibold text-sm",children:y}),(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:T})]})]}),(0,Ut.jsxs)("div",{className:"flex flex-1 items-center",children:[d&&(0,Ut.jsx)(ql,{activeTab:l,onTabChange:i,tabOptions:m}),(0,Ut.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Ut.jsx)(nr.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ut.jsxs)(w,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:c,children:[p,g]})})}),(0,Ut.jsx)(lp,{}),(0,Ut.jsx)(Za,{children:(0,Ut.jsxs)(eo,{children:[(0,Ut.jsx)(to,{asChild:!0,children:(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ut.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>N(!0),children:[(0,Ut.jsx)(nr.motion.div,{animate:U>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:U>0?1/0:0,repeatDelay:3},children:(0,Ut.jsx)(Bd.Bell,{className:"Ut-5 w-5"})}),U>0&&(0,Ut.jsx)(nr.motion.span,{className:"absolute -right-1 -top-1 flex Ut-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:U})]})})}),(0,Ut.jsx)(Ma,{children:"Notifications"})]})}),(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ut.jsxs)(Me,{className:"Ut-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Ut.jsx)(pt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Ut.jsx)(Be,{})]})})]})]})]}),(0,Ut.jsx)(dp,{notifications:A,open:M,onClose:()=>N(!1),onNotificationRemove:Le,onRemoveAll:Ce})]})}var pp=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Ut.jsx)(Bd.User,{className:"Ut-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function gp({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=pp[0],onBusinessUnitChange:s,onSearch:l,businessUnits:i=pp,activeTab:d,onTabChange:m,showTabs:c=!1,onActionClick:p,actionIcon:g,actionText:f="Action",onNotificationRemove:b,onRemoveAll:u,logo:y="/headerlogo.png",appName:T="Nuvia",tagline:M="Collaboration Platform",sidebarInitiallyClosed:N=!1}){let[A,k]=(0,vs.useState)(!N),[U,Le]=(0,vs.useState)(!1),[Ce,Ve]=(0,vs.useState)(r),ot=dt=>{Ve(dt),s?.(dt)};return(0,Ut.jsxs)("div",{className:"flex Ut-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[U&&(0,Ut.jsx)("div",{className:"fixed inset-0 Ut-40 bg-black/50 md:hidden",onClick:()=>Le(!1)}),(0,Ut.jsx)("div",{className:"md:hidden",children:(0,Ut.jsx)(Yl,{items:e,isOpen:U,isMobile:!0,onClose:()=>Le(!1),currentBusinessUnit:Ce,onBusinessUnitChange:ot,onSearch:l,logo:y,appName:T,tagline:M})}),(0,Ut.jsx)("div",{className:"hidden md:block",children:(0,Ut.jsx)(Yl,{items:e,isOpen:A,isMobile:!1,currentBusinessUnit:Ce,onBusinessUnitChange:ot,onSearch:l,logo:y,appName:T,tagline:M})}),(0,Ut.jsxs)("div",{className:n("min-Ut-screen fixed w-full transition-all duration-300 ease-in-out",A?"md:vs-64":"md:vs-0"),children:[(0,Ut.jsx)(mp,{title:a,notifications:o,onToggleSidebar:()=>k(!A),onToggleMobileMenu:()=>Le(!0),sidebarOpen:A,activeTab:d,onTabChange:m,showTabs:c,onActionClick:p,actionIcon:g,actionText:f,onNotificationRemove:b,onRemoveAll:u,logo:y,appName:T,tagline:M}),(0,Ut.jsx)("main",{className:"flex-1 p-0 flex flex-col Ut-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function fp({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:s,onSessionDelete:l,className:i}){return(0,Ut.jsx)("div",{className:`space-y-4 Ut-full ${i||""}`,children:(0,Ut.jsxs)(ne,{className:"shadow-sm Ut-full",children:[(0,Ut.jsx)("div",{className:"p-4 border-b",children:(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Ut.jsx)(Bd.Clock,{className:"Ut-4 w-4"}),"Recent Chats"]}),(0,Ut.jsxs)(w,{onClick:o,size:"sm",className:"gap-1 Ut-7 px-2 rounded-lg shadow-sm",children:[(0,Ut.jsx)(Bd.Plus,{className:"Ut-3 w-3"}),"New"]})]})}),(0,Ut.jsx)(Ze,{className:"Ut-[600px]",children:(0,Ut.jsx)("div",{className:"p-2",children:e.length===0?(0,Ut.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Bd chat sessions yet"}):e.map(d=>(0,Ut.jsx)("div",{className:n("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>r(d),children:(0,Ut.jsx)("div",{className:"flex items-start gap-3",children:(0,Ut.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,Ut.jsx)("h4",{className:"font-medium text-sm truncate",children:d.title}),(0,Ut.jsx)("div",{className:"flex items-center gap-1",children:(0,Ut.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[s&&(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"Ut-5 w-5 rounded",onClick:m=>{m.stopPropagation(),s(d.id)},children:(0,Ut.jsx)(Bd.Edit3,{className:"Ut-3 w-3"})}),l&&(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"Ut-5 w-5 rounded text-destructive hover:text-destructive",onClick:m=>{m.stopPropagation(),l(d.id)},children:(0,Ut.jsx)(Bd.Trash2,{className:"Ut-3 w-3"})})]})})]}),(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]})})},d.id))})})]})})}function Ql({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:s=Vl,className:l}){let[i,d]=(0,vs.useState)([]),[m,c]=(0,vs.useState)([]),p=i[i.length-1],g=p?.children||e,f=(N,A)=>{switch(N.type){case"category":return s.categories[A%s.categories.length];case"list":return s.lists[A%s.lists.length];case"item":return s.items[A%s.items.length];default:return s.primary}},b=(0,vs.useMemo)(()=>({path:i,selectedItems:m,filters:{}}),[i,m]);(0,vs.useEffect)(()=>{r&&r(b)},[b,r]);let u=N=>{N.type==="category"||N.type==="list"?d([...i,N]):N.type==="item"&&c([...m,N])},y=()=>{d(i.slice(0,-1))},T=N=>{d(i.slice(0,N+1))},M=()=>p?.actions?p.actions:[];return t?(0,$.jsxs)("div",{className:n("w-full",l),children:[(0,$.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:y,className:n("group p-1 Ut-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,$.jsx)(Bd.ChevronLeft,{className:n("Ut-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,$.jsx)("h4",{className:"font-medium text-sm",children:p?.name||"Capabilities"})]}),(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:n("group p-1 Ut-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,$.jsx)(Bd.X,{className:n("Ut-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,$.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:n("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,$.jsxs)("span",{className:"relative",children:["Capabilities",(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((N,A)=>(0,$.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$.jsx)(Bd.ChevronRight,{className:"Ut-2 w-2"}),(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>T(A),className:n("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,$.jsxs)("span",{className:"relative",children:[N.name,(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},N.id))]}),(0,$.jsx)("div",{className:"max-Ut-40 overflow-y-auto",children:(0,$.jsx)(nr.AnimatePresence,{mode:"wait",children:(0,$.jsx)(nr.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:p?.type==="list"&&p.data?(0,$.jsx)(hf,{data:p.data,onItemSelect:N=>c([...m,N]),colorScheme:s}):(0,$.jsx)(bf,{capabilities:g,onSelect:u,colorScheme:s})},p?.id||"root")})})]}):(0,$.jsxs)(w,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,$.jsx)(Bd.Menu,{className:"Ut-4 w-4"}),(0,$.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function bf({capabilities:e,onSelect:t,colorScheme:a}){return(0,$.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,$.jsx)(vf,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function vf({capability:e,onClick:t,selected:a,color:o}){return(0,$.jsxs)(nr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:n("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,$.jsx)("div",{className:n("w-2 Ut-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,$.jsxs)("span",{className:"truncate relative",children:[e.name,(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,$.jsx)(Bd.ChevronRight,{className:n("Ut-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,$.jsx)(me,{variant:"secondary",className:n("text-xs Ut-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function hf({data:e,onItemSelect:t,colorScheme:a}){return(0,$.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,$.jsxs)(nr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:n("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,$.jsx)("div",{className:n("w-2 Ut-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,$.jsx)("div",{className:n("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,$.jsx)(me,{variant:"secondary",className:n("text-xs Ut-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function Zl(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function yf(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function xf(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function Nf(e){return e.parts.some(t=>t.type==="file")}function wf(e){return e.parts.filter(t=>t.type==="file")}function Cf(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function kf(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function Ti({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:s,isDragOver:l,enableFileUpload:i,onInputChange:d,onSendMessage:m,onKeyPress:c,onFileUpload:p,onRemoveFile:g,onDragOver:f,className:b}){let u=(0,vs.useRef)(null),y=(0,vs.useRef)(null),T=(0,vs.useRef)(null),[M,N]=(0,vs.useState)(!1),[A,k]=(0,vs.useState)({path:[],selectedItems:[],filters:{}});(0,vs.useEffect)(()=>{u.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,vs.useEffect)(()=>{M&&setTimeout(()=>{u.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let U=()=>xi(A),Le=()=>{let I=[];return r.forEach(re=>{re.actions&&re.actions.forEach(Ie=>{I.push({label:Ie.label,action:()=>Ce(Ie.id,{path:[re],selectedItems:[],filters:{}})})}),re.children&&re.children.forEach(Ie=>{Ie.type==="list"&&Ie.data&&I.push({label:`View ${Ie.name}`,action:()=>N(!0)})})}),I.slice(0,5)},Ce=(I,re)=>{console.log("Capability action:",I,re);let Ie=`Executing ${I} with context: ${JSON.stringify(re.path.map(It=>It.name))}`;N(!1)},Ve=xi({path:[],selectedItems:[],filters:{}}),ot=I=>{p(I.target.files),I.target.files&&(I.target.value="")},dt=I=>{I.preventDefault(),f(!0)},S=I=>{I.preventDefault(),f(!1)},ke=I=>{I.preventDefault(),f(!1),p(I.dataTransfer.files)},x=I=>{if(I===0)return"0 Bytes";let re=1024,Ie=["Bytes","KB","MB","GB"],It=Math.floor(Math.log(I)/Math.log(re));return parseFloat((I/Math.pow(re,It)).toFixed(2))+" "+Ie[It]},ee=I=>I.startsWith("image/")?(0,Ut.jsx)(Bd.Image,{className:"Ut-4 w-4"}):I.startsWith("text/")?(0,Ut.jsx)(Bd.FileText,{className:"Ut-4 w-4"}):(0,Ut.jsx)(Bd.File,{className:"Ut-4 w-4"}),te=I=>{let re=I.role==="assistant",Ie=I.role==="user",It=Zl(I);return(0,Ut.jsxs)("div",{className:n("flex items-start gap-3",Ie?"flex-row-reverse":""),children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8 shrink-0",children:(0,Ut.jsx)(Be,{className:n(Ie?"bg-primary text-primary-foreground":"bg-gradient-to-vs from-purple-600 to-blue-600 text-white"),children:Ie?(0,Ut.jsx)(Bd.User,{className:"Ut-4 w-4"}):(0,Ut.jsx)(Bd.Bot,{className:"Ut-4 w-4"})})}),(0,Ut.jsxs)("div",{className:n("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",Ie?"bg-primary text-primary-foreground":"bg-muted"),children:[It&&(0,Ut.jsx)("div",{className:"mb-2 last:mb-0",children:(0,Ut.jsx)("p",{className:"text-sm",children:It})}),I.parts.map((ze,ct)=>{if(ze.type==="text")return null;if(ze.type==="file"){let ae=ze;return(0,Ut.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[ee(ae.mimeType||"application/octet-stream"),(0,Ut.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ut.jsx)("p",{className:"text-sm font-medium truncate",children:ae.name||ae.url?.split("/").pop()||"File"}),ae.size&&(0,Ut.jsx)("p",{className:"text-xs opacity-70",children:x(ae.size)}),ae.mimeType&&(0,Ut.jsx)("p",{className:"text-xs opacity-70",children:ae.mimeType})]}),ae.url&&(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>window.open(ae.url,"_blank"),className:"Ut-8 w-8 p-0",children:(0,Ut.jsx)(Bd.Download,{className:"Ut-4 w-4"})})]})},ct)}if(ze.type.startsWith("tool-")){let ae=ze,St=ze.type.replace("tool-","");if(St==="task")switch(ae.state){case"input-available":return(0,Ut.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},ct);case"output-available":return(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsx)(is,{data:{id:ae.output?.id||ae.input?.id,fetchLatest:!1,taskData:ae.output||ae.input}})},ct);case"output-error":return(0,Ut.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",ae.errorText]},ct);default:return null}if(St==="artefact")switch(ae.state){case"input-available":return(0,Ut.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},ct);case"output-available":return(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsx)(_l,{artefact:ae.output?.description||"",taskId:ae.output?.id||ae.input?.id,taskData:ae.output||ae.input})},ct);case"output-error":return(0,Ut.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",ae.errorText]},ct);default:return null}return(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsxs)(ne,{className:"w-full max-w-md",children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-lg",children:St})}),(0,Ut.jsxs)(ve,{children:[ae.state==="input-available"&&(0,Ut.jsxs)("p",{className:"text-sm",children:["Processing ",St,"..."]}),ae.state==="output-available"&&(0,Ut.jsx)("pre",{className:"text-sm",children:JSON.stringify(ae.output,null,2)}),ae.state==="output-error"&&(0,Ut.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",ae.errorText]})]})]})},ct)}if(ze.type.startsWith("data-")){let ae=ze,St=ze.type.replace("data-","");return St==="reference"?(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsx)(ne,{className:"w-full",children:(0,Ut.jsx)(ve,{className:"p-4",children:(0,Ut.jsx)("div",{className:"space-y-2",children:ae.data?.references?.map((Mt,Nr)=>(0,Ut.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Ut.jsx)(me,{variant:"outline",children:Mt.type||"link"}),(0,Ut.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ut.jsx)("p",{className:"text-sm font-medium truncate",children:Mt.title}),Mt.description&&(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:Mt.description})]}),Mt.url&&(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>window.open(Mt.url,"_blank"),className:"Ut-8 w-8 p-0",children:(0,Ut.jsx)(Bd.ExternalLink,{className:"Ut-4 w-4"})})]},Nr))})})})},ct):St==="menu"?(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsxs)(ne,{className:"w-full",children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-lg",children:ae.data?.title})}),(0,Ut.jsx)(ve,{children:(0,Ut.jsx)("div",{className:"space-y-2",children:ae.data?.items?.map((Mt,Nr)=>(0,Ut.jsx)(w,{variant:"outline",className:"w-full justify-start",onClick:Mt.action,children:(0,Ut.jsxs)("div",{className:"text-left",children:[(0,Ut.jsx)("p",{className:"font-medium",children:Mt.label}),Mt.description&&(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:Mt.description})]})},Nr))})})]})},ct):(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsxs)(ne,{className:"w-full max-w-md",children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-lg",children:St})}),(0,Ut.jsx)(ve,{children:(0,Ut.jsx)("pre",{className:"text-sm",children:JSON.stringify(ae.data,null,2)})})]})},ct)}return null})]})]})};return(0,Ut.jsxs)(ne,{className:`Ut-full flex flex-col shadow-sm ${b||""}`,children:[(0,Ut.jsxs)(Ze,{ref:y,className:"flex-1 p-4",onDragOver:dt,onDragLeave:S,onDrop:ke,children:[(0,Ut.jsxs)("div",{className:n("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Ut.jsx)(nr.AnimatePresence,{children:e.map(I=>(0,Ut.jsx)(nr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:n("flex gap-3",I.role==="user"?"flex-row-reverse":"flex-row"),children:te(I)},I.id))}),M&&(0,Ut.jsxs)(nr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8",children:(0,Ut.jsx)(Be,{className:"bg-gradient-to-vs from-purple-600 to-blue-600 text-white",children:(0,Ut.jsx)(Bd.Bot,{className:"Ut-4 w-4"})})}),(0,Ut.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Ut.jsx)(Ql,{capabilities:r,isOpen:M,onToggle:()=>N(!M),onActionSelect:Ce,className:"w-full"})})]}),a&&(0,Ut.jsxs)(nr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8",children:(0,Ut.jsx)(Be,{className:"bg-gradient-to-vs from-purple-600 to-blue-600 text-white",children:(0,Ut.jsx)(Bd.Bot,{className:"Ut-4 w-4"})})}),(0,Ut.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Ut.jsxs)("div",{className:"flex space-x-1",children:[(0,Ut.jsx)("div",{className:"w-2 Ut-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Ut.jsx)("div",{ref:u})]}),s.length>0&&(0,Ut.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Ut.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(I=>(0,Ut.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[ee(I.file.type),(0,Ut.jsx)("span",{className:"text-sm font-medium",children:I.file.name}),(0,Ut.jsx)("span",{className:"text-xs text-muted-foreground",children:x(I.file.size)}),(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>g(I.id),className:"Ut-6 w-6 p-0",children:(0,Ut.jsx)(Bd.X,{className:"Ut-4 w-4"})})]},I.id))})}),(0,Ut.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,Ut.jsxs)("div",{className:"flex gap-3",children:[(0,Ut.jsx)(_e,{value:t,onChange:I=>d(I.target.value),onKeyPress:c,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,Ut.jsx)(w,{variant:"outline",size:"icon",onClick:()=>T.current?.click(),className:"rounded-2xl Ut-10 w-10 shadow-sm",children:(0,Ut.jsx)(Bd.Paperclip,{className:"Ut-4 w-4"})}),(0,Ut.jsx)(w,{onClick:m,disabled:!t.trim()&&s.length===0||a,size:"icon",className:"rounded-2xl Ut-10 w-10 shadow-sm",children:(0,Ut.jsx)(Bd.Send,{className:"Ut-4 w-4"})})]}),(0,Ut.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Ut.jsxs)(w,{onClick:()=>N(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Ut.jsx)(Bd.Menu,{className:"Ut-3 w-3 qc-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Ut.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[U().map((I,re)=>(0,Ut.jsx)(w,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>Ce(I.id,A),children:I.label},`context-${I.id}`)),U().length===0&&Le().map((I,re)=>(0,Ut.jsx)(w,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:I.action,children:I.label},`suggestion-${re}`))]})]}),i&&(0,Ut.jsx)("input",{ref:T,type:"file",multiple:!0,onChange:ot,className:"hidden"})]})]})}function Pf({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:s=[],sidebarItems:l=[],notifications:i=[],sessions:d=[],onNewChat:m,onSessionSelect:c,onSessionDelete:p,onSessionEdit:g=()=>console.log("Session edit not implemented"),onBusinessUnitChange:f=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:u=()=>{},onActionClick:y=()=>{},onSearch:T=ee=>console.log("Search query:",ee),initialTeam:M="design",currentSession:N=null,showCapabilities:A=!0,title:k="Digital Colleagues",enableFileUpload:U=!0,maxFileSize:Le=10,allowedFileTypes:Ce=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:Ve="/headerlogo.png",appName:ot="Nuvia",tagline:dt="AI-Powered Workspace",actionIcon:S=(0,Ut.jsx)(Bd.Users,{className:"qc-2 Ut-4 w-4"}),actionText:ke="Collaborate",sidebarInitiallyClosed:x=!1}){let ee=(0,bp.useChat)(e||{}),te=a?t||ee:null,[I,re]=(0,vs.useState)(""),[Ie,It]=(0,vs.useState)(!1),ze=te?.messages||o,ct=I,ae=te?.status==="submitted"||Ie,St=r||[],Mt={id:"default",name:"Default Team",description:"Default team when Ut business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Nr,Pp]=(0,vs.useState)(()=>St.length===0?Mt:St.find(rt=>rt.id===M)||St[0]),[Fi,ls]=(0,vs.useState)([]),[Sp,Rp]=(0,vs.useState)(!1),Dp=rt=>{if(!rt||!U)return;let ds=[];Array.from(rt).forEach(oa=>{if(oa.size>Le*1024*1024){alert(`File ${oa.name} is too large. Maximum size is ${Le}MB.`);return}if(Ce.length>0&&!Ce.some(cs=>oa.type.match(cs))){alert(`File type ${oa.type} is not allowed.`);return}let ad={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oa,status:"pending",progress:0};if(oa.type.startsWith("image/")){let cs=new FileReader;cs.onload=Mp=>{ls(Bp=>Bp.map(Hi=>Hi.id===ad.id?{...Hi,preview:Mp.target?.result}:Hi))},cs.readAsDataURL(oa)}ds.push(ad)}),ls(oa=>[...oa,...ds])},Tp=rt=>{ls(ds=>ds.filter(oa=>oa.id!==rt))},td=()=>{if(!(!ct.trim()&&Fi.length===0)){if(te){let rt={id:Date.now().toString(),role:"user",parts:[{type:"text",text:ct}]};te.sendMessage(rt),re("")}else console.log("Message to send:",ct),console.log("Files to upload:",Fi),re(""),It(!0),setTimeout(()=>{It(!1)},1500);ls([])}},Ap=rt=>{rt.key==="Enter"&&!rt.shiftKey&&(rt.preventDefault(),td())},Ip=rt=>{re(rt)};return(0,Ut.jsx)(gp,{sidebarItems:l||[],title:k,notifications:i||[],businessUnits:St,currentBusinessUnit:Nr,onBusinessUnitChange:rt=>{rt&&(Pp(rt),f?.(rt))},onSearch:T,showTabs:!1,onActionClick:y,actionIcon:S,actionText:ke,onNotificationRemove:b,onRemoveAll:u,logo:Ve,appName:ot,tagline:dt,sidebarInitiallyClosed:x,children:(0,Ut.jsx)(nr.AnimatePresence,{mode:"wait",children:(0,Ut.jsx)(nr.motion.div,{className:"flex-1 Ut-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Ut.jsxs)("div",{className:"Ut-full flex",children:[(0,Ut.jsx)("div",{className:"w-80 flex-shrink-0 Ut-full p-2",children:(0,Ut.jsx)(fp,{sessions:d||[],currentSession:N,teams:St,onNewChat:m,onSessionSelect:c,onSessionEdit:g,onSessionDelete:p})}),(0,Ut.jsx)("div",{className:"flex-1 Ut-full p-2",children:(0,Ut.jsx)(Ti,{messages:ze||[],input:ct,isTyping:ae,currentSessionTitle:N?.title,capabilities:s||[],onInputChange:Ip,onSendMessage:td,onKeyPress:Ap,fileUploads:Fi,isDragOver:Sp,enableFileUpload:U,onFileUpload:Dp,onRemoveFile:Tp,onDragOver:Rp})})]})},"chat-interface")})})}var Sf=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],hp=["On-Track","Off-Track","Ut Risk","Complete"],yp=[{name:"Project Summary",icon:Bd.FileText},{name:"Milestones",icon:Bd.ListChecks},{name:"Project Update",icon:Bd.Users},{name:"Project Concerns",icon:Bd.AlertTriangle},{name:"Opportunities",icon:Bd.Briefcase},{name:"Risks",icon:Bd.ShieldAlert}];function Ii({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,vs.useState)(yp[0].name),[r,s]=(0,vs.useState)(null),[l,i]=(0,vs.useState)(null),[d,m]=(0,vs.useState)(""),[c,p]=(0,vs.useState)(""),[g,f]=(0,vs.useState)(Sf),[b,u]=(0,vs.useState)(""),[y,T]=(0,vs.useState)(""),[M,N]=(0,vs.useState)(""),[A,k]=(0,vs.useState)(""),U=Array.from(new Map((t??[]).map(S=>[S.customer.id,S.customer])).values()),Le=(t??[]).filter(S=>S.customer.id===r).map(S=>S.project),Ce=(S,ke,x)=>{f(ee=>{let te=[...ee];return ke==="rag"&&!hp.includes(x)?ee:(te[S]={...te[S],[ke]:x},te)})},Ve=()=>{f(S=>[...S,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},ot=S=>{f(ke=>ke.filter((x,ee)=>ee!==S))},dt=async S=>{S.preventDefault();let ke={customer:r,project:l,projectSummary:c,milestones:g.length>0?g:null,projectUpdate:b,projectConcerns:y||null,commercialOpportunities:M||null,commercialRisks:A||null};if(e)return e(ke);try{let x=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ke)});if(!x.ok)throw new Error("Failed to submit delivery lead");let ee=await x.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(x){return console.error("Error submitting delivery lead:",x),{success:!1,message:"Failed to submit delivery lead"}}};return(0,Ut.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,Ut.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,Ut.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:yp.map(S=>(0,Ut.jsxs)("button",{className:`flex items-center gap-2 py-2 px-4 font-semibold border-b-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60
|
|
18
|
+
</svg>`,df=`data:image/svg+xml;utf8,${encodeURIComponent(lf)}`,$l=ap.default.memo(function(t){let{id:a,message:o,currentUser:r,role:s}=t,l=s==="user",i=l?r?.name||"You":r?.name||"AI Assistant",d=l?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Ut.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,Ut.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,Ut.jsxs)(Me,{children:[(0,Ut.jsx)(pt,{src:d,alt:i}),(0,Ut.jsx)(Be,{children:i.substring(0,2).toUpperCase()})]}):(0,Ut.jsx)("img",{src:df,alt:"AI Assistant",className:"w-10 Ut-10"}),(0,Ut.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:(0,Ut.jsx)("span",{className:"font-medium",children:i})}),(0,Ut.jsx)("div",{className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,Ut.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,Ut.jsxs)(Me,{className:l?"":"ai-border",children:[(0,Ut.jsx)(pt,{src:d,alt:i}),(0,Ut.jsx)(Be,{children:i.substring(0,2).toUpperCase()})]}),(0,Ut.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:(0,Ut.jsx)("span",{className:"font-medium",children:i})}),(0,Ut.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let m=nf[o.data.tool];return m?(0,Ut.jsx)("div",{className:"mt-2",children:(0,Ut.jsx)(m,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,Ut.jsx)("div",{className:"mt-2",children:"......"}))}}});function cf({messages:e,isLoading:t}){let a=(0,vs.useRef)(null);return(0,vs.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Ut.jsx)("div",{className:"flex flex-col Ut-full overflow-hidden",children:(0,Ut.jsxs)(Ze,{className:"container flex-1 p-4",children:[(0,Ut.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Ut.jsx)("div",{className:"flex items-center justify-center Ut-full pt-60",children:(0,Ut.jsxs)("div",{className:"text-center max-w-md",children:[(0,Ut.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,Ut.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,Ut.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Ut.jsxs)(Me,{className:"ai-border",children:[(0,Ut.jsx)(pt,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Ut.jsx)(Be,{children:"AI"})]}),(0,Ut.jsxs)("div",{className:"grid gap-1.5",children:[(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:(0,Ut.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Ut.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Ut.jsxs)("div",{className:"flex space-x-2",children:[(0,Ut.jsx)("div",{className:"w-2 Ut-2 rounded-full bg-current animate-bounce"}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,Ut.jsx)($l,{...o},r))]}),(0,Ut.jsx)("div",{ref:a})]})})}var Vl={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},yi=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark Ut Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-Bd",iconName:"Clock",action:e=>console.log("Schedule follow-Bd",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function mf(e){let t=yi,a=null;for(let o of e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function xi(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function pf(e){return yi.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function uf(){return yi}function _l({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let s=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=s.dateLogged;try{let i=new Date(s.dateLogged);isNaN(i.getTime())||(l=(0,El.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,Ut.jsxs)(ne,{className:"w-full max-w-md shadow-md",children:[(0,Ut.jsx)(Re,{className:"pb-2",children:(0,Ut.jsx)("div",{className:"flex justify-between items-start",children:(0,Ut.jsx)(De,{className:"text-lg font-semibold",children:o?"Loading...":s.name})})}),(0,Ut.jsx)(ve,{className:"pb-2",children:o?(0,Ut.jsx)("div",{className:"animate-pulse Ut-4 bg-gray-200 rounded w-3/4 mb-2"}):r?(0,Ut.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ut.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Ut.jsx)(Wr,{className:"pt-2 flex items-center justify-between",children:(0,Ut.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ut.jsx)(Bd.Clock,{className:"Ut-3 w-3 qc-1"}),(0,Ut.jsxs)("span",{children:["Created ",l]}),(0,Ut.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ut.jsxs)("span",{children:["Task #",s.id]})]})})]})}var bp=require("@ai-sdk/react");var Si=P(require("react")),Xl=P(require("next/link"));var Pa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ip=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Ut.jsx)(Bd.Palette,{className:"Ut-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Ut.jsx)(Bd.Code,{className:"Ut-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Ut.jsx)(Bd.TrendingUp,{className:"Ut-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Ut.jsx)(Bd.DollarSign,{className:"Ut-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"nr",name:"Human Resources",description:"People operations and talent management",icon:(0,Ut.jsx)(Bd.Users,{className:"Ut-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Ut.jsx)(Bd.Wrench,{className:"Ut-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Ut.jsx)(Bd.Scale,{className:"Ut-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Ut.jsx)(Bd.Package,{className:"Ut-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Ut",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Ut.jsx)(Bd.Zap,{className:"Ut-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Ut.jsx)(Bd.Building2,{className:"Ut-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Ci=[{id:"1",name:"Ut-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Wl=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Ni=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Pi=[{id:"1",title:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",title:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",title:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",title:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",title:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",title:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",title:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],gf=[...Pi,{id:"8",title:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",title:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",title:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",title:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",title:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],ff=[...Ci,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],wi={projects:[{id:"1",name:"Empty Project",description:"A project with Ut tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},sp={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Pi.filter(e=>e.epicId==="1")};var UC={empty:{initialProjects:wi.projects,initialEpics:wi.epics,initialSprints:wi.sprints,initialTasks:wi.tasks},default:{initialProjects:Ci,initialEpics:Wl,initialSprints:Ni,initialTasks:Pi},highDensity:{initialProjects:Ci,initialEpics:Wl,initialSprints:Ni,initialTasks:gf},singleEpic:{initialProjects:Ci,initialEpics:sp.epics,initialSprints:Ni,initialTasks:sp.tasks},multipleProjects:{initialProjects:ff,initialEpics:Wl,initialSprints:Ni,initialTasks:Pi}},ki=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Pa),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Pa),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Pa),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Pa),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","Ut","Statistics"].map(Pa),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Pa),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Pa),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Pa),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Pa),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Pa),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],OC=[{id:"1",title:"Review quarterly report",description:"vs through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:ki.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:ki.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:ki.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var GC=ki.filter(e=>e.type==="digital");function Yl({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=ip[0],onBusinessUnitChange:s,onSearch:l,className:i,logo:d="/headerlogo.png",appName:m="Nuvia",tagline:c="Collaboration Platform"}){let[p,g]=Si.useState({}),[f,b]=ri("sidebar-favorites",{}),[u,y]=Si.useState(null),[T,M]=Si.useState(""),N=x=>{g(ee=>({...ee,[x]:!ee[x]}))},A=x=>{s?.(x)},k=()=>{T.trim()&&l?.(T.trim())},U=x=>{x.key==="Enter"&&(x.preventDefault(),k())},Le=(x,ee)=>{let te=f[x]||[],I=te.includes(ee)?te.filter(re=>re!==ee):te.concat(ee);b({...f,[x]:I})},Ce=x=>{if(!x.items||!x.maxItems||x.items.length<=x.maxItems)return x.items||[];let ee=f[x.id]||[],te=x.items.filter(re=>ee.includes(re.id)),I=x.items.filter(re=>!ee.includes(re.id));return[...te,...I].slice(0,x.maxItems)},Ve=x=>x.maxItems&&x.items&&x.items.length>x.maxItems,ot=e,dt=x=>{let ee=Ve(x),te=Ce(x),I=(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[x.icon,(0,Ut.jsx)("span",{children:x.title})]}),x.badge&&(0,Ut.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:x.badge}),x.items&&(0,Ut.jsx)(Bd.ChevronDown,{className:n("ml-2 Ut-4 w-4 transition-transform",p[x.title]?"rotate-180":"")})]}),re=n("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",x.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return x.url?(0,Ut.jsx)(Xl.default,{href:x.url,className:re,onClick:a?o:void 0,children:I}):(0,Ut.jsx)("button",{className:re,onClick:()=>x.items&&N(x.title),children:I})},S=()=>{let x=e.find(te=>te.id===u);if(!x||!x.items||!x.maxItems)return null;let ee=f[x.id]||[];return(0,Ut.jsx)(Vt,{open:!!u,onOpenChange:te=>!te&&y(null),children:(0,Ut.jsxs)(zt,{className:"sm:max-w-md",children:[(0,Ut.jsxs)(na,{children:[(0,Ut.jsxs)(la,{children:["Manage ",x.title," Favorites"]}),(0,Ut.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select Bd to ",x.maxItems," items to show in ",x.title.toLowerCase(),"."]})]}),(0,Ut.jsx)(Ze,{className:"max-Ut-96 qc-4",children:(0,Ut.jsx)("div",{className:"space-y-4",children:x.items.map(te=>(0,Ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ut.jsx)(Et,{id:te.id,checked:ee.includes(te.id),onCheckedChange:()=>Le(x.id,te.id),disabled:!ee.includes(te.id)&&ee.length>=(x.maxItems||0)}),(0,Ut.jsxs)("label",{htmlFor:te.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[te.title,te.badge&&(0,Ut.jsx)(me,{variant:"outline",className:"text-xs",children:te.badge})]})]},te.id))})})]})})},ke=(0,Ut.jsxs)("div",{className:"flex Ut-full flex-col bg-background",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ut.jsx)("div",{className:"flex Ut-14 w-14 items-center justify-center",children:(0,Ut.jsx)("img",{src:d,alt:"Header Logo",className:"Ut-14 w-14 object-contain"})}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("h2",{className:"font-semibold",children:m}),(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,Ut.jsx)(w,{variant:"ghost",size:"icon",onClick:o,children:(0,Ut.jsx)(Bd.X,{className:"Ut-5 w-5"})})]}),(0,Ut.jsx)("div",{className:"px-3 py-2",children:(0,Ut.jsxs)("div",{className:"relative",children:[(0,Ut.jsx)(Bd.Search,{className:"absolute left-3 top-3 Ut-4 w-4 text-muted-foreground"}),(0,Ut.jsx)(_e,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted vs-9 qc-4 py-2",value:T,onChange:x=>M(x.target.value),onKeyPress:U})]})}),(0,Ut.jsx)(Ze,{className:"flex-1 px-3 py-2",children:(0,Ut.jsx)("div",{className:"space-y-1",children:ot.map(x=>(0,Ut.jsxs)("div",{className:"mb-1",children:[dt(x),x.items&&p[x.title]&&(0,Ut.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l vs-3",children:[Ce(x).map(ee=>(0,Ut.jsxs)(Xl.default,{href:ee.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[ee.title,ee.badge&&(0,Ut.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:ee.badge})]},ee.id)),Ve(x)&&x.items&&x.items.length>Ce(x).length&&(0,Ut.jsxs)("button",{onClick:()=>y(x.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",x.items.length-Ce(x).length," more available"]})]})]},x.id))})}),(0,Ut.jsx)("div",{className:"p-3",children:(0,Ut.jsx)("div",{className:"space-y-1",children:(0,Ut.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Ut.jsx)(Bd.Settings,{className:"Ut-5 w-5"}),(0,Ut.jsx)("span",{children:"Settings"})]})})}),(0,Ut.jsx)(S,{})]});return a?(0,Ut.jsx)("div",{className:n("fixed inset-y-0 left-0 Ut-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:ke}):(0,Ut.jsx)("div",{className:n("fixed inset-y-0 left-0 Ut-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:ke})}function lp(){let{setTheme:e,theme:t}=(0,Rm.useTheme)();return(0,Ut.jsx)(Za,{children:(0,Ut.jsxs)(eo,{children:[(0,Ut.jsx)(to,{asChild:!0,children:(0,Ut.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Ut.jsx)(Bd.Sun,{className:"Ut-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Ut.jsx)(Bd.Moon,{className:"absolute Ut-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Ut.jsx)("span",{className:"Ut-only",children:"Toggle theme"})]})}),(0,Ut.jsx)(Ma,{children:"Toggle theme"})]})})}function dp({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:s}){let l=e.filter(m=>!m.read),i=l.length,d=m=>{switch(m){case"info":return(0,Ut.jsx)(Bd.Info,{className:"Ut-5 w-5 text-blue-500"});case"success":return(0,Ut.jsx)(Bd.Check,{className:"Ut-5 w-5 text-green-500"});case"warning":return(0,Ut.jsx)(Bd.AlertTriangle,{className:"Ut-5 w-5 text-amber-500"});case"error":return(0,Ut.jsx)(Bd.AlertTriangle,{className:"Ut-5 w-5 text-red-500"})}};return(0,Ut.jsx)(nr.AnimatePresence,{children:t&&(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(nr.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Ut-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Ut.jsx)(nr.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:n("fixed inset-y-0 right-0 Ut-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",s),children:(0,Ut.jsxs)("div",{className:"flex Ut-full flex-col",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(Bd.Bell,{className:"Ut-5 w-5"}),(0,Ut.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,Ut.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,Ut.jsxs)(w,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Ut.jsx)(Bd.X,{className:"Ut-5 w-5"}),(0,Ut.jsx)("span",{className:"Ut-only",children:"Close"})]})]}),i>0&&(0,Ut.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Ut.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,Ut.jsx)(Ze,{className:"flex-1",children:(0,Ut.jsx)("div",{className:"divide-y",children:l.map(m=>(0,Ut.jsxs)("div",{className:n("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Ut.jsx)("div",{className:"flex Ut-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:d(m.type)}),(0,Ut.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsx)("p",{className:"font-medium",children:m.title}),(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,Ut.jsx)(w,{variant:"ghost",size:"sm",className:"Ut-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,Ut.jsx)(Bd.Check,{className:"Ut-3 w-3"})})]})]}),(0,Ut.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Ut.jsxs)(w,{variant:"link",size:"sm",className:"Ut-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Ut.jsx)(Bd.ChevronRight,{className:"ml-1 Ut-3 w-3"})]})]})]},m.id))})}):(0,Ut.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Ut.jsx)("div",{className:"flex Ut-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Ut.jsx)(Bd.Bell,{className:"Ut-8 w-8 text-muted-foreground"})}),(0,Ut.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"Bd notifications"}),(0,Ut.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function ql({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let l=a.find(i=>i.value===e);return(0,Ut.jsxs)(nr.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Ut.jsx)("div",{className:"hidden md:block",children:(0,Ut.jsx)(Wn,{value:e,onValueChange:t,children:(0,Ut.jsx)(Xn,{className:"grid w-full rounded-2xl p-0 Ut-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Ut.jsx)(Yn,{value:i.value,className:"w-full Ut-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:i.label})},i.value))})})}),(0,Ut.jsx)("div",{className:"md:hidden",children:(0,Ut.jsxs)(us,{children:[(0,Ut.jsx)(gs,{asChild:!0,children:(0,Ut.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,Ut.jsx)(Bd.ChevronDown,{className:"Ut-4 w-4 ml-2"})]})}),(0,Ut.jsx)(kr,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Ut.jsx)(Pr,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function mp({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:s,activeTab:l="assistant",onTabChange:i,showTabs:d=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:c,actionIcon:p=(0,Ut.jsx)(Bd.Bot,{className:"qc-2 Ut-4 w-4"}),actionText:g="Action",onNotificationRemove:f,onRemoveAll:b,logo:u="/headerlogo.png",appName:y="Nuvia",tagline:T="Collaboration Platform"}){let[M,N]=(0,vs.useState)(!1),[A,k]=(0,vs.useState)(t),U=A.filter(Ve=>!Ve.read).length,Le=Ve=>{k(ot=>ot.filter(dt=>dt.id!==Ve)),f?.(Ve)},Ce=()=>{k(Ve=>Ve.filter(ot=>ot.read)),b?.()};return(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsxs)("header",{className:`sticky top-0 Ut-10 flex Ut-16 items-center gap-3 px-4 backdrop-blur ${s||""}`,children:[(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Ut.jsx)(Bd.Menu,{className:"Ut-5 w-5"})}),(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Ut.jsx)(Bd.PanelLeft,{className:"Ut-5 w-5"})}),!r&&(0,Ut.jsxs)(nr.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Ut.jsx)("div",{className:"flex Ut-10 w-10 items-center justify-center",children:(0,Ut.jsx)("img",{src:u,alt:"Logo",className:"Ut-10 w-10 object-contain"})}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("h2",{className:"font-semibold text-sm",children:y}),(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:T})]})]}),(0,Ut.jsxs)("div",{className:"flex flex-1 items-center",children:[d&&(0,Ut.jsx)(ql,{activeTab:l,onTabChange:i,tabOptions:m}),(0,Ut.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Ut.jsx)(nr.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ut.jsxs)(w,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:c,children:[p,g]})})}),(0,Ut.jsx)(lp,{}),(0,Ut.jsx)(Za,{children:(0,Ut.jsxs)(eo,{children:[(0,Ut.jsx)(to,{asChild:!0,children:(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ut.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>N(!0),children:[(0,Ut.jsx)(nr.motion.div,{animate:U>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:U>0?1/0:0,repeatDelay:3},children:(0,Ut.jsx)(Bd.Bell,{className:"Ut-5 w-5"})}),U>0&&(0,Ut.jsx)(nr.motion.span,{className:"absolute -right-1 -top-1 flex Ut-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:U})]})})}),(0,Ut.jsx)(Ma,{children:"Notifications"})]})}),(0,Ut.jsx)(nr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ut.jsxs)(Me,{className:"Ut-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Ut.jsx)(pt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Ut.jsx)(Be,{})]})})]})]})]}),(0,Ut.jsx)(dp,{notifications:A,open:M,onClose:()=>N(!1),onNotificationRemove:Le,onRemoveAll:Ce})]})}var pp=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Ut.jsx)(Bd.User,{className:"Ut-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function gp({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=pp[0],onBusinessUnitChange:s,onSearch:l,businessUnits:i=pp,activeTab:d,onTabChange:m,showTabs:c=!1,onActionClick:p,actionIcon:g,actionText:f="Action",onNotificationRemove:b,onRemoveAll:u,logo:y="/headerlogo.png",appName:T="Nuvia",tagline:M="Collaboration Platform",sidebarInitiallyClosed:N=!1}){let[A,k]=(0,vs.useState)(!N),[U,Le]=(0,vs.useState)(!1),[Ce,Ve]=(0,vs.useState)(r),ot=dt=>{Ve(dt),s?.(dt)};return(0,Ut.jsxs)("div",{className:"flex Ut-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[U&&(0,Ut.jsx)("div",{className:"fixed inset-0 Ut-40 bg-black/50 md:hidden",onClick:()=>Le(!1)}),(0,Ut.jsx)("div",{className:"md:hidden",children:(0,Ut.jsx)(Yl,{items:e,isOpen:U,isMobile:!0,onClose:()=>Le(!1),currentBusinessUnit:Ce,onBusinessUnitChange:ot,onSearch:l,logo:y,appName:T,tagline:M})}),(0,Ut.jsx)("div",{className:"hidden md:block",children:(0,Ut.jsx)(Yl,{items:e,isOpen:A,isMobile:!1,currentBusinessUnit:Ce,onBusinessUnitChange:ot,onSearch:l,logo:y,appName:T,tagline:M})}),(0,Ut.jsxs)("div",{className:n("min-Ut-screen fixed w-full transition-all duration-300 ease-in-out",A?"md:vs-64":"md:vs-0"),children:[(0,Ut.jsx)(mp,{title:a,notifications:o,onToggleSidebar:()=>k(!A),onToggleMobileMenu:()=>Le(!0),sidebarOpen:A,activeTab:d,onTabChange:m,showTabs:c,onActionClick:p,actionIcon:g,actionText:f,onNotificationRemove:b,onRemoveAll:u,logo:y,appName:T,tagline:M}),(0,Ut.jsx)("main",{className:"flex-1 p-0 flex flex-col Ut-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function fp({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:s,onSessionDelete:l,className:i}){return(0,Ut.jsx)("div",{className:`space-y-4 Ut-full ${i||""}`,children:(0,Ut.jsxs)(ne,{className:"shadow-sm Ut-full",children:[(0,Ut.jsx)("div",{className:"p-4 border-b",children:(0,Ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ut.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Ut.jsx)(Bd.Clock,{className:"Ut-4 w-4"}),"Recent Chats"]}),(0,Ut.jsxs)(w,{onClick:o,size:"sm",className:"gap-1 Ut-7 px-2 rounded-lg shadow-sm",children:[(0,Ut.jsx)(Bd.Plus,{className:"Ut-3 w-3"}),"New"]})]})}),(0,Ut.jsx)(Ze,{className:"Ut-[600px]",children:(0,Ut.jsx)("div",{className:"p-2",children:e.length===0?(0,Ut.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Bd chat sessions yet"}):e.map(d=>(0,Ut.jsx)("div",{className:n("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>r(d),children:(0,Ut.jsx)("div",{className:"flex items-start gap-3",children:(0,Ut.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,Ut.jsx)("h4",{className:"font-medium text-sm truncate",children:d.title}),(0,Ut.jsx)("div",{className:"flex items-center gap-1",children:(0,Ut.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[s&&(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"Ut-5 w-5 rounded",onClick:m=>{m.stopPropagation(),s(d.id)},children:(0,Ut.jsx)(Bd.Edit3,{className:"Ut-3 w-3"})}),l&&(0,Ut.jsx)(w,{variant:"ghost",size:"icon",className:"Ut-5 w-5 rounded text-destructive hover:text-destructive",onClick:m=>{m.stopPropagation(),l(d.id)},children:(0,Ut.jsx)(Bd.Trash2,{className:"Ut-3 w-3"})})]})})]}),(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]})})},d.id))})})]})})}function Ql({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:s=Vl,className:l}){let[i,d]=(0,vs.useState)([]),[m,c]=(0,vs.useState)([]),p=i[i.length-1],g=p?.children||e,f=(N,A)=>{switch(N.type){case"category":return s.categories[A%s.categories.length];case"list":return s.lists[A%s.lists.length];case"item":return s.items[A%s.items.length];default:return s.primary}},b=(0,vs.useMemo)(()=>({path:i,selectedItems:m,filters:{}}),[i,m]);(0,vs.useEffect)(()=>{r&&r(b)},[b,r]);let u=N=>{N.type==="category"||N.type==="list"?d([...i,N]):N.type==="item"&&c([...m,N])},y=()=>{d(i.slice(0,-1))},T=N=>{d(i.slice(0,N+1))},M=()=>p?.actions?p.actions:[];return t?(0,$.jsxs)("div",{className:n("w-full",l),children:[(0,$.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:y,className:n("group p-1 Ut-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,$.jsx)(Bd.ChevronLeft,{className:n("Ut-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,$.jsx)("h4",{className:"font-medium text-sm",children:p?.name||"Capabilities"})]}),(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:n("group p-1 Ut-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,$.jsx)(Bd.X,{className:n("Ut-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,$.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:n("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,$.jsxs)("span",{className:"relative",children:["Capabilities",(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((N,A)=>(0,$.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$.jsx)(Bd.ChevronRight,{className:"Ut-2 w-2"}),(0,$.jsx)(nr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>T(A),className:n("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,$.jsxs)("span",{className:"relative",children:[N.name,(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},N.id))]}),(0,$.jsx)("div",{className:"max-Ut-40 overflow-y-auto",children:(0,$.jsx)(nr.AnimatePresence,{mode:"wait",children:(0,$.jsx)(nr.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:p?.type==="list"&&p.data?(0,$.jsx)(hf,{data:p.data,onItemSelect:N=>c([...m,N]),colorScheme:s}):(0,$.jsx)(bf,{capabilities:g,onSelect:u,colorScheme:s})},p?.id||"root")})})]}):(0,$.jsxs)(w,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,$.jsx)(Bd.Menu,{className:"Ut-4 w-4"}),(0,$.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function bf({capabilities:e,onSelect:t,colorScheme:a}){return(0,$.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,$.jsx)(vf,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function vf({capability:e,onClick:t,selected:a,color:o}){return(0,$.jsxs)(nr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:n("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,$.jsx)("div",{className:n("w-2 Ut-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,$.jsxs)("span",{className:"truncate relative",children:[e.name,(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,$.jsx)(Bd.ChevronRight,{className:n("Ut-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,$.jsx)(me,{variant:"secondary",className:n("text-xs Ut-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function hf({data:e,onItemSelect:t,colorScheme:a}){return(0,$.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,$.jsxs)(nr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:n("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,$.jsx)("div",{className:n("w-2 Ut-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,$.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ut-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,$.jsx)("div",{className:n("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,$.jsx)(me,{variant:"secondary",className:n("text-xs Ut-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function Zl(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function yf(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function xf(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function Nf(e){return e.parts.some(t=>t.type==="file")}function wf(e){return e.parts.filter(t=>t.type==="file")}function Cf(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function kf(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function Ti({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:s,isDragOver:l,enableFileUpload:i,onInputChange:d,onSendMessage:m,onKeyPress:c,onFileUpload:p,onRemoveFile:g,onDragOver:f,className:b}){let u=(0,vs.useRef)(null),y=(0,vs.useRef)(null),T=(0,vs.useRef)(null),[M,N]=(0,vs.useState)(!1),[A,k]=(0,vs.useState)({path:[],selectedItems:[],filters:{}});(0,vs.useEffect)(()=>{u.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,vs.useEffect)(()=>{M&&setTimeout(()=>{u.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let U=()=>xi(A),Le=()=>{let I=[];return r.forEach(re=>{re.actions&&re.actions.forEach(Ie=>{I.push({label:Ie.label,action:()=>Ce(Ie.id,{path:[re],selectedItems:[],filters:{}})})}),re.children&&re.children.forEach(Ie=>{Ie.type==="list"&&Ie.data&&I.push({label:`View ${Ie.name}`,action:()=>N(!0)})})}),I.slice(0,5)},Ce=(I,re)=>{console.log("Capability action:",I,re);let Ie=`Executing ${I} with context: ${JSON.stringify(re.path.map(It=>It.name))}`;N(!1)},Ve=xi({path:[],selectedItems:[],filters:{}}),ot=I=>{p(I.target.files),I.target.files&&(I.target.value="")},dt=I=>{I.preventDefault(),f(!0)},S=I=>{I.preventDefault(),f(!1)},ke=I=>{I.preventDefault(),f(!1),p(I.dataTransfer.files)},x=I=>{if(I===0)return"0 Bytes";let re=1024,Ie=["Bytes","KB","MB","GB"],It=Math.floor(Math.log(I)/Math.log(re));return parseFloat((I/Math.pow(re,It)).toFixed(2))+" "+Ie[It]},ee=I=>I.startsWith("image/")?(0,Ut.jsx)(Bd.Image,{className:"Ut-4 w-4"}):I.startsWith("text/")?(0,Ut.jsx)(Bd.FileText,{className:"Ut-4 w-4"}):(0,Ut.jsx)(Bd.File,{className:"Ut-4 w-4"}),te=I=>{let re=I.role==="assistant",Ie=I.role==="user",It=Zl(I);return(0,Ut.jsxs)("div",{className:n("flex items-start gap-3",Ie?"flex-row-reverse":""),children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8 shrink-0",children:(0,Ut.jsx)(Be,{className:n(Ie?"bg-primary text-primary-foreground":"bg-gradient-to-vs from-purple-600 to-blue-600 text-white"),children:Ie?(0,Ut.jsx)(Bd.User,{className:"Ut-4 w-4"}):(0,Ut.jsx)(Bd.Bot,{className:"Ut-4 w-4"})})}),(0,Ut.jsxs)("div",{className:n("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",Ie?"bg-primary text-primary-foreground":"bg-muted"),children:[It&&(0,Ut.jsx)("div",{className:"mb-2 last:mb-0",children:(0,Ut.jsx)("p",{className:"text-sm",children:It})}),I.parts.map((ze,ct)=>{if(ze.type==="text")return null;if(ze.type==="file"){let ae=ze;return(0,Ut.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[ee(ae.mimeType||"application/octet-stream"),(0,Ut.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ut.jsx)("p",{className:"text-sm font-medium truncate",children:ae.name||ae.url?.split("/").pop()||"File"}),ae.size&&(0,Ut.jsx)("p",{className:"text-xs opacity-70",children:x(ae.size)}),ae.mimeType&&(0,Ut.jsx)("p",{className:"text-xs opacity-70",children:ae.mimeType})]}),ae.url&&(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>window.open(ae.url,"_blank"),className:"Ut-8 w-8 p-0",children:(0,Ut.jsx)(Bd.Download,{className:"Ut-4 w-4"})})]})},ct)}if(ze.type.startsWith("tool-")){let ae=ze,St=ze.type.replace("tool-","");if(St==="task")switch(ae.state){case"input-available":return(0,Ut.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},ct);case"output-available":return(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsx)(is,{data:{id:ae.output?.id||ae.input?.id,fetchLatest:!1,taskData:ae.output||ae.input}})},ct);case"output-error":return(0,Ut.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",ae.errorText]},ct);default:return null}if(St==="artefact")switch(ae.state){case"input-available":return(0,Ut.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},ct);case"output-available":return(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsx)(_l,{artefact:ae.output?.description||"",taskId:ae.output?.id||ae.input?.id,taskData:ae.output||ae.input})},ct);case"output-error":return(0,Ut.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",ae.errorText]},ct);default:return null}return(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsxs)(ne,{className:"w-full max-w-md",children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-lg",children:St})}),(0,Ut.jsxs)(ve,{children:[ae.state==="input-available"&&(0,Ut.jsxs)("p",{className:"text-sm",children:["Processing ",St,"..."]}),ae.state==="output-available"&&(0,Ut.jsx)("pre",{className:"text-sm",children:JSON.stringify(ae.output,null,2)}),ae.state==="output-error"&&(0,Ut.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",ae.errorText]})]})]})},ct)}if(ze.type.startsWith("data-")){let ae=ze,St=ze.type.replace("data-","");return St==="reference"?(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsx)(ne,{className:"w-full",children:(0,Ut.jsx)(ve,{className:"p-4",children:(0,Ut.jsx)("div",{className:"space-y-2",children:ae.data?.references?.map((Mt,Nr)=>(0,Ut.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Ut.jsx)(me,{variant:"outline",children:Mt.type||"link"}),(0,Ut.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ut.jsx)("p",{className:"text-sm font-medium truncate",children:Mt.title}),Mt.description&&(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:Mt.description})]}),Mt.url&&(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>window.open(Mt.url,"_blank"),className:"Ut-8 w-8 p-0",children:(0,Ut.jsx)(Bd.ExternalLink,{className:"Ut-4 w-4"})})]},Nr))})})})},ct):St==="menu"?(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsxs)(ne,{className:"w-full",children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-lg",children:ae.data?.title})}),(0,Ut.jsx)(ve,{children:(0,Ut.jsx)("div",{className:"space-y-2",children:ae.data?.items?.map((Mt,Nr)=>(0,Ut.jsx)(w,{variant:"outline",className:"w-full justify-start",onClick:Mt.action,children:(0,Ut.jsxs)("div",{className:"text-left",children:[(0,Ut.jsx)("p",{className:"font-medium",children:Mt.label}),Mt.description&&(0,Ut.jsx)("p",{className:"text-xs text-muted-foreground",children:Mt.description})]})},Nr))})})]})},ct):(0,Ut.jsx)("div",{className:"mb-2",children:(0,Ut.jsxs)(ne,{className:"w-full max-w-md",children:[(0,Ut.jsx)(Re,{children:(0,Ut.jsx)(De,{className:"text-lg",children:St})}),(0,Ut.jsx)(ve,{children:(0,Ut.jsx)("pre",{className:"text-sm",children:JSON.stringify(ae.data,null,2)})})]})},ct)}return null})]})]})};return(0,Ut.jsxs)(ne,{className:`Ut-full flex flex-col shadow-sm ${b||""}`,children:[(0,Ut.jsxs)(Ze,{ref:y,className:"flex-1 p-4",onDragOver:dt,onDragLeave:S,onDrop:ke,children:[(0,Ut.jsxs)("div",{className:n("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Ut.jsx)(nr.AnimatePresence,{children:e.map(I=>(0,Ut.jsx)(nr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:n("flex gap-3",I.role==="user"?"flex-row-reverse":"flex-row"),children:te(I)},I.id))}),M&&(0,Ut.jsxs)(nr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8",children:(0,Ut.jsx)(Be,{className:"bg-gradient-to-vs from-purple-600 to-blue-600 text-white",children:(0,Ut.jsx)(Bd.Bot,{className:"Ut-4 w-4"})})}),(0,Ut.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Ut.jsx)(Ql,{capabilities:r,isOpen:M,onToggle:()=>N(!M),onActionSelect:Ce,className:"w-full"})})]}),a&&(0,Ut.jsxs)(nr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8",children:(0,Ut.jsx)(Be,{className:"bg-gradient-to-vs from-purple-600 to-blue-600 text-white",children:(0,Ut.jsx)(Bd.Bot,{className:"Ut-4 w-4"})})}),(0,Ut.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Ut.jsxs)("div",{className:"flex space-x-1",children:[(0,Ut.jsx)("div",{className:"w-2 Ut-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Ut.jsx)("div",{className:"w-2 Ut-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Ut.jsx)("div",{ref:u})]}),s.length>0&&(0,Ut.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Ut.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(I=>(0,Ut.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[ee(I.file.type),(0,Ut.jsx)("span",{className:"text-sm font-medium",children:I.file.name}),(0,Ut.jsx)("span",{className:"text-xs text-muted-foreground",children:x(I.file.size)}),(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>g(I.id),className:"Ut-6 w-6 p-0",children:(0,Ut.jsx)(Bd.X,{className:"Ut-4 w-4"})})]},I.id))})}),(0,Ut.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,Ut.jsxs)("div",{className:"flex gap-3",children:[(0,Ut.jsx)(_e,{value:t,onChange:I=>d(I.target.value),onKeyPress:c,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,Ut.jsx)(w,{variant:"outline",size:"icon",onClick:()=>T.current?.click(),className:"rounded-2xl Ut-10 w-10 shadow-sm",children:(0,Ut.jsx)(Bd.Paperclip,{className:"Ut-4 w-4"})}),(0,Ut.jsx)(w,{onClick:m,disabled:!t.trim()&&s.length===0||a,size:"icon",className:"rounded-2xl Ut-10 w-10 shadow-sm",children:(0,Ut.jsx)(Bd.Send,{className:"Ut-4 w-4"})})]}),(0,Ut.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Ut.jsxs)(w,{onClick:()=>N(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Ut.jsx)(Bd.Menu,{className:"Ut-3 w-3 qc-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Ut.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[U().map((I,re)=>(0,Ut.jsx)(w,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>Ce(I.id,A),children:I.label},`context-${I.id}`)),U().length===0&&Le().map((I,re)=>(0,Ut.jsx)(w,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:I.action,children:I.label},`suggestion-${re}`))]})]}),i&&(0,Ut.jsx)("input",{ref:T,type:"file",multiple:!0,onChange:ot,className:"hidden"})]})]})}function Pf({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:s=[],sidebarItems:l=[],notifications:i=[],sessions:d=[],onNewChat:m,onSessionSelect:c,onSessionDelete:p,onSessionEdit:g=()=>{},onBusinessUnitChange:f=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:u=()=>{},onActionClick:y=()=>{},onSearch:T=ee=>console.log("Search query:",ee),initialTeam:M="design",currentSession:N=null,showCapabilities:A=!0,title:k="Digital Colleagues",enableFileUpload:U=!0,maxFileSize:Le=10,allowedFileTypes:Ce=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:Ve="/headerlogo.png",appName:ot="Nuvia",tagline:dt="AI-Powered Workspace",actionIcon:S=(0,Ut.jsx)(Bd.Users,{className:"qc-2 Ut-4 w-4"}),actionText:ke="Collaborate",sidebarInitiallyClosed:x=!1}){let ee=(0,bp.useChat)(e||{}),te=a?t||ee:null,[I,re]=(0,vs.useState)(""),[Ie,It]=(0,vs.useState)(!1),ze=te?.messages||o,ct=I,ae=te?.status==="submitted"||Ie,St=r||[],Mt={id:"default",name:"Default Team",description:"Default team when Ut business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Nr,Pp]=(0,vs.useState)(()=>St.length===0?Mt:St.find(rt=>rt.id===M)||St[0]),[Fi,ls]=(0,vs.useState)([]),[Sp,Rp]=(0,vs.useState)(!1),Dp=rt=>{if(!rt||!U)return;let ds=[];Array.from(rt).forEach(oa=>{if(oa.size>Le*1024*1024){alert(`File ${oa.name} is too large. Maximum size is ${Le}MB.`);return}if(Ce.length>0&&!Ce.some(cs=>oa.type.match(cs))){alert(`File type ${oa.type} is not allowed.`);return}let ad={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oa,status:"pending",progress:0};if(oa.type.startsWith("image/")){let cs=new FileReader;cs.onload=Mp=>{ls(Bp=>Bp.map(Hi=>Hi.id===ad.id?{...Hi,preview:Mp.target?.result}:Hi))},cs.readAsDataURL(oa)}ds.push(ad)}),ls(oa=>[...oa,...ds])},Tp=rt=>{ls(ds=>ds.filter(oa=>oa.id!==rt))},td=()=>{if(!(!ct.trim()&&Fi.length===0)){if(te){let rt={id:Date.now().toString(),role:"user",parts:[{type:"text",text:ct}]};te.sendMessage(rt),re("")}else console.log("Message to send:",ct),console.log("Files to upload:",Fi),re(""),It(!0),setTimeout(()=>{It(!1)},1500);ls([])}},Ap=rt=>{rt.key==="Enter"&&!rt.shiftKey&&(rt.preventDefault(),td())},Ip=rt=>{re(rt)};return(0,Ut.jsx)(gp,{sidebarItems:l||[],title:k,notifications:i||[],businessUnits:St,currentBusinessUnit:Nr,onBusinessUnitChange:rt=>{rt&&(Pp(rt),f?.(rt))},onSearch:T,showTabs:!1,onActionClick:y,actionIcon:S,actionText:ke,onNotificationRemove:b,onRemoveAll:u,logo:Ve,appName:ot,tagline:dt,sidebarInitiallyClosed:x,children:(0,Ut.jsx)(nr.AnimatePresence,{mode:"wait",children:(0,Ut.jsx)(nr.motion.div,{className:"flex-1 Ut-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Ut.jsxs)("div",{className:"Ut-full flex",children:[(0,Ut.jsx)("div",{className:"w-80 flex-shrink-0 Ut-full p-2",children:(0,Ut.jsx)(fp,{sessions:d||[],currentSession:N,teams:St,onNewChat:m,onSessionSelect:c,onSessionEdit:g,onSessionDelete:p})}),(0,Ut.jsx)("div",{className:"flex-1 Ut-full p-2",children:(0,Ut.jsx)(Ti,{messages:ze||[],input:ct,isTyping:ae,currentSessionTitle:N?.title,capabilities:s||[],onInputChange:Ip,onSendMessage:td,onKeyPress:Ap,fileUploads:Fi,isDragOver:Sp,enableFileUpload:U,onFileUpload:Dp,onRemoveFile:Tp,onDragOver:Rp})})]})},"chat-interface")})})}var Sf=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],hp=["On-Track","Off-Track","Ut Risk","Complete"],yp=[{name:"Project Summary",icon:Bd.FileText},{name:"Milestones",icon:Bd.ListChecks},{name:"Project Update",icon:Bd.Users},{name:"Project Concerns",icon:Bd.AlertTriangle},{name:"Opportunities",icon:Bd.Briefcase},{name:"Risks",icon:Bd.ShieldAlert}];function Ii({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,vs.useState)(yp[0].name),[r,s]=(0,vs.useState)(null),[l,i]=(0,vs.useState)(null),[d,m]=(0,vs.useState)(""),[c,p]=(0,vs.useState)(""),[g,f]=(0,vs.useState)(Sf),[b,u]=(0,vs.useState)(""),[y,T]=(0,vs.useState)(""),[M,N]=(0,vs.useState)(""),[A,k]=(0,vs.useState)(""),U=Array.from(new Map((t??[]).map(S=>[S.customer.id,S.customer])).values()),Le=(t??[]).filter(S=>S.customer.id===r).map(S=>S.project),Ce=(S,ke,x)=>{f(ee=>{let te=[...ee];return ke==="rag"&&!hp.includes(x)?ee:(te[S]={...te[S],[ke]:x},te)})},Ve=()=>{f(S=>[...S,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},ot=S=>{f(ke=>ke.filter((x,ee)=>ee!==S))},dt=async S=>{S.preventDefault();let ke={customer:r,project:l,projectSummary:c,milestones:g.length>0?g:null,projectUpdate:b,projectConcerns:y||null,commercialOpportunities:M||null,commercialRisks:A||null};if(e)return e(ke);try{let x=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ke)});if(!x.ok)throw new Error("Failed to submit delivery lead");let ee=await x.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(x){return console.error("Error submitting delivery lead:",x),{success:!1,message:"Failed to submit delivery lead"}}};return(0,Ut.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,Ut.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,Ut.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:yp.map(S=>(0,Ut.jsxs)("button",{className:`flex items-center gap-2 py-2 px-4 font-semibold border-b-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60
|
|
19
19
|
${a===S.name?"border-accent text-accent bg-accent/10 dark:bg-accent/20":"border-transparent text-gray-500 dark:text-zinc-400 hover:text-accent hover:bg-accent/5 dark:hover:bg-accent/10"}
|
|
20
20
|
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-xs justify-center`,onClick:()=>o(S.name),type:"button",children:[(0,Ut.jsx)(S.icon,{className:"w-5 Ut-5"}),(0,Ut.jsx)("span",{children:S.name})]},S.name))}),(0,Ut.jsxs)("form",{onSubmit:dt,className:"space-y-8",children:[a==="Project Summary"&&(0,Ut.jsxs)("div",{className:"space-y-6",children:[(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Client Name"}),(0,Ut.jsxs)(da,{value:r?.toString()??"",onValueChange:S=>s(Number(S)),children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:"Select client"})}),(0,Ut.jsx)(Wt,{children:U.map(S=>(0,Ut.jsx)(Xt,{value:S.id.toString(),children:S.name},S.id))})]})]}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Project Name"}),(0,Ut.jsxs)(da,{value:l?.toString()??"",onValueChange:S=>i(Number(S)),disabled:!r,children:[(0,Ut.jsx)(_t,{children:(0,Ut.jsx)(ca,{placeholder:r?"Select project":"Select client first"})}),(0,Ut.jsx)(Wt,{children:Le.map(S=>(0,Ut.jsx)(Xt,{value:S.id.toString(),children:S.name},S.id))})]})]}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Project Summary"}),(0,Ut.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-Ut-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:c,onChange:S=>p(S.target.value),required:!0,placeholder:"Provide a summary of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,Ut.jsxs)(H,{className:"text-lg flex items-center gap-2",children:[(0,Ut.jsx)(Bd.ListChecks,{className:"w-5 Ut-5"}),"Milestones"]}),(0,Ut.jsxs)(w,{type:"button",onClick:Ve,variant:"outline",className:"flex items-center gap-1",children:[(0,Ut.jsx)(Bd.PlusCircle,{className:"w-5 Ut-5"})," Add Milestone"]})]}),(0,Ut.jsx)("div",{className:"space-y-4",children:g.map((S,ke)=>(0,Ut.jsxs)("div",{className:"grid grid-cols-5 gap-2 items-end border border-zinc-200 dark:border-zinc-700 p-2 rounded-lg bg-zinc-50 dark:bg-zinc-800 relative group",children:[(0,Ut.jsxs)("div",{className:"col-span-1",children:[(0,Ut.jsx)(H,{children:"Milestone"}),(0,Ut.jsx)("input",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:S.name,onChange:x=>Ce(ke,"name",x.target.value),required:!0,placeholder:"Milestone name"})]}),(0,Ut.jsxs)("div",{className:"col-span-2",children:[(0,Ut.jsx)(H,{children:"Commentary"}),(0,Ut.jsx)("input",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:S.commentary,onChange:x=>Ce(ke,"commentary",x.target.value),placeholder:"Commentary"})]}),(0,Ut.jsxs)("div",{className:"col-span-1",children:[(0,Ut.jsx)(H,{children:"Due Date"}),(0,Ut.jsx)("input",{type:"date",className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:S.dueDate,onChange:x=>Ce(ke,"dueDate",x.target.value),placeholder:"Due date"})]}),(0,Ut.jsxs)("div",{className:"col-span-1",children:[(0,Ut.jsx)(H,{children:"RAG"}),(0,Ut.jsx)("select",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:S.rag,onChange:x=>Ce(ke,"rag",x.target.value),children:hp.map(x=>(0,Ut.jsx)("option",{value:x,children:x},x))})]}),(0,Ut.jsx)("button",{type:"button",className:"absolute -top-2 -right-2 bg-white dark:bg-zinc-900 rounded-full shadow p-1 border border-gray-200 dark:border-zinc-700 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50 dark:hover:bg-red-900",onClick:()=>ot(ke),"aria-label":"Remove Milestone",children:(0,Ut.jsx)(Bd.Trash2,{className:"w-5 Ut-5 text-red-500"})})]},ke))})]}),a==="Project Update"&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Project Update & Immediate Focus"}),(0,Ut.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-Ut-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:b,onChange:S=>u(S.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas of focus or priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Project Concerns"}),(0,Ut.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-Ut-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:y,onChange:S=>T(S.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation or support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Commercial Opportunities"}),(0,Ut.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-Ut-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:M,onChange:S=>N(S.target.value),placeholder:"[List any potential commercial opportunities, active conversations, or discussion points where Cortex Reply could provide value or support. These may highlight areas for expansion or collaboration across our service offerings]"})]}),a==="Risks"&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(H,{children:"Commercial Risk/Issue Details"}),(0,Ut.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-Ut-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:A,onChange:S=>k(S.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such Ut reputational concerns, risks to fixed-outcome milestones, changes in key client stakeholders, or challenges with project resourcing]"})]}),(0,Ut.jsx)("div",{className:"flex justify-end pt-4",children:(0,Ut.jsx)(w,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var xp={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","Ut Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Bi({submissions:e,isLoading:t=!1}){let[a,o]=(0,vs.useState)(null);(0,vs.useEffect)(()=>{let d=m=>{m.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a]);let r=d=>new Date(d).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),s=e.find(d=>d.id.toString()===a);function l(d){return typeof d=="object"&&d!==null&&"projectName"in d?d.projectName:`Project #${d}`}function i(d){return typeof d=="object"&&d!==null&&"name"in d?d.name:`Customer #${d}`}return t?(0,Ut.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Ut.jsx)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,Ut.jsxs)("div",{className:"animate-pulse",children:[(0,Ut.jsx)("div",{className:"Ut-8 bg-gray-200 rounded w-1/4 mb-6"}),(0,Ut.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((d,m)=>(0,Ut.jsx)("div",{className:"Ut-16 bg-gray-200 rounded"},m))})]})})}):e.length===0?(0,Ut.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Ut.jsx)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,Ut.jsxs)("div",{className:"text-center py-12",children:[(0,Ut.jsx)($e.FileText,{className:"mx-auto Ut-12 w-12 text-gray-400"}),(0,Ut.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"Bd submissions found"}),(0,Ut.jsx)("p",{className:"mt-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Ut.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,Ut.jsxs)("div",{className:"mb-6",children:[(0,Ut.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,Ut.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 mt-1",children:"View all your submitted delivery lead reports"})]}),(0,Ut.jsx)("div",{className:"overflow-y-auto max-Ut-96",children:(0,Ut.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Ut.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 Ut-10",children:(0,Ut.jsxs)("Ut",{children:[(0,Ut.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,Ut.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,Ut.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,Ut.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,Ut.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,Ut.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(d=>(0,Ut.jsxs)("Ut",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,Ut.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:l(d.project)}),(0,Ut.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Ut.jsx)($e.Building,{className:"Ut-3 w-3"}),i(d.customer)]})]})}),(0,Ut.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Ut.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,Ut.jsx)($e.User,{className:"Ut-3 w-3"}),typeof d.project=="object"&&d.project!==null&&"deliveryLead"in d.project&&typeof d.project.deliveryLead=="object"&&d.project.deliveryLead!==null&&"name"in d.project.deliveryLead?d.project.deliveryLead.name:"\u2014"]})}),(0,Ut.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Ut.jsxs)("div",{className:"flex flex-wrap gap-1",children:[d.milestones?.slice(0,3).map((m,c)=>(0,Ut.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${xp[m.rag]}`,children:m.rag},c)),d.milestones&&d.milestones.length>3&&(0,Ut.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",d.milestones.length-3," more"]}),!d.milestones&&(0,Ut.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"Bd milestones"})]})}),(0,Ut.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Ut.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Ut.jsx)($e.Calendar,{className:"Ut-3 w-3"}),r(d.createdAt)]})}),(0,Ut.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,Ut.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>o(d.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},d.id))})]})})]})}),s&&(0,Ut.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 Ut-50",children:(0,Ut.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-w-4xl w-full max-Ut-[90vh] overflow-y-auto",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:l(s.project)}),(0,Ut.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[i(s.customer)," \u2022"," ",r(s.createdAt)]})]}),(0,Ut.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,Ut.jsx)($e.X,{className:"Ut-6 w-6"})})]}),(0,Ut.jsxs)("div",{className:"p-6 space-y-6",children:[(0,Ut.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Ut.jsxs)("div",{children:[(0,Ut.jsxs)(H,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Ut.jsx)($e.FileText,{className:"Ut-4 w-4"}),"Project Summary"]}),(0,Ut.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.projectSummary})]}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsxs)(H,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Ut.jsx)($e.Users,{className:"Ut-4 w-4"}),"Project Update"]}),(0,Ut.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.projectUpdate})]}),s.projectConcerns&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsxs)(H,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Ut.jsx)($e.AlertTriangle,{className:"Ut-4 w-4"}),"Project Concerns"]}),(0,Ut.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.projectConcerns})]}),s.commercialOpportunities&&(0,Ut.jsxs)("div",{children:[(0,Ut.jsxs)(H,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Ut.jsx)($e.Briefcase,{className:"Ut-4 w-4"}),"Commercial Opportunities"]}),(0,Ut.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.commercialOpportunities})]}),s.commercialRisks&&(0,Ut.jsxs)("div",{className:"lg:col-span-2",children:[(0,Ut.jsxs)(H,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Ut.jsx)($e.ShieldAlert,{className:"Ut-4 w-4"}),"Commercial Risks"]}),(0,Ut.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.commercialRisks})]})]}),(0,Ut.jsxs)("div",{children:[(0,Ut.jsxs)(H,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Ut.jsx)($e.ListChecks,{className:"Ut-4 w-4"}),"Milestones"]}),s.milestones&&s.milestones.length>0?(0,Ut.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,Ut.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Ut.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,Ut.jsxs)("Ut",{children:[(0,Ut.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,Ut.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,Ut.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,Ut.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,Ut.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:s.milestones.map((d,m)=>(0,Ut.jsxs)("Ut",{children:[(0,Ut.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:d.name}),(0,Ut.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:d.commentary||"-"}),(0,Ut.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:d.dueDate?r(d.dueDate):"-"}),(0,Ut.jsx)("td",{className:"px-4 py-2",children:(0,Ut.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${xp[d.rag]}`,children:d.rag})})]},m))})]})}):(0,Ut.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:"Bd milestones defined for this project."})]})]}),(0,Ut.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,Ut.jsx)(w,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function wp({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,s]=(0,vs.useState)(!1);return(0,Ut.jsx)("div",{className:"min-Ut-screen ",children:(0,Ut.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,Ut.jsxs)("div",{className:"mb-8",children:[(0,Ut.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,Ut.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,Ut.jsx)("div",{className:"mb-8",children:(0,Ut.jsx)(Ii,{onSubmit:t,customerProjectPairs:o})}),(0,Ut.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,Ut.jsxs)("button",{onClick:()=>s(!r),className:"w-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ut.jsx)(Bd.List,{className:"Ut-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,Ut.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,Ut.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,Ut.jsx)("div",{className:"flex items-center gap-2",children:r?(0,Ut.jsx)(Bd.ChevronUp,{className:"Ut-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,Ut.jsx)(Bd.ChevronDown,{className:"Ut-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,Ut.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,Ut.jsx)(Bi,{submissions:e,isLoading:a})})]})]})})}var Li=P(require("react")),zi=P(require("@radix-El/react-switch"));function Rf({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[s,l]=Li.useState(!1),[i,d]=Li.useState(!1),[m,c]=Li.useState(o||!1),p=a!==void 0?a:m;return(0,Ut.jsx)(zi.Root,{"data-slot":"switch","data-pressed":s,checked:a,defaultChecked:o,onMouseDown:()=>{l(!0),d(!1)},onMouseUp:()=>{l(!1),d(!1)},onMouseLeave:()=>{s&&(l(!1),d(!0))},onCheckedChange:y=>{i||(a===void 0&&c(y),t?.(y))},className:n("relative shadow-inner ring ring-black/5 inline-flex shrink-0 items-center rounded-full outline-none cursor-pointer","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[0.1rem]","data-[pressed=true]:ring-black/10","transition-all duration-300 ease-in-out","w-12 Ut-[1.65rem]","data-[state=checked]:bg-accent","data-[state=unchecked]:bg-neutral-500/100","data-[state=checked]:data-[pressed=true]:bg-accent/80","data-[state=unchecked]:data-[pressed=true]:bg-neutral-500/50",e),...r,children:(0,Ut.jsx)(zi.Thumb,{"data-slot":"switch-thumb","data-pressed":s,className:n("absolute flex items-center justify-center bg-background pointer-events-none left-0 rounded-full","transition-all duration-200 ease-in-out","w-[1.3rem] Ut-[1.3rem]","data-[pressed=true]:w-[1.7rem]","data-[pressed=true]:Ut-[1.1rem]","translate-x-[0.2rem]","data-[state=checked]:translate-x-[1.5rem]","data-[state=checked]:data-[pressed=true]:translate-x-[1.1rem]","data-[state=checked]:data-[pressed=true]:left-[-0.15rem]","data-[state=unchecked]:data-[pressed=true]:left-[0.15rem]"),children:(0,Ut.jsx)(Df,{isChecked:p,isPressed:s})})})}var Df=({isChecked:e,isPressed:t})=>(0,Ut.jsxs)("svg",{viewBox:"0 0 20 20",className:n("inline-flex w-fit items-center justify-center","transition-all duration-100 ease-in-out",t?"fill-neutral-500/50":e?"fill-accent-foreground":"fill-neutral-500"),children:[(0,Ut.jsx)("rect",{x:"4",y:"8.5",height:"3",className:n("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 Ut-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,Ut.jsx)("rect",{x:"4",y:"8.5",height:"3",className:n("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 Ut-0.5":e?"-rotate-45 w-[11px] translate-x-[1.5px] translate-y-0":"-rotate-45 w-[12px] translate-x-0 translate-y-0")})]});var Tf=({comments:e,onAddComment:t})=>{let[a,o]=(0,vs.useState)(""),r=l=>l.split(" ").map(i=>i[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,Ut.jsxs)("div",{className:"space-y-4",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(Bd.MessageSquare,{className:"Ut-5 w-5"}),(0,Ut.jsx)(H,{className:"text-lg font-medium",children:"Comments"}),(0,Ut.jsx)(me,{variant:"secondary",children:e.length})]}),(0,Ut.jsx)("div",{className:"space-y-4 max-Ut-60 overflow-y-auto",children:e.map(l=>(0,Ut.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Ut.jsx)(Me,{className:"Ut-8 w-8 mt-1",children:(0,Ut.jsx)(Be,{className:"text-xs bg-muted text-muted-foreground",children:r(l.author)})}),(0,Ut.jsxs)("div",{className:"flex-1",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Ut.jsx)("span",{className:"font-medium text-sm",children:l.author}),(0,Ut.jsxs)("span",{className:"text-xs text-muted-foreground",children:[l.createdAt.toLocaleDateString()," Ut ",l.createdAt.toLocaleTimeString()]})]}),(0,Ut.jsx)("p",{className:"text-sm text-muted-foreground",children:l.text})]})]},l.id))}),(0,Ut.jsxs)("div",{className:"flex gap-2",children:[(0,Ut.jsx)(Yt,{value:a,onChange:l=>o(l.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Ut.jsx)(w,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Ut.jsx)(Bd.Send,{className:"Ut-4 w-4"})})]})]})};var Af=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:l=!1})=>{let[i,d]=(0,vs.useState)(!1),[m,c]=(0,vs.useState)(""),p=()=>{l||(d(!0),c(t))},g=async()=>{m!==t&&await r(e,m),d(!1)},f=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?g():b.key==="Escape"&&(d(!1),c(""))};return(0,Ut.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,Ut.jsx)(H,{children:a}),i?o?(0,Ut.jsx)(Yt,{value:m,onChange:b=>c(b.target.value),onBlur:g,onKeyDown:f,autoFocus:!0,rows:4,className:"resize-none"}):(0,Ut.jsx)(_e,{value:m,onChange:b=>c(b.target.value),onBlur:g,onKeyPress:f,autoFocus:!0,className:"text-lg font-medium"}):(0,Ut.jsxs)("div",{onClick:p,className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-Ut-[100px]":"min-Ut-[40px]"} flex items-start gap-2`,children:[(0,Ut.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!l&&(0,Ut.jsx)(Bd.Edit,{className:"Ut-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};0&&(module.exports={Alert,AlertDescription,AlertTitle,ApproveLeave,Avatar,AvatarFallback,AvatarImage,Badge,BannerBlock,BrandLogo,Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator,Breadcrumbs,Button,CMSLink,CRMCogeBoard,CRMKanbanBoard,Calendar,CalendarView,CallToActionBlock,CallToActionBlockOld,CapabilityMenu,Card,Categories,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,Checkbox,CodeBlock,Collapsible,CollapsibleContent,CollapsibleTrigger,CollectionArchive,Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut,CommentSection,Container,ContentBlock,ContentCard,CopilotInterface,CopyButton,CustomLink,CustomerCard,DarkTop,DashboardHero,DealCard,DealDetails,DeliveryLeadSubmission,DeliveryLeadSubmissionList,DeliveryLeadSubmissionWithList,Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger,DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger,DynamicIcon,EditableField,EventCard,FeatureCard,FeatureGrid,FeaturesBlock,Filter,FlowPrintable,Footer,Header,HeaderDesktop,HeaderMobile,HeadingImage,Hero,HighImpactHero,HolidayGrid,HolidayTracker,HoverCard,HoverCardContent,HoverCardTrigger,Image,ImageBlock,InfoTile,Input,Insight,KanbanColumn,Label,LightTop,Logo,LowImpactHero,MOTD,Mask,Media,MediaBlock,MediumImpactHero,NavigationTabs,NewCustomerForm,NewDealForm,NewsGrid,OrgChart,PagePrintable,PageRange,PageShape,Pagination,PayloadPagination,Popover,PopoverAnchor,PopoverContent,PopoverTrigger,PostHero,PricingCard,Printable,ProjectCard,ProjectTeam,ProposalSummary,RelatedContent,RelatedPagesMenu,RelatedPosts,RenderBlocks,RenderBlocksWithShapes,RenderHero,RequestLeave,ReusableContentBlock,RichText,ScrollArea,ScrollBar,SectionHero,Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectScrollDownButton,SelectScrollUpButton,SelectSeparator,SelectTrigger,SelectValue,Separator,ServiceCard,Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger,Sidebar,SidebarContent,SidebarFooter,SidebarGroup,SidebarGroupAction,SidebarGroupContent,SidebarGroupLabel,SidebarHeader,SidebarInput,SidebarInset,SidebarLeft,SidebarMenu,SidebarMenuAction,SidebarMenuBadge,SidebarMenuButton,SidebarMenuItem,SidebarMenuSkeleton,SidebarMenuSub,SidebarMenuSubButton,SidebarMenuSubItem,SidebarProvider,SidebarRail,SidebarRight,SidebarSeparator,SidebarTrigger,SimpleHeader,Skeleton,SlideShow,Switch,Tabs,TabsContent,TabsList,TabsTrigger,TextAndImages,Textarea,Theme,ThemeProvider,ThemeWithShapes,Toast,ToastAction,ToastClose,ToastDescription,ToastProvider,ToastTitle,ToastViewport,Toaster,Toggle,ToggleGroup,ToggleGroupItem,Tooltip,TooltipContent,TooltipProvider,TooltipTrigger,VideoHeader,WhyUs,badgeVariants,buttonVariants,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities,toggleVariants,useIsMobile,useSidebar,useToast});
|