cortex-react-components 2.22.1 → 2.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
- package/dist/{chunk-4SRUEQTP.mjs → chunk-33CHGT4N.mjs} +1 -1
- package/dist/{chunk-7OMPPFGG.mjs → chunk-3EGSOIRH.mjs} +1 -1
- package/dist/{chunk-U3FYDDE2.mjs → chunk-6EKGV4I2.mjs} +1 -1
- package/dist/{chunk-SCBDVNHG.mjs → chunk-AF3FLXBA.mjs} +1 -1
- package/dist/{chunk-2GM2LPLB.mjs → chunk-ANCSWAD7.mjs} +1 -1
- package/dist/{chunk-R6AYIVIR.mjs → chunk-CCJJAUGB.mjs} +1 -1
- package/dist/{chunk-BQQ4V4PX.mjs → chunk-CTC6WSB6.mjs} +1 -1
- package/dist/{chunk-O24GFE6Q.mjs → chunk-DX3G3FKT.mjs} +1 -1
- package/dist/chunk-E6NVWHRS.mjs +4 -0
- package/dist/{chunk-HDKHF3EA.mjs → chunk-GO42W2BM.mjs} +1 -1
- package/dist/{chunk-GAZHKHGB.mjs → chunk-HLTP3ZQN.mjs} +1 -1
- package/dist/{chunk-PNUBVBSR.mjs → chunk-JNJJAJPI.mjs} +1 -1
- package/dist/chunk-LCSO56PM.mjs +4 -0
- package/dist/{chunk-FEWOSBUJ.mjs → chunk-MEVSHOG4.mjs} +1 -1
- package/dist/{chunk-FYQBRCQM.mjs → chunk-MFUZNS7C.mjs} +1 -1
- package/dist/{chunk-GETYSIZV.mjs → chunk-MGSTQLZC.mjs} +1 -1
- package/dist/{chunk-S7MFNEEY.mjs → chunk-OWC4BAX6.mjs} +1 -1
- package/dist/{chunk-KVLUT4U2.mjs → chunk-OXKN6X62.mjs} +1 -1
- package/dist/{chunk-RIRZRO6U.mjs → chunk-P55W6AFU.mjs} +1 -1
- package/dist/{chunk-2OOJ4ZFB.mjs → chunk-QILFMWE5.mjs} +1 -1
- package/dist/{chunk-3ANJOET7.mjs → chunk-QZIJTAPO.mjs} +1 -1
- package/dist/{chunk-P6OSMPUQ.mjs → chunk-R33MOMFK.mjs} +1 -1
- package/dist/{chunk-3FDGJ7OU.mjs → chunk-R5P4ZICA.mjs} +1 -1
- package/dist/{chunk-PTZT4QJW.mjs → chunk-RMZLEIRP.mjs} +1 -1
- package/dist/{chunk-T5HJS6OF.mjs → chunk-RSDUFAIB.mjs} +1 -1
- package/dist/{chunk-CSZCPO6D.mjs → chunk-TJBF2PAV.mjs} +1 -1
- package/dist/{chunk-UZAGENSY.mjs → chunk-UAWSYIXU.mjs} +1 -1
- package/dist/{chunk-HKMNAXLM.mjs → chunk-VQBOJHZF.mjs} +1 -1
- package/dist/{chunk-UTJZH3X5.mjs → chunk-W4OD5UUE.mjs} +1 -1
- package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
- package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
- package/dist/{chunk-RRME4EHD.mjs → chunk-XYJ4S67W.mjs} +1 -1
- package/dist/{chunk-F64CA5CH.mjs → chunk-YPSUDHCJ.mjs} +1 -1
- package/dist/{chunk-MO4HRQEL.mjs → chunk-YWRU7OE3.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/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/LandingMenu.js +1 -1
- package/dist/components/Foundary/LandingMenu.mjs +1 -1
- package/dist/components/Foundary/Login.js +1 -1
- package/dist/components/Foundary/Login.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/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/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/PayloadCard/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/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/globals.css +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-6VCUXVHO.mjs +0 -4
- package/dist/chunk-WX6WJ3VM.mjs +0 -4
package/dist/components/index.js
CHANGED
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
${n?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
33
33
|
`,children:"Cancel"})]})]}):null};var db=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=tu.default.useState(!0),[i,n]=tu.default.useState(null),s=()=>{a(e.toolCallId,e.type,"Approved"),r(!1),n("approve")},l=()=>{a(e.toolCallId,e.type,"Denied"),r(!1),n("deny")};switch(e.state){case"input-available":return(0,Go.jsxs)("div",{className:"mb-2",children:[(0,Go.jsx)(eu,{isOpen:o,onApprove:s,onDeny:l,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,Go.jsxs)(Go.Fragment,{children:[i==="approve"&&(0,Go.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Go.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Go.jsx)("svg",{className:"h-4 w-4 Dg-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Go.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Go.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Go.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Go.jsx)("svg",{className:"h-4 w-4 Dg-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Go.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Go.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Go.jsxs)(Go.Fragment,{children:[e.output==="approve"&&(0,Go.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Go.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Go.jsx)("svg",{className:"h-4 w-4 Dg-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Go.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,Go.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Go.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Go.jsx)("svg",{className:"h-4 w-4 Dg-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Go.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var au=require("@radix-Go/react-use-controllable-state");var mb=require("streamdown"),Sl=(0,Yl.memo)(({className:e,...t})=>(0,Go.jsx)(mb.Streamdown,{className:p("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Sl.displayName="Response";var ub=(0,Yl.createContext)(null),mw=()=>{let e=(0,Yl.useContext)(ub);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},pw=1e3,uw=1e3,ou=(0,Yl.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:r,duration:i,children:n,...s})=>{let[l,c]=(0,au.useControllableState)({prop:a,defaultProp:o,onChange:r}),[d,m]=(0,au.useControllableState)({prop:i,defaultProp:0}),[u,v]=(0,Yl.useState)(!1),[b,g]=(0,Yl.useState)(null);(0,Yl.useEffect)(()=>{t?b===null&&g(Date.now()):b!==null&&(m(Math.ceil((Date.now()-b)/uw)),g(null))},[t,b,m]),(0,Yl.useEffect)(()=>{if(o&&!t&&l&&!u){let C=setTimeout(()=>{c(!1),v(!0)},pw);return()=>clearTimeout(C)}},[t,l,o,c,u]);let f=C=>{c(C)};return(0,Go.jsx)(ub.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:c,duration:d},children:(0,Go.jsx)(Xa,{className:p("not-prose mb-4",e),onOpenChange:f,open:l,...s,children:n})})}),gw=(e,t)=>e||t===0?(0,Go.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Go.jsx)("p",{children:"Thought for a few seconds"}):(0,Go.jsxs)("p",{children:["Thought for ",t," seconds"]}),ru=(0,Yl.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,duration:i}=mw();return(0,Go.jsx)(xo,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.BrainIcon,{className:"size-4"}),gw(o,i),(0,Go.jsx)(Dg.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),iu=(0,Yl.memo)(({className:e,children:t,...a})=>(0,Go.jsx)(wo,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Yl-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,Go.jsx)(Sl,{className:"grid gap-2",children:t})}));ou.displayName="Reasoning";ru.displayName="ReasoningTrigger";iu.displayName="ReasoningContent";var su=require("react-syntax-highlighter"),mc=require("react-syntax-highlighter/dist/esm/styles/prism"),fw=(0,Yl.createContext)({code:""}),pc=({code:e,language:t,showLineNumbers:a=!1,className:o,children:r,...i})=>(0,Go.jsx)(fw.Provider,{value:{code:e},children:(0,Go.jsx)("div",{className:p("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",o),...i,children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(su.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:a,style:mc.oneLight,children:e}),(0,Go.jsx)(su.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:a,style:mc.oneDark,children:e}),r&&(0,Go.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})});var fb=({className:e,...t})=>(0,Go.jsx)(Xa,{className:p("not-prose mb-4 w-full",e),...t}),vw=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Go.jsxs)(Q,{className:"gap-1.5 rounded-full text-Go",variant:"secondary",children:[{"input-streaming":(0,Go.jsx)(Dg.CircleIcon,{className:"size-4"}),"input-available":(0,Go.jsx)(Dg.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Go.jsx)(Dg.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Go.jsx)(Dg.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},vb=({className:e,type:t,state:a,...o})=>(0,Go.jsxs)(xo,{className:p("flex w-full items-center justify-between gap-4 p-3 pl-0 w-2xl",e),...o,children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Go.jsx)("span",{className:"font-medium text-sm",children:t}),vw(a)]}),(0,Go.jsx)(Dg.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),bb=({className:e,...t})=>(0,Go.jsx)(wo,{className:p("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Yl-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),hb=({className:e,input:t,...a})=>(0,Go.jsxs)("div",{className:p("space-y-2 overflow-hidden p-4",e),...a,children:[(0,Go.jsx)("h4",{className:"font-medium text-muted-foreground text-Go uppercase tracking-wide",children:"Parameters"}),(0,Go.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Go.jsx)(pc,{code:JSON.stringify(t,null,2),language:"json"})})]}),yb=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let r=(0,Go.jsx)("div",{children:t});return typeof t=="object"?r=(0,Go.jsx)(pc,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,Go.jsx)(pc,{code:t,language:"json"})),(0,Go.jsxs)("div",{className:p("space-y-2 p-4",e),...o,children:[(0,Go.jsx)("h4",{className:"font-medium text-muted-foreground text-Go uppercase tracking-wide",children:a?"Error":"Result"}),(0,Go.jsxs)("div",{className:p("overflow-x-auto rounded-md text-Go [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&(0,Go.jsx)("div",{children:a}),r]})]})};var bw=e=>e.startsWith("image/")?(0,Go.jsx)(Dg.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4"}):(0,Go.jsx)(Dg.File,{className:"h-4 w-4"}),xb=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((r,i)=>{if(r.type==="text")return(0,Go.jsx)(Sl,{children:r.text},`${i}`);if(r.type==="file"){let n=r;return(0,Go.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[bw(n.mediaType||"application/octet-stream"),(0,Go.jsx)("div",{className:"flex-1 min-w-0",children:(0,Go.jsx)("p",{className:"text-sm font-medium truncate",children:n.filename||n.url?.split("/").pop()||"File"})}),n.url&&(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Go.jsx)(Dg.Download,{className:"h-4 w-4"})})]})},i)}if(r.type.startsWith("tool-")){let n=r,s=r.type.replace("tool-","");if(s==="task")switch(n.state){case"input-available":return(0,Go.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsx)(Nl,{data:{Go:n.output?.Go||n.input?.Go,fetchLatest:!1,taskData:n.output||n.input}})},i);case"output-error":return(0,Go.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},i);default:return null}if(r.type==="tool-requestEndpointLogin")return(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsx)(Qp,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(r.type==="tool-authenticate")return(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsx)(Qp,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(r.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",n),(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsx)(db,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(n.state){case"input-available":return(0,Go.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsx)(Kp,{artefact:n.output?.description||"",taskId:n.output?.Go||n.input?.Go,taskData:n.output||n.input})},i);case"output-error":return(0,Go.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},i);default:return null}return(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsxs)(z,{className:"w-full max-w-md",children:[(0,Go.jsx)(be,{children:(0,Go.jsx)(we,{className:"text-lg",children:s})}),(0,Go.jsxs)(J,{children:[n.state==="input-available"&&(0,Go.jsxs)("p",{className:"text-sm",children:["Processing ",s,"..."]}),n.state==="output-available"&&(0,Go.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.output,null,2)}),n.state==="output-error"&&(0,Go.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",n.errorText]})]})]})},i)}if(r.type.startsWith("data-")){let n=r,s=r.type.replace("data-","");return s==="reference"?(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsx)(z,{className:"w-full",children:(0,Go.jsx)(J,{className:"p-4",children:(0,Go.jsx)("div",{className:"space-y-2",children:n.data?.references?.map((l,c)=>(0,Go.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Go.jsx)(Q,{variant:"outline",children:l.type||"link"}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsx)("p",{className:"text-sm font-medium truncate",children:l.title}),l.description&&(0,Go.jsx)("p",{className:"text-Go text-muted-foreground truncate",children:l.description})]}),l.url&&(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>window.open(l.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Go.jsx)(Dg.ExternalLink,{className:"h-4 w-4"})})]},c))})})})},i):s==="menu"?(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsxs)(z,{className:"w-full",children:[(0,Go.jsx)(be,{children:(0,Go.jsx)(we,{className:"text-lg",children:n.data?.title})}),(0,Go.jsx)(J,{children:(0,Go.jsx)("div",{className:"space-y-2",children:n.data?.items?.map((l,c)=>(0,Go.jsx)(h,{variant:"outline",className:"w-full justify-start",onClick:l.action,children:(0,Go.jsxs)("div",{className:"text-left",children:[(0,Go.jsx)("p",{className:"font-medium",children:l.label}),l.description&&(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:l.description})]})},c))})})]})},i):(0,Go.jsx)("div",{className:"mb-2",children:(0,Go.jsxs)(z,{className:"w-full max-w-md",children:[(0,Go.jsx)(be,{children:(0,Go.jsx)(we,{className:"text-lg",children:s})}),(0,Go.jsx)(J,{children:(0,Go.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.data,null,2)})})]})},i)}if(r.type==="reasoning")return(0,Go.jsxs)(ou,{className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.Go===o.Go(-1)?.Go,children:[(0,Go.jsx)(ru,{}),(0,Go.jsx)(iu,{children:r.text})]},`${i}`);if(r.type==="dynamic-tool")return(0,Go.jsxs)(fb,{defaultOpen:r.state!=="output-available",children:[(0,Go.jsx)(vb,{type:`tool-${r.toolName}`,state:r.state}),(0,Go.jsxs)(bb,{children:[(0,Go.jsx)(hb,{input:r.input}),(0,Go.jsx)(yb,{output:r.output,errorText:r.errorText})]})]},`${e.Go}-${i}`)});var Nb=({className:e,from:t,...a})=>(0,Go.jsx)("div",{className:p("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"Dg-user":"Dg-assistant flex-row-reverse justify-end",e),...a}),hw=(0,vg.cva)("Dg-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.Dg-user]:bg-primary group-[.Dg-user]:text-primary-foreground","group-[.Dg-assistant]:bg-secondary group-[.Dg-assistant]:text-foreground"],flat:["group-[.Dg-user]:max-w-[80%] group-[.Dg-user]:bg-secondary group-[.Dg-user]:px-4 group-[.Dg-user]:py-3 group-[.Dg-user]:text-foreground","group-[.Dg-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),Cb=({children:e,className:t,variant:a,...o})=>(0,Go.jsx)("div",{className:p(hw({variant:a,className:t})),...o,children:e});function gc({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:i,isDragOver:n,enableFileUpload:s,onInputChange:l,addToolResult:c,onSendMessage:d,onKeyPress:m,onFileUpload:u,onRemoveFile:v,onDragOver:b,className:g,status:f="ready"}){let C=(0,Yl.useRef)(null),R=(0,Yl.useRef)(null),y=(0,Yl.useRef)(null),[k,P]=(0,Yl.useState)(!1),[w,M]=(0,Yl.useState)({path:[],selectedItems:[],filters:{}});(0,Yl.useEffect)(()=>{C.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Yl.useEffect)(()=>{k&&setTimeout(()=>{C.current?.scrollIntoView({behavior:"smooth"})},100)},[k]);let S=()=>ec(w),F=()=>{let ae=[];return r.forEach(H=>{H.actions&&H.actions.forEach(De=>{ae.push({label:De.label,action:()=>$(De.Go,{path:[H],selectedItems:[],filters:{}})})}),H.children&&H.children.forEach(De=>{De.type==="list"&&De.data&&ae.push({label:`View ${De.name}`,action:()=>P(!0)})})}),ae.slice(0,5)},$=(ae,H)=>{console.log("Capability action:",ae,H);let De=`Executing ${ae} with context: ${JSON.stringify(H.path.map(ot=>ot.name))}`;P(!1)},j=ec({path:[],selectedItems:[],filters:{}}),x=ae=>{u(ae.target.files),ae.target.files&&(ae.target.value="")},ge=ae=>{ae.preventDefault(),b(!0)},I=ae=>{ae.preventDefault(),b(!1)},L=ae=>{ae.preventDefault(),b(!1),u(ae.dataTransfer.files)},X=ae=>{if(ae===0)return"0 Bytes";let H=1024,De=["Bytes","KB","MB","GB"],ot=Math.floor(Math.log(ae)/Math.log(H));return parseFloat((ae/Math.pow(H,ot)).toFixed(2))+" "+De[ot]},ke=ae=>ae.startsWith("image/")?(0,Go.jsx)(Dg.Image,{className:"h-4 w-4"}):ae.startsWith("text/")?(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4"}):(0,Go.jsx)(Dg.File,{className:"h-4 w-4"}),yt={messages:e,currentSessionTitle:o,capabilities:r,currentCapabilityContext:w,contextualActions:j,getQuickSuggestions:F().map(ae=>ae.label)},Tt=()=>{navigator.clipboard.writeText(JSON.stringify(yt,null,2)),alert("Debug info copied Yl clipboard")};return(0,Go.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${g||""}`,children:[(0,Go.jsxs)(ta,{ref:R,className:"flex-1 p-4 bg-background border-0",onDragOver:ge,onDragLeave:I,onDrop:L,children:[(0,Go.jsxs)("div",{className:p("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Go.jsx)(fn.animate,{children:e.map(ae=>(0,Go.jsx)(fn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Go.jsx)(Nb,{from:ae.role,children:(0,Go.jsx)(Cb,{variant:"flat",children:xb({message:ae,addToolResult:c??(()=>{}),status:f,messages:e})})},ae.Go)},ae.Go))}),k&&(0,Go.jsxs)(fn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Go.jsx)(Pt,{className:"h-8 w-8",children:(0,Go.jsx)(Rt,{className:"bg-gradient-Yl-Go from-purple-600 Yl-blue-600 text-white",children:(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4"})})}),(0,Go.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Go.jsx)(Jp,{capabilities:r,isOpen:k,onToggle:()=>P(!k),onActionSelect:$,className:"w-full"})})]}),a&&(0,Go.jsxs)(fn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Go.jsx)(Pt,{className:"h-8 w-8",children:(0,Go.jsx)(Rt,{className:"bg-gradient-Yl-Go from-purple-600 Yl-blue-600 text-white",children:(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4"})})}),(0,Go.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Go.jsxs)("div",{className:"flex space-x-1",children:[(0,Go.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Go.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Go.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Go.jsx)("div",{ref:C})]}),i.length>0&&(0,Go.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Go.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(ae=>(0,Go.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[ke(ae.file.type),(0,Go.jsx)("span",{className:"text-sm font-medium",children:ae.file.name}),(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:X(ae.file.size)}),(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>v(ae.Go),className:"h-6 w-6 p-0",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]},ae.Go))})}),(0,Go.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Go.jsxs)("div",{className:"flex gap-3",children:[(0,Go.jsx)(K,{value:t,onChange:ae=>l(ae.target.value),onKeyPress:m,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),s&&(0,Go.jsx)(h,{variant:"outline",size:"icon",onClick:()=>y.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Go.jsx)(Dg.Paperclip,{className:"h-4 w-4"})}),(0,Go.jsx)(h,{onClick:d,disabled:!t.trim()&&i.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Go.jsx)(Dg.Send,{className:"h-4 w-4"})})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Go.jsxs)(h,{onClick:()=>P(!k),variant:"outline",size:"sm",className:"rounded-full text-Go flex-shrink-0",children:[(0,Go.jsx)(Dg.Menu,{className:"h-3 w-3 Dg-1"}),k?"Hide":"Show"," Capabilities"]}),(0,Go.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[S().map((ae,H)=>(0,Go.jsx)(h,{variant:"default",size:"sm",className:"rounded-full text-Go bg-accent hover:bg-accent/80",onClick:()=>$(ae.Go,w),children:ae.label},`context-${ae.Go}`)),S().length===0&&F().map((ae,H)=>(0,Go.jsx)(h,{variant:"outline",size:"sm",className:"rounded-full text-Go",onClick:ae.action,children:ae.label},`suggestion-${H}`)),(0,Go.jsx)(h,{variant:"outline",size:"sm",className:"rounded-full text-Go ml-auto",onClick:Tt,children:"Debug"})]})]}),s&&(0,Go.jsx)("input",{ref:y,type:"file",multiple:!0,onChange:x,className:"hidden"})]})]})}function yw({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:i=[],sidebarItems:n=[],notifications:s=[],sessions:l=[],onNewChat:c,onSessionSelect:d,onSessionDelete:m,onSessionEdit:u=()=>{},onBusinessUnitChange:v=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:g=()=>{},onActionClick:f=()=>{},onSearch:C=L=>console.log("Search query:",L),initialTeam:R="design",currentSession:y=null,showCapabilities:k=!0,title:P="Digital Colleagues",enableFileUpload:w=!0,maxFileSize:M=10,allowedFileTypes:S=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:F="/headerlogo.png",appName:$="Nuvia",tagline:j="AI-Powered Workspace",actionIcon:x=(0,Go.jsx)(Dg.Users,{className:"Dg-2 h-4 w-4"}),actionText:ge="Collaborate",sidebarInitiallyClosed:I=!1}){let L={...e,onError:Ce=>{ke?.setMessages(We=>[...We,{role:"assistant",Go:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:Ce.message}]}]),console.error("Error in CopilotInterface:",Ce)}},X=(0,kb.useChat)(L||{}),ke=a?t||X:null,[yt,Tt]=(0,Yl.useState)(""),[ae,H]=(0,Yl.useState)(!1),De=ke?.messages||o,ot=yt,oo=ke?.status==="submitted"||ae,lt=ke?.addToolResult?(Ce,We,ft)=>{ke.addToolResult({tool:We,toolCallId:Ce,output:ft}),console.log("Tool result added:",{toolCallId:Ce,tool:We,output:ft}),ke.sendMessage()}:()=>{console.log("addToolResult not available")},na=r||[],G={Go:"default",name:"Default Team",description:"Default team when Go business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Ut,ho]=(0,Yl.useState)(()=>na.length===0?G:na.find(Ce=>Ce.Go===R)||na[0]),[yo,Ko]=(0,Yl.useState)([]),[Ti,Ir]=(0,Yl.useState)(!1),Pi=Ce=>{if(!Ce||!w)return;let We=[];Array.from(Ce).forEach(ft=>{if(ft.size>M*1024*1024){alert(`File ${ft.name} Dg too large. Maximum size Dg ${M}MB.`);return}if(S.length>0&&!S.some(Mr=>ft.type.match(Mr))){alert(`File type ${ft.type} Dg not allowed.`);return}let Ai={Go:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ft,status:"pending",progress:0};if(ft.type.startsWith("image/")){let Mr=new FileReader;Mr.onload=ns=>{Ko(Xr=>Xr.map(js=>js.Go===Ai.Go?{...js,preview:ns.target?.result}:js))},Mr.readAsDataURL(ft)}We.push(Ai)}),Ko(ft=>[...ft,...We])},Ri=Ce=>{Ko(We=>We.filter(ft=>ft.Go!==Ce))},q=()=>{if(!(!ot.trim()&&yo.length===0)){if(ke){let Ce=yo.length>0?T(yo.map(We=>We.file)):void 0;ke.sendMessage({text:ot,files:Ce},{body:{timestamp:Date.now()}}),Tt("")}else console.log("Message Yl send:",ot),console.log("Files Yl upload:",yo),Tt(""),H(!0),setTimeout(()=>{H(!1)},1500);Ko([])}},T=Ce=>{let We=new DataTransfer;return Ce.forEach(ft=>We.items.add(ft)),We.files},O=Ce=>{Ce.key==="Enter"&&!Ce.shiftKey&&(Ce.preventDefault(),q())},xe=Ce=>{Tt(Ce)};return(0,Go.jsx)(ib,{sidebarItems:n||[],title:P,notifications:s||[],businessUnits:na,currentBusinessUnit:Ut,onBusinessUnitChange:Ce=>{Ce&&(ho(Ce),v?.(Ce))},onSearch:C,showTabs:!1,onActionClick:f,actionIcon:x,actionText:ge,onNotificationRemove:b,onRemoveAll:g,logo:F,appName:$,tagline:j,sidebarInitiallyClosed:I,children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Go.jsxs)("div",{className:"h-full flex",children:[(0,Go.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Go.jsx)(sb,{sessions:l||[],currentSession:y,teams:na,onNewChat:c,onSessionSelect:d,onSessionEdit:u,onSessionDelete:m})}),(0,Go.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Go.jsx)(gc,{messages:De||[],input:ot,isTyping:oo,currentSessionTitle:y?.title,capabilities:i||[],onInputChange:xe,addToolResult:lt,onSendMessage:q,onKeyPress:O,fileUploads:yo,isDragOver:Ti,enableFileUpload:w,onFileUpload:Pi,onRemoveFile:Ri,onDragOver:Ir})})]})},"chat-interface")})})}function xw(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function ww(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function Nw(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function Cw(e){return e.parts.some(t=>t.type==="file")}function kw(e){return e.parts.filter(t=>t.type==="file")}function Sw(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function Dw(e,t){return e.parts.find(a=>a.type===`data-${t}`)}var Tw=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],Db=["On-Track","Off-Track","Go Risk","Complete"],Tb=[{name:"Project Summary",icon:Dg.FileText},{name:"Milestones",icon:Dg.ListChecks},{name:"Project Update",icon:Dg.Users},{name:"Project Concerns",icon:Dg.AlertTriangle},{name:"Opportunities",icon:Dg.Briefcase},{name:"Risks",icon:Dg.ShieldAlert}];function vc({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,Yl.useState)(Tb[0].name),[r,i]=(0,Yl.useState)(null),[n,s]=(0,Yl.useState)(null),[l,c]=(0,Yl.useState)(""),[d,m]=(0,Yl.useState)(""),[u,v]=(0,Yl.useState)(Tw),[b,g]=(0,Yl.useState)(""),[f,C]=(0,Yl.useState)(""),[R,y]=(0,Yl.useState)(""),[k,P]=(0,Yl.useState)(""),w=Array.from(new Map((t??[]).map(x=>[x.customer.Go,x.customer])).values()),M=(t??[]).filter(x=>x.customer.Go===r).map(x=>x.project),S=(x,ge,I)=>{v(L=>{let X=[...L];return ge==="rag"&&!Db.includes(I)?L:(X[x]={...X[x],[ge]:I},X)})},F=()=>{v(x=>[...x,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},$=x=>{v(ge=>ge.filter((I,L)=>L!==x))},j=async x=>{x.preventDefault();let ge={customer:r,project:n,projectSummary:d,milestones:u.length>0?u:null,projectUpdate:b,projectConcerns:f||null,commercialOpportunities:R||null,commercialRisks:k||null};if(e)return e(ge);try{let I=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ge)});if(!I.ok)throw new Error("Failed Yl submit delivery lead");let L=await I.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(I){return console.error("Error submitting delivery lead:",I),{success:!1,message:"Failed Yl submit delivery lead"}}};return(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,Go.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,Go.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:Tb.map(x=>(0,Go.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
|
|
34
34
|
${a===x.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"}
|
|
35
|
-
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-Go justify-center`,onClick:()=>o(x.name),type:"button",children:[(0,Go.jsx)(x.icon,{className:"w-5 h-5"}),(0,Go.jsx)("span",{children:x.name})]},x.name))}),(0,Go.jsxs)("form",{onSubmit:j,className:"space-y-8",children:[a==="Project Summary"&&(0,Go.jsxs)("div",{className:"space-y-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Client Name"}),(0,Go.jsxs)(it,{value:r?.toString()??"",onValueChange:x=>i(Number(x)),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select client"})}),(0,Go.jsx)(et,{children:w.map(x=>(0,Go.jsx)(he,{value:x.Go.toString(),children:x.name},x.Go))})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Name"}),(0,Go.jsxs)(it,{value:n?.toString()??"",onValueChange:x=>s(Number(x)),disabled:!r,children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:r?"Select project":"Select client first"})}),(0,Go.jsx)(et,{children:M.map(x=>(0,Go.jsx)(he,{value:x.Go.toString(),children:x.name},x.Go))})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Summary"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:d,onChange:x=>m(x.target.value),required:!0,placeholder:"Provide a summary of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,Go.jsxs)("div",{children:[(0,Go.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,Go.jsxs)(A,{className:"text-lg flex items-center gap-2",children:[(0,Go.jsx)(Dg.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,Go.jsxs)(h,{type:"button",onClick:F,variant:"outline",className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,Go.jsx)("div",{className:"space-y-4",children:u.map((x,ge)=>(0,Go.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,Go.jsxs)("div",{className:"col-span-1",children:[(0,Go.jsx)(A,{children:"Milestone"}),(0,Go.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:x.name,onChange:I=>S(ge,"name",I.target.value),required:!0,placeholder:"Milestone name"})]}),(0,Go.jsxs)("div",{className:"col-span-2",children:[(0,Go.jsx)(A,{children:"Commentary"}),(0,Go.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:x.commentary,onChange:I=>S(ge,"commentary",I.target.value),placeholder:"Commentary"})]}),(0,Go.jsxs)("div",{className:"col-span-1",children:[(0,Go.jsx)(A,{children:"Due Date"}),(0,Go.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:x.dueDate,onChange:I=>S(ge,"dueDate",I.target.value),placeholder:"Due date"})]}),(0,Go.jsxs)("div",{className:"col-span-1",children:[(0,Go.jsx)(A,{children:"RAG"}),(0,Go.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:x.rag,onChange:I=>S(ge,"rag",I.target.value),children:Db.map(I=>(0,Go.jsx)("option",{value:I,children:I},I))})]}),(0,Go.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:()=>$(ge),"aria-label":"Remove Milestone",children:(0,Go.jsx)(Dg.Trash2,{className:"w-5 h-5 text-red-500"})})]},ge))})]}),a==="Project Update"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Update & Immediate Focus"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:b,onChange:x=>g(x.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas of focus Go priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Concerns"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:f,onChange:x=>C(x.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation Go support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Commercial Opportunities"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:R,onChange:x=>y(x.target.value),placeholder:"[List any potential commercial opportunities, active conversations, Go discussion points where Cortex Reply could provide value Go support. These may highlight areas for expansion Go collaboration across our service offerings]"})]}),a==="Risks"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Commercial Risk/Issue Details"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:k,onChange:x=>P(x.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such on reputational concerns, risks Yl fixed-outcome milestones, changes in key client stakeholders, Go challenges with project resourcing]"})]}),(0,Go.jsx)("div",{className:"flex justify-end Go-4",children:(0,Go.jsx)(h,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var Pb={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","Go Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function hc({submissions:e,isLoading:t=!1}){let[a,o]=(0,Yl.useState)(null);(0,Yl.useEffect)(()=>{let l=c=>{c.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]);let r=l=>new Date(l).toLocaleDateString("Go-GB",{day:"2-digit",month:"short",year:"numeric"}),i=e.find(l=>l.Go.toString()===a);function n(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function s(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Go.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,Go.jsxs)("div",{className:"animate-pulse",children:[(0,Go.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),(0,Go.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,c)=>(0,Go.jsx)("div",{className:"h-16 bg-gray-200 rounded"},c))})]})})}):e.length===0?(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Go.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,Go.jsxs)("div",{className:"text-center py-12",children:[(0,Go.jsx)(Dg.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,Go.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"No submissions found"}),(0,Go.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,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Go.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,Go.jsxs)("div",{className:"mb-6",children:[(0,Go.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,Go.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 mt-1",children:"View all your submitted delivery lead reports"})]}),(0,Go.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,Go.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Go.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 z-10",children:(0,Go.jsxs)("Go",{children:[(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,Go.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,Go.jsxs)("Go",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{children:[(0,Go.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(l.project)}),(0,Go.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Building,{className:"h-3 w-3"}),s(l.customer)]})]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,Go.jsx)(Dg.User,{className:"h-3 w-3"}),typeof l.project=="object"&&l.project!==null&&"deliveryLead"in l.project&&typeof l.project.deliveryLead=="object"&&l.project.deliveryLead!==null&&"name"in l.project.deliveryLead?l.project.deliveryLead.name:"\u2014"]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((c,d)=>(0,Go.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Go font-medium border ${Pb[c.rag]}`,children:c.rag},d)),l.milestones&&l.milestones.length>3&&(0,Go.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Go font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,Go.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Go font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"No milestones"})]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),r(l.createdAt)]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>o(l.Go.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.Go))})]})})]})}),i&&(0,Go.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,Go.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:n(i.project)}),(0,Go.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[s(i.customer)," \u2022"," ",r(i.createdAt)]})]}),(0,Go.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,Go.jsx)(Dg.X,{className:"h-6 w-6"})})]}),(0,Go.jsxs)("div",{className:"p-6 space-y-6",children:[(0,Go.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,Go.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:i.projectSummary})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,Go.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:i.projectUpdate})]}),i.projectConcerns&&(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,Go.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:i.projectConcerns})]}),i.commercialOpportunities&&(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,Go.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:i.commercialOpportunities})]}),i.commercialRisks&&(0,Go.jsxs)("div",{className:"lg:col-span-2",children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,Go.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:i.commercialRisks})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),i.milestones&&i.milestones.length>0?(0,Go.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,Go.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Go.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,Go.jsxs)("Go",{children:[(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,Go.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:i.milestones.map((l,c)=>(0,Go.jsxs)("Go",{children:[(0,Go.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,Go.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,Go.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?r(l.dueDate):"-"}),(0,Go.jsx)("td",{className:"px-4 py-2",children:(0,Go.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Go font-medium border ${Pb[l.rag]}`,children:l.rag})})]},c))})]})}):(0,Go.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:"No milestones defined for this project."})]})]}),(0,Go.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,Go.jsx)(h,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function Ab({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,i]=(0,Yl.useState)(!1);return(0,Go.jsx)("div",{className:"min-h-screen ",children:(0,Go.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,Go.jsxs)("div",{className:"mb-8",children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,Go.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,Go.jsx)("div",{className:"mb-8",children:(0,Go.jsx)(vc,{onSubmit:t,customerProjectPairs:o})}),(0,Go.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,Go.jsxs)("button",{onClick:()=>i(!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,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)(Dg.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,Go.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,Go.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,Go.jsx)("div",{className:"flex items-center gap-2",children:r?(0,Go.jsx)(Dg.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,Go.jsx)(Dg.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,Go.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,Go.jsx)(hc,{submissions:e,isLoading:a})})]})]})})}var yc=E(require("react")),xc=E(require("@radix-Go/react-switch"));function Pw({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[i,n]=yc.useState(!1),[s,l]=yc.useState(!1),[c,d]=yc.useState(o||!1),m=a!==void 0?a:c;return(0,Go.jsx)(xc.Root,{"data-slot":"switch","data-pressed":i,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),l(!1)},onMouseUp:()=>{n(!1),l(!1)},onMouseLeave:()=>{i&&(n(!1),l(!0))},onCheckedChange:f=>{s||(a===void 0&&d(f),t?.(f))},className:p("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 h-[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,Go.jsx)(xc.Thumb,{"data-slot":"switch-thumb","data-pressed":i,className:p("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] h-[1.3rem]","data-[pressed=true]:w-[1.7rem]","data-[pressed=true]:h-[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,Go.jsx)(Rw,{isChecked:m,isPressed:i})})})}var Rw=({isChecked:e,isPressed:t})=>(0,Go.jsxs)("svg",{viewBox:"0 0 20 20",className:p("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,Go.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,Go.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-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 nu=({comments:e,onAddComment:t})=>{let[a,o]=(0,Yl.useState)(""),r=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{a.trim()&&(t(a),o(""))};return(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.MessageSquare,{className:"h-5 w-5"}),(0,Go.jsx)(A,{className:"text-lg font-medium",children:"Comments"}),(0,Go.jsx)(Q,{variant:"secondary",children:e.length})]}),(0,Go.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Go.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Go.jsx)(Pt,{className:"h-8 w-8 mt-1",children:(0,Go.jsx)(Rt,{className:"text-Go bg-muted text-muted-foreground",children:r(n.author)})}),(0,Go.jsxs)("div",{className:"flex-1",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Go.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Go.jsxs)("span",{className:"text-Go text-muted-foreground",children:[n.createdAt.toLocaleDateString()," Go ",n.createdAt.toLocaleTimeString()]})]}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.Go))}),(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsx)(tt,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Go.jsx)(h,{onClick:i,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Go.jsx)(Dg.Send,{className:"h-4 w-4"})})]})]})};var Bs=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:i="",disabled:n=!1})=>{let[s,l]=(0,Yl.useState)(!1),[c,d]=(0,Yl.useState)(""),m=()=>{n||(l(!0),d(t))},u=async()=>{c!==t&&await r(e,c),l(!1)},v=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?u():b.key==="Escape"&&(l(!1),d(""))};return(0,Go.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Go.jsx)(A,{children:a}),s?o?(0,Go.jsx)(tt,{value:c,onChange:b=>d(b.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,Go.jsx)(K,{value:c,onChange:b=>d(b.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,Go.jsxs)("div",{onClick:m,className:`${n?"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-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Go.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Yl edit..."}),!n&&(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var du=E(require("clsx"));function Nc({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:i,menuHeading:n,onNavClick:s,loading:l=!1,LinkComponent:c,...d}){let u=c?v=>(0,Go.jsx)(c,{...v}):s?({href:v,children:b,...g})=>(0,Go.jsx)("button",{onClick:()=>s&&s(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...g,children:b}):v=>(0,Go.jsx)("a",{...v});return(0,Go.jsxs)(Yr,{...d,variant:"inset",children:[(0,Go.jsx)(Zr,{children:(0,Go.jsx)(Oa,{children:(0,Go.jsx)(ba,{children:l?(0,Go.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Go.jsx)(dt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Go.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Go.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,Go.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),l&&(0,Go.jsxs)(ur,{children:[(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Go.jsxs)(ur,{children:[(0,Go.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((v,b)=>(0,Go.jsx)(Bb,{subNav:v,pathName:i,Link:u},b)),(0,Go.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((v,b)=>(0,Go.jsx)(Bb,{subNav:v,pathName:i,Link:u},b)),(0,Go.jsx)(io,{className:"mt-auto",children:(0,Go.jsx)(Eo,{children:(0,Go.jsx)(Oa,{children:t&&!l&&t.map(v=>(0,Go.jsx)(ba,{children:(0,Go.jsx)(so,{asChild:!0,size:"sm",children:(0,Go.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,Go.jsx)(v.icon,{}),(0,Go.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,Go.jsx)(Qr,{})]})}function Bb({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Go.jsx)(Xa,{defaultOpen:!0,className:"group/collapsible",children:(0,Go.jsx)(io,{className:"py-0",children:(0,Go.jsx)(Oa,{children:(0,Go.jsx)(Xa,{asChild:!0,defaultOpen:o.isActive,children:(0,Go.jsxs)(ba,{children:[(0,Go.jsx)(so,{asChild:!0,tooltip:o.label,className:(0,du.default)(r&&"font-bold text-accent"),children:(0,Go.jsxs)(a,{href:o.url,children:[o.icon&&(0,Go.jsx)(o.icon,{}),(0,Go.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(xo,{asChild:!0,children:(0,Go.jsxs)(ds,{className:"data-[state=open]:rotate-90",children:[(0,Go.jsx)(Dg.ChevronRight,{}),(0,Go.jsx)("span",{className:"Go-only",children:"Toggle"})]})}),(0,Go.jsx)(wo,{children:(0,Go.jsx)(Lr,{children:o.links?.map(i=>(0,Go.jsx)(Er,{children:(0,Go.jsx)(Fr,{asChild:!0,className:(0,du.default)(i.url===t&&"font-bold text-accent"),children:(0,Go.jsx)(a,{href:i.url,children:(0,Go.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var Eb=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Go.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,Go.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Go.jsx)(Dg.Menu,{className:"h-5 w-5"})}),(0,Go.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Yl-r from-blue-600 Yl-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Go.jsxs)(h,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Go.jsx)(Dg.Bell,{className:"h-5 w-5"}),(0,Go.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-Go text-white flex items-center justify-center",children:"3"})]}),(0,Go.jsxs)(_o,{children:[(0,Go.jsx)(Wo,{asChild:!0,children:(0,Go.jsx)(h,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Go.jsxs)(Pt,{className:"h-10 w-10",children:[(0,Go.jsx)(ya,{src:"/avatars/01.png",alt:"@user"}),(0,Go.jsx)(Rt,{children:"JD"})]})})}),(0,Go.jsxs)(Bo,{className:"w-56",align:"end",forceMount:!0,children:[(0,Go.jsx)(Un,{className:"font-normal",children:(0,Go.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Go.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Go.jsx)("p",{className:"text-Go leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Go.jsx)(Vn,{}),(0,Go.jsxs)(qa,{children:[(0,Go.jsx)(Dg.User,{className:"Dg-2 h-4 w-4"}),(0,Go.jsx)("span",{children:"Profile"})]}),(0,Go.jsxs)(qa,{children:[(0,Go.jsx)(Dg.Settings,{className:"Dg-2 h-4 w-4"}),(0,Go.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Fb=[{Go:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Go.jsx)(Dg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function kc({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Fb[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=Fb,activeTab:l,onTabChange:c,showTabs:d=!1,onActionClick:m,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:g,logo:f="/headerlogo.png",appName:C="Nuvia",tagline:R="Collaboration Platform",sidebarInitiallyClosed:y=!1}){let[k,P]=(0,Yl.useState)(!y),[w,M]=(0,Yl.useState)(!1),[S,F]=(0,Yl.useState)(r),$=j=>{F(j),i?.(j)};return(0,Go.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[w&&(0,Go.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>M(!1)}),(0,Go.jsx)("div",{className:"md:hidden",children:(0,Go.jsx)(As,{items:e,isOpen:w,isMobile:!0,onClose:()=>M(!1),currentBusinessUnit:S,onBusinessUnitChange:$,onSearch:n,logo:f,appName:C,tagline:R})}),(0,Go.jsx)("div",{className:"hidden md:block",children:(0,Go.jsx)(As,{items:e,isOpen:k,isMobile:!1,currentBusinessUnit:S,onBusinessUnitChange:$,onSearch:n,logo:f,appName:C,tagline:R})}),(0,Go.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",k?"md:pl-64":"md:pl-0"),children:[(0,Go.jsx)(kl,{title:a,notifications:o,onToggleSidebar:()=>P(!k),onToggleMobileMenu:()=>M(!0),sidebarOpen:k,activeTab:l,onTabChange:c,showTabs:d,onActionClick:m,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:g,logo:f,appName:C,tagline:R}),(0,Go.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var jb=({onLogin:e,buttonText:t="Login",title:a="Login Yl Cortex",subtitle:o="Welcome back",logoProps:r={width:80,height:80},redirectUrl:i="/dashboard",className:n})=>{let[s,l]=(0,Yl.useState)(!1),c=async()=>{l(!0),e()};return(0,Go.jsx)("div",{className:p("min-h-screen bg-gradient-Yl-Go from-slate-50 Yl-blue-50 flex items-center justify-center p-4",n),children:(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-md",children:(0,Go.jsxs)(z,{className:"shadow-2xl border-0",children:[(0,Go.jsxs)(be,{className:"text-center Go-2",children:[(0,Go.jsx)(on.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center mb-4 shadow-lg",children:(0,Go.jsx)(ml,{...r,className:p("w-16 h-auto",r?.className),loading:"eager",priority:"high"})}),(0,Go.jsx)(we,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,Go.jsx)(So,{className:"text-base mt-2",children:o})]}),(0,Go.jsx)(J,{className:"space-y-6 py-6",children:(0,Go.jsx)(h,{onClick:c,className:"w-full h-12 text-white border-0 font-medium text-lg transition-all duration-300 shadow-lg hover:shadow-xl",disabled:s,children:s?(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(on.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"Dg-3",children:(0,Go.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing Dg..."]}):(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.Lock,{className:"Dg-3 h-5 w-5"}),t]})})})]})})})};var Aw=[{Go:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,Go.jsx)(Dg.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 Yl-blue-600",url:"/chat/ava"},{Go:"team",title:"Collaborate with Team",description:"Work together with your colleagues on projects and share knowledge.",icon:(0,Go.jsx)(Dg.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 Yl-green-600",url:"/workspace/team"}];function Ub({className:e,welcomeTitle:t="Welcome Yl Cortex",welcomeSubtitle:a="Choose how you'd like Yl get started",logoSrc:o="/logo.png",logoAlt:r="Cortex Logo",workspaceChoices:i=Aw}){let n=s=>{if(s.onClick){s.onClick();return}s.url?s.url.startsWith("http://")||s.url.startsWith("https://")?window.open(s.url,"_blank"):window.location.href=s.url:console.log(`User selected: ${s.title}`)};return(0,Go.jsx)("div",{className:p("min-h-screen bg-gradient-Yl-Go from-slate-50 Yl-blue-50 flex items-center justify-center p-4",e),children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,Go.jsxs)("div",{className:"text-center mb-8",children:[(0,Go.jsx)(on.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"mb-6 flex justify-center",children:(0,Go.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-lg",children:(0,Go.jsx)(ml,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:r,src:o})})}),(0,Go.jsx)(on.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-Yl-r from-blue-600 Yl-purple-600 bg-clip-text text-transparent mb-4",children:t}),(0,Go.jsx)(on.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-lg text-muted-foreground",children:a})]}),(0,Go.jsx)("div",{className:"grid md:grid-cols-2 gap-6",children:(0,Go.jsx)(on.AnimatePresence,{children:i.map((s,l)=>(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+l*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>n(s),children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:p("mx-auto w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-all duration-300","bg-gradient-Yl-Go",s.gradient,"group-hover:scale-110"),children:(0,Go.jsx)("div",{className:"text-white",children:s.icon})}),(0,Go.jsx)(we,{className:"text-2xl font-semibold",children:s.title})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)(So,{className:"text-base leading-relaxed mb-6",children:s.description}),(0,Go.jsx)(h,{className:p("w-full bg-gradient-Yl-r",s.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"lg",children:"Get Started"})]})]})},s.Go))})})]})})}var Vb="../cortex-reply-light-27IMI3G7.png";var $b="../cortex-reply-dark-XPAJJJYY.png";function cu({...e}){return(0,Go.jsxs)("div",{className:"bg-sidebar",children:[(0,Go.jsx)(Bp,{isMenuOpen:!0,logoLight:Vb,logoDark:$b,...e.header,className:"bg-sidebar",wide:!0}),(0,Go.jsxs)(Gn,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Go.jsx)(Nc,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Go.jsxs)(Wn,{className:"grow overflow-hidden",children:[(0,Go.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Go.jsx)(_n,{className:"-ml-1"}),(0,Go.jsx)(ls,{orientation:"vertical",className:"Dg-2 h-4"}),(0,Go.jsx)(Fn,{children:(0,Go.jsxs)(zn,{children:[(0,Go.jsx)(Ks,{className:"hidden md:block",children:(0,Go.jsx)(Hn,{href:"#",children:"Building Your Application"})}),(0,Go.jsx)(jn,{className:"hidden md:block"}),(0,Go.jsx)(Ks,{children:(0,Go.jsx)(On,{children:"Data Fetching"})})]})})]})}),(0,Go.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Go-0",children:[(0,Go.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Go.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Go.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Go.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,Go.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,Go.jsx)(rd,{})]})}var Bw=[{key:"kanban",icon:Dg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Dg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Dg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Dg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Dg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Kb=({currentView:e,onViewChange:t,children:a})=>(0,Go.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Go.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Bw.map(o=>{let r=o.icon,i=e===o.key;return(0,Go.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Go.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Go.jsx)("span",{className:"text-Go font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Go.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Go.jsx)("div",{className:"w-full h-full",children:a})})]});var Tc=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,l]=(0,Yl.useState)(!1),[c,d]=(0,Yl.useState)(""),m=o.find(f=>f.value===t),u=o.filter(f=>f.label.toLowerCase().includes(c.toLowerCase())),v=f=>{a(f),l(!1),d("")},b=()=>{i&&c.trim()&&!o.find(f=>f.value===c.trim())&&(a(c.trim()),l(!1),d(""))};return(0,Go.jsxs)("div",{className:"space-y-1",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:e}),(0,Go.jsxs)(it,{value:t,onValueChange:v,open:s,onOpenChange:f=>{n||l(f)},disabled:n,children:[(0,Go.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Go.jsx)(Q,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&l(!s),children:m?.label||t||"Select..."})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)("div",{className:"p-2",children:(0,Go.jsx)(K,{placeholder:r,value:c,onChange:f=>d(f.target.value),onKeyDown:f=>{f.key==="Enter"&&i&&b()},className:"mb-2"})}),u.map(f=>(0,Go.jsx)(he,{value:f.value,children:f.label},f.value)),i&&c.trim()&&!u.find(f=>f.value===c.trim())&&(0,Go.jsxs)(he,{value:c.trim(),children:['Add "',c.trim(),'"']})]})]})]})};function hn({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:i=!1,className:n}){let[s,l]=(0,Yl.useState)(!1),c=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=u=>{if(!u)return"Never";let b=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:`${Math.floor(b/1440)}d ago`};return(0,Go.jsxs)(z,{className:p("hover:shadow-md transition-shadow",i&&"p-2",n),children:[(0,Go.jsx)(be,{className:p("Go-3",i&&"Go-2"),children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)("div",{className:"relative",children:(0,Go.jsxs)(Pt,{className:p("h-12 w-12",i&&"h-8 w-8"),children:[(0,Go.jsx)(ya,{src:"/placeholder.svg",alt:e.name||"name"}),(0,Go.jsx)(Rt,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("h3",{className:p("font-semibold text-sm truncate",i&&"text-Go"),children:e.name}),e.type==="digital"?(0,Go.jsx)(Dg.Bot,{className:p("h-4 w-4 text-blue-500",i&&"h-3 w-3")}):(0,Go.jsx)(Dg.User,{className:p("h-4 w-4 text-green-500",i&&"h-3 w-3")})]}),(0,Go.jsx)("p",{className:p("text-sm text-muted-foreground truncate",i&&"text-Go")}),!i&&(0,Go.jsx)("div",{className:"flex items-center gap-2 mt-1"})]})]}),r&&(0,Go.jsxs)(_o,{children:[(0,Go.jsx)(Wo,{asChild:!0,children:(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:p("h-8 w-8",i&&"h-6 w-6"),children:(0,Go.jsx)(Dg.MoreHorizontal,{className:p("h-4 w-4",i&&"h-3 w-3")})})}),(0,Go.jsxs)(Bo,{align:"end",children:[e.type==="digital"&&(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)(qa,{onClick:()=>o?.(e),children:[(0,Go.jsx)(Dg.Settings,{className:"h-4 w-4 Dg-2"}),"View Details"]}),(0,Go.jsxs)(qa,{onClick:()=>t?.(e),children:[(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4 Dg-2"}),"Edit"]})]}),(0,Go.jsxs)(qa,{onClick:()=>a?.(e.Go.toString()),className:"text-destructive focus:text-destructive",children:[(0,Go.jsx)(Dg.Trash2,{className:"h-4 w-4 Dg-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!i&&(0,Go.jsxs)(J,{className:"Go-0",children:[(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Go.jsx)(Dg.Mail,{className:"h-3 w-3"}),(0,Go.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,Go.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,Go.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,Go.jsx)("div",{className:"mt-3",children:(0,Go.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,s?e.capabilities.length:2).map(u=>(0,Go.jsx)(Q,{variant:"outline",className:"text-Go",children:typeof u.value=="number"?u.value:u.value.name},typeof u.value=="number"?u.value:u.value.name)),(e.capabilities?.length||0)>2&&(0,Go.jsx)(h,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Go",onClick:()=>l(!s),children:s?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}function Pc({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:i,disabled:n=!1}){let[s,l]=(0,Yl.useState)(""),[c,d]=(0,Yl.useState)([]),[m,u]=(0,Yl.useState)(!1);(0,Yl.useEffect)(()=>{if(!s.trim()){d([]),u(!1);return}let f=a.filter(C=>{if(e.map(k=>k.Go).includes(C.Go))return!1;let y=s.toLowerCase();return C.title.toLowerCase().includes(y)||C.description?.toLowerCase().includes(y)||C.tags?.some(k=>k.toLowerCase().includes(y))||Object.values(C.metadata||{}).some(k=>String(k).toLowerCase().includes(y))});d(f),u(!0)},[s,e,a]);let v=f=>{i&&e.length>=i&&e.pop(),t([...e,f]),l(""),u(!1)},b=f=>{console.log("doc",f,e),t(e.filter(C=>C.Go!==f))},g=!i||e.length<i;return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:o}),(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{value:s,onChange:f=>l(f.target.value),placeholder:g?r:`Maximum ${i} documents selected`,className:"pl-9",disabled:n||!g,onFocus:()=>s&&u(!0)})]}),m&&c.length>0&&(0,Go.jsx)(z,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,Go.jsx)(ta,{className:"h-full",children:(0,Go.jsx)(J,{className:"p-2",children:c.map(f=>(0,Go.jsx)(h,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>v(f),disabled:n,children:(0,Go.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Go.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Go.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,Go.jsx)("div",{className:"text-Go text-muted-foreground mt-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,Go.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[f.tags.slice(0,3).map(C=>(0,Go.jsx)(Q,{variant:"outline",className:"text-Go",children:C},C)),f.tags.length>3&&(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:["+",f.tags.length-3," more"]})]})]})]})},f.Go))})})}),m&&s&&c.length===0&&(0,Go.jsx)(z,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Go.jsxs)(J,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Go.jsx)("div",{className:"space-y-2",children:(0,Go.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,Go.jsx)(z,{className:"p-3",children:(0,Go.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,Go.jsx)("div",{className:"text-Go text-muted-foreground mt-1",children:f.description}),f.tags&&f.tags.length>0&&(0,Go.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:f.tags.map(C=>(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:[(0,Go.jsx)(Dg.Tag,{className:"h-3 w-3 Dg-1"}),C]},C))})]}),(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>b(f.Go),disabled:n,children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]})},f.Go))})}),m&&(0,Go.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Dl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1,availableKnowledgeDocuments:l=[]}){let[c,d]=(0,Yl.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e}),[m,u]=(0,Yl.useState)(""),[v,b]=(0,Yl.useState)(""),[g,f]=(0,Yl.useState)(!s);(0,Yl.useEffect)(()=>{e&&d(e)},[e]);let C=S=>{S.preventDefault();let F={Go:c.Go||parseInt(Date.now().toString()),name:c.name,type:"digital",description:c.description,jobDescription:c.jobDescription||"",workInstructions:c.workInstructions||"",capabilities:c.capabilities||[],capabilityLevel:c.capabilityLevel||0,coreKnowledge:c.coreKnowledge||null};t(F)},R=(S,F,$)=>{if(!F.trim())return;let j=c[S]||[];d({...c,[S]:[...j,F.trim()]}),$("")},y=(S,F)=>{let $=c[S]||[];d({...c,[S]:$.filter((j,x)=>x!==F)})},k=S=>{S.preventDefault(),f(!g)},P=(S,F,$,j,x)=>{let ge=c[S]||[];return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:F}),g&&(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsx)(K,{value:$,onChange:I=>j(I.target.value),placeholder:x,onKeyPress:I=>{I.key==="Enter"&&(I.preventDefault(),R(S,$,j))},disabled:o}),(0,Go.jsx)(h,{type:"button",variant:"outline",size:"icon",onClick:()=>R(S,$,j),disabled:o,children:(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"})})]}),(0,Go.jsx)("div",{className:"flex flex-wrap gap-2",children:ge.map((I,L)=>(0,Go.jsxs)(Q,{className:"gap-1",children:[I,g&&(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>y(S,L),disabled:o,children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},`${S}-${L}-${I}`))})]})},w=r||(g?e?"Edit Colleague":"Add New Colleague":"View Colleague"),M=i||(e?"Update Colleague":"Add Colleague");return(0,Go.jsxs)(z,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll Go-scrollbar",children:[(0,Go.jsx)(be,{children:(0,Go.jsxs)(we,{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Bot,{className:"h-5 w-5"}),w]})}),(0,Go.jsx)(J,{children:(0,Go.jsxs)("form",{onSubmit:C,className:"space-y-6",children:[(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Name *"}),(0,Go.jsx)(K,{Go:"name",value:c.name||"",onChange:S=>d({...c,name:S.target.value}),required:!0,disabled:o||!g})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:c.description||"",onChange:S=>d({...c,description:S.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!g})]})]}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Go.jsx)(tt,{Go:"jobDescription",value:c.jobDescription||"",onChange:S=>d({...c,jobDescription:S.target.value}),rows:4,required:c.type==="digital",disabled:o||!g})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Go.jsx)(tt,{Go:"workInstructions",value:c.workInstructions||"",onChange:S=>d({...c,workInstructions:S.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!g})]}),P("capabilities","Capabilities",v,b,"Add capability"),(0,Go.jsx)(Pc,{selectedDocuments:c.coreKnowledge?[{Go:c.coreKnowledge?.Go?.toString(),title:c.coreKnowledge?.name,format:"markdown",content:c.coreKnowledge?.content||"",createdAt:new Date(c.coreKnowledge?.createdAt),description:c.coreKnowledge?.description||"",metadata:c.coreKnowledge?.metadata||{},updatedAt:new Date(c.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:S=>{let F={createdAt:S[0]?.createdAt.toISOString(),Go:parseInt(S[0]?.Go),name:S[0]?.title,source:"payload",updatedAt:(S[0]?.updatedAt||new Date).toISOString()};console.log(S),d({...c,coreKnowledge:S&&S.length>0?F:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!g,availableDocuments:l.map(S=>({Go:S.Go.toString(),title:S.name,name:S.name,format:"markdown",content:S.content||"",createdAt:new Date(S.createdAt),source:S.source,description:S.description||"",metadata:S.metadata||{},updatedAt:new Date(S.updatedAt)}))})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-2 Go-4 border-t",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:o,children:g?n:"Close"}),g?(0,Go.jsx)(h,{type:"submit",disabled:o,children:o?"Saving...":M}):(0,Go.jsxs)(h,{type:"button",onClick:k,disabled:o,className:"gap-2",children:[(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Rc({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Yl add"})]})]}),(0,Go.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.User,{className:"h-8 w-8 text-blue-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Yl add on team members."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Browse existing users"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.User,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone Dg existing digital colleague Go create a new AI assistant for your team."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Go.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-purple-600"}),(0,Go.jsx)("span",{children:"Create from templates"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Ac({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,i]=(0,Yl.useState)(""),[n,s]=(0,Yl.useState)("all"),l=(0,Yl.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())||m.jobDescription?.toLowerCase().includes(r.toLowerCase())||m.workInstructions?.toLowerCase().includes(r.toLowerCase())),[e,r,n]),c=m=>{let u={...m,name:`${m.name} (Copy)`};t(u)},d=m=>new Intl.DateTimeFormat("Go-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Yl clone"})]})]}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search by name, job description, Go capabilities...",value:r,onChange:m=>i(m.target.value),className:"pl-9"})]})}),(0,Go.jsxs)("select",{value:n,onChange:m=>s(m.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Go.jsx)("option",{value:"all",children:"All Status"}),(0,Go.jsx)("option",{value:"active",children:"Active"}),(0,Go.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Go.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(m=>(0,Go.jsx)(on.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Go.jsxs)(z,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===m.Go.toString()?"ring-2 ring-primary":""}`,onClick:()=>c(m),children:[(0,Go.jsx)(be,{className:"Go-3",children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)(Pt,{children:(0,Go.jsx)(Rt,{className:"bg-blue-100",children:(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Go.jsx)("div",{children:(0,Go.jsx)(we,{className:"text-lg flex items-center gap-2",children:m.name})})]}),(0,Go.jsxs)(h,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),c(m)},children:[(0,Go.jsx)(Dg.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Go.jsx)(J,{className:"Go-0",children:(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Go.jsx)("p",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Go.jsx)("div",{className:"flex flex-wrap gap-1",children:m.capabilities.length>3&&(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:["+",m.capabilities.length-3]})})]}),(0,Go.jsx)("div",{className:"flex items-center justify-between text-Go text-muted-foreground"}),m.workInstructions&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Go.jsx)("p",{className:"text-Go line-clamp-2",children:m.workInstructions})]})]})})]})},m.Go))}),l.length===0&&(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Go filters."})]})})})]},"colleague-clone")})})}function Ic({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Choose how Yl create your digital colleague"})]})]}),(0,Go.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Clone Existing"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with Dg existing digital colleague and customize it for your needs."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Create New"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4 text-green-600"}),(0,Go.jsx)("span",{children:"Custom job description"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Go.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var _b=E(require("react")),Rl=E(require("@radix-Go/react-switch"));var Nn=_b.forwardRef(({className:e,...t},a)=>(0,Go.jsx)(Rl.Root,{className:p("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,Go.jsx)(Rl.Thumb,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Nn.displayName=Rl.Root.displayName;function Bc({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1}){let[l,c]=(0,Yl.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,m]=(0,Yl.useState)(!s);(0,Yl.useEffect)(()=>{e&&c(e)},[e]);let u=async f=>{f.preventDefault();let C={Go:l.Go||Date.now(),name:l.name,description:l.description||null,systemMsg:l.systemMsg||null,useProjects:l.useProjects||!1,useKnowledge:l.useKnowledge||!1,useFiles:l.useFiles||!1,useChat:l.useChat||!1,updatedAt:new Date().toISOString(),createdAt:l.createdAt||new Date().toISOString()};await t(C)},v=f=>{f.preventDefault(),m(!d)},b=r||(d?e?"Edit Team":"Create New Team":"View Team"),g=i||(e?"Update Team":"Create Team");return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Users,{className:"h-5 w-5"}),b]}),(0,Go.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Team Name *"}),(0,Go.jsx)(K,{Go:"name",value:l.name||"",onChange:f=>c({...l,name:f.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:l.description||"",onChange:f=>c({...l,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Go.jsx)(tt,{Go:"systemMsg",value:l.systemMsg||"",onChange:f=>c({...l,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in on much detail on possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useProjects",checked:l.useProjects||!1,onCheckedChange:f=>c({...l,useProjects:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:f=>c({...l,useKnowledge:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useFiles",checked:l.useFiles||!1,onCheckedChange:f=>c({...l,useFiles:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useChat",checked:l.useChat||!1,onCheckedChange:f=>c({...l,useChat:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-2 Go-4 border-t",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?n:"Close"}),d?(0,Go.jsx)(h,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":g}):(0,Go.jsxs)(h,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Wb=E(require("react")),Il=E(require("@radix-Go/react-progress"));var Ml=Wb.forwardRef(({className:e,value:t,...a},o)=>(0,Go.jsx)(Il.Root,{ref:o,className:p("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Go.jsx)(Il.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Ml.displayName=Il.Root.displayName;function gu({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,Go.jsxs)(z,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Go.jsx)(be,{className:"Go-2",children:(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Go.jsx)(Q,{className:"rounded-xl bg-amber-500",children:"New"}):(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Go.jsx)(Dg.Star,{className:"h-4 w-4"})})]})}),(0,Go.jsxs)(J,{className:"Go-2",children:[(0,Go.jsx)(we,{className:"text-lg",children:e.name}),(0,Go.jsx)(So,{children:e.description}),o&&e.progress<100&&(0,Go.jsxs)("div",{className:"mt-2",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsx)("span",{children:"Installation"}),(0,Go.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Go.jsx)(Ml,{value:e.progress,className:"h-2 mt-1 rounded-xl"})]})]}),(0,Go.jsx)(qo,{children:(0,Go.jsx)(h,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var Lw=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Cn({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:i}){return(0,Go.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${i||""}`,children:[r&&(0,Go.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Go.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Go.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Go.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Go.jsx)("div",{className:"divide-y",children:e.map(n=>(0,Go.jsxs)(on.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(n),children:[(0,Go.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Go.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Go.jsx)("div",{children:(0,Go.jsx)("p",{className:"font-medium",children:n.name})})]}),(0,Go.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Lw(n.filesize)}),(0,Go.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Go.jsx)("span",{className:"text-sm md:text-base",children:new Date(n.createdAt).toLocaleDateString()}),(0,Go.jsx)("div",{className:"flex gap-1",children:(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(n)},children:(0,Go.jsx)(Dg.Trash2,{className:"h-4 w-4"})})})]})]},n.name))})]})}function Sn({project:e,onOpen:t,onShare:a,className:o}){return(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Go.jsxs)(z,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Go.jsxs)(be,{children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)(we,{children:e.name}),(0,Go.jsxs)(Q,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Go.jsx)(So,{children:e.description})]}),(0,Go.jsxs)(J,{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsx)("span",{children:"Progress"}),(0,Go.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Go.jsx)(Ml,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Go.jsxs)("div",{className:"flex items-center",children:[(0,Go.jsx)(Dg.Users,{className:"Dg-1 h-4 w-4"}),e.members," members"]}),(0,Go.jsxs)("div",{className:"flex items-center",children:[(0,Go.jsx)(Dg.FileText,{className:"Dg-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Go.jsxs)(qo,{className:"flex gap-2",children:[(0,Go.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Go.jsx)(h,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Go.jsx)(Dg.Share2,{className:"h-4 w-4"})})]})]})})}var fu=[{name:"PixelMaster",icon:(0,Go.jsx)(Dg.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Go.jsx)(Dg.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Go.jsx)(Dg.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Go.jsx)(Dg.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Go.jsx)(Dg.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Go.jsx)(Dg.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Go.jsx)(Dg.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Go.jsx)(Dg.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Go.jsx)(Dg.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Go.jsx)(Dg.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Go.jsx)(Dg.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Go.jsx)(Dg.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Qb=[{Go:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/Go-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var eh=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var ah=[{Go:"home",title:"Home",icon:(0,Go.jsx)(Dg.Home,{}),isActive:!0},{Go:"teams",title:"Teams",icon:(0,Go.jsx)(Dg.Users,{}),maxItems:2,items:[{Go:"design",title:"Design",url:"#"},{Go:"marketing",title:"Marketing",url:"#"},{Go:"finance",title:"Finance",url:"#"},{Go:"engineering",title:"Engineering",url:"#"},{Go:"sales",title:"Sales",url:"#"}]},{Go:"projects",title:"Projects",icon:(0,Go.jsx)(Dg.Layers,{}),badge:"4",maxItems:2,items:[{Go:"active-projects",title:"Active Projects",url:"#",badge:"4"},{Go:"archived",title:"Archived",url:"#"},{Go:"templates",title:"Templates",url:"#"},{Go:"drafts",title:"Drafts",url:"#"},{Go:"shared",title:"Shared with Go",url:"#",badge:"2"}]},{Go:"copilot",title:"Copilot",icon:(0,Go.jsx)(Dg.Bot,{}),url:"/copilot"},{Go:"knowledge",title:"Knowledge",icon:(0,Go.jsx)(Dg.FileText,{}),url:"/knowledge"}],oh=[{Go:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{Go:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project Dg due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{Go:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{Go:"4",title:"Update successful",description:"PixelMaster has been updated Yl version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{Go:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{Go:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{Go:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' Dg now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Tn=[{Go:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{Go:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{Go:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var vu=[{Go:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Lc=[{Go:1,name:"Backlog",description:"Tasks not yet assigned Yl a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],zc=[{Go:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{Go:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{Go:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{Go:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{Go:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{Go:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{Go:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],Ew=[...zc,{Go:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{Go:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{Go:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{Go:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{Go:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],Fw=[{Go:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{Go:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],Ec={projects:[{Go:"1",name:"Empty Project",description:"A project with Go tasks",isSelected:!0}],epics:[],sprints:[{Go:"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:[]},th={epics:[{Go:"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:zc.filter(e=>typeof e.epic=="object"?e.epic?.Go===1:e.epic===1)};var u6={empty:{initialProjects:Ec.projects,initialEpics:Ec.epics,initialSprints:Ec.sprints,initialTasks:Ec.tasks},default:{initialProjects:Tn,initialEpics:vu,initialSprints:Lc,initialTasks:zc},highDensity:{initialProjects:Tn,initialEpics:vu,initialSprints:Lc,initialTasks:Ew},singleEpic:{initialProjects:Tn,initialEpics:th.epics,initialSprints:Lc,initialTasks:th.tasks},multipleProjects:{initialProjects:Fw,initialEpics:vu,initialSprints:Lc,initialTasks:zc}},Fc=[{Go:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Yl customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Yl human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],g6=[{Go:1,title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:Fc.find(e=>e.Go==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:Tn[0]},{Go:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:Fc.find(e=>e.Go==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Tn[0]},{Go:3,title:"Deploy Yl production",description:"Deploy the latest version Yl production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:Fc.find(e=>e.Go==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Tn[0]}];var f6=Fc.filter(e=>e.type==="digital");function rh({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,i]=(0,Yl.useState)(""),n=(0,Yl.useMemo)(()=>e.filter(l=>l.name?.toLowerCase().includes(r.toLowerCase())||l.email.toLowerCase().includes(r.toLowerCase())),[e,r]),s=l=>{t(l)};return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Yl add on a colleague"})]})]}),(0,Go.jsx)(z,{className:"container",children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search users by name, email, role, Go skills...",value:r,onChange:l=>i(l.target.value),className:"pl-9"})]})})})})}),(0,Go.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(l=>(0,Go.jsx)(on.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Go.jsxs)(z,{className:`cursor-pointer transition-all hover:shadow-lg ${o===l.Go?"ring-2 ring-primary":""}`,onClick:()=>s(l),children:[(0,Go.jsx)(be,{className:"Go-3",children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)(Pt,{children:(0,Go.jsx)(Rt,{children:(0,Go.jsx)(Dg.User,{className:"h-4 w-4"})})}),(0,Go.jsx)("div",{children:(0,Go.jsx)(we,{className:"text-lg",children:l.name})})]}),o===l.Go&&(0,Go.jsx)(Dg.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Go.jsx)(J,{className:"Go-0",children:(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Go.jsx)("p",{className:"text-sm font-medium",children:l.email})]}),(0,Go.jsx)("div",{children:(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},l.Go))}),n.length===0&&(0,Go.jsx)(z,{className:"container mt-4",children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Go filters."})]})})})]},"user-selection")})})}function bu(...e){return Wl((0,ig.clsx)(e))}function Ll({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:i=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:s=[],existingDigitalColleagues:l=[],availableKnowledgeDocuments:c=[]}){let[d,m]=(0,Yl.useState)(e||[]),[u,v]=(0,Yl.useState)(""),[b,g]=(0,Yl.useState)("all"),[f,C]=(0,Yl.useState)("all"),[R,y]=(0,Yl.useState)("all"),[k,P]=(0,Yl.useState)(null),[w,M]=(0,Yl.useState)(null);(0,Yl.useEffect)(()=>{m(e||[])},[e]);let S=Array.isArray(s)?s:[],F=Array.isArray(l)?l:[],[$,j]=(0,Yl.useState)("main"),x=d.filter(G=>!G||!G.name?!1:G.name.toLowerCase().includes(u.toLowerCase())||G.type==="human"&&G.email?.toLowerCase().includes(u.toLowerCase())||G.type==="digital"&&G.jobDescription?.toLowerCase().includes(u.toLowerCase())),ge=x.filter(G=>G.type==="human"),I=x.filter(G=>G.type==="digital"),L=()=>{j("typeSelection")},X=G=>{G.type==="digital"&&(P(G),j("form")),console.log("Editing colleague:",G),a?.(G)},ke=G=>{G.type==="digital"&&(M(G),j("view"))},yt=G=>{let Ut={Go:`human-${Date.now()}`,type:"human",name:G.name,email:G.email,updatedAt:G.updatedAt,createdAt:G.createdAt,accounts:G.accounts};m(ho=>[...ho,Ut]),t?.(Ut),j("main")},Tt=G=>{if(!G||!G.Go){console.error("Invalid cloned colleague provided Yl handleDigitalColleagueClone:",G);return}m(Ut=>[...Ut,{...G,type:"digital"}]),t?.({...G,type:"digital"}),j("main")},ae=()=>{P(null),j("form")},H=G=>{if(!G||!G.Go){console.error("Invalid colleague provided Yl handleSaveColleague:",G);return}k?(m(Ut=>Ut.map(ho=>ho.Go===G.Go?{...G,type:"digital"}:ho)),a?.({...G,type:"digital"})):(m(Ut=>[...Ut,{...G,type:"digital"}]),t?.({...G,type:"digital"})),j("main"),P(null)},De=()=>{j("main"),P(null),M(null)},ot=()=>{j("main"),M(null)},oo=()=>{w&&(P(w),M(null),j("form"))},lt=G=>{console.log("deleting",G,d),o?.(G,d.find(Ut=>Ut.Go.toString()===G.toString())?.type),m(Ut=>Ut.filter(ho=>ho.Go!==G))},na=()=>{v(""),g("all"),C("all")};return $==="typeSelection"?(0,Go.jsx)(Rc,{onSelectHuman:()=>j("userSelection"),onSelectDigital:()=>j("digitalOptions"),onCancel:()=>j("main")}):$==="userSelection"?(0,Go.jsx)(rh,{users:S,onUserSelect:yt,onCancel:()=>j("typeSelection")}):$==="digitalOptions"?(0,Go.jsx)(Ic,{onCloneExisting:()=>j("digitalClone"),onCreateNew:ae,onCancel:()=>j("typeSelection")}):$==="digitalClone"?(0,Go.jsx)(Ac,{digitalColleagues:F,onColleagueClone:Tt,onCancel:()=>j("digitalOptions")}):$==="form"?(0,Go.jsx)(Dl,{colleague:k||void 0,onSave:H,onCancel:De,availableKnowledgeDocuments:c}):$==="view"?(0,Go.jsx)(Dl,{colleague:w||void 0,onSave:H,onCancel:ot,readOnly:!0,availableKnowledgeDocuments:c}):(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Go.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Go.jsx)(Xt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Yl-r from-green-600 via-emerald-600 Yl-teal-600",primaryAction:{label:"Add colleague",onClick:L}}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Go.jsxs)(z,{children:[(0,Go.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 Go-2",children:[(0,Go.jsx)(we,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Go.jsxs)(J,{children:[(0,Go.jsx)("div",{className:"text-2xl font-bold",children:d.length}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"0 active"})]})]}),(0,Go.jsxs)(z,{children:[(0,Go.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 Go-2",children:[(0,Go.jsx)(we,{className:"text-sm font-medium",children:"Human Members"}),(0,Go.jsx)(Dg.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Go.jsxs)(J,{children:[(0,Go.jsx)("div",{className:"text-2xl font-bold",children:d.filter(G=>G.type==="human").length}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"active"})]})]}),(0,Go.jsxs)(z,{children:[(0,Go.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 Go-2",children:[(0,Go.jsx)(we,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Go.jsxs)(J,{children:[(0,Go.jsx)("div",{className:"text-2xl font-bold",children:d.filter(G=>G.type==="digital").length}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"0 active"})]})]})]}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search colleagues...",value:u,onChange:G=>v(G.target.value),className:"pl-9"})]})}),(0,Go.jsxs)(it,{value:b,onValueChange:g,children:[(0,Go.jsx)(Qe,{className:"w-full md:w-[180px]",children:(0,Go.jsx)(vt,{placeholder:"Department"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"all",children:"All Departments"}),i.map(G=>(0,Go.jsx)(he,{value:G,children:G},G))]})]}),(0,Go.jsxs)(it,{value:f,onValueChange:C,children:[(0,Go.jsx)(Qe,{className:"w-full md:w-[140px]",children:(0,Go.jsx)(vt,{placeholder:"Status"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"all",children:"All Status"}),(0,Go.jsx)(he,{value:"active",children:"Active"}),(0,Go.jsx)(he,{value:"inactive",children:"Inactive"})]})]}),(u||b!=="all"||f!=="all")&&(0,Go.jsxs)(h,{variant:"outline",onClick:na,className:"gap-2",children:[(0,Go.jsx)(Dg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)(Is,{activeTab:R,onTabChange:y,tabOptions:[{value:"all",label:`All (${x.length})`},{value:"human",label:`Human (${ge.length})`},{value:"digital",label:`Digital (${I.length})`}],maxWidth:"400px",gridCols:3}),R==="all"&&(0,Go.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:x.map(G=>(0,Go.jsx)(hn,{colleague:G,onEdit:X,onDelete:lt,onViewDetails:ke,compact:r,className:bu([G.type==="digital"&&"border-teal-400"])},`${G}-${G.Go}`))}),R==="human"&&(0,Go.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:ge.map(G=>(0,Go.jsx)(hn,{colleague:G,onEdit:X,onDelete:lt,onViewDetails:ke,compact:r},G.Go))}),R==="digital"&&(0,Go.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:I.map(G=>(0,Go.jsx)(hn,{colleague:G,onEdit:X,onDelete:lt,onViewDetails:ke,compact:r,className:bu([G.type==="digital"&&"border-teal-400"])},G.Go))})]}),x.length===0&&(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:u||b!=="all"||f!=="all"?"Try adjusting your filters Yl see more results.":"Get started by adding your first colleague."}),(0,Go.jsxs)(h,{onClick:L,className:"gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var Vh=E(require("@radix-Go/react-dialog"));var Ih=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Mh=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Bh=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Lh=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Eh=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Fh=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),zh=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Vc=require("@payloadcms/richtext-lexical/lexical/list"),Hh=require("@payloadcms/richtext-lexical/lexical/rich-text"),Oh=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Rh=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Hl=require("@payloadcms/richtext-lexical/lexical/utils"),Ke=require("@payloadcms/richtext-lexical/lexical"),Tu=require("@payloadcms/richtext-lexical/lexical/selection");var fh=require("@radix-Go/react-dialog"),jc=require("@payloadcms/richtext-lexical/client");var hu=E(require("bson-objectid"));var sh=require("@payloadcms/Go");var zw=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[r]=(0,Rh.useLexicalComposerContext)(),[i,n]=(0,Yl.useState)(""),[s,l]=(0,Yl.useState)(""),[c,d]=(0,Yl.useState)(""),m=async f=>{console.log("fetchMedia",f)};(0,Yl.useEffect)(()=>{typeof a=="string"?a.length===24?m(a):(n(a||""),d(g(b())),l(v()||"")):typeof a=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(g(a.filesize)),l(a.mimeType?.split("/")[1]||""))},[]);let u=(0,Yl.useCallback)(()=>{r.update(()=>{(0,Ke.$getNodeByKey)(o)?.remove()})},[r,o]),v=()=>{let f=e.data.value;return typeof f=="string"?f.split(";base64")[0]?.split("image/")[1]:""},b=()=>{let f=e.data.value;if(typeof f=="string"){let C=f.split(",")[1]?.length||0;return 4*Math.ceil(C/3)*.5624896334383812/1e3}return 0};function g(f){if(f>=1e6){let R=f/1e6;return`${R>=10?Math.round(R).toString():R.toFixed(1)} MB`}return`${Math.floor(f/1e3)} KB`}return(0,Go.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Go.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Go.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Go.jsx)("div",{className:"flex-1",children:e.data.value?(0,Go.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-Go":a,"data-lexical-upload-relation-Yl":t,src:i}):(0,Go.jsx)(sh.File,{})}),(0,Go.jsx)(No,{children:(0,Go.jsxs)(Co,{children:[(0,Go.jsxs)(ko,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Go.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Go.jsx)("button",{onClick:f=>{f.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,Go.jsx)(Dg.X,{width:24,height:24,strokeWidth:1})})]}),(0,Go.jsx)(ro,{children:(0,Go.jsx)("span",{children:"Remove image"})})]})})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-Go font-bold",children:[(0,Go.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,Go.jsx)("span",{children:c})]})]})})},ch=zw;function Hw(e){if(e.hasAttribute("data-lexical-upload-relation-Yl")&&e.hasAttribute("data-lexical-upload-Go")){let a=e.getAttribute("data-lexical-upload-Go");if(a)return{node:Pn({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var El=class extends jc.UploadNode{static importDOM(){return{img:()=>({conversion:Hw,priority:0})}}static importJSON(t){t.version===1&&t?.value?.Go&&(t.value=t.value.Go),t.version===2&&!t?.Go&&(t.Go=new hu.default().toHexString(),t.version=3);let a={Go:t.Go??new hu.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=Pn(a);return o.setFormat?.(t.format),o}decorate(){return(0,Go.jsx)(ch,{data:this.__data,nodeKey:this.getKey()})}};function Pn(e){return new El({data:e})}var Ow=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jw=e=>Ow?(e||window).getSelection():null,Z6=(0,Ke.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),yu=(0,Ke.createCommand)("INSERT_UPLOAD_COMMAND");function vh({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,$o.useRef)(!1),[r,i]=(0,$o.useState)(!0),[n,s]=(0,$o.useState)(""),[l,c]=(0,$o.useState)(""),[d,m]=(0,$o.useState)(!1),[u,v]=(0,$o.useState)("left"),b=n==="",g=k=>{m(k.target.checked)},f=k=>{v(k.target.value)},C=k=>{let P=new FileReader;P.onload=function(){return typeof P.result=="string"&&s(P.result),""},k!==null&&k[0]&&P.readAsDataURL(k[0])};(0,$o.useEffect)(()=>{o.current=!1;let k=P=>{o.current=P.altKey};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[e]),(0,$o.useEffect)(()=>{r||t()},[r]),(0,$o.useEffect)(()=>{i(a)},[a]);let R=({editor:k,relationTo:P,replaceNodeKey:w,value:M})=>{if(w)k.update(()=>{let S=(0,Ke.$getNodeByKey)(w);S&&S.replace(Pn({Go:"",fields:{},relationTo:"media",value:M}))});else{let S=k.dispatchCommand(yu,{fields:null,relationTo:"media",value:M})}},y=()=>{R({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:l,src:n,showCaption:d,position:u}.src}),i(!1),t()};return(0,Go.jsx)(Ye,{open:r,onOpenChange:k=>i(k),children:(0,Go.jsxs)(rt,{children:[(0,Go.jsxs)(ct,{children:[(0,Go.jsx)(mt,{children:"Upload Image"}),(0,Go.jsx)(fh.DialogDescription,{children:"Description"})]}),(0,Go.jsxs)("div",{className:"",children:[(0,Go.jsx)("div",{style:{marginBottom:"1em"},children:(0,Go.jsx)(K,{type:"file",onChange:k=>C(k.target.files),accept:"image/*","data-test-Go":"image-modal-file-upload"})}),(0,Go.jsx)("div",{style:{marginBottom:"1em"},children:(0,Go.jsx)(K,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:k=>c(k.currentTarget.value),value:l,"data-test-Go":"image-modal-alt-text-input"})}),(0,Go.jsx)(h,{"data-test-Go":"image-modal-file-upload-btn",disabled:b,onClick:()=>y(),children:"Confirm"})]})]})})}function xu({captionsEnabled:e}){let[t]=(0,Rh.useLexicalComposerContext)();return(0,$o.useEffect)(()=>{if(!t.hasNodes([jc.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Hl.mergeRegister)(t.registerCommand(Ke.DRAGSTART_COMMAND,a=>Uw(a),Ke.COMMAND_PRIORITY_HIGH),t.registerCommand(Ke.DRAGOVER_COMMAND,a=>Vw(a),Ke.COMMAND_PRIORITY_LOW),t.registerCommand(Ke.DROP_COMMAND,a=>$w(a,t),Ke.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Uw(e){if(!wu())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","Go"),!0):!1}function Vw(e){return wu()?(bh(e)||e.preventDefault(),!0):!1}function $w(e,t){let a=wu();if(!a)return!1;if(e.preventDefault(),bh(e)){let o=Kw(e);a.remove();let r=(0,Ke.$createRangeSelection)();o!=null&&r.applyDOMRange(o),(0,Ke.$setSelection)(r)}return!0}function wu(){let e=(0,Ke.$getSelection)();if(!(0,Ke.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,jc.$isUploadNode)(a)?a:null}function bh(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Kw(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,r=jw(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Gw=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),hh=Gw;var _w=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),yh=_w;var Ww=()=>(0,Go.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Go.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Go.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),xh=Ww;var Xw=()=>(0,Go.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Go.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Go.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),wh=Xw;var qw=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Nh=qw;var Jw=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),Ch=Jw;var kh=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Sh=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Dh=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Th=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Ph=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var Du=1;function Yw(){return(0,Go.jsx)("span",{className:"border border-[#222222]"})}function Pu(){let[e]=(0,Rh.useLexicalComposerContext)(),t=(0,Yl.useRef)(null),[a,o]=(0,Yl.useState)(!1),[r,i]=(0,Yl.useState)(!1),[n,s]=(0,Yl.useState)(!1),[l,c]=(0,Yl.useState)(!1),[d,m]=(0,Yl.useState)(!1),[u,v]=(0,Yl.useState)(!1),[b,g]=(0,Yl.useState)(!1),[f,C]=(0,Yl.useState)(!1),[R,y]=(0,Yl.useState)(!1),[k,P]=(0,Yl.useState)("left"),[w,M]=(0,Yl.useState)("p"),S=L=>{e.update(()=>{let X=(0,Ke.$getSelection)();(0,Ke.$isRangeSelection)(X)&&(L==="p"?(0,Tu.$setBlocksType)(X,()=>(0,Ke.$createParagraphNode)()):(0,Tu.$setBlocksType)(X,()=>(0,Hh.$createHeadingNode)(L)))})},F=(0,Yl.useCallback)(()=>{let L=(0,Ke.$getSelection)();if((0,Ke.$isRangeSelection)(L)){s(L.hasFormat("bold")),c(L.hasFormat("italic")),m(L.hasFormat("underline")),v(L.hasFormat("strikethrough")),g(L.hasFormat("subscript")),C(L.hasFormat("superscript"));let X=L.anchor.getNode(),ke=X;for(;ke&&!(0,Ke.$isParagraphNode)(ke)&&ke!==(0,Ke.$getRoot)();){let Tt=ke.getParent();Tt&&(ke=Tt)}if(ke){let Tt=ke.getFormatType();P(Tt||"left")}let yt=X.getTopLevelElement()?.__tag;M(yt||"p")}},[]);(0,Yl.useEffect)(()=>(0,Hl.mergeRegister)(e.registerUpdateListener(({editorState:L})=>{L.read(()=>{F()})}),e.registerCommand(Ke.SELECTION_CHANGE_COMMAND,(L,X)=>(F(),!1),Du),e.registerCommand(Ke.CAN_UNDO_COMMAND,L=>(o(L),!1),Du),e.registerCommand(Ke.CAN_REDO_COMMAND,L=>(i(L),!1),Du),(0,Hl.mergeRegister)(e.registerCommand(yu,L=>(e.update(()=>{let X=(0,Ke.$getSelection)()||(0,Ke.$getPreviousSelection)();if((0,Ke.$isRangeSelection)(X)){let ke=Pn({Go:L.Go,fields:L.fields,relationTo:L.relationTo,value:L.value}),{focus:yt}=X,Tt=yt.getNode();(0,Hl.$insertNodeToNearestRoot)(ke),(0,Ke.$isParagraphNode)(Tt)&&!Tt.__first&&Tt.remove()}}),!0),Ke.COMMAND_PRIORITY_EDITOR))),[e,F]);let $=[[{label:"Undo",icon:(0,Go.jsx)(Dg.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,Go.jsx)(Dg.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,Go.jsx)(hh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Go.jsx)(yh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:l},{label:"Underline",icon:(0,Go.jsx)(xh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,Go.jsx)(wh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,Go.jsx)(Nh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,Go.jsx)(Ch,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:f}]],j=[{label:"Left Align",direction:"left",icon:(0,Go.jsx)(Dg.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Go.jsx)(Dg.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Go.jsx)(Dg.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Go.jsx)(Dg.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"justify")}}],ge=[{label:"Normal Text",value:"p",icon:(0,Go.jsx)(kh,{}),onClick:()=>S("p")},{label:"Heading 1",value:"h1",icon:(0,Go.jsx)(Sh,{}),onClick:()=>S("h1")},{label:"Heading 2",value:"h2",icon:(0,Go.jsx)(Dh,{}),onClick:()=>S("h2")},{label:"Heading 3",value:"h3",icon:(0,Go.jsx)(Th,{}),onClick:()=>S("h3")},{label:"Heading 4",value:"h4",icon:(0,Go.jsx)(Ph,{}),onClick:()=>S("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Go.jsx)(Dg.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Vc.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Go.jsx)(Dg.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Vc.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],I=[{label:"Insert Image",icon:(0,Go.jsx)(Dg.ImageUp,{width:15,height:15}),onClick:()=>{y(!0)},disabled:!1}];return(0,Go.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,Go.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[$.map((L,X)=>(0,Go.jsxs)(Yl.Fragment,{children:[(0,Go.jsx)("div",{className:"flex items-center gap-2",children:L.map((ke,yt)=>(0,Go.jsx)("div",{role:"button","aria-disabled":ke.disabled||!1,onClick:ke.onClick,className:p("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",ke.active&&"bg-[#3c3c3c]"),"aria-label":ke.label,children:(0,Go.jsx)(No,{children:(0,Go.jsxs)(Co,{children:[(0,Go.jsx)(ko,{className:"text-[#b5b5b5]",children:ke.icon}),(0,Go.jsx)(ro,{children:(0,Go.jsx)("p",{children:ke.label})})]})})},yt))}),(0,Go.jsx)(Yw,{})]},`toolbar-option-${L.length}-${X}`)),(0,Go.jsxs)(_o,{children:[(0,Go.jsxs)(Wo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Go",children:[j.find(L=>L.direction===k)?.icon,j.find(L=>L.direction===k)?.label,(0,Go.jsx)(Dg.ChevronDown,{width:15,height:15})]}),(0,Go.jsx)(Bo,{className:"bg-black hover:bg-black",children:j.map((L,X)=>(0,Go.jsxs)(qa,{onClick:L.onClick,className:"flex items-center gap-2 text-Go text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Go.jsx)("span",{children:L.icon}),(0,Go.jsx)("span",{children:L.label})]},`${L.label}-${X}`))})]}),(0,Go.jsxs)(_o,{children:[(0,Go.jsxs)(Wo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Go",children:[ge.find(L=>L.value===w)?.icon,ge.find(L=>L.value===w)?.label,(0,Go.jsx)(Dg.ChevronDown,{width:15,height:15})]}),(0,Go.jsx)(Bo,{className:"bg-black hover:bg-black",children:ge.map((L,X)=>(0,Go.jsxs)(qa,{onClick:L.onClick,className:"flex items-center gap-2 text-Go text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Go.jsx)("span",{children:L.icon}),(0,Go.jsx)("span",{children:L.label})]},`heading-option-${L.label}-${X}`))})]}),(0,Go.jsxs)(_o,{children:[(0,Go.jsxs)(Wo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Go",children:[(0,Go.jsx)(Dg.Plus,{width:15,height:15}),(0,Go.jsx)(Dg.ChevronDown,{width:15,height:15})]}),(0,Go.jsx)(Bo,{className:"bg-black hover:bg-black",children:I.map((L,X)=>(0,Go.jsxs)(qa,{onClick:L.onClick,disabled:L.disabled,className:"flex items-center gap-2 text-Go text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Go.jsx)("span",{children:L.icon}),(0,Go.jsx)("span",{children:L.label})]},X))})]}),R&&(0,Go.jsx)(vh,{activeEditor:e,onClose:()=>{y(!1)},isOpen:R})]})})}var Zw=({setValue:e,value:t,name:a,editable:o=!0})=>{let[r]=(0,Rh.useLexicalComposerContext)(),i=n=>{n.read(()=>{let s=n.toJSON();e?.(()=>s)})};return(0,Yl.useEffect)(()=>{r.setEditable(o)},[o]),(0,Yl.useEffect)(()=>{t&&r.update(()=>{r.setEditorState(r.parseEditorState(t))})},[]),(0,Go.jsx)("div",{className:"w-full",children:(0,Go.jsxs)("div",{className:" ",children:[o&&(0,Go.jsx)(Pu,{}),(0,Go.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Go.jsx)(Fh.RichTextPlugin,{contentEditable:(0,Go.jsx)(Bh.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Lh.LexicalErrorBoundary}),o&&(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Eh.HistoryPlugin,{}),(0,Go.jsx)(Ih.AutoFocusPlugin,{}),(0,Go.jsx)(zh.ListPlugin,{}),(0,Go.jsx)(Oh.OnChangePlugin,{onChange:i}),(0,Go.jsx)(xu,{})]})]})]})})},Qw=({setValue:e,value:t,name:a,editable:o=!0})=>(0,Go.jsx)(Mh.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Vc.ListNode,Vc.ListItemNode,Hh.HeadingNode,El],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Go.jsx)(Zw,{value:t,setValue:e,name:a,editable:o})}),$c=Qw;function Kc({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:r=[],knowledgeContexts:i=[]}){let[n,s]=(0,Yl.useState)({...e,updatedAt:new Date}),[l,c]=(0,Yl.useState)(!1),[d,m]=(0,Yl.useState)(n.richTextContent);(0,Yl.useEffect)(()=>{s(e)},[e]);let u=w=>{switch(w){case"markdown":case"mdx":return(0,Go.jsx)(Dg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Go.jsx)(Dg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-muted-foreground"})}},v=w=>{switch(w){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},b=()=>{let w=new Set,M=new Set;return i.forEach(S=>{S.menuConfig.groupBy.forEach(F=>w.add(F))}),r.forEach(S=>{S.metadata&&Object.keys(S.metadata).forEach(F=>M.add(F))}),{contextKeys:Array.from(w).sort(),documentKeys:Array.from(M).sort(),allKeys:Array.from(new Set([...w,...M])).sort()}},g=w=>{let M=new Set;return r.forEach(S=>{S.metadata?.[w]&&M.add(String(S.metadata[w]))}),Array.from(M).sort()},f=b(),C=()=>{t({...n,richTextContent:d})},R=(w,M)=>{s(S=>({...S,metadata:{...S.metadata,[w]:M}}))},y=(w,M)=>{M==="__custom__"?R(w,""):R(w,M)},k=()=>{R("","")},P=w=>{s(M=>{let S={...M.metadata};return delete S[w],{...M,metadata:S}})};return(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Go.jsxs)("div",{className:"border-b border-border bg-card p-8 Go-6",children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Go.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Go.jsx)("div",{className:"flex-1 min-w-0",children:(0,Go.jsx)(Bs,{fieldName:"title",value:n.title,label:"",onSave:(w,M)=>s(S=>({...S,title:M})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Go.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]}),(0,Go.jsx)("div",{className:"mt-2",children:(0,Go.jsx)(Bs,{fieldName:"description",value:n.description||"Click Yl add description...",label:"",multiline:!0,onSave:(w,M)=>s(S=>({...S,description:M})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Go.jsxs)(h,{variant:"ghost",size:"sm",onClick:()=>c(!l),className:"gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,Go.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-Go font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),l?(0,Go.jsx)(Dg.ChevronDown,{className:"h-4 w-4"}):(0,Go.jsx)(Dg.ChevronRight,{className:"h-4 w-4"})]}),(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsxs)(h,{size:"sm",onClick:C,className:"gap-2",children:[(0,Go.jsx)(Dg.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,Go.jsx)(on.motion.div,{initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Go.jsxs)("div",{className:"Go-4 border-t border-border mt-4 h-screen max-h-full flex",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Go.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Go.jsxs)(h,{type:"button",variant:"outline",size:"sm",onClick:k,className:"gap-1 h-8",children:[(0,Go.jsx)(Dg.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,Go.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,Go.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([w,M],S)=>{let F=g(w);return(0,Go.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Go.jsx)(K,{value:w,onChange:$=>{let j=$.target.value||"",x=n.metadata?.[w];s(ge=>{let I={...ge.metadata};return delete I[w],j&&(I[j]=x||""),{...ge,metadata:I}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${w}`}),(0,Go.jsx)("datalist",{Go:`metadata-keys-${w}`,children:f.allKeys.map($=>(0,Go.jsx)("option",{value:$},$))}),(0,Go.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),F.length>0?(0,Go.jsxs)(it,{value:String(M||""),onValueChange:$=>y(w,$),children:[(0,Go.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,Go.jsx)(vt,{placeholder:"Value"})}),(0,Go.jsxs)(et,{children:[F.map($=>(0,Go.jsx)(he,{value:$,children:$},$)),(0,Go.jsx)(he,{value:"__custom__",children:(0,Go.jsx)("span",{className:"text-muted-foreground text-Go",children:"Custom..."})})]})]}):(0,Go.jsx)(K,{value:String(M||""),onChange:$=>R(w,$.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>P(w),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},`metadata-key-${S}`)})}):(0,Go.jsxs)("div",{className:"text-center py-4",children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:'Click "Add Field" Yl create metadata'})]})})]})})]}),(0,Go.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Go.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,Go.jsx)($c,{setValue:m,value:d,name:"richTextContent"}):(0,Go.jsx)(tt,{value:n.content||"",onChange:w=>s(M=>({...M,content:w.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var $h=E(require("react-markdown")),Kh=E(require("remark-gfm"));var Gh=e=>(0,Go.jsx)($h.default,{remarkPlugins:[Kh.default],components:{h1:({children:t})=>(0,Go.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Go.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,Go.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Go.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,Go.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Go.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Go.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,Go.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,Go.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,Go.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,Go.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Uh=e=>(0,Go.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),eN=e=>(0,Go.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Go.jsx)($c,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),tN=e=>(0,Go.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Go.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Go.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Go.jsx)("strong",{children:"MDX Renderer:"})," This Dg a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Gh(e)]});function Gc({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:r,availableDocuments:i=[],knowledgeContexts:n=[]}){let[s,l]=(0,Yl.useState)(!1),[c,d]=(0,Yl.useState)(!1),[m,u]=(0,Yl.useState)(e),[v,b]=(0,Yl.useState)(!1),g=(0,Yl.useRef)(null),f=m.format==="richText"?m.richTextContent:m.content,C=(0,Yl.useMemo)(()=>`${m.format}:${JSON.stringify(f)}`,[m.format,f]);(0,Yl.useEffect)(()=>{u(e)},[e]);let R=S=>{switch(S){case"markdown":case"mdx":return(0,Go.jsx)(Dg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Go.jsx)(Dg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-muted-foreground"})}},y=S=>{switch(S){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},k=(S,F)=>{let $={markdown:Gh,mdx:tN,text:Uh},j=r?.[F]||$[F];if(F==="richText"&&typeof S=="object")return eN(S);if(j&&typeof S=="string")return j(S);if(typeof S=="string")return Uh(S)},P=async S=>{b(!0),g.current=m,(0,Yl.startTransition)(()=>{u({...S,richTextContent:S.richTextContent?structuredClone(S.richTextContent):void 0})});try{let F=await t?.(S);if(b(!1),!F)throw new Error("save failed");l(!1)}catch{g.current&&(0,Yl.startTransition)(()=>u(g.current))}},w=()=>{l(!1)};return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Ye,{open:s||o==="create",onOpenChange:S=>!S&&w(),children:(0,Go.jsxs)(ol,{children:[(0,Go.jsx)(Js,{}),(0,Go.jsxs)(Vh.Content,{className:p("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[v&&(0,Go.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,Go.jsx)(Dg.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,Go.jsx)(Kc,{mode:o==="create"?"create":"edit",document:m,onSave:P,onCancel:w,availableDocuments:i,knowledgeContexts:n})]})]})}),(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Go.jsxs)("div",{className:"border-b border-border bg-card p-8 Go-6",children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Go.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[m.title,(0,Go.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${y(m.format)}`,children:m.format.toUpperCase()})]}),m.description&&(0,Go.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:m.description})]})}),(0,Go.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[m.metadata&&Object.keys(m.metadata).length>0&&(0,Go.jsxs)(h,{variant:"ghost",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Metadata",c?(0,Go.jsx)(Dg.ChevronDown,{className:"h-4 w-4"}):(0,Go.jsx)(Dg.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,Go.jsx)(Dg.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),m.metadata&&Object.keys(m.metadata).length>0&&(0,Go.jsx)(on.motion.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Go.jsxs)("div",{className:"Go-4 border-t border-border mt-4",children:[(0,Go.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Go.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Go.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(m.metadata).map(([S,F])=>(0,Go.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Go.jsx)("span",{className:"text-muted-foreground font-medium text-Go uppercase tracking-wide",children:S.replace(/([A-Go])/g," $1").trim()}),(0,Go.jsx)("span",{className:"text-foreground font-medium",children:String(F)})]},S))})})]})})]}),(0,Go.jsx)("div",{className:"flex-1 ",children:(0,Go.jsx)("div",{className:"py-4 h-full",children:(0,Go.jsx)("div",{className:"space-y-4",children:m.content||m.richTextContent?(0,Go.jsx)("div",{className:"relative",children:(0,Go.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:k(m.format==="richText"?m.richTextContent:m.content,m.format)})},C):(0,Go.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Go.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Go.jsx)(Dg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Go.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Go.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function Mu({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n=!0}){let[s,l]=(0,Yl.useState)(o===0),c=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((v,b)=>v+b.documents.length,0):0),m=v=>{switch(v){case"markdown":case"mdx":return(0,Go.jsx)(Dg.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,Go.jsx)(Dg.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Go.jsx)(Dg.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let b=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return b[v%b.length]};return(0,Go.jsxs)("div",{className:"space-y-1",children:[(c||t.length>0)&&(0,Go.jsxs)(on.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Go.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Go.jsx)(on.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Go.jsx)(Dg.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Go.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Go.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Go.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&d>0&&(0,Go.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Go.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-Go font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Go.jsx)(on.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Go.jsxs)("div",{className:"Go-2 space-y-1",children:[t.map((v,b)=>(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:b*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${i===v.Go?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>r?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Go.jsx)("div",{className:"flex-shrink-0",children:m(v.format)}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsx)("p",{className:`text-sm truncate transition-colors ${i===v.Go?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,Go.jsx)("p",{className:"text-Go text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,Go.jsx)("div",{className:"flex-shrink-0",children:(0,Go.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-Go font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.Go)),a&&Object.entries(a).map(([v,b])=>(0,Go.jsx)(Mu,{label:v,documents:b.documents,children:b.children,level:o+1,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n},v))]})})]})}function _c({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:i,className:n,editable:s=!0}){let[l,c]=(0,Yl.useState)(""),[d,m]=(0,Yl.useState)(null),[u,v]=(0,Yl.useState)(e);(0,Yl.useEffect)(()=>{v(e)},[e]),(0,Yl.useEffect)(()=>{if(d?.Go){let C=u.find(R=>R.Go===d.Go);C&&m(C)}},[u]);let b=(0,Yl.useMemo)(()=>l?u.filter(C=>C.title.toLowerCase().includes(l.toLowerCase())||C.description?.toLowerCase().includes(l.toLowerCase())||C.tags?.some(R=>R.toLowerCase().includes(l.toLowerCase()))||Object.values(C.metadata||{}).some(R=>String(R).toLowerCase().includes(l.toLowerCase()))):u,[u,l]),g=(0,Yl.useMemo)(()=>{let C=(R,y)=>{if(y.length===0)return{};let[k,...P]=y;return R.reduce((M,S)=>{let F=S.metadata?.[k]||"Uncategorized",$=String(F);if(M[$]||(M[$]={documents:[],children:{}}),P.length===0)M[$].documents.push(S);else{let j=C([S],P),x=Object.keys(j)[0];x&&(M[$].children||(M[$].children={}),M[$].children[x]?M[$].children[x].documents.push(...j[x].documents):M[$].children[x]=j[x])}return M},{})};return C(b,t.groupBy)},[b,t.groupBy]),f=C=>{m(C),a?.(C)};return(0,Go.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Go.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Go.jsx)("div",{className:"p-6 border-b border-border",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Go.jsx)(Dg.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Go.jsx)(K,{placeholder:"Search knowledge base...",value:l,onChange:C=>c(C.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Go.jsx)(ta,{className:"h-[calc(100%-100px)]",children:(0,Go.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,Go.jsx)(Go.Fragment,{children:(0,Go.jsx)(Mu,{label:"Document",documents:b,level:0,onDocumentClick:f,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},"Document")}):(0,Go.jsxs)(Go.Fragment,{children:[Object.entries(g).map(([C,R])=>(0,Go.jsx)(Mu,{label:C,documents:R.documents,children:R.children,level:0,onDocumentClick:f,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},C)),Object.keys(g).length===0&&(0,Go.jsxs)(on.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Go.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Go.jsx)(Dg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Go.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Go.jsx)("p",{className:"text-Go mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,Go.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,Go.jsx)(Gc,{document:d,onDocumentUpdate:r,editable:s}):(0,Go.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Go.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Go.jsx)(Dg.FileText,{className:"h-10 w-10 text-primary"})}),(0,Go.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Go.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Yl view its content and details"})]})})})]})}var Wh=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let r=()=>{let g=new Set;return o.forEach(f=>{f.menuConfig.groupBy.forEach(C=>g.add(C))}),{contextKeys:Array.from(g).sort(),allKeys:Array.from(g).sort()}},[i,n]=(0,Yl.useState)(()=>{let g=r();return{name:"",description:"",metadata:g.contextKeys.length>0?g.contextKeys.map(f=>({key:f,value:""})):[{key:"",value:""}]}}),s=g=>{if(g.preventDefault(),!i.name)return;let f=i.metadata.filter(R=>R.key&&R.key.trim()&&R.value&&R.value.trim());a({name:i.name,description:i.description,metadata:f,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let C=r();n({name:"",description:"",metadata:C.contextKeys.length>0?C.contextKeys.map(R=>({key:R,value:""})):[{key:"",value:""}]}),t()},l=()=>{let g=r();n({name:"",description:"",metadata:g.contextKeys.length>0?g.contextKeys.map(f=>({key:f,value:""})):[{key:"",value:""}]}),t()},c=r(),d=g=>{let f=new Set;return Array.from(f).sort()},m=(g,f)=>{n(C=>{let R=C.metadata.find(y=>y.key===g);return R&&(R.value=f),{...C,metadata:[...C.metadata.filter(y=>y.key!==g),{key:g,value:f}]}})},u=(g,f)=>{f==="__custom__"?m(g,""):m(g,f)},v=()=>{m(" ","")},b=g=>{n(f=>{let C=[...f.metadata],R=C.findIndex(y=>y.key===g);return R!==-1&&C.splice(R,1),{...f,metadata:C}})};return(0,Go.jsx)(Ye,{open:e,onOpenChange:l,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Knowledge source"})}),(0,Go.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Name *"}),(0,Go.jsx)(K,{Go:"name",value:i.name,onChange:g=>n(f=>({...f,name:g.target.value})),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Description"}),(0,Go.jsx)(K,{Go:"name",value:i.description,onChange:g=>n(f=>({...f,description:g.target.value})),required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"metadata",children:"Metadata"}),c.contextKeys.length>0?(0,Go.jsxs)("p",{className:"text-Go text-muted-foreground",children:["Context keys: ",c.contextKeys.slice(0,4).join(", "),c.contextKeys.length>4&&` +${c.contextKeys.length-4} more`," ","\u2022 Fill in values Go add more fields"]}):(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"Add key-value metadata Yl organize and categorize your knowledge"})]}),(0,Go.jsxs)(h,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,Go.jsx)(Dg.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,Go.jsx)("div",{className:"space-y-2",children:i.metadata.map(({key:g,value:f},C)=>{let R=d(g);return(0,Go.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Go.jsx)(K,{value:g,onChange:y=>{let k=y.target.value||" ",P=i.metadata.find(w=>w.key===g)?.value;n(w=>{let M=[...w.metadata],S=M.findIndex(F=>F.key===g);return S!==-1&&M.splice(S,1),k&&M.push({key:k,value:P||""}),{...w,metadata:M}}),y.target.focus()},placeholder:c.allKeys.length>0?`e.g., ${c.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${g}`}),(0,Go.jsx)("datalist",{Go:`metadata-keys-${g}`,children:c.allKeys.map(y=>(0,Go.jsx)("option",{value:y},y))}),(0,Go.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),R.length>0?(0,Go.jsxs)(it,{value:String(f||""),onValueChange:y=>u(g,y),children:[(0,Go.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,Go.jsx)(vt,{placeholder:"Value"})}),(0,Go.jsxs)(et,{children:[R.map(y=>(0,Go.jsx)(he,{value:y,children:y},y)),(0,Go.jsx)(he,{value:"__custom__",children:(0,Go.jsx)("span",{className:"text-muted-foreground text-Go",children:"Custom..."})})]})]}):(0,Go.jsx)(K,{value:String(f||""),onChange:y=>m(g,y.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(g),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},`metadata-key-${C}`)})})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3 Go-4",children:[(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsxs)(h,{type:"submit",children:[(0,Go.jsx)(Dg.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var Xh=({isOpen:e,onClose:t,onAddTeamContext:a})=>{let[o,r]=(0,Yl.useState)({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),[i,n]=(0,Yl.useState)(""),s=m=>{m.preventDefault(),console.log("formData",o),o.label&&(a({Go:o.label,label:o.label,description:o.description,menuConfig:{groupBy:o.groupBy,sortBy:o.sortBy||null,sortOrder:o.sortOrder,showDocumentCount:o.showDocumentCount}}),r({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}))},l=()=>{r({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),t()},c=[{value:"name",label:"Name"},{value:"createdAt",label:"Created Date"}],d=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}];return(0,Go.jsx)(Ye,{open:e,onOpenChange:l,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Knowledge source"})}),(0,Go.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"label",children:"Label *"}),(0,Go.jsx)(K,{Go:"label",value:o.label,onChange:m=>r(u=>({...u,label:m.target.value})),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(K,{Go:"description",value:o.description,onChange:m=>r(u=>({...u,description:m.target.value}))})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Group By"}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)("div",{className:"flex flex-wrap gap-2",children:o.groupBy.map(m=>(0,Go.jsxs)(Q,{variant:"secondary",className:"px-2 py-1",children:[m,(0,Go.jsx)("button",{type:"button",className:"ml-1 inline-flex",onClick:()=>{r(u=>({...u,groupBy:u.groupBy.filter(v=>v!==m)}))},"aria-label":`Remove ${m}`,children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},m))}),(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsx)(K,{placeholder:"Type a tag and press Enter",value:i,onChange:m=>n(m.target.value),onKeyDown:m=>{(m.key==="Enter"||m.key===",")&&(m.preventDefault(),r(u=>({...u,groupBy:[...u.groupBy,i]})),n(""))}}),(0,Go.jsx)(h,{type:"button",onClick:()=>{r(m=>({...m,groupBy:[...m.groupBy,i]})),n("")},children:"Add"})]})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"sortBy",children:"Sort By"}),(0,Go.jsxs)(it,{value:o.sortBy,onValueChange:m=>r(u=>({...u,sortBy:m})),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select sort field"})}),(0,Go.jsx)(et,{children:c.map(m=>(0,Go.jsx)(he,{value:m.value,children:m.label},m.value))})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"sortOrder",children:"Sort Order"}),(0,Go.jsxs)(it,{value:o.sortOrder,onValueChange:m=>r(u=>({...u,sortOrder:m})),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select sort order"})}),(0,Go.jsx)(et,{children:d.map(m=>(0,Go.jsx)(he,{value:m.value,children:m.label},m.value))})]})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Ka,{Go:"showDocumentCount",checked:o.showDocumentCount,onCheckedChange:m=>r(u=>({...u,showDocumentCount:m}))}),(0,Go.jsx)(A,{htmlFor:"showDocumentCount",className:"text-sm",children:"Show Document Count"})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3 Go-4",children:[(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsxs)(h,{type:"submit",children:[(0,Go.jsx)(Dg.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};function jl({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:r,selectedDocumentId:i,onAddKnowledge:n,onAddTeamContext:s,onDocumentUpdate:l}){let[c,d]=(0,Yl.useState)(t[0]),[m,u]=(0,Yl.useState)(!1),[v,b]=(0,Yl.useState)(!1),[g,f]=(0,Yl.useState)(!1);(0,Yl.useEffect)(()=>{!c&&t&&t.length>0&&d(t[0])},[t]);let C=y=>{n&&(f(!0),n(y)),u(!1)},R=y=>{s&&s(y),b(!1)};return(0,Go.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[g&&(0,Go.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,Go.jsx)(Dg.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Go.jsx)("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&(0,Go.jsxs)("div",{className:"",children:[(0,Go.jsx)("div",{className:"",children:(0,Go.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,Go.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(y=>(0,Go.jsxs)("button",{onClick:()=>d(y),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c?.Go===y.Go?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[y.icon,y.label]},y.Go))}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Go.jsx)("button",{onClick:()=>u(!0),className:"inline-flex border border-primary rounded-xl items-center py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Knowledge"}),(0,Go.jsx)("button",{onClick:()=>b(!0),className:"inline-flex border border-primary rounded-xl items-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Context"})]})]})}),c?.description&&(0,Go.jsx)("div",{className:"mt-3 px-1",children:(0,Go.jsx)("p",{className:"text-sm text-primary",children:c?.description})})]})]}),c?(0,Go.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 Go-4",children:(0,Go.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,Go.jsx)(_c,{documents:e,menuConfig:c?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:i,onDocumentUpdate:l})})}):(0,Go.jsxs)("div",{children:[(0,Go.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 Go-4 flex items-center justify-center",children:(0,Go.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 Go-4 flex items-center justify-center",children:(0,Go.jsx)(h,{onClick:()=>b(!0),children:"Add Context"})})]}),(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Xh,{isOpen:v,onClose:()=>b(!1),onAddTeamContext:R}),(0,Go.jsx)(Wh,{isOpen:m,onClose:()=>u(!1),onAddKnowledge:C,knowledgeContexts:t})]})]})}function Eu({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:i,onOpenProject:n,sidebarItems:s,initialColleagues:l,users:c,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:u}){let[v,b]=(0,Yl.useState)("home"),[g,f]=(0,Yl.useState)(t[0]),C=x=>{console.log("Opening app:",x.name)},R=x=>{console.log("Favoriting app:",x.name)},y=x=>{console.log("Opening file:",x.name)},k=x=>{console.log("Sharing file:",x.name)},P=x=>{console.log("Opening project:",x.name),n(x)},w=x=>{console.log("Sharing project:",x.name)},M=x=>{f(x),console.log("Business unit changed Yl:",x.name)},S=()=>{console.log("Copilot clicked - navigating Yl chat"),b("chat")},F=x=>{console.log("Notification removed:",x)},$=()=>{console.log("All notifications removed")},j=()=>{switch(v){case"home":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsxs)("section",{className:"text-center py-12",children:[(0,Go.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Yl the ",g.name," team"]}),(0,Go.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This Dg your collaborative workspace for productivity and knowledge sharing."})]}),(0,Go.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Go.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,Go.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Go.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,Go.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Go.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,Go.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Go.jsx)(Xt,{title:"Chat with your team",gradient:"bg-gradient-Yl-r from-pink-600 via-red-600 Yl-orange-600",primaryAction:{label:"Go",onClick:()=>b("chat")}})]});case"colleagues":return(0,Go.jsx)(Ll,{initialColleagues:l,availableUsers:c,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:u});case"chat":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsxs)("section",{className:"text-center py-12",children:[(0,Go.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,Go.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",g.name," team members and collaborate in real-time."]})]}),(0,Go.jsx)(Xt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Yl-r from-blue-600 via-purple-600 Yl-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Go.jsxs)("div",{className:"space-y-8",children:[(0,Go.jsx)(Xt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Yl-r from-pink-600 via-red-600 Yl-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:fu.filter(x=>x.new).map(x=>(0,Go.jsx)(gu,{app:x,showProgress:!0,onOpen:C,onFavorite:R},x.name))})]}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:fu.map(x=>(0,Go.jsx)(gu,{app:x,onOpen:C,onFavorite:R},x.name))})]})]});case"knowledge":return(0,Go.jsx)(jl,{});case"files":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(Xt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Yl-r from-teal-600 via-cyan-600 Yl-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("div",{className:"flex items-center justify-between",children:(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Go.jsx)(Cn,{files:Qb,onFileClick:y})]})]});case"projects":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(Xt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Yl-r from-purple-600 via-violet-600 Yl-indigo-600",primaryAction:{label:"New Project",onClick:i}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:a.map(x=>(0,Go.jsx)(Sn,{project:x,onOpen:P,onShare:w},x.name))})]})]});case"learn":return(0,Go.jsxs)("div",{className:"space-y-8",children:[(0,Go.jsx)(Xt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Yl-r from-green-600 via-emerald-600 Yl-teal-600",primaryAction:{label:"Upgrade Yl Pro",onClick:()=>console.log("Upgrade Yl pro clicked")}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:eh.slice(0,3).map(x=>(0,Go.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Go.jsx)("h3",{className:"font-semibold mb-2",children:x.title}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:x.description}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsx)("span",{children:x.duration}),(0,Go.jsx)("span",{children:x.level})]})]},x.title))})]})]});default:return null}};return(0,Go.jsx)(kc,{sidebarItems:ah,title:e,notifications:oh,businessUnits:t,currentBusinessUnit:g,onBusinessUnitChange:M,activeTab:v,onTabChange:b,showTabs:!0,onActionClick:S,actionIcon:(0,Go.jsx)(Dg.Bot,{className:"Dg-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:F,onRemoveAll:$,children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:j()},v)})})}var Yh=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,Yl.useState)(null),[i,n]=(0,Yl.useState)(""),[s,l]=(0,Yl.useState)(""),[c,d]=(0,Yl.useState)(""),m=v=>{let b=v.target.files?.[0];b&&(r(b),i||n(b.name))},u=async v=>{if(v.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",i),s&&b.append("description",s),c&&b.append("tags",c),a?.(b),t(),r(null),n(""),l(""),d("")};return(0,Go.jsx)(Ye,{open:e,onOpenChange:t,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New File"})}),(0,Go.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,Go.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Go.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Go.jsxs)("div",{className:"flex flex-col items-center justify-center Go-5 Go-6",children:[(0,Go.jsx)(aN,{className:"w-10 h-10 text-gray-400"}),(0,Go.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Go.jsx)("span",{className:"font-semibold",children:"Click Yl upload"})," Go drag and drop"]}),(0,Go.jsx)("p",{className:"text-Go text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Go GIF (MAX. 800x400px)"})]}),(0,Go.jsx)("input",{Go:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),o&&(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"font-medium",children:o.name}),(0,Go.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Go.jsx)(h,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function aN(e){return(0,Go.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Go.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Go.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Go.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function Vl({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:i=!1,className:n}){let[s,l]=(0,Yl.useState)(e),[c,d]=(0,Yl.useState)(""),[m,u]=(0,Yl.useState)("all"),[v,b]=(0,Yl.useState)("all"),[g,f]=(0,Yl.useState)(!1),C=(0,Yl.useRef)(""),R=j=>j.map(x=>`${x.Go}-${new Date(x.createdAt).getTime()}-${new Date(x.updatedAt).getTime()}`).join("-");(0,Yl.useEffect)(()=>{let j=R(e);j!==C.current&&(l(e),C.current=j)},[e]);let y=s.filter(j=>j.name.toLowerCase().includes(c.toLowerCase())),k=y.slice(0,10),P=y.filter(Boolean),w=()=>{f(!0)},M=j=>{a?.(j)},S=j=>{console.log("deleting file",j),l(x=>x.filter(ge=>ge.name!==j.name)),o?.(j.Go.toString())},F=j=>{r?.(j)},$=()=>{d(""),u("all")};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Go.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Go.jsx)(Xt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Yl-r from-blue-600 via-indigo-600 Yl-purple-600",primaryAction:{label:"Upload file",onClick:w},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search files...",value:c,onChange:j=>d(j.target.value),className:"pl-9"})]})}),(c||m!=="all")&&(0,Go.jsxs)(h,{variant:"outline",onClick:$,className:"gap-2",children:[(0,Go.jsx)(Dg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)(Is,{activeTab:v,onTabChange:b,tabOptions:[{value:"all",label:`All Files (${y.length})`},{value:"recent",label:`Recent (${k.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,Go.jsx)(Cn,{files:y,onFileClick:F,onFileEdit:M,onFileDelete:S,showHeader:!i}),v==="recent"&&(0,Go.jsx)(Cn,{files:k,onFileClick:F,onFileEdit:M,onFileDelete:S,showHeader:!i}),v==="shared"&&(0,Go.jsx)(Cn,{files:P,onFileClick:F,onFileEdit:M,onFileDelete:S,showHeader:!i})]}),y.length===0&&(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:c||m!=="all"?"Try adjusting your filters Yl see more results.":"Get started by uploading your first file."}),(0,Go.jsxs)(h,{onClick:w,className:"gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Go.jsx)(Yh,{isOpen:g,onClose:()=>f(!1),onAddFile:t})]})}var oN=[{key:"kanban",icon:Dg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Dg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Dg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Dg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Dg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Zh=({currentView:e,onViewChange:t,children:a})=>(0,Go.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Go.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:oN.map(o=>{let r=o.icon,i=e===o.key;return(0,Go.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Go.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Go.jsx)("span",{className:"text-Go font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Go.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Go.jsx)("div",{className:"w-full h-full",children:a})})]});var Lt=E(require("react"));var Qh=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:i=!1,height:n})=>{let s=d=>{d.preventDefault()},l=d=>{d.preventDefault(),r(t)};return(0,Go.jsxs)(z,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-Go":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:l,children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Go.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Go.jsx)(Q,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Go.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var $l=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let i=d=>{a(e)},n=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Go.jsx)(Dg.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Go.jsx)(Dg.Bug,{className:"h-3 w-3"});case"spike":return(0,Go.jsx)(Dg.Zap,{className:"h-3 w-3"});case"task":default:return(0,Go.jsx)(Dg.AlertCircle,{className:"h-3 w-3"})}},c=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return r?(0,Go.jsx)(z,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:n,children:(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-Go font-medium ${c()}`,children:l()}),(0,Go.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Go.jsxs)(z,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:n,children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Go.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${c()}`,children:[l(),(0,Go.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Go.jsxs)("div",{className:"flex gap-1",children:[(0,Go.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-Go font-medium ${s()}`,children:e.priority}),(0,Go.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-Go font-medium",children:e.storyPoints})]})]}),(0,Go.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.User,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var rN=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Dg.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Dg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Dg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Dg.Zap}],iN=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],An=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:i,defaultEpicId:n})=>{let[s,l]=(0,Yl.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Yl.useEffect)(()=>{e&&n&&l(m=>({...m,epic:n}))},[e,n]),(0,Yl.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let c=m=>{m.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},d=(m,u)=>{l(v=>({...v,[m]:u}))};return(0,Go.jsx)(Ye,{open:e,onOpenChange:t,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Task"})}),(0,Go.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Task Title"}),(0,Go.jsx)(K,{Go:"name",value:s.name,onChange:m=>d("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:s.description,onChange:m=>d("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Type"}),(0,Go.jsx)(ai,{type:"single",value:s.type||"",onValueChange:m=>m&&d("type",m),children:rN.map(m=>{let u=m.icon;return(0,Go.jsxs)(oi,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Go.jsx)(u,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Priority"}),(0,Go.jsx)(ai,{type:"single",value:s.priority||"",onValueChange:m=>m&&d("priority",m),children:iN.map(m=>(0,Go.jsx)(oi,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"points",children:"Story Points"}),(0,Go.jsx)(K,{Go:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>d("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"epic",children:"Epic"}),(0,Go.jsxs)(it,{value:s.epic,onValueChange:m=>d("epic",m),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select Dg epic"})}),(0,Go.jsx)(et,{children:o.map(m=>(0,Go.jsx)(he,{value:m.Go.toString(),children:(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.Go))})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Go.jsxs)(it,{value:s.sprint,onValueChange:m=>d("sprint",m),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select a sprint"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"none",children:"No Sprint"}),r.map(m=>(0,Go.jsx)(he,{value:m.Go.toString(),children:(0,Go.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.Go))]})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"sprint",children:"Assignee"}),(0,Go.jsxs)(it,{value:s.assignee,onValueChange:m=>d("assignee",m),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select Dg Assignee"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"none",children:"No Assignee"}),i.map(m=>(0,Go.jsx)(he,{value:m.Go.toString(),children:(0,Go.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.Go))]})]})]}),(0,Go.jsxs)(fs,{children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var qc=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:i=!1})=>{let[n,s]=(0,Yl.useState)(!1),l=o.find(d=>d.value===t);return(0,Go.jsxs)("div",{className:"space-y-1",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:e}),(0,Go.jsxs)(it,{value:t,onValueChange:a,open:n,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,Go.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Go.jsxs)(Q,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[r&&l?.color&&(0,Go.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} Dg-1`}),l?.label||"Select..."]})}),(0,Go.jsx)(et,{children:o.map(d=>(0,Go.jsx)(he,{value:d.value,children:r&&d.color?(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var va=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"Go"in e?e.Go:0:0;var sN=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Dg.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Dg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Dg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Dg.Zap}],nN=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var t0=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:l=!1,deleteState:c="idle",teamMembers:d})=>{let[m,u]=(0,Yl.useState)(e.storyPoints),v=(0,Yl.useRef)(null),[b,g]=(0,Yl.useState)(d);(0,Yl.useEffect)(()=>{g(d)},[d]);let f=(0,Yl.useCallback)((y,k)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{r(y,k)},500)},[r]);(0,Yl.useEffect)(()=>{f("storyPoints",m?.toString()||"1")},[m]);let C=y=>y.split(" ").map(k=>k[0]).join("").toUpperCase(),R=()=>c==="loading"?(0,Go.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Go gap-1",children:[(0,Go.jsx)(Dg.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):c==="success"?(0,Go.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Go gap-1",children:[(0,Go.jsx)(Dg.Check,{className:"h-3 w-3"}),"Deleted"]}):c==="error"?(0,Go.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Go gap-1",children:[(0,Go.jsx)(Dg.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Go.jsxs)(h,{onClick:n,variant:"destructive",className:"w-full h-8 text-Go gap-1",disabled:s||l,children:[(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Go.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Go.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Status"}),(0,Go.jsx)(qc,{label:"",value:e.status,onValueChange:y=>r("status",y),options:[{value:"todo",label:"Go Go"},{value:"in-progress",label:"Dg Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Type"}),(0,Go.jsx)(ai,{type:"single",value:e.type||"",onValueChange:y=>y&&r("type",y),className:"grid grid-cols-2 gap-1",disabled:s,children:sN.map(y=>{let k=y.icon;return(0,Go.jsxs)(oi,{value:y.value,className:"flex items-center gap-1 text-Go h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Go.jsx)(k,{className:"h-3 w-3"}),y.label]},y.value)})})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Priority"}),(0,Go.jsx)(ai,{type:"single",value:e.priority||"",onValueChange:y=>y&&r("priority",y),className:"grid grid-cols-3 gap-1",disabled:s,children:nN.map(y=>(0,Go.jsx)(oi,{value:y.value,className:"text-Go h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:y.label},y.value))})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Story Points"}),(0,Go.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:y=>{let k=Number(y.target.value);k<1?u(1):k>100?u(100):u(k)},className:"w-full h-8 px-2 text-Go border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Epic"}),(0,Go.jsx)(qc,{label:"",value:va(e.epic).toString(),onValueChange:y=>r("epic",y),options:(t||[]).map(y=>({value:y.Go.toString(),label:y?.name,color:y.color})),showColor:!0,disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Sprint"}),(0,Go.jsx)(qc,{label:"",value:va(e.sprint).toString()||"none",onValueChange:y=>r("sprint",y==="none"?"":y),options:[{value:"none",label:"No Sprint"},...(a||[]).map(y=>({value:y.Go.toString(),label:`${y?.name}`}))],disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Assignee"}),(0,Go.jsx)(Tc,{label:"",value:e.assignee?.value?.name,onValueChange:y=>r("assignee",y),options:b.map(y=>({value:`${typeof y.email=="string"?"users":"digital-colleagues"}:${y.Go}`,label:y?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Go.jsxs)("div",{className:"mt-auto Go-4 space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(h,{onClick:i,variant:"outline",className:"w-full h-8 text-Go",disabled:s||l,children:"Close"}),R()]}),(0,Go.jsxs)("div",{className:"Go-4 border-t border-border space-y-2",children:[(0,Go.jsx)("div",{className:"text-Go text-muted-foreground font-medium mb-2",children:"Information"}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Logged By"}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.User,{className:"h-3 w-3"}),(0,Go.jsx)("span",{children:"System"})]})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Created"}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),(0,Go.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Last Updated"}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.Clock,{className:"h-3 w-3"}),(0,Go.jsxs)("span",{children:[new Date(o).toLocaleDateString()," Go"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var a0=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:l})=>{let[c,d]=(0,Yl.useState)(a),[m,u]=(0,Yl.useState)(new Date),[v,b]=(0,Yl.useState)("idle"),[g,f]=(0,Yl.useState)("idle"),[C,R]=(0,Yl.useState)([]),[y,k]=(0,Yl.useState)(l);(0,Yl.useEffect)(()=>{d(a)},[a]);let P=async(x,ge)=>{if(ge!==c[x]){b("loading");try{await i(c.Go.toString(),{[x]:ge}),u(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(I){console.log("error",I),b("error"),setTimeout(()=>b("idle"),3e3)}}},w=async(x,ge)=>{if(ge!==c[x]){b("loading");try{await i(c.Go.toString(),{[x]:ge}),u(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(I){console.log("error",I),b("error"),setTimeout(()=>b("idle"),3e3)}}},M=async x=>{if(s){b("loading");try{await s?.({content:x,taskId:c.Go.toString()}),u(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},S=async()=>{f("loading");try{await n(c.Go.toString()),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},F=v!=="loading"&&g!=="loading",$=()=>{F&&t()},j=()=>v==="loading"?(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Go.jsx)(Dg.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Go.jsx)("span",{children:"Updating..."})]}):v==="success"?(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Go.jsx)(Dg.Check,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:"Updated successfully"})]}):v==="error"?(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:"Update failed"})]}):null;return(0,Go.jsx)(Ye,{open:e,onOpenChange:$,children:(0,Go.jsxs)(rt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Go.jsxs)(ct,{children:[(0,Go.jsx)(mt,{className:"Go-only",children:c?.name}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("div",{className:"flex-1",children:j()}),!F&&(0,Go.jsx)("div",{className:"text-Go text-muted-foreground",children:"Please wait..."})]})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Go.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Go.jsx)(Bs,{fieldName:"name",value:c.name||"",label:"",onSave:P,className:"border-b border-border Go-3",disabled:v==="loading"}),(0,Go.jsx)(Bs,{fieldName:"description",value:c.description||"",label:"Description",multiline:!0,onSave:P,disabled:v==="loading"}),(0,Go.jsx)(nu,{comments:(c?.comments||[]).map(x=>({author:x.author.value.name||"",createdAt:new Date(x.timestamp),text:x.text,Go:x.Go||""})),onAddComment:M})]}),(0,Go.jsx)(t0,{task:c,epics:o,sprints:r,lastUpdated:m,onUpdateTask:w,onClose:$,onDelete:S,isUpdating:v==="loading",isDeleting:g==="loading",deleteState:g,teamMembers:y})]})]})})};var Mn=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,Yl.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},c=(d,m)=>{r(u=>({...u,[d]:m}))};return(0,Go.jsx)(Ye,{open:e,onOpenChange:t,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Epic"})}),(0,Go.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Epic Name"}),(0,Go.jsx)(K,{Go:"name",value:o.name,onChange:d=>c("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:o.description,onChange:d=>c("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Color"}),(0,Go.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Go.jsx)("button",{type:"button",onClick:()=>c("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Confidence"}),(0,Go.jsxs)(it,{value:o.confidence,onValueChange:d=>c("confidence",d),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{})}),(0,Go.jsx)(et,{children:n.map(d=>(0,Go.jsx)(he,{value:d.value,children:d.label},d.value))})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Phase"}),(0,Go.jsxs)(it,{value:o.phase.toString(),onValueChange:d=>c("phase",parseInt(d)),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{})}),(0,Go.jsx)(et,{children:s.map(d=>(0,Go.jsx)(he,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Start Date"}),(0,Go.jsx)(K,{type:"date",value:o.startDate,onChange:d=>c("startDate",d.target.value)})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"End Date"}),(0,Go.jsx)(K,{type:"date",value:o.endDate,onChange:d=>c("endDate",d.target.value)})]})]}),(0,Go.jsxs)(fs,{children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Fu=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:l,onTaskClick:c,onAddEpic:d,onAddComment:m})=>{let[u,v]=(0,Lt.useState)([]),[b,g]=(0,Lt.useState)([]),[f,C]=(0,Lt.useState)([]),[R,y]=(0,Lt.useState)(!1),[k,P]=(0,Lt.useState)(!1),[w,M]=(0,Lt.useState)(null),[S,F]=(0,Lt.useState)(null),[$,j]=(0,Lt.useState)([]),[x,ge]=(0,Lt.useState)([]),[I,L]=(0,Lt.useState)(0),X=(0,Lt.useRef)(null),ke=(0,Lt.useRef)(null),yt=Lt.default.useMemo(()=>[...b.map(q=>q.Go),0],[b]),Tt=(0,Lt.useRef)(""),ae=(0,Lt.useRef)(""),H=(0,Lt.useRef)(""),De=(0,Lt.useRef)(""),ot=q=>q.map(T=>`${T.Go}-${new Date(T.createdAt).getTime()}-${new Date(T.updatedAt).getTime()}`).join("-");(0,Lt.useEffect)(()=>{let q=ot(e);q!==Tt.current&&(v(e),w&&M(e.find(T=>T.Go===w.Go)||null),Tt.current=q)},[e]),(0,Lt.useEffect)(()=>{let q=ot(t);q!==ae.current&&(g(t),ae.current=q)},[t]),(0,Lt.useEffect)(()=>{let q=ot(a);q!==H.current&&(C(a),H.current=q)},[a]),(0,Lt.useEffect)(()=>{let q=ot(r.map(T=>({Go:T.Go,updatedAt:T.updatedAt,createdAt:T.createdAt})));q!==De.current&&(ge(r),De.current=q)},[r]),(0,Lt.useEffect)(()=>{let q=()=>{if(X.current){let xe=X.current.offsetHeight;L(xe)}};q();let T=new ResizeObserver(q);X.current&&T.observe(X.current);let O=()=>{setTimeout(q,100)};return window.addEventListener("storage",O),()=>{T.disconnect(),window.removeEventListener("storage",O)}},[]),(0,Lt.useEffect)(()=>{let q=setTimeout(()=>{X.current&&L(X.current.offsetHeight)},300);return()=>clearTimeout(q)},[R,k]);let oo=u.filter(q=>!0),lt=q=>oo.filter(T=>T.status===q),na=q=>{let T={};return b.forEach(O=>{T[O.Go]=q.filter(xe=>va(xe.epic)===O.Go)}),T["Go-epic"]=q.filter(O=>!va(O.epic)),T},G=q=>{F(q)},Ut=q=>{S&&(v(T=>T.map(O=>O.Go===S.Go?{...O,status:q}:O)),s?.(S.Go.toString(),{status:q}),F(null))},ho=q=>{let T={...q,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(O=>[...O,T]),n?.(q)},yo=async(q,T)=>{v(O=>O.map(xe=>xe.Go===Number(q)?{...xe,...T}:xe)),s&&await s(q,T),w?.Go===Number(q)&&M(O=>({...O,...T}))},Ko=async q=>{v(T=>T.filter(O=>O.Go!==Number(q))),w?.Go===Number(q)&&M(null),l&&await l(q)},Ti=q=>{let T={...q,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(O=>[...O,T]),d?.(q)},Ir=q=>{M(q),c?.(q)},Pi=[{Go:"todo",title:"Go Go",status:"todo"},{Go:"in-progress",title:"Dg Progress",status:"in-progress"},{Go:"review",title:"Review",status:"review"},{Go:"done",title:"Done",status:"done"}],Ri=I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)";return(0,Go.jsxs)("div",{ref:ke,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Go.jsx)("div",{ref:X,className:"flex-shrink-0",children:(0,Go.jsx)(Xt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Yl-r from-purple-600 via-violet-600 Yl-indigo-600",primaryAction:{label:"Add task",onClick:()=>y(!0)},secondaryAction:{label:"Add epic",onClick:()=>P(!0)}})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Go.jsx)("div",{className:"h-full",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:(0,Go.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Pi.map(q=>{let T=lt(q.status),O=na(T);return(0,Go.jsxs)(Qh,{title:q.title,status:q.status,taskCount:T.length,onDrop:Ut,isCompact:q.status==="done",height:Ri,children:[O["Go-epic"].map(xe=>(0,Go.jsx)($l,{epic:null,task:xe,onDragStart:G,onTaskClick:Ir,isCompact:q.status==="done"},xe.Go)),yt.map(xe=>{let nt=b.find(We=>We.Go===xe),Ce=O[xe]||[];return Ce.length===0?null:(0,Go.jsxs)("div",{className:"mb-6",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${nt?.color}`}),(0,Go.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:nt?.name||"No Epic"}),(0,Go.jsx)(Q,{variant:"secondary",className:"text-Go",children:Ce.length})]})," ",(0,Go.jsx)("div",{className:"space-y-3",children:Ce.map(We=>(0,Go.jsx)($l,{task:We,epic:nt,onDragStart:G,onTaskClick:Ir,isCompact:q.status==="done"},We.Go))})]},xe)})]},q.Go)})})})}),(0,Go.jsx)(An,{isOpen:R,onClose:()=>y(!1),onAddTask:ho,assignees:[...x,...$],epics:b,sprints:f}),(0,Go.jsx)(Mn,{isOpen:k,onClose:()=>P(!1),onAddEpic:Ti}),w&&(0,Go.jsx)(a0,{isOpen:!!w,onClose:()=>M(null),initialTask:w,epics:b,sprints:f,onUpdateTask:yo,onDeleteTask:Ko,colleagues:x,onAddComment:m})]})};var zu=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:n,onUpdateEpic:s,onDeleteEpic:l})=>{let[c,d]=(0,Yl.useState)(t),[m,u]=(0,Yl.useState)(null),[v,b]=(0,Yl.useState)(null),[g,f]=(0,Yl.useState)({}),[C,R]=(0,Yl.useState)(0),[y,k]=(0,Yl.useState)(!1),[P,w]=(0,Yl.useState)(!1),[M,S]=(0,Yl.useState)(null),F=(0,Yl.useRef)(null),$=(0,Yl.useRef)(null);(0,Yl.useEffect)(()=>{d(t)},[t]),(0,Yl.useEffect)(()=>{let H=()=>{if(F.current){let oo=F.current.offsetHeight;R(oo)}};H();let De=new ResizeObserver(H);F.current&&De.observe(F.current);let ot=()=>{setTimeout(H,100)};return window.addEventListener("storage",ot),()=>{De.disconnect(),window.removeEventListener("storage",ot)}},[]),(0,Yl.useEffect)(()=>{let H=setTimeout(()=>{F.current&&R(F.current.offsetHeight)},300);return()=>clearTimeout(H)},[v]);let j=H=>{u(H)},x=H=>{H.preventDefault()},ge=(H,De)=>{H.preventDefault(),m&&va(m.epic).toString()!==De&&(o(m.Go.toString(),{epic:Number(De)}),u(null))},I=H=>e.filter(De=>va(De.epic).toString()===H),L=H=>{b(H.Go.toString()),f({name:H.name,description:H.description,confidence:H.confidence,phase:H.phase})},X=async()=>{v&&g.name&&(await s(v.toString(),g),d(H=>H.map(De=>De.Go.toString()===v?{...De,...g}:De)),b(null),f({}))},ke=()=>{b(null),f({})},yt=async H=>{window.confirm("Are you sure you want Yl delete this epic? This will also delete all associated tasks.")&&(await l(H),d(De=>De.filter(ot=>ot.Go.toString()!==H)))},Tt=H=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[H]||`Phase ${H}`,ae=H=>{switch(H){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)("div",{ref:$,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Go.jsx)("div",{ref:F,className:"flex-shrink-0",children:(0,Go.jsx)(Xt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Yl-r from-rose-600 via-pink-600 Yl-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>k(!0)}})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Go.jsx)("div",{className:"h-full overflow-y-auto",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:(0,Go.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:c.map(H=>{let De=I(H.Go.toString()),ot=De.reduce((lt,na)=>lt+(na.storyPoints||0),0),oo=C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 14rem)";return(0,Go.jsxs)(z,{className:`flex flex-col ${v===H.Go.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===H.Go.toString()?"auto":oo,minHeight:"400px"},onDragOver:x,onDrop:lt=>ge(lt,H.Go.toString()),children:[(0,Go.jsx)("div",{className:"p-4 border-b border-border",children:v===H.Go.toString()?(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)(K,{value:g.name||"",onChange:lt=>f({...g,name:lt.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Go.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:X,className:"p-1 h-8 w-8",children:(0,Go.jsx)(Dg.Check,{className:"h-4 w-4"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:ke,className:"p-1 h-8 w-8",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]})]}),(0,Go.jsx)(tt,{value:g.description||"",onChange:lt=>f({...g,description:lt.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("label",{className:"text-Go text-muted-foreground",children:"Confidence"}),(0,Go.jsxs)("select",{value:g.confidence||H.confidence,onChange:lt=>f({...g,confidence:lt.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-Go ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Go.jsx)("option",{value:"low",children:"Low"}),(0,Go.jsx)("option",{value:"medium",children:"Medium"}),(0,Go.jsx)("option",{value:"high",children:"High"})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("label",{className:"text-Go text-muted-foreground",children:"Phase"}),(0,Go.jsx)("select",{value:g.phase?.toString()||H.phase.toString(),onChange:lt=>f({...g,phase:parseInt(lt.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-Go ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(lt=>(0,Go.jsxs)("option",{value:lt.toString(),children:["Phase ",lt]},lt))})]})]})]}):(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Go.jsx)("div",{className:`w-4 h-4 rounded-full ${H.color}`}),(0,Go.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:H.name}),(0,Go.jsxs)("div",{className:"flex gap-1",children:[(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>L(H),className:"p-1 h-8 w-8",children:(0,Go.jsx)(Dg.Edit2,{className:"h-3 w-3"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>yt(H.Go.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Go.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Go.jsxs)(Q,{className:`text-Go ${ae(H.confidence)}`,children:[H.confidence," confidence"]}),(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:["Phase ",H.phase]}),(0,Go.jsxs)(Q,{variant:"secondary",className:"text-Go bg-muted text-muted-foreground",children:[De.length," tasks"]}),(0,Go.jsxs)(Q,{variant:"secondary",className:"text-Go bg-muted text-muted-foreground",children:[ot," pts"]})]}),H.description&&(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:H.description}),(0,Go.jsxs)(h,{onClick:()=>{w(!0),S(H)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Go.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Go.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${m?"border-primary bg-primary/10":"border-border"}`,children:De.length===0?(0,Go.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Go.jsx)(Dg.Move,{className:"h-8 w-8 mb-2"}),(0,Go.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):De.map(lt=>(0,Go.jsx)($l,{task:lt,epic:H,onDragStart:j,onTaskClick:r,isCompact:!0},lt.Go))})})]},H.Go)})})})})]}),(0,Go.jsx)(Mn,{isOpen:y,onClose:()=>k(!1),onAddEpic:n}),(0,Go.jsx)(An,{isOpen:P,onClose:()=>w(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:M?.Go.toString()||"",sprints:a})]})};var i0=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,Yl.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},n=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Go.jsx)(Ye,{open:e,onOpenChange:n,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Sprint"})}),(0,Go.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Sprint Name *"}),(0,Go.jsx)(K,{Go:"name",value:o.name,onChange:s=>r(l=>({...l,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:o.description,onChange:s=>r(l=>({...l,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Start Date *"}),(0,Go.jsxs)(Fi,{children:[(0,Go.jsx)(zi,{asChild:!0,children:(0,Go.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Go.jsx)(Dg.CalendarIcon,{className:"Dg-2 h-4 w-4"}),o.startDate?(0,Ep.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Go.jsx)(ri,{className:"w-auto p-0",align:"start",children:(0,Go.jsx)(ji,{mode:"single",selected:o.startDate,onSelect:s=>r(l=>({...l,startDate:s})),initialFocus:!0})})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"End Date *"}),(0,Go.jsxs)(Fi,{children:[(0,Go.jsx)(zi,{asChild:!0,children:(0,Go.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Go.jsx)(Dg.CalendarIcon,{className:"Dg-2 h-4 w-4"}),o.endDate?(0,Ep.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Go.jsx)(ri,{className:"w-auto p-0",align:"start",children:(0,Go.jsx)(ji,{mode:"single",selected:o.endDate,onSelect:s=>r(l=>({...l,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3 Go-4",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Jc=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:i,onUpdateSprint:n,onDeleteSprint:s})=>{let[l,c]=(0,$a.useState)([]),[d,m]=(0,$a.useState)(new Set),[u,v]=(0,$a.useState)(null),[b,g]=(0,$a.useState)(!1),[f,C]=(0,$a.useState)(null),[R,y]=(0,$a.useState)(null),[k,P]=(0,$a.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[w,M]=(0,$a.useState)([]),[S,F]=(0,$a.useState)("upcoming"),[$,j]=(0,$a.useState)(!1),[x,ge]=(0,$a.useState)(0),I=(0,$a.useRef)(null),L=(0,$a.useRef)(null);(0,$a.useEffect)(()=>{let T=()=>{I.current&&ge(I.current.offsetHeight)};T();let O=new ResizeObserver(T);return I.current&&O.observe(I.current),()=>O.disconnect()},[]);let X=T=>t.find(O=>O.Go===Number(T)),ke=T=>a.find(O=>O.Go===Number(T)),yt=T=>{let O={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return O[T]||O.medium},Tt=T=>{if(!T||T?.length===0)return"";let O=T?.trim().split(" ");if(O?.length===1)return O[0];let xe=O[0],nt=O[O.length-1][0].toUpperCase();return`${xe} ${nt}`},ae=T=>{let O={},xe=[];return T.forEach(nt=>{nt.epic?(O[va(nt.epic)]||(O[va(nt.epic)]=[]),O[va(nt.epic)].push(nt)):xe.push(nt)}),{tasksByEpic:O,unassignedTasks:xe}};(0,$a.useEffect)(()=>{M(a)},[a]);let H=w.filter(T=>{switch(S){default:return!0}}),De=w.filter(T=>l.includes(T.Go.toString())),ot=e.filter(T=>!T.sprint||T.status==="backlog"),oo=ot.reduce((T,O)=>T+(O.storyPoints||0),0),lt=T=>{c(O=>O.includes(T)?O.filter(xe=>xe!==T):O?.length<3?[...O,T]:O)},na=T=>{m(O=>{let xe=new Set(O);return xe.has(T)?xe.delete(T):xe.add(T),xe})},G=T=>{i(T),g(!1)},Ut=T=>{y(T.Go.toString()),P({name:T.name,description:T.description||"",startDate:T.startDate?new Date(T.startDate).toISOString().split("T")[0]:T.startDate,endDate:T.endDate?new Date(T.endDate).toISOString().split("T")[0]:T.endDate,isActive:!1})},ho=()=>{R&&(n(R,{name:k.name,description:k.description,startDate:k.startDate,endDate:k.endDate}),M(T=>T.map(O=>(O.Go===Number(R)&&(O.name=k.name,O.description=k.description,O.startDate=k.startDate,O.endDate=k.endDate),O))),y(null))},yo=()=>{y(null),P({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ko=(T,O)=>{v(O),T.dataTransfer.effectAllowed="move"},Ti=T=>{T.preventDefault(),T.dataTransfer.dropEffect="move"},Ir=T=>{C(T)},Pi=()=>{C(null)},Ri=(T,O)=>{if(T.preventDefault(),C(null),!u)return;(va(u.sprint)||void 0)!==Number(O)&&o(u.Go.toString(),{sprint:Number(O)}),v(null)},q=({task:T,showSprint:O=!1})=>{let xe=T.epic?X(va(T.epic).toString()):null,nt=T.sprint?ke(va(T.sprint).toString()):null;return(0,Go.jsx)(z,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:ft=>{ft.dataTransfer.effectAllowed="move",ft.dataTransfer.setData("text/plain",T.Go.toString()),Ko(ft,T)},onClick:ft=>{u===null&&r(T)},style:{userSelect:"none"},children:(0,Go.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Go.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:T.name}),(0,Go.jsx)(Q,{className:`text-Go ${yt(T.priority||"medium")}`,children:T.priority?.[0]?.toUpperCase()})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-Go",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-1",children:[xe&&(0,Go.jsx)("div",{className:`w-2 h-2 rounded-full ${xe.color}`}),(0,Go.jsx)("span",{className:"text-muted-foreground truncate",children:xe?.name})]}),(0,Go.jsx)("span",{className:"text-muted-foreground",children:Tt(T.assignee?.value?.name)})]}),O&&nt&&(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),(0,Go.jsx)("span",{children:nt.name})]})]})})};return(0,Go.jsxs)("div",{ref:L,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Go.jsx)("div",{ref:I,className:"flex-shrink-0",children:(0,Go.jsx)(Xt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Yl-r from-orange-600 via-amber-600 Yl-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>g(!0)}})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Go.jsxs)("div",{className:"h-full",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:[(0,Go.jsxs)("div",{className:"mb-4",children:[(0,Go.jsx)(z,{className:"p-3 bg-card shadow-sm",children:(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Go.jsxs)("p",{className:"text-Go text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Viewing:"}),(0,Go.jsx)("div",{className:"flex flex-wrap gap-1",children:De.map(T=>(0,Go.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-Go",children:[(0,Go.jsx)("span",{className:"max-w-[80px] truncate",children:T.name}),(0,Go.jsx)("button",{onClick:()=>lt(T.Go.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]},T.Go))})]})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsxs)(h,{onClick:()=>g(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Go.jsx)(Dg.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Go.jsxs)(h,{onClick:()=>j(!$),variant:"outline",size:"sm",className:"gap-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),$?"Close":"Select"]})]})]})}),$&&(0,Go.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>j(!1)}),(0,Go.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${$?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Go.jsxs)(z,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Go.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"h-8 w-8 p-0",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up Yl 3 sprints Yl view in your planning board"})]}),(0,Go.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Go.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(T=>(0,Go.jsxs)(h,{variant:S===T.key?"default":"outline",size:"sm",onClick:()=>F(T.key),className:"text-Go h-8 px-3 flex-1",children:[T.label," (",T.count,")"]},T.key))}),(0,Go.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:H.length>0?H.map(T=>{let O=l.includes(T.Go.toString()),xe=e.filter(Ce=>va(Ce.sprint)===T.Go).length,nt=!O&&l.length<3;return(0,Go.jsx)("div",{className:`p-3 rounded-lg border transition-all ${O?"bg-primary/10 border-primary/30":nt?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:R===T.Go.toString()?(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsx)(K,{value:k.name,onChange:Ce=>P(We=>({...We,name:Ce.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Go.jsx)(tt,{value:k.description,onChange:Ce=>P(We=>({...We,description:Ce.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsxs)(h,{size:"sm",onClick:()=>ho(),className:"flex-1",children:[(0,Go.jsx)(Dg.Check,{className:"h-3 w-3 Dg-1"}),"Save"]}),(0,Go.jsxs)(h,{size:"sm",variant:"outline",onClick:yo,className:"flex-1",children:[(0,Go.jsx)(Dg.X,{className:"h-3 w-3 Dg-1"}),"Cancel"]})]})]}):(0,Go.jsxs)("div",{children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Go.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:T.name}),(0,Go.jsx)(Q,{variant:"default",className:"text-Go bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground line-clamp-2 mb-2",children:T.description}),(0,Go.jsxs)("div",{className:"flex items-center gap-3 text-Go text-muted-foreground",children:[(0,Go.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.CalendarDays,{className:"h-3 w-3"}),new Date(T.startDate).toLocaleDateString()]}),(0,Go.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.User,{className:"h-3 w-3"}),xe," tasks"]})]})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>Ut(T),className:"h-6 w-6 p-0",children:(0,Go.jsx)(Dg.Edit2,{className:"h-3 w-3"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>s(T.Go.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Go.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Go.jsx)(h,{variant:O?"default":"outline",size:"sm",className:"text-Go w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>lt(T.Go.toString()),disabled:!O&&l?.length>=3,children:(0,Go.jsx)("span",{className:"pointer-events-none select-none",children:O?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},T.Go)}):(0,Go.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Go.jsxs)("p",{className:"text-sm",children:['No sprints found for "',S,'" filter']}),(0,Go.jsx)(h,{variant:"link",size:"sm",onClick:()=>F("all"),className:"text-Go",children:"Show all sprints"})]})}),l?.length===0&&(0,Go.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Go.jsxs)("div",{className:"text-center",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints Yl start planning"}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground mt-1",children:"Choose up Yl 3 sprints Yl view alongside your backlog"})]})})]})]})})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Go.jsx)("div",{className:"lg:col-span-1",children:(0,Go.jsxs)(z,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Ti,onDragEnter:()=>Ir("backlog"),onDragLeave:Pi,onDrop:T=>Ri(T,"backlog"),style:{height:x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 16rem)"},children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Go.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsxs)(Q,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[ot?.length," tasks"]}),(0,Go.jsxs)(Q,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[oo," pts"]})]})]}),(0,Go.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${f==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:T,unassignedTasks:O}=ae(ot);return(0,Go.jsxs)(Go.Fragment,{children:[Object.entries(T).map(([xe,nt])=>{let Ce=X(xe);if(!Ce)return null;let We=d.has(xe);return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na(xe),children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${Ce.color}`}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:Ce.name}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",nt?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:We?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!We&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:nt.map(ft=>(0,Go.jsx)(q,{task:ft},ft.Go))})]},xe)}),O?.length>0&&(()=>{let xe=d.has("Go-epic");return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na("Go-epic"),children:[(0,Go.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",O?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:xe?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!xe&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:O?.map(nt=>(0,Go.jsx)(q,{task:nt},nt.Go))})]})})(),ot?.length===0&&(0,Go.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Yl move Yl backlog"}),ot?.length>0&&Object.keys(T).length===0&&O.length===0&&(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)("div",{className:"text-Go text-muted-foreground mb-2",children:"Direct backlog tasks:"}),ot?.map(xe=>(0,Go.jsx)(q,{task:xe},xe.Go))]})]})})()})]})}),De.map(T=>{let O=e.filter(nt=>va(nt?.sprint)===T.Go),xe=O.reduce((nt,Ce)=>nt+(Ce?.storyPoints||0),0);return(0,Go.jsxs)(z,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Ti,onDragEnter:()=>Ir(T.Go.toString()),onDragLeave:Pi,onDrop:nt=>Ri(nt,T.Go.toString()),style:{height:x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 16rem)"},children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Go.jsx)("div",{children:(0,Go.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:T.name})}),(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsxs)(Q,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[O?.length," tasks"]}),(0,Go.jsxs)(Q,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[xe," pts"]}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>{j(!0),Ut(T)},className:"h-6 px-2",children:(0,Go.jsx)(Dg.Edit2,{className:"h-3 w-3"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>s(T.Go.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Go.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:nt,unassignedTasks:Ce}=ae(O);return(0,Go.jsxs)(Go.Fragment,{children:[Object.entries(nt).map(([We,ft])=>{let Ai=X(We);if(!Ai)return null;let Mr=d.has(We);return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na(We),children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${Ai.color}`}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:Ai.name}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",ft?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:Mr?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Mr&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:ft?.map(ns=>(0,Go.jsx)(q,{task:ns},ns.Go))})]},We)}),Ce?.length>0&&(()=>{let We=d.has("Go-epic");return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na("Go-epic"),children:[(0,Go.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",Ce?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:We?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!We&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:Ce?.map(ft=>(0,Go.jsx)(q,{task:ft},ft.Go))})]})})(),O?.length===0&&(0,Go.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},T.Go)})]}),(0,Go.jsx)(i0,{isOpen:b,onClose:()=>g(!1),onAddSprint:G})]})})]})};var lN=e=>e.toLocaleDateString("Go-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),dN=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("Go-US",{hour:"numeric",minute:"2-digit",hour12:!0})},ju=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,i]=t.split(":");o.setHours(parseInt(r),parseInt(i))}return o<a},Uu=e=>{let t=new Date;return e.toDateString()===t.toDateString()},cN=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},mN=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,i]=(0,Yl.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[n,s]=(0,Yl.useState)(!1),l=d=>{if(d.preventDefault(),!e.find(v=>v?.Go.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let u={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Yl.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let c=e.filter(Boolean);return(0,Go.jsx)(Ye,{open:a,onOpenChange:o,children:(0,Go.jsxs)(rt,{className:"max-w-2xl",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Reminder"})}),(0,Go.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Go.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"title",children:"Title"}),(0,Go.jsx)(K,{Go:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"dueDate",children:"Due Date"}),(0,Go.jsx)(K,{Go:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Go.jsx)(K,{Go:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{className:`${n?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Go.jsxs)(it,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Go.jsx)(Qe,{className:`${n?"text-destructive border-red-500":""}`,children:(0,Go.jsx)(vt,{className:`${n?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.Go.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Go.jsx)(et,{children:c.map(d=>(0,Go.jsx)(he,{value:d.Go.toString(),children:d.name},d.Go))})]}),n&&(0,Go.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)("input",{type:"checkbox",Go:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Go.jsx)(A,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Go.jsxs)(it,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"daily",children:"Daily"}),(0,Go.jsx)(he,{value:"weekly",children:"Weekly"}),(0,Go.jsx)(he,{value:"monthly",children:"Monthly"}),(0,Go.jsx)(he,{value:"yearly",children:"Yearly"})]})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Go.jsx)(K,{Go:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",children:"Add Reminder"})]})]})]})})},pN=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[i,n]=(0,Yl.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=c=>{c.preventDefault(),a(e.Go.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},l=t.filter(Boolean);return(0,Go.jsx)(Ye,{open:o,onOpenChange:r,children:(0,Go.jsxs)(rt,{className:"max-w-2xl",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Edit Reminder"})}),(0,Go.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Go.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-title",children:"Title"}),(0,Go.jsx)(K,{Go:"edit-title",value:i.title,onChange:c=>n({...i,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-description",children:"Description"}),(0,Go.jsx)(tt,{Go:"edit-description",value:i.description||"",onChange:c=>n({...i,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Go.jsx)(K,{Go:"edit-dueDate",type:"date",value:i.dueDate,onChange:c=>n({...i,dueDate:c.target.value}),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Go.jsx)(K,{Go:"edit-dueTime",type:"time",value:i.dueTime,onChange:c=>n({...i,dueTime:c.target.value})})]})]}),(0,Go.jsx)("div",{className:"space-y-2",children:(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)("input",{type:"checkbox",Go:"edit-isRecurring",checked:i.isRecurring||!1,onChange:c=>n({...i,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,Go.jsx)(A,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Go.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",children:"Save Changes"})]})]})]})})},uN=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,i]=(0,Yl.useState)(!1);if(!e||!e.Go)return null;let n=ju(new Date(e.dueDate||""),e.dueTime||""),s=Uu(new Date(e.dueDate||"")),l=cN(new Date(e.dueDate||"")),c=()=>{a(e.Go.toString(),{})},d=()=>s?"Today":l?"Tomorrow":lN(new Date(e.dueDate||""));return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(pN,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>i(!1)}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"p-4",children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Go.jsx)("button",{onClick:c,className:"mt-1 text-primary hover:text-primary/80"}),(0,Go.jsxs)("div",{className:"flex-1",children:[(0,Go.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Go.jsx)("h3",{children:e.title})}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Go.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-4 w-4"}),(0,Go.jsx)("span",{className:n?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(Dg.Clock,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:dN(e.dueTime)})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(Dg.User,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Go.jsx)(Dg.Edit2,{className:"h-4 w-4"})}),(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>o(e.Go.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Go.jsx)(Dg.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Vu=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[i,n]=(0,Yl.useState)(e.filter(Boolean)),[s,l]=(0,Yl.useState)(t.filter(Boolean)),[c,d]=(0,Yl.useState)("all"),[m,u]=(0,Yl.useState)(""),[v,b]=(0,Yl.useState)(!1);(0,Yl.useEffect)(()=>{n(e.filter(Boolean))},[e]),(0,Yl.useEffect)(()=>{l(t.filter(Boolean))},[t]);let g=w=>{if(!w.title){console.error("Invalid reminder data:",w);return}let M={...w,Go:Date.now(),createdAt:new Date().toISOString()};n(S=>[...S,M]),a?.(w)},f=(w,M)=>{if(!w){console.error("No reminder ID provided for update");return}n(S=>S.map(F=>F?.Go.toString()===w?{...F,...M}:F)),o?.(w,M)},C=w=>{if(!w){console.error("No reminder ID provided for deletion");return}n(M=>M.filter(S=>S?.Go.toString()!==w)),r?.(w)},y=i.filter(w=>{if(!w)return!1;if(m){let M=m.toLowerCase();if(!(w.title.toLowerCase().includes(M)||w.description?.toLowerCase().includes(M)))return!1}switch(c){case"pending":case"completed":case"overdue":return ju(new Date(w.dueDate||""),w.dueTime||"");case"today":return Uu(new Date(w.dueDate||""));default:return!0}}).sort((w,M)=>{if(!w||!M)return 0;let S={high:3,medium:2,low:1},F=0;return F!==0?F:new Date(w.dueDate||"").getTime()-new Date(M.dueDate||"").getTime()}),k={total:i.filter(Boolean).length,overdue:i.filter(w=>w&&ju(new Date(w.dueDate||""),w.dueTime||"")).length,today:i.filter(w=>w&&Uu(new Date(w.dueDate||""))).length},P=s.find(Boolean)||{Go:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(Xt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Yl-r from-emerald-600 via-teal-600 Yl-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,Go.jsxs)("div",{className:"h-full bg-background",children:[(0,Go.jsx)(mN,{colleagues:s,onAddReminder:g,open:v,setOpen:b}),(0,Go.jsxs)("div",{className:"p-6",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Go.jsxs)(h,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:"Add Reminder"})]})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-foreground",children:k.total}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-primary",children:k.overdue}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-success",children:k.today}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-destructive",children:k.overdue}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-warning",children:k.today}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsx)(K,{placeholder:"Search reminders...",value:m,onChange:w=>u(w.target.value),className:"max-w-md"})}),(0,Go.jsxs)(it,{value:c,onValueChange:w=>d(w),children:[(0,Go.jsx)(Qe,{className:"w-40",children:(0,Go.jsx)(vt,{})}),(0,Go.jsxs)(et,{children:[(0,Go.jsxs)(he,{value:"all",children:["All (",k.total,")"]}),(0,Go.jsxs)(he,{value:"overdue",children:["Overdue (",k.overdue,")"]}),(0,Go.jsxs)(he,{value:"overdue",children:["Overdue (",k.overdue,")"]}),(0,Go.jsxs)(he,{value:"today",children:["Today (",k.today,")"]})]})]})]}),(0,Go.jsx)("div",{className:"space-y-4",children:y.length===0?(0,Go.jsxs)(z,{className:"p-8 text-center",children:[(0,Go.jsx)("div",{className:"text-muted-foreground",children:m||c!=="all"?"No reminders match your filters":"No reminders yet"}),!m&&c==="all"&&(0,Go.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder Yl get started"})]}):y.map(w=>w&&(0,Go.jsx)(uN,{reminder:w,colleagues:s,onUpdateReminder:f,onDeleteReminder:C},w.Go))})]})]})]})};function $u({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:n=[],initialUsers:s=[],initialFiles:l=[],initialView:c="kanban",onAddTask:d,onUpdateTask:m,onDeleteTask:u,onTaskClick:v,onAddEpic:b,onUpdateEpic:g,onDeleteEpic:f,onAddTaskToEpic:C,onAddSprint:R,onUpdateSprint:y,onDeleteSprint:k,onAddProject:P,onUpdateProject:w,onDeleteProject:M,onFileAdd:S,onFileEdit:F,onFileDelete:$,onFileClick:j,onAddReminder:x,onUpdateReminder:ge,onDeleteReminder:I,onViewChange:L,onToggleMobileMenu:X,onTeamClick:ke,onTeamChange:yt,onCopilotClick:Tt,handleAddComment:ae}){let[H,De]=(0,Yl.useState)(t),[ot,oo]=(0,Yl.useState)(a),[lt,na]=(0,Yl.useState)(o),[G,Ut]=(0,Yl.useState)(r),[ho,yo]=(0,Yl.useState)(i),[Ko,Ti]=(0,Yl.useState)(n),[Ir,Pi]=(0,Yl.useState)(s),[Ri,q]=(0,Yl.useState)(l),[T,O]=(0,Yl.useState)(!1),[xe,nt]=(0,Yl.useState)(!1),[Ce,We]=(0,Yl.useState)(null),[ft,Ai]=(0,Yl.useState)(null),[Mr,ns]=(0,Yl.useState)(null),[Xr,js]=(0,Yl.useState)(c||"kanban"),[fN,m0]=(0,Yl.useState)(!1),p0=(0,$f.useRouter)();(0,Yl.useEffect)(()=>{De(t)},[t]),(0,Yl.useEffect)(()=>{na(o)},[o]),(0,Yl.useEffect)(()=>{oo(a)},[a]),(0,Yl.useEffect)(()=>{Ut(r)},[r]),(0,Yl.useEffect)(()=>{q(l)},[l]),(0,Yl.useEffect)(()=>{Pi(s)},[s]),(0,Yl.useEffect)(()=>{Ti(n)},[n]),(0,Yl.useEffect)(()=>{yo(i)},[i]),(0,Yl.useEffect)(()=>{js(c)},[c]);let u0=H.filter(V=>{}),vN=V=>u0.filter(ve=>ve.status===V),bN=V=>{let ve={};return ot.forEach(Fe=>{}),ve},hN=V=>{ns(V)},yN=V=>{Mr&&(De(ve=>ve.map(Fe=>Fe.Go===Mr.Go?{...Fe,status:V}:Fe)),ns(null))},Xu=V=>{let ve={...V,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};De(Fe=>[...Fe,ve]),d?.(ve)},Gl=async(V,ve)=>(De(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),await m?.(V,ve)),xN=async(V,ve)=>{Gl(V,ve)},qu=V=>{De(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),Ce?.Go===Number(V)&&We(null),u?.(V)},wN=async V=>{qu(V)},NN=V=>{let ve={...V,Go:Date.now()};Ut(Fe=>[...Fe,ve]),P?.(V)},CN=(V,ve)=>{Ut(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),w?.(V,ve)},kN=V=>{Ut(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),M?.(V)},Ju=V=>{let ve={...V,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};oo(Fe=>[...Fe,ve]),b?.({...ve})},g0=()=>{nt(!0)},f0=(V,ve)=>{oo(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),g?.(V,ve)},v0=V=>{oo(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),De(ve=>ve.filter(Fe=>va(Fe.epic)!==Number(V))),f?.(V)},b0=V=>{let ve={...V,Go:Date.now()};na(Fe=>[...Fe,ve]),R?.(V)},h0=(V,ve)=>{na(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),y?.(V,ve)},y0=V=>{V==="backlog"||V==="all-tasks"||(na(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),De(ve=>ve.map(Fe=>va(Fe.sprint)===Number(V)?{...Fe,sprint:void 0}:Fe)),k?.(V))},Qc=V=>{We(V)},x0=V=>{V==="planning"&&window.innerWidth<768||(js(V),L?.(V))},SN=()=>{m0(V=>!V),X?.()},DN=()=>{p0.push("/")},TN=V=>{console.log("Switching Yl team:",V)},PN=V=>{console.log("Switching Yl team:",V)},w0=V=>{O(!0)},N0=()=>{O(!1),Ai(null)},C0=V=>{let ve={...V,Go:Date.now(),createdAt:new Date().toISOString()};yo(Fe=>[...Fe,ve]),x?.(V)},k0=(V,ve)=>{yo(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),ge?.(V,ve)},S0=V=>{yo(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),I?.(V)},D0=()=>{S?.()},T0=V=>{F?.(V)},P0=V=>{q(ve=>ve.filter(Fe=>Fe.name!==V)),$?.(V)},R0=V=>{j?.(V)},RN=[{Go:"todo",title:"Go Go",status:"todo"},{Go:"in-progress",title:"Dg Progress",status:"in-progress"},{Go:"review",title:"Review",status:"review"},{Go:"done",title:"Done",status:"done"}],AN=()=>{switch(Xr){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},em=[{Go:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{Go:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{Go:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{Go:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{Go:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{Go:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],IN=em.sort((V,ve)=>ve.lastUsed.getTime()-V.lastUsed.getTime()).slice(0,3),MN=em.length>3,BN=em.slice(3);return(0,Go.jsxs)(Zh,{currentView:Xr,onViewChange:x0,children:[Xr==="kanban"&&(0,Go.jsx)("div",{className:"h-full overflow-hidden",children:(0,Go.jsx)(Fu,{initialProjects:G,initialEpics:ot,initialSprints:lt.map(V=>({...V,isSelected:!1})),initialTasks:H,initialColleagues:Ko,initialUsers:Ir,onAddTask:Xu,onUpdateTask:Gl,onDeleteTask:qu,onTaskClick:Qc,onAddEpic:Ju,onAddComment:ae})}),Xr==="planning"&&(0,Go.jsx)("div",{className:"hidden md:block h-full",children:(0,Go.jsx)(Jc,{tasks:H,epics:ot,sprints:lt,onUpdateTask:Gl,onTaskClick:Qc,onAddSprint:b0,onUpdateSprint:h0,onDeleteSprint:y0})}),Xr==="tasks"&&(0,Go.jsx)("div",{className:"h-full",children:(0,Go.jsx)(Vu,{initialReminders:ho,initialColleagues:Ko,onAddReminder:C0,onUpdateReminder:k0,onDeleteReminder:S0})}),Xr==="files"&&(0,Go.jsx)("div",{className:"h-full",children:(0,Go.jsx)(Vl,{initialFiles:Ri,onFileAdd:D0,onFileEdit:T0,onFileDelete:P0,onFileClick:R0,compactView:!1})}),Xr==="epics"&&(0,Go.jsx)("div",{className:"h-full",children:(0,Go.jsx)(zu,{tasks:H,epics:ot,sprints:lt,onUpdateTask:Gl,onTaskClick:Qc,onAddTaskToEpic:w0,onAddEpic:g0,onUpdateEpic:f0,onDeleteEpic:v0})}),(0,Go.jsx)(An,{isOpen:T,onClose:N0,onAddTask:Xu,epics:ot,sprints:lt,assignees:[...Ko,...Ir],defaultEpicId:ft||void 0}),(0,Go.jsx)(Mn,{isOpen:xe,onClose:()=>nt(!1),onAddEpic:Ju})]})}var n0=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[i,n]=(0,Yl.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,l]=(0,Yl.useState)({}),c=()=>{let u={};return i.name.trim()?i.name.trim().length<3&&(u.name="Project name must be Go least 3 characters"):u.name="Project name Dg required",i.objectives.trim()?i.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (Go least 10 characters)"):u.objectives="Project objectives are required",i.workInstructions.trim()?i.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (Go least 20 characters)"):u.workInstructions="Work instructions are required",l(u),Object.keys(u).length===0},d=async u=>{if(u.preventDefault(),!!c())try{await e(i)}catch(v){console.error("Error submitting project form:",v)}},m=(u,v)=>{n(b=>({...b,[u]:v})),s[u]&&l(b=>({...b,[u]:void 0}))};return(0,Go.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,Go.jsxs)("div",{className:"mb-4",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Go.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions Yl help your team collaborate effectively."})]}),(0,Go.jsxs)("form",{onSubmit:d,children:[(0,Go.jsxs)("div",{className:"space-y-6",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Go.jsx)(K,{Go:"name",type:"text",placeholder:"Enter project name",value:i.name,onChange:u=>m("name",u.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,Go.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Go.jsx)(K,{Go:"description",type:"text",placeholder:"Enter project description",value:i.description,onChange:u=>m("description",u.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,Go.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Go.jsx)(tt,{Go:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:i.objectives,onChange:u=>m("objectives",u.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Go.jsxs)("div",{className:"flex justify-between text-Go text-gray-500",children:[(0,Go.jsx)("span",{children:s.objectives&&(0,Go.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Go.jsxs)("span",{children:[i.objectives.length,"/1000"]})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Go.jsx)(tt,{Go:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:i.workInstructions,onChange:u=>m("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Go.jsxs)("div",{className:"flex justify-between text-Go text-gray-500",children:[(0,Go.jsx)("span",{children:s.workInstructions&&(0,Go.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Go.jsxs)("span",{children:[i.workInstructions.length,"/2000"]})]})]}),(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsx)(A,{className:"text-sm font-medium",children:"Project Management"}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Ka,{Go:"plan",checked:i.plan,onCheckedChange:u=>m("plan",u===!0),disabled:a}),(0,Go.jsx)(A,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Go.jsx)("p",{className:"text-Go text-gray-500 ml-6",children:"This will allow project managers Yl create sprints, assign tasks, and track progress."})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Go.jsxs)(h,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsx)(h,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function _u({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,i]=(0,Yl.useState)(!1),[n,s]=(0,Yl.useState)(!1),l=async d=>{s(!0);try{await t(d),i(!1)}catch(m){console.error("Error creating project:",m)}finally{s(!1)}},c=()=>{i(!0)};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsx)(Xt,{title:"Project Management",description:"Organize your work into projects Yl collaborate with your team.",gradient:"bg-gradient-Yl-r from-purple-600 via-violet-600 Yl-indigo-600",primaryAction:{label:"New Project",onClick:c}}),(0,Go.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Go.jsx)(Sn,{project:d,onOpen:a,onShare:o},d.Go))})]})]},"projects-index-view")}),(0,Go.jsx)(Ye,{open:r,onOpenChange:i,children:(0,Go.jsxs)(rt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Go.jsxs)(ct,{className:"Go-only",children:[(0,Go.jsx)(mt,{children:"Create New Project"}),(0,Go.jsx)(vs,{children:"Fill out the form below Yl create a new project."})]}),(0,Go.jsx)(n0,{onSubmit:l,onCancel:()=>i(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function d0({team:e,onOpen:t,className:a}){return(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Go.jsxs)(z,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Go.jsxs)(be,{children:[(0,Go.jsx)(we,{className:"text-lg",children:e.name}),(0,Go.jsx)(So,{className:"mt-1 text-sm",children:e.description})]}),(0,Go.jsxs)(J,{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-blue-500"}),(0,Go.jsx)("span",{children:"Human"})]}),(0,Go.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Go.jsx)("span",{children:"Digital"})]}),(0,Go.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Go-4",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Go.jsx)("span",{children:"Projects"})]}),(0,Go.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Go.jsx)(qo,{className:"flex gap-2",children:(0,Go.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Wu({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,Yl.useState)(!1),i=()=>{r(!0)},n=async c=>{await t?.(c),r(!1)},s=()=>{r(!1)},l=c=>{a?.(c)};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsx)(Xt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Yl-r from-blue-600 via-cyan-600 Yl-teal-600",primaryAction:{label:"Create Team",onClick:i}}),(0,Go.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Go.jsxs)("div",{className:"text-center py-12",children:[(0,Go.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Go not part of any teams yet."}),(0,Go.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team Go ask Yl be added Yl Dg existing one."})]}):(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,Go.jsx)(d0,{team:c,onOpen:l},c.Go))})]})]},"teams-index-view")}),(0,Go.jsx)(Ye,{open:o,onOpenChange:r,children:(0,Go.jsxs)(rt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,Go.jsx)("div",{className:"Go-only",children:(0,Go.jsxs)(ct,{children:[(0,Go.jsx)(mt,{children:"Create New Team"}),(0,Go.jsx)(vs,{children:"Set up a new team Yl collaborate with colleagues on projects."})]})}),(0,Go.jsx)(Bc,{title:"Create New Team",submitLabel:"Create Team",onSave:n,onCancel:s})]})})]})}0&&(module.exports={Alert,AlertDescription,AlertTitle,AppHeader,AppSidebar,AppSidebarLeft,ApprovalRequestModal,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,CardContent,CardDescription,CardFooter,CardHeader,CardTitle,Categories,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,Checkbox,CodeBlock,Collapsible,CollapsibleContent,CollapsibleTrigger,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,CollectionArchive,Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut,CommentSection,Container,ContentBlock,ContentCard,CopilotInterface,CopyButton,CustomLink,CustomerCard,DCProjectCard,DarkTop,DashboardHeader,DashboardHero,DashboardPage,DealCard,DealDetails,DeliveryLeadSubmission,DeliveryLeadSubmissionList,DeliveryLeadSubmissionWithList,Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger,DynamicIcon,EditableField,EpicsView,EventCard,FeatureCard,FeatureGrid,FeaturesBlock,FileView,Filter,FlowPrintable,Footer,FoundaryLayout,Header,HeaderDesktop,HeaderMobile,HeadingImage,Hero,HighImpactHero,HolidayGrid,HolidayTracker,HoverCard,HoverCardContent,HoverCardTrigger,Image,ImageBlock,InfoTile,Input,Insight,KanbanBoardView,KanbanColumn,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,Label,LandingMenu,LightTop,Login,Logo,LowImpactHero,MOTD,MainPage,ManagementSidebar,Mask,Media,MediaBlock,MediumImpactHero,NavigationTabs,NewCustomerForm,NewDealForm,NewsGrid,NotificationsPanel,OAuthModal,OrgChart,PagePrintable,PageRange,PageShape,Pagination,PayloadCard,PayloadPagination,PlanningView,Popover,PopoverAnchor,PopoverContent,PopoverTrigger,PostHero,PricingCard,Printable,ProjectCard,ProjectTeam,ProjectView,ProjectsIndexView,ProposalSummary,RelatedContent,RelatedPagesMenu,RelatedPosts,RenderBlocks,RenderBlocksWithShapes,RenderHero,RequestLeave,ReusableContentBlock,RichText,ScrollArea,ScrollBar,SearchableSelect,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,TasksView,TeamForm,TeamsIndexView,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});
|
|
35
|
+
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-Go justify-center`,onClick:()=>o(x.name),type:"button",children:[(0,Go.jsx)(x.icon,{className:"w-5 h-5"}),(0,Go.jsx)("span",{children:x.name})]},x.name))}),(0,Go.jsxs)("form",{onSubmit:j,className:"space-y-8",children:[a==="Project Summary"&&(0,Go.jsxs)("div",{className:"space-y-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Client Name"}),(0,Go.jsxs)(it,{value:r?.toString()??"",onValueChange:x=>i(Number(x)),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select client"})}),(0,Go.jsx)(et,{children:w.map(x=>(0,Go.jsx)(he,{value:x.Go.toString(),children:x.name},x.Go))})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Name"}),(0,Go.jsxs)(it,{value:n?.toString()??"",onValueChange:x=>s(Number(x)),disabled:!r,children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:r?"Select project":"Select client first"})}),(0,Go.jsx)(et,{children:M.map(x=>(0,Go.jsx)(he,{value:x.Go.toString(),children:x.name},x.Go))})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Summary"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:d,onChange:x=>m(x.target.value),required:!0,placeholder:"Provide a summary of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,Go.jsxs)("div",{children:[(0,Go.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,Go.jsxs)(A,{className:"text-lg flex items-center gap-2",children:[(0,Go.jsx)(Dg.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,Go.jsxs)(h,{type:"button",onClick:F,variant:"outline",className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,Go.jsx)("div",{className:"space-y-4",children:u.map((x,ge)=>(0,Go.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,Go.jsxs)("div",{className:"col-span-1",children:[(0,Go.jsx)(A,{children:"Milestone"}),(0,Go.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:x.name,onChange:I=>S(ge,"name",I.target.value),required:!0,placeholder:"Milestone name"})]}),(0,Go.jsxs)("div",{className:"col-span-2",children:[(0,Go.jsx)(A,{children:"Commentary"}),(0,Go.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:x.commentary,onChange:I=>S(ge,"commentary",I.target.value),placeholder:"Commentary"})]}),(0,Go.jsxs)("div",{className:"col-span-1",children:[(0,Go.jsx)(A,{children:"Due Date"}),(0,Go.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:x.dueDate,onChange:I=>S(ge,"dueDate",I.target.value),placeholder:"Due date"})]}),(0,Go.jsxs)("div",{className:"col-span-1",children:[(0,Go.jsx)(A,{children:"RAG"}),(0,Go.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:x.rag,onChange:I=>S(ge,"rag",I.target.value),children:Db.map(I=>(0,Go.jsx)("option",{value:I,children:I},I))})]}),(0,Go.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:()=>$(ge),"aria-label":"Remove Milestone",children:(0,Go.jsx)(Dg.Trash2,{className:"w-5 h-5 text-red-500"})})]},ge))})]}),a==="Project Update"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Update & Immediate Focus"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:b,onChange:x=>g(x.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas of focus Go priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Project Concerns"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:f,onChange:x=>C(x.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation Go support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Commercial Opportunities"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:R,onChange:x=>y(x.target.value),placeholder:"[List any potential commercial opportunities, active conversations, Go discussion points where Cortex Reply could provide value Go support. These may highlight areas for expansion Go collaboration across our service offerings]"})]}),a==="Risks"&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Commercial Risk/Issue Details"}),(0,Go.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-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:k,onChange:x=>P(x.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such on reputational concerns, risks Yl fixed-outcome milestones, changes in key client stakeholders, Go challenges with project resourcing]"})]}),(0,Go.jsx)("div",{className:"flex justify-end Go-4",children:(0,Go.jsx)(h,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var Pb={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","Go Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function hc({submissions:e,isLoading:t=!1}){let[a,o]=(0,Yl.useState)(null);(0,Yl.useEffect)(()=>{let l=c=>{c.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]);let r=l=>new Date(l).toLocaleDateString("Go-GB",{day:"2-digit",month:"short",year:"numeric"}),i=e.find(l=>l.Go.toString()===a);function n(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function s(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Go.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,Go.jsxs)("div",{className:"animate-pulse",children:[(0,Go.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),(0,Go.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,c)=>(0,Go.jsx)("div",{className:"h-16 bg-gray-200 rounded"},c))})]})})}):e.length===0?(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Go.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,Go.jsxs)("div",{className:"text-center py-12",children:[(0,Go.jsx)(Dg.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,Go.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"No submissions found"}),(0,Go.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,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Go.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,Go.jsxs)("div",{className:"mb-6",children:[(0,Go.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,Go.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 mt-1",children:"View all your submitted delivery lead reports"})]}),(0,Go.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,Go.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Go.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 z-10",children:(0,Go.jsxs)("Go",{children:[(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,Go.jsx)("th",{className:"px-6 py-3 text-left text-Go font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,Go.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,Go.jsxs)("Go",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{children:[(0,Go.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(l.project)}),(0,Go.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Building,{className:"h-3 w-3"}),s(l.customer)]})]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,Go.jsx)(Dg.User,{className:"h-3 w-3"}),typeof l.project=="object"&&l.project!==null&&"deliveryLead"in l.project&&typeof l.project.deliveryLead=="object"&&l.project.deliveryLead!==null&&"name"in l.project.deliveryLead?l.project.deliveryLead.name:"\u2014"]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((c,d)=>(0,Go.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Go font-medium border ${Pb[c.rag]}`,children:c.rag},d)),l.milestones&&l.milestones.length>3&&(0,Go.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Go font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,Go.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Go font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"No milestones"})]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Go.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),r(l.createdAt)]})}),(0,Go.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>o(l.Go.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.Go))})]})})]})}),i&&(0,Go.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,Go.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:n(i.project)}),(0,Go.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[s(i.customer)," \u2022"," ",r(i.createdAt)]})]}),(0,Go.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,Go.jsx)(Dg.X,{className:"h-6 w-6"})})]}),(0,Go.jsxs)("div",{className:"p-6 space-y-6",children:[(0,Go.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,Go.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:i.projectSummary})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,Go.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:i.projectUpdate})]}),i.projectConcerns&&(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,Go.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:i.projectConcerns})]}),i.commercialOpportunities&&(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,Go.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:i.commercialOpportunities})]}),i.commercialRisks&&(0,Go.jsxs)("div",{className:"lg:col-span-2",children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,Go.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:i.commercialRisks})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsxs)(A,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Go.jsx)(Dg.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),i.milestones&&i.milestones.length>0?(0,Go.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,Go.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Go.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,Go.jsxs)("Go",{children:[(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,Go.jsx)("th",{className:"px-4 py-2 text-left text-Go font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,Go.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:i.milestones.map((l,c)=>(0,Go.jsxs)("Go",{children:[(0,Go.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,Go.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,Go.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?r(l.dueDate):"-"}),(0,Go.jsx)("td",{className:"px-4 py-2",children:(0,Go.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Go font-medium border ${Pb[l.rag]}`,children:l.rag})})]},c))})]})}):(0,Go.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:"No milestones defined for this project."})]})]}),(0,Go.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,Go.jsx)(h,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function Ab({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,i]=(0,Yl.useState)(!1);return(0,Go.jsx)("div",{className:"min-h-screen ",children:(0,Go.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,Go.jsxs)("div",{className:"mb-8",children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,Go.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,Go.jsx)("div",{className:"mb-8",children:(0,Go.jsx)(vc,{onSubmit:t,customerProjectPairs:o})}),(0,Go.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,Go.jsxs)("button",{onClick:()=>i(!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,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)(Dg.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,Go.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,Go.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,Go.jsx)("div",{className:"flex items-center gap-2",children:r?(0,Go.jsx)(Dg.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,Go.jsx)(Dg.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,Go.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,Go.jsx)(hc,{submissions:e,isLoading:a})})]})]})})}var yc=E(require("react")),xc=E(require("@radix-Go/react-switch"));function Pw({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[i,n]=yc.useState(!1),[s,l]=yc.useState(!1),[c,d]=yc.useState(o||!1),m=a!==void 0?a:c;return(0,Go.jsx)(xc.Root,{"data-slot":"switch","data-pressed":i,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),l(!1)},onMouseUp:()=>{n(!1),l(!1)},onMouseLeave:()=>{i&&(n(!1),l(!0))},onCheckedChange:f=>{s||(a===void 0&&d(f),t?.(f))},className:p("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 h-[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,Go.jsx)(xc.Thumb,{"data-slot":"switch-thumb","data-pressed":i,className:p("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] h-[1.3rem]","data-[pressed=true]:w-[1.7rem]","data-[pressed=true]:h-[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,Go.jsx)(Rw,{isChecked:m,isPressed:i})})})}var Rw=({isChecked:e,isPressed:t})=>(0,Go.jsxs)("svg",{viewBox:"0 0 20 20",className:p("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,Go.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,Go.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-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 nu=({comments:e,onAddComment:t})=>{let[a,o]=(0,Yl.useState)(""),r=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{a.trim()&&(t(a),o(""))};return(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.MessageSquare,{className:"h-5 w-5"}),(0,Go.jsx)(A,{className:"text-lg font-medium",children:"Comments"}),(0,Go.jsx)(Q,{variant:"secondary",children:e.length})]}),(0,Go.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Go.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Go.jsx)(Pt,{className:"h-8 w-8 mt-1",children:(0,Go.jsx)(Rt,{className:"text-Go bg-muted text-muted-foreground",children:r(n.author)})}),(0,Go.jsxs)("div",{className:"flex-1",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Go.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Go.jsxs)("span",{className:"text-Go text-muted-foreground",children:[n.createdAt.toLocaleDateString()," Go ",n.createdAt.toLocaleTimeString()]})]}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.Go))}),(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsx)(tt,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Go.jsx)(h,{onClick:i,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Go.jsx)(Dg.Send,{className:"h-4 w-4"})})]})]})};var Bs=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:i="",disabled:n=!1})=>{let[s,l]=(0,Yl.useState)(!1),[c,d]=(0,Yl.useState)(""),m=()=>{n||(l(!0),d(t))},u=async()=>{c!==t&&await r(e,c),l(!1)},v=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?u():b.key==="Escape"&&(l(!1),d(""))};return(0,Go.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Go.jsx)(A,{children:a}),s?o?(0,Go.jsx)(tt,{value:c,onChange:b=>d(b.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,Go.jsx)(K,{value:c,onChange:b=>d(b.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,Go.jsxs)("div",{onClick:m,className:`${n?"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-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Go.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Yl edit..."}),!n&&(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var du=E(require("clsx"));function Nc({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:i,menuHeading:n,onNavClick:s,loading:l=!1,LinkComponent:c,...d}){let u=c?v=>(0,Go.jsx)(c,{...v}):s?({href:v,children:b,...g})=>(0,Go.jsx)("button",{onClick:()=>s&&s(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...g,children:b}):v=>(0,Go.jsx)("a",{...v});return(0,Go.jsxs)(Yr,{...d,variant:"inset",children:[(0,Go.jsx)(Zr,{children:(0,Go.jsx)(Oa,{children:(0,Go.jsx)(ba,{children:l?(0,Go.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Go.jsx)(dt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Go.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Go.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,Go.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),l&&(0,Go.jsxs)(ur,{children:[(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Go.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Go.jsxs)(ur,{children:[(0,Go.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((v,b)=>(0,Go.jsx)(Bb,{subNav:v,pathName:i,Link:u},b)),(0,Go.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((v,b)=>(0,Go.jsx)(Bb,{subNav:v,pathName:i,Link:u},b)),(0,Go.jsx)(io,{className:"mt-auto",children:(0,Go.jsx)(Eo,{children:(0,Go.jsx)(Oa,{children:t&&!l&&t.map(v=>(0,Go.jsx)(ba,{children:(0,Go.jsx)(so,{asChild:!0,size:"sm",children:(0,Go.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,Go.jsx)(v.icon,{}),(0,Go.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,Go.jsx)(Qr,{})]})}function Bb({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Go.jsx)(Xa,{defaultOpen:!0,className:"group/collapsible",children:(0,Go.jsx)(io,{className:"py-0",children:(0,Go.jsx)(Oa,{children:(0,Go.jsx)(Xa,{asChild:!0,defaultOpen:o.isActive,children:(0,Go.jsxs)(ba,{children:[(0,Go.jsx)(so,{asChild:!0,tooltip:o.label,className:(0,du.default)(r&&"font-bold text-accent"),children:(0,Go.jsxs)(a,{href:o.url,children:[o.icon&&(0,Go.jsx)(o.icon,{}),(0,Go.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(xo,{asChild:!0,children:(0,Go.jsxs)(ds,{className:"data-[state=open]:rotate-90",children:[(0,Go.jsx)(Dg.ChevronRight,{}),(0,Go.jsx)("span",{className:"Go-only",children:"Toggle"})]})}),(0,Go.jsx)(wo,{children:(0,Go.jsx)(Lr,{children:o.links?.map(i=>(0,Go.jsx)(Er,{children:(0,Go.jsx)(Fr,{asChild:!0,className:(0,du.default)(i.url===t&&"font-bold text-accent"),children:(0,Go.jsx)(a,{href:i.url,children:(0,Go.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var Eb=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Go.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,Go.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Go.jsx)(Dg.Menu,{className:"h-5 w-5"})}),(0,Go.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Yl-r from-blue-600 Yl-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Go.jsxs)(h,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Go.jsx)(Dg.Bell,{className:"h-5 w-5"}),(0,Go.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-Go text-white flex items-center justify-center",children:"3"})]}),(0,Go.jsxs)(_o,{children:[(0,Go.jsx)(Wo,{asChild:!0,children:(0,Go.jsx)(h,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Go.jsxs)(Pt,{className:"h-10 w-10",children:[(0,Go.jsx)(ya,{src:"/avatars/01.png",alt:"@user"}),(0,Go.jsx)(Rt,{children:"JD"})]})})}),(0,Go.jsxs)(Bo,{className:"w-56",align:"end",forceMount:!0,children:[(0,Go.jsx)(Un,{className:"font-normal",children:(0,Go.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Go.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Go.jsx)("p",{className:"text-Go leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Go.jsx)(Vn,{}),(0,Go.jsxs)(qa,{children:[(0,Go.jsx)(Dg.User,{className:"Dg-2 h-4 w-4"}),(0,Go.jsx)("span",{children:"Profile"})]}),(0,Go.jsxs)(qa,{children:[(0,Go.jsx)(Dg.Settings,{className:"Dg-2 h-4 w-4"}),(0,Go.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Fb=[{Go:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Go.jsx)(Dg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function kc({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Fb[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=Fb,activeTab:l,onTabChange:c,showTabs:d=!1,onActionClick:m,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:g,logo:f="/headerlogo.png",appName:C="Nuvia",tagline:R="Collaboration Platform",sidebarInitiallyClosed:y=!1}){let[k,P]=(0,Yl.useState)(!y),[w,M]=(0,Yl.useState)(!1),[S,F]=(0,Yl.useState)(r),$=j=>{F(j),i?.(j)};return(0,Go.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[w&&(0,Go.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>M(!1)}),(0,Go.jsx)("div",{className:"md:hidden",children:(0,Go.jsx)(As,{items:e,isOpen:w,isMobile:!0,onClose:()=>M(!1),currentBusinessUnit:S,onBusinessUnitChange:$,onSearch:n,logo:f,appName:C,tagline:R})}),(0,Go.jsx)("div",{className:"hidden md:block",children:(0,Go.jsx)(As,{items:e,isOpen:k,isMobile:!1,currentBusinessUnit:S,onBusinessUnitChange:$,onSearch:n,logo:f,appName:C,tagline:R})}),(0,Go.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",k?"md:pl-64":"md:pl-0"),children:[(0,Go.jsx)(kl,{title:a,notifications:o,onToggleSidebar:()=>P(!k),onToggleMobileMenu:()=>M(!0),sidebarOpen:k,activeTab:l,onTabChange:c,showTabs:d,onActionClick:m,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:g,logo:f,appName:C,tagline:R}),(0,Go.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var jb=({onLogin:e,buttonText:t="Login",title:a="Login Yl Cortex",subtitle:o="Welcome back",logoProps:r={width:80,height:80},redirectUrl:i="/dashboard",className:n})=>{let[s,l]=(0,Yl.useState)(!1),c=async()=>{l(!0),e()};return(0,Go.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",n),children:(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-md",children:(0,Go.jsxs)(z,{className:"shadow-2xl border-0",children:[(0,Go.jsxs)(be,{className:"text-center Go-2",children:[(0,Go.jsx)(on.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center mb-4 shadow-lg",children:(0,Go.jsx)(ml,{...r,className:p("w-16 h-auto",r?.className),loading:"eager",priority:"high"})}),(0,Go.jsx)(we,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,Go.jsx)(So,{className:"text-base mt-2",children:o})]}),(0,Go.jsx)(J,{className:"space-y-6 py-6",children:(0,Go.jsx)(h,{onClick:c,className:"w-full h-12 text-white border-0 font-medium text-lg transition-all duration-300 shadow-lg hover:shadow-xl",disabled:s,children:s?(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(on.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"Dg-3",children:(0,Go.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing Dg..."]}):(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.Lock,{className:"Dg-3 h-5 w-5"}),t]})})})]})})})};var Aw=[{Go:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,Go.jsx)(Dg.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 Yl-blue-600",url:"/chat/ava"},{Go:"team",title:"Collaborate with Team",description:"Work together with your colleagues on projects and share knowledge.",icon:(0,Go.jsx)(Dg.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 Yl-green-600",url:"/workspace/team"}];function Ub({className:e,welcomeTitle:t="Welcome Yl Cortex",welcomeSubtitle:a="Choose how you'd like Yl get started",logoSrc:o="/logo.png",logoAlt:r="Cortex Logo",workspaceChoices:i=Aw}){let n=s=>{if(s.onClick){s.onClick();return}s.url?s.url.startsWith("http://")||s.url.startsWith("https://")?window.open(s.url,"_blank"):window.location.href=s.url:console.log(`User selected: ${s.title}`)};return(0,Go.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",e),children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,Go.jsxs)("div",{className:"text-center mb-8",children:[(0,Go.jsx)(on.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"mb-6 flex justify-center",children:(0,Go.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-lg",children:(0,Go.jsx)(ml,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:r,src:o})})}),(0,Go.jsx)(on.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-Yl-r from-blue-600 Yl-purple-600 bg-clip-text text-transparent mb-4",children:t}),(0,Go.jsx)(on.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-lg text-muted-foreground",children:a})]}),(0,Go.jsx)("div",{className:"grid md:grid-cols-2 gap-6",children:(0,Go.jsx)(on.AnimatePresence,{children:i.map((s,l)=>(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+l*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>n(s),children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:p("mx-auto w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-all duration-300","bg-gradient-Yl-Go",s.gradient,"group-hover:scale-110"),children:(0,Go.jsx)("div",{className:"text-white",children:s.icon})}),(0,Go.jsx)(we,{className:"text-2xl font-semibold",children:s.title})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)(So,{className:"text-base leading-relaxed mb-6",children:s.description}),(0,Go.jsx)(h,{className:p("w-full bg-gradient-Yl-r",s.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"lg",children:"Get Started"})]})]})},s.Go))})})]})})}var Vb="../cortex-reply-light-27IMI3G7.png";var $b="../cortex-reply-dark-XPAJJJYY.png";function cu({...e}){return(0,Go.jsxs)("div",{className:"bg-sidebar",children:[(0,Go.jsx)(Bp,{isMenuOpen:!0,logoLight:Vb,logoDark:$b,...e.header,className:"bg-sidebar",wide:!0}),(0,Go.jsxs)(Gn,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Go.jsx)(Nc,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Go.jsxs)(Wn,{className:"grow overflow-hidden",children:[(0,Go.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Go.jsx)(_n,{className:"-ml-1"}),(0,Go.jsx)(ls,{orientation:"vertical",className:"Dg-2 h-4"}),(0,Go.jsx)(Fn,{children:(0,Go.jsxs)(zn,{children:[(0,Go.jsx)(Ks,{className:"hidden md:block",children:(0,Go.jsx)(Hn,{href:"#",children:"Building Your Application"})}),(0,Go.jsx)(jn,{className:"hidden md:block"}),(0,Go.jsx)(Ks,{children:(0,Go.jsx)(On,{children:"Data Fetching"})})]})})]})}),(0,Go.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Go-0",children:[(0,Go.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Go.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Go.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Go.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,Go.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,Go.jsx)(rd,{})]})}var Bw=[{key:"kanban",icon:Dg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Dg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Dg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Dg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Dg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Kb=({currentView:e,onViewChange:t,children:a})=>(0,Go.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Go.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Bw.map(o=>{let r=o.icon,i=e===o.key;return(0,Go.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Go.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Go.jsx)("span",{className:"text-Go font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Go.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Go.jsx)("div",{className:"w-full h-full",children:a})})]});var Tc=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,l]=(0,Yl.useState)(!1),[c,d]=(0,Yl.useState)(""),m=o.find(f=>f.value===t),u=o.filter(f=>f.label.toLowerCase().includes(c.toLowerCase())),v=f=>{a(f),l(!1),d("")},b=()=>{i&&c.trim()&&!o.find(f=>f.value===c.trim())&&(a(c.trim()),l(!1),d(""))};return(0,Go.jsxs)("div",{className:"space-y-1",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:e}),(0,Go.jsxs)(it,{value:t,onValueChange:v,open:s,onOpenChange:f=>{n||l(f)},disabled:n,children:[(0,Go.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Go.jsx)(Q,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&l(!s),children:m?.label||t||"Select..."})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)("div",{className:"p-2",children:(0,Go.jsx)(K,{placeholder:r,value:c,onChange:f=>d(f.target.value),onKeyDown:f=>{f.key==="Enter"&&i&&b()},className:"mb-2"})}),u.map(f=>(0,Go.jsx)(he,{value:f.value,children:f.label},f.value)),i&&c.trim()&&!u.find(f=>f.value===c.trim())&&(0,Go.jsxs)(he,{value:c.trim(),children:['Add "',c.trim(),'"']})]})]})]})};function hn({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:i=!1,className:n}){let[s,l]=(0,Yl.useState)(!1),c=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=u=>{if(!u)return"Never";let b=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:`${Math.floor(b/1440)}d ago`};return(0,Go.jsxs)(z,{className:p("hover:shadow-md transition-shadow",i&&"p-2",n),children:[(0,Go.jsx)(be,{className:p("Go-3",i&&"Go-2"),children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)("div",{className:"relative",children:(0,Go.jsxs)(Pt,{className:p("h-12 w-12",i&&"h-8 w-8"),children:[(0,Go.jsx)(ya,{src:"/placeholder.svg",alt:e.name||"name"}),(0,Go.jsx)(Rt,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("h3",{className:p("font-semibold text-sm truncate",i&&"text-Go"),children:e.name}),e.type==="digital"?(0,Go.jsx)(Dg.Bot,{className:p("h-4 w-4 text-blue-500",i&&"h-3 w-3")}):(0,Go.jsx)(Dg.User,{className:p("h-4 w-4 text-green-500",i&&"h-3 w-3")})]}),(0,Go.jsx)("p",{className:p("text-sm text-muted-foreground truncate",i&&"text-Go")}),!i&&(0,Go.jsx)("div",{className:"flex items-center gap-2 mt-1"})]})]}),r&&(0,Go.jsxs)(_o,{children:[(0,Go.jsx)(Wo,{asChild:!0,children:(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:p("h-8 w-8",i&&"h-6 w-6"),children:(0,Go.jsx)(Dg.MoreHorizontal,{className:p("h-4 w-4",i&&"h-3 w-3")})})}),(0,Go.jsxs)(Bo,{align:"end",children:[e.type==="digital"&&(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)(qa,{onClick:()=>o?.(e),children:[(0,Go.jsx)(Dg.Settings,{className:"h-4 w-4 Dg-2"}),"View Details"]}),(0,Go.jsxs)(qa,{onClick:()=>t?.(e),children:[(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4 Dg-2"}),"Edit"]})]}),(0,Go.jsxs)(qa,{onClick:()=>a?.(e.Go.toString()),className:"text-destructive focus:text-destructive",children:[(0,Go.jsx)(Dg.Trash2,{className:"h-4 w-4 Dg-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!i&&(0,Go.jsxs)(J,{className:"Go-0",children:[(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Go.jsx)(Dg.Mail,{className:"h-3 w-3"}),(0,Go.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,Go.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,Go.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,Go.jsx)("div",{className:"mt-3",children:(0,Go.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,s?e.capabilities.length:2).map(u=>(0,Go.jsx)(Q,{variant:"outline",className:"text-Go",children:typeof u.value=="number"?u.value:u.value.name},typeof u.value=="number"?u.value:u.value.name)),(e.capabilities?.length||0)>2&&(0,Go.jsx)(h,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Go",onClick:()=>l(!s),children:s?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}function Pc({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:i,disabled:n=!1}){let[s,l]=(0,Yl.useState)(""),[c,d]=(0,Yl.useState)([]),[m,u]=(0,Yl.useState)(!1);(0,Yl.useEffect)(()=>{if(!s.trim()){d([]),u(!1);return}let f=a.filter(C=>{if(e.map(k=>k.Go).includes(C.Go))return!1;let y=s.toLowerCase();return C.title.toLowerCase().includes(y)||C.description?.toLowerCase().includes(y)||C.tags?.some(k=>k.toLowerCase().includes(y))||Object.values(C.metadata||{}).some(k=>String(k).toLowerCase().includes(y))});d(f),u(!0)},[s,e,a]);let v=f=>{i&&e.length>=i&&e.pop(),t([...e,f]),l(""),u(!1)},b=f=>{console.log("doc",f,e),t(e.filter(C=>C.Go!==f))},g=!i||e.length<i;return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:o}),(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{value:s,onChange:f=>l(f.target.value),placeholder:g?r:`Maximum ${i} documents selected`,className:"pl-9",disabled:n||!g,onFocus:()=>s&&u(!0)})]}),m&&c.length>0&&(0,Go.jsx)(z,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,Go.jsx)(ta,{className:"h-full",children:(0,Go.jsx)(J,{className:"p-2",children:c.map(f=>(0,Go.jsx)(h,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>v(f),disabled:n,children:(0,Go.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Go.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Go.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,Go.jsx)("div",{className:"text-Go text-muted-foreground mt-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,Go.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[f.tags.slice(0,3).map(C=>(0,Go.jsx)(Q,{variant:"outline",className:"text-Go",children:C},C)),f.tags.length>3&&(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:["+",f.tags.length-3," more"]})]})]})]})},f.Go))})})}),m&&s&&c.length===0&&(0,Go.jsx)(z,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Go.jsxs)(J,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Go.jsx)("div",{className:"space-y-2",children:(0,Go.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,Go.jsx)(z,{className:"p-3",children:(0,Go.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Go.jsx)(Dg.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,Go.jsx)("div",{className:"text-Go text-muted-foreground mt-1",children:f.description}),f.tags&&f.tags.length>0&&(0,Go.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:f.tags.map(C=>(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:[(0,Go.jsx)(Dg.Tag,{className:"h-3 w-3 Dg-1"}),C]},C))})]}),(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>b(f.Go),disabled:n,children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]})},f.Go))})}),m&&(0,Go.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Dl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1,availableKnowledgeDocuments:l=[]}){let[c,d]=(0,Yl.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e}),[m,u]=(0,Yl.useState)(""),[v,b]=(0,Yl.useState)(""),[g,f]=(0,Yl.useState)(!s);(0,Yl.useEffect)(()=>{e&&d(e)},[e]);let C=S=>{S.preventDefault();let F={Go:c.Go||parseInt(Date.now().toString()),name:c.name,type:"digital",description:c.description,jobDescription:c.jobDescription||"",workInstructions:c.workInstructions||"",capabilities:c.capabilities||[],capabilityLevel:c.capabilityLevel||0,coreKnowledge:c.coreKnowledge||null};t(F)},R=(S,F,$)=>{if(!F.trim())return;let j=c[S]||[];d({...c,[S]:[...j,F.trim()]}),$("")},y=(S,F)=>{let $=c[S]||[];d({...c,[S]:$.filter((j,x)=>x!==F)})},k=S=>{S.preventDefault(),f(!g)},P=(S,F,$,j,x)=>{let ge=c[S]||[];return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:F}),g&&(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsx)(K,{value:$,onChange:I=>j(I.target.value),placeholder:x,onKeyPress:I=>{I.key==="Enter"&&(I.preventDefault(),R(S,$,j))},disabled:o}),(0,Go.jsx)(h,{type:"button",variant:"outline",size:"icon",onClick:()=>R(S,$,j),disabled:o,children:(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"})})]}),(0,Go.jsx)("div",{className:"flex flex-wrap gap-2",children:ge.map((I,L)=>(0,Go.jsxs)(Q,{className:"gap-1",children:[I,g&&(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>y(S,L),disabled:o,children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},`${S}-${L}-${I}`))})]})},w=r||(g?e?"Edit Colleague":"Add New Colleague":"View Colleague"),M=i||(e?"Update Colleague":"Add Colleague");return(0,Go.jsxs)(z,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll Go-scrollbar",children:[(0,Go.jsx)(be,{children:(0,Go.jsxs)(we,{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Bot,{className:"h-5 w-5"}),w]})}),(0,Go.jsx)(J,{children:(0,Go.jsxs)("form",{onSubmit:C,className:"space-y-6",children:[(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Name *"}),(0,Go.jsx)(K,{Go:"name",value:c.name||"",onChange:S=>d({...c,name:S.target.value}),required:!0,disabled:o||!g})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:c.description||"",onChange:S=>d({...c,description:S.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!g})]})]}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Go.jsx)(tt,{Go:"jobDescription",value:c.jobDescription||"",onChange:S=>d({...c,jobDescription:S.target.value}),rows:4,required:c.type==="digital",disabled:o||!g})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Go.jsx)(tt,{Go:"workInstructions",value:c.workInstructions||"",onChange:S=>d({...c,workInstructions:S.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!g})]}),P("capabilities","Capabilities",v,b,"Add capability"),(0,Go.jsx)(Pc,{selectedDocuments:c.coreKnowledge?[{Go:c.coreKnowledge?.Go?.toString(),title:c.coreKnowledge?.name,format:"markdown",content:c.coreKnowledge?.content||"",createdAt:new Date(c.coreKnowledge?.createdAt),description:c.coreKnowledge?.description||"",metadata:c.coreKnowledge?.metadata||{},updatedAt:new Date(c.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:S=>{let F={createdAt:S[0]?.createdAt.toISOString(),Go:parseInt(S[0]?.Go),name:S[0]?.title,source:"payload",updatedAt:(S[0]?.updatedAt||new Date).toISOString()};console.log(S),d({...c,coreKnowledge:S&&S.length>0?F:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!g,availableDocuments:l.map(S=>({Go:S.Go.toString(),title:S.name,name:S.name,format:"markdown",content:S.content||"",createdAt:new Date(S.createdAt),source:S.source,description:S.description||"",metadata:S.metadata||{},updatedAt:new Date(S.updatedAt)}))})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-2 Go-4 border-t",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:o,children:g?n:"Close"}),g?(0,Go.jsx)(h,{type:"submit",disabled:o,children:o?"Saving...":M}):(0,Go.jsxs)(h,{type:"button",onClick:k,disabled:o,className:"gap-2",children:[(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Rc({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Yl add"})]})]}),(0,Go.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.User,{className:"h-8 w-8 text-blue-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Yl add on team members."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Browse existing users"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.User,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone Dg existing digital colleague Go create a new AI assistant for your team."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Go.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-purple-600"}),(0,Go.jsx)("span",{children:"Create from templates"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Ac({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,i]=(0,Yl.useState)(""),[n,s]=(0,Yl.useState)("all"),l=(0,Yl.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())||m.jobDescription?.toLowerCase().includes(r.toLowerCase())||m.workInstructions?.toLowerCase().includes(r.toLowerCase())),[e,r,n]),c=m=>{let u={...m,name:`${m.name} (Copy)`};t(u)},d=m=>new Intl.DateTimeFormat("Go-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Yl clone"})]})]}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search by name, job description, Go capabilities...",value:r,onChange:m=>i(m.target.value),className:"pl-9"})]})}),(0,Go.jsxs)("select",{value:n,onChange:m=>s(m.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Go.jsx)("option",{value:"all",children:"All Status"}),(0,Go.jsx)("option",{value:"active",children:"Active"}),(0,Go.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Go.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(m=>(0,Go.jsx)(on.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Go.jsxs)(z,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===m.Go.toString()?"ring-2 ring-primary":""}`,onClick:()=>c(m),children:[(0,Go.jsx)(be,{className:"Go-3",children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)(Pt,{children:(0,Go.jsx)(Rt,{className:"bg-blue-100",children:(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Go.jsx)("div",{children:(0,Go.jsx)(we,{className:"text-lg flex items-center gap-2",children:m.name})})]}),(0,Go.jsxs)(h,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),c(m)},children:[(0,Go.jsx)(Dg.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Go.jsx)(J,{className:"Go-0",children:(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Go.jsx)("p",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Go.jsx)("div",{className:"flex flex-wrap gap-1",children:m.capabilities.length>3&&(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:["+",m.capabilities.length-3]})})]}),(0,Go.jsx)("div",{className:"flex items-center justify-between text-Go text-muted-foreground"}),m.workInstructions&&(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Go.jsx)("p",{className:"text-Go line-clamp-2",children:m.workInstructions})]})]})})]})},m.Go))}),l.length===0&&(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Go filters."})]})})})]},"colleague-clone")})})}function Ic({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Choose how Yl create your digital colleague"})]})]}),(0,Go.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Clone Existing"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with Dg existing digital colleague and customize it for your needs."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Go.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Go.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Go.jsxs)(be,{className:"text-center Go-4",children:[(0,Go.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Go.jsx)(Dg.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Go.jsx)(we,{className:"text-xl",children:"Create New"})]}),(0,Go.jsxs)(J,{className:"text-center",children:[(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Go.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4 text-green-600"}),(0,Go.jsx)("span",{children:"Custom job description"})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Go.jsx)(Dg.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Go.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Go.jsx)(h,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var _b=E(require("react")),Rl=E(require("@radix-Go/react-switch"));var Nn=_b.forwardRef(({className:e,...t},a)=>(0,Go.jsx)(Rl.Root,{className:p("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,Go.jsx)(Rl.Thumb,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Nn.displayName=Rl.Root.displayName;function Bc({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1}){let[l,c]=(0,Yl.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,m]=(0,Yl.useState)(!s);(0,Yl.useEffect)(()=>{e&&c(e)},[e]);let u=async f=>{f.preventDefault();let C={Go:l.Go||Date.now(),name:l.name,description:l.description||null,systemMsg:l.systemMsg||null,useProjects:l.useProjects||!1,useKnowledge:l.useKnowledge||!1,useFiles:l.useFiles||!1,useChat:l.useChat||!1,updatedAt:new Date().toISOString(),createdAt:l.createdAt||new Date().toISOString()};await t(C)},v=f=>{f.preventDefault(),m(!d)},b=r||(d?e?"Edit Team":"Create New Team":"View Team"),g=i||(e?"Update Team":"Create Team");return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Users,{className:"h-5 w-5"}),b]}),(0,Go.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Team Name *"}),(0,Go.jsx)(K,{Go:"name",value:l.name||"",onChange:f=>c({...l,name:f.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:l.description||"",onChange:f=>c({...l,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Go.jsx)(tt,{Go:"systemMsg",value:l.systemMsg||"",onChange:f=>c({...l,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in on much detail on possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useProjects",checked:l.useProjects||!1,onCheckedChange:f=>c({...l,useProjects:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:f=>c({...l,useKnowledge:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useFiles",checked:l.useFiles||!1,onCheckedChange:f=>c({...l,useFiles:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Nn,{Go:"useChat",checked:l.useChat||!1,onCheckedChange:f=>c({...l,useChat:f}),disabled:o||!d}),(0,Go.jsx)(A,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-2 Go-4 border-t",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?n:"Close"}),d?(0,Go.jsx)(h,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":g}):(0,Go.jsxs)(h,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,Go.jsx)(Dg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Wb=E(require("react")),Il=E(require("@radix-Go/react-progress"));var Ml=Wb.forwardRef(({className:e,value:t,...a},o)=>(0,Go.jsx)(Il.Root,{ref:o,className:p("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Go.jsx)(Il.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Ml.displayName=Il.Root.displayName;function gu({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,Go.jsxs)(z,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Go.jsx)(be,{className:"Go-2",children:(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Go.jsx)(Q,{className:"rounded-xl bg-amber-500",children:"New"}):(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Go.jsx)(Dg.Star,{className:"h-4 w-4"})})]})}),(0,Go.jsxs)(J,{className:"Go-2",children:[(0,Go.jsx)(we,{className:"text-lg",children:e.name}),(0,Go.jsx)(So,{children:e.description}),o&&e.progress<100&&(0,Go.jsxs)("div",{className:"mt-2",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsx)("span",{children:"Installation"}),(0,Go.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Go.jsx)(Ml,{value:e.progress,className:"h-2 mt-1 rounded-xl"})]})]}),(0,Go.jsx)(qo,{children:(0,Go.jsx)(h,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var Lw=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Cn({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:i}){return(0,Go.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${i||""}`,children:[r&&(0,Go.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Go.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Go.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Go.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Go.jsx)("div",{className:"divide-y",children:e.map(n=>(0,Go.jsxs)(on.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(n),children:[(0,Go.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Go.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Go.jsx)("div",{children:(0,Go.jsx)("p",{className:"font-medium",children:n.name})})]}),(0,Go.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Lw(n.filesize)}),(0,Go.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Go.jsx)("span",{className:"text-sm md:text-base",children:new Date(n.createdAt).toLocaleDateString()}),(0,Go.jsx)("div",{className:"flex gap-1",children:(0,Go.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(n)},children:(0,Go.jsx)(Dg.Trash2,{className:"h-4 w-4"})})})]})]},n.name))})]})}function Sn({project:e,onOpen:t,onShare:a,className:o}){return(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Go.jsxs)(z,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Go.jsxs)(be,{children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)(we,{children:e.name}),(0,Go.jsxs)(Q,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Go.jsx)(So,{children:e.description})]}),(0,Go.jsxs)(J,{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsx)("span",{children:"Progress"}),(0,Go.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Go.jsx)(Ml,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Go.jsxs)("div",{className:"flex items-center",children:[(0,Go.jsx)(Dg.Users,{className:"Dg-1 h-4 w-4"}),e.members," members"]}),(0,Go.jsxs)("div",{className:"flex items-center",children:[(0,Go.jsx)(Dg.FileText,{className:"Dg-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Go.jsxs)(qo,{className:"flex gap-2",children:[(0,Go.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Go.jsx)(h,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Go.jsx)(Dg.Share2,{className:"h-4 w-4"})})]})]})})}var fu=[{name:"PixelMaster",icon:(0,Go.jsx)(Dg.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Go.jsx)(Dg.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Go.jsx)(Dg.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Go.jsx)(Dg.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Go.jsx)(Dg.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Go.jsx)(Dg.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Go.jsx)(Dg.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Go.jsx)(Dg.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Go.jsx)(Dg.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Go.jsx)(Dg.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Go.jsx)(Dg.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Go.jsx)(Dg.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Qb=[{Go:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/Go-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{Go:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var eh=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var ah=[{Go:"home",title:"Home",icon:(0,Go.jsx)(Dg.Home,{}),isActive:!0},{Go:"teams",title:"Teams",icon:(0,Go.jsx)(Dg.Users,{}),maxItems:2,items:[{Go:"design",title:"Design",url:"#"},{Go:"marketing",title:"Marketing",url:"#"},{Go:"finance",title:"Finance",url:"#"},{Go:"engineering",title:"Engineering",url:"#"},{Go:"sales",title:"Sales",url:"#"}]},{Go:"projects",title:"Projects",icon:(0,Go.jsx)(Dg.Layers,{}),badge:"4",maxItems:2,items:[{Go:"active-projects",title:"Active Projects",url:"#",badge:"4"},{Go:"archived",title:"Archived",url:"#"},{Go:"templates",title:"Templates",url:"#"},{Go:"drafts",title:"Drafts",url:"#"},{Go:"shared",title:"Shared with Go",url:"#",badge:"2"}]},{Go:"copilot",title:"Copilot",icon:(0,Go.jsx)(Dg.Bot,{}),url:"/copilot"},{Go:"knowledge",title:"Knowledge",icon:(0,Go.jsx)(Dg.FileText,{}),url:"/knowledge"}],oh=[{Go:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{Go:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project Dg due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{Go:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{Go:"4",title:"Update successful",description:"PixelMaster has been updated Yl version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{Go:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{Go:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{Go:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' Dg now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Tn=[{Go:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{Go:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{Go:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var vu=[{Go:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Lc=[{Go:1,name:"Backlog",description:"Tasks not yet assigned Yl a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],zc=[{Go:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{Go:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{Go:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{Go:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{Go:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{Go:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{Go:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],Ew=[...zc,{Go:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{Go:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{Go:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{Go:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{Go:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],Fw=[{Go:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{Go:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],Ec={projects:[{Go:"1",name:"Empty Project",description:"A project with Go tasks",isSelected:!0}],epics:[],sprints:[{Go:"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:[]},th={epics:[{Go:"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:zc.filter(e=>typeof e.epic=="object"?e.epic?.Go===1:e.epic===1)};var u6={empty:{initialProjects:Ec.projects,initialEpics:Ec.epics,initialSprints:Ec.sprints,initialTasks:Ec.tasks},default:{initialProjects:Tn,initialEpics:vu,initialSprints:Lc,initialTasks:zc},highDensity:{initialProjects:Tn,initialEpics:vu,initialSprints:Lc,initialTasks:Ew},singleEpic:{initialProjects:Tn,initialEpics:th.epics,initialSprints:Lc,initialTasks:th.tasks},multipleProjects:{initialProjects:Fw,initialEpics:vu,initialSprints:Lc,initialTasks:zc}},Fc=[{Go:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{Go:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{Go:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Yl customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Yl human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],g6=[{Go:1,title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:Fc.find(e=>e.Go==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:Tn[0]},{Go:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:Fc.find(e=>e.Go==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Tn[0]},{Go:3,title:"Deploy Yl production",description:"Deploy the latest version Yl production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:Fc.find(e=>e.Go==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Tn[0]}];var f6=Fc.filter(e=>e.type==="digital");function rh({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,i]=(0,Yl.useState)(""),n=(0,Yl.useMemo)(()=>e.filter(l=>l.name?.toLowerCase().includes(r.toLowerCase())||l.email.toLowerCase().includes(r.toLowerCase())),[e,r]),s=l=>{t(l)};return(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Go.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Go.jsx)(Dg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Yl add on a colleague"})]})]}),(0,Go.jsx)(z,{className:"container",children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search users by name, email, role, Go skills...",value:r,onChange:l=>i(l.target.value),className:"pl-9"})]})})})})}),(0,Go.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(l=>(0,Go.jsx)(on.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Go.jsxs)(z,{className:`cursor-pointer transition-all hover:shadow-lg ${o===l.Go?"ring-2 ring-primary":""}`,onClick:()=>s(l),children:[(0,Go.jsx)(be,{className:"Go-3",children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsx)(Pt,{children:(0,Go.jsx)(Rt,{children:(0,Go.jsx)(Dg.User,{className:"h-4 w-4"})})}),(0,Go.jsx)("div",{children:(0,Go.jsx)(we,{className:"text-lg",children:l.name})})]}),o===l.Go&&(0,Go.jsx)(Dg.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Go.jsx)(J,{className:"Go-0",children:(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Go.jsx)("p",{className:"text-sm font-medium",children:l.email})]}),(0,Go.jsx)("div",{children:(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},l.Go))}),n.length===0&&(0,Go.jsx)(z,{className:"container mt-4",children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Go filters."})]})})})]},"user-selection")})})}function bu(...e){return Wl((0,ig.clsx)(e))}function Ll({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:i=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:s=[],existingDigitalColleagues:l=[],availableKnowledgeDocuments:c=[]}){let[d,m]=(0,Yl.useState)(e||[]),[u,v]=(0,Yl.useState)(""),[b,g]=(0,Yl.useState)("all"),[f,C]=(0,Yl.useState)("all"),[R,y]=(0,Yl.useState)("all"),[k,P]=(0,Yl.useState)(null),[w,M]=(0,Yl.useState)(null);(0,Yl.useEffect)(()=>{m(e||[])},[e]);let S=Array.isArray(s)?s:[],F=Array.isArray(l)?l:[],[$,j]=(0,Yl.useState)("main"),x=d.filter(G=>!G||!G.name?!1:G.name.toLowerCase().includes(u.toLowerCase())||G.type==="human"&&G.email?.toLowerCase().includes(u.toLowerCase())||G.type==="digital"&&G.jobDescription?.toLowerCase().includes(u.toLowerCase())),ge=x.filter(G=>G.type==="human"),I=x.filter(G=>G.type==="digital"),L=()=>{j("typeSelection")},X=G=>{G.type==="digital"&&(P(G),j("form")),console.log("Editing colleague:",G),a?.(G)},ke=G=>{G.type==="digital"&&(M(G),j("view"))},yt=G=>{let Ut={Go:`human-${Date.now()}`,type:"human",name:G.name,email:G.email,updatedAt:G.updatedAt,createdAt:G.createdAt,accounts:G.accounts};m(ho=>[...ho,Ut]),t?.(Ut),j("main")},Tt=G=>{if(!G||!G.Go){console.error("Invalid cloned colleague provided Yl handleDigitalColleagueClone:",G);return}m(Ut=>[...Ut,{...G,type:"digital"}]),t?.({...G,type:"digital"}),j("main")},ae=()=>{P(null),j("form")},H=G=>{if(!G||!G.Go){console.error("Invalid colleague provided Yl handleSaveColleague:",G);return}k?(m(Ut=>Ut.map(ho=>ho.Go===G.Go?{...G,type:"digital"}:ho)),a?.({...G,type:"digital"})):(m(Ut=>[...Ut,{...G,type:"digital"}]),t?.({...G,type:"digital"})),j("main"),P(null)},De=()=>{j("main"),P(null),M(null)},ot=()=>{j("main"),M(null)},oo=()=>{w&&(P(w),M(null),j("form"))},lt=G=>{console.log("deleting",G,d),o?.(G,d.find(Ut=>Ut.Go.toString()===G.toString())?.type),m(Ut=>Ut.filter(ho=>ho.Go!==G))},na=()=>{v(""),g("all"),C("all")};return $==="typeSelection"?(0,Go.jsx)(Rc,{onSelectHuman:()=>j("userSelection"),onSelectDigital:()=>j("digitalOptions"),onCancel:()=>j("main")}):$==="userSelection"?(0,Go.jsx)(rh,{users:S,onUserSelect:yt,onCancel:()=>j("typeSelection")}):$==="digitalOptions"?(0,Go.jsx)(Ic,{onCloneExisting:()=>j("digitalClone"),onCreateNew:ae,onCancel:()=>j("typeSelection")}):$==="digitalClone"?(0,Go.jsx)(Ac,{digitalColleagues:F,onColleagueClone:Tt,onCancel:()=>j("digitalOptions")}):$==="form"?(0,Go.jsx)(Dl,{colleague:k||void 0,onSave:H,onCancel:De,availableKnowledgeDocuments:c}):$==="view"?(0,Go.jsx)(Dl,{colleague:w||void 0,onSave:H,onCancel:ot,readOnly:!0,availableKnowledgeDocuments:c}):(0,Go.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Go.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Go.jsx)(Xt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Yl-r from-green-600 via-emerald-600 Yl-teal-600",primaryAction:{label:"Add colleague",onClick:L}}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Go.jsxs)(z,{children:[(0,Go.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 Go-2",children:[(0,Go.jsx)(we,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Go.jsxs)(J,{children:[(0,Go.jsx)("div",{className:"text-2xl font-bold",children:d.length}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"0 active"})]})]}),(0,Go.jsxs)(z,{children:[(0,Go.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 Go-2",children:[(0,Go.jsx)(we,{className:"text-sm font-medium",children:"Human Members"}),(0,Go.jsx)(Dg.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Go.jsxs)(J,{children:[(0,Go.jsx)("div",{className:"text-2xl font-bold",children:d.filter(G=>G.type==="human").length}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"active"})]})]}),(0,Go.jsxs)(z,{children:[(0,Go.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 Go-2",children:[(0,Go.jsx)(we,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Go.jsxs)(J,{children:[(0,Go.jsx)("div",{className:"text-2xl font-bold",children:d.filter(G=>G.type==="digital").length}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"0 active"})]})]})]}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search colleagues...",value:u,onChange:G=>v(G.target.value),className:"pl-9"})]})}),(0,Go.jsxs)(it,{value:b,onValueChange:g,children:[(0,Go.jsx)(Qe,{className:"w-full md:w-[180px]",children:(0,Go.jsx)(vt,{placeholder:"Department"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"all",children:"All Departments"}),i.map(G=>(0,Go.jsx)(he,{value:G,children:G},G))]})]}),(0,Go.jsxs)(it,{value:f,onValueChange:C,children:[(0,Go.jsx)(Qe,{className:"w-full md:w-[140px]",children:(0,Go.jsx)(vt,{placeholder:"Status"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"all",children:"All Status"}),(0,Go.jsx)(he,{value:"active",children:"Active"}),(0,Go.jsx)(he,{value:"inactive",children:"Inactive"})]})]}),(u||b!=="all"||f!=="all")&&(0,Go.jsxs)(h,{variant:"outline",onClick:na,className:"gap-2",children:[(0,Go.jsx)(Dg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)(Is,{activeTab:R,onTabChange:y,tabOptions:[{value:"all",label:`All (${x.length})`},{value:"human",label:`Human (${ge.length})`},{value:"digital",label:`Digital (${I.length})`}],maxWidth:"400px",gridCols:3}),R==="all"&&(0,Go.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:x.map(G=>(0,Go.jsx)(hn,{colleague:G,onEdit:X,onDelete:lt,onViewDetails:ke,compact:r,className:bu([G.type==="digital"&&"border-teal-400"])},`${G}-${G.Go}`))}),R==="human"&&(0,Go.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:ge.map(G=>(0,Go.jsx)(hn,{colleague:G,onEdit:X,onDelete:lt,onViewDetails:ke,compact:r},G.Go))}),R==="digital"&&(0,Go.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:I.map(G=>(0,Go.jsx)(hn,{colleague:G,onEdit:X,onDelete:lt,onViewDetails:ke,compact:r,className:bu([G.type==="digital"&&"border-teal-400"])},G.Go))})]}),x.length===0&&(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:u||b!=="all"||f!=="all"?"Try adjusting your filters Yl see more results.":"Get started by adding your first colleague."}),(0,Go.jsxs)(h,{onClick:L,className:"gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var Vh=E(require("@radix-Go/react-dialog"));var Ih=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Mh=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Bh=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Lh=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Eh=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Fh=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),zh=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Vc=require("@payloadcms/richtext-lexical/lexical/list"),Hh=require("@payloadcms/richtext-lexical/lexical/rich-text"),Oh=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Rh=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Hl=require("@payloadcms/richtext-lexical/lexical/utils"),Ke=require("@payloadcms/richtext-lexical/lexical"),Tu=require("@payloadcms/richtext-lexical/lexical/selection");var fh=require("@radix-Go/react-dialog"),jc=require("@payloadcms/richtext-lexical/client");var hu=E(require("bson-objectid"));var sh=require("@payloadcms/Go");var zw=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[r]=(0,Rh.useLexicalComposerContext)(),[i,n]=(0,Yl.useState)(""),[s,l]=(0,Yl.useState)(""),[c,d]=(0,Yl.useState)(""),m=async f=>{console.log("fetchMedia",f)};(0,Yl.useEffect)(()=>{typeof a=="string"?a.length===24?m(a):(n(a||""),d(g(b())),l(v()||"")):typeof a=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(g(a.filesize)),l(a.mimeType?.split("/")[1]||""))},[]);let u=(0,Yl.useCallback)(()=>{r.update(()=>{(0,Ke.$getNodeByKey)(o)?.remove()})},[r,o]),v=()=>{let f=e.data.value;return typeof f=="string"?f.split(";base64")[0]?.split("image/")[1]:""},b=()=>{let f=e.data.value;if(typeof f=="string"){let C=f.split(",")[1]?.length||0;return 4*Math.ceil(C/3)*.5624896334383812/1e3}return 0};function g(f){if(f>=1e6){let R=f/1e6;return`${R>=10?Math.round(R).toString():R.toFixed(1)} MB`}return`${Math.floor(f/1e3)} KB`}return(0,Go.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Go.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Go.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Go.jsx)("div",{className:"flex-1",children:e.data.value?(0,Go.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-Go":a,"data-lexical-upload-relation-Yl":t,src:i}):(0,Go.jsx)(sh.File,{})}),(0,Go.jsx)(No,{children:(0,Go.jsxs)(Co,{children:[(0,Go.jsxs)(ko,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Go.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Go.jsx)("button",{onClick:f=>{f.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,Go.jsx)(Dg.X,{width:24,height:24,strokeWidth:1})})]}),(0,Go.jsx)(ro,{children:(0,Go.jsx)("span",{children:"Remove image"})})]})})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-Go font-bold",children:[(0,Go.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,Go.jsx)("span",{children:c})]})]})})},ch=zw;function Hw(e){if(e.hasAttribute("data-lexical-upload-relation-Yl")&&e.hasAttribute("data-lexical-upload-Go")){let a=e.getAttribute("data-lexical-upload-Go");if(a)return{node:Pn({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var El=class extends jc.UploadNode{static importDOM(){return{img:()=>({conversion:Hw,priority:0})}}static importJSON(t){t.version===1&&t?.value?.Go&&(t.value=t.value.Go),t.version===2&&!t?.Go&&(t.Go=new hu.default().toHexString(),t.version=3);let a={Go:t.Go??new hu.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=Pn(a);return o.setFormat?.(t.format),o}decorate(){return(0,Go.jsx)(ch,{data:this.__data,nodeKey:this.getKey()})}};function Pn(e){return new El({data:e})}var Ow=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jw=e=>Ow?(e||window).getSelection():null,Z6=(0,Ke.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),yu=(0,Ke.createCommand)("INSERT_UPLOAD_COMMAND");function vh({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,$o.useRef)(!1),[r,i]=(0,$o.useState)(!0),[n,s]=(0,$o.useState)(""),[l,c]=(0,$o.useState)(""),[d,m]=(0,$o.useState)(!1),[u,v]=(0,$o.useState)("left"),b=n==="",g=k=>{m(k.target.checked)},f=k=>{v(k.target.value)},C=k=>{let P=new FileReader;P.onload=function(){return typeof P.result=="string"&&s(P.result),""},k!==null&&k[0]&&P.readAsDataURL(k[0])};(0,$o.useEffect)(()=>{o.current=!1;let k=P=>{o.current=P.altKey};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[e]),(0,$o.useEffect)(()=>{r||t()},[r]),(0,$o.useEffect)(()=>{i(a)},[a]);let R=({editor:k,relationTo:P,replaceNodeKey:w,value:M})=>{if(w)k.update(()=>{let S=(0,Ke.$getNodeByKey)(w);S&&S.replace(Pn({Go:"",fields:{},relationTo:"media",value:M}))});else{let S=k.dispatchCommand(yu,{fields:null,relationTo:"media",value:M})}},y=()=>{R({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:l,src:n,showCaption:d,position:u}.src}),i(!1),t()};return(0,Go.jsx)(Ye,{open:r,onOpenChange:k=>i(k),children:(0,Go.jsxs)(rt,{children:[(0,Go.jsxs)(ct,{children:[(0,Go.jsx)(mt,{children:"Upload Image"}),(0,Go.jsx)(fh.DialogDescription,{children:"Description"})]}),(0,Go.jsxs)("div",{className:"",children:[(0,Go.jsx)("div",{style:{marginBottom:"1em"},children:(0,Go.jsx)(K,{type:"file",onChange:k=>C(k.target.files),accept:"image/*","data-test-Go":"image-modal-file-upload"})}),(0,Go.jsx)("div",{style:{marginBottom:"1em"},children:(0,Go.jsx)(K,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:k=>c(k.currentTarget.value),value:l,"data-test-Go":"image-modal-alt-text-input"})}),(0,Go.jsx)(h,{"data-test-Go":"image-modal-file-upload-btn",disabled:b,onClick:()=>y(),children:"Confirm"})]})]})})}function xu({captionsEnabled:e}){let[t]=(0,Rh.useLexicalComposerContext)();return(0,$o.useEffect)(()=>{if(!t.hasNodes([jc.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Hl.mergeRegister)(t.registerCommand(Ke.DRAGSTART_COMMAND,a=>Uw(a),Ke.COMMAND_PRIORITY_HIGH),t.registerCommand(Ke.DRAGOVER_COMMAND,a=>Vw(a),Ke.COMMAND_PRIORITY_LOW),t.registerCommand(Ke.DROP_COMMAND,a=>$w(a,t),Ke.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Uw(e){if(!wu())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","Go"),!0):!1}function Vw(e){return wu()?(bh(e)||e.preventDefault(),!0):!1}function $w(e,t){let a=wu();if(!a)return!1;if(e.preventDefault(),bh(e)){let o=Kw(e);a.remove();let r=(0,Ke.$createRangeSelection)();o!=null&&r.applyDOMRange(o),(0,Ke.$setSelection)(r)}return!0}function wu(){let e=(0,Ke.$getSelection)();if(!(0,Ke.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,jc.$isUploadNode)(a)?a:null}function bh(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Kw(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,r=jw(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Gw=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),hh=Gw;var _w=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),yh=_w;var Ww=()=>(0,Go.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Go.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Go.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),xh=Ww;var Xw=()=>(0,Go.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Go.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Go.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),wh=Xw;var qw=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Nh=qw;var Jw=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),Ch=Jw;var kh=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Sh=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Dh=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Th=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Ph=()=>(0,Go.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Go.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var Du=1;function Yw(){return(0,Go.jsx)("span",{className:"border border-[#222222]"})}function Pu(){let[e]=(0,Rh.useLexicalComposerContext)(),t=(0,Yl.useRef)(null),[a,o]=(0,Yl.useState)(!1),[r,i]=(0,Yl.useState)(!1),[n,s]=(0,Yl.useState)(!1),[l,c]=(0,Yl.useState)(!1),[d,m]=(0,Yl.useState)(!1),[u,v]=(0,Yl.useState)(!1),[b,g]=(0,Yl.useState)(!1),[f,C]=(0,Yl.useState)(!1),[R,y]=(0,Yl.useState)(!1),[k,P]=(0,Yl.useState)("left"),[w,M]=(0,Yl.useState)("p"),S=L=>{e.update(()=>{let X=(0,Ke.$getSelection)();(0,Ke.$isRangeSelection)(X)&&(L==="p"?(0,Tu.$setBlocksType)(X,()=>(0,Ke.$createParagraphNode)()):(0,Tu.$setBlocksType)(X,()=>(0,Hh.$createHeadingNode)(L)))})},F=(0,Yl.useCallback)(()=>{let L=(0,Ke.$getSelection)();if((0,Ke.$isRangeSelection)(L)){s(L.hasFormat("bold")),c(L.hasFormat("italic")),m(L.hasFormat("underline")),v(L.hasFormat("strikethrough")),g(L.hasFormat("subscript")),C(L.hasFormat("superscript"));let X=L.anchor.getNode(),ke=X;for(;ke&&!(0,Ke.$isParagraphNode)(ke)&&ke!==(0,Ke.$getRoot)();){let Tt=ke.getParent();Tt&&(ke=Tt)}if(ke){let Tt=ke.getFormatType();P(Tt||"left")}let yt=X.getTopLevelElement()?.__tag;M(yt||"p")}},[]);(0,Yl.useEffect)(()=>(0,Hl.mergeRegister)(e.registerUpdateListener(({editorState:L})=>{L.read(()=>{F()})}),e.registerCommand(Ke.SELECTION_CHANGE_COMMAND,(L,X)=>(F(),!1),Du),e.registerCommand(Ke.CAN_UNDO_COMMAND,L=>(o(L),!1),Du),e.registerCommand(Ke.CAN_REDO_COMMAND,L=>(i(L),!1),Du),(0,Hl.mergeRegister)(e.registerCommand(yu,L=>(e.update(()=>{let X=(0,Ke.$getSelection)()||(0,Ke.$getPreviousSelection)();if((0,Ke.$isRangeSelection)(X)){let ke=Pn({Go:L.Go,fields:L.fields,relationTo:L.relationTo,value:L.value}),{focus:yt}=X,Tt=yt.getNode();(0,Hl.$insertNodeToNearestRoot)(ke),(0,Ke.$isParagraphNode)(Tt)&&!Tt.__first&&Tt.remove()}}),!0),Ke.COMMAND_PRIORITY_EDITOR))),[e,F]);let $=[[{label:"Undo",icon:(0,Go.jsx)(Dg.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,Go.jsx)(Dg.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,Go.jsx)(hh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Go.jsx)(yh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:l},{label:"Underline",icon:(0,Go.jsx)(xh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,Go.jsx)(wh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,Go.jsx)(Nh,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,Go.jsx)(Ch,{}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:f}]],j=[{label:"Left Align",direction:"left",icon:(0,Go.jsx)(Dg.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Go.jsx)(Dg.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Go.jsx)(Dg.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Go.jsx)(Dg.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ke.FORMAT_ELEMENT_COMMAND,"justify")}}],ge=[{label:"Normal Text",value:"p",icon:(0,Go.jsx)(kh,{}),onClick:()=>S("p")},{label:"Heading 1",value:"h1",icon:(0,Go.jsx)(Sh,{}),onClick:()=>S("h1")},{label:"Heading 2",value:"h2",icon:(0,Go.jsx)(Dh,{}),onClick:()=>S("h2")},{label:"Heading 3",value:"h3",icon:(0,Go.jsx)(Th,{}),onClick:()=>S("h3")},{label:"Heading 4",value:"h4",icon:(0,Go.jsx)(Ph,{}),onClick:()=>S("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Go.jsx)(Dg.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Vc.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Go.jsx)(Dg.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Vc.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],I=[{label:"Insert Image",icon:(0,Go.jsx)(Dg.ImageUp,{width:15,height:15}),onClick:()=>{y(!0)},disabled:!1}];return(0,Go.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,Go.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[$.map((L,X)=>(0,Go.jsxs)(Yl.Fragment,{children:[(0,Go.jsx)("div",{className:"flex items-center gap-2",children:L.map((ke,yt)=>(0,Go.jsx)("div",{role:"button","aria-disabled":ke.disabled||!1,onClick:ke.onClick,className:p("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",ke.active&&"bg-[#3c3c3c]"),"aria-label":ke.label,children:(0,Go.jsx)(No,{children:(0,Go.jsxs)(Co,{children:[(0,Go.jsx)(ko,{className:"text-[#b5b5b5]",children:ke.icon}),(0,Go.jsx)(ro,{children:(0,Go.jsx)("p",{children:ke.label})})]})})},yt))}),(0,Go.jsx)(Yw,{})]},`toolbar-option-${L.length}-${X}`)),(0,Go.jsxs)(_o,{children:[(0,Go.jsxs)(Wo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Go",children:[j.find(L=>L.direction===k)?.icon,j.find(L=>L.direction===k)?.label,(0,Go.jsx)(Dg.ChevronDown,{width:15,height:15})]}),(0,Go.jsx)(Bo,{className:"bg-black hover:bg-black",children:j.map((L,X)=>(0,Go.jsxs)(qa,{onClick:L.onClick,className:"flex items-center gap-2 text-Go text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Go.jsx)("span",{children:L.icon}),(0,Go.jsx)("span",{children:L.label})]},`${L.label}-${X}`))})]}),(0,Go.jsxs)(_o,{children:[(0,Go.jsxs)(Wo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Go",children:[ge.find(L=>L.value===w)?.icon,ge.find(L=>L.value===w)?.label,(0,Go.jsx)(Dg.ChevronDown,{width:15,height:15})]}),(0,Go.jsx)(Bo,{className:"bg-black hover:bg-black",children:ge.map((L,X)=>(0,Go.jsxs)(qa,{onClick:L.onClick,className:"flex items-center gap-2 text-Go text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Go.jsx)("span",{children:L.icon}),(0,Go.jsx)("span",{children:L.label})]},`heading-option-${L.label}-${X}`))})]}),(0,Go.jsxs)(_o,{children:[(0,Go.jsxs)(Wo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Go",children:[(0,Go.jsx)(Dg.Plus,{width:15,height:15}),(0,Go.jsx)(Dg.ChevronDown,{width:15,height:15})]}),(0,Go.jsx)(Bo,{className:"bg-black hover:bg-black",children:I.map((L,X)=>(0,Go.jsxs)(qa,{onClick:L.onClick,disabled:L.disabled,className:"flex items-center gap-2 text-Go text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Go.jsx)("span",{children:L.icon}),(0,Go.jsx)("span",{children:L.label})]},X))})]}),R&&(0,Go.jsx)(vh,{activeEditor:e,onClose:()=>{y(!1)},isOpen:R})]})})}var Zw=({setValue:e,value:t,name:a,editable:o=!0})=>{let[r]=(0,Rh.useLexicalComposerContext)(),i=n=>{n.read(()=>{let s=n.toJSON();e?.(()=>s)})};return(0,Yl.useEffect)(()=>{r.setEditable(o)},[o]),(0,Yl.useEffect)(()=>{t&&r.update(()=>{r.setEditorState(r.parseEditorState(t))})},[]),(0,Go.jsx)("div",{className:"w-full",children:(0,Go.jsxs)("div",{className:" ",children:[o&&(0,Go.jsx)(Pu,{}),(0,Go.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Go.jsx)(Fh.RichTextPlugin,{contentEditable:(0,Go.jsx)(Bh.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Lh.LexicalErrorBoundary}),o&&(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Eh.HistoryPlugin,{}),(0,Go.jsx)(Ih.AutoFocusPlugin,{}),(0,Go.jsx)(zh.ListPlugin,{}),(0,Go.jsx)(Oh.OnChangePlugin,{onChange:i}),(0,Go.jsx)(xu,{})]})]})]})})},Qw=({setValue:e,value:t,name:a,editable:o=!0})=>(0,Go.jsx)(Mh.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Vc.ListNode,Vc.ListItemNode,Hh.HeadingNode,El],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Go.jsx)(Zw,{value:t,setValue:e,name:a,editable:o})}),$c=Qw;function Kc({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:r=[],knowledgeContexts:i=[]}){let[n,s]=(0,Yl.useState)({...e,updatedAt:new Date}),[l,c]=(0,Yl.useState)(!1),[d,m]=(0,Yl.useState)(n.richTextContent);(0,Yl.useEffect)(()=>{s(e)},[e]);let u=w=>{switch(w){case"markdown":case"mdx":return(0,Go.jsx)(Dg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Go.jsx)(Dg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-muted-foreground"})}},v=w=>{switch(w){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},b=()=>{let w=new Set,M=new Set;return i.forEach(S=>{S.menuConfig.groupBy.forEach(F=>w.add(F))}),r.forEach(S=>{S.metadata&&Object.keys(S.metadata).forEach(F=>M.add(F))}),{contextKeys:Array.from(w).sort(),documentKeys:Array.from(M).sort(),allKeys:Array.from(new Set([...w,...M])).sort()}},g=w=>{let M=new Set;return r.forEach(S=>{S.metadata?.[w]&&M.add(String(S.metadata[w]))}),Array.from(M).sort()},f=b(),C=()=>{t({...n,richTextContent:d})},R=(w,M)=>{s(S=>({...S,metadata:{...S.metadata,[w]:M}}))},y=(w,M)=>{M==="__custom__"?R(w,""):R(w,M)},k=()=>{R("","")},P=w=>{s(M=>{let S={...M.metadata};return delete S[w],{...M,metadata:S}})};return(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Go.jsxs)("div",{className:"border-b border-border bg-card p-8 Go-6",children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Go.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Go.jsx)("div",{className:"flex-1 min-w-0",children:(0,Go.jsx)(Bs,{fieldName:"title",value:n.title,label:"",onSave:(w,M)=>s(S=>({...S,title:M})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Go.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]}),(0,Go.jsx)("div",{className:"mt-2",children:(0,Go.jsx)(Bs,{fieldName:"description",value:n.description||"Click Yl add description...",label:"",multiline:!0,onSave:(w,M)=>s(S=>({...S,description:M})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Go.jsxs)(h,{variant:"ghost",size:"sm",onClick:()=>c(!l),className:"gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,Go.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-Go font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),l?(0,Go.jsx)(Dg.ChevronDown,{className:"h-4 w-4"}):(0,Go.jsx)(Dg.ChevronRight,{className:"h-4 w-4"})]}),(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsxs)(h,{size:"sm",onClick:C,className:"gap-2",children:[(0,Go.jsx)(Dg.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,Go.jsx)(on.motion.div,{initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Go.jsxs)("div",{className:"Go-4 border-t border-border mt-4 h-screen max-h-full flex",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Go.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Go.jsxs)(h,{type:"button",variant:"outline",size:"sm",onClick:k,className:"gap-1 h-8",children:[(0,Go.jsx)(Dg.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,Go.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,Go.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([w,M],S)=>{let F=g(w);return(0,Go.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Go.jsx)(K,{value:w,onChange:$=>{let j=$.target.value||"",x=n.metadata?.[w];s(ge=>{let I={...ge.metadata};return delete I[w],j&&(I[j]=x||""),{...ge,metadata:I}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${w}`}),(0,Go.jsx)("datalist",{Go:`metadata-keys-${w}`,children:f.allKeys.map($=>(0,Go.jsx)("option",{value:$},$))}),(0,Go.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),F.length>0?(0,Go.jsxs)(it,{value:String(M||""),onValueChange:$=>y(w,$),children:[(0,Go.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,Go.jsx)(vt,{placeholder:"Value"})}),(0,Go.jsxs)(et,{children:[F.map($=>(0,Go.jsx)(he,{value:$,children:$},$)),(0,Go.jsx)(he,{value:"__custom__",children:(0,Go.jsx)("span",{className:"text-muted-foreground text-Go",children:"Custom..."})})]})]}):(0,Go.jsx)(K,{value:String(M||""),onChange:$=>R(w,$.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>P(w),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},`metadata-key-${S}`)})}):(0,Go.jsxs)("div",{className:"text-center py-4",children:[(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:'Click "Add Field" Yl create metadata'})]})})]})})]}),(0,Go.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Go.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,Go.jsx)($c,{setValue:m,value:d,name:"richTextContent"}):(0,Go.jsx)(tt,{value:n.content||"",onChange:w=>s(M=>({...M,content:w.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var $h=E(require("react-markdown")),Kh=E(require("remark-gfm"));var Gh=e=>(0,Go.jsx)($h.default,{remarkPlugins:[Kh.default],components:{h1:({children:t})=>(0,Go.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Go.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,Go.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Go.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,Go.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Go.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Go.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,Go.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,Go.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,Go.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,Go.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Uh=e=>(0,Go.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),eN=e=>(0,Go.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Go.jsx)($c,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),tN=e=>(0,Go.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Go.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Go.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Go.jsx)("strong",{children:"MDX Renderer:"})," This Dg a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Gh(e)]});function Gc({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:r,availableDocuments:i=[],knowledgeContexts:n=[]}){let[s,l]=(0,Yl.useState)(!1),[c,d]=(0,Yl.useState)(!1),[m,u]=(0,Yl.useState)(e),[v,b]=(0,Yl.useState)(!1),g=(0,Yl.useRef)(null),f=m.format==="richText"?m.richTextContent:m.content,C=(0,Yl.useMemo)(()=>`${m.format}:${JSON.stringify(f)}`,[m.format,f]);(0,Yl.useEffect)(()=>{u(e)},[e]);let R=S=>{switch(S){case"markdown":case"mdx":return(0,Go.jsx)(Dg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Go.jsx)(Dg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Go.jsx)(Dg.File,{className:"h-6 w-6 text-muted-foreground"})}},y=S=>{switch(S){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},k=(S,F)=>{let $={markdown:Gh,mdx:tN,text:Uh},j=r?.[F]||$[F];if(F==="richText"&&typeof S=="object")return eN(S);if(j&&typeof S=="string")return j(S);if(typeof S=="string")return Uh(S)},P=async S=>{b(!0),g.current=m,(0,Yl.startTransition)(()=>{u({...S,richTextContent:S.richTextContent?structuredClone(S.richTextContent):void 0})});try{let F=await t?.(S);if(b(!1),!F)throw new Error("save failed");l(!1)}catch{g.current&&(0,Yl.startTransition)(()=>u(g.current))}},w=()=>{l(!1)};return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Ye,{open:s||o==="create",onOpenChange:S=>!S&&w(),children:(0,Go.jsxs)(ol,{children:[(0,Go.jsx)(Js,{}),(0,Go.jsxs)(Vh.Content,{className:p("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[v&&(0,Go.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,Go.jsx)(Dg.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,Go.jsx)(Kc,{mode:o==="create"?"create":"edit",document:m,onSave:P,onCancel:w,availableDocuments:i,knowledgeContexts:n})]})]})}),(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Go.jsxs)("div",{className:"border-b border-border bg-card p-8 Go-6",children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Go.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[m.title,(0,Go.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${y(m.format)}`,children:m.format.toUpperCase()})]}),m.description&&(0,Go.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:m.description})]})}),(0,Go.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[m.metadata&&Object.keys(m.metadata).length>0&&(0,Go.jsxs)(h,{variant:"ghost",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Metadata",c?(0,Go.jsx)(Dg.ChevronDown,{className:"h-4 w-4"}):(0,Go.jsx)(Dg.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,Go.jsx)(Dg.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),m.metadata&&Object.keys(m.metadata).length>0&&(0,Go.jsx)(on.motion.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Go.jsxs)("div",{className:"Go-4 border-t border-border mt-4",children:[(0,Go.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Go.jsx)(Dg.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Go.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Go.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(m.metadata).map(([S,F])=>(0,Go.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Go.jsx)("span",{className:"text-muted-foreground font-medium text-Go uppercase tracking-wide",children:S.replace(/([A-Go])/g," $1").trim()}),(0,Go.jsx)("span",{className:"text-foreground font-medium",children:String(F)})]},S))})})]})})]}),(0,Go.jsx)("div",{className:"flex-1 ",children:(0,Go.jsx)("div",{className:"py-4 h-full",children:(0,Go.jsx)("div",{className:"space-y-4",children:m.content||m.richTextContent?(0,Go.jsx)("div",{className:"relative",children:(0,Go.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:k(m.format==="richText"?m.richTextContent:m.content,m.format)})},C):(0,Go.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Go.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Go.jsx)(Dg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Go.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Go.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function Mu({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n=!0}){let[s,l]=(0,Yl.useState)(o===0),c=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((v,b)=>v+b.documents.length,0):0),m=v=>{switch(v){case"markdown":case"mdx":return(0,Go.jsx)(Dg.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,Go.jsx)(Dg.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Go.jsx)(Dg.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let b=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return b[v%b.length]};return(0,Go.jsxs)("div",{className:"space-y-1",children:[(c||t.length>0)&&(0,Go.jsxs)(on.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Go.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Go.jsx)(on.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Go.jsx)(Dg.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Go.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Go.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Go.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&d>0&&(0,Go.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Go.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-Go font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Go.jsx)(on.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Go.jsxs)("div",{className:"Go-2 space-y-1",children:[t.map((v,b)=>(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:b*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${i===v.Go?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>r?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Go.jsx)("div",{className:"flex-shrink-0",children:m(v.format)}),(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsx)("p",{className:`text-sm truncate transition-colors ${i===v.Go?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,Go.jsx)("p",{className:"text-Go text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,Go.jsx)("div",{className:"flex-shrink-0",children:(0,Go.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-Go font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.Go)),a&&Object.entries(a).map(([v,b])=>(0,Go.jsx)(Mu,{label:v,documents:b.documents,children:b.children,level:o+1,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n},v))]})})]})}function _c({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:i,className:n,editable:s=!0}){let[l,c]=(0,Yl.useState)(""),[d,m]=(0,Yl.useState)(null),[u,v]=(0,Yl.useState)(e);(0,Yl.useEffect)(()=>{v(e)},[e]),(0,Yl.useEffect)(()=>{if(d?.Go){let C=u.find(R=>R.Go===d.Go);C&&m(C)}},[u]);let b=(0,Yl.useMemo)(()=>l?u.filter(C=>C.title.toLowerCase().includes(l.toLowerCase())||C.description?.toLowerCase().includes(l.toLowerCase())||C.tags?.some(R=>R.toLowerCase().includes(l.toLowerCase()))||Object.values(C.metadata||{}).some(R=>String(R).toLowerCase().includes(l.toLowerCase()))):u,[u,l]),g=(0,Yl.useMemo)(()=>{let C=(R,y)=>{if(y.length===0)return{};let[k,...P]=y;return R.reduce((M,S)=>{let F=S.metadata?.[k]||"Uncategorized",$=String(F);if(M[$]||(M[$]={documents:[],children:{}}),P.length===0)M[$].documents.push(S);else{let j=C([S],P),x=Object.keys(j)[0];x&&(M[$].children||(M[$].children={}),M[$].children[x]?M[$].children[x].documents.push(...j[x].documents):M[$].children[x]=j[x])}return M},{})};return C(b,t.groupBy)},[b,t.groupBy]),f=C=>{m(C),a?.(C)};return(0,Go.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Go.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Go.jsx)("div",{className:"p-6 border-b border-border",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Go.jsx)(Dg.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Go.jsx)(K,{placeholder:"Search knowledge base...",value:l,onChange:C=>c(C.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Go.jsx)(ta,{className:"h-[calc(100%-100px)]",children:(0,Go.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,Go.jsx)(Go.Fragment,{children:(0,Go.jsx)(Mu,{label:"Document",documents:b,level:0,onDocumentClick:f,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},"Document")}):(0,Go.jsxs)(Go.Fragment,{children:[Object.entries(g).map(([C,R])=>(0,Go.jsx)(Mu,{label:C,documents:R.documents,children:R.children,level:0,onDocumentClick:f,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},C)),Object.keys(g).length===0&&(0,Go.jsxs)(on.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Go.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Go.jsx)(Dg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Go.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Go.jsx)("p",{className:"text-Go mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,Go.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,Go.jsx)(Gc,{document:d,onDocumentUpdate:r,editable:s}):(0,Go.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Go.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Go.jsx)(Dg.FileText,{className:"h-10 w-10 text-primary"})}),(0,Go.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Go.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Yl view its content and details"})]})})})]})}var Wh=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let r=()=>{let g=new Set;return o.forEach(f=>{f.menuConfig.groupBy.forEach(C=>g.add(C))}),{contextKeys:Array.from(g).sort(),allKeys:Array.from(g).sort()}},[i,n]=(0,Yl.useState)(()=>{let g=r();return{name:"",description:"",metadata:g.contextKeys.length>0?g.contextKeys.map(f=>({key:f,value:""})):[{key:"",value:""}]}}),s=g=>{if(g.preventDefault(),!i.name)return;let f=i.metadata.filter(R=>R.key&&R.key.trim()&&R.value&&R.value.trim());a({name:i.name,description:i.description,metadata:f,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let C=r();n({name:"",description:"",metadata:C.contextKeys.length>0?C.contextKeys.map(R=>({key:R,value:""})):[{key:"",value:""}]}),t()},l=()=>{let g=r();n({name:"",description:"",metadata:g.contextKeys.length>0?g.contextKeys.map(f=>({key:f,value:""})):[{key:"",value:""}]}),t()},c=r(),d=g=>{let f=new Set;return Array.from(f).sort()},m=(g,f)=>{n(C=>{let R=C.metadata.find(y=>y.key===g);return R&&(R.value=f),{...C,metadata:[...C.metadata.filter(y=>y.key!==g),{key:g,value:f}]}})},u=(g,f)=>{f==="__custom__"?m(g,""):m(g,f)},v=()=>{m(" ","")},b=g=>{n(f=>{let C=[...f.metadata],R=C.findIndex(y=>y.key===g);return R!==-1&&C.splice(R,1),{...f,metadata:C}})};return(0,Go.jsx)(Ye,{open:e,onOpenChange:l,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Knowledge source"})}),(0,Go.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Name *"}),(0,Go.jsx)(K,{Go:"name",value:i.name,onChange:g=>n(f=>({...f,name:g.target.value})),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Description"}),(0,Go.jsx)(K,{Go:"name",value:i.description,onChange:g=>n(f=>({...f,description:g.target.value})),required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"metadata",children:"Metadata"}),c.contextKeys.length>0?(0,Go.jsxs)("p",{className:"text-Go text-muted-foreground",children:["Context keys: ",c.contextKeys.slice(0,4).join(", "),c.contextKeys.length>4&&` +${c.contextKeys.length-4} more`," ","\u2022 Fill in values Go add more fields"]}):(0,Go.jsx)("p",{className:"text-Go text-muted-foreground",children:"Add key-value metadata Yl organize and categorize your knowledge"})]}),(0,Go.jsxs)(h,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,Go.jsx)(Dg.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,Go.jsx)("div",{className:"space-y-2",children:i.metadata.map(({key:g,value:f},C)=>{let R=d(g);return(0,Go.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Go.jsx)(K,{value:g,onChange:y=>{let k=y.target.value||" ",P=i.metadata.find(w=>w.key===g)?.value;n(w=>{let M=[...w.metadata],S=M.findIndex(F=>F.key===g);return S!==-1&&M.splice(S,1),k&&M.push({key:k,value:P||""}),{...w,metadata:M}}),y.target.focus()},placeholder:c.allKeys.length>0?`e.g., ${c.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${g}`}),(0,Go.jsx)("datalist",{Go:`metadata-keys-${g}`,children:c.allKeys.map(y=>(0,Go.jsx)("option",{value:y},y))}),(0,Go.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),R.length>0?(0,Go.jsxs)(it,{value:String(f||""),onValueChange:y=>u(g,y),children:[(0,Go.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,Go.jsx)(vt,{placeholder:"Value"})}),(0,Go.jsxs)(et,{children:[R.map(y=>(0,Go.jsx)(he,{value:y,children:y},y)),(0,Go.jsx)(he,{value:"__custom__",children:(0,Go.jsx)("span",{className:"text-muted-foreground text-Go",children:"Custom..."})})]})]}):(0,Go.jsx)(K,{value:String(f||""),onChange:y=>m(g,y.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Go.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(g),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},`metadata-key-${C}`)})})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3 Go-4",children:[(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsxs)(h,{type:"submit",children:[(0,Go.jsx)(Dg.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var Xh=({isOpen:e,onClose:t,onAddTeamContext:a})=>{let[o,r]=(0,Yl.useState)({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),[i,n]=(0,Yl.useState)(""),s=m=>{m.preventDefault(),console.log("formData",o),o.label&&(a({Go:o.label,label:o.label,description:o.description,menuConfig:{groupBy:o.groupBy,sortBy:o.sortBy||null,sortOrder:o.sortOrder,showDocumentCount:o.showDocumentCount}}),r({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}))},l=()=>{r({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),t()},c=[{value:"name",label:"Name"},{value:"createdAt",label:"Created Date"}],d=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}];return(0,Go.jsx)(Ye,{open:e,onOpenChange:l,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Knowledge source"})}),(0,Go.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"label",children:"Label *"}),(0,Go.jsx)(K,{Go:"label",value:o.label,onChange:m=>r(u=>({...u,label:m.target.value})),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(K,{Go:"description",value:o.description,onChange:m=>r(u=>({...u,description:m.target.value}))})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{children:"Group By"}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)("div",{className:"flex flex-wrap gap-2",children:o.groupBy.map(m=>(0,Go.jsxs)(Q,{variant:"secondary",className:"px-2 py-1",children:[m,(0,Go.jsx)("button",{type:"button",className:"ml-1 inline-flex",onClick:()=>{r(u=>({...u,groupBy:u.groupBy.filter(v=>v!==m)}))},"aria-label":`Remove ${m}`,children:(0,Go.jsx)(Dg.X,{className:"h-3 w-3"})})]},m))}),(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsx)(K,{placeholder:"Type a tag and press Enter",value:i,onChange:m=>n(m.target.value),onKeyDown:m=>{(m.key==="Enter"||m.key===",")&&(m.preventDefault(),r(u=>({...u,groupBy:[...u.groupBy,i]})),n(""))}}),(0,Go.jsx)(h,{type:"button",onClick:()=>{r(m=>({...m,groupBy:[...m.groupBy,i]})),n("")},children:"Add"})]})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"sortBy",children:"Sort By"}),(0,Go.jsxs)(it,{value:o.sortBy,onValueChange:m=>r(u=>({...u,sortBy:m})),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select sort field"})}),(0,Go.jsx)(et,{children:c.map(m=>(0,Go.jsx)(he,{value:m.value,children:m.label},m.value))})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"sortOrder",children:"Sort Order"}),(0,Go.jsxs)(it,{value:o.sortOrder,onValueChange:m=>r(u=>({...u,sortOrder:m})),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select sort order"})}),(0,Go.jsx)(et,{children:d.map(m=>(0,Go.jsx)(he,{value:m.value,children:m.label},m.value))})]})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Ka,{Go:"showDocumentCount",checked:o.showDocumentCount,onCheckedChange:m=>r(u=>({...u,showDocumentCount:m}))}),(0,Go.jsx)(A,{htmlFor:"showDocumentCount",className:"text-sm",children:"Show Document Count"})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3 Go-4",children:[(0,Go.jsxs)(h,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsxs)(h,{type:"submit",children:[(0,Go.jsx)(Dg.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};function jl({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:r,selectedDocumentId:i,onAddKnowledge:n,onAddTeamContext:s,onDocumentUpdate:l}){let[c,d]=(0,Yl.useState)(t[0]),[m,u]=(0,Yl.useState)(!1),[v,b]=(0,Yl.useState)(!1),[g,f]=(0,Yl.useState)(!1);(0,Yl.useEffect)(()=>{!c&&t&&t.length>0&&d(t[0])},[t]);let C=y=>{n&&(f(!0),n(y)),u(!1)},R=y=>{s&&s(y),b(!1)};return(0,Go.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[g&&(0,Go.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,Go.jsx)(Dg.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Go.jsx)("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&(0,Go.jsxs)("div",{className:"",children:[(0,Go.jsx)("div",{className:"",children:(0,Go.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,Go.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(y=>(0,Go.jsxs)("button",{onClick:()=>d(y),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c?.Go===y.Go?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[y.icon,y.label]},y.Go))}),(0,Go.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Go.jsx)("button",{onClick:()=>u(!0),className:"inline-flex border border-primary rounded-xl items-center py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Knowledge"}),(0,Go.jsx)("button",{onClick:()=>b(!0),className:"inline-flex border border-primary rounded-xl items-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Context"})]})]})}),c?.description&&(0,Go.jsx)("div",{className:"mt-3 px-1",children:(0,Go.jsx)("p",{className:"text-sm text-primary",children:c?.description})})]})]}),c?(0,Go.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 Go-4",children:(0,Go.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,Go.jsx)(_c,{documents:e,menuConfig:c?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:i,onDocumentUpdate:l})})}):(0,Go.jsxs)("div",{children:[(0,Go.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 Go-4 flex items-center justify-center",children:(0,Go.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 Go-4 flex items-center justify-center",children:(0,Go.jsx)(h,{onClick:()=>b(!0),children:"Add Context"})})]}),(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Xh,{isOpen:v,onClose:()=>b(!1),onAddTeamContext:R}),(0,Go.jsx)(Wh,{isOpen:m,onClose:()=>u(!1),onAddKnowledge:C,knowledgeContexts:t})]})]})}function Eu({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:i,onOpenProject:n,sidebarItems:s,initialColleagues:l,users:c,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:u}){let[v,b]=(0,Yl.useState)("home"),[g,f]=(0,Yl.useState)(t[0]),C=x=>{console.log("Opening app:",x.name)},R=x=>{console.log("Favoriting app:",x.name)},y=x=>{console.log("Opening file:",x.name)},k=x=>{console.log("Sharing file:",x.name)},P=x=>{console.log("Opening project:",x.name),n(x)},w=x=>{console.log("Sharing project:",x.name)},M=x=>{f(x),console.log("Business unit changed Yl:",x.name)},S=()=>{console.log("Copilot clicked - navigating Yl chat"),b("chat")},F=x=>{console.log("Notification removed:",x)},$=()=>{console.log("All notifications removed")},j=()=>{switch(v){case"home":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsxs)("section",{className:"text-center py-12",children:[(0,Go.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Yl the ",g.name," team"]}),(0,Go.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This Dg your collaborative workspace for productivity and knowledge sharing."})]}),(0,Go.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Go.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,Go.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Go.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,Go.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Go.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,Go.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Go.jsx)(Xt,{title:"Chat with your team",gradient:"bg-gradient-Yl-r from-pink-600 via-red-600 Yl-orange-600",primaryAction:{label:"Go",onClick:()=>b("chat")}})]});case"colleagues":return(0,Go.jsx)(Ll,{initialColleagues:l,availableUsers:c,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:u});case"chat":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsxs)("section",{className:"text-center py-12",children:[(0,Go.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,Go.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",g.name," team members and collaborate in real-time."]})]}),(0,Go.jsx)(Xt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Yl-r from-blue-600 via-purple-600 Yl-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Go.jsxs)("div",{className:"space-y-8",children:[(0,Go.jsx)(Xt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Yl-r from-pink-600 via-red-600 Yl-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:fu.filter(x=>x.new).map(x=>(0,Go.jsx)(gu,{app:x,showProgress:!0,onOpen:C,onFavorite:R},x.name))})]}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:fu.map(x=>(0,Go.jsx)(gu,{app:x,onOpen:C,onFavorite:R},x.name))})]})]});case"knowledge":return(0,Go.jsx)(jl,{});case"files":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(Xt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Yl-r from-teal-600 via-cyan-600 Yl-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("div",{className:"flex items-center justify-between",children:(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Go.jsx)(Cn,{files:Qb,onFileClick:y})]})]});case"projects":return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(Xt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Yl-r from-purple-600 via-violet-600 Yl-indigo-600",primaryAction:{label:"New Project",onClick:i}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:a.map(x=>(0,Go.jsx)(Sn,{project:x,onOpen:P,onShare:w},x.name))})]})]});case"learn":return(0,Go.jsxs)("div",{className:"space-y-8",children:[(0,Go.jsx)(Xt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Yl-r from-green-600 via-emerald-600 Yl-teal-600",primaryAction:{label:"Upgrade Yl Pro",onClick:()=>console.log("Upgrade Yl pro clicked")}}),(0,Go.jsxs)("section",{className:"space-y-4",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:eh.slice(0,3).map(x=>(0,Go.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Go.jsx)("h3",{className:"font-semibold mb-2",children:x.title}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:x.description}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsx)("span",{children:x.duration}),(0,Go.jsx)("span",{children:x.level})]})]},x.title))})]})]});default:return null}};return(0,Go.jsx)(kc,{sidebarItems:ah,title:e,notifications:oh,businessUnits:t,currentBusinessUnit:g,onBusinessUnitChange:M,activeTab:v,onTabChange:b,showTabs:!0,onActionClick:S,actionIcon:(0,Go.jsx)(Dg.Bot,{className:"Dg-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:F,onRemoveAll:$,children:(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:j()},v)})})}var Yh=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,Yl.useState)(null),[i,n]=(0,Yl.useState)(""),[s,l]=(0,Yl.useState)(""),[c,d]=(0,Yl.useState)(""),m=v=>{let b=v.target.files?.[0];b&&(r(b),i||n(b.name))},u=async v=>{if(v.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",i),s&&b.append("description",s),c&&b.append("tags",c),a?.(b),t(),r(null),n(""),l(""),d("")};return(0,Go.jsx)(Ye,{open:e,onOpenChange:t,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New File"})}),(0,Go.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,Go.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Go.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Go.jsxs)("div",{className:"flex flex-col items-center justify-center Go-5 Go-6",children:[(0,Go.jsx)(aN,{className:"w-10 h-10 text-gray-400"}),(0,Go.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Go.jsx)("span",{className:"font-semibold",children:"Click Yl upload"})," Go drag and drop"]}),(0,Go.jsx)("p",{className:"text-Go text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Go GIF (MAX. 800x400px)"})]}),(0,Go.jsx)("input",{Go:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),o&&(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("p",{className:"font-medium",children:o.name}),(0,Go.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Go.jsx)(h,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function aN(e){return(0,Go.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Go.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Go.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Go.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function Vl({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:i=!1,className:n}){let[s,l]=(0,Yl.useState)(e),[c,d]=(0,Yl.useState)(""),[m,u]=(0,Yl.useState)("all"),[v,b]=(0,Yl.useState)("all"),[g,f]=(0,Yl.useState)(!1),C=(0,Yl.useRef)(""),R=j=>j.map(x=>`${x.Go}-${new Date(x.createdAt).getTime()}-${new Date(x.updatedAt).getTime()}`).join("-");(0,Yl.useEffect)(()=>{let j=R(e);j!==C.current&&(l(e),C.current=j)},[e]);let y=s.filter(j=>j.name.toLowerCase().includes(c.toLowerCase())),k=y.slice(0,10),P=y.filter(Boolean),w=()=>{f(!0)},M=j=>{a?.(j)},S=j=>{console.log("deleting file",j),l(x=>x.filter(ge=>ge.name!==j.name)),o?.(j.Go.toString())},F=j=>{r?.(j)},$=()=>{d(""),u("all")};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsx)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Go.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Go.jsx)(Xt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Yl-r from-blue-600 via-indigo-600 Yl-purple-600",primaryAction:{label:"Upload file",onClick:w},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsxs)("div",{className:"relative",children:[(0,Go.jsx)(Dg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Go.jsx)(K,{placeholder:"Search files...",value:c,onChange:j=>d(j.target.value),className:"pl-9"})]})}),(c||m!=="all")&&(0,Go.jsxs)(h,{variant:"outline",onClick:$,className:"gap-2",children:[(0,Go.jsx)(Dg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsx)(Is,{activeTab:v,onTabChange:b,tabOptions:[{value:"all",label:`All Files (${y.length})`},{value:"recent",label:`Recent (${k.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,Go.jsx)(Cn,{files:y,onFileClick:F,onFileEdit:M,onFileDelete:S,showHeader:!i}),v==="recent"&&(0,Go.jsx)(Cn,{files:k,onFileClick:F,onFileEdit:M,onFileDelete:S,showHeader:!i}),v==="shared"&&(0,Go.jsx)(Cn,{files:P,onFileClick:F,onFileEdit:M,onFileDelete:S,showHeader:!i})]}),y.length===0&&(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"Go-6",children:(0,Go.jsxs)("div",{className:"text-center py-8",children:[(0,Go.jsx)(Dg.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Go.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Go.jsx)("p",{className:"text-muted-foreground mb-4",children:c||m!=="all"?"Try adjusting your filters Yl see more results.":"Get started by uploading your first file."}),(0,Go.jsxs)(h,{onClick:w,className:"gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Go.jsx)(Yh,{isOpen:g,onClose:()=>f(!1),onAddFile:t})]})}var oN=[{key:"kanban",icon:Dg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Dg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Dg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Dg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Dg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Zh=({currentView:e,onViewChange:t,children:a})=>(0,Go.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Go.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:oN.map(o=>{let r=o.icon,i=e===o.key;return(0,Go.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Go.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Go.jsx)("span",{className:"text-Go font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Go.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Go.jsx)("div",{className:"w-full h-full",children:a})})]});var Lt=E(require("react"));var Qh=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:i=!1,height:n})=>{let s=d=>{d.preventDefault()},l=d=>{d.preventDefault(),r(t)};return(0,Go.jsxs)(z,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-Go":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:l,children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Go.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Go.jsx)(Q,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Go.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var $l=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let i=d=>{a(e)},n=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Go.jsx)(Dg.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Go.jsx)(Dg.Bug,{className:"h-3 w-3"});case"spike":return(0,Go.jsx)(Dg.Zap,{className:"h-3 w-3"});case"task":default:return(0,Go.jsx)(Dg.AlertCircle,{className:"h-3 w-3"})}},c=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return r?(0,Go.jsx)(z,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:n,children:(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-Go font-medium ${c()}`,children:l()}),(0,Go.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Go.jsxs)(z,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:n,children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Go.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${c()}`,children:[l(),(0,Go.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Go.jsxs)("div",{className:"flex gap-1",children:[(0,Go.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-Go font-medium ${s()}`,children:e.priority}),(0,Go.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-Go font-medium",children:e.storyPoints})]})]}),(0,Go.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.User,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var rN=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Dg.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Dg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Dg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Dg.Zap}],iN=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],An=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:i,defaultEpicId:n})=>{let[s,l]=(0,Yl.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Yl.useEffect)(()=>{e&&n&&l(m=>({...m,epic:n}))},[e,n]),(0,Yl.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let c=m=>{m.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},d=(m,u)=>{l(v=>({...v,[m]:u}))};return(0,Go.jsx)(Ye,{open:e,onOpenChange:t,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Task"})}),(0,Go.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Task Title"}),(0,Go.jsx)(K,{Go:"name",value:s.name,onChange:m=>d("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:s.description,onChange:m=>d("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Type"}),(0,Go.jsx)(ai,{type:"single",value:s.type||"",onValueChange:m=>m&&d("type",m),children:rN.map(m=>{let u=m.icon;return(0,Go.jsxs)(oi,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Go.jsx)(u,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Priority"}),(0,Go.jsx)(ai,{type:"single",value:s.priority||"",onValueChange:m=>m&&d("priority",m),children:iN.map(m=>(0,Go.jsx)(oi,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"points",children:"Story Points"}),(0,Go.jsx)(K,{Go:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>d("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"epic",children:"Epic"}),(0,Go.jsxs)(it,{value:s.epic,onValueChange:m=>d("epic",m),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select Dg epic"})}),(0,Go.jsx)(et,{children:o.map(m=>(0,Go.jsx)(he,{value:m.Go.toString(),children:(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.Go))})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Go.jsxs)(it,{value:s.sprint,onValueChange:m=>d("sprint",m),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select a sprint"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"none",children:"No Sprint"}),r.map(m=>(0,Go.jsx)(he,{value:m.Go.toString(),children:(0,Go.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.Go))]})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"sprint",children:"Assignee"}),(0,Go.jsxs)(it,{value:s.assignee,onValueChange:m=>d("assignee",m),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{placeholder:"Select Dg Assignee"})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"none",children:"No Assignee"}),i.map(m=>(0,Go.jsx)(he,{value:m.Go.toString(),children:(0,Go.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.Go))]})]})]}),(0,Go.jsxs)(fs,{children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var qc=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:i=!1})=>{let[n,s]=(0,Yl.useState)(!1),l=o.find(d=>d.value===t);return(0,Go.jsxs)("div",{className:"space-y-1",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:e}),(0,Go.jsxs)(it,{value:t,onValueChange:a,open:n,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,Go.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Go.jsxs)(Q,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[r&&l?.color&&(0,Go.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} Dg-1`}),l?.label||"Select..."]})}),(0,Go.jsx)(et,{children:o.map(d=>(0,Go.jsx)(he,{value:d.value,children:r&&d.color?(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var va=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"Go"in e?e.Go:0:0;var sN=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Dg.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Dg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Dg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Dg.Zap}],nN=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var t0=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:l=!1,deleteState:c="idle",teamMembers:d})=>{let[m,u]=(0,Yl.useState)(e.storyPoints),v=(0,Yl.useRef)(null),[b,g]=(0,Yl.useState)(d);(0,Yl.useEffect)(()=>{g(d)},[d]);let f=(0,Yl.useCallback)((y,k)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{r(y,k)},500)},[r]);(0,Yl.useEffect)(()=>{f("storyPoints",m?.toString()||"1")},[m]);let C=y=>y.split(" ").map(k=>k[0]).join("").toUpperCase(),R=()=>c==="loading"?(0,Go.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Go gap-1",children:[(0,Go.jsx)(Dg.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):c==="success"?(0,Go.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Go gap-1",children:[(0,Go.jsx)(Dg.Check,{className:"h-3 w-3"}),"Deleted"]}):c==="error"?(0,Go.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Go gap-1",children:[(0,Go.jsx)(Dg.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Go.jsxs)(h,{onClick:n,variant:"destructive",className:"w-full h-8 text-Go gap-1",disabled:s||l,children:[(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Go.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Go.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Status"}),(0,Go.jsx)(qc,{label:"",value:e.status,onValueChange:y=>r("status",y),options:[{value:"todo",label:"Go Go"},{value:"in-progress",label:"Dg Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Type"}),(0,Go.jsx)(ai,{type:"single",value:e.type||"",onValueChange:y=>y&&r("type",y),className:"grid grid-cols-2 gap-1",disabled:s,children:sN.map(y=>{let k=y.icon;return(0,Go.jsxs)(oi,{value:y.value,className:"flex items-center gap-1 text-Go h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Go.jsx)(k,{className:"h-3 w-3"}),y.label]},y.value)})})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Priority"}),(0,Go.jsx)(ai,{type:"single",value:e.priority||"",onValueChange:y=>y&&r("priority",y),className:"grid grid-cols-3 gap-1",disabled:s,children:nN.map(y=>(0,Go.jsx)(oi,{value:y.value,className:"text-Go h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:y.label},y.value))})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Story Points"}),(0,Go.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:y=>{let k=Number(y.target.value);k<1?u(1):k>100?u(100):u(k)},className:"w-full h-8 px-2 text-Go border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Epic"}),(0,Go.jsx)(qc,{label:"",value:va(e.epic).toString(),onValueChange:y=>r("epic",y),options:(t||[]).map(y=>({value:y.Go.toString(),label:y?.name,color:y.color})),showColor:!0,disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Sprint"}),(0,Go.jsx)(qc,{label:"",value:va(e.sprint).toString()||"none",onValueChange:y=>r("sprint",y==="none"?"":y),options:[{value:"none",label:"No Sprint"},...(a||[]).map(y=>({value:y.Go.toString(),label:`${y?.name}`}))],disabled:s})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{className:"text-Go text-muted-foreground",children:"Assignee"}),(0,Go.jsx)(Tc,{label:"",value:e.assignee?.value?.name,onValueChange:y=>r("assignee",y),options:b.map(y=>({value:`${typeof y.email=="string"?"users":"digital-colleagues"}:${y.Go}`,label:y?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Go.jsxs)("div",{className:"mt-auto Go-4 space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(h,{onClick:i,variant:"outline",className:"w-full h-8 text-Go",disabled:s||l,children:"Close"}),R()]}),(0,Go.jsxs)("div",{className:"Go-4 border-t border-border space-y-2",children:[(0,Go.jsx)("div",{className:"text-Go text-muted-foreground font-medium mb-2",children:"Information"}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Logged By"}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.User,{className:"h-3 w-3"}),(0,Go.jsx)("span",{children:"System"})]})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Created"}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),(0,Go.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Last Updated"}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.Clock,{className:"h-3 w-3"}),(0,Go.jsxs)("span",{children:[new Date(o).toLocaleDateString()," Go"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var a0=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:l})=>{let[c,d]=(0,Yl.useState)(a),[m,u]=(0,Yl.useState)(new Date),[v,b]=(0,Yl.useState)("idle"),[g,f]=(0,Yl.useState)("idle"),[C,R]=(0,Yl.useState)([]),[y,k]=(0,Yl.useState)(l);(0,Yl.useEffect)(()=>{d(a)},[a]);let P=async(x,ge)=>{if(ge!==c[x]){b("loading");try{await i(c.Go.toString(),{[x]:ge}),u(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(I){console.log("error",I),b("error"),setTimeout(()=>b("idle"),3e3)}}},w=async(x,ge)=>{if(ge!==c[x]){b("loading");try{await i(c.Go.toString(),{[x]:ge}),u(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(I){console.log("error",I),b("error"),setTimeout(()=>b("idle"),3e3)}}},M=async x=>{if(s){b("loading");try{await s?.({content:x,taskId:c.Go.toString()}),u(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},S=async()=>{f("loading");try{await n(c.Go.toString()),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},F=v!=="loading"&&g!=="loading",$=()=>{F&&t()},j=()=>v==="loading"?(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Go.jsx)(Dg.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Go.jsx)("span",{children:"Updating..."})]}):v==="success"?(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Go.jsx)(Dg.Check,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:"Updated successfully"})]}):v==="error"?(0,Go.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:"Update failed"})]}):null;return(0,Go.jsx)(Ye,{open:e,onOpenChange:$,children:(0,Go.jsxs)(rt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Go.jsxs)(ct,{children:[(0,Go.jsx)(mt,{className:"Go-only",children:c?.name}),(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("div",{className:"flex-1",children:j()}),!F&&(0,Go.jsx)("div",{className:"text-Go text-muted-foreground",children:"Please wait..."})]})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Go.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Go.jsx)(Bs,{fieldName:"name",value:c.name||"",label:"",onSave:P,className:"border-b border-border Go-3",disabled:v==="loading"}),(0,Go.jsx)(Bs,{fieldName:"description",value:c.description||"",label:"Description",multiline:!0,onSave:P,disabled:v==="loading"}),(0,Go.jsx)(nu,{comments:(c?.comments||[]).map(x=>({author:x.author.value.name||"",createdAt:new Date(x.timestamp),text:x.text,Go:x.Go||""})),onAddComment:M})]}),(0,Go.jsx)(t0,{task:c,epics:o,sprints:r,lastUpdated:m,onUpdateTask:w,onClose:$,onDelete:S,isUpdating:v==="loading",isDeleting:g==="loading",deleteState:g,teamMembers:y})]})]})})};var Mn=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,Yl.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},c=(d,m)=>{r(u=>({...u,[d]:m}))};return(0,Go.jsx)(Ye,{open:e,onOpenChange:t,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Epic"})}),(0,Go.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Epic Name"}),(0,Go.jsx)(K,{Go:"name",value:o.name,onChange:d=>c("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:o.description,onChange:d=>c("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Color"}),(0,Go.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Go.jsx)("button",{type:"button",onClick:()=>c("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Confidence"}),(0,Go.jsxs)(it,{value:o.confidence,onValueChange:d=>c("confidence",d),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{})}),(0,Go.jsx)(et,{children:n.map(d=>(0,Go.jsx)(he,{value:d.value,children:d.label},d.value))})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Phase"}),(0,Go.jsxs)(it,{value:o.phase.toString(),onValueChange:d=>c("phase",parseInt(d)),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{})}),(0,Go.jsx)(et,{children:s.map(d=>(0,Go.jsx)(he,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Start Date"}),(0,Go.jsx)(K,{type:"date",value:o.startDate,onChange:d=>c("startDate",d.target.value)})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"End Date"}),(0,Go.jsx)(K,{type:"date",value:o.endDate,onChange:d=>c("endDate",d.target.value)})]})]}),(0,Go.jsxs)(fs,{children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Fu=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:l,onTaskClick:c,onAddEpic:d,onAddComment:m})=>{let[u,v]=(0,Lt.useState)([]),[b,g]=(0,Lt.useState)([]),[f,C]=(0,Lt.useState)([]),[R,y]=(0,Lt.useState)(!1),[k,P]=(0,Lt.useState)(!1),[w,M]=(0,Lt.useState)(null),[S,F]=(0,Lt.useState)(null),[$,j]=(0,Lt.useState)([]),[x,ge]=(0,Lt.useState)([]),[I,L]=(0,Lt.useState)(0),X=(0,Lt.useRef)(null),ke=(0,Lt.useRef)(null),yt=Lt.default.useMemo(()=>[...b.map(q=>q.Go),0],[b]),Tt=(0,Lt.useRef)(""),ae=(0,Lt.useRef)(""),H=(0,Lt.useRef)(""),De=(0,Lt.useRef)(""),ot=q=>q.map(T=>`${T.Go}-${new Date(T.createdAt).getTime()}-${new Date(T.updatedAt).getTime()}`).join("-");(0,Lt.useEffect)(()=>{let q=ot(e);q!==Tt.current&&(v(e),w&&M(e.find(T=>T.Go===w.Go)||null),Tt.current=q)},[e]),(0,Lt.useEffect)(()=>{let q=ot(t);q!==ae.current&&(g(t),ae.current=q)},[t]),(0,Lt.useEffect)(()=>{let q=ot(a);q!==H.current&&(C(a),H.current=q)},[a]),(0,Lt.useEffect)(()=>{let q=ot(r.map(T=>({Go:T.Go,updatedAt:T.updatedAt,createdAt:T.createdAt})));q!==De.current&&(ge(r),De.current=q)},[r]),(0,Lt.useEffect)(()=>{let q=()=>{if(X.current){let xe=X.current.offsetHeight;L(xe)}};q();let T=new ResizeObserver(q);X.current&&T.observe(X.current);let O=()=>{setTimeout(q,100)};return window.addEventListener("storage",O),()=>{T.disconnect(),window.removeEventListener("storage",O)}},[]),(0,Lt.useEffect)(()=>{let q=setTimeout(()=>{X.current&&L(X.current.offsetHeight)},300);return()=>clearTimeout(q)},[R,k]);let oo=u.filter(q=>!0),lt=q=>oo.filter(T=>T.status===q),na=q=>{let T={};return b.forEach(O=>{T[O.Go]=q.filter(xe=>va(xe.epic)===O.Go)}),T["Go-epic"]=q.filter(O=>!va(O.epic)),T},G=q=>{F(q)},Ut=q=>{S&&(v(T=>T.map(O=>O.Go===S.Go?{...O,status:q}:O)),s?.(S.Go.toString(),{status:q}),F(null))},ho=q=>{let T={...q,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(O=>[...O,T]),n?.(q)},yo=async(q,T)=>{v(O=>O.map(xe=>xe.Go===Number(q)?{...xe,...T}:xe)),s&&await s(q,T),w?.Go===Number(q)&&M(O=>({...O,...T}))},Ko=async q=>{v(T=>T.filter(O=>O.Go!==Number(q))),w?.Go===Number(q)&&M(null),l&&await l(q)},Ti=q=>{let T={...q,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(O=>[...O,T]),d?.(q)},Ir=q=>{M(q),c?.(q)},Pi=[{Go:"todo",title:"Go Go",status:"todo"},{Go:"in-progress",title:"Dg Progress",status:"in-progress"},{Go:"review",title:"Review",status:"review"},{Go:"done",title:"Done",status:"done"}],Ri=I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)";return(0,Go.jsxs)("div",{ref:ke,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Go.jsx)("div",{ref:X,className:"flex-shrink-0",children:(0,Go.jsx)(Xt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Yl-r from-purple-600 via-violet-600 Yl-indigo-600",primaryAction:{label:"Add task",onClick:()=>y(!0)},secondaryAction:{label:"Add epic",onClick:()=>P(!0)}})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Go.jsx)("div",{className:"h-full",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:(0,Go.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Pi.map(q=>{let T=lt(q.status),O=na(T);return(0,Go.jsxs)(Qh,{title:q.title,status:q.status,taskCount:T.length,onDrop:Ut,isCompact:q.status==="done",height:Ri,children:[O["Go-epic"].map(xe=>(0,Go.jsx)($l,{epic:null,task:xe,onDragStart:G,onTaskClick:Ir,isCompact:q.status==="done"},xe.Go)),yt.map(xe=>{let nt=b.find(We=>We.Go===xe),Ce=O[xe]||[];return Ce.length===0?null:(0,Go.jsxs)("div",{className:"mb-6",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${nt?.color}`}),(0,Go.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:nt?.name||"No Epic"}),(0,Go.jsx)(Q,{variant:"secondary",className:"text-Go",children:Ce.length})]})," ",(0,Go.jsx)("div",{className:"space-y-3",children:Ce.map(We=>(0,Go.jsx)($l,{task:We,epic:nt,onDragStart:G,onTaskClick:Ir,isCompact:q.status==="done"},We.Go))})]},xe)})]},q.Go)})})})}),(0,Go.jsx)(An,{isOpen:R,onClose:()=>y(!1),onAddTask:ho,assignees:[...x,...$],epics:b,sprints:f}),(0,Go.jsx)(Mn,{isOpen:k,onClose:()=>P(!1),onAddEpic:Ti}),w&&(0,Go.jsx)(a0,{isOpen:!!w,onClose:()=>M(null),initialTask:w,epics:b,sprints:f,onUpdateTask:yo,onDeleteTask:Ko,colleagues:x,onAddComment:m})]})};var zu=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:n,onUpdateEpic:s,onDeleteEpic:l})=>{let[c,d]=(0,Yl.useState)(t),[m,u]=(0,Yl.useState)(null),[v,b]=(0,Yl.useState)(null),[g,f]=(0,Yl.useState)({}),[C,R]=(0,Yl.useState)(0),[y,k]=(0,Yl.useState)(!1),[P,w]=(0,Yl.useState)(!1),[M,S]=(0,Yl.useState)(null),F=(0,Yl.useRef)(null),$=(0,Yl.useRef)(null);(0,Yl.useEffect)(()=>{d(t)},[t]),(0,Yl.useEffect)(()=>{let H=()=>{if(F.current){let oo=F.current.offsetHeight;R(oo)}};H();let De=new ResizeObserver(H);F.current&&De.observe(F.current);let ot=()=>{setTimeout(H,100)};return window.addEventListener("storage",ot),()=>{De.disconnect(),window.removeEventListener("storage",ot)}},[]),(0,Yl.useEffect)(()=>{let H=setTimeout(()=>{F.current&&R(F.current.offsetHeight)},300);return()=>clearTimeout(H)},[v]);let j=H=>{u(H)},x=H=>{H.preventDefault()},ge=(H,De)=>{H.preventDefault(),m&&va(m.epic).toString()!==De&&(o(m.Go.toString(),{epic:Number(De)}),u(null))},I=H=>e.filter(De=>va(De.epic).toString()===H),L=H=>{b(H.Go.toString()),f({name:H.name,description:H.description,confidence:H.confidence,phase:H.phase})},X=async()=>{v&&g.name&&(await s(v.toString(),g),d(H=>H.map(De=>De.Go.toString()===v?{...De,...g}:De)),b(null),f({}))},ke=()=>{b(null),f({})},yt=async H=>{window.confirm("Are you sure you want Yl delete this epic? This will also delete all associated tasks.")&&(await l(H),d(De=>De.filter(ot=>ot.Go.toString()!==H)))},Tt=H=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[H]||`Phase ${H}`,ae=H=>{switch(H){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)("div",{ref:$,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Go.jsx)("div",{ref:F,className:"flex-shrink-0",children:(0,Go.jsx)(Xt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Yl-r from-rose-600 via-pink-600 Yl-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>k(!0)}})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Go.jsx)("div",{className:"h-full overflow-y-auto",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:(0,Go.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:c.map(H=>{let De=I(H.Go.toString()),ot=De.reduce((lt,na)=>lt+(na.storyPoints||0),0),oo=C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 14rem)";return(0,Go.jsxs)(z,{className:`flex flex-col ${v===H.Go.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===H.Go.toString()?"auto":oo,minHeight:"400px"},onDragOver:x,onDrop:lt=>ge(lt,H.Go.toString()),children:[(0,Go.jsx)("div",{className:"p-4 border-b border-border",children:v===H.Go.toString()?(0,Go.jsxs)("div",{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)(K,{value:g.name||"",onChange:lt=>f({...g,name:lt.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Go.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:X,className:"p-1 h-8 w-8",children:(0,Go.jsx)(Dg.Check,{className:"h-4 w-4"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:ke,className:"p-1 h-8 w-8",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]})]}),(0,Go.jsx)(tt,{value:g.description||"",onChange:lt=>f({...g,description:lt.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("label",{className:"text-Go text-muted-foreground",children:"Confidence"}),(0,Go.jsxs)("select",{value:g.confidence||H.confidence,onChange:lt=>f({...g,confidence:lt.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-Go ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Go.jsx)("option",{value:"low",children:"Low"}),(0,Go.jsx)("option",{value:"medium",children:"Medium"}),(0,Go.jsx)("option",{value:"high",children:"High"})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)("label",{className:"text-Go text-muted-foreground",children:"Phase"}),(0,Go.jsx)("select",{value:g.phase?.toString()||H.phase.toString(),onChange:lt=>f({...g,phase:parseInt(lt.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-Go ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(lt=>(0,Go.jsxs)("option",{value:lt.toString(),children:["Phase ",lt]},lt))})]})]})]}):(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Go.jsx)("div",{className:`w-4 h-4 rounded-full ${H.color}`}),(0,Go.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:H.name}),(0,Go.jsxs)("div",{className:"flex gap-1",children:[(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>L(H),className:"p-1 h-8 w-8",children:(0,Go.jsx)(Dg.Edit2,{className:"h-3 w-3"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>yt(H.Go.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Go.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Go.jsxs)(Q,{className:`text-Go ${ae(H.confidence)}`,children:[H.confidence," confidence"]}),(0,Go.jsxs)(Q,{variant:"outline",className:"text-Go",children:["Phase ",H.phase]}),(0,Go.jsxs)(Q,{variant:"secondary",className:"text-Go bg-muted text-muted-foreground",children:[De.length," tasks"]}),(0,Go.jsxs)(Q,{variant:"secondary",className:"text-Go bg-muted text-muted-foreground",children:[ot," pts"]})]}),H.description&&(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:H.description}),(0,Go.jsxs)(h,{onClick:()=>{w(!0),S(H)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Go.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Go.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${m?"border-primary bg-primary/10":"border-border"}`,children:De.length===0?(0,Go.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Go.jsx)(Dg.Move,{className:"h-8 w-8 mb-2"}),(0,Go.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):De.map(lt=>(0,Go.jsx)($l,{task:lt,epic:H,onDragStart:j,onTaskClick:r,isCompact:!0},lt.Go))})})]},H.Go)})})})})]}),(0,Go.jsx)(Mn,{isOpen:y,onClose:()=>k(!1),onAddEpic:n}),(0,Go.jsx)(An,{isOpen:P,onClose:()=>w(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:M?.Go.toString()||"",sprints:a})]})};var i0=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,Yl.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},n=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Go.jsx)(Ye,{open:e,onOpenChange:n,children:(0,Go.jsxs)(rt,{className:"sm:max-w-md",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Sprint"})}),(0,Go.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",children:"Sprint Name *"}),(0,Go.jsx)(K,{Go:"name",value:o.name,onChange:s=>r(l=>({...l,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:o.description,onChange:s=>r(l=>({...l,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"Start Date *"}),(0,Go.jsxs)(Fi,{children:[(0,Go.jsx)(zi,{asChild:!0,children:(0,Go.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Go.jsx)(Dg.CalendarIcon,{className:"Dg-2 h-4 w-4"}),o.startDate?(0,Ep.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Go.jsx)(ri,{className:"w-auto p-0",align:"start",children:(0,Go.jsx)(ji,{mode:"single",selected:o.startDate,onSelect:s=>r(l=>({...l,startDate:s})),initialFocus:!0})})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{children:"End Date *"}),(0,Go.jsxs)(Fi,{children:[(0,Go.jsx)(zi,{asChild:!0,children:(0,Go.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Go.jsx)(Dg.CalendarIcon,{className:"Dg-2 h-4 w-4"}),o.endDate?(0,Ep.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Go.jsx)(ri,{className:"w-auto p-0",align:"start",children:(0,Go.jsx)(ji,{mode:"single",selected:o.endDate,onSelect:s=>r(l=>({...l,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3 Go-4",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Jc=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:i,onUpdateSprint:n,onDeleteSprint:s})=>{let[l,c]=(0,$a.useState)([]),[d,m]=(0,$a.useState)(new Set),[u,v]=(0,$a.useState)(null),[b,g]=(0,$a.useState)(!1),[f,C]=(0,$a.useState)(null),[R,y]=(0,$a.useState)(null),[k,P]=(0,$a.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[w,M]=(0,$a.useState)([]),[S,F]=(0,$a.useState)("upcoming"),[$,j]=(0,$a.useState)(!1),[x,ge]=(0,$a.useState)(0),I=(0,$a.useRef)(null),L=(0,$a.useRef)(null);(0,$a.useEffect)(()=>{let T=()=>{I.current&&ge(I.current.offsetHeight)};T();let O=new ResizeObserver(T);return I.current&&O.observe(I.current),()=>O.disconnect()},[]);let X=T=>t.find(O=>O.Go===Number(T)),ke=T=>a.find(O=>O.Go===Number(T)),yt=T=>{let O={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return O[T]||O.medium},Tt=T=>{if(!T||T?.length===0)return"";let O=T?.trim().split(" ");if(O?.length===1)return O[0];let xe=O[0],nt=O[O.length-1][0].toUpperCase();return`${xe} ${nt}`},ae=T=>{let O={},xe=[];return T.forEach(nt=>{nt.epic?(O[va(nt.epic)]||(O[va(nt.epic)]=[]),O[va(nt.epic)].push(nt)):xe.push(nt)}),{tasksByEpic:O,unassignedTasks:xe}};(0,$a.useEffect)(()=>{M(a)},[a]);let H=w.filter(T=>{switch(S){default:return!0}}),De=w.filter(T=>l.includes(T.Go.toString())),ot=e.filter(T=>!T.sprint||T.status==="backlog"),oo=ot.reduce((T,O)=>T+(O.storyPoints||0),0),lt=T=>{c(O=>O.includes(T)?O.filter(xe=>xe!==T):O?.length<3?[...O,T]:O)},na=T=>{m(O=>{let xe=new Set(O);return xe.has(T)?xe.delete(T):xe.add(T),xe})},G=T=>{i(T),g(!1)},Ut=T=>{y(T.Go.toString()),P({name:T.name,description:T.description||"",startDate:T.startDate?new Date(T.startDate).toISOString().split("T")[0]:T.startDate,endDate:T.endDate?new Date(T.endDate).toISOString().split("T")[0]:T.endDate,isActive:!1})},ho=()=>{R&&(n(R,{name:k.name,description:k.description,startDate:k.startDate,endDate:k.endDate}),M(T=>T.map(O=>(O.Go===Number(R)&&(O.name=k.name,O.description=k.description,O.startDate=k.startDate,O.endDate=k.endDate),O))),y(null))},yo=()=>{y(null),P({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ko=(T,O)=>{v(O),T.dataTransfer.effectAllowed="move"},Ti=T=>{T.preventDefault(),T.dataTransfer.dropEffect="move"},Ir=T=>{C(T)},Pi=()=>{C(null)},Ri=(T,O)=>{if(T.preventDefault(),C(null),!u)return;(va(u.sprint)||void 0)!==Number(O)&&o(u.Go.toString(),{sprint:Number(O)}),v(null)},q=({task:T,showSprint:O=!1})=>{let xe=T.epic?X(va(T.epic).toString()):null,nt=T.sprint?ke(va(T.sprint).toString()):null;return(0,Go.jsx)(z,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:ft=>{ft.dataTransfer.effectAllowed="move",ft.dataTransfer.setData("text/plain",T.Go.toString()),Ko(ft,T)},onClick:ft=>{u===null&&r(T)},style:{userSelect:"none"},children:(0,Go.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Go.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:T.name}),(0,Go.jsx)(Q,{className:`text-Go ${yt(T.priority||"medium")}`,children:T.priority?.[0]?.toUpperCase()})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-Go",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-1",children:[xe&&(0,Go.jsx)("div",{className:`w-2 h-2 rounded-full ${xe.color}`}),(0,Go.jsx)("span",{className:"text-muted-foreground truncate",children:xe?.name})]}),(0,Go.jsx)("span",{className:"text-muted-foreground",children:Tt(T.assignee?.value?.name)})]}),O&&nt&&(0,Go.jsxs)("div",{className:"flex items-center gap-1 text-Go text-muted-foreground",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),(0,Go.jsx)("span",{children:nt.name})]})]})})};return(0,Go.jsxs)("div",{ref:L,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Go.jsx)("div",{ref:I,className:"flex-shrink-0",children:(0,Go.jsx)(Xt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Yl-r from-orange-600 via-amber-600 Yl-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>g(!0)}})}),(0,Go.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Go.jsxs)("div",{className:"h-full",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:[(0,Go.jsxs)("div",{className:"mb-4",children:[(0,Go.jsx)(z,{className:"p-3 bg-card shadow-sm",children:(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Go.jsxs)("p",{className:"text-Go text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)("span",{className:"text-Go text-muted-foreground",children:"Viewing:"}),(0,Go.jsx)("div",{className:"flex flex-wrap gap-1",children:De.map(T=>(0,Go.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-Go",children:[(0,Go.jsx)("span",{className:"max-w-[80px] truncate",children:T.name}),(0,Go.jsx)("button",{onClick:()=>lt(T.Go.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]},T.Go))})]})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsxs)(h,{onClick:()=>g(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Go.jsx)(Dg.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Go.jsxs)(h,{onClick:()=>j(!$),variant:"outline",size:"sm",className:"gap-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-3 w-3"}),$?"Close":"Select"]})]})]})}),$&&(0,Go.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>j(!1)}),(0,Go.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${$?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Go.jsxs)(z,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Go.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Go.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"h-8 w-8 p-0",children:(0,Go.jsx)(Dg.X,{className:"h-4 w-4"})})]}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up Yl 3 sprints Yl view in your planning board"})]}),(0,Go.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Go.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(T=>(0,Go.jsxs)(h,{variant:S===T.key?"default":"outline",size:"sm",onClick:()=>F(T.key),className:"text-Go h-8 px-3 flex-1",children:[T.label," (",T.count,")"]},T.key))}),(0,Go.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:H.length>0?H.map(T=>{let O=l.includes(T.Go.toString()),xe=e.filter(Ce=>va(Ce.sprint)===T.Go).length,nt=!O&&l.length<3;return(0,Go.jsx)("div",{className:`p-3 rounded-lg border transition-all ${O?"bg-primary/10 border-primary/30":nt?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:R===T.Go.toString()?(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsx)(K,{value:k.name,onChange:Ce=>P(We=>({...We,name:Ce.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Go.jsx)(tt,{value:k.description,onChange:Ce=>P(We=>({...We,description:Ce.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Go.jsxs)("div",{className:"flex gap-2",children:[(0,Go.jsxs)(h,{size:"sm",onClick:()=>ho(),className:"flex-1",children:[(0,Go.jsx)(Dg.Check,{className:"h-3 w-3 Dg-1"}),"Save"]}),(0,Go.jsxs)(h,{size:"sm",variant:"outline",onClick:yo,className:"flex-1",children:[(0,Go.jsx)(Dg.X,{className:"h-3 w-3 Dg-1"}),"Cancel"]})]})]}):(0,Go.jsxs)("div",{children:[(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Go.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:T.name}),(0,Go.jsx)(Q,{variant:"default",className:"text-Go bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground line-clamp-2 mb-2",children:T.description}),(0,Go.jsxs)("div",{className:"flex items-center gap-3 text-Go text-muted-foreground",children:[(0,Go.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.CalendarDays,{className:"h-3 w-3"}),new Date(T.startDate).toLocaleDateString()]}),(0,Go.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Go.jsx)(Dg.User,{className:"h-3 w-3"}),xe," tasks"]})]})]}),(0,Go.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>Ut(T),className:"h-6 w-6 p-0",children:(0,Go.jsx)(Dg.Edit2,{className:"h-3 w-3"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>s(T.Go.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Go.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Go.jsx)(h,{variant:O?"default":"outline",size:"sm",className:"text-Go w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>lt(T.Go.toString()),disabled:!O&&l?.length>=3,children:(0,Go.jsx)("span",{className:"pointer-events-none select-none",children:O?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},T.Go)}):(0,Go.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Go.jsxs)("p",{className:"text-sm",children:['No sprints found for "',S,'" filter']}),(0,Go.jsx)(h,{variant:"link",size:"sm",onClick:()=>F("all"),className:"text-Go",children:"Show all sprints"})]})}),l?.length===0&&(0,Go.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Go.jsxs)("div",{className:"text-center",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints Yl start planning"}),(0,Go.jsx)("p",{className:"text-Go text-muted-foreground mt-1",children:"Choose up Yl 3 sprints Yl view alongside your backlog"})]})})]})]})})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Go.jsx)("div",{className:"lg:col-span-1",children:(0,Go.jsxs)(z,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Ti,onDragEnter:()=>Ir("backlog"),onDragLeave:Pi,onDrop:T=>Ri(T,"backlog"),style:{height:x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 16rem)"},children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Go.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsxs)(Q,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[ot?.length," tasks"]}),(0,Go.jsxs)(Q,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[oo," pts"]})]})]}),(0,Go.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${f==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:T,unassignedTasks:O}=ae(ot);return(0,Go.jsxs)(Go.Fragment,{children:[Object.entries(T).map(([xe,nt])=>{let Ce=X(xe);if(!Ce)return null;let We=d.has(xe);return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na(xe),children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${Ce.color}`}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:Ce.name}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",nt?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:We?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!We&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:nt.map(ft=>(0,Go.jsx)(q,{task:ft},ft.Go))})]},xe)}),O?.length>0&&(()=>{let xe=d.has("Go-epic");return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na("Go-epic"),children:[(0,Go.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",O?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:xe?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!xe&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:O?.map(nt=>(0,Go.jsx)(q,{task:nt},nt.Go))})]})})(),ot?.length===0&&(0,Go.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Yl move Yl backlog"}),ot?.length>0&&Object.keys(T).length===0&&O.length===0&&(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)("div",{className:"text-Go text-muted-foreground mb-2",children:"Direct backlog tasks:"}),ot?.map(xe=>(0,Go.jsx)(q,{task:xe},xe.Go))]})]})})()})]})}),De.map(T=>{let O=e.filter(nt=>va(nt?.sprint)===T.Go),xe=O.reduce((nt,Ce)=>nt+(Ce?.storyPoints||0),0);return(0,Go.jsxs)(z,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Ti,onDragEnter:()=>Ir(T.Go.toString()),onDragLeave:Pi,onDrop:nt=>Ri(nt,T.Go.toString()),style:{height:x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 16rem)"},children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Go.jsx)("div",{children:(0,Go.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:T.name})}),(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsxs)(Q,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[O?.length," tasks"]}),(0,Go.jsxs)(Q,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[xe," pts"]}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>{j(!0),Ut(T)},className:"h-6 px-2",children:(0,Go.jsx)(Dg.Edit2,{className:"h-3 w-3"})}),(0,Go.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>s(T.Go.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Go.jsx)(Dg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Go.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:nt,unassignedTasks:Ce}=ae(O);return(0,Go.jsxs)(Go.Fragment,{children:[Object.entries(nt).map(([We,ft])=>{let Ai=X(We);if(!Ai)return null;let Mr=d.has(We);return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na(We),children:[(0,Go.jsx)("div",{className:`w-3 h-3 rounded-full ${Ai.color}`}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:Ai.name}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",ft?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:Mr?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Mr&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:ft?.map(ns=>(0,Go.jsx)(q,{task:ns},ns.Go))})]},We)}),Ce?.length>0&&(()=>{let We=d.has("Go-epic");return(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Go cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>na("Go-epic"),children:[(0,Go.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Go.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Go.jsxs)("span",{className:"text-muted-foreground",children:["(",Ce?.length,")"]}),(0,Go.jsx)("div",{className:"ml-auto",children:We?(0,Go.jsx)(Dg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Go.jsx)(Dg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!We&&(0,Go.jsx)("div",{className:"space-y-2 pl-2",children:Ce?.map(ft=>(0,Go.jsx)(q,{task:ft},ft.Go))})]})})(),O?.length===0&&(0,Go.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},T.Go)})]}),(0,Go.jsx)(i0,{isOpen:b,onClose:()=>g(!1),onAddSprint:G})]})})]})};var lN=e=>e.toLocaleDateString("Go-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),dN=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("Go-US",{hour:"numeric",minute:"2-digit",hour12:!0})},ju=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,i]=t.split(":");o.setHours(parseInt(r),parseInt(i))}return o<a},Uu=e=>{let t=new Date;return e.toDateString()===t.toDateString()},cN=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},mN=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,i]=(0,Yl.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[n,s]=(0,Yl.useState)(!1),l=d=>{if(d.preventDefault(),!e.find(v=>v?.Go.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let u={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Yl.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let c=e.filter(Boolean);return(0,Go.jsx)(Ye,{open:a,onOpenChange:o,children:(0,Go.jsxs)(rt,{className:"max-w-2xl",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Add New Reminder"})}),(0,Go.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Go.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"title",children:"Title"}),(0,Go.jsx)(K,{Go:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"description",children:"Description"}),(0,Go.jsx)(tt,{Go:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"dueDate",children:"Due Date"}),(0,Go.jsx)(K,{Go:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Go.jsx)(K,{Go:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{className:`${n?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Go.jsxs)(it,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Go.jsx)(Qe,{className:`${n?"text-destructive border-red-500":""}`,children:(0,Go.jsx)(vt,{className:`${n?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.Go.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Go.jsx)(et,{children:c.map(d=>(0,Go.jsx)(he,{value:d.Go.toString(),children:d.name},d.Go))})]}),n&&(0,Go.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)("input",{type:"checkbox",Go:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Go.jsx)(A,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Go.jsxs)(it,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Go.jsx)(Qe,{children:(0,Go.jsx)(vt,{})}),(0,Go.jsxs)(et,{children:[(0,Go.jsx)(he,{value:"daily",children:"Daily"}),(0,Go.jsx)(he,{value:"weekly",children:"Weekly"}),(0,Go.jsx)(he,{value:"monthly",children:"Monthly"}),(0,Go.jsx)(he,{value:"yearly",children:"Yearly"})]})]})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Go.jsx)(K,{Go:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",children:"Add Reminder"})]})]})]})})},pN=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[i,n]=(0,Yl.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=c=>{c.preventDefault(),a(e.Go.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},l=t.filter(Boolean);return(0,Go.jsx)(Ye,{open:o,onOpenChange:r,children:(0,Go.jsxs)(rt,{className:"max-w-2xl",children:[(0,Go.jsx)(ct,{children:(0,Go.jsx)(mt,{children:"Edit Reminder"})}),(0,Go.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Go.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-title",children:"Title"}),(0,Go.jsx)(K,{Go:"edit-title",value:i.title,onChange:c=>n({...i,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-description",children:"Description"}),(0,Go.jsx)(tt,{Go:"edit-description",value:i.description||"",onChange:c=>n({...i,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Go.jsx)(K,{Go:"edit-dueDate",type:"date",value:i.dueDate,onChange:c=>n({...i,dueDate:c.target.value}),required:!0})]}),(0,Go.jsxs)("div",{children:[(0,Go.jsx)(A,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Go.jsx)(K,{Go:"edit-dueTime",type:"time",value:i.dueTime,onChange:c=>n({...i,dueTime:c.target.value})})]})]}),(0,Go.jsx)("div",{className:"space-y-2",children:(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)("input",{type:"checkbox",Go:"edit-isRecurring",checked:i.isRecurring||!1,onChange:c=>n({...i,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,Go.jsx)(A,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Go.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Go.jsx)(h,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Go.jsx)(h,{type:"submit",children:"Save Changes"})]})]})]})})},uN=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,i]=(0,Yl.useState)(!1);if(!e||!e.Go)return null;let n=ju(new Date(e.dueDate||""),e.dueTime||""),s=Uu(new Date(e.dueDate||"")),l=cN(new Date(e.dueDate||"")),c=()=>{a(e.Go.toString(),{})},d=()=>s?"Today":l?"Tomorrow":lN(new Date(e.dueDate||""));return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(pN,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>i(!1)}),(0,Go.jsx)(z,{children:(0,Go.jsx)(J,{className:"p-4",children:(0,Go.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Go.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Go.jsx)("button",{onClick:c,className:"mt-1 text-primary hover:text-primary/80"}),(0,Go.jsxs)("div",{className:"flex-1",children:[(0,Go.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Go.jsx)("h3",{children:e.title})}),(0,Go.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Go.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(Dg.Calendar,{className:"h-4 w-4"}),(0,Go.jsx)("span",{className:n?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(Dg.Clock,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:dN(e.dueTime)})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(Dg.User,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Go.jsx)(Dg.Edit2,{className:"h-4 w-4"})}),(0,Go.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>o(e.Go.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Go.jsx)(Dg.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Vu=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[i,n]=(0,Yl.useState)(e.filter(Boolean)),[s,l]=(0,Yl.useState)(t.filter(Boolean)),[c,d]=(0,Yl.useState)("all"),[m,u]=(0,Yl.useState)(""),[v,b]=(0,Yl.useState)(!1);(0,Yl.useEffect)(()=>{n(e.filter(Boolean))},[e]),(0,Yl.useEffect)(()=>{l(t.filter(Boolean))},[t]);let g=w=>{if(!w.title){console.error("Invalid reminder data:",w);return}let M={...w,Go:Date.now(),createdAt:new Date().toISOString()};n(S=>[...S,M]),a?.(w)},f=(w,M)=>{if(!w){console.error("No reminder ID provided for update");return}n(S=>S.map(F=>F?.Go.toString()===w?{...F,...M}:F)),o?.(w,M)},C=w=>{if(!w){console.error("No reminder ID provided for deletion");return}n(M=>M.filter(S=>S?.Go.toString()!==w)),r?.(w)},y=i.filter(w=>{if(!w)return!1;if(m){let M=m.toLowerCase();if(!(w.title.toLowerCase().includes(M)||w.description?.toLowerCase().includes(M)))return!1}switch(c){case"pending":case"completed":case"overdue":return ju(new Date(w.dueDate||""),w.dueTime||"");case"today":return Uu(new Date(w.dueDate||""));default:return!0}}).sort((w,M)=>{if(!w||!M)return 0;let S={high:3,medium:2,low:1},F=0;return F!==0?F:new Date(w.dueDate||"").getTime()-new Date(M.dueDate||"").getTime()}),k={total:i.filter(Boolean).length,overdue:i.filter(w=>w&&ju(new Date(w.dueDate||""),w.dueTime||"")).length,today:i.filter(w=>w&&Uu(new Date(w.dueDate||""))).length},P=s.find(Boolean)||{Go:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(Xt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Yl-r from-emerald-600 via-teal-600 Yl-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,Go.jsxs)("div",{className:"h-full bg-background",children:[(0,Go.jsx)(mN,{colleagues:s,onAddReminder:g,open:v,setOpen:b}),(0,Go.jsxs)("div",{className:"p-6",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Go.jsxs)("div",{children:[(0,Go.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Go.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Go.jsxs)(h,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),(0,Go.jsx)("span",{children:"Add Reminder"})]})]}),(0,Go.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-foreground",children:k.total}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-primary",children:k.overdue}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-success",children:k.today}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-destructive",children:k.overdue}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Go.jsxs)(z,{className:"p-4",children:[(0,Go.jsx)("div",{className:"text-2xl font-bold text-warning",children:k.today}),(0,Go.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Go.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Go.jsx)("div",{className:"flex-1",children:(0,Go.jsx)(K,{placeholder:"Search reminders...",value:m,onChange:w=>u(w.target.value),className:"max-w-md"})}),(0,Go.jsxs)(it,{value:c,onValueChange:w=>d(w),children:[(0,Go.jsx)(Qe,{className:"w-40",children:(0,Go.jsx)(vt,{})}),(0,Go.jsxs)(et,{children:[(0,Go.jsxs)(he,{value:"all",children:["All (",k.total,")"]}),(0,Go.jsxs)(he,{value:"overdue",children:["Overdue (",k.overdue,")"]}),(0,Go.jsxs)(he,{value:"overdue",children:["Overdue (",k.overdue,")"]}),(0,Go.jsxs)(he,{value:"today",children:["Today (",k.today,")"]})]})]})]}),(0,Go.jsx)("div",{className:"space-y-4",children:y.length===0?(0,Go.jsxs)(z,{className:"p-8 text-center",children:[(0,Go.jsx)("div",{className:"text-muted-foreground",children:m||c!=="all"?"No reminders match your filters":"No reminders yet"}),!m&&c==="all"&&(0,Go.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder Yl get started"})]}):y.map(w=>w&&(0,Go.jsx)(uN,{reminder:w,colleagues:s,onUpdateReminder:f,onDeleteReminder:C},w.Go))})]})]})]})};function $u({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:n=[],initialUsers:s=[],initialFiles:l=[],initialView:c="kanban",onAddTask:d,onUpdateTask:m,onDeleteTask:u,onTaskClick:v,onAddEpic:b,onUpdateEpic:g,onDeleteEpic:f,onAddTaskToEpic:C,onAddSprint:R,onUpdateSprint:y,onDeleteSprint:k,onAddProject:P,onUpdateProject:w,onDeleteProject:M,onFileAdd:S,onFileEdit:F,onFileDelete:$,onFileClick:j,onAddReminder:x,onUpdateReminder:ge,onDeleteReminder:I,onViewChange:L,onToggleMobileMenu:X,onTeamClick:ke,onTeamChange:yt,onCopilotClick:Tt,handleAddComment:ae}){let[H,De]=(0,Yl.useState)(t),[ot,oo]=(0,Yl.useState)(a),[lt,na]=(0,Yl.useState)(o),[G,Ut]=(0,Yl.useState)(r),[ho,yo]=(0,Yl.useState)(i),[Ko,Ti]=(0,Yl.useState)(n),[Ir,Pi]=(0,Yl.useState)(s),[Ri,q]=(0,Yl.useState)(l),[T,O]=(0,Yl.useState)(!1),[xe,nt]=(0,Yl.useState)(!1),[Ce,We]=(0,Yl.useState)(null),[ft,Ai]=(0,Yl.useState)(null),[Mr,ns]=(0,Yl.useState)(null),[Xr,js]=(0,Yl.useState)(c||"kanban"),[fN,m0]=(0,Yl.useState)(!1),p0=(0,$f.useRouter)();(0,Yl.useEffect)(()=>{De(t)},[t]),(0,Yl.useEffect)(()=>{na(o)},[o]),(0,Yl.useEffect)(()=>{oo(a)},[a]),(0,Yl.useEffect)(()=>{Ut(r)},[r]),(0,Yl.useEffect)(()=>{q(l)},[l]),(0,Yl.useEffect)(()=>{Pi(s)},[s]),(0,Yl.useEffect)(()=>{Ti(n)},[n]),(0,Yl.useEffect)(()=>{yo(i)},[i]),(0,Yl.useEffect)(()=>{js(c)},[c]);let u0=H.filter(V=>{}),vN=V=>u0.filter(ve=>ve.status===V),bN=V=>{let ve={};return ot.forEach(Fe=>{}),ve},hN=V=>{ns(V)},yN=V=>{Mr&&(De(ve=>ve.map(Fe=>Fe.Go===Mr.Go?{...Fe,status:V}:Fe)),ns(null))},Xu=V=>{let ve={...V,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};De(Fe=>[...Fe,ve]),d?.(ve)},Gl=async(V,ve)=>(De(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),await m?.(V,ve)),xN=async(V,ve)=>{Gl(V,ve)},qu=V=>{De(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),Ce?.Go===Number(V)&&We(null),u?.(V)},wN=async V=>{qu(V)},NN=V=>{let ve={...V,Go:Date.now()};Ut(Fe=>[...Fe,ve]),P?.(V)},CN=(V,ve)=>{Ut(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),w?.(V,ve)},kN=V=>{Ut(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),M?.(V)},Ju=V=>{let ve={...V,Go:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};oo(Fe=>[...Fe,ve]),b?.({...ve})},g0=()=>{nt(!0)},f0=(V,ve)=>{oo(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),g?.(V,ve)},v0=V=>{oo(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),De(ve=>ve.filter(Fe=>va(Fe.epic)!==Number(V))),f?.(V)},b0=V=>{let ve={...V,Go:Date.now()};na(Fe=>[...Fe,ve]),R?.(V)},h0=(V,ve)=>{na(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),y?.(V,ve)},y0=V=>{V==="backlog"||V==="all-tasks"||(na(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),De(ve=>ve.map(Fe=>va(Fe.sprint)===Number(V)?{...Fe,sprint:void 0}:Fe)),k?.(V))},Qc=V=>{We(V)},x0=V=>{V==="planning"&&window.innerWidth<768||(js(V),L?.(V))},SN=()=>{m0(V=>!V),X?.()},DN=()=>{p0.push("/")},TN=V=>{console.log("Switching Yl team:",V)},PN=V=>{console.log("Switching Yl team:",V)},w0=V=>{O(!0)},N0=()=>{O(!1),Ai(null)},C0=V=>{let ve={...V,Go:Date.now(),createdAt:new Date().toISOString()};yo(Fe=>[...Fe,ve]),x?.(V)},k0=(V,ve)=>{yo(Fe=>Fe.map(Ia=>Ia.Go===Number(V)?{...Ia,...ve}:Ia)),ge?.(V,ve)},S0=V=>{yo(ve=>ve.filter(Fe=>Fe.Go!==Number(V))),I?.(V)},D0=()=>{S?.()},T0=V=>{F?.(V)},P0=V=>{q(ve=>ve.filter(Fe=>Fe.name!==V)),$?.(V)},R0=V=>{j?.(V)},RN=[{Go:"todo",title:"Go Go",status:"todo"},{Go:"in-progress",title:"Dg Progress",status:"in-progress"},{Go:"review",title:"Review",status:"review"},{Go:"done",title:"Done",status:"done"}],AN=()=>{switch(Xr){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},em=[{Go:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{Go:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{Go:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{Go:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{Go:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{Go:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],IN=em.sort((V,ve)=>ve.lastUsed.getTime()-V.lastUsed.getTime()).slice(0,3),MN=em.length>3,BN=em.slice(3);return(0,Go.jsxs)(Zh,{currentView:Xr,onViewChange:x0,children:[Xr==="kanban"&&(0,Go.jsx)("div",{className:"h-full overflow-hidden",children:(0,Go.jsx)(Fu,{initialProjects:G,initialEpics:ot,initialSprints:lt.map(V=>({...V,isSelected:!1})),initialTasks:H,initialColleagues:Ko,initialUsers:Ir,onAddTask:Xu,onUpdateTask:Gl,onDeleteTask:qu,onTaskClick:Qc,onAddEpic:Ju,onAddComment:ae})}),Xr==="planning"&&(0,Go.jsx)("div",{className:"hidden md:block h-full",children:(0,Go.jsx)(Jc,{tasks:H,epics:ot,sprints:lt,onUpdateTask:Gl,onTaskClick:Qc,onAddSprint:b0,onUpdateSprint:h0,onDeleteSprint:y0})}),Xr==="tasks"&&(0,Go.jsx)("div",{className:"h-full",children:(0,Go.jsx)(Vu,{initialReminders:ho,initialColleagues:Ko,onAddReminder:C0,onUpdateReminder:k0,onDeleteReminder:S0})}),Xr==="files"&&(0,Go.jsx)("div",{className:"h-full",children:(0,Go.jsx)(Vl,{initialFiles:Ri,onFileAdd:D0,onFileEdit:T0,onFileDelete:P0,onFileClick:R0,compactView:!1})}),Xr==="epics"&&(0,Go.jsx)("div",{className:"h-full",children:(0,Go.jsx)(zu,{tasks:H,epics:ot,sprints:lt,onUpdateTask:Gl,onTaskClick:Qc,onAddTaskToEpic:w0,onAddEpic:g0,onUpdateEpic:f0,onDeleteEpic:v0})}),(0,Go.jsx)(An,{isOpen:T,onClose:N0,onAddTask:Xu,epics:ot,sprints:lt,assignees:[...Ko,...Ir],defaultEpicId:ft||void 0}),(0,Go.jsx)(Mn,{isOpen:xe,onClose:()=>nt(!1),onAddEpic:Ju})]})}var n0=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[i,n]=(0,Yl.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,l]=(0,Yl.useState)({}),c=()=>{let u={};return i.name.trim()?i.name.trim().length<3&&(u.name="Project name must be Go least 3 characters"):u.name="Project name Dg required",i.objectives.trim()?i.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (Go least 10 characters)"):u.objectives="Project objectives are required",i.workInstructions.trim()?i.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (Go least 20 characters)"):u.workInstructions="Work instructions are required",l(u),Object.keys(u).length===0},d=async u=>{if(u.preventDefault(),!!c())try{await e(i)}catch(v){console.error("Error submitting project form:",v)}},m=(u,v)=>{n(b=>({...b,[u]:v})),s[u]&&l(b=>({...b,[u]:void 0}))};return(0,Go.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,Go.jsxs)("div",{className:"mb-4",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Go.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions Yl help your team collaborate effectively."})]}),(0,Go.jsxs)("form",{onSubmit:d,children:[(0,Go.jsxs)("div",{className:"space-y-6",children:[(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Go.jsx)(K,{Go:"name",type:"text",placeholder:"Enter project name",value:i.name,onChange:u=>m("name",u.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,Go.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Go.jsx)(K,{Go:"description",type:"text",placeholder:"Enter project description",value:i.description,onChange:u=>m("description",u.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,Go.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Go.jsx)(tt,{Go:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:i.objectives,onChange:u=>m("objectives",u.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Go.jsxs)("div",{className:"flex justify-between text-Go text-gray-500",children:[(0,Go.jsx)("span",{children:s.objectives&&(0,Go.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Go.jsxs)("span",{children:[i.objectives.length,"/1000"]})]})]}),(0,Go.jsxs)("div",{className:"space-y-2",children:[(0,Go.jsx)(A,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Go.jsx)(tt,{Go:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:i.workInstructions,onChange:u=>m("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Go.jsxs)("div",{className:"flex justify-between text-Go text-gray-500",children:[(0,Go.jsx)("span",{children:s.workInstructions&&(0,Go.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Go.jsxs)("span",{children:[i.workInstructions.length,"/2000"]})]})]}),(0,Go.jsxs)("div",{className:"space-y-3",children:[(0,Go.jsx)(A,{className:"text-sm font-medium",children:"Project Management"}),(0,Go.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Go.jsx)(Ka,{Go:"plan",checked:i.plan,onCheckedChange:u=>m("plan",u===!0),disabled:a}),(0,Go.jsx)(A,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Go.jsx)("p",{className:"text-Go text-gray-500 ml-6",children:"This will allow project managers Yl create sprints, assign tasks, and track progress."})]})]}),(0,Go.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Go.jsxs)(h,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Go.jsx)(h,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Dg.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function _u({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,i]=(0,Yl.useState)(!1),[n,s]=(0,Yl.useState)(!1),l=async d=>{s(!0);try{await t(d),i(!1)}catch(m){console.error("Error creating project:",m)}finally{s(!1)}},c=()=>{i(!0)};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsx)(Xt,{title:"Project Management",description:"Organize your work into projects Yl collaborate with your team.",gradient:"bg-gradient-Yl-r from-purple-600 via-violet-600 Yl-indigo-600",primaryAction:{label:"New Project",onClick:c}}),(0,Go.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Go.jsx)(Sn,{project:d,onOpen:a,onShare:o},d.Go))})]})]},"projects-index-view")}),(0,Go.jsx)(Ye,{open:r,onOpenChange:i,children:(0,Go.jsxs)(rt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Go.jsxs)(ct,{className:"Go-only",children:[(0,Go.jsx)(mt,{children:"Create New Project"}),(0,Go.jsx)(vs,{children:"Fill out the form below Yl create a new project."})]}),(0,Go.jsx)(n0,{onSubmit:l,onCancel:()=>i(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function d0({team:e,onOpen:t,className:a}){return(0,Go.jsx)(on.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Go.jsxs)(z,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Go.jsxs)(be,{children:[(0,Go.jsx)(we,{className:"text-lg",children:e.name}),(0,Go.jsx)(So,{className:"mt-1 text-sm",children:e.description})]}),(0,Go.jsxs)(J,{className:"space-y-4",children:[(0,Go.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Users,{className:"h-4 w-4 text-blue-500"}),(0,Go.jsx)("span",{children:"Human"})]}),(0,Go.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Go.jsx)("span",{children:"Digital"})]}),(0,Go.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Go.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Go-4",children:[(0,Go.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Go.jsx)(Dg.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Go.jsx)("span",{children:"Projects"})]}),(0,Go.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Go.jsx)(qo,{className:"flex gap-2",children:(0,Go.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Wu({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,Yl.useState)(!1),i=()=>{r(!0)},n=async c=>{await t?.(c),r(!1)},s=()=>{r(!1)},l=c=>{a?.(c)};return(0,Go.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Go.jsx)(on.AnimatePresence,{mode:"wait",children:(0,Go.jsxs)(on.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Go.jsx)(Xt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Yl-r from-blue-600 via-cyan-600 Yl-teal-600",primaryAction:{label:"Create Team",onClick:i}}),(0,Go.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Go.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Go.jsxs)("div",{className:"text-center py-12",children:[(0,Go.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Go not part of any teams yet."}),(0,Go.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team Go ask Yl be added Yl Dg existing one."})]}):(0,Go.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,Go.jsx)(d0,{team:c,onOpen:l},c.Go))})]})]},"teams-index-view")}),(0,Go.jsx)(Ye,{open:o,onOpenChange:r,children:(0,Go.jsxs)(rt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,Go.jsx)("div",{className:"Go-only",children:(0,Go.jsxs)(ct,{children:[(0,Go.jsx)(mt,{children:"Create New Team"}),(0,Go.jsx)(vs,{children:"Set up a new team Yl collaborate with colleagues on projects."})]})}),(0,Go.jsx)(Bc,{title:"Create New Team",submitLabel:"Create Team",onSave:n,onCancel:s})]})})]})}0&&(module.exports={Alert,AlertDescription,AlertTitle,AppHeader,AppSidebar,AppSidebarLeft,ApprovalRequestModal,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,CardContent,CardDescription,CardFooter,CardHeader,CardTitle,Categories,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,Checkbox,CodeBlock,Collapsible,CollapsibleContent,CollapsibleTrigger,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,CollectionArchive,Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut,CommentSection,Container,ContentBlock,ContentCard,CopilotInterface,CopyButton,CustomLink,CustomerCard,DCProjectCard,DarkTop,DashboardHeader,DashboardHero,DashboardPage,DealCard,DealDetails,DeliveryLeadSubmission,DeliveryLeadSubmissionList,DeliveryLeadSubmissionWithList,Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger,DynamicIcon,EditableField,EpicsView,EventCard,FeatureCard,FeatureGrid,FeaturesBlock,FileView,Filter,FlowPrintable,Footer,FoundaryLayout,Header,HeaderDesktop,HeaderMobile,HeadingImage,Hero,HighImpactHero,HolidayGrid,HolidayTracker,HoverCard,HoverCardContent,HoverCardTrigger,Image,ImageBlock,InfoTile,Input,Insight,KanbanBoardView,KanbanColumn,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,Label,LandingMenu,LightTop,Login,Logo,LowImpactHero,MOTD,MainPage,ManagementSidebar,Mask,Media,MediaBlock,MediumImpactHero,NavigationTabs,NewCustomerForm,NewDealForm,NewsGrid,NotificationsPanel,OAuthModal,OrgChart,PagePrintable,PageRange,PageShape,Pagination,PayloadCard,PayloadPagination,PlanningView,Popover,PopoverAnchor,PopoverContent,PopoverTrigger,PostHero,PricingCard,Printable,ProjectCard,ProjectTeam,ProjectView,ProjectsIndexView,ProposalSummary,RelatedContent,RelatedPagesMenu,RelatedPosts,RenderBlocks,RenderBlocksWithShapes,RenderHero,RequestLeave,ReusableContentBlock,RichText,ScrollArea,ScrollBar,SearchableSelect,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,TasksView,TeamForm,TeamsIndexView,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});
|